@wyltils/ems-editor 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +9756 -8414
- package/dist/index.umd.js +66 -34
- package/dist/style.css +1 -1
- package/package.json +5 -3
package/dist/index.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(ot,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("element-plus"),require("pinia"),require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","pinia","monaco-editor"],g):(ot=typeof globalThis<"u"?globalThis:ot||self,g(ot.EmsEditor={},ot.Vue,ot.ElementPlus,ot.Pinia,ot.monaco))})(this,function(ot,g,Xt,ge,wd){"use strict";function Ad(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>s[e]})}}return t.default=s,Object.freeze(t)}const xd=Ad(wd);/*! Element Plus Icons Vue v2.3.2 */var vd=g.defineComponent({name:"Document",__name:"document",setup(s){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),Pr=vd,Ed=g.defineComponent({name:"FolderOpened",__name:"folder-opened",setup(s){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"})]))}}),Sd=Ed,Md=g.defineComponent({name:"Folder",__name:"folder",setup(s){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32"})]))}}),Bd=Md,kd=g.defineComponent({name:"Menu",__name:"menu",setup(s){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),Id=kd,Td=g.defineComponent({name:"Plus",__name:"plus",setup(s){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Pd=Td,Od=g.defineComponent({name:"Search",__name:"search",setup(s){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),Or=Od;function V(s,t){var e={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&t.indexOf(n)<0&&(e[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(s);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(s,n[i])&&(e[n[i]]=s[n[i]]);return e}function H(s,t,e,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,n);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(i<3?r(o):i>3?r(t,e,o):r(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o}function Qs(s,t,e,n){function i(o){return o instanceof e?o:new e(function(r){r(o)})}return new(e||(e=Promise))(function(o,r){function a(h){try{c(n.next(h))}catch(u){r(u)}}function l(h){try{c(n.throw(h))}catch(u){r(u)}}function c(h){h.done?o(h.value):i(h.value).then(a,l)}c((n=n.apply(s,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function Nd(s){s.forEach(t=>{Object.hasOwn(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){const n=document.createDocumentFragment();e.forEach(i=>{const o=i instanceof Node;n.appendChild(o?i:document.createTextNode(String(i)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&(s=>{Nd(s)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var Nr=typeof global=="object"&&global&&global.Object===Object&&global,Rd=typeof self=="object"&&self&&self.Object===Object&&self,$t=Nr||Rd||Function("return this")(),Jt=$t.Symbol,Rr=Object.prototype,Dd=Rr.hasOwnProperty,Qd=Rr.toString,Pn=Jt?Jt.toStringTag:void 0;function Ld(s){var t=Dd.call(s,Pn),e=s[Pn];try{s[Pn]=void 0;var n=!0}catch{}var i=Qd.call(s);return n&&(t?s[Pn]=e:delete s[Pn]),i}var zd=Object.prototype,Fd=zd.toString;function Ud(s){return Fd.call(s)}var Vd="[object Null]",Kd="[object Undefined]",Dr=Jt?Jt.toStringTag:void 0;function Se(s){return s==null?s===void 0?Kd:Vd:Dr&&Dr in Object(s)?Ld(s):Ud(s)}function Zt(s){return s!=null&&typeof s=="object"}var Jd="[object Symbol]";function ae(s){return typeof s=="symbol"||Zt(s)&&Se(s)==Jd}function Bi(s,t){for(var e=-1,n=s==null?0:s.length,i=Array(n);++e<n;)i[e]=t(s[e],e,s);return i}var St=Array.isArray,Qr=Jt?Jt.prototype:void 0,Lr=Qr?Qr.toString:void 0;function zr(s){if(typeof s=="string")return s;if(St(s))return Bi(s,zr)+"";if(ae(s))return Lr?Lr.call(s):"";var t=s+"";return t=="0"&&1/s==-1/0?"-0":t}var jd=/\s/;function Gd(s){for(var t=s.length;t--&&jd.test(s.charAt(t)););return t}var Yd=/^\s+/;function Hd(s){return s&&s.slice(0,Gd(s)+1).replace(Yd,"")}function ht(s){var t=typeof s;return s!=null&&(t=="object"||t=="function")}var Fr=NaN,_d=/^[-+]0x[0-9a-f]+$/i,Wd=/^0b[01]+$/i,qd=/^0o[0-7]+$/i,Xd=parseInt;function On(s){if(typeof s=="number")return s;if(ae(s))return Fr;if(ht(s)){var t=typeof s.valueOf=="function"?s.valueOf():s;s=ht(t)?t+"":t}if(typeof s!="string")return s===0?s:+s;s=Hd(s);var e=Wd.test(s);return e||qd.test(s)?Xd(s.slice(2),e?2:8):_d.test(s)?Fr:+s}function Xe(s){return s}var $d="[object AsyncFunction]",Zd="[object Function]",tg="[object GeneratorFunction]",eg="[object Proxy]";function Ls(s){if(!ht(s))return!1;var t=Se(s);return t==Zd||t==tg||t==$d||t==eg}var zs=$t["__core-js_shared__"],Ur=function(){var s=/[^.]+$/.exec(zs&&zs.keys&&zs.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}();function ng(s){return!!Ur&&Ur in s}var ig=Function.prototype,sg=ig.toString;function ze(s){if(s!=null){try{return sg.call(s)}catch{}try{return s+""}catch{}}return""}var og=/[\\^$.*+?()[\]{}|]/g,rg=/^\[object .+?Constructor\]$/,ag=Function.prototype,lg=Object.prototype,cg=ag.toString,hg=lg.hasOwnProperty,ug=RegExp("^"+cg.call(hg).replace(og,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dg(s){if(!ht(s)||ng(s))return!1;var t=Ls(s)?ug:rg;return t.test(ze(s))}function gg(s,t){return s==null?void 0:s[t]}function Fe(s,t){var e=gg(s,t);return dg(e)?e:void 0}var Fs=Fe($t,"WeakMap"),Vr=Object.create,fg=function(){function s(){}return function(t){if(!ht(t))return{};if(Vr)return Vr(t);s.prototype=t;var e=new s;return s.prototype=void 0,e}}();function Kr(s,t,e){switch(e.length){case 0:return s.call(t);case 1:return s.call(t,e[0]);case 2:return s.call(t,e[0],e[1]);case 3:return s.call(t,e[0],e[1],e[2])}return s.apply(t,e)}function pg(){}function Jr(s,t){var e=-1,n=s.length;for(t||(t=Array(n));++e<n;)t[e]=s[e];return t}var mg=800,bg=16,yg=Date.now;function Cg(s){var t=0,e=0;return function(){var n=yg(),i=bg-(n-e);if(e=n,i>0){if(++t>=mg)return arguments[0]}else t=0;return s.apply(void 0,arguments)}}function wg(s){return function(){return s}}var ki=function(){try{var s=Fe(Object,"defineProperty");return s({},"",{}),s}catch{}}(),Ag=ki?function(s,t){return ki(s,"toString",{configurable:!0,enumerable:!1,value:wg(t),writable:!0})}:Xe,jr=Cg(Ag);function xg(s,t){for(var e=-1,n=s==null?0:s.length;++e<n&&t(s[e],e,s)!==!1;);return s}function vg(s,t,e,n){for(var i=s.length,o=e+-1;++o<i;)if(t(s[o],o,s))return o;return-1}function Eg(s){return s!==s}function Sg(s,t,e){for(var n=e-1,i=s.length;++n<i;)if(s[n]===t)return n;return-1}function Mg(s,t,e){return t===t?Sg(s,t,e):vg(s,Eg,e)}function Gr(s,t){var e=s==null?0:s.length;return!!e&&Mg(s,t,0)>-1}var Bg=9007199254740991,kg=/^(?:0|[1-9]\d*)$/;function Ii(s,t){var e=typeof s;return t=t??Bg,!!t&&(e=="number"||e!="symbol"&&kg.test(s))&&s>-1&&s%1==0&&s<t}function Ti(s,t,e){t=="__proto__"&&ki?ki(s,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):s[t]=e}function $e(s,t){return s===t||s!==s&&t!==t}var Ig=Object.prototype,Tg=Ig.hasOwnProperty;function Us(s,t,e){var n=s[t];(!(Tg.call(s,t)&&$e(n,e))||e===void 0&&!(t in s))&&Ti(s,t,e)}function Nn(s,t,e,n){var i=!e;e||(e={});for(var o=-1,r=t.length;++o<r;){var a=t[o],l=void 0;l===void 0&&(l=s[a]),i?Ti(e,a,l):Us(e,a,l)}return e}var Yr=Math.max;function Hr(s,t,e){return t=Yr(t===void 0?s.length-1:t,0),function(){for(var n=arguments,i=-1,o=Yr(n.length-t,0),r=Array(o);++i<o;)r[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=e(r),Kr(s,this,a)}}function Ze(s,t){return jr(Hr(s,t,Xe),s+"")}var Pg=9007199254740991;function Vs(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Pg}function Ue(s){return s!=null&&Vs(s.length)&&!Ls(s)}function Pi(s,t,e){if(!ht(e))return!1;var n=typeof t;return(n=="number"?Ue(e)&&Ii(t,e.length):n=="string"&&t in e)?$e(e[t],s):!1}function _r(s){return Ze(function(t,e){var n=-1,i=e.length,o=i>1?e[i-1]:void 0,r=i>2?e[2]:void 0;for(o=s.length>3&&typeof o=="function"?(i--,o):void 0,r&&Pi(e[0],e[1],r)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var a=e[n];a&&s(t,a,n,o)}return t})}var Og=Object.prototype;function Oi(s){var t=s&&s.constructor,e=typeof t=="function"&&t.prototype||Og;return s===e}function Ng(s,t){for(var e=-1,n=Array(s);++e<s;)n[e]=t(e);return n}var Rg="[object Arguments]";function Wr(s){return Zt(s)&&Se(s)==Rg}var qr=Object.prototype,Dg=qr.hasOwnProperty,Qg=qr.propertyIsEnumerable,tn=Wr(function(){return arguments}())?Wr:function(s){return Zt(s)&&Dg.call(s,"callee")&&!Qg.call(s,"callee")};function Lg(){return!1}var Xr=typeof ot=="object"&&ot&&!ot.nodeType&&ot,$r=Xr&&typeof module=="object"&&module&&!module.nodeType&&module,zg=$r&&$r.exports===Xr,Zr=zg?$t.Buffer:void 0,Fg=Zr?Zr.isBuffer:void 0,en=Fg||Lg,Ug="[object Arguments]",Vg="[object Array]",Kg="[object Boolean]",Jg="[object Date]",jg="[object Error]",Gg="[object Function]",Yg="[object Map]",Hg="[object Number]",_g="[object Object]",Wg="[object RegExp]",qg="[object Set]",Xg="[object String]",$g="[object WeakMap]",Zg="[object ArrayBuffer]",tf="[object DataView]",ef="[object Float32Array]",nf="[object Float64Array]",sf="[object Int8Array]",of="[object Int16Array]",rf="[object Int32Array]",af="[object Uint8Array]",lf="[object Uint8ClampedArray]",cf="[object Uint16Array]",hf="[object Uint32Array]",rt={};rt[ef]=rt[nf]=rt[sf]=rt[of]=rt[rf]=rt[af]=rt[lf]=rt[cf]=rt[hf]=!0,rt[Ug]=rt[Vg]=rt[Zg]=rt[Kg]=rt[tf]=rt[Jg]=rt[jg]=rt[Gg]=rt[Yg]=rt[Hg]=rt[_g]=rt[Wg]=rt[qg]=rt[Xg]=rt[$g]=!1;function uf(s){return Zt(s)&&Vs(s.length)&&!!rt[Se(s)]}function Ni(s){return function(t){return s(t)}}var ta=typeof ot=="object"&&ot&&!ot.nodeType&&ot,Rn=ta&&typeof module=="object"&&module&&!module.nodeType&&module,df=Rn&&Rn.exports===ta,Ks=df&&Nr.process,nn=function(){try{var s=Rn&&Rn.require&&Rn.require("util").types;return s||Ks&&Ks.binding&&Ks.binding("util")}catch{}}(),ea=nn&&nn.isTypedArray,Ri=ea?Ni(ea):uf,gf=Object.prototype,ff=gf.hasOwnProperty;function na(s,t){var e=St(s),n=!e&&tn(s),i=!e&&!n&&en(s),o=!e&&!n&&!i&&Ri(s),r=e||n||i||o,a=r?Ng(s.length,String):[],l=a.length;for(var c in s)(t||ff.call(s,c))&&!(r&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ii(c,l)))&&a.push(c);return a}function ia(s,t){return function(e){return s(t(e))}}var pf=ia(Object.keys,Object),mf=Object.prototype,bf=mf.hasOwnProperty;function sa(s){if(!Oi(s))return pf(s);var t=[];for(var e in Object(s))bf.call(s,e)&&e!="constructor"&&t.push(e);return t}function Dn(s){return Ue(s)?na(s):sa(s)}function yf(s){var t=[];if(s!=null)for(var e in Object(s))t.push(e);return t}var Cf=Object.prototype,wf=Cf.hasOwnProperty;function Af(s){if(!ht(s))return yf(s);var t=Oi(s),e=[];for(var n in s)n=="constructor"&&(t||!wf.call(s,n))||e.push(n);return e}function sn(s){return Ue(s)?na(s,!0):Af(s)}var xf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vf=/^\w*$/;function Js(s,t){if(St(s))return!1;var e=typeof s;return e=="number"||e=="symbol"||e=="boolean"||s==null||ae(s)?!0:vf.test(s)||!xf.test(s)||t!=null&&s in Object(t)}var Qn=Fe(Object,"create");function Ef(){this.__data__=Qn?Qn(null):{},this.size=0}function Sf(s){var t=this.has(s)&&delete this.__data__[s];return this.size-=t?1:0,t}var Mf="__lodash_hash_undefined__",Bf=Object.prototype,kf=Bf.hasOwnProperty;function If(s){var t=this.__data__;if(Qn){var e=t[s];return e===Mf?void 0:e}return kf.call(t,s)?t[s]:void 0}var Tf=Object.prototype,Pf=Tf.hasOwnProperty;function Of(s){var t=this.__data__;return Qn?t[s]!==void 0:Pf.call(t,s)}var Nf="__lodash_hash_undefined__";function Rf(s,t){var e=this.__data__;return this.size+=this.has(s)?0:1,e[s]=Qn&&t===void 0?Nf:t,this}function Ve(s){var t=-1,e=s==null?0:s.length;for(this.clear();++t<e;){var n=s[t];this.set(n[0],n[1])}}Ve.prototype.clear=Ef,Ve.prototype.delete=Sf,Ve.prototype.get=If,Ve.prototype.has=Of,Ve.prototype.set=Rf;function Df(){this.__data__=[],this.size=0}function Di(s,t){for(var e=s.length;e--;)if($e(s[e][0],t))return e;return-1}var Qf=Array.prototype,Lf=Qf.splice;function zf(s){var t=this.__data__,e=Di(t,s);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Lf.call(t,e,1),--this.size,!0}function Ff(s){var t=this.__data__,e=Di(t,s);return e<0?void 0:t[e][1]}function Uf(s){return Di(this.__data__,s)>-1}function Vf(s,t){var e=this.__data__,n=Di(e,s);return n<0?(++this.size,e.push([s,t])):e[n][1]=t,this}function fe(s){var t=-1,e=s==null?0:s.length;for(this.clear();++t<e;){var n=s[t];this.set(n[0],n[1])}}fe.prototype.clear=Df,fe.prototype.delete=zf,fe.prototype.get=Ff,fe.prototype.has=Uf,fe.prototype.set=Vf;var Ln=Fe($t,"Map");function Kf(){this.size=0,this.__data__={hash:new Ve,map:new(Ln||fe),string:new Ve}}function Jf(s){var t=typeof s;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?s!=="__proto__":s===null}function Qi(s,t){var e=s.__data__;return Jf(t)?e[typeof t=="string"?"string":"hash"]:e.map}function jf(s){var t=Qi(this,s).delete(s);return this.size-=t?1:0,t}function Gf(s){return Qi(this,s).get(s)}function Yf(s){return Qi(this,s).has(s)}function Hf(s,t){var e=Qi(this,s),n=e.size;return e.set(s,t),this.size+=e.size==n?0:1,this}function pe(s){var t=-1,e=s==null?0:s.length;for(this.clear();++t<e;){var n=s[t];this.set(n[0],n[1])}}pe.prototype.clear=Kf,pe.prototype.delete=jf,pe.prototype.get=Gf,pe.prototype.has=Yf,pe.prototype.set=Hf;var _f="Expected a function";function js(s,t){if(typeof s!="function"||t!=null&&typeof t!="function")throw new TypeError(_f);var e=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=e.cache;if(o.has(i))return o.get(i);var r=s.apply(this,n);return e.cache=o.set(i,r)||o,r};return e.cache=new(js.Cache||pe),e}js.Cache=pe;var Wf=500;function qf(s){var t=js(s,function(n){return e.size===Wf&&e.clear(),n}),e=t.cache;return t}var Xf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$f=/\\(\\)?/g,Zf=qf(function(s){var t=[];return s.charCodeAt(0)===46&&t.push(""),s.replace(Xf,function(e,n,i,o){t.push(i?o.replace($f,"$1"):n||e)}),t});function on(s){return s==null?"":zr(s)}function Li(s,t){return St(s)?s:Js(s,t)?[s]:Zf(on(s))}function zn(s){if(typeof s=="string"||ae(s))return s;var t=s+"";return t=="0"&&1/s==-1/0?"-0":t}function zi(s,t){t=Li(t,s);for(var e=0,n=t.length;s!=null&&e<n;)s=s[zn(t[e++])];return e&&e==n?s:void 0}function tp(s,t,e){var n=s==null?void 0:zi(s,t);return n===void 0?e:n}function Gs(s,t){for(var e=-1,n=t.length,i=s.length;++e<n;)s[i+e]=t[e];return s}var oa=Jt?Jt.isConcatSpreadable:void 0;function ep(s){return St(s)||tn(s)||!!(oa&&s&&s[oa])}function Fi(s,t,e,n,i){var o=-1,r=s.length;for(e||(e=ep),i||(i=[]);++o<r;){var a=s[o];e(a)?Gs(i,a):n||(i[i.length]=a)}return i}function np(s){var t=s==null?0:s.length;return t?Fi(s):[]}function ip(s){return jr(Hr(s,void 0,np),s+"")}var Ys=ia(Object.getPrototypeOf,Object),sp="[object Object]",op=Function.prototype,rp=Object.prototype,ra=op.toString,ap=rp.hasOwnProperty,lp=ra.call(Object);function te(s){if(!Zt(s)||Se(s)!=sp)return!1;var t=Ys(s);if(t===null)return!0;var e=ap.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&ra.call(e)==lp}function cp(s,t,e){var n=-1,i=s.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=s[n+t];return o}function hp(s,t,e){var n=s.length;return e=e===void 0?n:e,!t&&e>=n?s:cp(s,t,e)}var up="\\ud800-\\udfff",dp="\\u0300-\\u036f",gp="\\ufe20-\\ufe2f",fp="\\u20d0-\\u20ff",pp=dp+gp+fp,mp="\\ufe0e\\ufe0f",bp="\\u200d",yp=RegExp("["+bp+up+pp+mp+"]");function aa(s){return yp.test(s)}function Cp(s){return s.split("")}var la="\\ud800-\\udfff",wp="\\u0300-\\u036f",Ap="\\ufe20-\\ufe2f",xp="\\u20d0-\\u20ff",vp=wp+Ap+xp,Ep="\\ufe0e\\ufe0f",Sp="["+la+"]",Hs="["+vp+"]",_s="\\ud83c[\\udffb-\\udfff]",Mp="(?:"+Hs+"|"+_s+")",ca="[^"+la+"]",ha="(?:\\ud83c[\\udde6-\\uddff]){2}",ua="[\\ud800-\\udbff][\\udc00-\\udfff]",Bp="\\u200d",da=Mp+"?",ga="["+Ep+"]?",kp="(?:"+Bp+"(?:"+[ca,ha,ua].join("|")+")"+ga+da+")*",Ip=ga+da+kp,Tp="(?:"+[ca+Hs+"?",Hs,ha,ua,Sp].join("|")+")",Pp=RegExp(_s+"(?="+_s+")|"+Tp+Ip,"g");function Op(s){return s.match(Pp)||[]}function Np(s){return aa(s)?Op(s):Cp(s)}function fa(s){return function(t){t=on(t);var e=aa(t)?Np(t):void 0,n=e?e[0]:t.charAt(0),i=e?hp(e,1).join(""):t.slice(1);return n[s]()+i}}var Ui=fa("toUpperCase");function Rp(s){return Ui(on(s).toLowerCase())}function Dp(s,t,e,n){for(var i=-1,o=s==null?0:s.length;++i<o;)e=t(e,s[i],i,s);return e}function Qp(s){return function(t){return s==null?void 0:s[t]}}var Lp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zp=Qp(Lp),Fp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Up="\\u0300-\\u036f",Vp="\\ufe20-\\ufe2f",Kp="\\u20d0-\\u20ff",Jp=Up+Vp+Kp,jp="["+Jp+"]",Gp=RegExp(jp,"g");function Yp(s){return s=on(s),s&&s.replace(Fp,zp).replace(Gp,"")}var Hp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function _p(s){return s.match(Hp)||[]}var Wp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function qp(s){return Wp.test(s)}var pa="\\ud800-\\udfff",Xp="\\u0300-\\u036f",$p="\\ufe20-\\ufe2f",Zp="\\u20d0-\\u20ff",tm=Xp+$p+Zp,ma="\\u2700-\\u27bf",ba="a-z\\xdf-\\xf6\\xf8-\\xff",em="\\xac\\xb1\\xd7\\xf7",nm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",im="\\u2000-\\u206f",sm=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ya="A-Z\\xc0-\\xd6\\xd8-\\xde",om="\\ufe0e\\ufe0f",Ca=em+nm+im+sm,wa="['’]",Aa="["+Ca+"]",rm="["+tm+"]",xa="\\d+",am="["+ma+"]",va="["+ba+"]",Ea="[^"+pa+Ca+xa+ma+ba+ya+"]",lm="\\ud83c[\\udffb-\\udfff]",cm="(?:"+rm+"|"+lm+")",hm="[^"+pa+"]",Sa="(?:\\ud83c[\\udde6-\\uddff]){2}",Ma="[\\ud800-\\udbff][\\udc00-\\udfff]",rn="["+ya+"]",um="\\u200d",Ba="(?:"+va+"|"+Ea+")",dm="(?:"+rn+"|"+Ea+")",ka="(?:"+wa+"(?:d|ll|m|re|s|t|ve))?",Ia="(?:"+wa+"(?:D|LL|M|RE|S|T|VE))?",Ta=cm+"?",Pa="["+om+"]?",gm="(?:"+um+"(?:"+[hm,Sa,Ma].join("|")+")"+Pa+Ta+")*",fm="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mm=Pa+Ta+gm,bm="(?:"+[am,Sa,Ma].join("|")+")"+mm,ym=RegExp([rn+"?"+va+"+"+ka+"(?="+[Aa,rn,"$"].join("|")+")",dm+"+"+Ia+"(?="+[Aa,rn+Ba,"$"].join("|")+")",rn+"?"+Ba+"+"+ka,rn+"+"+Ia,pm,fm,xa,bm].join("|"),"g");function Cm(s){return s.match(ym)||[]}function wm(s,t,e){return s=on(s),t=t,t===void 0?qp(s)?Cm(s):_p(s):s.match(t)||[]}var Am="['’]",xm=RegExp(Am,"g");function Oa(s){return function(t){return Dp(wm(Yp(t).replace(xm,"")),s,"")}}var Fn=Oa(function(s,t,e){return t=t.toLowerCase(),s+(e?Rp(t):t)});function Na(){if(!arguments.length)return[];var s=arguments[0];return St(s)?s:[s]}function vm(s,t,e){return s===s&&(e!==void 0&&(s=s<=e?s:e),t!==void 0&&(s=s>=t?s:t)),s}function Ke(s,t,e){return e===void 0&&(e=t,t=void 0),e!==void 0&&(e=On(e),e=e===e?e:0),t!==void 0&&(t=On(t),t=t===t?t:0),vm(On(s),t,e)}function Em(){this.__data__=new fe,this.size=0}function Sm(s){var t=this.__data__,e=t.delete(s);return this.size=t.size,e}function Mm(s){return this.__data__.get(s)}function Bm(s){return this.__data__.has(s)}var km=200;function Im(s,t){var e=this.__data__;if(e instanceof fe){var n=e.__data__;if(!Ln||n.length<km-1)return n.push([s,t]),this.size=++e.size,this;e=this.__data__=new pe(n)}return e.set(s,t),this.size=e.size,this}function ee(s){var t=this.__data__=new fe(s);this.size=t.size}ee.prototype.clear=Em,ee.prototype.delete=Sm,ee.prototype.get=Mm,ee.prototype.has=Bm,ee.prototype.set=Im;function Tm(s,t){return s&&Nn(t,Dn(t),s)}function Pm(s,t){return s&&Nn(t,sn(t),s)}var Ra=typeof ot=="object"&&ot&&!ot.nodeType&&ot,Da=Ra&&typeof module=="object"&&module&&!module.nodeType&&module,Om=Da&&Da.exports===Ra,Qa=Om?$t.Buffer:void 0,La=Qa?Qa.allocUnsafe:void 0;function za(s,t){if(t)return s.slice();var e=s.length,n=La?La(e):new s.constructor(e);return s.copy(n),n}function Nm(s,t){for(var e=-1,n=s==null?0:s.length,i=0,o=[];++e<n;){var r=s[e];t(r,e,s)&&(o[i++]=r)}return o}function Fa(){return[]}var Rm=Object.prototype,Dm=Rm.propertyIsEnumerable,Ua=Object.getOwnPropertySymbols,Ws=Ua?function(s){return s==null?[]:(s=Object(s),Nm(Ua(s),function(t){return Dm.call(s,t)}))}:Fa;function Qm(s,t){return Nn(s,Ws(s),t)}var Lm=Object.getOwnPropertySymbols,Va=Lm?function(s){for(var t=[];s;)Gs(t,Ws(s)),s=Ys(s);return t}:Fa;function zm(s,t){return Nn(s,Va(s),t)}function Ka(s,t,e){var n=t(s);return St(s)?n:Gs(n,e(s))}function qs(s){return Ka(s,Dn,Ws)}function Fm(s){return Ka(s,sn,Va)}var Xs=Fe($t,"DataView"),$s=Fe($t,"Promise"),an=Fe($t,"Set"),Ja="[object Map]",Um="[object Object]",ja="[object Promise]",Ga="[object Set]",Ya="[object WeakMap]",Ha="[object DataView]",Vm=ze(Xs),Km=ze(Ln),Jm=ze($s),jm=ze(an),Gm=ze(Fs),jt=Se;(Xs&&jt(new Xs(new ArrayBuffer(1)))!=Ha||Ln&&jt(new Ln)!=Ja||$s&&jt($s.resolve())!=ja||an&&jt(new an)!=Ga||Fs&&jt(new Fs)!=Ya)&&(jt=function(s){var t=Se(s),e=t==Um?s.constructor:void 0,n=e?ze(e):"";if(n)switch(n){case Vm:return Ha;case Km:return Ja;case Jm:return ja;case jm:return Ga;case Gm:return Ya}return t});var Ym=Object.prototype,Hm=Ym.hasOwnProperty;function _m(s){var t=s.length,e=new s.constructor(t);return t&&typeof s[0]=="string"&&Hm.call(s,"index")&&(e.index=s.index,e.input=s.input),e}var Vi=$t.Uint8Array;function Zs(s){var t=new s.constructor(s.byteLength);return new Vi(t).set(new Vi(s)),t}function Wm(s,t){var e=t?Zs(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.byteLength)}var qm=/\w*$/;function Xm(s){var t=new s.constructor(s.source,qm.exec(s));return t.lastIndex=s.lastIndex,t}var _a=Jt?Jt.prototype:void 0,Wa=_a?_a.valueOf:void 0;function $m(s){return Wa?Object(Wa.call(s)):{}}function qa(s,t){var e=t?Zs(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}var Zm="[object Boolean]",t0="[object Date]",e0="[object Map]",n0="[object Number]",i0="[object RegExp]",s0="[object Set]",o0="[object String]",r0="[object Symbol]",a0="[object ArrayBuffer]",l0="[object DataView]",c0="[object Float32Array]",h0="[object Float64Array]",u0="[object Int8Array]",d0="[object Int16Array]",g0="[object Int32Array]",f0="[object Uint8Array]",p0="[object Uint8ClampedArray]",m0="[object Uint16Array]",b0="[object Uint32Array]";function y0(s,t,e){var n=s.constructor;switch(t){case a0:return Zs(s);case Zm:case t0:return new n(+s);case l0:return Wm(s,e);case c0:case h0:case u0:case d0:case g0:case f0:case p0:case m0:case b0:return qa(s,e);case e0:return new n;case n0:case o0:return new n(s);case i0:return Xm(s);case s0:return new n;case r0:return $m(s)}}function Xa(s){return typeof s.constructor=="function"&&!Oi(s)?fg(Ys(s)):{}}var C0="[object Map]";function w0(s){return Zt(s)&&jt(s)==C0}var $a=nn&&nn.isMap,A0=$a?Ni($a):w0,x0="[object Set]";function v0(s){return Zt(s)&&jt(s)==x0}var Za=nn&&nn.isSet,E0=Za?Ni(Za):v0,S0=1,M0=2,B0=4,tl="[object Arguments]",k0="[object Array]",I0="[object Boolean]",T0="[object Date]",P0="[object Error]",el="[object Function]",O0="[object GeneratorFunction]",N0="[object Map]",R0="[object Number]",nl="[object Object]",D0="[object RegExp]",Q0="[object Set]",L0="[object String]",z0="[object Symbol]",F0="[object WeakMap]",U0="[object ArrayBuffer]",V0="[object DataView]",K0="[object Float32Array]",J0="[object Float64Array]",j0="[object Int8Array]",G0="[object Int16Array]",Y0="[object Int32Array]",H0="[object Uint8Array]",_0="[object Uint8ClampedArray]",W0="[object Uint16Array]",q0="[object Uint32Array]",it={};it[tl]=it[k0]=it[U0]=it[V0]=it[I0]=it[T0]=it[K0]=it[J0]=it[j0]=it[G0]=it[Y0]=it[N0]=it[R0]=it[nl]=it[D0]=it[Q0]=it[L0]=it[z0]=it[H0]=it[_0]=it[W0]=it[q0]=!0,it[P0]=it[el]=it[F0]=!1;function Un(s,t,e,n,i,o){var r,a=t&S0,l=t&M0,c=t&B0;if(r!==void 0)return r;if(!ht(s))return s;var h=St(s);if(h){if(r=_m(s),!a)return Jr(s,r)}else{var u=jt(s),d=u==el||u==O0;if(en(s))return za(s,a);if(u==nl||u==tl||d&&!i){if(r=l||d?{}:Xa(s),!a)return l?zm(s,Pm(r,s)):Qm(s,Tm(r,s))}else{if(!it[u])return i?s:{};r=y0(s,u,a)}}o||(o=new ee);var f=o.get(s);if(f)return f;o.set(s,r),E0(s)?s.forEach(function(b){r.add(Un(b,t,e,b,s,o))}):A0(s)&&s.forEach(function(b,y){r.set(y,Un(b,t,e,y,s,o))});var p=c?l?Fm:qs:l?sn:Dn,m=h?void 0:p(s);return xg(m||s,function(b,y){m&&(y=b,b=s[y]),Us(r,y,Un(b,t,e,y,s,o))}),r}var X0=4;function to(s){return Un(s,X0)}var $0=1,Z0=4;function at(s){return Un(s,$0|Z0)}var t1="__lodash_hash_undefined__";function e1(s){return this.__data__.set(s,t1),this}function n1(s){return this.__data__.has(s)}function ln(s){var t=-1,e=s==null?0:s.length;for(this.__data__=new pe;++t<e;)this.add(s[t])}ln.prototype.add=ln.prototype.push=e1,ln.prototype.has=n1;function i1(s,t){for(var e=-1,n=s==null?0:s.length;++e<n;)if(t(s[e],e,s))return!0;return!1}function eo(s,t){return s.has(t)}var s1=1,o1=2;function il(s,t,e,n,i,o){var r=e&s1,a=s.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=o.get(s),h=o.get(t);if(c&&h)return c==t&&h==s;var u=-1,d=!0,f=e&o1?new ln:void 0;for(o.set(s,t),o.set(t,s);++u<a;){var p=s[u],m=t[u];if(n)var b=r?n(m,p,u,t,s,o):n(p,m,u,s,t,o);if(b!==void 0){if(b)continue;d=!1;break}if(f){if(!i1(t,function(y,C){if(!eo(f,C)&&(p===y||i(p,y,e,n,o)))return f.push(C)})){d=!1;break}}else if(!(p===m||i(p,m,e,n,o))){d=!1;break}}return o.delete(s),o.delete(t),d}function r1(s){var t=-1,e=Array(s.size);return s.forEach(function(n,i){e[++t]=[i,n]}),e}function no(s){var t=-1,e=Array(s.size);return s.forEach(function(n){e[++t]=n}),e}var a1=1,l1=2,c1="[object Boolean]",h1="[object Date]",u1="[object Error]",d1="[object Map]",g1="[object Number]",f1="[object RegExp]",p1="[object Set]",m1="[object String]",b1="[object Symbol]",y1="[object ArrayBuffer]",C1="[object DataView]",sl=Jt?Jt.prototype:void 0,io=sl?sl.valueOf:void 0;function w1(s,t,e,n,i,o,r){switch(e){case C1:if(s.byteLength!=t.byteLength||s.byteOffset!=t.byteOffset)return!1;s=s.buffer,t=t.buffer;case y1:return!(s.byteLength!=t.byteLength||!o(new Vi(s),new Vi(t)));case c1:case h1:case g1:return $e(+s,+t);case u1:return s.name==t.name&&s.message==t.message;case f1:case m1:return s==t+"";case d1:var a=r1;case p1:var l=n&a1;if(a||(a=no),s.size!=t.size&&!l)return!1;var c=r.get(s);if(c)return c==t;n|=l1,r.set(s,t);var h=il(a(s),a(t),n,i,o,r);return r.delete(s),h;case b1:if(io)return io.call(s)==io.call(t)}return!1}var A1=1,x1=Object.prototype,v1=x1.hasOwnProperty;function E1(s,t,e,n,i,o){var r=e&A1,a=qs(s),l=a.length,c=qs(t),h=c.length;if(l!=h&&!r)return!1;for(var u=l;u--;){var d=a[u];if(!(r?d in t:v1.call(t,d)))return!1}var f=o.get(s),p=o.get(t);if(f&&p)return f==t&&p==s;var m=!0;o.set(s,t),o.set(t,s);for(var b=r;++u<l;){d=a[u];var y=s[d],C=t[d];if(n)var A=r?n(C,y,d,t,s,o):n(y,C,d,s,t,o);if(!(A===void 0?y===C||i(y,C,e,n,o):A)){m=!1;break}b||(b=d=="constructor")}if(m&&!b){var x=s.constructor,v=t.constructor;x!=v&&"constructor"in s&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof v=="function"&&v instanceof v)&&(m=!1)}return o.delete(s),o.delete(t),m}var S1=1,ol="[object Arguments]",rl="[object Array]",Ki="[object Object]",M1=Object.prototype,al=M1.hasOwnProperty;function B1(s,t,e,n,i,o){var r=St(s),a=St(t),l=r?rl:jt(s),c=a?rl:jt(t);l=l==ol?Ki:l,c=c==ol?Ki:c;var h=l==Ki,u=c==Ki,d=l==c;if(d&&en(s)){if(!en(t))return!1;r=!0,h=!1}if(d&&!h)return o||(o=new ee),r||Ri(s)?il(s,t,e,n,i,o):w1(s,t,l,e,n,i,o);if(!(e&S1)){var f=h&&al.call(s,"__wrapped__"),p=u&&al.call(t,"__wrapped__");if(f||p){var m=f?s.value():s,b=p?t.value():t;return o||(o=new ee),i(m,b,e,n,o)}}return d?(o||(o=new ee),E1(s,t,e,n,i,o)):!1}function Ji(s,t,e,n,i){return s===t?!0:s==null||t==null||!Zt(s)&&!Zt(t)?s!==s&&t!==t:B1(s,t,e,n,Ji,i)}var k1=1,I1=2;function T1(s,t,e,n){var i=e.length,o=i;if(s==null)return!o;for(s=Object(s);i--;){var r=e[i];if(r[2]?r[1]!==s[r[0]]:!(r[0]in s))return!1}for(;++i<o;){r=e[i];var a=r[0],l=s[a],c=r[1];if(r[2]){if(l===void 0&&!(a in s))return!1}else{var h=new ee,u;if(!(u===void 0?Ji(c,l,k1|I1,n,h):u))return!1}}return!0}function ll(s){return s===s&&!ht(s)}function P1(s){for(var t=Dn(s),e=t.length;e--;){var n=t[e],i=s[n];t[e]=[n,i,ll(i)]}return t}function cl(s,t){return function(e){return e==null?!1:e[s]===t&&(t!==void 0||s in Object(e))}}function O1(s){var t=P1(s);return t.length==1&&t[0][2]?cl(t[0][0],t[0][1]):function(e){return e===s||T1(e,s,t)}}function N1(s,t){return s!=null&&t in Object(s)}function hl(s,t,e){t=Li(t,s);for(var n=-1,i=t.length,o=!1;++n<i;){var r=zn(t[n]);if(!(o=s!=null&&e(s,r)))break;s=s[r]}return o||++n!=i?o:(i=s==null?0:s.length,!!i&&Vs(i)&&Ii(r,i)&&(St(s)||tn(s)))}function ul(s,t){return s!=null&&hl(s,t,N1)}var R1=1,D1=2;function Q1(s,t){return Js(s)&&ll(t)?cl(zn(s),t):function(e){var n=tp(e,s);return n===void 0&&n===t?ul(e,s):Ji(t,n,R1|D1)}}function L1(s){return function(t){return t==null?void 0:t[s]}}function z1(s){return function(t){return zi(t,s)}}function F1(s){return Js(s)?L1(zn(s)):z1(s)}function so(s){return typeof s=="function"?s:s==null?Xe:typeof s=="object"?St(s)?Q1(s[0],s[1]):O1(s):F1(s)}function U1(s,t,e,n){for(var i=-1,o=s==null?0:s.length;++i<o;){var r=s[i];t(n,r,e(r),s)}return n}function V1(s){return function(t,e,n){for(var i=-1,o=Object(t),r=n(t),a=r.length;a--;){var l=r[++i];if(e(o[l],l,o)===!1)break}return t}}var dl=V1();function K1(s,t){return s&&dl(s,t,Dn)}function J1(s,t){return function(e,n){if(e==null)return e;if(!Ue(e))return s(e,n);for(var i=e.length,o=-1,r=Object(e);++o<i&&n(r[o],o,r)!==!1;);return e}}var gl=J1(K1);function j1(s,t,e,n){return gl(s,function(i,o,r){t(n,i,e(i),r)}),n}function G1(s,t){return function(e,n){var i=St(e)?U1:j1,o=t?t():{};return i(e,s,so(n),o)}}var oo=function(){return $t.Date.now()},Y1="Expected a function",H1=Math.max,_1=Math.min;function ji(s,t,e){var n,i,o,r,a,l,c=0,h=!1,u=!1,d=!0;if(typeof s!="function")throw new TypeError(Y1);t=On(t)||0,ht(e)&&(h=!!e.leading,u="maxWait"in e,o=u?H1(On(e.maxWait)||0,t):o,d="trailing"in e?!!e.trailing:d);function f(B){var E=n,M=i;return n=i=void 0,c=B,r=s.apply(M,E),r}function p(B){return c=B,a=setTimeout(y,t),h?f(B):r}function m(B){var E=B-l,M=B-c,k=t-E;return u?_1(k,o-M):k}function b(B){var E=B-l,M=B-c;return l===void 0||E>=t||E<0||u&&M>=o}function y(){var B=oo();if(b(B))return C(B);a=setTimeout(y,m(B))}function C(B){return a=void 0,d&&n?f(B):(n=i=void 0,r)}function A(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function x(){return a===void 0?r:C(oo())}function v(){var B=oo(),E=b(B);if(n=arguments,i=this,l=B,E){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(y,t),f(l)}return a===void 0&&(a=setTimeout(y,t)),r}return v.cancel=A,v.flush=x,v}var fl=Object.prototype,W1=fl.hasOwnProperty,q1=Ze(function(s,t){s=Object(s);var e=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Pi(t[0],t[1],i)&&(n=1);++e<n;)for(var o=t[e],r=sn(o),a=-1,l=r.length;++a<l;){var c=r[a],h=s[c];(h===void 0||$e(h,fl[c])&&!W1.call(s,c))&&(s[c]=o[c])}return s});function ro(s,t,e){(e!==void 0&&!$e(s[t],e)||e===void 0&&!(t in s))&&Ti(s,t,e)}function Gi(s){return Zt(s)&&Ue(s)}function ao(s,t){if(!(t==="constructor"&&typeof s[t]=="function")&&t!="__proto__")return s[t]}function X1(s){return Nn(s,sn(s))}function $1(s,t,e,n,i,o,r){var a=ao(s,e),l=ao(t,e),c=r.get(l);if(c){ro(s,e,c);return}var h=o?o(a,l,e+"",s,t,r):void 0,u=h===void 0;if(u){var d=St(l),f=!d&&en(l),p=!d&&!f&&Ri(l);h=l,d||f||p?St(a)?h=a:Gi(a)?h=Jr(a):f?(u=!1,h=za(l,!0)):p?(u=!1,h=qa(l,!0)):h=[]:te(l)||tn(l)?(h=a,tn(a)?h=X1(a):(!ht(a)||Ls(a))&&(h=Xa(l))):u=!1}u&&(r.set(l,h),i(h,l,n,o,r),r.delete(l)),ro(s,e,h)}function Yi(s,t,e,n,i){s!==t&&dl(t,function(o,r){if(i||(i=new ee),ht(o))$1(s,t,r,e,Yi,n,i);else{var a=n?n(ao(s,r),o,r+"",s,t,i):void 0;a===void 0&&(a=o),ro(s,r,a)}},sn)}function pl(s,t,e,n,i,o){return ht(s)&&ht(t)&&(o.set(t,s),Yi(s,t,void 0,pl,o),o.delete(t)),s}var Z1=_r(function(s,t,e,n){Yi(s,t,e,n)}),ml=Ze(function(s){return s.push(void 0,pl),Kr(Z1,void 0,s)}),tb=200;function eb(s,t,e,n){var i=-1,o=Gr,r=!0,a=s.length,l=[],c=t.length;if(!a)return l;t.length>=tb&&(o=eo,r=!1,t=new ln(t));t:for(;++i<a;){var h=s[i],u=h;if(h=h!==0?h:0,r&&u===u){for(var d=c;d--;)if(t[d]===u)continue t;l.push(h)}else o(t,u,n)||l.push(h)}return l}var nb=Ze(function(s,t){return Gi(s)?eb(s,Fi(t,1,Gi,!0)):[]});function ib(s,t){var e=-1,n=Ue(s)?Array(s.length):[];return gl(s,function(i,o,r){n[++e]=t(i,o,r)}),n}var sb=Object.prototype,ob=sb.hasOwnProperty,bl=G1(function(s,t,e){ob.call(s,e)?s[e].push(t):Ti(s,e,[t])});function rb(s,t){return s>t}var ab=Object.prototype,lb=ab.hasOwnProperty;function cb(s,t){return s!=null&&lb.call(s,t)}function Hi(s,t){return s!=null&&hl(s,t,cb)}var hb="[object Map]",ub="[object Set]",db=Object.prototype,gb=db.hasOwnProperty;function lo(s){if(s==null)return!0;if(Ue(s)&&(St(s)||typeof s=="string"||typeof s.splice=="function"||en(s)||Ri(s)||tn(s)))return!s.length;var t=jt(s);if(t==hb||t==ub)return!s.size;if(Oi(s))return!sa(s).length;for(var e in s)if(gb.call(s,e))return!1;return!0}function me(s,t){return Ji(s,t)}var fb="[object Number]";function be(s){return typeof s=="number"||Zt(s)&&Se(s)==fb}var pb=fa("toLowerCase");function mb(s,t,e){for(var n=-1,i=s.length;++n<i;){var o=s[n],r=t(o);if(r!=null&&(a===void 0?r===r&&!ae(r):e(r,a)))var a=r,l=o}return l}function bb(s){return s&&s.length?mb(s,Xe,rb):void 0}var ct=_r(function(s,t,e){Yi(s,t,e)});function yb(s,t,e,n){if(!ht(s))return s;t=Li(t,s);for(var i=-1,o=t.length,r=o-1,a=s;a!=null&&++i<o;){var l=zn(t[i]),c=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return s;if(i!=r){var h=a[l];c=void 0,c===void 0&&(c=ht(h)?h:Ii(t[i+1])?[]:{})}Us(a,l,c),a=a[l]}return s}function Cb(s,t,e){for(var n=-1,i=t.length,o={};++n<i;){var r=t[n],a=zi(s,r);e(a,r)&&yb(o,Li(r,s),a)}return o}function wb(s,t){var e=s.length;for(s.sort(t);e--;)s[e]=s[e].value;return s}function Ab(s,t){if(s!==t){var e=s!==void 0,n=s===null,i=s===s,o=ae(s),r=t!==void 0,a=t===null,l=t===t,c=ae(t);if(!a&&!c&&!o&&s>t||o&&r&&l&&!a&&!c||n&&r&&l||!e&&l||!i)return 1;if(!n&&!o&&!c&&s<t||c&&e&&i&&!n&&!o||a&&e&&i||!r&&i||!l)return-1}return 0}function xb(s,t,e){for(var n=-1,i=s.criteria,o=t.criteria,r=i.length,a=e.length;++n<r;){var l=Ab(i[n],o[n]);if(l){if(n>=a)return l;var c=e[n];return l*(c=="desc"?-1:1)}}return s.index-t.index}function vb(s,t,e){t.length?t=Bi(t,function(o){return St(o)?function(r){return zi(r,o.length===1?o[0]:o)}:o}):t=[Xe];var n=-1;t=Bi(t,Ni(so));var i=ib(s,function(o,r,a){var l=Bi(t,function(c){return c(o)});return{criteria:l,index:++n,value:o}});return wb(i,function(o,r){return xb(o,r,e)})}function Eb(s,t){return Cb(s,t,function(e,n){return ul(s,n)})}var yl=ip(function(s,t){return s==null?{}:Eb(s,t)}),co=Ze(function(s,t){if(s==null)return[];var e=t.length;return e>1&&Pi(s,t[0],t[1])?t=[]:e>2&&Pi(t[0],t[1],t[2])&&(t=[t[0]]),vb(s,Fi(t),[])}),Sb=4294967295,Mb=Sb-1,Bb=Math.floor,kb=Math.min;function Cl(s,t,e,n){var i=0,o=s==null?0:s.length;if(o===0)return 0;t=e(t);for(var r=t!==t,a=t===null,l=ae(t),c=t===void 0;i<o;){var h=Bb((i+o)/2),u=e(s[h]),d=u!==void 0,f=u===null,p=u===u,m=ae(u);if(r)var b=p;else c?b=p&&d:a?b=p&&d&&!f:l?b=p&&d&&!f&&!m:f||m?b=!1:b=u<t;b?i=h+1:o=h}return kb(o,Mb)}var Ib=4294967295,Tb=Ib>>>1;function Pb(s,t,e){var n=0,i=s==null?n:s.length;if(typeof t=="number"&&t===t&&i<=Tb){for(;n<i;){var o=n+i>>>1,r=s[o];r!==null&&!ae(r)&&r<t?n=o+1:i=o}return i}return Cl(s,t,Xe)}function Ob(s,t){return Pb(s,t)}function Nb(s,t,e){return Cl(s,t,so(e))}var Rb=Oa(function(s,t,e){return s+(e?" ":"")+Ui(t)}),Db="Expected a function";function Qb(s,t,e){var n=!0,i=!0;if(typeof s!="function")throw new TypeError(Db);return ht(e)&&(n="leading"in e?!0:n,i="trailing"in e?!!e.trailing:i),ji(s,t,{leading:n,maxWait:t,trailing:i})}var Lb=1/0,zb=an&&1/no(new an([,-0]))[1]==Lb?function(s){return new an(s)}:pg,Fb=200;function wl(s,t,e){var n=-1,i=Gr,o=s.length,r=!0,a=[],l=a;if(o>=Fb){var c=zb(s);if(c)return no(c);r=!1,i=eo,l=new ln}else l=a;t:for(;++n<o;){var h=s[n],u=h;if(h=h!==0?h:0,r&&u===u){for(var d=l.length;d--;)if(l[d]===u)continue t;a.push(h)}else i(l,u,e)||(l!==a&&l.push(u),a.push(h))}return a}var Al=Ze(function(s){return wl(Fi(s,1,Gi,!0))});function xl(s){return s&&s.length?wl(s):[]}var Ub=0;function Vb(s){var t=++Ub;return on(s)+t}function ye(s){return typeof s=="string"&&s.slice(-1)==="%"}function Vt(s,t){if(s==null)return 0;let e;if(typeof s=="string"){if(e=parseFloat(s),ye(s)&&(e/=100,Number.isFinite(e)))return e*t}else e=s;return Number.isFinite(e)?e>0&&e<1?e*t:e:0}function ne(s){if(typeof s=="object"){let e=0,n=0,i=0,o=0;return s.vertical!=null&&Number.isFinite(s.vertical)&&(n=o=s.vertical),s.horizontal!=null&&Number.isFinite(s.horizontal)&&(i=e=s.horizontal),s.left!=null&&Number.isFinite(s.left)&&(e=s.left),s.top!=null&&Number.isFinite(s.top)&&(n=s.top),s.right!=null&&Number.isFinite(s.right)&&(i=s.right),s.bottom!=null&&Number.isFinite(s.bottom)&&(o=s.bottom),{top:n,right:i,bottom:o,left:e}}let t=0;return s!=null&&Number.isFinite(s)&&(t=s),{top:t,right:t,bottom:t,left:t}}let vl=!1,El=!1,Sl=!1,Kb=!1,Ml=!1;if(typeof navigator=="object"){const s=navigator.userAgent;s.indexOf("Macintosh")>=0,s.match(/(iPad|iPhone|iPod)/g),s.indexOf("Windows")>=0,vl=s.indexOf("MSIE")>=0,s.match(/Trident\/7\./),El=!!s.match(/Edge\//),s.indexOf("Mozilla/")>=0&&s.indexOf("MSIE")<0&&s.indexOf("Edge/")<0,s.indexOf("Chrome/")>=0&&s.indexOf("Edge/")<0,s.indexOf("Opera/")>=0||s.indexOf("OPR/")>=0,s.indexOf("Firefox/")>=0,Sl=s.indexOf("AppleWebKit/")>=0&&s.indexOf("Chrome/")<0&&s.indexOf("Edge/")<0,typeof document=="object"&&(Ml=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||s.indexOf("Opera/")>=0)}if(typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,typeof document=="object")try{const s=Object.defineProperty({},"passive",{get(){Kb=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},s)}catch{}const Bl=vl,kl=El,Jb=Sl,jb=!Ml;function Gb(){const s=window.module;return s!=null&&s.hot!=null&&s.hot.status!=null?s.hot.status():"unkonwn"}function Il(){return Gb()==="apply"}const Yb={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function Hb(s){const t=document.createElement(Yb[s]||"div"),e=`on${s}`;let n=e in t;return n||(t.setAttribute(e,"return;"),n=typeof t[e]=="function"),n}const Vn=[];function Me(s,t){const e=Vn.find(n=>n.name===s);if(!(e&&(e.loadTimes+=1,e.loadTimes>1))&&!Il()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=t;const i=document.querySelector("head");i&&i.insertBefore(n,i.firstChild),Vn.push({name:s,loadTimes:1,styleElement:n})}}function Be(s){const t=Vn.findIndex(e=>e.name===s);if(t>-1){const e=Vn[t];if(e.loadTimes-=1,e.loadTimes>0)return;let n=e.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Vn.splice(t,1)}}function _b(s){const t=s.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return t&&t[2]?t[2].replace(/\s+/," ").split(" "):null}function Tl(s){const t=parseFloat(s);return Number.isNaN(t)?null:t}function Wb(s){const t="data:";return s.substr(0,t.length)===t}function qb(s,t){if(!s||Wb(s)){setTimeout(()=>t(null,s));return}const e=()=>{t(new Error(`Failed to load image: ${s}`))},n=window.FileReader?o=>{if(o.status===200){const r=new FileReader;r.onload=a=>{const l=a.target.result;t(null,l)},r.onerror=e,r.readAsDataURL(o.response)}else e()}:o=>{const r=a=>{const c=[];for(let h=0;h<a.length;h+=32768)c.push(String.fromCharCode.apply(null,a.subarray(h,h+32768)));return c.join("")};if(o.status===200){let a=s.split(".").pop()||"png";a==="svg"&&(a="svg+xml");const l=`data:image/${a};base64,`,c=new Uint8Array(o.response),h=l+btoa(r(c));t(null,h)}else e()},i=new XMLHttpRequest;i.responseType=window.FileReader?"blob":"arraybuffer",i.open("GET",s,!0),i.addEventListener("error",e),i.addEventListener("load",()=>n(i)),i.send()}function Xb(s){let t=s.replace(/\s/g,"");t=decodeURIComponent(t);const e=t.indexOf(","),n=t.slice(0,e),i=n.split(":")[1].split(";")[0],o=t.slice(e+1);let r;n.indexOf("base64")>=0?r=atob(o):r=unescape(encodeURIComponent(o));const a=new Uint8Array(r.length);for(let l=0;l<r.length;l+=1)a[l]=r.charCodeAt(l);return new Blob([a],{type:i})}function $b(s,t){const e=window.navigator.msSaveBlob;if(e)e(s,t);else{const n=window.URL.createObjectURL(s),i=document.createElement("a");i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function ho(s,t){const e=Xb(s);$b(e,t)}function Zb(s,t={}){let e=null;const n=h=>(e==null&&(e=_b(s)),e!=null?Tl(e[h]):null),i=h=>{const u=s.match(h);return u&&u[2]?Tl(u[2]):null};let o=t.width;if(o==null&&(o=i(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),o==null&&(o=n(2)),o==null)throw new Error("Can not parse width from svg string");let r=t.height;if(r==null&&(r=i(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),r==null&&(r=n(3)),r==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(s).replace(/'/g,"%27").replace(/"/g,"%22")}`}function ty(s){return typeof s=="object"&&s.then&&typeof s.then=="function"}function uo(s){return s!=null&&(s instanceof Promise||ty(s))}function go(...s){const t=[];if(s.forEach(n=>{Array.isArray(n)?t.push(...n):t.push(n)}),t.some(n=>uo(n))){const n=t.map(i=>uo(i)?i:Promise.resolve(i!==!1));return Promise.all(n).then(i=>i.reduce((o,r)=>r!==!1&&o,!0))}return t.every(n=>n!==!1)}function ey(...s){const t=go(s);return typeof t=="boolean"?Promise.resolve(t):t}function Pl(s,t,e){if(e)switch(e.length){case 0:return s.call(t);case 1:return s.call(t,e[0]);case 2:return s.call(t,e[0],e[1]);case 3:return s.call(t,e[0],e[1],e[2]);case 4:return s.call(t,e[0],e[1],e[2],e[3]);case 5:return s.call(t,e[0],e[1],e[2],e[3],e[4]);case 6:return s.call(t,e[0],e[1],e[2],e[3],e[4],e[5]);default:return s.apply(t,e)}return s.call(t)}function D(s,t,...e){return Pl(s,t,e)}function Ol(s){return 180*s/Math.PI%360}const It=function(s,t=!1){return(t?s:s%360)*Math.PI/180};function Pt(s){return s%360+(s<0?360:0)}function Je(s,t=0){return Number.isInteger(s)?s:+s.toFixed(t)}function Nl(s,t){let e,n;if(t==null?(n=s??1,e=0):(n=t,e=s??0),n<e){const i=e;e=n,n=i}return Math.floor(Math.random()*(n-e+1)+e)}function cn(s,t,e){return Number.isNaN(s)?NaN:Number.isNaN(t)||Number.isNaN(e)?0:s<t?t:s>e?e:s}function ie(s,t){return t*Math.round(s/t)}function Rl(s,t){return t!=null&&s!=null&&t.x>=s.x&&t.x<=s.x+s.width&&t.y>=s.y&&t.y<=s.y+s.height}function Dl(s,t){const e=s.x-t.x,n=s.y-t.y;return e*e+n*n}class ke{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class w extends ke{static create(t,e){return t==null||typeof t=="number"?new w(t,e):w.clone(t)}static clone(t){return w.isPoint(t)?new w(t.x,t.y):Array.isArray(t)?new w(t[0],t[1]):new w(t.x,t.y)}static equals(t,e){return t===e?!0:t!=null&&e!=null?t.x===e.x&&t.y===e.y:!1}static rotateEx(t,e,n,i=new w){const o=w.clone(t),r=w.clone(i),a=o.x-r.x,l=o.y-r.y,c=a*e-l*n,h=l*e+a*n;return new w(c+r.x,h+r.y)}static toJSON(t){return w.isPoint(t)?{x:t.x,y:t.y}:Array.isArray(t)?{x:t[0],y:t[1]}:{x:t.x,y:t.y}}static fromPolar(t,e,n=new w){let i=Math.abs(t*Math.cos(e)),o=Math.abs(t*Math.sin(e));const r=w.clone(n),a=Pt(Ol(e));return a<90?o=-o:a<180?(i=-i,o=-o):a<270&&(i=-i),new w(r.x+i,r.y+o)}static toPolar(t,e=new w){const n=w.clone(t),i=w.clone(e),o=n.x-i.x,r=n.y-i.y;return new w(Math.sqrt(o*o+r*r),It(i.theta(n)))}static equalPoints(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!==e.length)return!1;if(t!=null&&e!=null){for(let n=0,i=t.length;n<i;n+=1)if(!w.equals(t[n],e[n]))return!1}return!0}static random(t,e,n,i){return new w(Nl(t,e),Nl(n,i))}static rotate(t,e,n){const i=It(Pt(-e)),o=Math.sin(i),r=Math.cos(i);return w.rotateEx(t,r,o,n)}static isPoint(t){return t!=null&&t instanceof w}static isPointLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"}static isPointData(t){return t!=null&&Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}constructor(t,e){super(),this.x=t??0,this.y=e??0}round(t=0){return this.x=Je(this.x,t),this.y=Je(this.y,t),this}add(t,e){const n=w.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=w.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=w.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=w.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new w){const i=w.create(n);return this.x=i.x+t*(this.x-i.x),this.y=i.y+e*(this.y-i.y),this}closest(t){if(t.length===1)return w.create(t[0]);let e=null,n=1/0;return t.forEach(i=>{const o=this.squaredDistance(i);o<n&&(e=i,n=o)}),e?w.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=w.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistance(t){const e=w.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new w){const e=w.create(t),n=-(e.y-this.y),i=e.x-this.x;let o=Math.atan2(n,i);return o<0&&(o=2*Math.PI+o),180*o/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){return new w(0,0).angleBetween(this,t)}toPolar(t){return this.update(w.toPolar(this,t)),this}changeInAngle(t,e,n=new w){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return Rl(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=w.create(t),n=It(this.y),i=It(e.y),o=this.x,r=e.x,a=It(r-o),l=Math.sin(a)*Math.cos(i),c=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(a),h=Ol(Math.atan2(l,c)),u=["NE","E","SE","S","SW","W","NW","N"];let d=h-22.5;return d<0&&(d+=360),d=parseInt(d/45,10),u[d]}cross(t,e){if(t!=null&&e!=null){const n=w.create(t),i=w.create(e);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=w.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if(typeof t=="number")return new w(this.x-t,this.y-e);const n=w.create(t);return new w(this.x-n.x,this.y-n.y)}lerp(t,e){const n=w.create(t);return new w((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=w.create(t),i=It(n.theta(this));return this.translate(Math.cos(i)*e,-Math.sin(i)*e)}reflection(t){return w.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=ie(this.x,t),this.y=ie(this.y,e??t),this}equals(t){const e=w.create(t);return e!=null&&e.x===this.x&&e.y===this.y}clone(){return w.clone(this)}toJSON(){return w.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}class I extends ke{static isRectangle(t){return t!=null&&t instanceof I}static isRectangleLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}static create(t,e,n,i){return t==null||typeof t=="number"?new I(t,e,n,i):I.clone(t)}static clone(t){return I.isRectangle(t)?t.clone():Array.isArray(t)?new I(t[0],t[1],t[2],t[3]):new I(t.x,t.y,t.width,t.height)}static fromEllipse(t){return new I(t.x-t.a,t.y-t.b,2*t.a,2*t.b)}static fromSize(t){return new I(0,0,t.width,t.height)}static fromPositionAndSize(t,e){return new I(t.x,t.y,e.width,e.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new w(this.x,this.y)}get topLeft(){return new w(this.x,this.y)}get topCenter(){return new w(this.x+this.width/2,this.y)}get topRight(){return new w(this.x+this.width,this.y)}get center(){return new w(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new w(this.x,this.y+this.height)}get bottomCenter(){return new w(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new w(this.x+this.width,this.y+this.height)}get corner(){return new w(this.x+this.width,this.y+this.height)}get rightMiddle(){return new w(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new w(this.x,this.y+this.height/2)}get topLine(){return new N(this.topLeft,this.topRight)}get rightLine(){return new N(this.topRight,this.bottomRight)}get bottomLine(){return new N(this.bottomLeft,this.bottomRight)}get leftLine(){return new N(this.topLeft,this.bottomLeft)}constructor(t,e,n,i){super(),this.x=t??0,this.y=e??0,this.width=n??0,this.height=i??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=It(t),n=Math.abs(Math.sin(e)),i=Math.abs(Math.cos(e)),o=this.width*i+this.height*n,r=this.width*n+this.height*i;return new I(this.x+(this.width-o)/2,this.y+(this.height-r)/2,o,r)}round(t=0){return this.x=Je(this.x,t),this.y=Je(this.y,t),this.width=Je(this.width,t),this.height=Je(this.height,t),this}add(t,e,n,i){const o=I.create(t,e,n,i),r=Math.min(this.x,o.x),a=Math.min(this.y,o.y),l=Math.max(this.x+this.width,o.x+o.width),c=Math.max(this.y+this.height,o.y+o.height);return this.x=r,this.y=a,this.width=l-r,this.height=c-a,this}update(t,e,n,i){const o=I.create(t,e,n,i);return this.x=o.x,this.y=o.y,this.width=o.width,this.height=o.height,this}inflate(t,e){const n=t,i=e??t;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),i=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(t,e){const n=w.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new w){const i=this.origin.scale(t,e,n);return this.x=i.x,this.y=i.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(t!==0){const n=It(t),i=Math.cos(n),o=Math.sin(n);let r=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();r=w.rotateEx(r,i,o,e),a=w.rotateEx(a,i,o,e),l=w.rotateEx(l,i,o,e),c=w.rotateEx(c,i,o,e);const h=new I(r.x,r.y,0,0);h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),h.add(c.x,c.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=I.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=I.clone(t),i=e.x,o=e.y;let r=1/0,a=1/0,l=1/0,c=1/0,h=1/0,u=1/0,d=1/0,f=1/0;const p=n.topLeft;p.x<i&&(r=(this.x-i)/(p.x-i)),p.y<o&&(h=(this.y-o)/(p.y-o));const m=n.bottomRight;m.x>i&&(a=(this.x+this.width-i)/(m.x-i)),m.y>o&&(u=(this.y+this.height-o)/(m.y-o));const b=n.topRight;b.x>i&&(l=(this.x+this.width-i)/(b.x-i)),b.y<o&&(d=(this.y-o)/(b.y-o));const y=n.bottomLeft;return y.x<i&&(c=(this.x-i)/(y.x-i)),y.y>o&&(f=(this.y+this.height-o)/(y.y-o)),{sx:Math.min(r,a,l,c),sy:Math.min(h,u,d,f)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return Rl(this,w.create(t,e))}containsRect(t,e,n,i){const o=I.create(t,e,n,i),r=this.x,a=this.y,l=this.width,c=this.height,h=o.x,u=o.y,d=o.width,f=o.height;return l===0||c===0||d===0||f===0?!1:h>=r&&u>=a&&h+d<=r+l&&u+f<=a+c}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return e.forEach(o=>{const r=t.intersectsWithLine(o);r!==null&&i.indexOf(r.toString())<0&&(n.push(r),i.push(r.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=w.clone(t),i=this.center;let o=null;e!=null&&e!==0&&n.rotate(e,i);const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new N(i,n);for(let l=r.length-1;l>=0;l-=1){const c=r[l].intersectsWithLine(a);if(c!==null){o=c;break}}return o&&e!=null&&e!==0&&o.rotate(-e,i),o}intersectsWithRect(t,e,n,i){const o=I.create(t,e,n,i);if(!this.isIntersectWithRect(o))return null;const r=this.origin,a=this.corner,l=o.origin,c=o.corner,h=Math.max(r.x,l.x),u=Math.max(r.y,l.y);return new I(h,u,Math.min(a.x,c.x)-h,Math.min(a.y,c.y)-u)}isIntersectWithRect(t,e,n,i){const o=I.create(t,e,n,i),r=this.origin,a=this.corner,l=o.origin,c=o.corner;return!(c.x<=r.x||c.y<=r.y||l.x>=a.x||l.y>=a.y)}normalize(){let t=this.x,e=this.y,n=this.width,i=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,i=-this.height),this.x=t,this.y=e,this.width=n,this.height=i,this}union(t){const e=I.clone(t),n=this.origin,i=this.corner,o=e.origin,r=e.corner,a=Math.min(n.x,o.x),l=Math.min(n.y,o.y),c=Math.max(i.x,r.x),h=Math.max(i.y,r.y);return new I(a,l,c-a,h-l)}getNearestSideToPoint(t){const e=w.clone(t),n=e.x-this.x,i=this.x+this.width-e.x,o=e.y-this.y,r=this.y+this.height-e.y;let a=n,l="left";return i<a&&(a=i,l="right"),o<a&&(a=o,l="top"),r<a&&(l="bottom"),l}getNearestPointToPoint(t){const e=w.clone(t);if(this.containsPoint(e)){const n=this.getNearestSideToPoint(e);if(n==="left")return new w(this.x,e.y);if(n==="top")return new w(e.x,this.y);if(n==="right")return new w(this.x+this.width,e.y);if(n==="bottom")return new w(e.x,this.y+this.height)}return e.adhereToRect(this)}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new I(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class N extends ke{static isLine(t){return t!=null&&t instanceof N}get center(){return new w((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(t,e,n,i){super(),typeof t=="number"&&typeof e=="number"?(this.start=new w(t,e),this.end=new w(n,i)):(this.start=w.create(t),this.end=w.create(e))}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:i}=e,o=n.clone().rotate(270,i),r=i.clone().rotate(90,n);return n.move(r,t),i.move(o,t),e}vector(){return new w(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new w(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new I(t,e,n-t,i-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new N(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let i=!0;t<0&&(i=!1,t=-t);const o=this.length();if(t>=o)return i?n.clone():e.clone();const r=(i?t:o-t)/o;return this.pointAt(r)}divideAt(t){const e=this.pointAt(t);return[new N(this.start,e),new N(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new N(this.start,e),new N(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(e.cross(t,n)!==0)return!1;const i=this.length();return!(new N(e,t).length()>i||new N(t,n).length()>i)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new w(this.end.x-this.start.x,this.end.y-this.start.y),n=new w(t.end.x-t.start.x,t.end.y-t.start.y),i=e.x*n.y-e.y*n.x,o=new w(t.start.x-this.start.x,t.start.y-this.start.y),r=o.x*n.y-o.y*n.x,a=o.x*e.y-o.y*e.x;if(i===0||r*i<0||a*i<0)return null;if(i>0){if(r>i||a>i)return null}else if(r<i||a<i)return null;return new w(this.start.x+r*e.x/i,this.start.y+r*e.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=w.clone(t),n=this.start,i=this.end;return((i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x))/this.length()}pointSquaredDistance(t,e){const n=w.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=w.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAt(t),o=new N(e,n);return o.translate(i.x-e.x,i.y-e.y),o}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAtLength(t),o=new N(e,n);return o.translate(i.x-e.x,i.y-e.y),o}relativeCcw(t,e){const n=w.create(t,e);let i=n.x-this.start.x,o=n.y-this.start.y;const r=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=i*a-o*r;return l===0&&(l=i*r+o*a,l>0&&(i-=r,o-=a,l=i*r+o*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(t){return t!=null&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new N(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class Ft extends ke{static isEllipse(t){return t!=null&&t instanceof Ft}static create(t,e,n,i){return t==null||typeof t=="number"?new Ft(t,e,n,i):Ft.parse(t)}static parse(t){return Ft.isEllipse(t)?t.clone():Array.isArray(t)?new Ft(t[0],t[1],t[2],t[3]):new Ft(t.x,t.y,t.a,t.b)}static fromRect(t){const e=t.center;return new Ft(e.x,e.y,t.width/2,t.height/2)}get center(){return new w(this.x,this.y)}constructor(t,e,n,i){super(),this.x=t??0,this.y=e??0,this.a=n??0,this.b=i??0}bbox(){return I.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,i=e??t;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(t,e){const n=w.create(t,e),i=n.x-this.x,o=n.y-this.y,r=this.a,a=this.b;return i*i/(r*r)+o*o/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,i=this.b,o=t.start,r=t.end,a=t.vector(),l=o.diff(new w(this.x,this.y)),c=new w(a.x/(n*n),a.y/(i*i)),h=new w(l.x/(n*n),l.y/(i*i)),u=a.dot(c),d=a.dot(h),f=l.dot(h)-1,p=d*d-u*f;if(p<0)return null;if(p>0){const m=Math.sqrt(p),b=(-d-m)/u,y=(-d+m)/u;if((b<0||b>1)&&(y<0||y>1))return null;b>=0&&b<=1&&e.push(o.lerp(r,b)),y>=0&&y<=1&&e.push(o.lerp(r,y))}else{const m=-d/u;if(m>=0&&m<=1)e.push(o.lerp(r,m));else return null}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=w.clone(t);e&&n.rotate(e,this.getCenter());const i=n.x-this.x,o=n.y-this.y;let r;if(i===0)return r=this.bbox().getNearestPointToPoint(n),e?r.rotate(-e,this.getCenter()):r;const a=o/i,l=a*a,c=this.a*this.a,h=this.b*this.b;let u=Math.sqrt(1/(1/c+l/h));u=i<0?-u:u;const d=a*u;return r=new w(this.x+u,this.y+d),e?r.rotate(-e,this.getCenter()):r}tangentTheta(t){const e=w.clone(t),n=e.x,i=e.y,o=this.a,r=this.b,a=this.bbox().center,l=a.x,c=a.y,h=30,u=n>a.x+o/2,d=n<a.x-o/2;let f,p;return u||d?(p=n>a.x?i-h:i+h,f=o*o/(n-l)-o*o*(i-c)*(p-c)/(r*r*(n-l))+l):(f=i>a.y?n+h:n-h,p=r*r/(i-c)-r*r*(n-l)*(f-l)/(o*o*(i-c))+c),new w(f,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=I.fromEllipse(this);n.rotate(t,e);const i=Ft.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(t,e){const n=w.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new Ft(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const ny=new RegExp("^[\\s\\dLMCZz,.]*$");function iy(s){return typeof s!="string"?!1:ny.test(s)}function fo(s,t){return(s%t+t)%t}function sy(s,t,e,n,i){if(!s||s.length===0)return"";const o=[],r=s[s.length-1],a=t!=null&&t>0,l=t||0;if(n&&a){s=s.slice();const u=s[0],d=new w(r.x+(u.x-r.x)/2,r.y+(u.y-r.y)/2);s.splice(0,0,d)}let c=s[0],h=1;for(e?o.push("M",c.x,c.y):o.push("L",c.x,c.y);h<(n?s.length:s.length-1);){let u=s[fo(h,s.length)],d=c.x-u.x,f=c.y-u.y;if(a&&(d!==0||f!==0)&&(i==null||i.indexOf(h-1)<0)){let p=Math.sqrt(d*d+f*f);const m=d*Math.min(l,p/2)/p,b=f*Math.min(l,p/2)/p,y=u.x+m,C=u.y+b;o.push("L",y,C);let A=s[fo(h+1,s.length)];for(;h<s.length-2&&Math.round(A.x-u.x)===0&&Math.round(A.y-u.y)===0;)A=s[fo(h+2,s.length)],h+=1;d=A.x-u.x,f=A.y-u.y,p=Math.max(1,Math.sqrt(d*d+f*f));const x=d*Math.min(l,p/2)/p,v=f*Math.min(l,p/2)/p,B=u.x+x,E=u.y+v;o.push("Q",u.x,u.y,B,E),u=new w(B,E)}else o.push("L",u.x,u.y);c=u,h+=1}return n?o.push("Z"):o.push("L",r.x,r.y),o.map(u=>typeof u=="string"?u:+u.toFixed(3)).join(" ")}function oy(s,t={}){const e=[];return s&&s.length&&s.forEach(n=>{Array.isArray(n)?e.push({x:n[0],y:n[1]}):e.push({x:n.x,y:n.y})}),sy(e,t.round,t.initialMove==null||t.initialMove,t.close,t.exclude)}function Ql(s,t,e,n,i=0,o=0,r=0,a,l){if(e===0||n===0)return[];a-=s,l-=t,e=Math.abs(e),n=Math.abs(n);const c=-a/2,h=-l/2,u=Math.cos(i*Math.PI/180),d=Math.sin(i*Math.PI/180),f=u*c+d*h,p=-1*d*c+u*h,m=f*f,b=p*p,y=e*e,C=n*n,A=m/y+b/C;let x;if(A>1)e=Math.sqrt(A)*e,n=Math.sqrt(A)*n,x=0;else{let W=1;o===r&&(W=-1),x=W*Math.sqrt((y*C-y*b-C*m)/(y*b+C*m))}const v=x*e*p/n,B=-1*x*n*f/e,E=u*v-d*B+a/2,M=d*v+u*B+l/2;let k=Math.atan2((p-B)/n,(f-v)/e)-Math.atan2(0,1),T=k>=0?k:2*Math.PI+k;k=Math.atan2((-p-B)/n,(-f-v)/e)-Math.atan2((p-B)/n,(f-v)/e);let P=k>=0?k:2*Math.PI+k;r===0&&P>0?P-=2*Math.PI:r!==0&&P<0&&(P+=2*Math.PI);const R=P*2/Math.PI,F=Math.ceil(R<0?-1*R:R),K=P/F,Z=8/3*Math.sin(K/4)*Math.sin(K/4)/Math.sin(K/2),Y=u*e,Et=u*n,Qt=d*e,Lt=d*n;let pt=Math.cos(T),Q=Math.sin(T),q=-Z*(Y*Q+Lt*pt),tt=-Z*(Qt*Q-Et*pt),J=0,et=0;const mt=[];for(let W=0;W<F;W+=1){T+=K,pt=Math.cos(T),Q=Math.sin(T),J=Y*pt-Lt*Q+E,et=Qt*pt+Et*Q+M;const bt=-Z*(Y*Q+Lt*pt),Ee=-Z*(Qt*Q-Et*pt),zt=W*6;mt[zt]=Number(q+s),mt[zt+1]=Number(tt+t),mt[zt+2]=Number(J-bt+s),mt[zt+3]=Number(et-Ee+t),mt[zt+4]=Number(J+s),mt[zt+5]=Number(et+t),q=J+bt,tt=et+Ee}return mt.map(W=>+W.toFixed(2))}class yt extends ke{static isPolyline(t){return t!=null&&t instanceof yt}static parse(t){const e=t.trim();if(e==="")return new yt;const n=[],i=e.split(/\s*,\s*|\s+/);for(let o=0,r=i.length;o<r;o+=2)n.push({x:+i[o],y:+i[o+1]});return new yt(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(t){if(super(),t!=null){if(typeof t=="string")return yt.parse(t);this.points=t.map(e=>w.create(e))}else this.points=[]}scale(t,e,n=new w){return this.points.forEach(i=>i.scale(t,e,n)),this}rotate(t,e){return this.points.forEach(n=>n.rotate(t,e)),this}translate(t,e){const n=w.create(t,e);return this.points.forEach(i=>i.translate(n.x,n.y)),this}round(t=0){return this.points.forEach(e=>e.round(t)),this}bbox(){if(this.points.length===0)return new I;let t=1/0,e=-1/0,n=1/0,i=-1/0;const o=this.points;for(let r=0,a=o.length;r<a;r+=1){const l=o[r],c=l.x,h=l.y;c<t&&(t=c),c>e&&(e=c),h<n&&(n=h),h>i&&(i=h)}return new I(t,n,e-t,i-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(n===0||n===1)return 0;let i=0,o=0,r=1/0;for(let a=0,l=n-1;a<l;a+=1){const c=new N(e[a],e[a+1]),h=c.length(),u=c.closestPointNormalizedLength(t),f=c.pointAt(u).squaredDistance(t);f<r&&(r=f,o=i+u*h),i+=h}return o}closestPointNormalizedLength(t){const e=this.length();return e===0?0:this.closestPointLength(t)/e}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(this.points.length===0)return!1;const e=w.clone(t),n=e.x,i=e.y,o=this.points,r=o.length;let a=r-1,l=0;for(let c=0;c<r;c+=1){const h=o[a],u=o[c];if(e.equals(h))return!0;const d=new N(h,u);if(d.containsPoint(t))return!0;if(i<=h.y&&i>u.y||i>h.y&&i<=u.y){const f=h.x-n>u.x-n?h.x-n:u.x-n;if(f>=0){const p=new w(n+f,i),m=new N(t,p);d.intersectsWithLine(m)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(t){const e=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const o=this.points[n],r=this.points[n+1],a=t.intersectsWithLine(new N(o,r));a&&e.push(a)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const n=this.points[t],i=this.points[t+1];if(new N(n,i).isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const i=this.points[e],o=this.points[e+1];t+=i.distance(o)}return t}pointAt(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1||t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const o=this.length()*t;return this.pointAtLength(o)}pointAtLength(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1)return e[0].clone();let i=!0;t<0&&(i=!1,t=-t);let o=0;for(let a=0,l=n-1;a<l;a+=1){const c=i?a:l-1-a,h=e[c],u=e[c+1],d=new N(h,u),f=h.distance(u);if(t<=o+f)return d.pointAtLength((i?1:-1)*(t-o));o+=f}return(i?e[n-1]:e[0]).clone()}tangentAt(t){const n=this.points.length;if(n===0||n===1)return null;t<0&&(t=0),t>1&&(t=1);const o=this.length()*t;return this.tangentAtLength(o)}tangentAtLength(t){const e=this.points,n=e.length;if(n===0||n===1)return null;let i=!0;t<0&&(i=!1,t=-t);let o,r=0;for(let a=0,l=n-1;a<l;a+=1){const c=i?a:l-1-a,h=e[c],u=e[c+1],d=new N(h,u),f=h.distance(u);if(d.isDifferentiable()){if(t<=r+f)return d.tangentAtLength((i?1:-1)*(t-r));o=d}r+=f}if(o){const a=i?1:0;return o.tangentAt(a)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let i=0;for(;e[i+2];){const o=i,r=i+1,a=i+2,l=e[o],c=e[r],h=e[a];new N(l,h).closestPoint(c).distance(c)<=n?e.splice(r,1):i+=1}return this}toHull(){const t=this.points,e=t.length;if(e===0)return new yt;let n=t[0];for(let d=1;d<e;d+=1)(t[d].y<n.y||t[d].y===n.y&&t[d].x>n.x)&&(n=t[d]);const i=[];for(let d=0;d<e;d+=1){let f=n.theta(t[d]);f===0&&(f=360),i.push([t[d],d,f])}if(i.sort((d,f)=>{let p=d[2]-f[2];return p===0&&(p=f[1]-d[1]),p}),i.length>2){const d=i[i.length-1];i.unshift(d)}const o={},r=[],a=d=>`${d[0].toString()}@${d[1]}`;for(;i.length!==0;){const d=i.pop(),f=d[0];if(o[a(d)])continue;let p=!1;for(;!p;)if(r.length<2)r.push(d),p=!0;else{const m=r.pop(),b=m[0],y=r.pop(),C=y[0],A=C.cross(b,f);if(A<0)r.push(y),r.push(m),r.push(d),p=!0;else if(A===0){const v=b.angleBetween(C,f);Math.abs(v-180)<1e-10||b.equals(f)||C.equals(b)?(o[a(m)]=b,r.push(y)):Math.abs((v+1)%360-1)<1e-10&&(r.push(y),i.push(m))}else o[a(m)]=b,r.push(y)}}r.length>2&&r.pop();let l,c=-1;for(let d=0,f=r.length;d<f;d+=1){const p=r[d][1];(l===void 0||p<l)&&(l=p,c=d)}let h=[];if(c>0){const d=r.slice(c),f=r.slice(0,c);h=d.concat(f)}else h=r;const u=[];for(let d=0,f=h.length;d<f;d+=1)u.push(h[d][0]);return new yt(u)}equals(t){return t==null||t.points.length!==this.points.length?!1:t.points.every((e,n)=>e.equals(this.points[n]))}clone(){return new yt(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.serialize()}`).join(" ")}}class dt extends ke{static isCurve(t){return t!=null&&t instanceof dt}static throughPoints(t){if(t==null||Array.isArray(t)&&t.length<2)throw new Error("At least 2 points are required");const e=ry(t),n=[];for(let i=0,o=e[0].length;i<o;i+=1){const r=new w(e[0][i].x,e[0][i].y),a=new w(e[1][i].x,e[1][i].y);n.push(new dt(t[i],r,a,t[i+1]))}return n}constructor(t,e,n,i){super(),this.PRECISION=3,this.start=w.create(t),this.controlPoint1=w.create(e),this.controlPoint2=w.create(n),this.end=w.create(i)}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end,o=t.x,r=t.y,a=e.x,l=e.y,c=n.x,h=n.y,u=i.x,d=i.y,f=[],p=[[],[]];let m,b,y,C,A,x,v,B;for(let Y=0;Y<2;Y+=1){if(Y===0?(b=6*o-12*a+6*c,m=-3*o+9*a-9*c+3*u,y=3*a-3*o):(b=6*r-12*l+6*h,m=-3*r+9*l-9*h+3*d,y=3*l-3*r),Math.abs(m)<1e-12){if(Math.abs(b)<1e-12)continue;C=-y/b,C>0&&C<1&&f.push(C);continue}v=b*b-4*y*m,B=Math.sqrt(v),!(v<0)&&(A=(-b+B)/(2*m),A>0&&A<1&&f.push(A),x=(-b-B)/(2*m),x>0&&x<1&&f.push(x))}let E,M,k,T=f.length;const P=T;for(;T;)T-=1,C=f[T],k=1-C,E=k*k*k*o+3*k*k*C*a+3*k*C*C*c+C*C*C*u,p[0][T]=E,M=k*k*k*r+3*k*k*C*l+3*k*C*C*h+C*C*C*d,p[1][T]=M;f[P]=0,f[P+1]=1,p[0][P]=o,p[1][P]=r,p[0][P+1]=u,p[1][P+1]=d,f.length=P+2,p[0].length=P+2,p[1].length=P+2;const R=Math.min.apply(null,p[0]),F=Math.min.apply(null,p[1]),K=Math.max.apply(null,p[0]),Z=Math.max.apply(null,p[1]);return new I(R,F,K-R,Z-F)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(!i)return 0;const o=this.length(n);return o===0?0:i/o}closestPointT(t,e={}){const n=this.getPrecision(e),i=this.getDivisions(e),o=Math.pow(10,-n);let r=null,a=0,l=0,c=0,h=0,u=0,d=null;const f=i.length;let p=f>0?1/f:0;for(i.forEach((m,b)=>{const y=m.start.distance(t),C=m.end.distance(t),A=y+C;(d==null||A<d)&&(r=m,a=b*p,l=(b+1)*p,c=y,h=C,d=A,u=m.endpointDistance())});;){const m=c?Math.abs(c-h)/c:0,b=h!=null?Math.abs(c-h)/h:0,y=m<o||b<o,C=c?c<u*o:!0,A=h?h<u*o:!0;if(y||(C||A))return c<=h?a:l;const v=r.divide(.5);p/=2;const B=v[0].start.distance(t),E=v[0].end.distance(t),M=B+E,k=v[1].start.distance(t),T=v[1].end.distance(t),P=k+T;M<=P?(r=v[0],l-=p,c=B,h=E):(r=v[1],a+=p,c=k,h=T)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,o=this.end;if(t<=0)return[new dt(e,e,e,e),new dt(e,n,i,o)];if(t>=1)return[new dt(e,n,i,o),new dt(o,o,o,o)];const r=this.getSkeletonPoints(t),a=r.startControlPoint1,l=r.startControlPoint2,c=r.divider,h=r.dividerControlPoint1,u=r.dividerControlPoint2;return[new dt(e,a,l,c),new dt(c,h,u,o)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,o=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:o.clone(),dividerControlPoint1:o.clone(),dividerControlPoint2:o.clone()};const r=new N(e,n).pointAt(t),a=new N(n,i).pointAt(t),l=new N(i,o).pointAt(t),c=new N(r,a).pointAt(t),h=new N(a,l).pointAt(t),u=new N(c,h).pointAt(t);return{startControlPoint1:r,startControlPoint2:c,divider:u,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new dt(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(e===0)return n;let i=this.endpointDistance();const o=Math.pow(10,-e);let r=0;for(;;){r+=1;const a=[];n.forEach(h=>{const u=h.divide(.5);a.push(u[0],u[1])});const l=a.reduce((h,u)=>h+u.endpointDistance(),0),c=l!==0?(l-i)/l:0;if(r>1&&c<o)return a;n=a,i=l}}length(t={}){return this.getDivisions(t).reduce((n,i)=>n+i.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=e.precision===void 0?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,i=e.dividerControlPoint1,o=e.divider,r=new N(n,i);return r.translate(o.x-n.x,o.y-n.y),r}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getDivisions(t={}){if(t.subdivisions!=null)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),o=this.length(n)*t;return this.tAtLength(o,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),o=this.getDivisions(e),r={precision:i,subdivisions:o};let a=null,l,c,h=0,u=0,d=0;const f=o.length;let p=f>0?1/f:0;for(let y=0;y<f;y+=1){const C=n?y:f-1-y,A=o[y],x=A.endpointDistance();if(t<=d+x){a=A,l=C*p,c=(C+1)*p,h=n?t-d:x+d-t,u=n?x+d-t:t-d;break}d+=x}if(a==null)return n?1:0;const m=this.length(r),b=Math.pow(10,-i);for(;;){let y;if(y=m!==0?h/m:0,y<b)return l;if(y=m!==0?u/m:0,y<b)return c;let C,A;const x=a.divide(.5);p/=2;const v=x[0].endpointDistance(),B=x[1].endpointDistance();h<=v?(a=x[0],c-=p,C=h,A=v-C):(a=x[1],l+=p,C=h-v,A=B-C),h=C,u=A}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach(i=>n.push(i.end.clone())),n}toPolyline(t={}){return new yt(this.toPoints(t))}scale(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return t!=null&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new dt(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}function Ll(s){const t=s.length,e=[],n=[];let i=2;e[0]=s[0]/i;for(let o=1;o<t;o+=1)n[o]=1/i,i=(o<t-1?4:3.5)-n[o],e[o]=(s[o]-e[o-1])/i;for(let o=1;o<t;o+=1)e[t-o-1]-=n[t-o]*e[t-o];return e}function ry(s){const t=s.map(l=>w.clone(l)),e=[],n=[],i=t.length-1;if(i===1)return e[0]=new w((2*t[0].x+t[1].x)/3,(2*t[0].y+t[1].y)/3),n[0]=new w(2*e[0].x-t[0].x,2*e[0].y-t[0].y),[e,n];const o=[];for(let l=1;l<i-1;l+=1)o[l]=4*t[l].x+2*t[l+1].x;o[0]=t[0].x+2*t[1].x,o[i-1]=(8*t[i-1].x+t[i].x)/2;const r=Ll(o);for(let l=1;l<i-1;l+=1)o[l]=4*t[l].y+2*t[l+1].y;o[0]=t[0].y+2*t[1].y,o[i-1]=(8*t[i-1].y+t[i].y)/2;const a=Ll(o);for(let l=0;l<i;l+=1)e.push(new w(r[l],a[l])),l<i-1?n.push(new w(2*t[l+1].x-r[l+1],2*t[l+1].y-a[l+1])):n.push(new w((t[i].x+r[i-1])/2,(t[i].y+a[i-1])/2));return[e,n]}class _i extends ke{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class gt extends _i{static create(...t){const e=t.length,n=t[0];if(N.isLine(n))return new gt(n);if(w.isPointLike(n))return e===1?new gt(n):t.map(o=>new gt(o));if(e===2)return new gt(+t[0],+t[1]);const i=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];i.push(new gt(r,a))}return i}constructor(t,e){super(),N.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=w.create(t,e).round(2)}get type(){return"L"}get line(){return new N(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new gt(e[0]),new gt(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new gt(e[0]),new gt(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new gt(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class Kn extends _i{static create(){return new Kn}get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new N(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new gt(e[0]):this.clone(),new gt(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new gt(e[0]):this.clone(),new gt(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new Kn}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class le extends _i{static create(...t){const e=t.length,n=t[0];if(N.isLine(n))return new le(n);if(dt.isCurve(n))return new le(n);if(w.isPointLike(n)){if(e===1)return new le(n);const o=[];for(let r=0;r<e;r+=1)r===0?o.push(new le(t[r])):o.push(new gt(t[r]));return o}if(e===2)return new le(+t[0],+t[1]);const i=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];o===0?i.push(new le(r,a)):i.push(new gt(r,a))}return i}constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,N.isLine(t)||dt.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=w.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}clone(){return new le(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class Ot extends _i{static create(...t){const e=t.length,n=t[0];if(dt.isCurve(n))return new Ot(n);if(w.isPointLike(n)){if(e===3)return new Ot(t[0],t[1],t[2]);const o=[];for(let r=0;r<e;r+=3)o.push(new Ot(t[r],t[r+1],t[r+2]));return o}if(e===6)return new Ot(t[0],t[1],t[2],t[3],t[4],t[5]);const i=[];for(let o=0;o<e;o+=6)i.push(new Ot(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return i}constructor(t,e,n,i,o,r){super(),dt.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):typeof t=="number"?(this.controlPoint1=new w(t,e).round(2),this.controlPoint2=new w(n,i).round(2),this.endPoint=new w(o,r).round(2)):(this.controlPoint1=w.create(t).round(2),this.controlPoint2=w.create(e).round(2),this.endPoint=w.create(n).round(2))}get type(){return"C"}get curve(){return new dt(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new Ot(n[0]),new Ot(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new Ot(n[0]),new Ot(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new Ot(e[0]),new Ot(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new Ot(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")}}function Wi(s,t,e){return{x:s*Math.cos(e)-t*Math.sin(e),y:s*Math.sin(e)+t*Math.cos(e)}}function zl(s,t,e,n,i,o){const r=.3333333333333333,a=2/3;return[r*s+a*e,r*t+a*n,r*i+a*e,r*o+a*n,i,o]}function Fl(s,t,e,n,i,o,r,a,l,c){const h=Math.PI*120/180,u=Math.PI/180*(+i||0);let d=[],f,p,m,b,y;if(c)p=c[0],m=c[1],b=c[2],y=c[3];else{f=Wi(s,t,-u),s=f.x,t=f.y,f=Wi(a,l,-u),a=f.x,l=f.y;const K=(s-a)/2,Z=(t-l)/2;let Y=K*K/(e*e)+Z*Z/(n*n);Y>1&&(Y=Math.sqrt(Y),e=Y*e,n=Y*n);const Et=e*e,Qt=n*n,Lt=(o===r?-1:1)*Math.sqrt(Math.abs((Et*Qt-Et*Z*Z-Qt*K*K)/(Et*Z*Z+Qt*K*K)));b=Lt*e*Z/n+(s+a)/2,y=Lt*-n*K/e+(t+l)/2,p=Math.asin((t-y)/n),m=Math.asin((l-y)/n),p=s<b?Math.PI-p:p,m=a<b?Math.PI-m:m,p<0&&(p=Math.PI*2+p),m<0&&(m=Math.PI*2+m),r&&p>m&&(p-=Math.PI*2),!r&&m>p&&(m-=Math.PI*2)}let C=m-p;if(Math.abs(C)>h){const K=m,Z=a,Y=l;m=p+h*(r&&m>p?1:-1),a=b+e*Math.cos(m),l=y+n*Math.sin(m),d=Fl(a,l,e,n,i,0,r,Z,Y,[m,K,b,y])}C=m-p;const A=Math.cos(p),x=Math.sin(p),v=Math.cos(m),B=Math.sin(m),E=Math.tan(C/4),M=4/3*(e*E),k=4/3*(n*E),T=[s,t],P=[s+M*x,t-k*A],R=[a+M*B,l-k*v],F=[a,l];if(P[0]=2*T[0]-P[0],P[1]=2*T[1]-P[1],c)return[P,R,F].concat(d);{d=[P,R,F].concat(d).join().split(",");const K=[],Z=d.length;for(let Y=0;Y<Z;Y+=1)K[Y]=Y%2?Wi(+d[Y-1],+d[Y],u).y:Wi(+d[Y],+d[Y+1],u).x;return K}}function ay(s){if(!s)return null;const t=`
|
|
2
|
-
\v\f\r \u2028\u2029`,e=new RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),n=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return s.replace(e,(r,a,l)=>{const c=[];let h=a.toLowerCase();l.replace(n,(d,f)=>(f&&c.push(+f),d)),h==="m"&&c.length>2&&(o.push([a,...c.splice(0,2)]),h="l",a=a==="m"?"l":"L");const u=i[h];for(;c.length>=u&&(o.push([a,...c.splice(0,u)]),!!u););return r}),o}function ly(s){const t=ay(s);if(!t||!t.length)return[["M",0,0]];let e=0,n=0,i=0,o=0;const r=[];for(let a=0,l=t.length;a<l;a+=1){const c=[];r.push(c);const h=t[a],u=h[0];if(u!==u.toUpperCase())switch(c[0]=u.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+e,c[7]=+h[7]+n;break;case"V":c[1]=+h[1]+n;break;case"H":c[1]=+h[1]+e;break;case"M":i=+h[1]+e,o=+h[2]+n;for(let d=1,f=h.length;d<f;d+=1)c[d]=+h[d]+(d%2?e:n);break;default:for(let d=1,f=h.length;d<f;d+=1)c[d]=+h[d]+(d%2?e:n);break}else for(let d=0,f=h.length;d<f;d+=1)c[d]=h[d];switch(c[0]){case"Z":e=+i,n=+o;break;case"H":e=c[1];break;case"V":n=c[1];break;case"M":i=c[c.length-2],o=c[c.length-1],e=c[c.length-2],n=c[c.length-1];break;default:e=c[c.length-2],n=c[c.length-1];break}}return r}function cy(s){const t=ly(s),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function n(l,c,h){let u,d;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(Fl.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(u=c.x*2-c.bx,d=c.y*2-c.by):(u=c.x,d=c.y),["C",u,d].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(zl(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(zl(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function i(l,c){if(l[c].length>7){l[c].shift();const h=l[c];for(;h.length;)o[c]="A",c+=1,l.splice(c,0,["C"].concat(h.splice(0,6)));l.splice(c,1),a=t.length}}const o=[];let r="",a=t.length;for(let l=0;l<a;l+=1){let c="";t[l]&&(c=t[l][0]),c!=="C"&&(o[l]=c,l>0&&(r=o[l-1])),t[l]=n(t[l],e,r),o[l]!=="A"&&c==="C"&&(o[l]="C"),i(t,l);const h=t[l],u=h.length;e.x=h[u-2],e.y=h[u-1],e.bx=parseFloat(h[u-4])||e.x,e.by=parseFloat(h[u-3])||e.y}return(!t[0][0]||t[0][0]!=="M")&&t.unshift(["M",0,0]),t}function Ul(s){return cy(s).map(t=>t.map(e=>typeof e=="string"?e:Je(e,2))).join(",").split(",").join(" ")}class z extends ke{static isPath(t){return t!=null&&t instanceof z}static parse(t){if(!t)return new z;const e=new z,n=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,i=Ul(t).match(n);if(i!=null)for(let o=0,r=i.length;o<r;o+=1){const a=i[o],l=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,c=a.match(l);if(c!=null){const h=c[0],u=c.slice(1).map(f=>+f),d=z.createSegment.call(null,h,...u);e.appendSegment(d)}}return e}static createSegment(t,...e){if(t==="M")return le.create.call(null,...e);if(t==="L")return gt.create.call(null,...e);if(t==="C")return Ot.create.call(null,...e);if(t==="z"||t==="Z")return Kn.create();throw new Error(`Invalid path segment type "${t}"`)}constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(N.isLine(t[0])||dt.isCurve(t[0])){let e=null;t.forEach((i,o)=>{o===0&&this.appendSegment(z.createSegment("M",i.start)),e!=null&&!e.end.equals(i.start)&&this.appendSegment(z.createSegment("M",i.start)),N.isLine(i)?this.appendSegment(z.createSegment("L",i.end)):dt.isCurve(i)&&this.appendSegment(z.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),e=i})}else t.forEach(n=>{n.isSegment&&this.appendSegment(n)});else t!=null&&(N.isLine(t)?(this.appendSegment(z.createSegment("M",t.start)),this.appendSegment(z.createSegment("L",t.end))):dt.isCurve(t)?(this.appendSegment(z.createSegment("M",t.start)),this.appendSegment(z.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):yt.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((e,n)=>{const i=n===0?z.createSegment("M",e):z.createSegment("L",e);this.appendSegment(i)}):t.isSegment&&this.appendSegment(t))}get start(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=0;n<e;n+=1){const i=t[n];if(i.isVisible)return i.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=e-1;n>=0;n-=1){const i=t[n];if(i.isVisible)return i.end}return t[e-1].end}moveTo(...t){return this.appendSegment(le.create.call(null,...t))}lineTo(...t){return this.appendSegment(gt.create.call(null,...t))}curveTo(...t){return this.appendSegment(Ot.create.call(null,...t))}arcTo(t,e,n,i,o,r,a){const l=this.end||new w,c=typeof r=="number"?Ql(l.x,l.y,t,e,n,i,o,r,a):Ql(l.x,l.y,t,e,n,i,o,r.x,r.y);if(c!=null)for(let h=0,u=c.length;h<u;h+=6)this.curveTo(c[h],c[h+1],c[h+2],c[h+3],c[h+4],c[h+5]);return this}quadTo(t,e,n,i){const o=this.end||new w,r=["M",o.x,o.y];if(typeof t=="number")r.push("Q",t,e,n,i);else{const l=e;r.push("Q",t.x,t.y,l.x,l.y)}const a=z.parse(r.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Kn.create())}drawPoints(t,e={}){const n=oy(t,e),i=z.parse(n);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const t=this.segments,e=t.length;if(e===0)return null;let n;for(let o=0;o<e;o+=1){const r=t[o];if(r.isVisible){const a=r.bbox();a!=null&&(n=n?n.union(a):a)}}if(n!=null)return n;const i=t[e-1];return new I(i.end.x,i.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n=e!==0?this.segments[e-1]:null,i;const o=null;if(Array.isArray(t))for(let r=0,a=t.length;r<a;r+=1){const l=t[r];i=this.prepareSegment(l,n,o),this.segments.push(i),n=i}else t!=null&&t.isSegment&&(i=this.prepareSegment(t,n,o),this.segments.push(i));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let i,o=null,r=null;if(n!==0&&(t>=1?(o=this.segments[t-1],r=o.nextSegment):(o=null,r=this.segments[0])),!Array.isArray(e))i=this.prepareSegment(e,o,r),this.segments.splice(t,0,i);else for(let a=0,l=e.length;a<l;a+=1){const c=e[a];i=this.prepareSegment(c,o,r),this.segments.splice(t+a,0,i),o=i}return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],i=n.previousSegment,o=n.nextSegment;return i&&(i.nextSegment=o),o&&(o.previousSegment=i),n.isSubpathStart&&o&&this.updateSubpathStartSegment(o),n}replaceSegment(t,e){const n=this.fixIndex(t);let i;const o=this.segments[n];let r=o.previousSegment;const a=o.nextSegment;let l=o.isSubpathStart;if(!Array.isArray(e))i=this.prepareSegment(e,r,a),this.segments.splice(n,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(t,1);for(let c=0,h=e.length;c<h;c+=1){const u=e[c];i=this.prepareSegment(u,r,a),this.segments.splice(t+c,0,i),r=i,l&&i.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(e===0)throw new Error("Path has no segments.");let n=t;for(;n<0;)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(this.segments.length===0)return null;const n=cn(t,0,1),i=this.getOptions(e),r=this.length(i)*n;return this.segmentIndexAtLength(r,i)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(n===0)return null;let i=!0;t<0&&(i=!1,t=-t);const o=this.getPrecision(e),r=this.getSubdivisions(e);let a=0,l=null;for(let c=0;c<n;c+=1){const h=i?c:n-1-c,u=this.segments[h],d=r[h],f=u.length({precision:o,subdivisions:d});if(u.isVisible){if(t<=a+f)return h;l=h}a+=f}return l}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let i=0,o=this.segments.length;i<o;i+=1){const a=this.segments[i].getSubdivisions({precision:e});n.push(a)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;for(;n&&!n.isSubpathStart;)e!=null?n.subpathStartSegment=e.subpathStartSegment:n.subpathStartSegment=null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,e!=null&&(e.nextSegment=t),n!=null&&(n.previousSegment=t);let i=t;return t.isSubpathStart&&(t.subpathStartSegment=t,i=n),i!=null&&this.updateSubpathStartSegment(i),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),i=this.closestPointT(t,n);return i?this.lengthAtT(i,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(i===0)return 0;const o=this.length(n);return o===0?0:i/o}closestPointT(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=i[a];if(c.isVisible){const u=c.closestPointT(t,{precision:n,subdivisions:h}),d=c.pointAtT(u),f=Dl(d,t);f<r&&(o={segmentIndex:a,value:u},r=f)}}return o||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=i[a];if(c.isDifferentiable()){const u=c.closestPointT(t,{precision:n,subdivisions:h}),d=c.pointAtT(u),f=Dl(d,t);f<r&&(o=c.tangentAtT(u),r=f)}}return o||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let i=0;for(let o=0,r=n.length;o<r;o+=1)n[o].containsPoint(t)&&(i+=1);return i%2===1}pointAt(t,e={}){if(this.segments.length===0)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),o=this.length(n)*t;return this.pointAtLength(o,n)}pointAtLength(t,e={}){if(this.segments.length===0)return null;if(t===0)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let c=0,h=this.segments.length;c<h;c+=1){const u=n?c:h-1-c,d=this.segments[u],f=o[u],p=d.length({precision:i,subdivisions:f});if(d.isVisible){if(t<=a+p)return d.pointAtLength((n?1:-1)*(t-a),{precision:i,subdivisions:f});r=d}a+=p}return r?n?r.end:r.start:this.segments[this.segments.length-1].end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(n===0)return null;const i=t.segmentIndex;if(i<0)return e[0].pointAtT(0);if(i>=n)return e[n-1].pointAtT(1);const o=cn(t.value,0,1);return e[i].pointAtT(o)}divideAt(t,e={}){if(this.segments.length===0)return null;const n=cn(t,0,1),i=this.getOptions(e),r=this.length(i)*n;return this.divideAtLength(r,i)}divideAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),o=this.getSubdivisions(e);let r=0,a,l,c,h,u;for(let v=0,B=this.segments.length;v<B;v+=1){const E=n?v:B-1-v,M=this.getSegment(E),k=o[E],T={precision:i,subdivisions:k},P=M.length(T);if(M.isDifferentiable()&&(c=M,h=E,t<=r+P)){l=E,a=M.divideAtLength((n?1:-1)*(t-r),T);break}r+=P}if(!c)return null;a||(l=h,u=n?1:0,a=c.divideAtT(u));const d=this.clone(),f=l;d.replaceSegment(f,a);const p=f;let m=f+1,b=f+2;a[0].isDifferentiable()||(d.removeSegment(p),m-=1,b-=1);const y=d.getSegment(m).start;d.insertSegment(m,z.createSegment("M",y)),b+=1,a[1].isDifferentiable()||(d.removeSegment(b-1),b-=1);const C=b-p-1;for(let v=b,B=d.segments.length;v<B;v+=1){const E=this.getSegment(v-C),M=d.getSegment(v);if(M.type==="Z"&&!E.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const k=z.createSegment("L",E.end);d.replaceSegment(v,k)}}const A=new z(d.segments.slice(0,m)),x=new z(d.segments.slice(m));return[A,x]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(n==null)return null;let i=null;for(let o=0,r=n.length;o<r;o+=1){const a=n[o],l=t.intersect(a);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1)if(this.segments[t].isDifferentiable())return!0;return!1}isValid(){const t=this.segments;return t.length===0||t[0].type==="M"}length(t={}){if(this.segments.length===0)return 0;const e=this.getSubdivisions(t);let n=0;for(let i=0,o=this.segments.length;i<o;i+=1){const r=this.segments[i],a=e[i];n+=r.length({subdivisions:a})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(n===0)return 0;let i=t.segmentIndex;if(i<0)return 0;let o=cn(t.value,0,1);i>=n&&(i=n-1,o=1);const r=this.getPrecision(e),a=this.getSubdivisions(e);let l=0;for(let u=0;u<i;u+=1){const d=this.segments[u],f=a[u];l+=d.length({precision:r,subdivisions:f})}const c=this.segments[i],h=a[i];return l+=c.lengthAtT(o,{precision:r,subdivisions:h}),l}tangentAt(t,e={}){if(this.segments.length===0)return null;const n=cn(t,0,1),i=this.getOptions(e),r=this.length(i)*n;return this.tangentAtLength(r,i)}tangentAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const h=n?l:c-1-l,u=this.segments[h],d=o[h],f=u.length({precision:i,subdivisions:d});if(u.isDifferentiable()){if(t<=a+f)return u.tangentAtLength((n?1:-1)*(t-a),{precision:i,subdivisions:d});r=u}a+=f}if(r){const l=n?1:0;return r.tangentAtT(l)}return null}tangentAtT(t){const e=this.segments.length;if(e===0)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const i=cn(t.value,0,1);return this.segments[n].tangentAtT(i)}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getSubdivisions(t={}){if(t.segmentSubdivisions==null){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(n===0)return null;const i=this.getSubdivisions(t),o=[];let r=[];for(let a=0;a<n;a+=1){const l=e[a];if(l.isVisible){const c=i[a];c.length>0?c.forEach(h=>r.push(h.start)):r.push(l.start)}else r.length>0&&(r.push(e[a-1].end),o.push(r),r=[])}return r.length>0&&(r.push(this.end),o.push(r)),o}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(n=>new yt(n)):null}scale(t,e,n){return this.segments.forEach(i=>i.scale(t,e,n)),this}rotate(t,e){return this.segments.forEach(n=>n.rotate(t,e)),this}translate(t,e){return typeof t=="number"?this.segments.forEach(n=>n.translate(t,e)):this.segments.forEach(n=>n.translate(t)),this}clone(){const t=new z;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(t==null)return!1;const e=this.segments,n=t.segments,i=e.length;if(n.length!==i)return!1;for(let o=0;o<i;o+=1){const r=e[o],a=n[o];if(r.type!==a.type||!r.equals(a))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}function hn(s,t,e){let n,i;typeof t=="object"?(n=t.x,i=t.y):(n=t,i=e);const o=z.parse(s),r=o.bbox();if(r){let a=-r.height/2-r.y,l=-r.width/2-r.x;typeof n=="number"&&(l-=n),typeof i=="number"&&(a-=i),o.translate(l,a)}return o.serialize()}const po=/[\t\r\n\f]/g,mo=/\S+/g,un=s=>` ${s} `;function dn(s){return s&&s.getAttribute&&s.getAttribute("class")||""}function ce(s,t){if(s==null||t==null)return!1;const e=un(dn(s)),n=un(t);return s.nodeType===1?e.replace(po," ").includes(n):!1}function O(s,t){if(!(s==null||t==null)){if(typeof t=="function")return O(s,t(dn(s)));if(typeof t=="string"&&s.nodeType===1){const e=t.match(mo)||[],n=un(dn(s)).replace(po," ");let i=e.reduce((o,r)=>o.indexOf(un(r))<0?`${o}${r} `:o,n);i=i.trim(),n!==i&&s.setAttribute("class",i)}}}function st(s,t){if(s!=null){if(typeof t=="function")return st(s,t(dn(s)));if((!t||typeof t=="string")&&s.nodeType===1){const e=(t||"").match(mo)||[],n=un(dn(s)).replace(po," ");let i=e.reduce((o,r)=>{const a=un(r);return o.indexOf(a)>-1?o.replace(a," "):o},n);i=t?i.trim():"",n!==i&&s.setAttribute("class",i)}}}function se(s,t,e){if(!(s==null||t==null)){if(e!=null&&typeof t=="string"){e?O(s,t):st(s,t);return}if(typeof t=="function")return se(s,t(dn(s),e),e);typeof t=="string"&&(t.match(mo)||[]).forEach(i=>{ce(s,i)?st(s,i):O(s,i)})}}let Vl=0;function hy(){return Vl+=1,`v${Vl}`}function bo(s){return(s.id==null||s.id==="")&&(s.id=hy()),s.id}function Ie(s){return s==null?!1:typeof s.getScreenCTM=="function"&&s instanceof SVGElement}const Ct={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},Kl="1.1";function Jl(s,t=document){return t.createElement(s)}function yo(s,t=Ct.xhtml,e=document){return e.createElementNS(t,s)}function oe(s,t=document){return yo(s,Ct.svg,t)}function qi(s){if(s){const e=`<svg xmlns="${Ct.svg}" xmlns:xlink="${Ct.xlink}" version="${Kl}">${s}</svg>`,{documentElement:n}=uy(e,{async:!1});return n}const t=document.createElementNS(Ct.svg,"svg");return t.setAttributeNS(Ct.xmlns,"xmlns:xlink",Ct.xlink),t.setAttribute("version",Kl),t}function uy(s,t={}){let e;try{const n=new DOMParser;if(t.async!=null){const i=n;i.async=t.async}e=n.parseFromString(s,t.mimeType||"text/xml")}catch{e=void 0}if(!e||e.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${s}`);return e}function dy(s,t=!0){const e=s.nodeName;return t?e.toLowerCase():e.toUpperCase()}function Co(s){let t=0,e=s.previousSibling;for(;e;)e.nodeType===1&&(t+=1),e=e.previousSibling;return t}function gy(s,t){return s.querySelectorAll(t)}function fy(s,t){return s.querySelector(t)}function jl(s,t,e){const n=s.ownerSVGElement;let i=s.parentNode;for(;i&&i!==e&&i!==n;){if(ce(i,t))return i;i=i.parentNode}return null}function wo(s,t){const e=t&&t.parentNode;return s===e||!!(e&&e.nodeType===1&&s.compareDocumentPosition(e)&16)}function Gt(s){s&&(Array.isArray(s)?s:[s]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function Jn(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function Mt(s,t){(Array.isArray(t)?t:[t]).forEach(n=>{n!=null&&s.appendChild(n)})}function Gl(s,t){const e=s.firstChild;return e?jn(e,t):Mt(s,t)}function jn(s,t){const e=s.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(i=>{i!=null&&e.insertBefore(i,s)})}function py(s,t){const e=s.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(i=>{i!=null&&e.insertBefore(i,s.nextSibling)})}function Yt(s,t){t!=null&&t.appendChild(s)}function my(s){return!!s&&s.nodeType===1}function Yl(s){try{return s instanceof HTMLElement}catch{return typeof s=="object"&&s.nodeType===1&&typeof s.style=="object"&&typeof s.ownerDocument=="object"}}function by(s,t){const e=[];let n=s.firstChild;for(;n;n=n.nextSibling)n.nodeType===1&&(!t||ce(n,t))&&e.push(n);return e}const Hl=s=>{const t=Object.create(null);return e=>t[e]||(t[e]=s(e))},_l=Hl(s=>s.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Ao=Hl(s=>Rb(Fn(s)).replace(/ /g,"")),Wl=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits","preserveAspectRatio"];function yy(s,t){return s.getAttribute(t)}function xo(s,t){const e=Xl(t);e.ns?s.hasAttributeNS(e.ns,e.local)&&s.removeAttributeNS(e.ns,e.local):s.hasAttribute(t)&&s.removeAttribute(t)}function vo(s,t,e){if(e==null)return xo(s,t);const n=Xl(t);n.ns&&typeof e=="string"?s.setAttributeNS(n.ns,t,e):t==="id"?s.id=`${e}`:s.setAttribute(t,`${e}`)}function ql(s,t){Object.keys(t).forEach(e=>{vo(s,e,t[e])})}function j(s,t,e){if(t==null){const n=s.attributes,i={};for(let o=0;o<n.length;o+=1)i[n[o].name]=n[o].value;return i}if(typeof t=="string"&&e===void 0)return s.getAttribute(t);typeof t=="object"?ql(s,t):vo(s,t,e)}function Xl(s){if(s.indexOf(":")!==-1){const t=s.split(":");return{ns:Ct[t[0]],local:t[1]}}return{ns:null,local:s}}function Gn(s){const t={};return Object.keys(s).forEach(e=>{const n=Wl.includes(e)?e:_l(e);t[n]=s[e]}),t}function Xi(s){const t={};return s.split(";").forEach(n=>{const i=n.trim();if(i){const o=i.split("=");o.length&&(t[o[0].trim()]=o[1]?o[1].trim():"")}}),t}function Eo(s,t){return Object.keys(t).forEach(e=>{if(e==="class")s[e]=s[e]?`${s[e]} ${t[e]}`:t[e];else if(e==="style"){const n=typeof s[e]=="object",i=typeof t[e]=="object";let o,r;n&&i?(o=s[e],r=t[e]):n?(o=s[e],r=Xi(t[e])):i?(o=Xi(s[e]),r=t[e]):(o=Xi(s[e]),r=Xi(t[e])),s[e]=Eo(o,r)}else s[e]=t[e]}),s}const Cy=/-(.)/g;function wy(s){return s.replace(Cy,(t,e)=>e.toUpperCase())}const So={},$l=["webkit","ms","moz","o"],Zl=typeof document<"u"?document.createElement("div").style:{};function Ay(s){for(let t=0;t<$l.length;t+=1){const e=$l[t]+s;if(e in Zl)return e}return null}function xy(s){const t=wy(s);if(So[t]==null){const e=t.charAt(0).toUpperCase()+t.slice(1);So[t]=t in Zl?t:Ay(e)}return So[t]}function tc(s,t){const e=s.ownerDocument&&s.ownerDocument.defaultView&&s.ownerDocument.defaultView.opener?s.ownerDocument.defaultView.getComputedStyle(s,null):window.getComputedStyle(s,null);return e&&t?e.getPropertyValue(t)||e[t]:e}const vy={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Ey(s){return/^--/.test(s)}function $i(s,t,e){const n=window.getComputedStyle(s,null);return e?n.getPropertyValue(t)||void 0:n[t]||s.style[t]}function Zi(s,t){return parseInt($i(s,t),10)||0}function Sy(s,t){return!vy[s]&&typeof t=="number"?`${t}px`:t}function $(s,t,e){if(typeof t=="string"){const n=Ey(t);if(n||(t=xy(t)),e===void 0)return $i(s,t,n);n||(e=Sy(t,e));const i=s.style;n?i.setProperty(t,e):i[t]=e;return}for(const n in t)$(s,n,t[n])}function Mo(s){let t=2166136261,e=!1,n=s;for(let i=0,o=n.length;i<o;i+=1){let r=n.charCodeAt(i);r>127&&!e&&(n=unescape(encodeURIComponent(n)),r=n.charCodeAt(i),e=!0),t^=r,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function Bo(){let s="";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let e=0,n=t.length;e<n;e+=1){const i=t[e],o=Math.random()*16|0,r=i==="x"?o:i==="y"?o&3|8:i;s+=r.toString(16)}return s}function My(s,t,e){const n=Math.min(2,Math.floor(s.length*.34));let i=Math.floor(s.length*.4)+1,o,r=!1;const a=s.toLowerCase();for(const l of t){const c=e(l);if(c!==void 0&&Math.abs(c.length-a.length)<=n){const h=c.toLowerCase();if(h===a){if(c===s)continue;return l}if(r||c.length<3)continue;const u=By(a,h,i-1);if(u===void 0)continue;u<3?(r=!0,o=l):(i=u,o=l)}}return o}function By(s,t,e){let n=new Array(t.length+1),i=new Array(t.length+1);const o=e+1;for(let a=0;a<=t.length;a+=1)n[a]=a;for(let a=1;a<=s.length;a+=1){const l=s.charCodeAt(a-1),c=a>e?a-e:1,h=t.length>e+a?e+a:t.length;i[0]=a;let u=a;for(let f=1;f<c;f+=1)i[f]=o;for(let f=c;f<=h;f+=1){const p=l===t.charCodeAt(f-1)?n[f-1]:Math.min(n[f]+1,i[f-1]+1,n[f-1]+2);i[f]=p,u=Math.min(u,p)}for(let f=h+1;f<=t.length;f+=1)i[f]=o;if(u>e)return;const d=n;n=i,i=d}const r=n[t.length];return r>e?void 0:r}const ts=new WeakMap;function ky(s,t){const e=Fn(t),n=ts.get(s);if(n)return n[e]}function Iy(s,t,e){const n=Fn(t),i=ts.get(s);i?i[n]=e:ts.set(s,{[n]:e})}function je(s,t,e){if(!t)return ts.get(s);if(typeof t=="string"){if(e===void 0)return ky(s,t);Iy(s,t,e);return}for(const n in t)je(s,n,t[n])}const Ty={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function ko(s,t,e){if(t){if(typeof t=="string"){if(t=Ty[t]||t,arguments.length<3)return s[t];s[t]=e;return}for(const n in t)ko(s,n,t[n])}}function Py(s,...t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(s.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})}const Oy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,t){s.__proto__=t}||function(s,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e])};function Ny(s,t){Oy(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}class Ry{}const Dy=/^\s*class\s+/.test(`${Ry}`)||/^\s*class\s*\{/.test(`${class{}}`);function Io(s,t){let e;return Dy?e=class extends t{}:(e=function(){return t.apply(this,arguments)},Ny(e,t)),Object.defineProperty(e,"name",{value:s}),e}function ec(s){return s==="__proto__"}function To(s,t,e="/"){let n;const i=Array.isArray(t)?t:t.split(e);if(i.length)for(n=s;i.length;){const o=i.shift();if(Object(n)===n&&o&&o in n)n=n[o];else return}return n}function gn(s,t,e,n="/"){const i=Array.isArray(t)?t:t.split(n),o=i.pop();if(o&&!ec(o)){let r=s;i.forEach(a=>{ec(a)||(r[a]==null&&(r[a]={}),r=r[a])}),r[o]=e}return s}function nc(s,t,e="/"){const n=Array.isArray(t)?t.slice():t.split(e),i=n.pop();if(i)if(n.length>0){const o=To(s,n);o&&delete o[i]}else delete s[i];return s}function Qy(s,t,e={}){const n=e.offset||0,i=[],o=[];let r,a,l=null;for(let c=0;c<s.length;c+=1){r=o[c]=s[c];for(let h=0,u=t.length;h<u;h+=1){const d=t[h],f=d.start+n,p=d.end+n;c>=f&&c<p&&(typeof r=="string"?r=o[c]={t:s[c],attrs:d.attrs}:r.attrs=Eo(Eo({},r.attrs),d.attrs),e.includeAnnotationIndices&&(r.annotations==null&&(r.annotations=[]),r.annotations.push(h)))}a=o[c-1],a?ht(r)&&ht(a)?(l=l,JSON.stringify(r.attrs)===JSON.stringify(a.attrs)?l.t+=r.t:(i.push(l),l=r)):ht(r)||ht(a)?(l=l,i.push(l),l=r):l=String(l||"")+String(r):l=r}return l!=null&&i.push(l),i}function Ly(s){return s.replace(/ /g," ")}class L{get[Symbol.toStringTag](){return ic}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}static isVector(t){if(t==null)return!1;if(t instanceof L)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===ic)&&n.node instanceof SVGElement&&typeof n.sample=="function"&&typeof n.toPath=="function"}static create(t,e,n){return new L(t,e,n)}static createVectors(t){if(t[0]==="<"){const e=qi(t),n=[];for(let i=0,o=e.childNodes.length;i<o;i+=1){const r=e.childNodes[i];n.push(L.create(document.importNode(r,!0)))}return n}return[L.create(t)]}static toNode(t){return L.isVector(t)?t.node:t}static toNodes(t){return Array.isArray(t)?t.map(e=>L.toNode(e)):[L.toNode(t)]}constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let i;if(L.isVector(t))i=t.node;else if(typeof t=="string")if(t.toLowerCase()==="svg")i=qi();else if(t[0]==="<"){const o=qi(t);i=document.importNode(o.firstChild,!0)}else i=document.createElementNS(Ct.svg,t);else i=t;this.node=i,e&&this.setAttributes(e),n&&this.append(n)}transform(t,e){return t==null?fn(this.node):(fn(this.node,t,e),this)}translate(t,e=0,n={}){return t==null?dc(this.node):(dc(this.node,t,e,n),this)}rotate(t,e,n,i={}){return t==null?No(this.node):(No(this.node,t,e,n,i),this)}scale(t,e){return t==null?gc(this.node):(gc(this.node,t,e),this)}getTransformToElement(t){const e=L.toNode(t);return Ro(this.node,e)}removeAttribute(t){return xo(this.node,t),this}getAttribute(t){return yy(this.node,t)}setAttribute(t,e){return vo(this.node,t,e),this}setAttributes(t){return ql(this.node,t),this}attr(t,e){return t==null?j(this.node):typeof t=="string"&&e===void 0?j(this.node,t):(typeof t=="object"?j(this.node,t):j(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:L.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?L.create(e):L.create("defs").appendTo(t)}text(t,e={}){return oc(this.node,t,e),this}tagName(){return dy(this.node)}clone(){return L.create(this.node.cloneNode(!0))}remove(){return Gt(this.node),this}empty(){return Jn(this.node),this}append(t){return Mt(this.node,L.toNodes(t)),this}appendTo(t){return Yt(this.node,L.isVector(t)?t.node:t),this}prepend(t){return Gl(this.node,L.toNodes(t)),this}before(t){return jn(this.node,L.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(L.toNode(t),this.node),L.create(t)}first(){return this.node.firstChild?L.create(this.node.firstChild):null}last(){return this.node.lastChild?L.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?L.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(L.toNode(t))}find(t){const e=[],n=gy(this.node,t);if(n)for(let i=0,o=n.length;i<o;i+=1)e.push(L.create(n[i]));return e}findOne(t){const e=fy(this.node,t);return e?L.create(e):null}findParentByClass(t,e){const n=jl(this.node,t,e);return n?L.create(n):null}matches(t){const e=this.node;this.node.matches;const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}contains(t){return wo(this.node,L.isVector(t)?t.node:t)}wrap(t){const e=L.create(t),n=this.node.parentNode;return n!=null&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(e.node.parentNode==null)return null;if(e=L.create(e.node.parentNode),t==null)return e;do if(typeof t=="string"?e.matches(t):e instanceof t)return e;while(e=L.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1)t[n].nodeType===1&&e.push(L.create(t[n]));return e}eachChild(t,e){const n=this.children();for(let i=0,o=n.length;i<o;i+=1)t.call(n[i],n[i],i,n),e&&n[i].eachChild(t,e);return this}index(){return Co(this.node)}hasClass(t){return ce(this.node,t)}addClass(t){return O(this.node,t),this}removeClass(t){return st(this.node,t),this}toggleClass(t,e){return se(this.node,t,e),this}toLocalPoint(t,e){return s6(this.node,t,e)}sample(t=1){return this.node instanceof SVGPathElement?Vy(this.node,t):[]}toPath(){return L.create(_y(this.node))}toPathData(){return hc(this.node)}}const ic=`X6.${L.name}`;function zy(s,t){const e=L.create(t),n=L.create("textPath"),i=s.d;if(i&&s["xlink:href"]===void 0){const o=L.create("path").attr("d",i).appendTo(e.defs());n.attr("xlink:href",`#${o.id}`)}return typeof s=="object"&&n.attr(s),n.node}function Fy(s,t,e){const n=e.eol,i=e.baseSize,o=e.lineHeight;let r=0,a;const l={},c=t.length-1;for(let h=0;h<=c;h+=1){let u=t[h],d=null;if(typeof u=="object"){const f=u.attrs,p=L.create("tspan",f);a=p.node;let m=u.t;n&&h===c&&(m+=n),a.textContent=m;const b=f.class;b&&p.addClass(b),e.includeAnnotationIndices&&p.attr("annotations",u.annotations.join(",")),d=parseFloat(f["font-size"]),d===void 0&&(d=i),d&&d>r&&(r=d)}else n&&h===c&&(u+=n),a=document.createTextNode(u||" "),i&&i>r&&(r=i);s.appendChild(a)}return r&&(l.maxFontSize=r),o?l.lineHeight=o:r&&(l.lineHeight=r*1.2),l}const sc=/em$/;function es(s,t){const e=parseFloat(s);return sc.test(s)?e*t:e}function Uy(s,t,e,n){if(!Array.isArray(t))return 0;const i=t.length;if(!i)return 0;let o=t[0];const r=es(o.maxFontSize,e)||e;let a=0;const l=es(n,e);for(let u=1;u<i;u+=1){o=t[u];const d=es(o.lineHeight,e)||l;a+=d}const c=es(o.maxFontSize,e)||e;let h;switch(s){case"middle":h=r/2-.15*c-a/2;break;case"bottom":h=-(.25*c)-a;break;case"top":default:h=.8*r;break}return h}function oc(s,t,e={}){t=Ly(t);const n=e.eol;let i=e.textPath;const o=e.textVerticalAnchor,r=o==="middle"||o==="bottom"||o==="top";let a=e.x;a===void 0&&(a=s.getAttribute("x")||0);const l=e.includeAnnotationIndices;let c=e.annotations;c&&!Array.isArray(c)&&(c=[c]);const h=e.lineHeight,u=h==="auto",d=u?"1.5em":h||"1em";let f=!0;const p=s.childNodes;if(p.length===1){const k=p[0];k&&k.tagName.toUpperCase()==="TITLE"&&(f=!1)}f&&Jn(s),j(s,{"xml:space":"preserve",display:t||e.displayEmpty?null:"none"});const m=j(s,"font-size");let b=parseFloat(m);b||(b=16,(r||c)&&!m&&j(s,"font-size",`${b}`));let y;i?(typeof i=="string"&&(i={d:i}),y=zy(i,s)):y=document.createDocumentFragment();let C,A=0,x;const v=t.split(`
|
|
3
|
-
`),
|
|
4
|
-
`,a=e.fontSize||14,l=e.lineHeight?parseFloat(e.lineHeight):Math.ceil(a*1.4),c=Math.floor(o/l);if(s.indexOf(r)>-1){const b=Bo(),y=[];return s.split(r).forEach(C=>{const A=ac(C,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),e,Object.assign(Object.assign({},n),{eol:b}));A&&y.push(...A.split(b))}),y.slice(0,c).join(r)}const{width:h}=Yn(s,e);if(h<i)return s;const u=[];let d=s,f=h,p=n.ellipsis,m=0;p&&(typeof p!="string"&&(p="…"),m=Yn(p,e).width);for(let b=0;b<c;b+=1)if(f>i)if(b===c-1){const[C]=rc(d,i-m,f,e);u.push(p?`${C}${p}`:C)}else{const[C,A]=rc(d,i,f,e);u.push(C),d=A,f=Yn(d,e).width}else{u.push(d);break}return u.join(r)}const Po=.551784;function Bt(s,t,e=NaN){const n=s.getAttribute(t);if(n==null)return e;const i=parseFloat(n);return Number.isNaN(i)?e:i}function Vy(s,t=1){const e=s.getTotalLength(),n=[];let i=0,o;for(;i<e;)o=s.getPointAtLength(i),n.push({distance:i,x:o.x,y:o.y}),i+=t;return n}function Ky(s){return["M",Bt(s,"x1"),Bt(s,"y1"),"L",Bt(s,"x2"),Bt(s,"y2")].join(" ")}function Jy(s){const t=ns(s);return t.length===0?null:`${lc(t)} Z`}function jy(s){const t=ns(s);return t.length===0?null:lc(t)}function lc(s){return`M ${s.map(e=>`${e.x} ${e.y}`).join(" L")}`}function ns(s){const t=[],e=s.points;if(e)for(let n=0,i=e.numberOfItems;n<i;n+=1)t.push(e.getItem(n));return t}function Gy(s){const t=Bt(s,"cx",0),e=Bt(s,"cy",0),n=Bt(s,"r"),i=n*Po;return["M",t,e-n,"C",t+i,e-n,t+n,e-i,t+n,e,"C",t+n,e+i,t+i,e+n,t,e+n,"C",t-i,e+n,t-n,e+i,t-n,e,"C",t-n,e-i,t-i,e-n,t,e-n,"Z"].join(" ")}function Yy(s){const t=Bt(s,"cx",0),e=Bt(s,"cy",0),n=Bt(s,"rx"),i=Bt(s,"ry")||n,o=n*Po,r=i*Po;return["M",t,e-i,"C",t+o,e-i,t+n,e-r,t+n,e,"C",t+n,e+r,t+o,e+i,t,e+i,"C",t-o,e+i,t-n,e+r,t-n,e,"C",t-n,e-r,t-o,e-i,t,e-i,"Z"].join(" ")}function Hy(s){return cc({x:Bt(s,"x",0),y:Bt(s,"y",0),width:Bt(s,"width",0),height:Bt(s,"height",0),rx:Bt(s,"rx",0),ry:Bt(s,"ry",0)})}function cc(s){let t;const e=s.x,n=s.y,i=s.width,o=s.height,r=Math.min(s.rx||s["top-rx"]||0,i/2),a=Math.min(s.rx||s["bottom-rx"]||0,i/2),l=Math.min(s.ry||s["top-ry"]||0,o/2),c=Math.min(s.ry||s["bottom-ry"]||0,o/2);return r||a||l||c?t=["M",e,n+l,"v",o-l-c,"a",a,c,0,0,0,a,c,"h",i-2*a,"a",a,c,0,0,0,a,-c,"v",-(o-c-l),"a",r,l,0,0,0,-r,-l,"h",-(i-2*r),"a",r,l,0,0,0,-r,l,"Z"]:t=["M",e,n,"H",e+i,"V",n+o,"H",e,"V",n,"Z"],t.join(" ")}function _y(s){const t=oe("path");j(t,j(s));const e=hc(s);return e&&t.setAttribute("d",e),t}function hc(s){const t=s.tagName.toLowerCase();switch(t){case"path":return s.getAttribute("d");case"line":return Ky(s);case"polygon":return Jy(s);case"polyline":return jy(s);case"ellipse":return Yy(s);case"circle":return Gy(s);case"rect":return Hy(s)}throw new Error(`"${t}" cannot be converted to svg path element.`)}const Wy=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,uc=/[ ,]+/,qy=/^(\w+)\((.*)\)/;function Xy(s,t){const n=oe("svg").createSVGPoint();return n.x=s,n.y=t,n}function wt(s){const e=oe("svg").createSVGMatrix();if(s!=null){const n=s,i=["a","b","c","d","e","f"];for(const o of i)n[o]!==void 0&&(e[o]=n[o])}return e}function $y(s){const t=oe("svg");return s!=null?(s instanceof DOMMatrix||(s=wt(s)),t.createSVGTransformFromMatrix(s)):t.createSVGTransform()}function Hn(s){let t=wt();const e=s!=null&&s.match(Wy);if(!e)return t;for(let n=0,i=e.length;n<i;n+=1){const r=e[n].match(qy);if(r){let a,l,c,h,u,d=wt();const f=r[2].split(uc);switch(r[1].toLowerCase()){case"scale":a=parseFloat(f[0]),l=f[1]===void 0?a:parseFloat(f[1]),d=d.scaleNonUniform(a,l);break;case"translate":c=parseFloat(f[0]),h=parseFloat(f[1]),d=d.translate(c,h);break;case"rotate":u=parseFloat(f[0]),c=parseFloat(f[1])||0,h=parseFloat(f[2])||0,c!==0||h!==0?d=d.translate(c,h).rotate(u).translate(-c,-h):d=d.rotate(u);break;case"skewx":u=parseFloat(f[0]),d=d.skewX(u);break;case"skewy":u=parseFloat(f[0]),d=d.skewY(u);break;case"matrix":d.a=parseFloat(f[0]),d.b=parseFloat(f[1]),d.c=parseFloat(f[2]),d.d=parseFloat(f[3]),d.e=parseFloat(f[4]),d.f=parseFloat(f[5]);break;default:continue}t=t.multiply(d)}}return t}function _n(s){const t=s||{},e=t.a!=null?t.a:1,n=t.b!=null?t.b:0,i=t.c!=null?t.c:0,o=t.d!=null?t.d:1,r=t.e!=null?t.e:0,a=t.f!=null?t.f:0;return`matrix(${e},${n},${i},${o},${r},${a})`}function is(s){let t,e,n;if(s){const o=uc;if(s.trim().indexOf("matrix")>=0){const r=Hn(s),a=Zy(r);t=[a.translateX,a.translateY],e=[a.rotation],n=[a.scaleX,a.scaleY];const l=[];(t[0]!==0||t[1]!==0)&&l.push(`translate(${t.join(",")})`),(n[0]!==1||n[1]!==1)&&l.push(`scale(${n.join(",")})`),e[0]!==0&&l.push(`rotate(${e[0]})`),s=l.join(" ")}else{const r=s.match(/translate\((.*?)\)/);r&&(t=r[1].split(o));const a=s.match(/rotate\((.*?)\)/);a&&(e=a[1].split(o));const l=s.match(/scale\((.*?)\)/);l&&(n=l[1].split(o))}}const i=n&&n[0]?parseFloat(n[0]):1;return{raw:s||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:e&&e[0]?parseInt(e[0],10):0,cx:e&&e[1]?parseInt(e[1],10):void 0,cy:e&&e[2]?parseInt(e[2],10):void 0},scale:{sx:i,sy:n&&n[1]?parseFloat(n[1]):i}}}function Oo(s,t){const e=t.x*s.a+t.y*s.c+0,n=t.x*s.b+t.y*s.d+0;return{x:e,y:n}}function Zy(s){const t=Oo(s,{x:0,y:1}),e=Oo(s,{x:1,y:0}),n=180/Math.PI*Math.atan2(t.y,t.x)-90,i=180/Math.PI*Math.atan2(e.y,e.x);return{skewX:n,skewY:i,translateX:s.e,translateY:s.f,scaleX:Math.sqrt(s.a*s.a+s.b*s.b),scaleY:Math.sqrt(s.c*s.c+s.d*s.d),rotation:n}}function t6(s){let t,e,n,i;return s?(t=s.a==null?1:s.a,i=s.d==null?1:s.d,e=s.b,n=s.c):t=i=1,{sx:e?Math.sqrt(t*t+e*e):t,sy:n?Math.sqrt(n*n+i*i):i}}function e6(s){let t={x:0,y:1};s&&(t=Oo(s,t));const e=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:e%360+(e<0?360:0)}}function n6(s){return{tx:s&&s.e||0,ty:s&&s.f||0}}function fn(s,t,e={}){if(t==null)return Hn(j(s,"transform"));if(e.absolute){s.setAttribute("transform",_n(t));return}const n=s.transform,i=$y(t);n.baseVal.appendItem(i)}function dc(s,t,e=0,n={}){let i=j(s,"transform");const o=is(i);if(t==null)return o.translation;i=o.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const r=n.absolute?t:o.translation.tx+t,a=n.absolute?e:o.translation.ty+e,l=`translate(${r},${a})`;s.setAttribute("transform",`${l} ${i}`.trim())}function No(s,t,e,n,i={}){let o=j(s,"transform");const r=is(o);if(t==null)return r.rotation;o=r.raw,o=o.replace(/rotate\([^)]*\)/g,"").trim(),t%=360;const a=i.absolute?t:r.rotation.angle+t,l=e!=null&&n!=null?`,${e},${n}`:"",c=`rotate(${a}${l})`;s.setAttribute("transform",`${o} ${c}`.trim())}function gc(s,t,e){let n=j(s,"transform");const i=is(n);if(t==null)return i.scale;e=e??t,n=i.raw,n=n.replace(/scale\([^)]*\)/g,"").trim();const o=`scale(${t},${e})`;s.setAttribute("transform",`${n} ${o}`.trim())}function Ro(s,t){if(Ie(t)&&Ie(s)){const e=t.getScreenCTM(),n=s.getScreenCTM();if(e&&n)return e.inverse().multiply(n)}return wt()}function i6(s,t){let e=wt();if(Ie(t)&&Ie(s)){let n=s;const i=[];for(;n&&n!==t;){const o=n.getAttribute("transform")||null,r=Hn(o);i.push(r),n=n.parentNode}i.reverse().forEach(o=>{e=e.multiply(o)})}return e}function s6(s,t,e){const n=s instanceof SVGSVGElement?s:s.ownerSVGElement,i=n.createSVGPoint();i.x=t,i.y=e;try{const o=n.getScreenCTM(),r=i.matrixTransform(o.inverse()),a=Ro(s,n).inverse();return r.matrixTransform(a)}catch{return i}}const fc={};function pn(s){return fc[s]||{}}function ss(s,t){fc[s]=t}const Wn=new WeakMap;function o6(s){return Wn.has(s)||Wn.set(s,{events:Object.create(null)}),Wn.get(s)}function Do(s){return Wn.get(s)}function r6(s){return Wn.delete(s)}const os=()=>!0,mn=()=>!1;function pc(s){s.stopPropagation()}function a6(s,t,e){s.addEventListener!=null&&s.addEventListener(t,e)}function l6(s,t,e){s.removeEventListener!=null&&s.removeEventListener(t,e)}const c6=/[^\x20\t\r\n\f]+/g,h6=/^([^.]*)(?:\.(.+)|)/;function mc(s){return(s||"").match(c6)||[""]}function bc(s){const t=h6.exec(s)||[];return{originType:t[1]?t[1].trim():t[1],namespaces:t[2]?t[2].split(".").map(e=>e.trim()).sort():[]}}function Qo(s){return s.nodeType===1||s.nodeType===9||!+s.nodeType}let yc=0;const bn=new WeakMap;function Cc(s){return bn.has(s)||(bn.set(s,yc),yc+=1),bn.get(s)}function u6(s){return bn.get(s)}function d6(s){return bn.delete(s)}function wc(s,t){return bn.set(s,t)}function g6(s,t){const e=[],n=Do(s),i=n&&n.events&&n.events[t.type],o=i&&i.handlers||[],r=i?i.delegateCount:0;if(r>0&&!(t.type==="click"&&typeof t.button=="number"&&t.button>=1)){for(let a=t.target;a!==s;a=a.parentNode||s)if(a.nodeType===1&&!(t.type==="click"&&a.disabled===!0)){const l=[],c={};for(let h=0;h<r;h+=1){const u=o[h],d=u.selector;if(d!=null&&c[d]==null){const f=s,p=[];f.querySelectorAll(d).forEach(m=>{p.push(m)}),c[d]=p.includes(a)}c[d]&&l.push(u)}l.length&&e.push({elem:a,handlers:l})}}return r<o.length&&e.push({elem:s,handlers:o.slice(r)}),e}function Ac(s){return s!=null&&s===s.window}function xc(s,t){const e=s.nodeType===9?s.documentElement:s,n=t&&t.parentNode;return s===n||!!(n&&n.nodeType===1&&(e.contains?e.contains(n):s.compareDocumentPosition&&s.compareDocumentPosition(n)&16))}class Ce{static create(t){return t instanceof Ce?t:new Ce(t)}static addProperty(t,e){Object.defineProperty(Ce.prototype,t,{enumerable:!0,configurable:!0,get:typeof e=="function"?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(n){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}})}constructor(t,e){this.isDefaultPrevented=mn,this.isPropagationStopped=mn,this.isImmediatePropagationStopped=mn,this.isSimulated=!1,this.preventDefault=()=>{const n=this.originalEvent;this.isDefaultPrevented=os,n&&!this.isSimulated&&n.preventDefault()},this.stopPropagation=()=>{const n=this.originalEvent;this.isPropagationStopped=os,n&&!this.isSimulated&&n.stopPropagation()},this.stopImmediatePropagation=()=>{const n=this.originalEvent;this.isImmediatePropagationStopped=os,n&&!this.isSimulated&&n.stopImmediatePropagation(),this.stopPropagation()},typeof t=="string"?this.type=t:t.type&&(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?os:mn,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.timeStamp=t.timeStamp),e&&Object.assign(this,e),this.timeStamp||(this.timeStamp=Date.now())}}const vc={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(vc).forEach(s=>Ce.addProperty(s,vc[s])),ss("load",{noBubble:!0}),ss("beforeunload",{postDispatch(s,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}),ss("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(s,t){let e;const n=t.relatedTarget,i=t.handleObj;return(!n||n!==s&&!xc(s,n))&&(t.type=i.originType,e=i.handler.call(s,t),t.type="mouseover"),e}}),ss("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(s,t){let e;const n=t.relatedTarget,i=t.handleObj;return(!n||n!==s&&!xc(s,n))&&(t.type=i.originType,e=i.handler.call(s,t),t.type="mouseout"),e}});let Lo;function f6(s,t,e,n,i){if(!Qo(s))return;let o;if(typeof e!="function"){const{handler:c,selector:h}=e,u=V(e,["handler","selector"]);e=c,i=h,o=u}const r=o6(s);let a=r.handler;a==null&&(a=r.handler=function(c,...h){return Lo!==c.type?p6(s,c,...h):void 0});const l=Cc(e);mc(t).forEach(c=>{const{originType:h,namespaces:u}=bc(c);if(!h)return;let d=h,f=pn(d);d=(i?f.delegateType:f.bindType)||d,f=pn(d);const p=Object.assign({type:d,originType:h,data:n,selector:i,guid:l,handler:e,namespace:u.join(".")},o),m=r.events;let b=m[d];b||(b=m[d]={handlers:[],delegateCount:0},(!f.setup||f.setup(s,n,u,a)===!1)&&a6(s,d,a)),f.add&&(d6(p.handler),f.add(s,p),wc(p.handler,l)),i?(b.handlers.splice(b.delegateCount,0,p),b.delegateCount+=1):b.handlers.push(p)})}function Ec(s,t,e,n,i){const o=Do(s);if(!o)return;const r=o.events;r&&(mc(t).forEach(a=>{const{originType:l,namespaces:c}=bc(a);if(!l){Object.keys(r).forEach(m=>{Ec(s,m+a,e,n,!0)});return}let h=l;const u=pn(h);h=(n?u.delegateType:u.bindType)||h;const d=r[h];if(!d)return;const f=c.length>0?new RegExp(`(^|\\.)${c.join("\\.(?:.*\\.|)")}(\\.|$)`):null,p=d.handlers.length;for(let m=d.handlers.length-1;m>=0;m-=1){const b=d.handlers[m];(i||l===b.originType)&&(!e||u6(e)===b.guid)&&(f==null||b.namespace&&f.test(b.namespace))&&(n==null||n===b.selector||n==="**"&&b.selector)&&(d.handlers.splice(m,1),b.selector&&(d.delegateCount-=1),u.remove&&u.remove(s,b))}p&&d.handlers.length===0&&((!u.teardown||u.teardown(s,c,o.handler)===!1)&&l6(s,h,o.handler),delete r[h])}),Object.keys(r).length===0&&r6(s))}function p6(s,t,...e){const n=Ce.create(t);n.delegateTarget=s;const i=pn(n.type);if(i.preDispatch&&i.preDispatch(s,n)===!1)return;const o=g6(s,n);for(let r=0,a=o.length;r<a&&!n.isPropagationStopped();r+=1){const l=o[r];n.currentTarget=l.elem;for(let c=0,h=l.handlers.length;c<h&&!n.isImmediatePropagationStopped();c+=1){const u=l.handlers[c];if(n.rnamespace==null||u.namespace&&n.rnamespace.test(u.namespace)){n.handleObj=u,n.data=u.data;const d=pn(u.originType).handle,f=d?d(l.elem,n,...e):u.handler.call(l.elem,n,...e);f!==void 0&&(n.result=f,f===!1&&(n.preventDefault(),n.stopPropagation()))}}}return i.postDispatch&&i.postDispatch(s,n),n.result}function m6(s,t,e,n){let i=s,o=typeof s=="string"?s:s.type,r=typeof s=="string"||i.namespace==null?[]:i.namespace.split(".");const a=e;if(a.nodeType===3||a.nodeType===8)return;o.indexOf(".")>-1&&(r=o.split("."),o=r.shift(),r.sort());const l=o.indexOf(":")<0&&`on${o}`;i=s instanceof Ce?s:new Ce(o,typeof s=="object"?s:null),i.namespace=r.join("."),i.rnamespace=i.namespace?new RegExp(`(^|\\.)${r.join("\\.(?:.*\\.|)")}(\\.|$)`):null,i.result=void 0,i.target||(i.target=a);const c=[i];Array.isArray(t)?c.push(...t):c.push(t);const h=pn(o);if(!n&&h.trigger&&h.trigger(a,i,t)===!1)return;let u;const d=[a];if(!n&&!h.noBubble&&!Ac(a)){u=h.delegateType||o;let p=a,m=a.parentNode;for(;m!=null;)d.push(m),p=m,m=m.parentNode;const b=a.ownerDocument||document;if(p===b){const y=p.defaultView||p.parentWindow||window;d.push(y)}}let f=a;for(let p=0,m=d.length;p<m&&!i.isPropagationStopped();p+=1){const b=d[p];f=b,i.type=p>1?u:h.bindType||o;const y=Do(b);y&&y.events[i.type]&&y.handler&&y.handler.call(b,...c);const C=l&&b[l]||null;C&&Qo(b)&&(i.result=C.call(b,...c),i.result===!1&&i.preventDefault())}if(i.type=o,!n&&!i.isDefaultPrevented()){const p=h.preventDefault;if((p==null||p(d.pop(),i,t)===!1)&&Qo(a)&&l&&typeof a[o]=="function"&&!Ac(a)){const m=a[l];m&&(a[l]=null),Lo=o,i.isPropagationStopped()&&f.addEventListener(o,pc),a[o](),i.isPropagationStopped()&&f.removeEventListener(o,pc),Lo=void 0,m&&(a[l]=m)}}return i.result}class nt{static on(t,e,n,i,o){return qn.on(t,e,n,i,o),t}static once(t,e,n,i,o){return qn.on(t,e,n,i,o,!0),t}static off(t,e,n,i){return qn.off(t,e,n,i),t}static trigger(t,e,n,i){return m6(e,n,t,i),t}}var qn;(function(s){function t(n,i,o,r,a,l){if(typeof i=="object"){typeof o!="string"&&(r=r||o,o=void 0),Object.keys(i).forEach(c=>t(n,c,o,r,i[c],l));return}if(r==null&&a==null?(a=o,r=o=void 0):a==null&&(typeof o=="string"?(a=r,r=void 0):(a=r,r=o,o=void 0)),a===!1)a=mn;else if(!a)return;if(l){const c=a;a=function(h,...u){return s.off(n,h),c.call(this,h,...u)},wc(a,Cc(c))}f6(n,i,a,r,o)}s.on=t;function e(n,i,o,r){const a=i;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;e(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(c=>e(n,c,o,l[c]));return}(o===!1||typeof o=="function")&&(r=o,o=void 0),r===!1&&(r=mn),Ec(n,i,r,o)}s.off=e})(qn||(qn={}));class Sc{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=Hb("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(t){if(this.onWheelGuard!=null&&!this.onWheelGuard(t))return;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault();let e;(this.deltaX!==0||this.deltaY!==0)&&(t.stopPropagation(),e=!0),e===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function yn(s){const t=s.getBoundingClientRect(),e=s.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}}function b6(s){return s.getBoundingClientRect().width}function y6(s){return s.getBoundingClientRect().height}function C6(s){const t=$i(s,"position")==="fixed";let e;if(t){const n=s.getBoundingClientRect();e={left:n.left,top:n.top}}else e=yn(s);if(!t){const n=s.ownerDocument;let i=s.offsetParent||n.documentElement;for(;(i===n.body||i===n.documentElement)&&$i(i,"position")==="static";)i=i.parentNode;if(i!==s&&my(i)){const o=yn(i);e.top-=o.top+Zi(i,"borderTopWidth"),e.left-=o.left+Zi(i,"borderLeftWidth")}}return{top:e.top-Zi(s,"marginTop"),left:e.left-Zi(s,"marginLeft")}}function we(s,t){const e=Xy(s.x,s.y).matrixTransform(t);return new w(e.x,e.y)}function w6(s,t){return new N(we(s.start,t),we(s.end,t))}function Ht(s,t){const n=oe("svg").createSVGPoint();n.x=s.x,n.y=s.y;const i=n.matrixTransform(t);n.x=s.x+s.width,n.y=s.y;const o=n.matrixTransform(t);n.x=s.x+s.width,n.y=s.y+s.height;const r=n.matrixTransform(t);n.x=s.x,n.y=s.y+s.height;const a=n.matrixTransform(t),l=Math.min(i.x,o.x,r.x,a.x),c=Math.max(i.x,o.x,r.x,a.x),h=Math.min(i.y,o.y,r.y,a.y),u=Math.max(i.y,o.y,r.y,a.y);return new I(l,h,c-l,u-h)}function Mc(s,t,e){let n=null;if(!s.ownerSVGElement)return new I(0,0,0,0);try{n=s.getBBox()}catch{n={x:s.clientLeft,y:s.clientTop,width:s.clientWidth,height:s.clientHeight}}return I.create(n)}function he(s,t={}){let e=null;if(!s.ownerSVGElement||!Ie(s)){if(Yl(s)){const{left:r,top:a,width:l,height:c}=Bc(s);return new I(r,a,l,c)}return new I(0,0,0,0)}let i=t.target;if(!t.recursive){try{e=s.getBBox()}catch{e={x:s.clientLeft,y:s.clientTop,width:s.clientWidth,height:s.clientHeight}}if(!i)return I.create(e);const r=Ro(s,i);return Ht(e,r)}{const r=s.childNodes,a=r.length;if(a===0)return he(s,{target:i});i||(i=s);let l=null;for(let c=0;c<a;c+=1){const h=r[c];let u=null;h.childNodes.length===0?u=he(h,{target:i}):u=he(h,{target:i,recursive:!0}),l?l=l.union(u):l=I.create(u)}return l||new I(0,0,0,0)}}function Bc(s){let t=0,e=0,n=0,i=0;if(s){let o=s;for(;o;)t+=o.offsetLeft,e+=o.offsetTop,o=o.offsetParent,o&&(t+=parseInt(tc(o,"borderLeft"),10),e+=parseInt(tc(o,"borderTop"),10));n=s.offsetWidth,i=s.offsetHeight}return{left:t,top:e,width:n,height:i}}function kc(s){const t=e=>{const n=s.getAttribute(e),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};switch(s instanceof SVGElement&&s.nodeName.toLowerCase()){case"rect":return new I(t("x"),t("y"),t("width"),t("height"));case"circle":return new Ft(t("cx"),t("cy"),t("r"),t("r"));case"ellipse":return new Ft(t("cx"),t("cy"),t("rx"),t("ry"));case"polyline":{const e=ns(s);return new yt(e)}case"polygon":{const e=ns(s);return e.length>1&&e.push(e[0]),new yt(e)}case"path":{let e=s.getAttribute("d");return iy(e)||(e=Ul(e)),z.parse(e)}case"line":return new N(t("x1"),t("y1"),t("x2"),t("y2"))}return he(s)}function A6(s){if(s==null)return null;let t=s;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),ce(t,"x6-port"))t=t.nextElementSibling;else if(e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}function x6(s){const t=A6(s);if(!Ie(t)){if(Yl(s)){const{left:i,top:o,width:r,height:a}=Bc(s);return new I(i,o,r,a)}return new I(0,0,0,0)}return kc(t).bbox()||I.create()}const v6=(s,t)=>s-t;class E6{constructor(t={}){this.comparator=t.comparator||v6,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(t,e,n){const i={priority:t,value:e},o=this.data.length;return n&&(i.id=n,this.index[n]=o),this.data.push(i),this.bubbleUp(o),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if(typeof n>"u")throw new Error(`Node with id '${t}' was not found in the heap.`);const i=this.data,o=i[n].priority,r=this.comparator(e,o);r<0?(i[n].priority=e,this.bubbleUp(n)):r>0&&(i[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return e!=null&&e.id&&delete this.index[e.id],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,i,o=t;for(;o>0&&(i=o-1>>>1,this.comparator(e[o].priority,e[i].priority)<0);){n=e[i],e[i]=e[o];let r=e[o].id;r!=null&&(this.index[r]=i),e[o]=n,r=e[o].id,r!=null&&(this.index[r]=o),o=i}}bubbleDown(t){const e=this.data,n=e.length-1;let i=t;for(;;){const o=(i<<1)+1,r=o+1;let a=i;if(o<=n&&this.comparator(e[o].priority,e[a].priority)<0&&(a=o),r<=n&&this.comparator(e[r].priority,e[a].priority)<0&&(a=r),a!==i){const l=e[a];e[a]=e[i];let c=e[i].id;c!=null&&(this.index[c]=a),e[i]=l,c=e[i].id,c!=null&&(this.index[c]=i),i=a}else break}}}function S6(s,t,e=(n,i)=>1){const n={},i={},o={},r=new E6;for(n[t]=0,Object.keys(s).forEach(a=>{a!==t&&(n[a]=1/0),r.insert(n[a],a,a)});!r.isEmpty();){const a=r.remove();o[a]=!0;const l=s[a];for(let c=0;c<l.length;c+=1){const h=l[c];if(!o[h]){const u=n[a]+e(a,h);u<n[h]&&(n[h]=u,i[h]=a,r.updatePriority(h,u))}}}return i}const Xn=/(-?(?:\d*\.\d+|\d+))\s*(px|em|rem|ch|vh|vw|vmin|vmax|%|cm|mm|in|pt|pc|ex|fr|deg|rad|turn)$/,Ic=(s,t)=>{const e=t-s;return n=>s+e*n},Tc=(s,t)=>{const e=Xn,n=e.exec(s),i=e.exec(t),o=i?i[1]:"",r=n?+n[1]:0,a=i?+i[1]:0,l=o.indexOf("."),c=l>0?o[1].length-l-1:0,h=a-r,u=n?n[2]:"";return d=>(r+h*d).toFixed(c)+u},M6=(s,t)=>{const e=parseInt(s.slice(1),16),n=parseInt(t.slice(1),16),i=e&255,o=(n&255)-i,r=e&65280,a=(n&65280)-r,l=e&16711680,c=(n&16711680)-l;return h=>{const u=i+o*h&255,d=r+a*h&65280,f=l+c*h&16711680;return`#${(1<<24|u|d|f).toString(16).slice(1)}`}},B6=(s,t)=>{const e=o=>{const r=[];if(!o)return r;const a=/(\w+)\(([^)]+)\)/g;let l=a.exec(o);for(;l!==null;)l[1]&&l[2]&&r.push({name:l[1],values:l[2].split(/\s*,\s*/).filter(Boolean)}),l=a.exec(o);return r},n=e(s),i=e(t);return n.length===0||i.length===0?()=>s:o=>{const r=[];for(let a=0;a<Math.min(n.length,i.length);a++){const l=n[a],c=i[a];if(!(!l||!c)&&l.name===c.name&&l.values.length>0&&l.values.length===c.values.length){const h=[];for(let u=0;u<l.values.length;u++){const d=l.values[u],f=c.values[u];if(!(d===void 0||f===void 0))if(Xn.test(d)||Xn.test(f)){const p=Tc(d,f);h.push(p(o))}else if(!Number.isNaN(parseFloat(d))&&!Number.isNaN(parseFloat(f))){const p=Ic(parseFloat(d),parseFloat(f));h.push(p(o).toString())}else h.push(d)}h.length>0&&r.push(`${l.name}(${h.join(", ")})`)}}return r.length>0?r.join(" "):s}},Pc=s=>s,k6=s=>s*s,I6=s=>s*s*s,T6=s=>{if(s<=0)return 0;if(s>=1)return 1;const t=s*s,e=t*s;return 4*(s<.5?e:3*(s-t)+e-.75)},P6=s=>Math.pow(2,10*(s-1)),O6=s=>{for(let t=0,e=1;;t+=e,e/=2)if(s>=(7-4*t)/11){const n=(11-6*t-11*s)/4;return-n*n+e*e}},N6={reverse(s){return t=>1-s(1-t)},reflect(s){return t=>.5*(t<.5?s(2*t):2-s(2-2*t))},clamp(s,t=0,e=1){return n=>{const i=s(n);return i<t?t:i>e?e:i}},back(s=1.70158){return t=>t*t*((s+1)*t-s)},elastic(s=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*s/3*t)}};function R6(s){return-1*Math.cos(s*(Math.PI/2))+1}function D6(s){return Math.sin(s*(Math.PI/2))}function Q6(s){return-.5*(Math.cos(Math.PI*s)-1)}function L6(s){return s*s}function z6(s){return s*(2-s)}function F6(s){return s<.5?2*s*s:-1+(4-2*s)*s}function U6(s){return s*s*s}function V6(s){const t=s-1;return t*t*t+1}function K6(s){return s<.5?4*s*s*s:(s-1)*(2*s-2)*(2*s-2)+1}function J6(s){return s*s*s*s}function j6(s){const t=s-1;return 1-t*t*t*t}function G6(s){const t=s-1;return s<.5?8*s*s*s*s:1-8*t*t*t*t}function Y6(s){return s*s*s*s*s}function H6(s){const t=s-1;return 1+t*t*t*t*t}function _6(s){const t=s-1;return s<.5?16*s*s*s*s*s:1+16*t*t*t*t*t}function W6(s){return s===0?0:Math.pow(2,10*(s-1))}function q6(s){return s===1?1:-Math.pow(2,-10*s)+1}function X6(s){if(s===0||s===1)return s;const t=s*2,e=t-1;return t<1?.5*Math.pow(2,10*e):.5*(-Math.pow(2,-10*e)+2)}function $6(s){const t=s/1;return-1*(Math.sqrt(1-t*s)-1)}function Z6(s){const t=s-1;return Math.sqrt(1-t*t)}function tC(s){const t=s*2,e=t-2;return t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-e*e)+1)}function eC(s,t=1.70158){return s*s*((t+1)*s-t)}function nC(s,t=1.70158){const e=s/1-1;return e*e*((t+1)*e+t)+1}function iC(s,t=1.70158){const e=s*2,n=e-2,i=t*1.525;return e<1?.5*e*e*((i+1)*e-i):.5*(n*n*((i+1)*n+i)+2)}function sC(s,t=.7){if(s===0||s===1)return s;const n=s/1-1,i=1-t,o=i/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-o)*(2*Math.PI)/i))}function oC(s,t=.7){const e=1-t,n=s*2;if(s===0||s===1)return s;const i=e/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*n)*Math.sin((n-i)*(2*Math.PI)/e)+1}function rC(s,t=.65){const e=1-t;if(s===0||s===1)return s;const n=s*2,i=n-1,o=e/(2*Math.PI)*Math.asin(1);return n<1?-.5*(Math.pow(2,10*i)*Math.sin((i-o)*(2*Math.PI)/e)):Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/e)*.5+1}function zo(s){const t=s/1;if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const e=t-.5454545454545454;return 7.5625*e*e+.75}if(t<2.5/2.75){const e=t-.8181818181818182;return 7.5625*e*e+.9375}{const e=t-.9545454545454546;return 7.5625*e*e+.984375}}function Oc(s){return 1-zo(1-s)}function aC(s){return s<.5?Oc(s*2)*.5:zo(s*2-1)*.5+.5}const lC=Object.freeze(Object.defineProperty({__proto__:null,bounce:O6,cubic:I6,decorators:N6,easeInBack:eC,easeInBounce:Oc,easeInCirc:$6,easeInCubic:U6,easeInElastic:sC,easeInExpo:W6,easeInOutBack:iC,easeInOutBounce:aC,easeInOutCirc:tC,easeInOutCubic:K6,easeInOutElastic:rC,easeInOutExpo:X6,easeInOutQuad:F6,easeInOutQuart:G6,easeInOutQuint:_6,easeInOutSine:Q6,easeInQuad:L6,easeInQuart:J6,easeInQuint:Y6,easeInSine:R6,easeOutBack:nC,easeOutBounce:zo,easeOutCirc:Z6,easeOutCubic:V6,easeOutElastic:oC,easeOutExpo:q6,easeOutQuad:z6,easeOutQuart:j6,easeOutQuint:H6,easeOutSine:D6,exponential:P6,inout:T6,linear:Pc,quad:k6},Symbol.toStringTag,{value:"Module"}));function Fo(s,t){const e=[];for(let n=0;n<s.length;n+=2){const i=s[n],o=s[n+1],r=Array.isArray(t)?t:[t],a=Pl(i,o,r);e.push(a)}return go(e)}class cC{constructor(){this.listeners={}}on(t,e,n){return e==null?this:(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,n),this)}once(t,e,n){const i=(...o)=>(this.off(t,i),Fo([e,n],o));return this.on(t,i,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const i=this.listeners;return(t?[t]:Object.keys(i)).forEach(r=>{const a=i[r];if(a){if(!(e||n)){delete i[r];return}for(let l=a.length-2;l>=0;l-=2)e&&a[l]!==e||n&&a[l+1]!==n||a.splice(l,2)}}),this}trigger(t,...e){let n=!0;if(t!=="*"){const o=this.listeners[t];o!=null&&(n=Fo([...o],e))}const i=this.listeners["*"];return i!=null?go([n,Fo([...i],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}class Cn{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}function _(){return(s,t,e)=>{const n=e.value,i=s.__proto__;e.value=function(...o){this.disposed||(n.call(this,...o),i.dispose.call(this))}}}class Nt extends cC{dispose(){this.off()}}H([_()],Nt.prototype,"dispose",null),Py(Nt,Cn);class Uo{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach(e=>{const n=this.map.get(e);t(n,e)})}dispose(){this.clear()}}function Vo(s){const t=[],e=[];return Array.isArray(s)?t.push(...s):s.split("|").forEach(n=>{n.indexOf("&")===-1?t.push(n):e.push(...n.split("&"))}),{or:t,and:e}}function hC(s,t){if(s!=null&&t!=null){const e=Vo(s),n=Vo(t),i=e.or.sort(),o=n.or.sort(),r=e.and.sort(),a=n.and.sort(),l=(c,h)=>c.length===h.length&&(c.length===0||c.every((u,d)=>u===h[d]));return l(i,o)&&l(r,a)}return s==null&&t==null}function Te(s,t,e){if(t==null||Array.isArray(t)&&t.length===0)return e?s.altKey!==!0&&s.ctrlKey!==!0&&s.metaKey!==!0&&s.shiftKey!==!0:!0;const{or:n,and:i}=Vo(t),o=r=>{const a=`${r.toLowerCase()}Key`;return s[a]===!0};return n.some(r=>o(r))&&i.every(r=>o(r))}class ut{static create(t){return new ut(t)}constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if(typeof t=="object"){Object.entries(t).forEach(([r,a])=>{this.register(r,a,e)});return}this.exist(t)&&!n&&!Il()&&this.onDuplicated(t);const i=this.options.process,o=i?D(i,this,t,e):e;return this.data[t]=o,o}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return t?this.data[t]!=null:!1}onDuplicated(t){try{throw this.options.onConflict&&D(this.options.onConflict,this,t),new Error(`${Ui(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),i=e?`${e} ${pb(this.options.type)}`:this.options.type;return`${Ui(i)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return My(t,Object.keys(this.data),e=>e)}}const uC={},Nc={position:rs("x","width","origin")},Rc={position:rs("y","height","origin")},dC={position:rs("x","width","corner")},gC={position:rs("y","height","corner")},Dc={set:Pe("width","width")},Qc={set:Pe("height","height")},fC={set:Pe("rx","width")},pC={set:Pe("ry","height")},Lc={set:(s=>{const t=Pe(s,"width"),e=Pe(s,"height");return function(n,i){const o=i.refBBox,r=o.height>o.width?t:e;return D(r,this,n,i)}})("r")},mC={set(s,{refBBox:t}){let e=parseFloat(s);const n=ye(s);n&&(e/=100);const i=Math.sqrt(t.height*t.height+t.width*t.width);let o;return Number.isFinite(e)&&(n||e>=0&&e<=1?o=e*i:o=Math.max(e+i,0)),{r:o}}},bC={set:Pe("cx","width")},yC={set:Pe("cy","height")},zc={set:Vc({resetOffset:!0})},CC={set:Vc({resetOffset:!1})},Fc={set:Kc({resetOffset:!0})},wC={set:Kc({resetOffset:!1})},AC=Lc,xC=zc,vC=Fc,EC=Nc,SC=Rc,MC=Dc,BC=Qc;function rs(s,t,e){return(n,{refBBox:i})=>{if(n==null)return null;let o=parseFloat(n);const r=ye(n);r&&(o/=100);let a;if(Number.isFinite(o)){const c=i[e];r||o>0&&o<1?a=c[s]+i[t]*o:a=c[s]+o}const l=new w;return l[s]=a||0,l}}function Pe(s,t){return(e,{refBBox:n})=>{let i=parseFloat(e);const o=ye(e);o&&(i/=100);const r={};if(Number.isFinite(i)){const a=o||i>=0&&i<=1?i*n[t]:Math.max(i+n[t],0);r[s]=a}return r}}function Uc(s,t){const e="x6-shape",n=t&&t.resetOffset;return(i,{elem:o,refBBox:r})=>{let a=je(o,e);if(!a||a.value!==i){const m=s(i);a={value:i,shape:m,shapeBBox:m.bbox()},je(o,e,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),h=c.getOrigin(),u=r.getOrigin();c.x=u.x,c.y=u.y;const d=r.getMaxScaleToFit(c,u),f=c.width===0||r.width===0?1:d.sx,p=c.height===0||r.height===0?1:d.sy;return l.scale(f,p,h),n&&l.translate(-h.x,-h.y),l}}function Vc(s){function t(n){return z.parse(n)}const e=Uc(t,s);return(n,i)=>({d:e(n,i).serialize()})}function Kc(s){const t=Uc(e=>new yt(e),s);return(e,n)=>({points:t(e,n).serialize()})}const kC={qualify:te,set(s,{view:t}){return`url(#${t.graph.defineGradient(s)})`}},IC={qualify:te,set(s,{view:t}){const e=t.cell,n=Object.assign({},s);if(e.isEdge()&&n.type==="linearGradient"){const i=t,o=i.sourcePoint,r=i.targetPoint;n.id=`gradient-${n.type}-${e.id}`,n.attrs=Object.assign(Object.assign({},n.attrs),{x1:o.x,y1:o.y,x2:r.x,y2:r.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(n.id)}return`url(#${t.graph.defineGradient(n)})`}},Jc={qualify(s,{attrs:t}){return t.textWrap==null||!te(t.textWrap)},set(s,{view:t,elem:e,attrs:n}){const i="x6-text",o=je(e,i),r=h=>{try{return JSON.parse(h)}catch{return h}},a={x:n.x,eol:n.eol,annotations:r(n.annotations),textPath:r(n["text-path"]||n.textPath),textVerticalAnchor:n["text-vertical-anchor"]||n.textVerticalAnchor,displayEmpty:(n["display-empty"]||n.displayEmpty)==="true",lineHeight:n["line-height"]||n.lineHeight},l=n["font-size"]||n.fontSize,c=JSON.stringify([s,a]);if(l&&e.setAttribute("font-size",l),o==null||o!==c){const h=a.textPath;if(h!=null&&typeof h=="object"){const u=h.selector;if(typeof u=="string"){const d=t.find(u)[0];d instanceof SVGPathElement&&(bo(d),a.textPath=Object.assign({"xlink:href":`#${d.id}`},h))}}oc(e,`${s}`,a),je(e,i,c)}}},TC={qualify:te,set(s,{view:t,elem:e,attrs:n,refBBox:i}){const o=s,r=o.width||0;ye(r)?i.width*=parseFloat(r)/100:r<=0?i.width+=r:i.width=r;const a=o.height||0;ye(a)?i.height*=parseFloat(a)/100:a<=0?i.height+=a:i.height=a;let l,c=o.text;c==null&&(c=n.text||(e==null?void 0:e.textContent)),c!=null?l=ac(`${c}`,i,{"font-weight":n["font-weight"]||n.fontWeight,"font-size":n["font-size"]||n.fontSize,"font-family":n["font-family"]||n.fontFamily,lineHeight:n.lineHeight},{ellipsis:o.ellipsis}):l="",D(Jc.set,this,l,{view:t,elem:e,attrs:n,refBBox:i,cell:t.cell})}},wn=(s,{attrs:t})=>t.text!==void 0,PC={qualify:wn},OC={qualify:wn},NC={qualify:wn},RC={qualify:wn},DC={qualify:wn},QC={qualify:wn},LC={qualify(s,{elem:t}){return t instanceof SVGElement},set(s,{elem:t}){const e="x6-title",n=`${s}`,i=je(t,e);if(i==null||i!==n){je(t,e,n);const o=t.firstChild;if(o&&o.tagName.toUpperCase()==="TITLE"){const r=o;r.textContent=n}else{const r=document.createElementNS(t.namespaceURI,"title");r.textContent=n,t.insertBefore(r,o)}}}},zC={offset:jc("x","width","right")},FC={offset:jc("y","height","bottom")},UC={offset(s,{refBBox:t}){return s?{x:-t.x,y:-t.y}:{x:0,y:0}}};function jc(s,t,e){return(n,{refBBox:i})=>{const o=new w;let r;return n==="middle"?r=i[t]/2:n===e?r=i[t]:typeof n=="number"&&Number.isFinite(n)?r=n>-1&&n<1?-i[t]*n:-n:ye(n)?r=i[t]*parseFloat(n)/100:r=0,o[s]=-(i[s]+r),o}}const VC={qualify:te,set(s,{elem:t}){$(t,s)}},KC={set(s,{elem:t}){t.innerHTML=`${s}`}},JC={qualify:te,set(s,{view:t}){return`url(#${t.graph.defineFilter(s)})`}},jC={set(s){return s!=null&&typeof s=="object"&&s.id?s.id:s}},GC=s=>{var{size:t,width:e,height:n,offset:i,open:o}=s,r=V(s,["size","width","height","offset","open"]);return Gc({size:t,width:e,height:n,offset:i},o===!0,!0,void 0,r)},YC=s=>{var{size:t,width:e,height:n,offset:i,factor:o}=s,r=V(s,["size","width","height","offset","factor"]);return Gc({size:t,width:e,height:n,offset:i},!1,!1,o,r)};function Gc(s,t,e,n=3/4,i={}){const o=s.size||10,r=s.width||o,a=s.height||o,l=new z,c={};if(t)l.moveTo(r,0).lineTo(0,a/2).lineTo(r,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(r,0),!e){const h=Ke(n,0,1);l.lineTo(r*h,a/2)}l.lineTo(r,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),i),{tagName:"path",d:hn(l.serialize(),{x:s.offset!=null?s.offset:-r/2})})}const HC=s=>{var{size:t,width:e,height:n,offset:i}=s,o=V(s,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new z;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},o),{tagName:"path",d:hn(c.serialize(),i??-a/2)})},_C=s=>{var{d:t,offsetX:e,offsetY:n}=s,i=V(s,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:hn(t,e,n)})},WC=s=>{var{size:t,width:e,height:n,offset:i}=s,o=V(s,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new z;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:hn(c.serialize(),i||-a/2)})},qC=s=>{var{width:t,height:e,offset:n,open:i,flip:o}=s,r=V(s,["width","height","offset","open","flip"]);let a=e||6;const l=t||10,c=i===!0,h=o===!0,u=Object.assign(Object.assign({},r),{tagName:"path"});h&&(a=-a);const d=new z;return d.moveTo(0,a).lineTo(l,0),c?u.fill="none":(d.lineTo(l,a),d.close()),u.d=hn(d.serialize(),{x:n||-l/2,y:a/2}),u},Yc=s=>{var{r:t}=s,e=V(s,["r"]);const n=t||5;return Object.assign(Object.assign({cx:n},e),{tagName:"circle",r:n})},XC=Object.freeze(Object.defineProperty({__proto__:null,async:qC,block:GC,circle:Yc,circlePlus:s=>{var{r:t}=s,e=V(s,["r"]);const n=t||5,i=new z;return i.moveTo(n,0).lineTo(n,n*2),i.moveTo(0,n).lineTo(n*2,n),{children:[Object.assign(Object.assign({},Yc({r:n})),{fill:"none"}),Object.assign(Object.assign({},e),{tagName:"path",d:hn(i.serialize(),-n)})]}},classic:YC,cross:WC,diamond:HC,ellipse:s=>{var{rx:t,ry:e}=s,n=V(s,["rx","ry"]);const i=t||5,o=e||5;return Object.assign(Object.assign({cx:i},n),{tagName:"ellipse",rx:i,ry:o})},path:_C},Symbol.toStringTag,{value:"Module"})),$n=ut.create({type:"marker"});$n.register(XC,!0);function Ko(s){return typeof s=="string"||te(s)}const $C={qualify:Ko,set(s,{view:t,attrs:e}){return Jo("marker-start",s,t,e)}},ZC={qualify:Ko,set(s,{view:t,attrs:e}){return Jo("marker-end",s,t,e,{transform:"rotate(180)"})}},t2={qualify:Ko,set(s,{view:t,attrs:e}){return Jo("marker-mid",s,t,e)}};function Jo(s,t,e,n,i={}){const o=typeof t=="string"?{name:t}:t,{name:r,args:a}=o,l=V(o,["name","args"]);let c=l;if(r&&typeof r=="string"){const u=$n.get(r);if(u)c=u(Object.assign(Object.assign({},l),a));else return $n.onNotFound(r)}const h=Object.assign(Object.assign(Object.assign({},e2(n,s)),i),c);return{[s]:`url(#${e.graph.defineMarker(h)})`}}function e2(s,t){const e={},n=s.stroke;if(typeof n=="string"&&(e.stroke=n,e.fill=n),t!=="marker-mid"){const i=parseFloat(s.strokeWidth||s["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);e.refX=t==="marker-start"?o:-o}}return e}const Zn=(s,{view:t})=>t.cell.isEdge(),n2={qualify:Zn,set(s,t){var e,n,i,o;const r=t.view,a=s.reverse||!1,l=s.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let h,u;const d=r.getConnectionLength()||0;l<0?(h=(d+l)/2,u=-l):(h=l,u=d-l*2);const f=r.getConnection();c=(o=(i=(n=(e=f==null?void 0:f.divideAtLength(h))===null||e===void 0?void 0:e[1])===null||n===void 0?void 0:n.divideAtLength(u))===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.serialize()}else{let h;l<0?h=((r.getConnectionLength()||0)+l)/2:h=l;const u=r.getConnection();if(u){const d=u.divideAtLength(h),f=u.divideAtLength(-h);d&&f&&(c=`${d[0].serialize()} ${f[1].serialize()}`)}}return{d:c||r.getConnectionPathData()}}},Hc={qualify:Zn,set:as("getTangentAtLength",{rotate:!0})},i2={qualify:Zn,set:as("getTangentAtLength",{rotate:!1})},_c={qualify:Zn,set:as("getTangentAtRatio",{rotate:!0})},s2={qualify:Zn,set:as("getTangentAtRatio",{rotate:!1})},o2=Hc,r2=_c;function as(s,t){const e={x:1,y:0};return(n,i)=>{let o,r;const a=i.view,l=a[s](Number(n));return l?(r=t.rotate?l.vector().vectorAngle(e):0,o=l.start):(o=a.path.start,r=0),r===0||Number.isNaN(r)?{transform:`translate(${o.x},${o.y})`}:{transform:`translate(${o.x},${o.y}) rotate(${r})`}}}const a2=Object.freeze(Object.defineProperty({__proto__:null,annotations:RC,atConnectionLength:o2,atConnectionLengthIgnoreGradient:i2,atConnectionLengthKeepGradient:Hc,atConnectionRatio:r2,atConnectionRatioIgnoreGradient:s2,atConnectionRatioKeepGradient:_c,connection:n2,displayEmpty:QC,eol:DC,fill:kC,filter:JC,html:KC,lineHeight:PC,port:jC,ref:uC,refCx:bC,refCy:yC,refD:xC,refDKeepOffset:CC,refDResetOffset:zc,refDx:dC,refDy:gC,refHeight:Qc,refHeight2:BC,refPoints:vC,refPointsKeepOffset:wC,refPointsResetOffset:Fc,refR:AC,refRCircumscribed:mC,refRInscribed:Lc,refRx:fC,refRy:pC,refWidth:Dc,refWidth2:MC,refX:Nc,refX2:EC,refY:Rc,refY2:SC,resetOffset:UC,sourceMarker:$C,stroke:IC,style:VC,targetMarker:ZC,text:Jc,textPath:NC,textVerticalAnchor:OC,textWrap:TC,title:LC,vertexMarker:t2,xAlign:zC,yAlign:FC},Symbol.toStringTag,{value:"Module"})),l2={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"};function c2(s,t,e){return!!(s!=null&&(typeof s=="string"||typeof s.qualify!="function"||D(s.qualify,this,t,e)))}const Wc=Object.assign(Object.assign({},l2),a2),ti=ut.create({type:"attribute definition"});ti.register(Wc,!0);const qc=s=>{const t=document.createElement("canvas"),e=s.width,n=s.height;t.width=e*2,t.height=n;const i=t.getContext("2d");return i.drawImage(s,0,0,e,n),i.translate(2*e,0),i.scale(-1,1),i.drawImage(s,0,0,e,n),t},Xc=s=>{const t=document.createElement("canvas"),e=s.width,n=s.height;t.width=e,t.height=n*2;const i=t.getContext("2d");return i.drawImage(s,0,0,e,n),i.translate(0,2*n),i.scale(1,-1),i.drawImage(s,0,0,e,n),t},$c=s=>{const t=document.createElement("canvas"),e=s.width,n=s.height;t.width=2*e,t.height=2*n;const i=t.getContext("2d");return i.drawImage(s,0,0,e,n),i.setTransform(-1,0,0,-1,t.width,t.height),i.drawImage(s,0,0,e,n),i.setTransform(-1,0,0,1,t.width,0),i.drawImage(s,0,0,e,n),i.setTransform(1,0,0,-1,0,t.height),i.drawImage(s,0,0,e,n),t},ls=Object.assign({},Object.freeze(Object.defineProperty({__proto__:null,flipX:qc,flipXY:$c,flipY:Xc,watermark:(s,t)=>{const e=s.width,n=s.height,i=document.createElement("canvas");i.width=e*3,i.height=n*3;const o=i.getContext("2d"),r=t.angle!=null?-t.angle:-20,a=It(r),l=i.width/4,c=i.height/4;for(let h=0;h<4;h+=1)for(let u=0;u<4;u+=1)(h+u)%2>0&&(o.setTransform(1,0,0,1,(2*h-1)*l,(2*u-1)*c),o.rotate(a),o.drawImage(s,-e/2,-n/2,e,n));return i}},Symbol.toStringTag,{value:"Module"})));ls["flip-x"]=qc,ls["flip-y"]=Xc,ls["flip-xy"]=$c;const cs=ut.create({type:"background pattern"});cs.register(ls,!0);function hs(s,t,e){let n;if(typeof e=="object"){if(Number.isFinite(e.y)){const o=new N(t,s),{start:r,end:a}=o.parallel(e.y);t=r,s=a}n=e.x}else n=e;if(n==null||!Number.isFinite(n))return s;const i=s.distance(t);return n===0&&i>0?s:s.move(t,-Math.min(n,i-1))}function us(s){const t=s.getAttribute("stroke-width");return t===null?0:parseFloat(t)||0}function h2(s){if(s==null)return null;let t=s;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}const Zc=(s,t,e,n)=>{const i=t.getBBoxOfElement(e);n.stroked&&i.inflate(us(e)/2);const o=s.intersect(i),r=o&&o.length?s.start.closest(o):s.end;return hs(r,s.start,n.offset)},u2=function(s,t,e,n,i){const o=t.cell,r=o.isNode()?o.getAngle():0;if(r===0)return D(Zc,this,s,t,e,n,i);const a=t.getUnrotatedBBoxOfElement(e);n.stroked&&a.inflate(us(e)/2);const l=a.getCenter(),c=s.clone().rotate(r,l),h=c.setLength(1e6).intersect(a),u=h&&h.length?c.start.closest(h).rotate(-r,l):s.end;return hs(u,s.start,n.offset)},d2=(s,t,e,n)=>{let i,o;const r=s.end,a=n.selector;if(typeof a=="string"?i=t.findOne(a):Array.isArray(a)?i=To(e,a):i=h2(e),!Ie(i)){if(i===e||!Ie(e))return r;i=e}const l=t.getShapeOfElement(i),c=t.getMatrixOfElement(i),h=t.getRootTranslatedMatrix(),u=t.getRootRotatedMatrix(),d=h.multiply(u).multiply(c),f=d.inverse(),p=w6(s,f),m=p.start.clone(),b=t.getDataOfElement(i);if(n.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const x=b.shapeBBox;if(x!=null&&x.containsPoint(m))return r}n.extrapolate===!0&&p.setLength(1e6);let y;if(z.isPath(l)){const x=n.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:x})),y={precision:x,segmentSubdivisions:b.segmentSubdivisions},o=p.intersect(l,y)}else o=p.intersect(l);o?Array.isArray(o)&&(o=m.closest(o)):n.sticky===!0&&(I.isRectangle(l)?o=l.getNearestPointToPoint(m):Ft.isEllipse(l)?o=l.intersectsWithLineFromCenterToPoint(m):o=l.closestPoint(m,y));const C=o?we(o,d):r;let A=n.offset||0;return n.stroked!==!1&&(typeof A=="object"?(A=Object.assign({},A),A.x==null&&(A.x=0),A.x+=us(i)/2):A+=us(i)/2),hs(C,s.start,A)};function g2(s,t,e=0){const{start:n,end:i}=s;let o,r,a,l;switch(t){case"left":l="x",o=i,r=n,a=-1;break;case"right":l="x",o=n,r=i,a=1;break;case"top":l="y",o=i,r=n,a=-1;break;case"bottom":l="y",o=n,r=i,a=1;break;default:return}n[l]<i[l]?o[l]=r[l]:r[l]=o[l],Number.isFinite(e)&&(o[l]+=a*e,r[l]+=a*e)}const f2=Object.freeze(Object.defineProperty({__proto__:null,anchor:(s,t,e,n)=>{const{alignOffset:i,align:o}=n;return o&&g2(s,o,i),hs(s.end,s.start,n.offset)},bbox:Zc,boundary:d2,rect:u2},Symbol.toStringTag,{value:"Module"})),ei=ut.create({type:"connection point"});ei.register(f2,!0);const th=1,ds=1/3,gs=2/3;let ni=[],fs=[];function p2(s){let t=s.graph._jumpOverUpdateList;if(t==null&&(t=s.graph._jumpOverUpdateList=[],s.graph.on("cell:mouseup",()=>{const e=s.graph._jumpOverUpdateList;setTimeout(()=>{for(let n=0;n<e.length;n+=1)e[n].update()})}),s.graph.on("model:reseted",()=>{t=s.graph._jumpOverUpdateList=[]})),t.indexOf(s)<0){t.push(s);const e=()=>t.splice(t.indexOf(s),1);s.cell.once("change:connector",e),s.cell.once("removed",e)}}function jo(s,t,e=[]){const n=[s,...e,t],i=[];return n.forEach((o,r)=>{const a=n[r+1];a!=null&&i.push(new N(o,a))}),i}function m2(s,t){const e=[];return t.forEach(n=>{const i=s.intersectsWithLine(n);if(i){const{x:o,y:r}=i,{start:a,end:l}=n,c=Math.round(a.x)===Math.round(o)&&Math.round(a.y)===Math.round(r),h=Math.round(l.x)===Math.round(o)&&Math.round(l.y)===Math.round(r);if(c||h)return;e.push(i)}}),e}function eh(s,t){return new N(s,t).squaredLength()}function b2(s,t,e){return t.reduce((n,i,o)=>{if(fs.includes(i))return n;const r=n.pop()||s,a=w.create(i).move(r.start,-e);let l=w.create(i).move(r.start,+e);const c=t[o+1];if(c!=null){const d=l.distance(c);d<=e&&(l=c.move(r.start,d),fs.push(c))}else if(a.distance(r.end)<e*2+th)return n.push(r),n;if(l.distance(r.start)<e*2+th)return n.push(r),n;const u=new N(a,l);return ni.push(u),n.push(new N(r.start,a),u,new N(l,r.end)),n},[])}function nh(s,t,e,n){const i=new z;let o;return o=z.createSegment("M",s[0].start),i.appendSegment(o),s.forEach((r,a)=>{if(ni.includes(r)){let l,c,h,u;if(e==="arc"){l=-90,c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const f=r.getCenter(),p=new N(f,r.end).rotate(l,f);let m;m=new N(r.start,f),h=m.pointAt(2/3).rotate(l,r.start),u=p.pointAt(1/3).rotate(-l,p.end),o=z.createSegment("C",h,u,p.end),i.appendSegment(o),m=new N(f,r.end),h=p.pointAt(1/3).rotate(l,p.end),u=m.pointAt(1/3).rotate(-l,r.end),o=z.createSegment("C",h,u,r.end),i.appendSegment(o)}else if(e==="gap")o=z.createSegment("M",r.end),i.appendSegment(o);else if(e==="cubic"){l=r.start.theta(r.end);const d=t*.6;let f=t*1.35;c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(f*=-1),h=new w(r.start.x+d,r.start.y+f).rotate(l,r.start),u=new w(r.end.x-d,r.end.y+f).rotate(l,r.end),o=z.createSegment("C",h,u,r.end),i.appendSegment(o)}}else{const l=s[a+1];n===0||!l||ni.includes(l)?(o=z.createSegment("L",r.end),i.appendSegment(o)):y2(n,i,r.end,r.start,l.end)}}),i}function y2(s,t,e,n,i){const o=e.distance(n)/2,r=e.distance(i)/2,a=-Math.min(s,o),l=-Math.min(s,r),c=e.clone().move(n,a).round(),h=e.clone().move(i,l).round(),u=new w(ds*c.x+gs*e.x,gs*e.y+ds*c.y),d=new w(ds*h.x+gs*e.x,gs*e.y+ds*h.y);let f;f=z.createSegment("L",c),t.appendSegment(f),f=z.createSegment("C",u,d,h),t.appendSegment(f)}const ih=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(s,t,e,n={}){ni=[],fs=[],p2(this);const i=n.size||5,o=n.type||"arc",r=n.radius||0,a=n.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return nh(jo(s,t,e),i,o,r);const u=this.cell,d=h.indexOf(u),f=l.options.connecting.connector||{},p=h.filter((x,v)=>{const B=x.getConnector()||f;return a.includes(B.name)?!1:v>d?B.name!=="jumpover":!0}),m=p.map(x=>l.findViewByCell(x)),b=jo(s,t,e),y=m.map(x=>x==null?[]:x===this?b:jo(x.sourcePoint,x.targetPoint,x.routePoints)),C=[];b.forEach(x=>{const v=p.reduce((B,E,M)=>{if(E!==u){const k=m2(x,y[M]);B.push(...k)}return B},[]).sort((B,E)=>eh(x.start,B)-eh(x.start,E));v.length>0?C.push(...b2(x,v,i)):C.push(x)});const A=nh(C,i,o,r);return ni=[],fs=[],n.raw?A:A.serialize()},loop:(s,t,e,n={})=>{const i=e.length===3?0:1,o=w.create(e[0+i]),r=w.create(e[2+i]),a=w.create(e[1+i]);if(!w.equals(s,t)){const c=new w((s.x+t.x)/2,(s.y+t.y)/2),h=c.angleBetween(w.create(s).rotate(90,c),a);h>1&&(o.rotate(180-h,c),r.rotate(180-h,c),a.rotate(180-h,c))}const l=`
|
|
5
|
-
M ${
|
|
1
|
+
(function(ct,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("element-plus"),require("pinia"),require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","pinia","monaco-editor"],g):(ct=typeof globalThis<"u"?globalThis:ct||self,g(ct.EmsEditor={},ct.Vue,ct.ElementPlus,ct.Pinia,ct.monaco))})(this,function(ct,g,It,pe,Qd){"use strict";function Vd(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const Lt=Vd(Qd);/*! Element Plus Icons Vue v2.3.2 */var zd=g.defineComponent({name:"Document",__name:"document",setup(i){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),Kr=zd,Fd=g.defineComponent({name:"FolderOpened",__name:"folder-opened",setup(i){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"})]))}}),Ud=Fd,Kd=g.defineComponent({name:"Folder",__name:"folder",setup(i){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32"})]))}}),Jd=Kd,jd=g.defineComponent({name:"Menu",__name:"menu",setup(i){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),Gd=jd,Yd=g.defineComponent({name:"Plus",__name:"plus",setup(i){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Hd=Yd,_d=g.defineComponent({name:"Search",__name:"search",setup(i){return(t,e)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),Jr=_d;function _(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(e[n[s]]=i[n[s]]);return e}function X(i,t,e,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(o=(s<3?r(o):s>3?r(t,e,o):r(t,e))||o);return s>3&&o&&Object.defineProperty(t,e,o),o}function js(i,t,e,n){function s(o){return o instanceof e?o:new e(function(r){r(o)})}return new(e||(e=Promise))(function(o,r){function a(h){try{c(n.next(h))}catch(u){r(u)}}function l(h){try{c(n.throw(h))}catch(u){r(u)}}function c(h){h.done?o(h.value):s(h.value).then(a,l)}c((n=n.apply(i,t||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function Wd(i){i.forEach(t=>{Object.hasOwn(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){const n=document.createDocumentFragment();e.forEach(s=>{const o=s instanceof Node;n.appendChild(o?s:document.createTextNode(String(s)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&(i=>{Wd(i)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var jr=typeof global=="object"&&global&&global.Object===Object&&global,qd=typeof self=="object"&&self&&self.Object===Object&&self,te=jr||qd||Function("return this")(),Yt=te.Symbol,Gr=Object.prototype,Xd=Gr.hasOwnProperty,$d=Gr.toString,Dn=Yt?Yt.toStringTag:void 0;function Zd(i){var t=Xd.call(i,Dn),e=i[Dn];try{i[Dn]=void 0;var n=!0}catch{}var s=$d.call(i);return n&&(t?i[Dn]=e:delete i[Dn]),s}var tg=Object.prototype,eg=tg.toString;function ng(i){return eg.call(i)}var ig="[object Null]",sg="[object Undefined]",Yr=Yt?Yt.toStringTag:void 0;function Me(i){return i==null?i===void 0?sg:ig:Yr&&Yr in Object(i)?Zd(i):ng(i)}function ee(i){return i!=null&&typeof i=="object"}var og="[object Symbol]";function ce(i){return typeof i=="symbol"||ee(i)&&Me(i)==og}function Oi(i,t){for(var e=-1,n=i==null?0:i.length,s=Array(n);++e<n;)s[e]=t(i[e],e,i);return s}var Pt=Array.isArray,Hr=Yt?Yt.prototype:void 0,_r=Hr?Hr.toString:void 0;function Wr(i){if(typeof i=="string")return i;if(Pt(i))return Oi(i,Wr)+"";if(ce(i))return _r?_r.call(i):"";var t=i+"";return t=="0"&&1/i==-1/0?"-0":t}var rg=/\s/;function ag(i){for(var t=i.length;t--&&rg.test(i.charAt(t)););return t}var lg=/^\s+/;function cg(i){return i&&i.slice(0,ag(i)+1).replace(lg,"")}function mt(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}var qr=NaN,hg=/^[-+]0x[0-9a-f]+$/i,ug=/^0b[01]+$/i,dg=/^0o[0-7]+$/i,gg=parseInt;function Ln(i){if(typeof i=="number")return i;if(ce(i))return qr;if(mt(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=mt(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=cg(i);var e=ug.test(i);return e||dg.test(i)?gg(i.slice(2),e?2:8):hg.test(i)?qr:+i}function $e(i){return i}var fg="[object AsyncFunction]",pg="[object Function]",mg="[object GeneratorFunction]",bg="[object Proxy]";function Gs(i){if(!mt(i))return!1;var t=Me(i);return t==pg||t==mg||t==fg||t==bg}var Ys=te["__core-js_shared__"],Xr=function(){var i=/[^.]+$/.exec(Ys&&Ys.keys&&Ys.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function yg(i){return!!Xr&&Xr in i}var wg=Function.prototype,Cg=wg.toString;function ze(i){if(i!=null){try{return Cg.call(i)}catch{}try{return i+""}catch{}}return""}var Ag=/[\\^$.*+?()[\]{}|]/g,xg=/^\[object .+?Constructor\]$/,vg=Function.prototype,Eg=Object.prototype,Sg=vg.toString,Mg=Eg.hasOwnProperty,Bg=RegExp("^"+Sg.call(Mg).replace(Ag,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kg(i){if(!mt(i)||yg(i))return!1;var t=Gs(i)?Bg:xg;return t.test(ze(i))}function Tg(i,t){return i==null?void 0:i[t]}function Fe(i,t){var e=Tg(i,t);return kg(e)?e:void 0}var Hs=Fe(te,"WeakMap"),$r=Object.create,Ig=function(){function i(){}return function(t){if(!mt(t))return{};if($r)return $r(t);i.prototype=t;var e=new i;return i.prototype=void 0,e}}();function Zr(i,t,e){switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2])}return i.apply(t,e)}function Pg(){}function ta(i,t){var e=-1,n=i.length;for(t||(t=Array(n));++e<n;)t[e]=i[e];return t}var Og=800,Ng=16,Rg=Date.now;function Dg(i){var t=0,e=0;return function(){var n=Rg(),s=Ng-(n-e);if(e=n,s>0){if(++t>=Og)return arguments[0]}else t=0;return i.apply(void 0,arguments)}}function Lg(i){return function(){return i}}var Ni=function(){try{var i=Fe(Object,"defineProperty");return i({},"",{}),i}catch{}}(),Qg=Ni?function(i,t){return Ni(i,"toString",{configurable:!0,enumerable:!1,value:Lg(t),writable:!0})}:$e,ea=Dg(Qg);function Vg(i,t){for(var e=-1,n=i==null?0:i.length;++e<n&&t(i[e],e,i)!==!1;);return i}function zg(i,t,e,n){for(var s=i.length,o=e+-1;++o<s;)if(t(i[o],o,i))return o;return-1}function Fg(i){return i!==i}function Ug(i,t,e){for(var n=e-1,s=i.length;++n<s;)if(i[n]===t)return n;return-1}function Kg(i,t,e){return t===t?Ug(i,t,e):zg(i,Fg,e)}function na(i,t){var e=i==null?0:i.length;return!!e&&Kg(i,t,0)>-1}var Jg=9007199254740991,jg=/^(?:0|[1-9]\d*)$/;function Ri(i,t){var e=typeof i;return t=t??Jg,!!t&&(e=="number"||e!="symbol"&&jg.test(i))&&i>-1&&i%1==0&&i<t}function Di(i,t,e){t=="__proto__"&&Ni?Ni(i,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):i[t]=e}function Ze(i,t){return i===t||i!==i&&t!==t}var Gg=Object.prototype,Yg=Gg.hasOwnProperty;function _s(i,t,e){var n=i[t];(!(Yg.call(i,t)&&Ze(n,e))||e===void 0&&!(t in i))&&Di(i,t,e)}function Qn(i,t,e,n){var s=!e;e||(e={});for(var o=-1,r=t.length;++o<r;){var a=t[o],l=void 0;l===void 0&&(l=i[a]),s?Di(e,a,l):_s(e,a,l)}return e}var ia=Math.max;function sa(i,t,e){return t=ia(t===void 0?i.length-1:t,0),function(){for(var n=arguments,s=-1,o=ia(n.length-t,0),r=Array(o);++s<o;)r[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=e(r),Zr(i,this,a)}}function tn(i,t){return ea(sa(i,t,$e),i+"")}var Hg=9007199254740991;function Ws(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Hg}function Ue(i){return i!=null&&Ws(i.length)&&!Gs(i)}function Li(i,t,e){if(!mt(e))return!1;var n=typeof t;return(n=="number"?Ue(e)&&Ri(t,e.length):n=="string"&&t in e)?Ze(e[t],i):!1}function oa(i){return tn(function(t,e){var n=-1,s=e.length,o=s>1?e[s-1]:void 0,r=s>2?e[2]:void 0;for(o=i.length>3&&typeof o=="function"?(s--,o):void 0,r&&Li(e[0],e[1],r)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var a=e[n];a&&i(t,a,n,o)}return t})}var _g=Object.prototype;function Qi(i){var t=i&&i.constructor,e=typeof t=="function"&&t.prototype||_g;return i===e}function Wg(i,t){for(var e=-1,n=Array(i);++e<i;)n[e]=t(e);return n}var qg="[object Arguments]";function ra(i){return ee(i)&&Me(i)==qg}var aa=Object.prototype,Xg=aa.hasOwnProperty,$g=aa.propertyIsEnumerable,en=ra(function(){return arguments}())?ra:function(i){return ee(i)&&Xg.call(i,"callee")&&!$g.call(i,"callee")};function Zg(){return!1}var la=typeof ct=="object"&&ct&&!ct.nodeType&&ct,ca=la&&typeof module=="object"&&module&&!module.nodeType&&module,tf=ca&&ca.exports===la,ha=tf?te.Buffer:void 0,ef=ha?ha.isBuffer:void 0,nn=ef||Zg,nf="[object Arguments]",sf="[object Array]",of="[object Boolean]",rf="[object Date]",af="[object Error]",lf="[object Function]",cf="[object Map]",hf="[object Number]",uf="[object Object]",df="[object RegExp]",gf="[object Set]",ff="[object String]",pf="[object WeakMap]",mf="[object ArrayBuffer]",bf="[object DataView]",yf="[object Float32Array]",wf="[object Float64Array]",Cf="[object Int8Array]",Af="[object Int16Array]",xf="[object Int32Array]",vf="[object Uint8Array]",Ef="[object Uint8ClampedArray]",Sf="[object Uint16Array]",Mf="[object Uint32Array]",ht={};ht[yf]=ht[wf]=ht[Cf]=ht[Af]=ht[xf]=ht[vf]=ht[Ef]=ht[Sf]=ht[Mf]=!0,ht[nf]=ht[sf]=ht[mf]=ht[of]=ht[bf]=ht[rf]=ht[af]=ht[lf]=ht[cf]=ht[hf]=ht[uf]=ht[df]=ht[gf]=ht[ff]=ht[pf]=!1;function Bf(i){return ee(i)&&Ws(i.length)&&!!ht[Me(i)]}function Vi(i){return function(t){return i(t)}}var ua=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Vn=ua&&typeof module=="object"&&module&&!module.nodeType&&module,kf=Vn&&Vn.exports===ua,qs=kf&&jr.process,sn=function(){try{var i=Vn&&Vn.require&&Vn.require("util").types;return i||qs&&qs.binding&&qs.binding("util")}catch{}}(),da=sn&&sn.isTypedArray,zi=da?Vi(da):Bf,Tf=Object.prototype,If=Tf.hasOwnProperty;function ga(i,t){var e=Pt(i),n=!e&&en(i),s=!e&&!n&&nn(i),o=!e&&!n&&!s&&zi(i),r=e||n||s||o,a=r?Wg(i.length,String):[],l=a.length;for(var c in i)(t||If.call(i,c))&&!(r&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ri(c,l)))&&a.push(c);return a}function fa(i,t){return function(e){return i(t(e))}}var Pf=fa(Object.keys,Object),Of=Object.prototype,Nf=Of.hasOwnProperty;function pa(i){if(!Qi(i))return Pf(i);var t=[];for(var e in Object(i))Nf.call(i,e)&&e!="constructor"&&t.push(e);return t}function zn(i){return Ue(i)?ga(i):pa(i)}function Rf(i){var t=[];if(i!=null)for(var e in Object(i))t.push(e);return t}var Df=Object.prototype,Lf=Df.hasOwnProperty;function Qf(i){if(!mt(i))return Rf(i);var t=Qi(i),e=[];for(var n in i)n=="constructor"&&(t||!Lf.call(i,n))||e.push(n);return e}function on(i){return Ue(i)?ga(i,!0):Qf(i)}var Vf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zf=/^\w*$/;function Xs(i,t){if(Pt(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||ce(i)?!0:zf.test(i)||!Vf.test(i)||t!=null&&i in Object(t)}var Fn=Fe(Object,"create");function Ff(){this.__data__=Fn?Fn(null):{},this.size=0}function Uf(i){var t=this.has(i)&&delete this.__data__[i];return this.size-=t?1:0,t}var Kf="__lodash_hash_undefined__",Jf=Object.prototype,jf=Jf.hasOwnProperty;function Gf(i){var t=this.__data__;if(Fn){var e=t[i];return e===Kf?void 0:e}return jf.call(t,i)?t[i]:void 0}var Yf=Object.prototype,Hf=Yf.hasOwnProperty;function _f(i){var t=this.__data__;return Fn?t[i]!==void 0:Hf.call(t,i)}var Wf="__lodash_hash_undefined__";function qf(i,t){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=Fn&&t===void 0?Wf:t,this}function Ke(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Ke.prototype.clear=Ff,Ke.prototype.delete=Uf,Ke.prototype.get=Gf,Ke.prototype.has=_f,Ke.prototype.set=qf;function Xf(){this.__data__=[],this.size=0}function Fi(i,t){for(var e=i.length;e--;)if(Ze(i[e][0],t))return e;return-1}var $f=Array.prototype,Zf=$f.splice;function tp(i){var t=this.__data__,e=Fi(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Zf.call(t,e,1),--this.size,!0}function ep(i){var t=this.__data__,e=Fi(t,i);return e<0?void 0:t[e][1]}function np(i){return Fi(this.__data__,i)>-1}function ip(i,t){var e=this.__data__,n=Fi(e,i);return n<0?(++this.size,e.push([i,t])):e[n][1]=t,this}function me(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}me.prototype.clear=Xf,me.prototype.delete=tp,me.prototype.get=ep,me.prototype.has=np,me.prototype.set=ip;var Un=Fe(te,"Map");function sp(){this.size=0,this.__data__={hash:new Ke,map:new(Un||me),string:new Ke}}function op(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function Ui(i,t){var e=i.__data__;return op(t)?e[typeof t=="string"?"string":"hash"]:e.map}function rp(i){var t=Ui(this,i).delete(i);return this.size-=t?1:0,t}function ap(i){return Ui(this,i).get(i)}function lp(i){return Ui(this,i).has(i)}function cp(i,t){var e=Ui(this,i),n=e.size;return e.set(i,t),this.size+=e.size==n?0:1,this}function be(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}be.prototype.clear=sp,be.prototype.delete=rp,be.prototype.get=ap,be.prototype.has=lp,be.prototype.set=cp;var hp="Expected a function";function $s(i,t){if(typeof i!="function"||t!=null&&typeof t!="function")throw new TypeError(hp);var e=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=e.cache;if(o.has(s))return o.get(s);var r=i.apply(this,n);return e.cache=o.set(s,r)||o,r};return e.cache=new($s.Cache||be),e}$s.Cache=be;var up=500;function dp(i){var t=$s(i,function(n){return e.size===up&&e.clear(),n}),e=t.cache;return t}var gp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fp=/\\(\\)?/g,pp=dp(function(i){var t=[];return i.charCodeAt(0)===46&&t.push(""),i.replace(gp,function(e,n,s,o){t.push(s?o.replace(fp,"$1"):n||e)}),t});function rn(i){return i==null?"":Wr(i)}function Ki(i,t){return Pt(i)?i:Xs(i,t)?[i]:pp(rn(i))}function Kn(i){if(typeof i=="string"||ce(i))return i;var t=i+"";return t=="0"&&1/i==-1/0?"-0":t}function Ji(i,t){t=Ki(t,i);for(var e=0,n=t.length;i!=null&&e<n;)i=i[Kn(t[e++])];return e&&e==n?i:void 0}function mp(i,t,e){var n=i==null?void 0:Ji(i,t);return n===void 0?e:n}function Zs(i,t){for(var e=-1,n=t.length,s=i.length;++e<n;)i[s+e]=t[e];return i}var ma=Yt?Yt.isConcatSpreadable:void 0;function bp(i){return Pt(i)||en(i)||!!(ma&&i&&i[ma])}function ji(i,t,e,n,s){var o=-1,r=i.length;for(e||(e=bp),s||(s=[]);++o<r;){var a=i[o];e(a)?Zs(s,a):n||(s[s.length]=a)}return s}function yp(i){var t=i==null?0:i.length;return t?ji(i):[]}function wp(i){return ea(sa(i,void 0,yp),i+"")}var to=fa(Object.getPrototypeOf,Object),Cp="[object Object]",Ap=Function.prototype,xp=Object.prototype,ba=Ap.toString,vp=xp.hasOwnProperty,Ep=ba.call(Object);function ne(i){if(!ee(i)||Me(i)!=Cp)return!1;var t=to(i);if(t===null)return!0;var e=vp.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&ba.call(e)==Ep}function Sp(i,t,e){var n=-1,s=i.length;t<0&&(t=-t>s?0:s+t),e=e>s?s:e,e<0&&(e+=s),s=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=i[n+t];return o}function Mp(i,t,e){var n=i.length;return e=e===void 0?n:e,!t&&e>=n?i:Sp(i,t,e)}var Bp="\\ud800-\\udfff",kp="\\u0300-\\u036f",Tp="\\ufe20-\\ufe2f",Ip="\\u20d0-\\u20ff",Pp=kp+Tp+Ip,Op="\\ufe0e\\ufe0f",Np="\\u200d",Rp=RegExp("["+Np+Bp+Pp+Op+"]");function ya(i){return Rp.test(i)}function Dp(i){return i.split("")}var wa="\\ud800-\\udfff",Lp="\\u0300-\\u036f",Qp="\\ufe20-\\ufe2f",Vp="\\u20d0-\\u20ff",zp=Lp+Qp+Vp,Fp="\\ufe0e\\ufe0f",Up="["+wa+"]",eo="["+zp+"]",no="\\ud83c[\\udffb-\\udfff]",Kp="(?:"+eo+"|"+no+")",Ca="[^"+wa+"]",Aa="(?:\\ud83c[\\udde6-\\uddff]){2}",xa="[\\ud800-\\udbff][\\udc00-\\udfff]",Jp="\\u200d",va=Kp+"?",Ea="["+Fp+"]?",jp="(?:"+Jp+"(?:"+[Ca,Aa,xa].join("|")+")"+Ea+va+")*",Gp=Ea+va+jp,Yp="(?:"+[Ca+eo+"?",eo,Aa,xa,Up].join("|")+")",Hp=RegExp(no+"(?="+no+")|"+Yp+Gp,"g");function _p(i){return i.match(Hp)||[]}function Wp(i){return ya(i)?_p(i):Dp(i)}function Sa(i){return function(t){t=rn(t);var e=ya(t)?Wp(t):void 0,n=e?e[0]:t.charAt(0),s=e?Mp(e,1).join(""):t.slice(1);return n[i]()+s}}var Gi=Sa("toUpperCase");function qp(i){return Gi(rn(i).toLowerCase())}function Xp(i,t,e,n){for(var s=-1,o=i==null?0:i.length;++s<o;)e=t(e,i[s],s,i);return e}function $p(i){return function(t){return i==null?void 0:i[t]}}var Zp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I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:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tm=$p(Zp),em=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nm="\\u0300-\\u036f",im="\\ufe20-\\ufe2f",sm="\\u20d0-\\u20ff",om=nm+im+sm,rm="["+om+"]",am=RegExp(rm,"g");function lm(i){return i=rn(i),i&&i.replace(em,tm).replace(am,"")}var cm=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function hm(i){return i.match(cm)||[]}var um=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function dm(i){return um.test(i)}var Ma="\\ud800-\\udfff",gm="\\u0300-\\u036f",fm="\\ufe20-\\ufe2f",pm="\\u20d0-\\u20ff",mm=gm+fm+pm,Ba="\\u2700-\\u27bf",ka="a-z\\xdf-\\xf6\\xf8-\\xff",bm="\\xac\\xb1\\xd7\\xf7",ym="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",wm="\\u2000-\\u206f",Cm=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ta="A-Z\\xc0-\\xd6\\xd8-\\xde",Am="\\ufe0e\\ufe0f",Ia=bm+ym+wm+Cm,Pa="['’]",Oa="["+Ia+"]",xm="["+mm+"]",Na="\\d+",vm="["+Ba+"]",Ra="["+ka+"]",Da="[^"+Ma+Ia+Na+Ba+ka+Ta+"]",Em="\\ud83c[\\udffb-\\udfff]",Sm="(?:"+xm+"|"+Em+")",Mm="[^"+Ma+"]",La="(?:\\ud83c[\\udde6-\\uddff]){2}",Qa="[\\ud800-\\udbff][\\udc00-\\udfff]",an="["+Ta+"]",Bm="\\u200d",Va="(?:"+Ra+"|"+Da+")",km="(?:"+an+"|"+Da+")",za="(?:"+Pa+"(?:d|ll|m|re|s|t|ve))?",Fa="(?:"+Pa+"(?:D|LL|M|RE|S|T|VE))?",Ua=Sm+"?",Ka="["+Am+"]?",Tm="(?:"+Bm+"(?:"+[Mm,La,Qa].join("|")+")"+Ka+Ua+")*",Im="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Om=Ka+Ua+Tm,Nm="(?:"+[vm,La,Qa].join("|")+")"+Om,Rm=RegExp([an+"?"+Ra+"+"+za+"(?="+[Oa,an,"$"].join("|")+")",km+"+"+Fa+"(?="+[Oa,an+Va,"$"].join("|")+")",an+"?"+Va+"+"+za,an+"+"+Fa,Pm,Im,Na,Nm].join("|"),"g");function Dm(i){return i.match(Rm)||[]}function Lm(i,t,e){return i=rn(i),t=t,t===void 0?dm(i)?Dm(i):hm(i):i.match(t)||[]}var Qm="['’]",Vm=RegExp(Qm,"g");function Ja(i){return function(t){return Xp(Lm(lm(t).replace(Vm,"")),i,"")}}var Jn=Ja(function(i,t,e){return t=t.toLowerCase(),i+(e?qp(t):t)});function ja(){if(!arguments.length)return[];var i=arguments[0];return Pt(i)?i:[i]}function zm(i,t,e){return i===i&&(e!==void 0&&(i=i<=e?i:e),t!==void 0&&(i=i>=t?i:t)),i}function Je(i,t,e){return e===void 0&&(e=t,t=void 0),e!==void 0&&(e=Ln(e),e=e===e?e:0),t!==void 0&&(t=Ln(t),t=t===t?t:0),zm(Ln(i),t,e)}function Fm(){this.__data__=new me,this.size=0}function Um(i){var t=this.__data__,e=t.delete(i);return this.size=t.size,e}function Km(i){return this.__data__.get(i)}function Jm(i){return this.__data__.has(i)}var jm=200;function Gm(i,t){var e=this.__data__;if(e instanceof me){var n=e.__data__;if(!Un||n.length<jm-1)return n.push([i,t]),this.size=++e.size,this;e=this.__data__=new be(n)}return e.set(i,t),this.size=e.size,this}function ie(i){var t=this.__data__=new me(i);this.size=t.size}ie.prototype.clear=Fm,ie.prototype.delete=Um,ie.prototype.get=Km,ie.prototype.has=Jm,ie.prototype.set=Gm;function Ym(i,t){return i&&Qn(t,zn(t),i)}function Hm(i,t){return i&&Qn(t,on(t),i)}var Ga=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Ya=Ga&&typeof module=="object"&&module&&!module.nodeType&&module,_m=Ya&&Ya.exports===Ga,Ha=_m?te.Buffer:void 0,_a=Ha?Ha.allocUnsafe:void 0;function Wa(i,t){if(t)return i.slice();var e=i.length,n=_a?_a(e):new i.constructor(e);return i.copy(n),n}function Wm(i,t){for(var e=-1,n=i==null?0:i.length,s=0,o=[];++e<n;){var r=i[e];t(r,e,i)&&(o[s++]=r)}return o}function qa(){return[]}var qm=Object.prototype,Xm=qm.propertyIsEnumerable,Xa=Object.getOwnPropertySymbols,io=Xa?function(i){return i==null?[]:(i=Object(i),Wm(Xa(i),function(t){return Xm.call(i,t)}))}:qa;function $m(i,t){return Qn(i,io(i),t)}var Zm=Object.getOwnPropertySymbols,$a=Zm?function(i){for(var t=[];i;)Zs(t,io(i)),i=to(i);return t}:qa;function t0(i,t){return Qn(i,$a(i),t)}function Za(i,t,e){var n=t(i);return Pt(i)?n:Zs(n,e(i))}function so(i){return Za(i,zn,io)}function e0(i){return Za(i,on,$a)}var oo=Fe(te,"DataView"),ro=Fe(te,"Promise"),ln=Fe(te,"Set"),tl="[object Map]",n0="[object Object]",el="[object Promise]",nl="[object Set]",il="[object WeakMap]",sl="[object DataView]",i0=ze(oo),s0=ze(Un),o0=ze(ro),r0=ze(ln),a0=ze(Hs),Ht=Me;(oo&&Ht(new oo(new ArrayBuffer(1)))!=sl||Un&&Ht(new Un)!=tl||ro&&Ht(ro.resolve())!=el||ln&&Ht(new ln)!=nl||Hs&&Ht(new Hs)!=il)&&(Ht=function(i){var t=Me(i),e=t==n0?i.constructor:void 0,n=e?ze(e):"";if(n)switch(n){case i0:return sl;case s0:return tl;case o0:return el;case r0:return nl;case a0:return il}return t});var l0=Object.prototype,c0=l0.hasOwnProperty;function h0(i){var t=i.length,e=new i.constructor(t);return t&&typeof i[0]=="string"&&c0.call(i,"index")&&(e.index=i.index,e.input=i.input),e}var Yi=te.Uint8Array;function ao(i){var t=new i.constructor(i.byteLength);return new Yi(t).set(new Yi(i)),t}function u0(i,t){var e=t?ao(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.byteLength)}var d0=/\w*$/;function g0(i){var t=new i.constructor(i.source,d0.exec(i));return t.lastIndex=i.lastIndex,t}var ol=Yt?Yt.prototype:void 0,rl=ol?ol.valueOf:void 0;function f0(i){return rl?Object(rl.call(i)):{}}function al(i,t){var e=t?ao(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.length)}var p0="[object Boolean]",m0="[object Date]",b0="[object Map]",y0="[object Number]",w0="[object RegExp]",C0="[object Set]",A0="[object String]",x0="[object Symbol]",v0="[object ArrayBuffer]",E0="[object DataView]",S0="[object Float32Array]",M0="[object Float64Array]",B0="[object Int8Array]",k0="[object Int16Array]",T0="[object Int32Array]",I0="[object Uint8Array]",P0="[object Uint8ClampedArray]",O0="[object Uint16Array]",N0="[object Uint32Array]";function R0(i,t,e){var n=i.constructor;switch(t){case v0:return ao(i);case p0:case m0:return new n(+i);case E0:return u0(i,e);case S0:case M0:case B0:case k0:case T0:case I0:case P0:case O0:case N0:return al(i,e);case b0:return new n;case y0:case A0:return new n(i);case w0:return g0(i);case C0:return new n;case x0:return f0(i)}}function ll(i){return typeof i.constructor=="function"&&!Qi(i)?Ig(to(i)):{}}var D0="[object Map]";function L0(i){return ee(i)&&Ht(i)==D0}var cl=sn&&sn.isMap,Q0=cl?Vi(cl):L0,V0="[object Set]";function z0(i){return ee(i)&&Ht(i)==V0}var hl=sn&&sn.isSet,F0=hl?Vi(hl):z0,U0=1,K0=2,J0=4,ul="[object Arguments]",j0="[object Array]",G0="[object Boolean]",Y0="[object Date]",H0="[object Error]",dl="[object Function]",_0="[object GeneratorFunction]",W0="[object Map]",q0="[object Number]",gl="[object Object]",X0="[object RegExp]",$0="[object Set]",Z0="[object String]",t1="[object Symbol]",e1="[object WeakMap]",n1="[object ArrayBuffer]",i1="[object DataView]",s1="[object Float32Array]",o1="[object Float64Array]",r1="[object Int8Array]",a1="[object Int16Array]",l1="[object Int32Array]",c1="[object Uint8Array]",h1="[object Uint8ClampedArray]",u1="[object Uint16Array]",d1="[object Uint32Array]",rt={};rt[ul]=rt[j0]=rt[n1]=rt[i1]=rt[G0]=rt[Y0]=rt[s1]=rt[o1]=rt[r1]=rt[a1]=rt[l1]=rt[W0]=rt[q0]=rt[gl]=rt[X0]=rt[$0]=rt[Z0]=rt[t1]=rt[c1]=rt[h1]=rt[u1]=rt[d1]=!0,rt[H0]=rt[dl]=rt[e1]=!1;function jn(i,t,e,n,s,o){var r,a=t&U0,l=t&K0,c=t&J0;if(r!==void 0)return r;if(!mt(i))return i;var h=Pt(i);if(h){if(r=h0(i),!a)return ta(i,r)}else{var u=Ht(i),d=u==dl||u==_0;if(nn(i))return Wa(i,a);if(u==gl||u==ul||d&&!s){if(r=l||d?{}:ll(i),!a)return l?t0(i,Hm(r,i)):$m(i,Ym(r,i))}else{if(!rt[u])return s?i:{};r=R0(i,u,a)}}o||(o=new ie);var f=o.get(i);if(f)return f;o.set(i,r),F0(i)?i.forEach(function(b){r.add(jn(b,t,e,b,i,o))}):Q0(i)&&i.forEach(function(b,y){r.set(y,jn(b,t,e,y,i,o))});var m=c?l?e0:so:l?on:zn,p=h?void 0:m(i);return Vg(p||i,function(b,y){p&&(y=b,b=i[y]),_s(r,y,jn(b,t,e,y,i,o))}),r}var g1=4;function lo(i){return jn(i,g1)}var f1=1,p1=4;function ut(i){return jn(i,f1|p1)}var m1="__lodash_hash_undefined__";function b1(i){return this.__data__.set(i,m1),this}function y1(i){return this.__data__.has(i)}function cn(i){var t=-1,e=i==null?0:i.length;for(this.__data__=new be;++t<e;)this.add(i[t])}cn.prototype.add=cn.prototype.push=b1,cn.prototype.has=y1;function w1(i,t){for(var e=-1,n=i==null?0:i.length;++e<n;)if(t(i[e],e,i))return!0;return!1}function co(i,t){return i.has(t)}var C1=1,A1=2;function fl(i,t,e,n,s,o){var r=e&C1,a=i.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=o.get(i),h=o.get(t);if(c&&h)return c==t&&h==i;var u=-1,d=!0,f=e&A1?new cn:void 0;for(o.set(i,t),o.set(t,i);++u<a;){var m=i[u],p=t[u];if(n)var b=r?n(p,m,u,t,i,o):n(m,p,u,i,t,o);if(b!==void 0){if(b)continue;d=!1;break}if(f){if(!w1(t,function(y,C){if(!co(f,C)&&(m===y||s(m,y,e,n,o)))return f.push(C)})){d=!1;break}}else if(!(m===p||s(m,p,e,n,o))){d=!1;break}}return o.delete(i),o.delete(t),d}function x1(i){var t=-1,e=Array(i.size);return i.forEach(function(n,s){e[++t]=[s,n]}),e}function ho(i){var t=-1,e=Array(i.size);return i.forEach(function(n){e[++t]=n}),e}var v1=1,E1=2,S1="[object Boolean]",M1="[object Date]",B1="[object Error]",k1="[object Map]",T1="[object Number]",I1="[object RegExp]",P1="[object Set]",O1="[object String]",N1="[object Symbol]",R1="[object ArrayBuffer]",D1="[object DataView]",pl=Yt?Yt.prototype:void 0,uo=pl?pl.valueOf:void 0;function L1(i,t,e,n,s,o,r){switch(e){case D1:if(i.byteLength!=t.byteLength||i.byteOffset!=t.byteOffset)return!1;i=i.buffer,t=t.buffer;case R1:return!(i.byteLength!=t.byteLength||!o(new Yi(i),new Yi(t)));case S1:case M1:case T1:return Ze(+i,+t);case B1:return i.name==t.name&&i.message==t.message;case I1:case O1:return i==t+"";case k1:var a=x1;case P1:var l=n&v1;if(a||(a=ho),i.size!=t.size&&!l)return!1;var c=r.get(i);if(c)return c==t;n|=E1,r.set(i,t);var h=fl(a(i),a(t),n,s,o,r);return r.delete(i),h;case N1:if(uo)return uo.call(i)==uo.call(t)}return!1}var Q1=1,V1=Object.prototype,z1=V1.hasOwnProperty;function F1(i,t,e,n,s,o){var r=e&Q1,a=so(i),l=a.length,c=so(t),h=c.length;if(l!=h&&!r)return!1;for(var u=l;u--;){var d=a[u];if(!(r?d in t:z1.call(t,d)))return!1}var f=o.get(i),m=o.get(t);if(f&&m)return f==t&&m==i;var p=!0;o.set(i,t),o.set(t,i);for(var b=r;++u<l;){d=a[u];var y=i[d],C=t[d];if(n)var w=r?n(C,y,d,t,i,o):n(y,C,d,i,t,o);if(!(w===void 0?y===C||s(y,C,e,n,o):w)){p=!1;break}b||(b=d=="constructor")}if(p&&!b){var x=i.constructor,E=t.constructor;x!=E&&"constructor"in i&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof E=="function"&&E instanceof E)&&(p=!1)}return o.delete(i),o.delete(t),p}var U1=1,ml="[object Arguments]",bl="[object Array]",Hi="[object Object]",K1=Object.prototype,yl=K1.hasOwnProperty;function J1(i,t,e,n,s,o){var r=Pt(i),a=Pt(t),l=r?bl:Ht(i),c=a?bl:Ht(t);l=l==ml?Hi:l,c=c==ml?Hi:c;var h=l==Hi,u=c==Hi,d=l==c;if(d&&nn(i)){if(!nn(t))return!1;r=!0,h=!1}if(d&&!h)return o||(o=new ie),r||zi(i)?fl(i,t,e,n,s,o):L1(i,t,l,e,n,s,o);if(!(e&U1)){var f=h&&yl.call(i,"__wrapped__"),m=u&&yl.call(t,"__wrapped__");if(f||m){var p=f?i.value():i,b=m?t.value():t;return o||(o=new ie),s(p,b,e,n,o)}}return d?(o||(o=new ie),F1(i,t,e,n,s,o)):!1}function _i(i,t,e,n,s){return i===t?!0:i==null||t==null||!ee(i)&&!ee(t)?i!==i&&t!==t:J1(i,t,e,n,_i,s)}var j1=1,G1=2;function Y1(i,t,e,n){var s=e.length,o=s;if(i==null)return!o;for(i=Object(i);s--;){var r=e[s];if(r[2]?r[1]!==i[r[0]]:!(r[0]in i))return!1}for(;++s<o;){r=e[s];var a=r[0],l=i[a],c=r[1];if(r[2]){if(l===void 0&&!(a in i))return!1}else{var h=new ie,u;if(!(u===void 0?_i(c,l,j1|G1,n,h):u))return!1}}return!0}function wl(i){return i===i&&!mt(i)}function H1(i){for(var t=zn(i),e=t.length;e--;){var n=t[e],s=i[n];t[e]=[n,s,wl(s)]}return t}function Cl(i,t){return function(e){return e==null?!1:e[i]===t&&(t!==void 0||i in Object(e))}}function _1(i){var t=H1(i);return t.length==1&&t[0][2]?Cl(t[0][0],t[0][1]):function(e){return e===i||Y1(e,i,t)}}function W1(i,t){return i!=null&&t in Object(i)}function Al(i,t,e){t=Ki(t,i);for(var n=-1,s=t.length,o=!1;++n<s;){var r=Kn(t[n]);if(!(o=i!=null&&e(i,r)))break;i=i[r]}return o||++n!=s?o:(s=i==null?0:i.length,!!s&&Ws(s)&&Ri(r,s)&&(Pt(i)||en(i)))}function xl(i,t){return i!=null&&Al(i,t,W1)}var q1=1,X1=2;function $1(i,t){return Xs(i)&&wl(t)?Cl(Kn(i),t):function(e){var n=mp(e,i);return n===void 0&&n===t?xl(e,i):_i(t,n,q1|X1)}}function Z1(i){return function(t){return t==null?void 0:t[i]}}function tb(i){return function(t){return Ji(t,i)}}function eb(i){return Xs(i)?Z1(Kn(i)):tb(i)}function go(i){return typeof i=="function"?i:i==null?$e:typeof i=="object"?Pt(i)?$1(i[0],i[1]):_1(i):eb(i)}function nb(i,t,e,n){for(var s=-1,o=i==null?0:i.length;++s<o;){var r=i[s];t(n,r,e(r),i)}return n}function ib(i){return function(t,e,n){for(var s=-1,o=Object(t),r=n(t),a=r.length;a--;){var l=r[++s];if(e(o[l],l,o)===!1)break}return t}}var vl=ib();function sb(i,t){return i&&vl(i,t,zn)}function ob(i,t){return function(e,n){if(e==null)return e;if(!Ue(e))return i(e,n);for(var s=e.length,o=-1,r=Object(e);++o<s&&n(r[o],o,r)!==!1;);return e}}var El=ob(sb);function rb(i,t,e,n){return El(i,function(s,o,r){t(n,s,e(s),r)}),n}function ab(i,t){return function(e,n){var s=Pt(e)?nb:rb,o=t?t():{};return s(e,i,go(n),o)}}var fo=function(){return te.Date.now()},lb="Expected a function",cb=Math.max,hb=Math.min;function Wi(i,t,e){var n,s,o,r,a,l,c=0,h=!1,u=!1,d=!0;if(typeof i!="function")throw new TypeError(lb);t=Ln(t)||0,mt(e)&&(h=!!e.leading,u="maxWait"in e,o=u?cb(Ln(e.maxWait)||0,t):o,d="trailing"in e?!!e.trailing:d);function f(S){var v=n,M=s;return n=s=void 0,c=S,r=i.apply(M,v),r}function m(S){return c=S,a=setTimeout(y,t),h?f(S):r}function p(S){var v=S-l,M=S-c,k=t-v;return u?hb(k,o-M):k}function b(S){var v=S-l,M=S-c;return l===void 0||v>=t||v<0||u&&M>=o}function y(){var S=fo();if(b(S))return C(S);a=setTimeout(y,p(S))}function C(S){return a=void 0,d&&n?f(S):(n=s=void 0,r)}function w(){a!==void 0&&clearTimeout(a),c=0,n=l=s=a=void 0}function x(){return a===void 0?r:C(fo())}function E(){var S=fo(),v=b(S);if(n=arguments,s=this,l=S,v){if(a===void 0)return m(l);if(u)return clearTimeout(a),a=setTimeout(y,t),f(l)}return a===void 0&&(a=setTimeout(y,t)),r}return E.cancel=w,E.flush=x,E}var Sl=Object.prototype,ub=Sl.hasOwnProperty,db=tn(function(i,t){i=Object(i);var e=-1,n=t.length,s=n>2?t[2]:void 0;for(s&&Li(t[0],t[1],s)&&(n=1);++e<n;)for(var o=t[e],r=on(o),a=-1,l=r.length;++a<l;){var c=r[a],h=i[c];(h===void 0||Ze(h,Sl[c])&&!ub.call(i,c))&&(i[c]=o[c])}return i});function po(i,t,e){(e!==void 0&&!Ze(i[t],e)||e===void 0&&!(t in i))&&Di(i,t,e)}function qi(i){return ee(i)&&Ue(i)}function mo(i,t){if(!(t==="constructor"&&typeof i[t]=="function")&&t!="__proto__")return i[t]}function gb(i){return Qn(i,on(i))}function fb(i,t,e,n,s,o,r){var a=mo(i,e),l=mo(t,e),c=r.get(l);if(c){po(i,e,c);return}var h=o?o(a,l,e+"",i,t,r):void 0,u=h===void 0;if(u){var d=Pt(l),f=!d&&nn(l),m=!d&&!f&&zi(l);h=l,d||f||m?Pt(a)?h=a:qi(a)?h=ta(a):f?(u=!1,h=Wa(l,!0)):m?(u=!1,h=al(l,!0)):h=[]:ne(l)||en(l)?(h=a,en(a)?h=gb(a):(!mt(a)||Gs(a))&&(h=ll(l))):u=!1}u&&(r.set(l,h),s(h,l,n,o,r),r.delete(l)),po(i,e,h)}function Xi(i,t,e,n,s){i!==t&&vl(t,function(o,r){if(s||(s=new ie),mt(o))fb(i,t,r,e,Xi,n,s);else{var a=n?n(mo(i,r),o,r+"",i,t,s):void 0;a===void 0&&(a=o),po(i,r,a)}},on)}function Ml(i,t,e,n,s,o){return mt(i)&&mt(t)&&(o.set(t,i),Xi(i,t,void 0,Ml,o),o.delete(t)),i}var pb=oa(function(i,t,e,n){Xi(i,t,e,n)}),Bl=tn(function(i){return i.push(void 0,Ml),Zr(pb,void 0,i)}),mb=200;function bb(i,t,e,n){var s=-1,o=na,r=!0,a=i.length,l=[],c=t.length;if(!a)return l;t.length>=mb&&(o=co,r=!1,t=new cn(t));t:for(;++s<a;){var h=i[s],u=h;if(h=h!==0?h:0,r&&u===u){for(var d=c;d--;)if(t[d]===u)continue t;l.push(h)}else o(t,u,n)||l.push(h)}return l}var yb=tn(function(i,t){return qi(i)?bb(i,ji(t,1,qi,!0)):[]});function wb(i,t){var e=-1,n=Ue(i)?Array(i.length):[];return El(i,function(s,o,r){n[++e]=t(s,o,r)}),n}var Cb=Object.prototype,Ab=Cb.hasOwnProperty,kl=ab(function(i,t,e){Ab.call(i,e)?i[e].push(t):Di(i,e,[t])});function xb(i,t){return i>t}var vb=Object.prototype,Eb=vb.hasOwnProperty;function Sb(i,t){return i!=null&&Eb.call(i,t)}function $i(i,t){return i!=null&&Al(i,t,Sb)}var Mb="[object Map]",Bb="[object Set]",kb=Object.prototype,Tb=kb.hasOwnProperty;function bo(i){if(i==null)return!0;if(Ue(i)&&(Pt(i)||typeof i=="string"||typeof i.splice=="function"||nn(i)||zi(i)||en(i)))return!i.length;var t=Ht(i);if(t==Mb||t==Bb)return!i.size;if(Qi(i))return!pa(i).length;for(var e in i)if(Tb.call(i,e))return!1;return!0}function ye(i,t){return _i(i,t)}var Ib="[object Number]";function we(i){return typeof i=="number"||ee(i)&&Me(i)==Ib}var Pb=Sa("toLowerCase");function Ob(i,t,e){for(var n=-1,s=i.length;++n<s;){var o=i[n],r=t(o);if(r!=null&&(a===void 0?r===r&&!ce(r):e(r,a)))var a=r,l=o}return l}function Nb(i){return i&&i.length?Ob(i,$e,xb):void 0}var pt=oa(function(i,t,e){Xi(i,t,e)});function Rb(i,t,e,n){if(!mt(i))return i;t=Ki(t,i);for(var s=-1,o=t.length,r=o-1,a=i;a!=null&&++s<o;){var l=Kn(t[s]),c=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return i;if(s!=r){var h=a[l];c=void 0,c===void 0&&(c=mt(h)?h:Ri(t[s+1])?[]:{})}_s(a,l,c),a=a[l]}return i}function Db(i,t,e){for(var n=-1,s=t.length,o={};++n<s;){var r=t[n],a=Ji(i,r);e(a,r)&&Rb(o,Ki(r,i),a)}return o}function Lb(i,t){var e=i.length;for(i.sort(t);e--;)i[e]=i[e].value;return i}function Qb(i,t){if(i!==t){var e=i!==void 0,n=i===null,s=i===i,o=ce(i),r=t!==void 0,a=t===null,l=t===t,c=ce(t);if(!a&&!c&&!o&&i>t||o&&r&&l&&!a&&!c||n&&r&&l||!e&&l||!s)return 1;if(!n&&!o&&!c&&i<t||c&&e&&s&&!n&&!o||a&&e&&s||!r&&s||!l)return-1}return 0}function Vb(i,t,e){for(var n=-1,s=i.criteria,o=t.criteria,r=s.length,a=e.length;++n<r;){var l=Qb(s[n],o[n]);if(l){if(n>=a)return l;var c=e[n];return l*(c=="desc"?-1:1)}}return i.index-t.index}function zb(i,t,e){t.length?t=Oi(t,function(o){return Pt(o)?function(r){return Ji(r,o.length===1?o[0]:o)}:o}):t=[$e];var n=-1;t=Oi(t,Vi(go));var s=wb(i,function(o,r,a){var l=Oi(t,function(c){return c(o)});return{criteria:l,index:++n,value:o}});return Lb(s,function(o,r){return Vb(o,r,e)})}function Fb(i,t){return Db(i,t,function(e,n){return xl(i,n)})}var Tl=wp(function(i,t){return i==null?{}:Fb(i,t)}),yo=tn(function(i,t){if(i==null)return[];var e=t.length;return e>1&&Li(i,t[0],t[1])?t=[]:e>2&&Li(t[0],t[1],t[2])&&(t=[t[0]]),zb(i,ji(t),[])}),Ub=4294967295,Kb=Ub-1,Jb=Math.floor,jb=Math.min;function Il(i,t,e,n){var s=0,o=i==null?0:i.length;if(o===0)return 0;t=e(t);for(var r=t!==t,a=t===null,l=ce(t),c=t===void 0;s<o;){var h=Jb((s+o)/2),u=e(i[h]),d=u!==void 0,f=u===null,m=u===u,p=ce(u);if(r)var b=m;else c?b=m&&d:a?b=m&&d&&!f:l?b=m&&d&&!f&&!p:f||p?b=!1:b=u<t;b?s=h+1:o=h}return jb(o,Kb)}var Gb=4294967295,Yb=Gb>>>1;function Hb(i,t,e){var n=0,s=i==null?n:i.length;if(typeof t=="number"&&t===t&&s<=Yb){for(;n<s;){var o=n+s>>>1,r=i[o];r!==null&&!ce(r)&&r<t?n=o+1:s=o}return s}return Il(i,t,$e)}function _b(i,t){return Hb(i,t)}function Wb(i,t,e){return Il(i,t,go(e))}var qb=Ja(function(i,t,e){return i+(e?" ":"")+Gi(t)}),Xb="Expected a function";function $b(i,t,e){var n=!0,s=!0;if(typeof i!="function")throw new TypeError(Xb);return mt(e)&&(n="leading"in e?!0:n,s="trailing"in e?!!e.trailing:s),Wi(i,t,{leading:n,maxWait:t,trailing:s})}var Zb=1/0,ty=ln&&1/ho(new ln([,-0]))[1]==Zb?function(i){return new ln(i)}:Pg,ey=200;function Pl(i,t,e){var n=-1,s=na,o=i.length,r=!0,a=[],l=a;if(o>=ey){var c=ty(i);if(c)return ho(c);r=!1,s=co,l=new cn}else l=a;t:for(;++n<o;){var h=i[n],u=h;if(h=h!==0?h:0,r&&u===u){for(var d=l.length;d--;)if(l[d]===u)continue t;a.push(h)}else s(l,u,e)||(l!==a&&l.push(u),a.push(h))}return a}var Ol=tn(function(i){return Pl(ji(i,1,qi,!0))});function Nl(i){return i&&i.length?Pl(i):[]}var ny=0;function iy(i){var t=++ny;return rn(i)+t}function Ce(i){return typeof i=="string"&&i.slice(-1)==="%"}function jt(i,t){if(i==null)return 0;let e;if(typeof i=="string"){if(e=parseFloat(i),Ce(i)&&(e/=100,Number.isFinite(e)))return e*t}else e=i;return Number.isFinite(e)?e>0&&e<1?e*t:e:0}function se(i){if(typeof i=="object"){let e=0,n=0,s=0,o=0;return i.vertical!=null&&Number.isFinite(i.vertical)&&(n=o=i.vertical),i.horizontal!=null&&Number.isFinite(i.horizontal)&&(s=e=i.horizontal),i.left!=null&&Number.isFinite(i.left)&&(e=i.left),i.top!=null&&Number.isFinite(i.top)&&(n=i.top),i.right!=null&&Number.isFinite(i.right)&&(s=i.right),i.bottom!=null&&Number.isFinite(i.bottom)&&(o=i.bottom),{top:n,right:s,bottom:o,left:e}}let t=0;return i!=null&&Number.isFinite(i)&&(t=i),{top:t,right:t,bottom:t,left:t}}let Rl=!1,Dl=!1,Ll=!1,sy=!1,Ql=!1;if(typeof navigator=="object"){const i=navigator.userAgent;i.indexOf("Macintosh")>=0,i.match(/(iPad|iPhone|iPod)/g),i.indexOf("Windows")>=0,Rl=i.indexOf("MSIE")>=0,i.match(/Trident\/7\./),Dl=!!i.match(/Edge\//),i.indexOf("Mozilla/")>=0&&i.indexOf("MSIE")<0&&i.indexOf("Edge/")<0,i.indexOf("Chrome/")>=0&&i.indexOf("Edge/")<0,i.indexOf("Opera/")>=0||i.indexOf("OPR/")>=0,i.indexOf("Firefox/")>=0,Ll=i.indexOf("AppleWebKit/")>=0&&i.indexOf("Chrome/")<0&&i.indexOf("Edge/")<0,typeof document=="object"&&(Ql=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||i.indexOf("Opera/")>=0)}if(typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,typeof document=="object")try{const i=Object.defineProperty({},"passive",{get(){sy=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},i)}catch{}const Vl=Rl,zl=Dl,oy=Ll,ry=!Ql;function ay(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}function Fl(){return ay()==="apply"}const ly={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function cy(i){const t=document.createElement(ly[i]||"div"),e=`on${i}`;let n=e in t;return n||(t.setAttribute(e,"return;"),n=typeof t[e]=="function"),n}const Gn=[];function Be(i,t){const e=Gn.find(n=>n.name===i);if(!(e&&(e.loadTimes+=1,e.loadTimes>1))&&!Fl()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=t;const s=document.querySelector("head");s&&s.insertBefore(n,s.firstChild),Gn.push({name:i,loadTimes:1,styleElement:n})}}function ke(i){const t=Gn.findIndex(e=>e.name===i);if(t>-1){const e=Gn[t];if(e.loadTimes-=1,e.loadTimes>0)return;let n=e.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Gn.splice(t,1)}}function hy(i){const t=i.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return t&&t[2]?t[2].replace(/\s+/," ").split(" "):null}function Ul(i){const t=parseFloat(i);return Number.isNaN(t)?null:t}function uy(i){const t="data:";return i.substr(0,t.length)===t}function dy(i,t){if(!i||uy(i)){setTimeout(()=>t(null,i));return}const e=()=>{t(new Error(`Failed to load image: ${i}`))},n=window.FileReader?o=>{if(o.status===200){const r=new FileReader;r.onload=a=>{const l=a.target.result;t(null,l)},r.onerror=e,r.readAsDataURL(o.response)}else e()}:o=>{const r=a=>{const c=[];for(let h=0;h<a.length;h+=32768)c.push(String.fromCharCode.apply(null,a.subarray(h,h+32768)));return c.join("")};if(o.status===200){let a=i.split(".").pop()||"png";a==="svg"&&(a="svg+xml");const l=`data:image/${a};base64,`,c=new Uint8Array(o.response),h=l+btoa(r(c));t(null,h)}else e()},s=new XMLHttpRequest;s.responseType=window.FileReader?"blob":"arraybuffer",s.open("GET",i,!0),s.addEventListener("error",e),s.addEventListener("load",()=>n(s)),s.send()}function gy(i){let t=i.replace(/\s/g,"");t=decodeURIComponent(t);const e=t.indexOf(","),n=t.slice(0,e),s=n.split(":")[1].split(";")[0],o=t.slice(e+1);let r;n.indexOf("base64")>=0?r=atob(o):r=unescape(encodeURIComponent(o));const a=new Uint8Array(r.length);for(let l=0;l<r.length;l+=1)a[l]=r.charCodeAt(l);return new Blob([a],{type:s})}function fy(i,t){const e=window.navigator.msSaveBlob;if(e)e(i,t);else{const n=window.URL.createObjectURL(i),s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(n)}}function wo(i,t){const e=gy(i);fy(e,t)}function py(i,t={}){let e=null;const n=h=>(e==null&&(e=hy(i)),e!=null?Ul(e[h]):null),s=h=>{const u=i.match(h);return u&&u[2]?Ul(u[2]):null};let o=t.width;if(o==null&&(o=s(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),o==null&&(o=n(2)),o==null)throw new Error("Can not parse width from svg string");let r=t.height;if(r==null&&(r=s(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),r==null&&(r=n(3)),r==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(i).replace(/'/g,"%27").replace(/"/g,"%22")}`}function my(i){return typeof i=="object"&&i.then&&typeof i.then=="function"}function Co(i){return i!=null&&(i instanceof Promise||my(i))}function Ao(...i){const t=[];if(i.forEach(n=>{Array.isArray(n)?t.push(...n):t.push(n)}),t.some(n=>Co(n))){const n=t.map(s=>Co(s)?s:Promise.resolve(s!==!1));return Promise.all(n).then(s=>s.reduce((o,r)=>r!==!1&&o,!0))}return t.every(n=>n!==!1)}function by(...i){const t=Ao(i);return typeof t=="boolean"?Promise.resolve(t):t}function Kl(i,t,e){if(e)switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2]);case 4:return i.call(t,e[0],e[1],e[2],e[3]);case 5:return i.call(t,e[0],e[1],e[2],e[3],e[4]);case 6:return i.call(t,e[0],e[1],e[2],e[3],e[4],e[5]);default:return i.apply(t,e)}return i.call(t)}function F(i,t,...e){return Kl(i,t,e)}function Jl(i){return 180*i/Math.PI%360}const Rt=function(i,t=!1){return(t?i:i%360)*Math.PI/180};function Qt(i){return i%360+(i<0?360:0)}function je(i,t=0){return Number.isInteger(i)?i:+i.toFixed(t)}function jl(i,t){let e,n;if(t==null?(n=i??1,e=0):(n=t,e=i??0),n<e){const s=e;e=n,n=s}return Math.floor(Math.random()*(n-e+1)+e)}function hn(i,t,e){return Number.isNaN(i)?NaN:Number.isNaN(t)||Number.isNaN(e)?0:i<t?t:i>e?e:i}function oe(i,t){return t*Math.round(i/t)}function Gl(i,t){return t!=null&&i!=null&&t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height}function Yl(i,t){const e=i.x-t.x,n=i.y-t.y;return e*e+n*n}class Te{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class A extends Te{static create(t,e){return t==null||typeof t=="number"?new A(t,e):A.clone(t)}static clone(t){return A.isPoint(t)?new A(t.x,t.y):Array.isArray(t)?new A(t[0],t[1]):new A(t.x,t.y)}static equals(t,e){return t===e?!0:t!=null&&e!=null?t.x===e.x&&t.y===e.y:!1}static rotateEx(t,e,n,s=new A){const o=A.clone(t),r=A.clone(s),a=o.x-r.x,l=o.y-r.y,c=a*e-l*n,h=l*e+a*n;return new A(c+r.x,h+r.y)}static toJSON(t){return A.isPoint(t)?{x:t.x,y:t.y}:Array.isArray(t)?{x:t[0],y:t[1]}:{x:t.x,y:t.y}}static fromPolar(t,e,n=new A){let s=Math.abs(t*Math.cos(e)),o=Math.abs(t*Math.sin(e));const r=A.clone(n),a=Qt(Jl(e));return a<90?o=-o:a<180?(s=-s,o=-o):a<270&&(s=-s),new A(r.x+s,r.y+o)}static toPolar(t,e=new A){const n=A.clone(t),s=A.clone(e),o=n.x-s.x,r=n.y-s.y;return new A(Math.sqrt(o*o+r*r),Rt(s.theta(n)))}static equalPoints(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!==e.length)return!1;if(t!=null&&e!=null){for(let n=0,s=t.length;n<s;n+=1)if(!A.equals(t[n],e[n]))return!1}return!0}static random(t,e,n,s){return new A(jl(t,e),jl(n,s))}static rotate(t,e,n){const s=Rt(Qt(-e)),o=Math.sin(s),r=Math.cos(s);return A.rotateEx(t,r,o,n)}static isPoint(t){return t!=null&&t instanceof A}static isPointLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"}static isPointData(t){return t!=null&&Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}constructor(t,e){super(),this.x=t??0,this.y=e??0}round(t=0){return this.x=je(this.x,t),this.y=je(this.y,t),this}add(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=A.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=A.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new A){const s=A.create(n);return this.x=s.x+t*(this.x-s.x),this.y=s.y+e*(this.y-s.y),this}closest(t){if(t.length===1)return A.create(t[0]);let e=null,n=1/0;return t.forEach(s=>{const o=this.squaredDistance(s);o<n&&(e=s,n=o)}),e?A.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=A.create(t),n=this.x-e.x,s=this.y-e.y;return n*n+s*s}manhattanDistance(t){const e=A.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new A){const e=A.create(t),n=-(e.y-this.y),s=e.x-this.x;let o=Math.atan2(n,s);return o<0&&(o=2*Math.PI+o),180*o/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){return new A(0,0).angleBetween(this,t)}toPolar(t){return this.update(A.toPolar(this,t)),this}changeInAngle(t,e,n=new A){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return Gl(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=A.create(t),n=Rt(this.y),s=Rt(e.y),o=this.x,r=e.x,a=Rt(r-o),l=Math.sin(a)*Math.cos(s),c=Math.cos(n)*Math.sin(s)-Math.sin(n)*Math.cos(s)*Math.cos(a),h=Jl(Math.atan2(l,c)),u=["NE","E","SE","S","SW","W","NW","N"];let d=h-22.5;return d<0&&(d+=360),d=parseInt(d/45,10),u[d]}cross(t,e){if(t!=null&&e!=null){const n=A.create(t),s=A.create(e);return(s.x-this.x)*(n.y-this.y)-(s.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=A.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if(typeof t=="number")return new A(this.x-t,this.y-e);const n=A.create(t);return new A(this.x-n.x,this.y-n.y)}lerp(t,e){const n=A.create(t);return new A((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=A.create(t),s=Rt(n.theta(this));return this.translate(Math.cos(s)*e,-Math.sin(s)*e)}reflection(t){return A.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=oe(this.x,t),this.y=oe(this.y,e??t),this}equals(t){const e=A.create(t);return e!=null&&e.x===this.x&&e.y===this.y}clone(){return A.clone(this)}toJSON(){return A.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}class I extends Te{static isRectangle(t){return t!=null&&t instanceof I}static isRectangleLike(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}static create(t,e,n,s){return t==null||typeof t=="number"?new I(t,e,n,s):I.clone(t)}static clone(t){return I.isRectangle(t)?t.clone():Array.isArray(t)?new I(t[0],t[1],t[2],t[3]):new I(t.x,t.y,t.width,t.height)}static fromEllipse(t){return new I(t.x-t.a,t.y-t.b,2*t.a,2*t.b)}static fromSize(t){return new I(0,0,t.width,t.height)}static fromPositionAndSize(t,e){return new I(t.x,t.y,e.width,e.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new A(this.x,this.y)}get topLeft(){return new A(this.x,this.y)}get topCenter(){return new A(this.x+this.width/2,this.y)}get topRight(){return new A(this.x+this.width,this.y)}get center(){return new A(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new A(this.x,this.y+this.height)}get bottomCenter(){return new A(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new A(this.x+this.width,this.y+this.height)}get corner(){return new A(this.x+this.width,this.y+this.height)}get rightMiddle(){return new A(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new A(this.x,this.y+this.height/2)}get topLine(){return new z(this.topLeft,this.topRight)}get rightLine(){return new z(this.topRight,this.bottomRight)}get bottomLine(){return new z(this.bottomLeft,this.bottomRight)}get leftLine(){return new z(this.topLeft,this.bottomLeft)}constructor(t,e,n,s){super(),this.x=t??0,this.y=e??0,this.width=n??0,this.height=s??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=Rt(t),n=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e)),o=this.width*s+this.height*n,r=this.width*n+this.height*s;return new I(this.x+(this.width-o)/2,this.y+(this.height-r)/2,o,r)}round(t=0){return this.x=je(this.x,t),this.y=je(this.y,t),this.width=je(this.width,t),this.height=je(this.height,t),this}add(t,e,n,s){const o=I.create(t,e,n,s),r=Math.min(this.x,o.x),a=Math.min(this.y,o.y),l=Math.max(this.x+this.width,o.x+o.width),c=Math.max(this.y+this.height,o.y+o.height);return this.x=r,this.y=a,this.width=l-r,this.height=c-a,this}update(t,e,n,s){const o=I.create(t,e,n,s);return this.x=o.x,this.y=o.y,this.width=o.width,this.height=o.height,this}inflate(t,e){const n=t,s=e??t;return this.x-=n,this.y-=s,this.width+=2*n,this.height+=2*s,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),s=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=s.x-n.x,this.height=s.y-n.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new A){const s=this.origin.scale(t,e,n);return this.x=s.x,this.y=s.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(t!==0){const n=Rt(t),s=Math.cos(n),o=Math.sin(n);let r=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();r=A.rotateEx(r,s,o,e),a=A.rotateEx(a,s,o,e),l=A.rotateEx(l,s,o,e),c=A.rotateEx(c,s,o,e);const h=new I(r.x,r.y,0,0);h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),h.add(c.x,c.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=I.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=I.clone(t),s=e.x,o=e.y;let r=1/0,a=1/0,l=1/0,c=1/0,h=1/0,u=1/0,d=1/0,f=1/0;const m=n.topLeft;m.x<s&&(r=(this.x-s)/(m.x-s)),m.y<o&&(h=(this.y-o)/(m.y-o));const p=n.bottomRight;p.x>s&&(a=(this.x+this.width-s)/(p.x-s)),p.y>o&&(u=(this.y+this.height-o)/(p.y-o));const b=n.topRight;b.x>s&&(l=(this.x+this.width-s)/(b.x-s)),b.y<o&&(d=(this.y-o)/(b.y-o));const y=n.bottomLeft;return y.x<s&&(c=(this.x-s)/(y.x-s)),y.y>o&&(f=(this.y+this.height-o)/(y.y-o)),{sx:Math.min(r,a,l,c),sy:Math.min(h,u,d,f)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return Gl(this,A.create(t,e))}containsRect(t,e,n,s){const o=I.create(t,e,n,s),r=this.x,a=this.y,l=this.width,c=this.height,h=o.x,u=o.y,d=o.width,f=o.height;return l===0||c===0||d===0||f===0?!1:h>=r&&u>=a&&h+d<=r+l&&u+f<=a+c}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],s=[];return e.forEach(o=>{const r=t.intersectsWithLine(o);r!==null&&s.indexOf(r.toString())<0&&(n.push(r),s.push(r.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=A.clone(t),s=this.center;let o=null;e!=null&&e!==0&&n.rotate(e,s);const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new z(s,n);for(let l=r.length-1;l>=0;l-=1){const c=r[l].intersectsWithLine(a);if(c!==null){o=c;break}}return o&&e!=null&&e!==0&&o.rotate(-e,s),o}intersectsWithRect(t,e,n,s){const o=I.create(t,e,n,s);if(!this.isIntersectWithRect(o))return null;const r=this.origin,a=this.corner,l=o.origin,c=o.corner,h=Math.max(r.x,l.x),u=Math.max(r.y,l.y);return new I(h,u,Math.min(a.x,c.x)-h,Math.min(a.y,c.y)-u)}isIntersectWithRect(t,e,n,s){const o=I.create(t,e,n,s),r=this.origin,a=this.corner,l=o.origin,c=o.corner;return!(c.x<=r.x||c.y<=r.y||l.x>=a.x||l.y>=a.y)}normalize(){let t=this.x,e=this.y,n=this.width,s=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,s=-this.height),this.x=t,this.y=e,this.width=n,this.height=s,this}union(t){const e=I.clone(t),n=this.origin,s=this.corner,o=e.origin,r=e.corner,a=Math.min(n.x,o.x),l=Math.min(n.y,o.y),c=Math.max(s.x,r.x),h=Math.max(s.y,r.y);return new I(a,l,c-a,h-l)}getNearestSideToPoint(t){const e=A.clone(t),n=e.x-this.x,s=this.x+this.width-e.x,o=e.y-this.y,r=this.y+this.height-e.y;let a=n,l="left";return s<a&&(a=s,l="right"),o<a&&(a=o,l="top"),r<a&&(l="bottom"),l}getNearestPointToPoint(t){const e=A.clone(t);if(this.containsPoint(e)){const n=this.getNearestSideToPoint(e);if(n==="left")return new A(this.x,e.y);if(n==="top")return new A(e.x,this.y);if(n==="right")return new A(this.x+this.width,e.y);if(n==="bottom")return new A(e.x,this.y+this.height)}return e.adhereToRect(this)}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new I(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class z extends Te{static isLine(t){return t!=null&&t instanceof z}get center(){return new A((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(t,e,n,s){super(),typeof t=="number"&&typeof e=="number"?(this.start=new A(t,e),this.end=new A(n,s)):(this.start=A.create(t),this.end=A.create(e))}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:s}=e,o=n.clone().rotate(270,s),r=s.clone().rotate(90,n);return n.move(r,t),s.move(o,t),e}vector(){return new A(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new A(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),s=Math.max(this.start.y,this.end.y);return new I(t,e,n-t,s-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new z(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let s=!0;t<0&&(s=!1,t=-t);const o=this.length();if(t>=o)return s?n.clone():e.clone();const r=(s?t:o-t)/o;return this.pointAt(r)}divideAt(t){const e=this.pointAt(t);return[new z(this.start,e),new z(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new z(this.start,e),new z(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(e.cross(t,n)!==0)return!1;const s=this.length();return!(new z(e,t).length()>s||new z(t,n).length()>s)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new A(this.end.x-this.start.x,this.end.y-this.start.y),n=new A(t.end.x-t.start.x,t.end.y-t.start.y),s=e.x*n.y-e.y*n.x,o=new A(t.start.x-this.start.x,t.start.y-this.start.y),r=o.x*n.y-o.y*n.x,a=o.x*e.y-o.y*e.x;if(s===0||r*s<0||a*s<0)return null;if(s>0){if(r>s||a>s)return null}else if(r<s||a<s)return null;return new A(this.start.x+r*e.x/s,this.start.y+r*e.y/s)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=A.clone(t),n=this.start,s=this.end;return((s.x-n.x)*(e.y-n.y)-(s.y-n.y)*(e.x-n.x))/this.length()}pointSquaredDistance(t,e){const n=A.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=A.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,s=this.pointAt(t),o=new z(e,n);return o.translate(s.x-e.x,s.y-e.y),o}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,s=this.pointAtLength(t),o=new z(e,n);return o.translate(s.x-e.x,s.y-e.y),o}relativeCcw(t,e){const n=A.create(t,e);let s=n.x-this.start.x,o=n.y-this.start.y;const r=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=s*a-o*r;return l===0&&(l=s*r+o*a,l>0&&(s-=r,o-=a,l=s*r+o*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(t){return t!=null&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new z(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class Kt extends Te{static isEllipse(t){return t!=null&&t instanceof Kt}static create(t,e,n,s){return t==null||typeof t=="number"?new Kt(t,e,n,s):Kt.parse(t)}static parse(t){return Kt.isEllipse(t)?t.clone():Array.isArray(t)?new Kt(t[0],t[1],t[2],t[3]):new Kt(t.x,t.y,t.a,t.b)}static fromRect(t){const e=t.center;return new Kt(e.x,e.y,t.width/2,t.height/2)}get center(){return new A(this.x,this.y)}constructor(t,e,n,s){super(),this.x=t??0,this.y=e??0,this.a=n??0,this.b=s??0}bbox(){return I.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,s=e??t;return this.a+=2*n,this.b+=2*s,this}normalizedDistance(t,e){const n=A.create(t,e),s=n.x-this.x,o=n.y-this.y,r=this.a,a=this.b;return s*s/(r*r)+o*o/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,s=this.b,o=t.start,r=t.end,a=t.vector(),l=o.diff(new A(this.x,this.y)),c=new A(a.x/(n*n),a.y/(s*s)),h=new A(l.x/(n*n),l.y/(s*s)),u=a.dot(c),d=a.dot(h),f=l.dot(h)-1,m=d*d-u*f;if(m<0)return null;if(m>0){const p=Math.sqrt(m),b=(-d-p)/u,y=(-d+p)/u;if((b<0||b>1)&&(y<0||y>1))return null;b>=0&&b<=1&&e.push(o.lerp(r,b)),y>=0&&y<=1&&e.push(o.lerp(r,y))}else{const p=-d/u;if(p>=0&&p<=1)e.push(o.lerp(r,p));else return null}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=A.clone(t);e&&n.rotate(e,this.getCenter());const s=n.x-this.x,o=n.y-this.y;let r;if(s===0)return r=this.bbox().getNearestPointToPoint(n),e?r.rotate(-e,this.getCenter()):r;const a=o/s,l=a*a,c=this.a*this.a,h=this.b*this.b;let u=Math.sqrt(1/(1/c+l/h));u=s<0?-u:u;const d=a*u;return r=new A(this.x+u,this.y+d),e?r.rotate(-e,this.getCenter()):r}tangentTheta(t){const e=A.clone(t),n=e.x,s=e.y,o=this.a,r=this.b,a=this.bbox().center,l=a.x,c=a.y,h=30,u=n>a.x+o/2,d=n<a.x-o/2;let f,m;return u||d?(m=n>a.x?s-h:s+h,f=o*o/(n-l)-o*o*(s-c)*(m-c)/(r*r*(n-l))+l):(f=s>a.y?n+h:n-h,m=r*r/(s-c)-r*r*(n-l)*(f-l)/(o*o*(s-c))+c),new A(f,m).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=I.fromEllipse(this);n.rotate(t,e);const s=Kt.fromRect(n);return this.a=s.a,this.b=s.b,this.x=s.x,this.y=s.y,this}translate(t,e){const n=A.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new Kt(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const yy=new RegExp("^[\\s\\dLMCZz,.]*$");function wy(i){return typeof i!="string"?!1:yy.test(i)}function xo(i,t){return(i%t+t)%t}function Cy(i,t,e,n,s){if(!i||i.length===0)return"";const o=[],r=i[i.length-1],a=t!=null&&t>0,l=t||0;if(n&&a){i=i.slice();const u=i[0],d=new A(r.x+(u.x-r.x)/2,r.y+(u.y-r.y)/2);i.splice(0,0,d)}let c=i[0],h=1;for(e?o.push("M",c.x,c.y):o.push("L",c.x,c.y);h<(n?i.length:i.length-1);){let u=i[xo(h,i.length)],d=c.x-u.x,f=c.y-u.y;if(a&&(d!==0||f!==0)&&(s==null||s.indexOf(h-1)<0)){let m=Math.sqrt(d*d+f*f);const p=d*Math.min(l,m/2)/m,b=f*Math.min(l,m/2)/m,y=u.x+p,C=u.y+b;o.push("L",y,C);let w=i[xo(h+1,i.length)];for(;h<i.length-2&&Math.round(w.x-u.x)===0&&Math.round(w.y-u.y)===0;)w=i[xo(h+2,i.length)],h+=1;d=w.x-u.x,f=w.y-u.y,m=Math.max(1,Math.sqrt(d*d+f*f));const x=d*Math.min(l,m/2)/m,E=f*Math.min(l,m/2)/m,S=u.x+x,v=u.y+E;o.push("Q",u.x,u.y,S,v),u=new A(S,v)}else o.push("L",u.x,u.y);c=u,h+=1}return n?o.push("Z"):o.push("L",r.x,r.y),o.map(u=>typeof u=="string"?u:+u.toFixed(3)).join(" ")}function Ay(i,t={}){const e=[];return i&&i.length&&i.forEach(n=>{Array.isArray(n)?e.push({x:n[0],y:n[1]}):e.push({x:n.x,y:n.y})}),Cy(e,t.round,t.initialMove==null||t.initialMove,t.close,t.exclude)}function Hl(i,t,e,n,s=0,o=0,r=0,a,l){if(e===0||n===0)return[];a-=i,l-=t,e=Math.abs(e),n=Math.abs(n);const c=-a/2,h=-l/2,u=Math.cos(s*Math.PI/180),d=Math.sin(s*Math.PI/180),f=u*c+d*h,m=-1*d*c+u*h,p=f*f,b=m*m,y=e*e,C=n*n,w=p/y+b/C;let x;if(w>1)e=Math.sqrt(w)*e,n=Math.sqrt(w)*n,x=0;else{let U=1;o===r&&(U=-1),x=U*Math.sqrt((y*C-y*b-C*p)/(y*b+C*p))}const E=x*e*m/n,S=-1*x*n*f/e,v=u*E-d*S+a/2,M=d*E+u*S+l/2;let k=Math.atan2((m-S)/n,(f-E)/e)-Math.atan2(0,1),T=k>=0?k:2*Math.PI+k;k=Math.atan2((-m-S)/n,(-f-E)/e)-Math.atan2((m-S)/n,(f-E)/e);let P=k>=0?k:2*Math.PI+k;r===0&&P>0?P-=2*Math.PI:r!==0&&P<0&&(P+=2*Math.PI);const R=P*2/Math.PI,J=Math.ceil(R<0?-1*R:R),D=P/J,N=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),G=u*e,ot=u*n,yt=d*e,gt=d*n;let lt=Math.cos(T),V=Math.sin(T),Z=-N*(G*V+gt*lt),it=-N*(yt*V-ot*lt),H=0,O=0;const Q=[];for(let U=0;U<J;U+=1){T+=D,lt=Math.cos(T),V=Math.sin(T),H=G*lt-gt*V+v,O=yt*lt+ot*V+M;const tt=-N*(G*V+gt*lt),Tt=-N*(yt*V-ot*lt),ft=U*6;Q[ft]=Number(Z+i),Q[ft+1]=Number(it+t),Q[ft+2]=Number(H-tt+i),Q[ft+3]=Number(O-Tt+t),Q[ft+4]=Number(H+i),Q[ft+5]=Number(O+t),Z=H+tt,it=O+Tt}return Q.map(U=>+U.toFixed(2))}class xt extends Te{static isPolyline(t){return t!=null&&t instanceof xt}static parse(t){const e=t.trim();if(e==="")return new xt;const n=[],s=e.split(/\s*,\s*|\s+/);for(let o=0,r=s.length;o<r;o+=2)n.push({x:+s[o],y:+s[o+1]});return new xt(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(t){if(super(),t!=null){if(typeof t=="string")return xt.parse(t);this.points=t.map(e=>A.create(e))}else this.points=[]}scale(t,e,n=new A){return this.points.forEach(s=>s.scale(t,e,n)),this}rotate(t,e){return this.points.forEach(n=>n.rotate(t,e)),this}translate(t,e){const n=A.create(t,e);return this.points.forEach(s=>s.translate(n.x,n.y)),this}round(t=0){return this.points.forEach(e=>e.round(t)),this}bbox(){if(this.points.length===0)return new I;let t=1/0,e=-1/0,n=1/0,s=-1/0;const o=this.points;for(let r=0,a=o.length;r<a;r+=1){const l=o[r],c=l.x,h=l.y;c<t&&(t=c),c>e&&(e=c),h<n&&(n=h),h>s&&(s=h)}return new I(t,n,e-t,s-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(n===0||n===1)return 0;let s=0,o=0,r=1/0;for(let a=0,l=n-1;a<l;a+=1){const c=new z(e[a],e[a+1]),h=c.length(),u=c.closestPointNormalizedLength(t),f=c.pointAt(u).squaredDistance(t);f<r&&(r=f,o=s+u*h),s+=h}return o}closestPointNormalizedLength(t){const e=this.length();return e===0?0:this.closestPointLength(t)/e}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(this.points.length===0)return!1;const e=A.clone(t),n=e.x,s=e.y,o=this.points,r=o.length;let a=r-1,l=0;for(let c=0;c<r;c+=1){const h=o[a],u=o[c];if(e.equals(h))return!0;const d=new z(h,u);if(d.containsPoint(t))return!0;if(s<=h.y&&s>u.y||s>h.y&&s<=u.y){const f=h.x-n>u.x-n?h.x-n:u.x-n;if(f>=0){const m=new A(n+f,s),p=new z(t,m);d.intersectsWithLine(p)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(t){const e=[];for(let n=0,s=this.points.length-1;n<s;n+=1){const o=this.points[n],r=this.points[n+1],a=t.intersectsWithLine(new z(o,r));a&&e.push(a)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const n=this.points[t],s=this.points[t+1];if(new z(n,s).isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const s=this.points[e],o=this.points[e+1];t+=s.distance(o)}return t}pointAt(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1||t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const o=this.length()*t;return this.pointAtLength(o)}pointAtLength(t){const e=this.points,n=e.length;if(n===0)return null;if(n===1)return e[0].clone();let s=!0;t<0&&(s=!1,t=-t);let o=0;for(let a=0,l=n-1;a<l;a+=1){const c=s?a:l-1-a,h=e[c],u=e[c+1],d=new z(h,u),f=h.distance(u);if(t<=o+f)return d.pointAtLength((s?1:-1)*(t-o));o+=f}return(s?e[n-1]:e[0]).clone()}tangentAt(t){const n=this.points.length;if(n===0||n===1)return null;t<0&&(t=0),t>1&&(t=1);const o=this.length()*t;return this.tangentAtLength(o)}tangentAtLength(t){const e=this.points,n=e.length;if(n===0||n===1)return null;let s=!0;t<0&&(s=!1,t=-t);let o,r=0;for(let a=0,l=n-1;a<l;a+=1){const c=s?a:l-1-a,h=e[c],u=e[c+1],d=new z(h,u),f=h.distance(u);if(d.isDifferentiable()){if(t<=r+f)return d.tangentAtLength((s?1:-1)*(t-r));o=d}r+=f}if(o){const a=s?1:0;return o.tangentAt(a)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let s=0;for(;e[s+2];){const o=s,r=s+1,a=s+2,l=e[o],c=e[r],h=e[a];new z(l,h).closestPoint(c).distance(c)<=n?e.splice(r,1):s+=1}return this}toHull(){const t=this.points,e=t.length;if(e===0)return new xt;let n=t[0];for(let d=1;d<e;d+=1)(t[d].y<n.y||t[d].y===n.y&&t[d].x>n.x)&&(n=t[d]);const s=[];for(let d=0;d<e;d+=1){let f=n.theta(t[d]);f===0&&(f=360),s.push([t[d],d,f])}if(s.sort((d,f)=>{let m=d[2]-f[2];return m===0&&(m=f[1]-d[1]),m}),s.length>2){const d=s[s.length-1];s.unshift(d)}const o={},r=[],a=d=>`${d[0].toString()}@${d[1]}`;for(;s.length!==0;){const d=s.pop(),f=d[0];if(o[a(d)])continue;let m=!1;for(;!m;)if(r.length<2)r.push(d),m=!0;else{const p=r.pop(),b=p[0],y=r.pop(),C=y[0],w=C.cross(b,f);if(w<0)r.push(y),r.push(p),r.push(d),m=!0;else if(w===0){const E=b.angleBetween(C,f);Math.abs(E-180)<1e-10||b.equals(f)||C.equals(b)?(o[a(p)]=b,r.push(y)):Math.abs((E+1)%360-1)<1e-10&&(r.push(y),s.push(p))}else o[a(p)]=b,r.push(y)}}r.length>2&&r.pop();let l,c=-1;for(let d=0,f=r.length;d<f;d+=1){const m=r[d][1];(l===void 0||m<l)&&(l=m,c=d)}let h=[];if(c>0){const d=r.slice(c),f=r.slice(0,c);h=d.concat(f)}else h=r;const u=[];for(let d=0,f=h.length;d<f;d+=1)u.push(h[d][0]);return new xt(u)}equals(t){return t==null||t.points.length!==this.points.length?!1:t.points.every((e,n)=>e.equals(this.points[n]))}clone(){return new xt(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.serialize()}`).join(" ")}}class wt extends Te{static isCurve(t){return t!=null&&t instanceof wt}static throughPoints(t){if(t==null||Array.isArray(t)&&t.length<2)throw new Error("At least 2 points are required");const e=xy(t),n=[];for(let s=0,o=e[0].length;s<o;s+=1){const r=new A(e[0][s].x,e[0][s].y),a=new A(e[1][s].x,e[1][s].y);n.push(new wt(t[s],r,a,t[s+1]))}return n}constructor(t,e,n,s){super(),this.PRECISION=3,this.start=A.create(t),this.controlPoint1=A.create(e),this.controlPoint2=A.create(n),this.end=A.create(s)}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end,o=t.x,r=t.y,a=e.x,l=e.y,c=n.x,h=n.y,u=s.x,d=s.y,f=[],m=[[],[]];let p,b,y,C,w,x,E,S;for(let G=0;G<2;G+=1){if(G===0?(b=6*o-12*a+6*c,p=-3*o+9*a-9*c+3*u,y=3*a-3*o):(b=6*r-12*l+6*h,p=-3*r+9*l-9*h+3*d,y=3*l-3*r),Math.abs(p)<1e-12){if(Math.abs(b)<1e-12)continue;C=-y/b,C>0&&C<1&&f.push(C);continue}E=b*b-4*y*p,S=Math.sqrt(E),!(E<0)&&(w=(-b+S)/(2*p),w>0&&w<1&&f.push(w),x=(-b-S)/(2*p),x>0&&x<1&&f.push(x))}let v,M,k,T=f.length;const P=T;for(;T;)T-=1,C=f[T],k=1-C,v=k*k*k*o+3*k*k*C*a+3*k*C*C*c+C*C*C*u,m[0][T]=v,M=k*k*k*r+3*k*k*C*l+3*k*C*C*h+C*C*C*d,m[1][T]=M;f[P]=0,f[P+1]=1,m[0][P]=o,m[1][P]=r,m[0][P+1]=u,m[1][P+1]=d,f.length=P+2,m[0].length=P+2,m[1].length=P+2;const R=Math.min.apply(null,m[0]),J=Math.min.apply(null,m[1]),D=Math.max.apply(null,m[0]),N=Math.max.apply(null,m[1]);return new I(R,J,D-R,N-J)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),s=this.closestPointLength(t,n);if(!s)return 0;const o=this.length(n);return o===0?0:s/o}closestPointT(t,e={}){const n=this.getPrecision(e),s=this.getDivisions(e),o=Math.pow(10,-n);let r=null,a=0,l=0,c=0,h=0,u=0,d=null;const f=s.length;let m=f>0?1/f:0;for(s.forEach((p,b)=>{const y=p.start.distance(t),C=p.end.distance(t),w=y+C;(d==null||w<d)&&(r=p,a=b*m,l=(b+1)*m,c=y,h=C,d=w,u=p.endpointDistance())});;){const p=c?Math.abs(c-h)/c:0,b=h!=null?Math.abs(c-h)/h:0,y=p<o||b<o,C=c?c<u*o:!0,w=h?h<u*o:!0;if(y||(C||w))return c<=h?a:l;const E=r.divide(.5);m/=2;const S=E[0].start.distance(t),v=E[0].end.distance(t),M=S+v,k=E[1].start.distance(t),T=E[1].end.distance(t),P=k+T;M<=P?(r=E[0],l-=m,c=S,h=v):(r=E[1],a+=m,c=k,h=T)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,s=this.controlPoint2,o=this.end;if(t<=0)return[new wt(e,e,e,e),new wt(e,n,s,o)];if(t>=1)return[new wt(e,n,s,o),new wt(o,o,o,o)];const r=this.getSkeletonPoints(t),a=r.startControlPoint1,l=r.startControlPoint2,c=r.divider,h=r.dividerControlPoint1,u=r.dividerControlPoint2;return[new wt(e,a,l,c),new wt(c,h,u,o)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,s=this.controlPoint2,o=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:s.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:s.clone(),divider:o.clone(),dividerControlPoint1:o.clone(),dividerControlPoint2:o.clone()};const r=new z(e,n).pointAt(t),a=new z(n,s).pointAt(t),l=new z(s,o).pointAt(t),c=new z(r,a).pointAt(t),h=new z(a,l).pointAt(t),u=new z(c,h).pointAt(t);return{startControlPoint1:r,startControlPoint2:c,divider:u,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(e===0)return n;let s=this.endpointDistance();const o=Math.pow(10,-e);let r=0;for(;;){r+=1;const a=[];n.forEach(h=>{const u=h.divide(.5);a.push(u[0],u[1])});const l=a.reduce((h,u)=>h+u.endpointDistance(),0),c=l!==0?(l-s)/l:0;if(r>1&&c<o)return a;n=a,s=l}}length(t={}){return this.getDivisions(t).reduce((n,s)=>n+s.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=e.precision===void 0?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(s))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,s=e.dividerControlPoint1,o=e.divider,r=new z(n,s);return r.translate(o.x-n.x,o.y-n.y),r}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getDivisions(t={}){if(t.subdivisions!=null)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),o=this.length(n)*t;return this.tAtLength(o,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getDivisions(e),r={precision:s,subdivisions:o};let a=null,l,c,h=0,u=0,d=0;const f=o.length;let m=f>0?1/f:0;for(let y=0;y<f;y+=1){const C=n?y:f-1-y,w=o[y],x=w.endpointDistance();if(t<=d+x){a=w,l=C*m,c=(C+1)*m,h=n?t-d:x+d-t,u=n?x+d-t:t-d;break}d+=x}if(a==null)return n?1:0;const p=this.length(r),b=Math.pow(10,-s);for(;;){let y;if(y=p!==0?h/p:0,y<b)return l;if(y=p!==0?u/p:0,y<b)return c;let C,w;const x=a.divide(.5);m/=2;const E=x[0].endpointDistance(),S=x[1].endpointDistance();h<=E?(a=x[0],c-=m,C=h,w=E-C):(a=x[1],l+=m,C=h-E,w=S-C),h=C,u=w}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach(s=>n.push(s.end.clone())),n}toPolyline(t={}){return new xt(this.toPoints(t))}scale(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return t!=null&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}function _l(i){const t=i.length,e=[],n=[];let s=2;e[0]=i[0]/s;for(let o=1;o<t;o+=1)n[o]=1/s,s=(o<t-1?4:3.5)-n[o],e[o]=(i[o]-e[o-1])/s;for(let o=1;o<t;o+=1)e[t-o-1]-=n[t-o]*e[t-o];return e}function xy(i){const t=i.map(l=>A.clone(l)),e=[],n=[],s=t.length-1;if(s===1)return e[0]=new A((2*t[0].x+t[1].x)/3,(2*t[0].y+t[1].y)/3),n[0]=new A(2*e[0].x-t[0].x,2*e[0].y-t[0].y),[e,n];const o=[];for(let l=1;l<s-1;l+=1)o[l]=4*t[l].x+2*t[l+1].x;o[0]=t[0].x+2*t[1].x,o[s-1]=(8*t[s-1].x+t[s].x)/2;const r=_l(o);for(let l=1;l<s-1;l+=1)o[l]=4*t[l].y+2*t[l+1].y;o[0]=t[0].y+2*t[1].y,o[s-1]=(8*t[s-1].y+t[s].y)/2;const a=_l(o);for(let l=0;l<s;l+=1)e.push(new A(r[l],a[l])),l<s-1?n.push(new A(2*t[l+1].x-r[l+1],2*t[l+1].y-a[l+1])):n.push(new A((t[s].x+r[s-1])/2,(t[s].y+a[s-1])/2));return[e,n]}class Zi extends Te{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class Ct extends Zi{static create(...t){const e=t.length,n=t[0];if(z.isLine(n))return new Ct(n);if(A.isPointLike(n))return e===1?new Ct(n):t.map(o=>new Ct(o));if(e===2)return new Ct(+t[0],+t[1]);const s=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];s.push(new Ct(r,a))}return s}constructor(t,e){super(),z.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=A.create(t,e).round(2)}get type(){return"L"}get line(){return new z(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new Ct(e[0]),new Ct(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new Ct(e[0]),new Ct(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new Ct(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class Yn extends Zi{static create(){return new Yn}get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new z(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new Ct(e[0]):this.clone(),new Ct(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new Ct(e[0]):this.clone(),new Ct(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new Yn}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class he extends Zi{static create(...t){const e=t.length,n=t[0];if(z.isLine(n))return new he(n);if(wt.isCurve(n))return new he(n);if(A.isPointLike(n)){if(e===1)return new he(n);const o=[];for(let r=0;r<e;r+=1)r===0?o.push(new he(t[r])):o.push(new Ct(t[r]));return o}if(e===2)return new he(+t[0],+t[1]);const s=[];for(let o=0;o<e;o+=2){const r=+t[o],a=+t[o+1];o===0?s.push(new he(r,a)):s.push(new Ct(r,a))}return s}constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,z.isLine(t)||wt.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=A.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}clone(){return new he(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}class Vt extends Zi{static create(...t){const e=t.length,n=t[0];if(wt.isCurve(n))return new Vt(n);if(A.isPointLike(n)){if(e===3)return new Vt(t[0],t[1],t[2]);const o=[];for(let r=0;r<e;r+=3)o.push(new Vt(t[r],t[r+1],t[r+2]));return o}if(e===6)return new Vt(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<e;o+=6)s.push(new Vt(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}constructor(t,e,n,s,o,r){super(),wt.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):typeof t=="number"?(this.controlPoint1=new A(t,e).round(2),this.controlPoint2=new A(n,s).round(2),this.endPoint=new A(o,r).round(2)):(this.controlPoint1=A.create(t).round(2),this.controlPoint2=A.create(e).round(2),this.endPoint=A.create(n).round(2))}get type(){return"C"}get curve(){return new wt(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new Vt(n[0]),new Vt(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new Vt(n[0]),new Vt(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new Vt(e[0]),new Vt(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,s=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(s))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new Vt(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")}}function ts(i,t,e){return{x:i*Math.cos(e)-t*Math.sin(e),y:i*Math.sin(e)+t*Math.cos(e)}}function Wl(i,t,e,n,s,o){const r=.3333333333333333,a=2/3;return[r*i+a*e,r*t+a*n,r*s+a*e,r*o+a*n,s,o]}function ql(i,t,e,n,s,o,r,a,l,c){const h=Math.PI*120/180,u=Math.PI/180*(+s||0);let d=[],f,m,p,b,y;if(c)m=c[0],p=c[1],b=c[2],y=c[3];else{f=ts(i,t,-u),i=f.x,t=f.y,f=ts(a,l,-u),a=f.x,l=f.y;const D=(i-a)/2,N=(t-l)/2;let G=D*D/(e*e)+N*N/(n*n);G>1&&(G=Math.sqrt(G),e=G*e,n=G*n);const ot=e*e,yt=n*n,gt=(o===r?-1:1)*Math.sqrt(Math.abs((ot*yt-ot*N*N-yt*D*D)/(ot*N*N+yt*D*D)));b=gt*e*N/n+(i+a)/2,y=gt*-n*D/e+(t+l)/2,m=Math.asin((t-y)/n),p=Math.asin((l-y)/n),m=i<b?Math.PI-m:m,p=a<b?Math.PI-p:p,m<0&&(m=Math.PI*2+m),p<0&&(p=Math.PI*2+p),r&&m>p&&(m-=Math.PI*2),!r&&p>m&&(p-=Math.PI*2)}let C=p-m;if(Math.abs(C)>h){const D=p,N=a,G=l;p=m+h*(r&&p>m?1:-1),a=b+e*Math.cos(p),l=y+n*Math.sin(p),d=ql(a,l,e,n,s,0,r,N,G,[p,D,b,y])}C=p-m;const w=Math.cos(m),x=Math.sin(m),E=Math.cos(p),S=Math.sin(p),v=Math.tan(C/4),M=4/3*(e*v),k=4/3*(n*v),T=[i,t],P=[i+M*x,t-k*w],R=[a+M*S,l-k*E],J=[a,l];if(P[0]=2*T[0]-P[0],P[1]=2*T[1]-P[1],c)return[P,R,J].concat(d);{d=[P,R,J].concat(d).join().split(",");const D=[],N=d.length;for(let G=0;G<N;G+=1)D[G]=G%2?ts(+d[G-1],+d[G],u).y:ts(+d[G],+d[G+1],u).x;return D}}function vy(i){if(!i)return null;const t=`
|
|
2
|
+
\v\f\r \u2028\u2029`,e=new RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),n=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return i.replace(e,(r,a,l)=>{const c=[];let h=a.toLowerCase();l.replace(n,(d,f)=>(f&&c.push(+f),d)),h==="m"&&c.length>2&&(o.push([a,...c.splice(0,2)]),h="l",a=a==="m"?"l":"L");const u=s[h];for(;c.length>=u&&(o.push([a,...c.splice(0,u)]),!!u););return r}),o}function Ey(i){const t=vy(i);if(!t||!t.length)return[["M",0,0]];let e=0,n=0,s=0,o=0;const r=[];for(let a=0,l=t.length;a<l;a+=1){const c=[];r.push(c);const h=t[a],u=h[0];if(u!==u.toUpperCase())switch(c[0]=u.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+e,c[7]=+h[7]+n;break;case"V":c[1]=+h[1]+n;break;case"H":c[1]=+h[1]+e;break;case"M":s=+h[1]+e,o=+h[2]+n;for(let d=1,f=h.length;d<f;d+=1)c[d]=+h[d]+(d%2?e:n);break;default:for(let d=1,f=h.length;d<f;d+=1)c[d]=+h[d]+(d%2?e:n);break}else for(let d=0,f=h.length;d<f;d+=1)c[d]=h[d];switch(c[0]){case"Z":e=+s,n=+o;break;case"H":e=c[1];break;case"V":n=c[1];break;case"M":s=c[c.length-2],o=c[c.length-1],e=c[c.length-2],n=c[c.length-1];break;default:e=c[c.length-2],n=c[c.length-1];break}}return r}function Sy(i){const t=Ey(i),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function n(l,c,h){let u,d;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(ql.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(u=c.x*2-c.bx,d=c.y*2-c.by):(u=c.x,d=c.y),["C",u,d].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(Wl(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(Wl(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function s(l,c){if(l[c].length>7){l[c].shift();const h=l[c];for(;h.length;)o[c]="A",c+=1,l.splice(c,0,["C"].concat(h.splice(0,6)));l.splice(c,1),a=t.length}}const o=[];let r="",a=t.length;for(let l=0;l<a;l+=1){let c="";t[l]&&(c=t[l][0]),c!=="C"&&(o[l]=c,l>0&&(r=o[l-1])),t[l]=n(t[l],e,r),o[l]!=="A"&&c==="C"&&(o[l]="C"),s(t,l);const h=t[l],u=h.length;e.x=h[u-2],e.y=h[u-1],e.bx=parseFloat(h[u-4])||e.x,e.by=parseFloat(h[u-3])||e.y}return(!t[0][0]||t[0][0]!=="M")&&t.unshift(["M",0,0]),t}function Xl(i){return Sy(i).map(t=>t.map(e=>typeof e=="string"?e:je(e,2))).join(",").split(",").join(" ")}class j extends Te{static isPath(t){return t!=null&&t instanceof j}static parse(t){if(!t)return new j;const e=new j,n=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,s=Xl(t).match(n);if(s!=null)for(let o=0,r=s.length;o<r;o+=1){const a=s[o],l=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,c=a.match(l);if(c!=null){const h=c[0],u=c.slice(1).map(f=>+f),d=j.createSegment.call(null,h,...u);e.appendSegment(d)}}return e}static createSegment(t,...e){if(t==="M")return he.create.call(null,...e);if(t==="L")return Ct.create.call(null,...e);if(t==="C")return Vt.create.call(null,...e);if(t==="z"||t==="Z")return Yn.create();throw new Error(`Invalid path segment type "${t}"`)}constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(z.isLine(t[0])||wt.isCurve(t[0])){let e=null;t.forEach((s,o)=>{o===0&&this.appendSegment(j.createSegment("M",s.start)),e!=null&&!e.end.equals(s.start)&&this.appendSegment(j.createSegment("M",s.start)),z.isLine(s)?this.appendSegment(j.createSegment("L",s.end)):wt.isCurve(s)&&this.appendSegment(j.createSegment("C",s.controlPoint1,s.controlPoint2,s.end)),e=s})}else t.forEach(n=>{n.isSegment&&this.appendSegment(n)});else t!=null&&(z.isLine(t)?(this.appendSegment(j.createSegment("M",t.start)),this.appendSegment(j.createSegment("L",t.end))):wt.isCurve(t)?(this.appendSegment(j.createSegment("M",t.start)),this.appendSegment(j.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):xt.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((e,n)=>{const s=n===0?j.createSegment("M",e):j.createSegment("L",e);this.appendSegment(s)}):t.isSegment&&this.appendSegment(t))}get start(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=0;n<e;n+=1){const s=t[n];if(s.isVisible)return s.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(e===0)return null;for(let n=e-1;n>=0;n-=1){const s=t[n];if(s.isVisible)return s.end}return t[e-1].end}moveTo(...t){return this.appendSegment(he.create.call(null,...t))}lineTo(...t){return this.appendSegment(Ct.create.call(null,...t))}curveTo(...t){return this.appendSegment(Vt.create.call(null,...t))}arcTo(t,e,n,s,o,r,a){const l=this.end||new A,c=typeof r=="number"?Hl(l.x,l.y,t,e,n,s,o,r,a):Hl(l.x,l.y,t,e,n,s,o,r.x,r.y);if(c!=null)for(let h=0,u=c.length;h<u;h+=6)this.curveTo(c[h],c[h+1],c[h+2],c[h+3],c[h+4],c[h+5]);return this}quadTo(t,e,n,s){const o=this.end||new A,r=["M",o.x,o.y];if(typeof t=="number")r.push("Q",t,e,n,s);else{const l=e;r.push("Q",t.x,t.y,l.x,l.y)}const a=j.parse(r.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Yn.create())}drawPoints(t,e={}){const n=Ay(t,e),s=j.parse(n);s&&s.segments&&this.appendSegment(s.segments)}bbox(){const t=this.segments,e=t.length;if(e===0)return null;let n;for(let o=0;o<e;o+=1){const r=t[o];if(r.isVisible){const a=r.bbox();a!=null&&(n=n?n.union(a):a)}}if(n!=null)return n;const s=t[e-1];return new I(s.end.x,s.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n=e!==0?this.segments[e-1]:null,s;const o=null;if(Array.isArray(t))for(let r=0,a=t.length;r<a;r+=1){const l=t[r];s=this.prepareSegment(l,n,o),this.segments.push(s),n=s}else t!=null&&t.isSegment&&(s=this.prepareSegment(t,n,o),this.segments.push(s));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let s,o=null,r=null;if(n!==0&&(t>=1?(o=this.segments[t-1],r=o.nextSegment):(o=null,r=this.segments[0])),!Array.isArray(e))s=this.prepareSegment(e,o,r),this.segments.splice(t,0,s);else for(let a=0,l=e.length;a<l;a+=1){const c=e[a];s=this.prepareSegment(c,o,r),this.segments.splice(t+a,0,s),o=s}return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],s=n.previousSegment,o=n.nextSegment;return s&&(s.nextSegment=o),o&&(o.previousSegment=s),n.isSubpathStart&&o&&this.updateSubpathStartSegment(o),n}replaceSegment(t,e){const n=this.fixIndex(t);let s;const o=this.segments[n];let r=o.previousSegment;const a=o.nextSegment;let l=o.isSubpathStart;if(!Array.isArray(e))s=this.prepareSegment(e,r,a),this.segments.splice(n,1,s),l&&s.isSubpathStart&&(l=!1);else{this.segments.splice(t,1);for(let c=0,h=e.length;c<h;c+=1){const u=e[c];s=this.prepareSegment(u,r,a),this.segments.splice(t+c,0,s),r=s,l&&s.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(e===0)throw new Error("Path has no segments.");let n=t;for(;n<0;)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(this.segments.length===0)return null;const n=hn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.segmentIndexAtLength(r,s)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(n===0)return null;let s=!0;t<0&&(s=!1,t=-t);const o=this.getPrecision(e),r=this.getSubdivisions(e);let a=0,l=null;for(let c=0;c<n;c+=1){const h=s?c:n-1-c,u=this.segments[h],d=r[h],f=u.length({precision:o,subdivisions:d});if(u.isVisible){if(t<=a+f)return h;l=h}a+=f}return l}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let s=0,o=this.segments.length;s<o;s+=1){const a=this.segments[s].getSubdivisions({precision:e});n.push(a)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;for(;n&&!n.isSubpathStart;)e!=null?n.subpathStartSegment=e.subpathStartSegment:n.subpathStartSegment=null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,e!=null&&(e.nextSegment=t),n!=null&&(n.previousSegment=t);let s=t;return t.isSubpathStart&&(t.subpathStartSegment=t,s=n),s!=null&&this.updateSubpathStartSegment(s),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),s=this.closestPointT(t,n);return s?this.lengthAtT(s,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),s=this.closestPointLength(t,n);if(s===0)return 0;const o=this.length(n);return o===0?0:s/o}closestPointT(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=s[a];if(c.isVisible){const u=c.closestPointT(t,{precision:n,subdivisions:h}),d=c.pointAtT(u),f=Yl(d,t);f<r&&(o={segmentIndex:a,value:u},r=f)}}return o||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(this.segments.length===0)return null;const n=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],h=s[a];if(c.isDifferentiable()){const u=c.closestPointT(t,{precision:n,subdivisions:h}),d=c.pointAtT(u),f=Yl(d,t);f<r&&(o=c.tangentAtT(u),r=f)}}return o||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let s=0;for(let o=0,r=n.length;o<r;o+=1)n[o].containsPoint(t)&&(s+=1);return s%2===1}pointAt(t,e={}){if(this.segments.length===0)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),o=this.length(n)*t;return this.pointAtLength(o,n)}pointAtLength(t,e={}){if(this.segments.length===0)return null;if(t===0)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let c=0,h=this.segments.length;c<h;c+=1){const u=n?c:h-1-c,d=this.segments[u],f=o[u],m=d.length({precision:s,subdivisions:f});if(d.isVisible){if(t<=a+m)return d.pointAtLength((n?1:-1)*(t-a),{precision:s,subdivisions:f});r=d}a+=m}return r?n?r.end:r.start:this.segments[this.segments.length-1].end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(n===0)return null;const s=t.segmentIndex;if(s<0)return e[0].pointAtT(0);if(s>=n)return e[n-1].pointAtT(1);const o=hn(t.value,0,1);return e[s].pointAtT(o)}divideAt(t,e={}){if(this.segments.length===0)return null;const n=hn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.divideAtLength(r,s)}divideAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r=0,a,l,c,h,u;for(let E=0,S=this.segments.length;E<S;E+=1){const v=n?E:S-1-E,M=this.getSegment(v),k=o[v],T={precision:s,subdivisions:k},P=M.length(T);if(M.isDifferentiable()&&(c=M,h=v,t<=r+P)){l=v,a=M.divideAtLength((n?1:-1)*(t-r),T);break}r+=P}if(!c)return null;a||(l=h,u=n?1:0,a=c.divideAtT(u));const d=this.clone(),f=l;d.replaceSegment(f,a);const m=f;let p=f+1,b=f+2;a[0].isDifferentiable()||(d.removeSegment(m),p-=1,b-=1);const y=d.getSegment(p).start;d.insertSegment(p,j.createSegment("M",y)),b+=1,a[1].isDifferentiable()||(d.removeSegment(b-1),b-=1);const C=b-m-1;for(let E=b,S=d.segments.length;E<S;E+=1){const v=this.getSegment(E-C),M=d.getSegment(E);if(M.type==="Z"&&!v.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const k=j.createSegment("L",v.end);d.replaceSegment(E,k)}}const w=new j(d.segments.slice(0,p)),x=new j(d.segments.slice(p));return[w,x]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(n==null)return null;let s=null;for(let o=0,r=n.length;o<r;o+=1){const a=n[o],l=t.intersect(a);l&&(s==null&&(s=[]),Array.isArray(l)?s.push(...l):s.push(l))}return s}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1)if(this.segments[t].isDifferentiable())return!0;return!1}isValid(){const t=this.segments;return t.length===0||t[0].type==="M"}length(t={}){if(this.segments.length===0)return 0;const e=this.getSubdivisions(t);let n=0;for(let s=0,o=this.segments.length;s<o;s+=1){const r=this.segments[s],a=e[s];n+=r.length({subdivisions:a})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(n===0)return 0;let s=t.segmentIndex;if(s<0)return 0;let o=hn(t.value,0,1);s>=n&&(s=n-1,o=1);const r=this.getPrecision(e),a=this.getSubdivisions(e);let l=0;for(let u=0;u<s;u+=1){const d=this.segments[u],f=a[u];l+=d.length({precision:r,subdivisions:f})}const c=this.segments[s],h=a[s];return l+=c.lengthAtT(o,{precision:r,subdivisions:h}),l}tangentAt(t,e={}){if(this.segments.length===0)return null;const n=hn(t,0,1),s=this.getOptions(e),r=this.length(s)*n;return this.tangentAtLength(r,s)}tangentAtLength(t,e={}){if(this.segments.length===0)return null;let n=!0;t<0&&(n=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const h=n?l:c-1-l,u=this.segments[h],d=o[h],f=u.length({precision:s,subdivisions:d});if(u.isDifferentiable()){if(t<=a+f)return u.tangentAtLength((n?1:-1)*(t-a),{precision:s,subdivisions:d});r=u}a+=f}if(r){const l=n?1:0;return r.tangentAtT(l)}return null}tangentAtT(t){const e=this.segments.length;if(e===0)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const s=hn(t.value,0,1);return this.segments[n].tangentAtT(s)}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getSubdivisions(t={}){if(t.segmentSubdivisions==null){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(n===0)return null;const s=this.getSubdivisions(t),o=[];let r=[];for(let a=0;a<n;a+=1){const l=e[a];if(l.isVisible){const c=s[a];c.length>0?c.forEach(h=>r.push(h.start)):r.push(l.start)}else r.length>0&&(r.push(e[a-1].end),o.push(r),r=[])}return r.length>0&&(r.push(this.end),o.push(r)),o}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(n=>new xt(n)):null}scale(t,e,n){return this.segments.forEach(s=>s.scale(t,e,n)),this}rotate(t,e){return this.segments.forEach(n=>n.rotate(t,e)),this}translate(t,e){return typeof t=="number"?this.segments.forEach(n=>n.translate(t,e)):this.segments.forEach(n=>n.translate(t)),this}clone(){const t=new j;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(t==null)return!1;const e=this.segments,n=t.segments,s=e.length;if(n.length!==s)return!1;for(let o=0;o<s;o+=1){const r=e[o],a=n[o];if(r.type!==a.type||!r.equals(a))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}function un(i,t,e){let n,s;typeof t=="object"?(n=t.x,s=t.y):(n=t,s=e);const o=j.parse(i),r=o.bbox();if(r){let a=-r.height/2-r.y,l=-r.width/2-r.x;typeof n=="number"&&(l-=n),typeof s=="number"&&(a-=s),o.translate(l,a)}return o.serialize()}const vo=/[\t\r\n\f]/g,Eo=/\S+/g,dn=i=>` ${i} `;function gn(i){return i&&i.getAttribute&&i.getAttribute("class")||""}function ue(i,t){if(i==null||t==null)return!1;const e=dn(gn(i)),n=dn(t);return i.nodeType===1?e.replace(vo," ").includes(n):!1}function L(i,t){if(!(i==null||t==null)){if(typeof t=="function")return L(i,t(gn(i)));if(typeof t=="string"&&i.nodeType===1){const e=t.match(Eo)||[],n=dn(gn(i)).replace(vo," ");let s=e.reduce((o,r)=>o.indexOf(dn(r))<0?`${o}${r} `:o,n);s=s.trim(),n!==s&&i.setAttribute("class",s)}}}function at(i,t){if(i!=null){if(typeof t=="function")return at(i,t(gn(i)));if((!t||typeof t=="string")&&i.nodeType===1){const e=(t||"").match(Eo)||[],n=dn(gn(i)).replace(vo," ");let s=e.reduce((o,r)=>{const a=dn(r);return o.indexOf(a)>-1?o.replace(a," "):o},n);s=t?s.trim():"",n!==s&&i.setAttribute("class",s)}}}function re(i,t,e){if(!(i==null||t==null)){if(e!=null&&typeof t=="string"){e?L(i,t):at(i,t);return}if(typeof t=="function")return re(i,t(gn(i),e),e);typeof t=="string"&&(t.match(Eo)||[]).forEach(s=>{ue(i,s)?at(i,s):L(i,s)})}}let $l=0;function My(){return $l+=1,`v${$l}`}function So(i){return(i.id==null||i.id==="")&&(i.id=My()),i.id}function Ie(i){return i==null?!1:typeof i.getScreenCTM=="function"&&i instanceof SVGElement}const vt={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},Zl="1.1";function tc(i,t=document){return t.createElement(i)}function Mo(i,t=vt.xhtml,e=document){return e.createElementNS(t,i)}function ae(i,t=document){return Mo(i,vt.svg,t)}function es(i){if(i){const e=`<svg xmlns="${vt.svg}" xmlns:xlink="${vt.xlink}" version="${Zl}">${i}</svg>`,{documentElement:n}=By(e,{async:!1});return n}const t=document.createElementNS(vt.svg,"svg");return t.setAttributeNS(vt.xmlns,"xmlns:xlink",vt.xlink),t.setAttribute("version",Zl),t}function By(i,t={}){let e;try{const n=new DOMParser;if(t.async!=null){const s=n;s.async=t.async}e=n.parseFromString(i,t.mimeType||"text/xml")}catch{e=void 0}if(!e||e.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${i}`);return e}function ky(i,t=!0){const e=i.nodeName;return t?e.toLowerCase():e.toUpperCase()}function Bo(i){let t=0,e=i.previousSibling;for(;e;)e.nodeType===1&&(t+=1),e=e.previousSibling;return t}function Ty(i,t){return i.querySelectorAll(t)}function Iy(i,t){return i.querySelector(t)}function ec(i,t,e){const n=i.ownerSVGElement;let s=i.parentNode;for(;s&&s!==e&&s!==n;){if(ue(s,t))return s;s=s.parentNode}return null}function ko(i,t){const e=t&&t.parentNode;return i===e||!!(e&&e.nodeType===1&&i.compareDocumentPosition(e)&16)}function _t(i){i&&(Array.isArray(i)?i:[i]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function Hn(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Ot(i,t){(Array.isArray(t)?t:[t]).forEach(n=>{n!=null&&i.appendChild(n)})}function nc(i,t){const e=i.firstChild;return e?_n(e,t):Ot(i,t)}function _n(i,t){const e=i.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&e.insertBefore(s,i)})}function Py(i,t){const e=i.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&e.insertBefore(s,i.nextSibling)})}function Wt(i,t){t!=null&&t.appendChild(i)}function Oy(i){return!!i&&i.nodeType===1}function ic(i){try{return i instanceof HTMLElement}catch{return typeof i=="object"&&i.nodeType===1&&typeof i.style=="object"&&typeof i.ownerDocument=="object"}}function Ny(i,t){const e=[];let n=i.firstChild;for(;n;n=n.nextSibling)n.nodeType===1&&(!t||ue(n,t))&&e.push(n);return e}const sc=i=>{const t=Object.create(null);return e=>t[e]||(t[e]=i(e))},oc=sc(i=>i.replace(/\B([A-Z])/g,"-$1").toLowerCase()),To=sc(i=>qb(Jn(i)).replace(/ /g,"")),rc=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits","preserveAspectRatio"];function Ry(i,t){return i.getAttribute(t)}function Io(i,t){const e=lc(t);e.ns?i.hasAttributeNS(e.ns,e.local)&&i.removeAttributeNS(e.ns,e.local):i.hasAttribute(t)&&i.removeAttribute(t)}function Po(i,t,e){if(e==null)return Io(i,t);const n=lc(t);n.ns&&typeof e=="string"?i.setAttributeNS(n.ns,t,e):t==="id"?i.id=`${e}`:i.setAttribute(t,`${e}`)}function ac(i,t){Object.keys(t).forEach(e=>{Po(i,e,t[e])})}function W(i,t,e){if(t==null){const n=i.attributes,s={};for(let o=0;o<n.length;o+=1)s[n[o].name]=n[o].value;return s}if(typeof t=="string"&&e===void 0)return i.getAttribute(t);typeof t=="object"?ac(i,t):Po(i,t,e)}function lc(i){if(i.indexOf(":")!==-1){const t=i.split(":");return{ns:vt[t[0]],local:t[1]}}return{ns:null,local:i}}function Wn(i){const t={};return Object.keys(i).forEach(e=>{const n=rc.includes(e)?e:oc(e);t[n]=i[e]}),t}function ns(i){const t={};return i.split(";").forEach(n=>{const s=n.trim();if(s){const o=s.split("=");o.length&&(t[o[0].trim()]=o[1]?o[1].trim():"")}}),t}function Oo(i,t){return Object.keys(t).forEach(e=>{if(e==="class")i[e]=i[e]?`${i[e]} ${t[e]}`:t[e];else if(e==="style"){const n=typeof i[e]=="object",s=typeof t[e]=="object";let o,r;n&&s?(o=i[e],r=t[e]):n?(o=i[e],r=ns(t[e])):s?(o=ns(i[e]),r=t[e]):(o=ns(i[e]),r=ns(t[e])),i[e]=Oo(o,r)}else i[e]=t[e]}),i}const Dy=/-(.)/g;function Ly(i){return i.replace(Dy,(t,e)=>e.toUpperCase())}const No={},cc=["webkit","ms","moz","o"],hc=typeof document<"u"?document.createElement("div").style:{};function Qy(i){for(let t=0;t<cc.length;t+=1){const e=cc[t]+i;if(e in hc)return e}return null}function Vy(i){const t=Ly(i);if(No[t]==null){const e=t.charAt(0).toUpperCase()+t.slice(1);No[t]=t in hc?t:Qy(e)}return No[t]}function uc(i,t){const e=i.ownerDocument&&i.ownerDocument.defaultView&&i.ownerDocument.defaultView.opener?i.ownerDocument.defaultView.getComputedStyle(i,null):window.getComputedStyle(i,null);return e&&t?e.getPropertyValue(t)||e[t]:e}const zy={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Fy(i){return/^--/.test(i)}function is(i,t,e){const n=window.getComputedStyle(i,null);return e?n.getPropertyValue(t)||void 0:n[t]||i.style[t]}function ss(i,t){return parseInt(is(i,t),10)||0}function Uy(i,t){return!zy[i]&&typeof t=="number"?`${t}px`:t}function nt(i,t,e){if(typeof t=="string"){const n=Fy(t);if(n||(t=Vy(t)),e===void 0)return is(i,t,n);n||(e=Uy(t,e));const s=i.style;n?s.setProperty(t,e):s[t]=e;return}for(const n in t)nt(i,n,t[n])}function Ro(i){let t=2166136261,e=!1,n=i;for(let s=0,o=n.length;s<o;s+=1){let r=n.charCodeAt(s);r>127&&!e&&(n=unescape(encodeURIComponent(n)),r=n.charCodeAt(s),e=!0),t^=r,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function Do(){let i="";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=Math.random()*16|0,r=s==="x"?o:s==="y"?o&3|8:s;i+=r.toString(16)}return i}function Ky(i,t,e){const n=Math.min(2,Math.floor(i.length*.34));let s=Math.floor(i.length*.4)+1,o,r=!1;const a=i.toLowerCase();for(const l of t){const c=e(l);if(c!==void 0&&Math.abs(c.length-a.length)<=n){const h=c.toLowerCase();if(h===a){if(c===i)continue;return l}if(r||c.length<3)continue;const u=Jy(a,h,s-1);if(u===void 0)continue;u<3?(r=!0,o=l):(s=u,o=l)}}return o}function Jy(i,t,e){let n=new Array(t.length+1),s=new Array(t.length+1);const o=e+1;for(let a=0;a<=t.length;a+=1)n[a]=a;for(let a=1;a<=i.length;a+=1){const l=i.charCodeAt(a-1),c=a>e?a-e:1,h=t.length>e+a?e+a:t.length;s[0]=a;let u=a;for(let f=1;f<c;f+=1)s[f]=o;for(let f=c;f<=h;f+=1){const m=l===t.charCodeAt(f-1)?n[f-1]:Math.min(n[f]+1,s[f-1]+1,n[f-1]+2);s[f]=m,u=Math.min(u,m)}for(let f=h+1;f<=t.length;f+=1)s[f]=o;if(u>e)return;const d=n;n=s,s=d}const r=n[t.length];return r>e?void 0:r}const os=new WeakMap;function jy(i,t){const e=Jn(t),n=os.get(i);if(n)return n[e]}function Gy(i,t,e){const n=Jn(t),s=os.get(i);s?s[n]=e:os.set(i,{[n]:e})}function Ge(i,t,e){if(!t)return os.get(i);if(typeof t=="string"){if(e===void 0)return jy(i,t);Gy(i,t,e);return}for(const n in t)Ge(i,n,t[n])}const Yy={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function Lo(i,t,e){if(t){if(typeof t=="string"){if(t=Yy[t]||t,arguments.length<3)return i[t];i[t]=e;return}for(const n in t)Lo(i,n,t[n])}}function Hy(i,...t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(i.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})}const _y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e])};function Wy(i,t){_y(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}class qy{}const Xy=/^\s*class\s+/.test(`${qy}`)||/^\s*class\s*\{/.test(`${class{}}`);function Qo(i,t){let e;return Xy?e=class extends t{}:(e=function(){return t.apply(this,arguments)},Wy(e,t)),Object.defineProperty(e,"name",{value:i}),e}function dc(i){return i==="__proto__"}function Vo(i,t,e="/"){let n;const s=Array.isArray(t)?t:t.split(e);if(s.length)for(n=i;s.length;){const o=s.shift();if(Object(n)===n&&o&&o in n)n=n[o];else return}return n}function fn(i,t,e,n="/"){const s=Array.isArray(t)?t:t.split(n),o=s.pop();if(o&&!dc(o)){let r=i;s.forEach(a=>{dc(a)||(r[a]==null&&(r[a]={}),r=r[a])}),r[o]=e}return i}function gc(i,t,e="/"){const n=Array.isArray(t)?t.slice():t.split(e),s=n.pop();if(s)if(n.length>0){const o=Vo(i,n);o&&delete o[s]}else delete i[s];return i}function $y(i,t,e={}){const n=e.offset||0,s=[],o=[];let r,a,l=null;for(let c=0;c<i.length;c+=1){r=o[c]=i[c];for(let h=0,u=t.length;h<u;h+=1){const d=t[h],f=d.start+n,m=d.end+n;c>=f&&c<m&&(typeof r=="string"?r=o[c]={t:i[c],attrs:d.attrs}:r.attrs=Oo(Oo({},r.attrs),d.attrs),e.includeAnnotationIndices&&(r.annotations==null&&(r.annotations=[]),r.annotations.push(h)))}a=o[c-1],a?mt(r)&&mt(a)?(l=l,JSON.stringify(r.attrs)===JSON.stringify(a.attrs)?l.t+=r.t:(s.push(l),l=r)):mt(r)||mt(a)?(l=l,s.push(l),l=r):l=String(l||"")+String(r):l=r}return l!=null&&s.push(l),s}function Zy(i){return i.replace(/ /g," ")}class K{get[Symbol.toStringTag](){return fc}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}static isVector(t){if(t==null)return!1;if(t instanceof K)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===fc)&&n.node instanceof SVGElement&&typeof n.sample=="function"&&typeof n.toPath=="function"}static create(t,e,n){return new K(t,e,n)}static createVectors(t){if(t[0]==="<"){const e=es(t),n=[];for(let s=0,o=e.childNodes.length;s<o;s+=1){const r=e.childNodes[s];n.push(K.create(document.importNode(r,!0)))}return n}return[K.create(t)]}static toNode(t){return K.isVector(t)?t.node:t}static toNodes(t){return Array.isArray(t)?t.map(e=>K.toNode(e)):[K.toNode(t)]}constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let s;if(K.isVector(t))s=t.node;else if(typeof t=="string")if(t.toLowerCase()==="svg")s=es();else if(t[0]==="<"){const o=es(t);s=document.importNode(o.firstChild,!0)}else s=document.createElementNS(vt.svg,t);else s=t;this.node=s,e&&this.setAttributes(e),n&&this.append(n)}transform(t,e){return t==null?pn(this.node):(pn(this.node,t,e),this)}translate(t,e=0,n={}){return t==null?vc(this.node):(vc(this.node,t,e,n),this)}rotate(t,e,n,s={}){return t==null?Uo(this.node):(Uo(this.node,t,e,n,s),this)}scale(t,e){return t==null?Ec(this.node):(Ec(this.node,t,e),this)}getTransformToElement(t){const e=K.toNode(t);return Ko(this.node,e)}removeAttribute(t){return Io(this.node,t),this}getAttribute(t){return Ry(this.node,t)}setAttribute(t,e){return Po(this.node,t,e),this}setAttributes(t){return ac(this.node,t),this}attr(t,e){return t==null?W(this.node):typeof t=="string"&&e===void 0?W(this.node,t):(typeof t=="object"?W(this.node,t):W(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:K.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?K.create(e):K.create("defs").appendTo(t)}text(t,e={}){return mc(this.node,t,e),this}tagName(){return ky(this.node)}clone(){return K.create(this.node.cloneNode(!0))}remove(){return _t(this.node),this}empty(){return Hn(this.node),this}append(t){return Ot(this.node,K.toNodes(t)),this}appendTo(t){return Wt(this.node,K.isVector(t)?t.node:t),this}prepend(t){return nc(this.node,K.toNodes(t)),this}before(t){return _n(this.node,K.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(K.toNode(t),this.node),K.create(t)}first(){return this.node.firstChild?K.create(this.node.firstChild):null}last(){return this.node.lastChild?K.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?K.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(K.toNode(t))}find(t){const e=[],n=Ty(this.node,t);if(n)for(let s=0,o=n.length;s<o;s+=1)e.push(K.create(n[s]));return e}findOne(t){const e=Iy(this.node,t);return e?K.create(e):null}findParentByClass(t,e){const n=ec(this.node,t,e);return n?K.create(n):null}matches(t){const e=this.node;this.node.matches;const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}contains(t){return ko(this.node,K.isVector(t)?t.node:t)}wrap(t){const e=K.create(t),n=this.node.parentNode;return n!=null&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(e.node.parentNode==null)return null;if(e=K.create(e.node.parentNode),t==null)return e;do if(typeof t=="string"?e.matches(t):e instanceof t)return e;while(e=K.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1)t[n].nodeType===1&&e.push(K.create(t[n]));return e}eachChild(t,e){const n=this.children();for(let s=0,o=n.length;s<o;s+=1)t.call(n[s],n[s],s,n),e&&n[s].eachChild(t,e);return this}index(){return Bo(this.node)}hasClass(t){return ue(this.node,t)}addClass(t){return L(this.node,t),this}removeClass(t){return at(this.node,t),this}toggleClass(t,e){return re(this.node,t,e),this}toLocalPoint(t,e){return C6(this.node,t,e)}sample(t=1){return this.node instanceof SVGPathElement?i6(this.node,t):[]}toPath(){return K.create(h6(this.node))}toPathData(){return Ac(this.node)}}const fc=`X6.${K.name}`;function t6(i,t){const e=K.create(t),n=K.create("textPath"),s=i.d;if(s&&i["xlink:href"]===void 0){const o=K.create("path").attr("d",s).appendTo(e.defs());n.attr("xlink:href",`#${o.id}`)}return typeof i=="object"&&n.attr(i),n.node}function e6(i,t,e){const n=e.eol,s=e.baseSize,o=e.lineHeight;let r=0,a;const l={},c=t.length-1;for(let h=0;h<=c;h+=1){let u=t[h],d=null;if(typeof u=="object"){const f=u.attrs,m=K.create("tspan",f);a=m.node;let p=u.t;n&&h===c&&(p+=n),a.textContent=p;const b=f.class;b&&m.addClass(b),e.includeAnnotationIndices&&m.attr("annotations",u.annotations.join(",")),d=parseFloat(f["font-size"]),d===void 0&&(d=s),d&&d>r&&(r=d)}else n&&h===c&&(u+=n),a=document.createTextNode(u||" "),s&&s>r&&(r=s);i.appendChild(a)}return r&&(l.maxFontSize=r),o?l.lineHeight=o:r&&(l.lineHeight=r*1.2),l}const pc=/em$/;function rs(i,t){const e=parseFloat(i);return pc.test(i)?e*t:e}function n6(i,t,e,n){if(!Array.isArray(t))return 0;const s=t.length;if(!s)return 0;let o=t[0];const r=rs(o.maxFontSize,e)||e;let a=0;const l=rs(n,e);for(let u=1;u<s;u+=1){o=t[u];const d=rs(o.lineHeight,e)||l;a+=d}const c=rs(o.maxFontSize,e)||e;let h;switch(i){case"middle":h=r/2-.15*c-a/2;break;case"bottom":h=-(.25*c)-a;break;case"top":default:h=.8*r;break}return h}function mc(i,t,e={}){t=Zy(t);const n=e.eol;let s=e.textPath;const o=e.textVerticalAnchor,r=o==="middle"||o==="bottom"||o==="top";let a=e.x;a===void 0&&(a=i.getAttribute("x")||0);const l=e.includeAnnotationIndices;let c=e.annotations;c&&!Array.isArray(c)&&(c=[c]);const h=e.lineHeight,u=h==="auto",d=u?"1.5em":h||"1em";let f=!0;const m=i.childNodes;if(m.length===1){const k=m[0];k&&k.tagName.toUpperCase()==="TITLE"&&(f=!1)}f&&Hn(i),W(i,{"xml:space":"preserve",display:t||e.displayEmpty?null:"none"});const p=W(i,"font-size");let b=parseFloat(p);b||(b=16,(r||c)&&!p&&W(i,"font-size",`${b}`));let y;s?(typeof s=="string"&&(s={d:s}),y=t6(s,i)):y=document.createDocumentFragment();let C,w=0,x;const E=t.split(`
|
|
3
|
+
`),S=[],v=E.length-1;for(let k=0;k<=v;k+=1){C=d;let T="v-line";const P=ae("tspan");let R,J=E[k];if(J)if(c){const D=$y(J,c,{offset:-w,includeAnnotationIndices:l});R=e6(P,D,{eol:k!==v&&n,baseSize:b,lineHeight:u?null:d,includeAnnotationIndices:l});const N=R.lineHeight;N&&u&&k!==0&&(C=N),k===0&&(x=R.maxFontSize*.8)}else n&&k!==v&&(J+=n),P.textContent=J;else{P.textContent="-",T+=" v-empty-line";const D=P.style;D.fillOpacity=0,D.strokeOpacity=0,c&&(R={})}R&&S.push(R),k>0&&P.setAttribute("dy",C),(k>0||s)&&P.setAttribute("x",a),P.className.baseVal=T,y.appendChild(P),w+=J.length+1}if(r)if(c)C=n6(o,S,b,d);else if(o==="top")C="0.8em";else{let k;switch(v>0?(k=parseFloat(d)||1,k*=v,pc.test(d)||(k/=b)):k=0,o){case"middle":C=`${.3-k/2}em`;break;case"bottom":C=`${-k-.3}em`;break}}else o===0?C="0em":o?C=o:(C=0,i.getAttribute("y")==null&&i.setAttribute("y",`${x||"0.8em"}`));y.firstChild.setAttribute("dy",C),i.appendChild(y)}function qn(i,t={}){const e=document.createElement("canvas").getContext("2d");if(!i)return{width:0};const n=[],s=t["font-size"]?`${parseFloat(t["font-size"])}px`:"14px";return n.push(t["font-style"]||"normal"),n.push(t["font-variant"]||"normal"),n.push(t["font-weight"]||400),n.push(s),n.push(t["font-family"]||"sans-serif"),e.font=n.join(" "),e.measureText(i)}function bc(i,t,e,n={}){if(t>=e)return[i,""];const s=i.length,o={};let r=Math.round(t/e*s-1);for(r<0&&(r=0);r>=0&&r<s;){const a=i.slice(0,r),l=o[a]||qn(a,n).width,c=i.slice(0,r+1),h=o[c]||qn(c,n).width;if(o[a]=l,o[c]=h,l>t)r-=1;else if(h<=t)r+=1;else break}return[i.slice(0,r),i.slice(r)]}function yc(i,t,e={},n={}){const s=t.width,o=t.height,r=n.eol||`
|
|
4
|
+
`,a=e.fontSize||14,l=e.lineHeight?parseFloat(e.lineHeight):Math.ceil(a*1.4),c=Math.floor(o/l);if(i.indexOf(r)>-1){const b=Do(),y=[];return i.split(r).forEach(C=>{const w=yc(C,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),e,Object.assign(Object.assign({},n),{eol:b}));w&&y.push(...w.split(b))}),y.slice(0,c).join(r)}const{width:h}=qn(i,e);if(h<s)return i;const u=[];let d=i,f=h,m=n.ellipsis,p=0;m&&(typeof m!="string"&&(m="…"),p=qn(m,e).width);for(let b=0;b<c;b+=1)if(f>s)if(b===c-1){const[C]=bc(d,s-p,f,e);u.push(m?`${C}${m}`:C)}else{const[C,w]=bc(d,s,f,e);u.push(C),d=w,f=qn(d,e).width}else{u.push(d);break}return u.join(r)}const zo=.551784;function Nt(i,t,e=NaN){const n=i.getAttribute(t);if(n==null)return e;const s=parseFloat(n);return Number.isNaN(s)?e:s}function i6(i,t=1){const e=i.getTotalLength(),n=[];let s=0,o;for(;s<e;)o=i.getPointAtLength(s),n.push({distance:s,x:o.x,y:o.y}),s+=t;return n}function s6(i){return["M",Nt(i,"x1"),Nt(i,"y1"),"L",Nt(i,"x2"),Nt(i,"y2")].join(" ")}function o6(i){const t=as(i);return t.length===0?null:`${wc(t)} Z`}function r6(i){const t=as(i);return t.length===0?null:wc(t)}function wc(i){return`M ${i.map(e=>`${e.x} ${e.y}`).join(" L")}`}function as(i){const t=[],e=i.points;if(e)for(let n=0,s=e.numberOfItems;n<s;n+=1)t.push(e.getItem(n));return t}function a6(i){const t=Nt(i,"cx",0),e=Nt(i,"cy",0),n=Nt(i,"r"),s=n*zo;return["M",t,e-n,"C",t+s,e-n,t+n,e-s,t+n,e,"C",t+n,e+s,t+s,e+n,t,e+n,"C",t-s,e+n,t-n,e+s,t-n,e,"C",t-n,e-s,t-s,e-n,t,e-n,"Z"].join(" ")}function l6(i){const t=Nt(i,"cx",0),e=Nt(i,"cy",0),n=Nt(i,"rx"),s=Nt(i,"ry")||n,o=n*zo,r=s*zo;return["M",t,e-s,"C",t+o,e-s,t+n,e-r,t+n,e,"C",t+n,e+r,t+o,e+s,t,e+s,"C",t-o,e+s,t-n,e+r,t-n,e,"C",t-n,e-r,t-o,e-s,t,e-s,"Z"].join(" ")}function c6(i){return Cc({x:Nt(i,"x",0),y:Nt(i,"y",0),width:Nt(i,"width",0),height:Nt(i,"height",0),rx:Nt(i,"rx",0),ry:Nt(i,"ry",0)})}function Cc(i){let t;const e=i.x,n=i.y,s=i.width,o=i.height,r=Math.min(i.rx||i["top-rx"]||0,s/2),a=Math.min(i.rx||i["bottom-rx"]||0,s/2),l=Math.min(i.ry||i["top-ry"]||0,o/2),c=Math.min(i.ry||i["bottom-ry"]||0,o/2);return r||a||l||c?t=["M",e,n+l,"v",o-l-c,"a",a,c,0,0,0,a,c,"h",s-2*a,"a",a,c,0,0,0,a,-c,"v",-(o-c-l),"a",r,l,0,0,0,-r,-l,"h",-(s-2*r),"a",r,l,0,0,0,-r,l,"Z"]:t=["M",e,n,"H",e+s,"V",n+o,"H",e,"V",n,"Z"],t.join(" ")}function h6(i){const t=ae("path");W(t,W(i));const e=Ac(i);return e&&t.setAttribute("d",e),t}function Ac(i){const t=i.tagName.toLowerCase();switch(t){case"path":return i.getAttribute("d");case"line":return s6(i);case"polygon":return o6(i);case"polyline":return r6(i);case"ellipse":return l6(i);case"circle":return a6(i);case"rect":return c6(i)}throw new Error(`"${t}" cannot be converted to svg path element.`)}const u6=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,xc=/[ ,]+/,d6=/^(\w+)\((.*)\)/;function g6(i,t){const n=ae("svg").createSVGPoint();return n.x=i,n.y=t,n}function Et(i){const e=ae("svg").createSVGMatrix();if(i!=null){const n=i,s=["a","b","c","d","e","f"];for(const o of s)n[o]!==void 0&&(e[o]=n[o])}return e}function f6(i){const t=ae("svg");return i!=null?(i instanceof DOMMatrix||(i=Et(i)),t.createSVGTransformFromMatrix(i)):t.createSVGTransform()}function Xn(i){let t=Et();const e=i!=null&&i.match(u6);if(!e)return t;for(let n=0,s=e.length;n<s;n+=1){const r=e[n].match(d6);if(r){let a,l,c,h,u,d=Et();const f=r[2].split(xc);switch(r[1].toLowerCase()){case"scale":a=parseFloat(f[0]),l=f[1]===void 0?a:parseFloat(f[1]),d=d.scaleNonUniform(a,l);break;case"translate":c=parseFloat(f[0]),h=parseFloat(f[1]),d=d.translate(c,h);break;case"rotate":u=parseFloat(f[0]),c=parseFloat(f[1])||0,h=parseFloat(f[2])||0,c!==0||h!==0?d=d.translate(c,h).rotate(u).translate(-c,-h):d=d.rotate(u);break;case"skewx":u=parseFloat(f[0]),d=d.skewX(u);break;case"skewy":u=parseFloat(f[0]),d=d.skewY(u);break;case"matrix":d.a=parseFloat(f[0]),d.b=parseFloat(f[1]),d.c=parseFloat(f[2]),d.d=parseFloat(f[3]),d.e=parseFloat(f[4]),d.f=parseFloat(f[5]);break;default:continue}t=t.multiply(d)}}return t}function $n(i){const t=i||{},e=t.a!=null?t.a:1,n=t.b!=null?t.b:0,s=t.c!=null?t.c:0,o=t.d!=null?t.d:1,r=t.e!=null?t.e:0,a=t.f!=null?t.f:0;return`matrix(${e},${n},${s},${o},${r},${a})`}function ls(i){let t,e,n;if(i){const o=xc;if(i.trim().indexOf("matrix")>=0){const r=Xn(i),a=p6(r);t=[a.translateX,a.translateY],e=[a.rotation],n=[a.scaleX,a.scaleY];const l=[];(t[0]!==0||t[1]!==0)&&l.push(`translate(${t.join(",")})`),(n[0]!==1||n[1]!==1)&&l.push(`scale(${n.join(",")})`),e[0]!==0&&l.push(`rotate(${e[0]})`),i=l.join(" ")}else{const r=i.match(/translate\((.*?)\)/);r&&(t=r[1].split(o));const a=i.match(/rotate\((.*?)\)/);a&&(e=a[1].split(o));const l=i.match(/scale\((.*?)\)/);l&&(n=l[1].split(o))}}const s=n&&n[0]?parseFloat(n[0]):1;return{raw:i||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:e&&e[0]?parseInt(e[0],10):0,cx:e&&e[1]?parseInt(e[1],10):void 0,cy:e&&e[2]?parseInt(e[2],10):void 0},scale:{sx:s,sy:n&&n[1]?parseFloat(n[1]):s}}}function Fo(i,t){const e=t.x*i.a+t.y*i.c+0,n=t.x*i.b+t.y*i.d+0;return{x:e,y:n}}function p6(i){const t=Fo(i,{x:0,y:1}),e=Fo(i,{x:1,y:0}),n=180/Math.PI*Math.atan2(t.y,t.x)-90,s=180/Math.PI*Math.atan2(e.y,e.x);return{skewX:n,skewY:s,translateX:i.e,translateY:i.f,scaleX:Math.sqrt(i.a*i.a+i.b*i.b),scaleY:Math.sqrt(i.c*i.c+i.d*i.d),rotation:n}}function m6(i){let t,e,n,s;return i?(t=i.a==null?1:i.a,s=i.d==null?1:i.d,e=i.b,n=i.c):t=s=1,{sx:e?Math.sqrt(t*t+e*e):t,sy:n?Math.sqrt(n*n+s*s):s}}function b6(i){let t={x:0,y:1};i&&(t=Fo(i,t));const e=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:e%360+(e<0?360:0)}}function y6(i){return{tx:i&&i.e||0,ty:i&&i.f||0}}function pn(i,t,e={}){if(t==null)return Xn(W(i,"transform"));if(e.absolute){i.setAttribute("transform",$n(t));return}const n=i.transform,s=f6(t);n.baseVal.appendItem(s)}function vc(i,t,e=0,n={}){let s=W(i,"transform");const o=ls(s);if(t==null)return o.translation;s=o.raw,s=s.replace(/translate\([^)]*\)/g,"").trim();const r=n.absolute?t:o.translation.tx+t,a=n.absolute?e:o.translation.ty+e,l=`translate(${r},${a})`;i.setAttribute("transform",`${l} ${s}`.trim())}function Uo(i,t,e,n,s={}){let o=W(i,"transform");const r=ls(o);if(t==null)return r.rotation;o=r.raw,o=o.replace(/rotate\([^)]*\)/g,"").trim(),t%=360;const a=s.absolute?t:r.rotation.angle+t,l=e!=null&&n!=null?`,${e},${n}`:"",c=`rotate(${a}${l})`;i.setAttribute("transform",`${o} ${c}`.trim())}function Ec(i,t,e){let n=W(i,"transform");const s=ls(n);if(t==null)return s.scale;e=e??t,n=s.raw,n=n.replace(/scale\([^)]*\)/g,"").trim();const o=`scale(${t},${e})`;i.setAttribute("transform",`${n} ${o}`.trim())}function Ko(i,t){if(Ie(t)&&Ie(i)){const e=t.getScreenCTM(),n=i.getScreenCTM();if(e&&n)return e.inverse().multiply(n)}return Et()}function w6(i,t){let e=Et();if(Ie(t)&&Ie(i)){let n=i;const s=[];for(;n&&n!==t;){const o=n.getAttribute("transform")||null,r=Xn(o);s.push(r),n=n.parentNode}s.reverse().forEach(o=>{e=e.multiply(o)})}return e}function C6(i,t,e){const n=i instanceof SVGSVGElement?i:i.ownerSVGElement,s=n.createSVGPoint();s.x=t,s.y=e;try{const o=n.getScreenCTM(),r=s.matrixTransform(o.inverse()),a=Ko(i,n).inverse();return r.matrixTransform(a)}catch{return s}}const Sc={};function mn(i){return Sc[i]||{}}function cs(i,t){Sc[i]=t}const Zn=new WeakMap;function A6(i){return Zn.has(i)||Zn.set(i,{events:Object.create(null)}),Zn.get(i)}function Jo(i){return Zn.get(i)}function x6(i){return Zn.delete(i)}const hs=()=>!0,bn=()=>!1;function Mc(i){i.stopPropagation()}function v6(i,t,e){i.addEventListener!=null&&i.addEventListener(t,e)}function E6(i,t,e){i.removeEventListener!=null&&i.removeEventListener(t,e)}const S6=/[^\x20\t\r\n\f]+/g,M6=/^([^.]*)(?:\.(.+)|)/;function Bc(i){return(i||"").match(S6)||[""]}function kc(i){const t=M6.exec(i)||[];return{originType:t[1]?t[1].trim():t[1],namespaces:t[2]?t[2].split(".").map(e=>e.trim()).sort():[]}}function jo(i){return i.nodeType===1||i.nodeType===9||!+i.nodeType}let Tc=0;const yn=new WeakMap;function Ic(i){return yn.has(i)||(yn.set(i,Tc),Tc+=1),yn.get(i)}function B6(i){return yn.get(i)}function k6(i){return yn.delete(i)}function Pc(i,t){return yn.set(i,t)}function T6(i,t){const e=[],n=Jo(i),s=n&&n.events&&n.events[t.type],o=s&&s.handlers||[],r=s?s.delegateCount:0;if(r>0&&!(t.type==="click"&&typeof t.button=="number"&&t.button>=1)){for(let a=t.target;a!==i;a=a.parentNode||i)if(a.nodeType===1&&!(t.type==="click"&&a.disabled===!0)){const l=[],c={};for(let h=0;h<r;h+=1){const u=o[h],d=u.selector;if(d!=null&&c[d]==null){const f=i,m=[];f.querySelectorAll(d).forEach(p=>{m.push(p)}),c[d]=m.includes(a)}c[d]&&l.push(u)}l.length&&e.push({elem:a,handlers:l})}}return r<o.length&&e.push({elem:i,handlers:o.slice(r)}),e}function Oc(i){return i!=null&&i===i.window}function Nc(i,t){const e=i.nodeType===9?i.documentElement:i,n=t&&t.parentNode;return i===n||!!(n&&n.nodeType===1&&(e.contains?e.contains(n):i.compareDocumentPosition&&i.compareDocumentPosition(n)&16))}class Ae{static create(t){return t instanceof Ae?t:new Ae(t)}static addProperty(t,e){Object.defineProperty(Ae.prototype,t,{enumerable:!0,configurable:!0,get:typeof e=="function"?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(n){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}})}constructor(t,e){this.isDefaultPrevented=bn,this.isPropagationStopped=bn,this.isImmediatePropagationStopped=bn,this.isSimulated=!1,this.preventDefault=()=>{const n=this.originalEvent;this.isDefaultPrevented=hs,n&&!this.isSimulated&&n.preventDefault()},this.stopPropagation=()=>{const n=this.originalEvent;this.isPropagationStopped=hs,n&&!this.isSimulated&&n.stopPropagation()},this.stopImmediatePropagation=()=>{const n=this.originalEvent;this.isImmediatePropagationStopped=hs,n&&!this.isSimulated&&n.stopImmediatePropagation(),this.stopPropagation()},typeof t=="string"?this.type=t:t.type&&(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?hs:bn,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.timeStamp=t.timeStamp),e&&Object.assign(this,e),this.timeStamp||(this.timeStamp=Date.now())}}const Rc={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(Rc).forEach(i=>Ae.addProperty(i,Rc[i])),cs("load",{noBubble:!0}),cs("beforeunload",{postDispatch(i,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}),cs("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(i,t){let e;const n=t.relatedTarget,s=t.handleObj;return(!n||n!==i&&!Nc(i,n))&&(t.type=s.originType,e=s.handler.call(i,t),t.type="mouseover"),e}}),cs("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(i,t){let e;const n=t.relatedTarget,s=t.handleObj;return(!n||n!==i&&!Nc(i,n))&&(t.type=s.originType,e=s.handler.call(i,t),t.type="mouseout"),e}});let Go;function I6(i,t,e,n,s){if(!jo(i))return;let o;if(typeof e!="function"){const{handler:c,selector:h}=e,u=_(e,["handler","selector"]);e=c,s=h,o=u}const r=A6(i);let a=r.handler;a==null&&(a=r.handler=function(c,...h){return Go!==c.type?P6(i,c,...h):void 0});const l=Ic(e);Bc(t).forEach(c=>{const{originType:h,namespaces:u}=kc(c);if(!h)return;let d=h,f=mn(d);d=(s?f.delegateType:f.bindType)||d,f=mn(d);const m=Object.assign({type:d,originType:h,data:n,selector:s,guid:l,handler:e,namespace:u.join(".")},o),p=r.events;let b=p[d];b||(b=p[d]={handlers:[],delegateCount:0},(!f.setup||f.setup(i,n,u,a)===!1)&&v6(i,d,a)),f.add&&(k6(m.handler),f.add(i,m),Pc(m.handler,l)),s?(b.handlers.splice(b.delegateCount,0,m),b.delegateCount+=1):b.handlers.push(m)})}function Dc(i,t,e,n,s){const o=Jo(i);if(!o)return;const r=o.events;r&&(Bc(t).forEach(a=>{const{originType:l,namespaces:c}=kc(a);if(!l){Object.keys(r).forEach(p=>{Dc(i,p+a,e,n,!0)});return}let h=l;const u=mn(h);h=(n?u.delegateType:u.bindType)||h;const d=r[h];if(!d)return;const f=c.length>0?new RegExp(`(^|\\.)${c.join("\\.(?:.*\\.|)")}(\\.|$)`):null,m=d.handlers.length;for(let p=d.handlers.length-1;p>=0;p-=1){const b=d.handlers[p];(s||l===b.originType)&&(!e||B6(e)===b.guid)&&(f==null||b.namespace&&f.test(b.namespace))&&(n==null||n===b.selector||n==="**"&&b.selector)&&(d.handlers.splice(p,1),b.selector&&(d.delegateCount-=1),u.remove&&u.remove(i,b))}m&&d.handlers.length===0&&((!u.teardown||u.teardown(i,c,o.handler)===!1)&&E6(i,h,o.handler),delete r[h])}),Object.keys(r).length===0&&x6(i))}function P6(i,t,...e){const n=Ae.create(t);n.delegateTarget=i;const s=mn(n.type);if(s.preDispatch&&s.preDispatch(i,n)===!1)return;const o=T6(i,n);for(let r=0,a=o.length;r<a&&!n.isPropagationStopped();r+=1){const l=o[r];n.currentTarget=l.elem;for(let c=0,h=l.handlers.length;c<h&&!n.isImmediatePropagationStopped();c+=1){const u=l.handlers[c];if(n.rnamespace==null||u.namespace&&n.rnamespace.test(u.namespace)){n.handleObj=u,n.data=u.data;const d=mn(u.originType).handle,f=d?d(l.elem,n,...e):u.handler.call(l.elem,n,...e);f!==void 0&&(n.result=f,f===!1&&(n.preventDefault(),n.stopPropagation()))}}}return s.postDispatch&&s.postDispatch(i,n),n.result}function O6(i,t,e,n){let s=i,o=typeof i=="string"?i:i.type,r=typeof i=="string"||s.namespace==null?[]:s.namespace.split(".");const a=e;if(a.nodeType===3||a.nodeType===8)return;o.indexOf(".")>-1&&(r=o.split("."),o=r.shift(),r.sort());const l=o.indexOf(":")<0&&`on${o}`;s=i instanceof Ae?i:new Ae(o,typeof i=="object"?i:null),s.namespace=r.join("."),s.rnamespace=s.namespace?new RegExp(`(^|\\.)${r.join("\\.(?:.*\\.|)")}(\\.|$)`):null,s.result=void 0,s.target||(s.target=a);const c=[s];Array.isArray(t)?c.push(...t):c.push(t);const h=mn(o);if(!n&&h.trigger&&h.trigger(a,s,t)===!1)return;let u;const d=[a];if(!n&&!h.noBubble&&!Oc(a)){u=h.delegateType||o;let m=a,p=a.parentNode;for(;p!=null;)d.push(p),m=p,p=p.parentNode;const b=a.ownerDocument||document;if(m===b){const y=m.defaultView||m.parentWindow||window;d.push(y)}}let f=a;for(let m=0,p=d.length;m<p&&!s.isPropagationStopped();m+=1){const b=d[m];f=b,s.type=m>1?u:h.bindType||o;const y=Jo(b);y&&y.events[s.type]&&y.handler&&y.handler.call(b,...c);const C=l&&b[l]||null;C&&jo(b)&&(s.result=C.call(b,...c),s.result===!1&&s.preventDefault())}if(s.type=o,!n&&!s.isDefaultPrevented()){const m=h.preventDefault;if((m==null||m(d.pop(),s,t)===!1)&&jo(a)&&l&&typeof a[o]=="function"&&!Oc(a)){const p=a[l];p&&(a[l]=null),Go=o,s.isPropagationStopped()&&f.addEventListener(o,Mc),a[o](),s.isPropagationStopped()&&f.removeEventListener(o,Mc),Go=void 0,p&&(a[l]=p)}}return s.result}class st{static on(t,e,n,s,o){return ti.on(t,e,n,s,o),t}static once(t,e,n,s,o){return ti.on(t,e,n,s,o,!0),t}static off(t,e,n,s){return ti.off(t,e,n,s),t}static trigger(t,e,n,s){return O6(e,n,t,s),t}}var ti;(function(i){function t(n,s,o,r,a,l){if(typeof s=="object"){typeof o!="string"&&(r=r||o,o=void 0),Object.keys(s).forEach(c=>t(n,c,o,r,s[c],l));return}if(r==null&&a==null?(a=o,r=o=void 0):a==null&&(typeof o=="string"?(a=r,r=void 0):(a=r,r=o,o=void 0)),a===!1)a=bn;else if(!a)return;if(l){const c=a;a=function(h,...u){return i.off(n,h),c.call(this,h,...u)},Pc(a,Ic(c))}I6(n,s,a,r,o)}i.on=t;function e(n,s,o,r){const a=s;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;e(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof s=="object"){const l=s;Object.keys(l).forEach(c=>e(n,c,o,l[c]));return}(o===!1||typeof o=="function")&&(r=o,o=void 0),r===!1&&(r=bn),Dc(n,s,r,o)}i.off=e})(ti||(ti={}));class Lc{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=cy("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(t){if(this.onWheelGuard!=null&&!this.onWheelGuard(t))return;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault();let e;(this.deltaX!==0||this.deltaY!==0)&&(t.stopPropagation(),e=!0),e===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function wn(i){const t=i.getBoundingClientRect(),e=i.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}}function N6(i){return i.getBoundingClientRect().width}function R6(i){return i.getBoundingClientRect().height}function D6(i){const t=is(i,"position")==="fixed";let e;if(t){const n=i.getBoundingClientRect();e={left:n.left,top:n.top}}else e=wn(i);if(!t){const n=i.ownerDocument;let s=i.offsetParent||n.documentElement;for(;(s===n.body||s===n.documentElement)&&is(s,"position")==="static";)s=s.parentNode;if(s!==i&&Oy(s)){const o=wn(s);e.top-=o.top+ss(s,"borderTopWidth"),e.left-=o.left+ss(s,"borderLeftWidth")}}return{top:e.top-ss(i,"marginTop"),left:e.left-ss(i,"marginLeft")}}function xe(i,t){const e=g6(i.x,i.y).matrixTransform(t);return new A(e.x,e.y)}function L6(i,t){return new z(xe(i.start,t),xe(i.end,t))}function qt(i,t){const n=ae("svg").createSVGPoint();n.x=i.x,n.y=i.y;const s=n.matrixTransform(t);n.x=i.x+i.width,n.y=i.y;const o=n.matrixTransform(t);n.x=i.x+i.width,n.y=i.y+i.height;const r=n.matrixTransform(t);n.x=i.x,n.y=i.y+i.height;const a=n.matrixTransform(t),l=Math.min(s.x,o.x,r.x,a.x),c=Math.max(s.x,o.x,r.x,a.x),h=Math.min(s.y,o.y,r.y,a.y),u=Math.max(s.y,o.y,r.y,a.y);return new I(l,h,c-l,u-h)}function Qc(i,t,e){let n=null;if(!i.ownerSVGElement)return new I(0,0,0,0);try{n=i.getBBox()}catch{n={x:i.clientLeft,y:i.clientTop,width:i.clientWidth,height:i.clientHeight}}return I.create(n)}function de(i,t={}){let e=null;if(!i.ownerSVGElement||!Ie(i)){if(ic(i)){const{left:r,top:a,width:l,height:c}=Vc(i);return new I(r,a,l,c)}return new I(0,0,0,0)}let s=t.target;if(!t.recursive){try{e=i.getBBox()}catch{e={x:i.clientLeft,y:i.clientTop,width:i.clientWidth,height:i.clientHeight}}if(!s)return I.create(e);const r=Ko(i,s);return qt(e,r)}{const r=i.childNodes,a=r.length;if(a===0)return de(i,{target:s});s||(s=i);let l=null;for(let c=0;c<a;c+=1){const h=r[c];let u=null;h.childNodes.length===0?u=de(h,{target:s}):u=de(h,{target:s,recursive:!0}),l?l=l.union(u):l=I.create(u)}return l||new I(0,0,0,0)}}function Vc(i){let t=0,e=0,n=0,s=0;if(i){let o=i;for(;o;)t+=o.offsetLeft,e+=o.offsetTop,o=o.offsetParent,o&&(t+=parseInt(uc(o,"borderLeft"),10),e+=parseInt(uc(o,"borderTop"),10));n=i.offsetWidth,s=i.offsetHeight}return{left:t,top:e,width:n,height:s}}function zc(i){const t=e=>{const n=i.getAttribute(e),s=n?parseFloat(n):0;return Number.isNaN(s)?0:s};switch(i instanceof SVGElement&&i.nodeName.toLowerCase()){case"rect":return new I(t("x"),t("y"),t("width"),t("height"));case"circle":return new Kt(t("cx"),t("cy"),t("r"),t("r"));case"ellipse":return new Kt(t("cx"),t("cy"),t("rx"),t("ry"));case"polyline":{const e=as(i);return new xt(e)}case"polygon":{const e=as(i);return e.length>1&&e.push(e[0]),new xt(e)}case"path":{let e=i.getAttribute("d");return wy(e)||(e=Xl(e)),j.parse(e)}case"line":return new z(t("x1"),t("y1"),t("x2"),t("y2"))}return de(i)}function Q6(i){if(i==null)return null;let t=i;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),ue(t,"x6-port"))t=t.nextElementSibling;else if(e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}function V6(i){const t=Q6(i);if(!Ie(t)){if(ic(i)){const{left:s,top:o,width:r,height:a}=Vc(i);return new I(s,o,r,a)}return new I(0,0,0,0)}return zc(t).bbox()||I.create()}const z6=(i,t)=>i-t;class F6{constructor(t={}){this.comparator=t.comparator||z6,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(t,e,n){const s={priority:t,value:e},o=this.data.length;return n&&(s.id=n,this.index[n]=o),this.data.push(s),this.bubbleUp(o),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if(typeof n>"u")throw new Error(`Node with id '${t}' was not found in the heap.`);const s=this.data,o=s[n].priority,r=this.comparator(e,o);r<0?(s[n].priority=e,this.bubbleUp(n)):r>0&&(s[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return e!=null&&e.id&&delete this.index[e.id],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,s,o=t;for(;o>0&&(s=o-1>>>1,this.comparator(e[o].priority,e[s].priority)<0);){n=e[s],e[s]=e[o];let r=e[o].id;r!=null&&(this.index[r]=s),e[o]=n,r=e[o].id,r!=null&&(this.index[r]=o),o=s}}bubbleDown(t){const e=this.data,n=e.length-1;let s=t;for(;;){const o=(s<<1)+1,r=o+1;let a=s;if(o<=n&&this.comparator(e[o].priority,e[a].priority)<0&&(a=o),r<=n&&this.comparator(e[r].priority,e[a].priority)<0&&(a=r),a!==s){const l=e[a];e[a]=e[s];let c=e[s].id;c!=null&&(this.index[c]=a),e[s]=l,c=e[s].id,c!=null&&(this.index[c]=s),s=a}else break}}}function U6(i,t,e=(n,s)=>1){const n={},s={},o={},r=new F6;for(n[t]=0,Object.keys(i).forEach(a=>{a!==t&&(n[a]=1/0),r.insert(n[a],a,a)});!r.isEmpty();){const a=r.remove();o[a]=!0;const l=i[a];for(let c=0;c<l.length;c+=1){const h=l[c];if(!o[h]){const u=n[a]+e(a,h);u<n[h]&&(n[h]=u,s[h]=a,r.updatePriority(h,u))}}}return s}const ei=/(-?(?:\d*\.\d+|\d+))\s*(px|em|rem|ch|vh|vw|vmin|vmax|%|cm|mm|in|pt|pc|ex|fr|deg|rad|turn)$/,Fc=(i,t)=>{const e=t-i;return n=>i+e*n},Uc=(i,t)=>{const e=ei,n=e.exec(i),s=e.exec(t),o=s?s[1]:"",r=n?+n[1]:0,a=s?+s[1]:0,l=o.indexOf("."),c=l>0?o[1].length-l-1:0,h=a-r,u=n?n[2]:"";return d=>(r+h*d).toFixed(c)+u},K6=(i,t)=>{const e=parseInt(i.slice(1),16),n=parseInt(t.slice(1),16),s=e&255,o=(n&255)-s,r=e&65280,a=(n&65280)-r,l=e&16711680,c=(n&16711680)-l;return h=>{const u=s+o*h&255,d=r+a*h&65280,f=l+c*h&16711680;return`#${(1<<24|u|d|f).toString(16).slice(1)}`}},J6=(i,t)=>{const e=o=>{const r=[];if(!o)return r;const a=/(\w+)\(([^)]+)\)/g;let l=a.exec(o);for(;l!==null;)l[1]&&l[2]&&r.push({name:l[1],values:l[2].split(/\s*,\s*/).filter(Boolean)}),l=a.exec(o);return r},n=e(i),s=e(t);return n.length===0||s.length===0?()=>i:o=>{const r=[];for(let a=0;a<Math.min(n.length,s.length);a++){const l=n[a],c=s[a];if(!(!l||!c)&&l.name===c.name&&l.values.length>0&&l.values.length===c.values.length){const h=[];for(let u=0;u<l.values.length;u++){const d=l.values[u],f=c.values[u];if(!(d===void 0||f===void 0))if(ei.test(d)||ei.test(f)){const m=Uc(d,f);h.push(m(o))}else if(!Number.isNaN(parseFloat(d))&&!Number.isNaN(parseFloat(f))){const m=Fc(parseFloat(d),parseFloat(f));h.push(m(o).toString())}else h.push(d)}h.length>0&&r.push(`${l.name}(${h.join(", ")})`)}}return r.length>0?r.join(" "):i}},Kc=i=>i,j6=i=>i*i,G6=i=>i*i*i,Y6=i=>{if(i<=0)return 0;if(i>=1)return 1;const t=i*i,e=t*i;return 4*(i<.5?e:3*(i-t)+e-.75)},H6=i=>Math.pow(2,10*(i-1)),_6=i=>{for(let t=0,e=1;;t+=e,e/=2)if(i>=(7-4*t)/11){const n=(11-6*t-11*i)/4;return-n*n+e*e}},W6={reverse(i){return t=>1-i(1-t)},reflect(i){return t=>.5*(t<.5?i(2*t):2-i(2-2*t))},clamp(i,t=0,e=1){return n=>{const s=i(n);return s<t?t:s>e?e:s}},back(i=1.70158){return t=>t*t*((i+1)*t-i)},elastic(i=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*i/3*t)}};function q6(i){return-1*Math.cos(i*(Math.PI/2))+1}function X6(i){return Math.sin(i*(Math.PI/2))}function $6(i){return-.5*(Math.cos(Math.PI*i)-1)}function Z6(i){return i*i}function t2(i){return i*(2-i)}function e2(i){return i<.5?2*i*i:-1+(4-2*i)*i}function n2(i){return i*i*i}function i2(i){const t=i-1;return t*t*t+1}function s2(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1}function o2(i){return i*i*i*i}function r2(i){const t=i-1;return 1-t*t*t*t}function a2(i){const t=i-1;return i<.5?8*i*i*i*i:1-8*t*t*t*t}function l2(i){return i*i*i*i*i}function c2(i){const t=i-1;return 1+t*t*t*t*t}function h2(i){const t=i-1;return i<.5?16*i*i*i*i*i:1+16*t*t*t*t*t}function u2(i){return i===0?0:Math.pow(2,10*(i-1))}function d2(i){return i===1?1:-Math.pow(2,-10*i)+1}function g2(i){if(i===0||i===1)return i;const t=i*2,e=t-1;return t<1?.5*Math.pow(2,10*e):.5*(-Math.pow(2,-10*e)+2)}function f2(i){const t=i/1;return-1*(Math.sqrt(1-t*i)-1)}function p2(i){const t=i-1;return Math.sqrt(1-t*t)}function m2(i){const t=i*2,e=t-2;return t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-e*e)+1)}function b2(i,t=1.70158){return i*i*((t+1)*i-t)}function y2(i,t=1.70158){const e=i/1-1;return e*e*((t+1)*e+t)+1}function w2(i,t=1.70158){const e=i*2,n=e-2,s=t*1.525;return e<1?.5*e*e*((s+1)*e-s):.5*(n*n*((s+1)*n+s)+2)}function C2(i,t=.7){if(i===0||i===1)return i;const n=i/1-1,s=1-t,o=s/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-o)*(2*Math.PI)/s))}function A2(i,t=.7){const e=1-t,n=i*2;if(i===0||i===1)return i;const s=e/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/e)+1}function x2(i,t=.65){const e=1-t;if(i===0||i===1)return i;const n=i*2,s=n-1,o=e/(2*Math.PI)*Math.asin(1);return n<1?-.5*(Math.pow(2,10*s)*Math.sin((s-o)*(2*Math.PI)/e)):Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/e)*.5+1}function Yo(i){const t=i/1;if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const e=t-.5454545454545454;return 7.5625*e*e+.75}if(t<2.5/2.75){const e=t-.8181818181818182;return 7.5625*e*e+.9375}{const e=t-.9545454545454546;return 7.5625*e*e+.984375}}function Jc(i){return 1-Yo(1-i)}function v2(i){return i<.5?Jc(i*2)*.5:Yo(i*2-1)*.5+.5}const E2=Object.freeze(Object.defineProperty({__proto__:null,bounce:_6,cubic:G6,decorators:W6,easeInBack:b2,easeInBounce:Jc,easeInCirc:f2,easeInCubic:n2,easeInElastic:C2,easeInExpo:u2,easeInOutBack:w2,easeInOutBounce:v2,easeInOutCirc:m2,easeInOutCubic:s2,easeInOutElastic:x2,easeInOutExpo:g2,easeInOutQuad:e2,easeInOutQuart:a2,easeInOutQuint:h2,easeInOutSine:$6,easeInQuad:Z6,easeInQuart:o2,easeInQuint:l2,easeInSine:q6,easeOutBack:y2,easeOutBounce:Yo,easeOutCirc:p2,easeOutCubic:i2,easeOutElastic:A2,easeOutExpo:d2,easeOutQuad:t2,easeOutQuart:r2,easeOutQuint:c2,easeOutSine:X6,exponential:H6,inout:Y6,linear:Kc,quad:j6},Symbol.toStringTag,{value:"Module"}));function Ho(i,t){const e=[];for(let n=0;n<i.length;n+=2){const s=i[n],o=i[n+1],r=Array.isArray(t)?t:[t],a=Kl(s,o,r);e.push(a)}return Ao(e)}class S2{constructor(){this.listeners={}}on(t,e,n){return e==null?this:(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,n),this)}once(t,e,n){const s=(...o)=>(this.off(t,s),Ho([e,n],o));return this.on(t,s,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const s=this.listeners;return(t?[t]:Object.keys(s)).forEach(r=>{const a=s[r];if(a){if(!(e||n)){delete s[r];return}for(let l=a.length-2;l>=0;l-=2)e&&a[l]!==e||n&&a[l+1]!==n||a.splice(l,2)}}),this}trigger(t,...e){let n=!0;if(t!=="*"){const o=this.listeners[t];o!=null&&(n=Ho([...o],e))}const s=this.listeners["*"];return s!=null?Ao([n,Ho([...s],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}class Cn{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}function $(){return(i,t,e)=>{const n=e.value,s=i.__proto__;e.value=function(...o){this.disposed||(n.call(this,...o),s.dispose.call(this))}}}class zt extends S2{dispose(){this.off()}}X([$()],zt.prototype,"dispose",null),Hy(zt,Cn);class _o{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach(e=>{const n=this.map.get(e);t(n,e)})}dispose(){this.clear()}}function Wo(i){const t=[],e=[];return Array.isArray(i)?t.push(...i):i.split("|").forEach(n=>{n.indexOf("&")===-1?t.push(n):e.push(...n.split("&"))}),{or:t,and:e}}function M2(i,t){if(i!=null&&t!=null){const e=Wo(i),n=Wo(t),s=e.or.sort(),o=n.or.sort(),r=e.and.sort(),a=n.and.sort(),l=(c,h)=>c.length===h.length&&(c.length===0||c.every((u,d)=>u===h[d]));return l(s,o)&&l(r,a)}return i==null&&t==null}function Pe(i,t,e){if(t==null||Array.isArray(t)&&t.length===0)return e?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:n,and:s}=Wo(t),o=r=>{const a=`${r.toLowerCase()}Key`;return i[a]===!0};return n.some(r=>o(r))&&s.every(r=>o(r))}class bt{static create(t){return new bt(t)}constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if(typeof t=="object"){Object.entries(t).forEach(([r,a])=>{this.register(r,a,e)});return}this.exist(t)&&!n&&!Fl()&&this.onDuplicated(t);const s=this.options.process,o=s?F(s,this,t,e):e;return this.data[t]=o,o}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return t?this.data[t]!=null:!1}onDuplicated(t){try{throw this.options.onConflict&&F(this.options.onConflict,this,t),new Error(`${Gi(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),s=e?`${e} ${Pb(this.options.type)}`:this.options.type;return`${Gi(s)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return Ky(t,Object.keys(this.data),e=>e)}}const B2={},jc={position:us("x","width","origin")},Gc={position:us("y","height","origin")},k2={position:us("x","width","corner")},T2={position:us("y","height","corner")},Yc={set:Oe("width","width")},Hc={set:Oe("height","height")},I2={set:Oe("rx","width")},P2={set:Oe("ry","height")},_c={set:(i=>{const t=Oe(i,"width"),e=Oe(i,"height");return function(n,s){const o=s.refBBox,r=o.height>o.width?t:e;return F(r,this,n,s)}})("r")},O2={set(i,{refBBox:t}){let e=parseFloat(i);const n=Ce(i);n&&(e/=100);const s=Math.sqrt(t.height*t.height+t.width*t.width);let o;return Number.isFinite(e)&&(n||e>=0&&e<=1?o=e*s:o=Math.max(e+s,0)),{r:o}}},N2={set:Oe("cx","width")},R2={set:Oe("cy","height")},Wc={set:$c({resetOffset:!0})},D2={set:$c({resetOffset:!1})},qc={set:Zc({resetOffset:!0})},L2={set:Zc({resetOffset:!1})},Q2=_c,V2=Wc,z2=qc,F2=jc,U2=Gc,K2=Yc,J2=Hc;function us(i,t,e){return(n,{refBBox:s})=>{if(n==null)return null;let o=parseFloat(n);const r=Ce(n);r&&(o/=100);let a;if(Number.isFinite(o)){const c=s[e];r||o>0&&o<1?a=c[i]+s[t]*o:a=c[i]+o}const l=new A;return l[i]=a||0,l}}function Oe(i,t){return(e,{refBBox:n})=>{let s=parseFloat(e);const o=Ce(e);o&&(s/=100);const r={};if(Number.isFinite(s)){const a=o||s>=0&&s<=1?s*n[t]:Math.max(s+n[t],0);r[i]=a}return r}}function Xc(i,t){const e="x6-shape",n=t&&t.resetOffset;return(s,{elem:o,refBBox:r})=>{let a=Ge(o,e);if(!a||a.value!==s){const p=i(s);a={value:s,shape:p,shapeBBox:p.bbox()},Ge(o,e,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),h=c.getOrigin(),u=r.getOrigin();c.x=u.x,c.y=u.y;const d=r.getMaxScaleToFit(c,u),f=c.width===0||r.width===0?1:d.sx,m=c.height===0||r.height===0?1:d.sy;return l.scale(f,m,h),n&&l.translate(-h.x,-h.y),l}}function $c(i){function t(n){return j.parse(n)}const e=Xc(t,i);return(n,s)=>({d:e(n,s).serialize()})}function Zc(i){const t=Xc(e=>new xt(e),i);return(e,n)=>({points:t(e,n).serialize()})}const j2={qualify:ne,set(i,{view:t}){return`url(#${t.graph.defineGradient(i)})`}},G2={qualify:ne,set(i,{view:t}){const e=t.cell,n=Object.assign({},i);if(e.isEdge()&&n.type==="linearGradient"){const s=t,o=s.sourcePoint,r=s.targetPoint;n.id=`gradient-${n.type}-${e.id}`,n.attrs=Object.assign(Object.assign({},n.attrs),{x1:o.x,y1:o.y,x2:r.x,y2:r.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(n.id)}return`url(#${t.graph.defineGradient(n)})`}},th={qualify(i,{attrs:t}){return t.textWrap==null||!ne(t.textWrap)},set(i,{view:t,elem:e,attrs:n}){const s="x6-text",o=Ge(e,s),r=h=>{try{return JSON.parse(h)}catch{return h}},a={x:n.x,eol:n.eol,annotations:r(n.annotations),textPath:r(n["text-path"]||n.textPath),textVerticalAnchor:n["text-vertical-anchor"]||n.textVerticalAnchor,displayEmpty:(n["display-empty"]||n.displayEmpty)==="true",lineHeight:n["line-height"]||n.lineHeight},l=n["font-size"]||n.fontSize,c=JSON.stringify([i,a]);if(l&&e.setAttribute("font-size",l),o==null||o!==c){const h=a.textPath;if(h!=null&&typeof h=="object"){const u=h.selector;if(typeof u=="string"){const d=t.find(u)[0];d instanceof SVGPathElement&&(So(d),a.textPath=Object.assign({"xlink:href":`#${d.id}`},h))}}mc(e,`${i}`,a),Ge(e,s,c)}}},Y2={qualify:ne,set(i,{view:t,elem:e,attrs:n,refBBox:s}){const o=i,r=o.width||0;Ce(r)?s.width*=parseFloat(r)/100:r<=0?s.width+=r:s.width=r;const a=o.height||0;Ce(a)?s.height*=parseFloat(a)/100:a<=0?s.height+=a:s.height=a;let l,c=o.text;c==null&&(c=n.text||(e==null?void 0:e.textContent)),c!=null?l=yc(`${c}`,s,{"font-weight":n["font-weight"]||n.fontWeight,"font-size":n["font-size"]||n.fontSize,"font-family":n["font-family"]||n.fontFamily,lineHeight:n.lineHeight},{ellipsis:o.ellipsis}):l="",F(th.set,this,l,{view:t,elem:e,attrs:n,refBBox:s,cell:t.cell})}},An=(i,{attrs:t})=>t.text!==void 0,H2={qualify:An},_2={qualify:An},W2={qualify:An},q2={qualify:An},X2={qualify:An},$2={qualify:An},Z2={qualify(i,{elem:t}){return t instanceof SVGElement},set(i,{elem:t}){const e="x6-title",n=`${i}`,s=Ge(t,e);if(s==null||s!==n){Ge(t,e,n);const o=t.firstChild;if(o&&o.tagName.toUpperCase()==="TITLE"){const r=o;r.textContent=n}else{const r=document.createElementNS(t.namespaceURI,"title");r.textContent=n,t.insertBefore(r,o)}}}},t3={offset:eh("x","width","right")},e3={offset:eh("y","height","bottom")},n3={offset(i,{refBBox:t}){return i?{x:-t.x,y:-t.y}:{x:0,y:0}}};function eh(i,t,e){return(n,{refBBox:s})=>{const o=new A;let r;return n==="middle"?r=s[t]/2:n===e?r=s[t]:typeof n=="number"&&Number.isFinite(n)?r=n>-1&&n<1?-s[t]*n:-n:Ce(n)?r=s[t]*parseFloat(n)/100:r=0,o[i]=-(s[i]+r),o}}const i3={qualify:ne,set(i,{elem:t}){nt(t,i)}},s3={set(i,{elem:t}){t.innerHTML=`${i}`}},o3={qualify:ne,set(i,{view:t}){return`url(#${t.graph.defineFilter(i)})`}},r3={set(i){return i!=null&&typeof i=="object"&&i.id?i.id:i}},a3=i=>{var{size:t,width:e,height:n,offset:s,open:o}=i,r=_(i,["size","width","height","offset","open"]);return nh({size:t,width:e,height:n,offset:s},o===!0,!0,void 0,r)},l3=i=>{var{size:t,width:e,height:n,offset:s,factor:o}=i,r=_(i,["size","width","height","offset","factor"]);return nh({size:t,width:e,height:n,offset:s},!1,!1,o,r)};function nh(i,t,e,n=3/4,s={}){const o=i.size||10,r=i.width||o,a=i.height||o,l=new j,c={};if(t)l.moveTo(r,0).lineTo(0,a/2).lineTo(r,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(r,0),!e){const h=Je(n,0,1);l.lineTo(r*h,a/2)}l.lineTo(r,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),s),{tagName:"path",d:un(l.serialize(),{x:i.offset!=null?i.offset:-r/2})})}const c3=i=>{var{size:t,width:e,height:n,offset:s}=i,o=_(i,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new j;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},o),{tagName:"path",d:un(c.serialize(),s??-a/2)})},h3=i=>{var{d:t,offsetX:e,offsetY:n}=i,s=_(i,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},s),{tagName:"path",d:un(t,e,n)})},u3=i=>{var{size:t,width:e,height:n,offset:s}=i,o=_(i,["size","width","height","offset"]);const r=t||10,a=e||r,l=n||r,c=new j;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:un(c.serialize(),s||-a/2)})},d3=i=>{var{width:t,height:e,offset:n,open:s,flip:o}=i,r=_(i,["width","height","offset","open","flip"]);let a=e||6;const l=t||10,c=s===!0,h=o===!0,u=Object.assign(Object.assign({},r),{tagName:"path"});h&&(a=-a);const d=new j;return d.moveTo(0,a).lineTo(l,0),c?u.fill="none":(d.lineTo(l,a),d.close()),u.d=un(d.serialize(),{x:n||-l/2,y:a/2}),u},ih=i=>{var{r:t}=i,e=_(i,["r"]);const n=t||5;return Object.assign(Object.assign({cx:n},e),{tagName:"circle",r:n})},g3=Object.freeze(Object.defineProperty({__proto__:null,async:d3,block:a3,circle:ih,circlePlus:i=>{var{r:t}=i,e=_(i,["r"]);const n=t||5,s=new j;return s.moveTo(n,0).lineTo(n,n*2),s.moveTo(0,n).lineTo(n*2,n),{children:[Object.assign(Object.assign({},ih({r:n})),{fill:"none"}),Object.assign(Object.assign({},e),{tagName:"path",d:un(s.serialize(),-n)})]}},classic:l3,cross:u3,diamond:c3,ellipse:i=>{var{rx:t,ry:e}=i,n=_(i,["rx","ry"]);const s=t||5,o=e||5;return Object.assign(Object.assign({cx:s},n),{tagName:"ellipse",rx:s,ry:o})},path:h3},Symbol.toStringTag,{value:"Module"})),ni=bt.create({type:"marker"});ni.register(g3,!0);function qo(i){return typeof i=="string"||ne(i)}const f3={qualify:qo,set(i,{view:t,attrs:e}){return Xo("marker-start",i,t,e)}},p3={qualify:qo,set(i,{view:t,attrs:e}){return Xo("marker-end",i,t,e,{transform:"rotate(180)"})}},m3={qualify:qo,set(i,{view:t,attrs:e}){return Xo("marker-mid",i,t,e)}};function Xo(i,t,e,n,s={}){const o=typeof t=="string"?{name:t}:t,{name:r,args:a}=o,l=_(o,["name","args"]);let c=l;if(r&&typeof r=="string"){const u=ni.get(r);if(u)c=u(Object.assign(Object.assign({},l),a));else return ni.onNotFound(r)}const h=Object.assign(Object.assign(Object.assign({},b3(n,i)),s),c);return{[i]:`url(#${e.graph.defineMarker(h)})`}}function b3(i,t){const e={},n=i.stroke;if(typeof n=="string"&&(e.stroke=n,e.fill=n),t!=="marker-mid"){const s=parseFloat(i.strokeWidth||i["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);e.refX=t==="marker-start"?o:-o}}return e}const ii=(i,{view:t})=>t.cell.isEdge(),y3={qualify:ii,set(i,t){var e,n,s,o;const r=t.view,a=i.reverse||!1,l=i.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let h,u;const d=r.getConnectionLength()||0;l<0?(h=(d+l)/2,u=-l):(h=l,u=d-l*2);const f=r.getConnection();c=(o=(s=(n=(e=f==null?void 0:f.divideAtLength(h))===null||e===void 0?void 0:e[1])===null||n===void 0?void 0:n.divideAtLength(u))===null||s===void 0?void 0:s[0])===null||o===void 0?void 0:o.serialize()}else{let h;l<0?h=((r.getConnectionLength()||0)+l)/2:h=l;const u=r.getConnection();if(u){const d=u.divideAtLength(h),f=u.divideAtLength(-h);d&&f&&(c=`${d[0].serialize()} ${f[1].serialize()}`)}}return{d:c||r.getConnectionPathData()}}},sh={qualify:ii,set:ds("getTangentAtLength",{rotate:!0})},w3={qualify:ii,set:ds("getTangentAtLength",{rotate:!1})},oh={qualify:ii,set:ds("getTangentAtRatio",{rotate:!0})},C3={qualify:ii,set:ds("getTangentAtRatio",{rotate:!1})},A3=sh,x3=oh;function ds(i,t){const e={x:1,y:0};return(n,s)=>{let o,r;const a=s.view,l=a[i](Number(n));return l?(r=t.rotate?l.vector().vectorAngle(e):0,o=l.start):(o=a.path.start,r=0),r===0||Number.isNaN(r)?{transform:`translate(${o.x},${o.y})`}:{transform:`translate(${o.x},${o.y}) rotate(${r})`}}}const v3=Object.freeze(Object.defineProperty({__proto__:null,annotations:q2,atConnectionLength:A3,atConnectionLengthIgnoreGradient:w3,atConnectionLengthKeepGradient:sh,atConnectionRatio:x3,atConnectionRatioIgnoreGradient:C3,atConnectionRatioKeepGradient:oh,connection:y3,displayEmpty:$2,eol:X2,fill:j2,filter:o3,html:s3,lineHeight:H2,port:r3,ref:B2,refCx:N2,refCy:R2,refD:V2,refDKeepOffset:D2,refDResetOffset:Wc,refDx:k2,refDy:T2,refHeight:Hc,refHeight2:J2,refPoints:z2,refPointsKeepOffset:L2,refPointsResetOffset:qc,refR:Q2,refRCircumscribed:O2,refRInscribed:_c,refRx:I2,refRy:P2,refWidth:Yc,refWidth2:K2,refX:jc,refX2:F2,refY:Gc,refY2:U2,resetOffset:n3,sourceMarker:f3,stroke:G2,style:i3,targetMarker:p3,text:th,textPath:W2,textVerticalAnchor:_2,textWrap:Y2,title:Z2,vertexMarker:m3,xAlign:t3,yAlign:e3},Symbol.toStringTag,{value:"Module"})),E3={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"};function S3(i,t,e){return!!(i!=null&&(typeof i=="string"||typeof i.qualify!="function"||F(i.qualify,this,t,e)))}const rh=Object.assign(Object.assign({},E3),v3),si=bt.create({type:"attribute definition"});si.register(rh,!0);const ah=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=e*2,t.height=n;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.translate(2*e,0),s.scale(-1,1),s.drawImage(i,0,0,e,n),t},lh=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=e,t.height=n*2;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.translate(0,2*n),s.scale(1,-1),s.drawImage(i,0,0,e,n),t},ch=i=>{const t=document.createElement("canvas"),e=i.width,n=i.height;t.width=2*e,t.height=2*n;const s=t.getContext("2d");return s.drawImage(i,0,0,e,n),s.setTransform(-1,0,0,-1,t.width,t.height),s.drawImage(i,0,0,e,n),s.setTransform(-1,0,0,1,t.width,0),s.drawImage(i,0,0,e,n),s.setTransform(1,0,0,-1,0,t.height),s.drawImage(i,0,0,e,n),t},gs=Object.assign({},Object.freeze(Object.defineProperty({__proto__:null,flipX:ah,flipXY:ch,flipY:lh,watermark:(i,t)=>{const e=i.width,n=i.height,s=document.createElement("canvas");s.width=e*3,s.height=n*3;const o=s.getContext("2d"),r=t.angle!=null?-t.angle:-20,a=Rt(r),l=s.width/4,c=s.height/4;for(let h=0;h<4;h+=1)for(let u=0;u<4;u+=1)(h+u)%2>0&&(o.setTransform(1,0,0,1,(2*h-1)*l,(2*u-1)*c),o.rotate(a),o.drawImage(i,-e/2,-n/2,e,n));return s}},Symbol.toStringTag,{value:"Module"})));gs["flip-x"]=ah,gs["flip-y"]=lh,gs["flip-xy"]=ch;const fs=bt.create({type:"background pattern"});fs.register(gs,!0);function ps(i,t,e){let n;if(typeof e=="object"){if(Number.isFinite(e.y)){const o=new z(t,i),{start:r,end:a}=o.parallel(e.y);t=r,i=a}n=e.x}else n=e;if(n==null||!Number.isFinite(n))return i;const s=i.distance(t);return n===0&&s>0?i:i.move(t,-Math.min(n,s-1))}function ms(i){const t=i.getAttribute("stroke-width");return t===null?0:parseFloat(t)||0}function M3(i){if(i==null)return null;let t=i;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}const hh=(i,t,e,n)=>{const s=t.getBBoxOfElement(e);n.stroked&&s.inflate(ms(e)/2);const o=i.intersect(s),r=o&&o.length?i.start.closest(o):i.end;return ps(r,i.start,n.offset)},B3=function(i,t,e,n,s){const o=t.cell,r=o.isNode()?o.getAngle():0;if(r===0)return F(hh,this,i,t,e,n,s);const a=t.getUnrotatedBBoxOfElement(e);n.stroked&&a.inflate(ms(e)/2);const l=a.getCenter(),c=i.clone().rotate(r,l),h=c.setLength(1e6).intersect(a),u=h&&h.length?c.start.closest(h).rotate(-r,l):i.end;return ps(u,i.start,n.offset)},k3=(i,t,e,n)=>{let s,o;const r=i.end,a=n.selector;if(typeof a=="string"?s=t.findOne(a):Array.isArray(a)?s=Vo(e,a):s=M3(e),!Ie(s)){if(s===e||!Ie(e))return r;s=e}const l=t.getShapeOfElement(s),c=t.getMatrixOfElement(s),h=t.getRootTranslatedMatrix(),u=t.getRootRotatedMatrix(),d=h.multiply(u).multiply(c),f=d.inverse(),m=L6(i,f),p=m.start.clone(),b=t.getDataOfElement(s);if(n.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const x=b.shapeBBox;if(x!=null&&x.containsPoint(p))return r}n.extrapolate===!0&&m.setLength(1e6);let y;if(j.isPath(l)){const x=n.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:x})),y={precision:x,segmentSubdivisions:b.segmentSubdivisions},o=m.intersect(l,y)}else o=m.intersect(l);o?Array.isArray(o)&&(o=p.closest(o)):n.sticky===!0&&(I.isRectangle(l)?o=l.getNearestPointToPoint(p):Kt.isEllipse(l)?o=l.intersectsWithLineFromCenterToPoint(p):o=l.closestPoint(p,y));const C=o?xe(o,d):r;let w=n.offset||0;return n.stroked!==!1&&(typeof w=="object"?(w=Object.assign({},w),w.x==null&&(w.x=0),w.x+=ms(s)/2):w+=ms(s)/2),ps(C,i.start,w)};function T3(i,t,e=0){const{start:n,end:s}=i;let o,r,a,l;switch(t){case"left":l="x",o=s,r=n,a=-1;break;case"right":l="x",o=n,r=s,a=1;break;case"top":l="y",o=s,r=n,a=-1;break;case"bottom":l="y",o=n,r=s,a=1;break;default:return}n[l]<s[l]?o[l]=r[l]:r[l]=o[l],Number.isFinite(e)&&(o[l]+=a*e,r[l]+=a*e)}const I3=Object.freeze(Object.defineProperty({__proto__:null,anchor:(i,t,e,n)=>{const{alignOffset:s,align:o}=n;return o&&T3(i,o,s),ps(i.end,i.start,n.offset)},bbox:hh,boundary:k3,rect:B3},Symbol.toStringTag,{value:"Module"})),oi=bt.create({type:"connection point"});oi.register(I3,!0);const uh=1,bs=1/3,ys=2/3;let ri=[],ws=[];function P3(i){let t=i.graph._jumpOverUpdateList;if(t==null&&(t=i.graph._jumpOverUpdateList=[],i.graph.on("cell:mouseup",()=>{const e=i.graph._jumpOverUpdateList;setTimeout(()=>{for(let n=0;n<e.length;n+=1)e[n].update()})}),i.graph.on("model:reseted",()=>{t=i.graph._jumpOverUpdateList=[]})),t.indexOf(i)<0){t.push(i);const e=()=>t.splice(t.indexOf(i),1);i.cell.once("change:connector",e),i.cell.once("removed",e)}}function $o(i,t,e=[]){const n=[i,...e,t],s=[];return n.forEach((o,r)=>{const a=n[r+1];a!=null&&s.push(new z(o,a))}),s}function O3(i,t){const e=[];return t.forEach(n=>{const s=i.intersectsWithLine(n);if(s){const{x:o,y:r}=s,{start:a,end:l}=n,c=Math.round(a.x)===Math.round(o)&&Math.round(a.y)===Math.round(r),h=Math.round(l.x)===Math.round(o)&&Math.round(l.y)===Math.round(r);if(c||h)return;e.push(s)}}),e}function dh(i,t){return new z(i,t).squaredLength()}function N3(i,t,e){return t.reduce((n,s,o)=>{if(ws.includes(s))return n;const r=n.pop()||i,a=A.create(s).move(r.start,-e);let l=A.create(s).move(r.start,+e);const c=t[o+1];if(c!=null){const d=l.distance(c);d<=e&&(l=c.move(r.start,d),ws.push(c))}else if(a.distance(r.end)<e*2+uh)return n.push(r),n;if(l.distance(r.start)<e*2+uh)return n.push(r),n;const u=new z(a,l);return ri.push(u),n.push(new z(r.start,a),u,new z(l,r.end)),n},[])}function gh(i,t,e,n){const s=new j;let o;return o=j.createSegment("M",i[0].start),s.appendSegment(o),i.forEach((r,a)=>{if(ri.includes(r)){let l,c,h,u;if(e==="arc"){l=-90,c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const f=r.getCenter(),m=new z(f,r.end).rotate(l,f);let p;p=new z(r.start,f),h=p.pointAt(2/3).rotate(l,r.start),u=m.pointAt(1/3).rotate(-l,m.end),o=j.createSegment("C",h,u,m.end),s.appendSegment(o),p=new z(f,r.end),h=m.pointAt(1/3).rotate(l,m.end),u=p.pointAt(1/3).rotate(-l,r.end),o=j.createSegment("C",h,u,r.end),s.appendSegment(o)}else if(e==="gap")o=j.createSegment("M",r.end),s.appendSegment(o);else if(e==="cubic"){l=r.start.theta(r.end);const d=t*.6;let f=t*1.35;c=r.start.diff(r.end),(c.x<0||c.x===0&&c.y<0)&&(f*=-1),h=new A(r.start.x+d,r.start.y+f).rotate(l,r.start),u=new A(r.end.x-d,r.end.y+f).rotate(l,r.end),o=j.createSegment("C",h,u,r.end),s.appendSegment(o)}}else{const l=i[a+1];n===0||!l||ri.includes(l)?(o=j.createSegment("L",r.end),s.appendSegment(o)):R3(n,s,r.end,r.start,l.end)}}),s}function R3(i,t,e,n,s){const o=e.distance(n)/2,r=e.distance(s)/2,a=-Math.min(i,o),l=-Math.min(i,r),c=e.clone().move(n,a).round(),h=e.clone().move(s,l).round(),u=new A(bs*c.x+ys*e.x,ys*e.y+bs*c.y),d=new A(bs*h.x+ys*e.x,ys*e.y+bs*h.y);let f;f=j.createSegment("L",c),t.appendSegment(f),f=j.createSegment("C",u,d,h),t.appendSegment(f)}const fh=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(i,t,e,n={}){ri=[],ws=[],P3(this);const s=n.size||5,o=n.type||"arc",r=n.radius||0,a=n.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return gh($o(i,t,e),s,o,r);const u=this.cell,d=h.indexOf(u),f=l.options.connecting.connector||{},m=h.filter((x,E)=>{const S=x.getConnector()||f;return a.includes(S.name)?!1:E>d?S.name!=="jumpover":!0}),p=m.map(x=>l.findViewByCell(x)),b=$o(i,t,e),y=p.map(x=>x==null?[]:x===this?b:$o(x.sourcePoint,x.targetPoint,x.routePoints)),C=[];b.forEach(x=>{const E=m.reduce((S,v,M)=>{if(v!==u){const k=O3(x,y[M]);S.push(...k)}return S},[]).sort((S,v)=>dh(x.start,S)-dh(x.start,v));E.length>0?C.push(...N3(x,E,s)):C.push(x)});const w=gh(C,s,o,r);return ri=[],ws=[],n.raw?w:w.serialize()},loop:(i,t,e,n={})=>{const s=e.length===3?0:1,o=A.create(e[0+s]),r=A.create(e[2+s]),a=A.create(e[1+s]);if(!A.equals(i,t)){const c=new A((i.x+t.x)/2,(i.y+t.y)/2),h=c.angleBetween(A.create(i).rotate(90,c),a);h>1&&(o.rotate(180-h,c),r.rotate(180-h,c),a.rotate(180-h,c))}const l=`
|
|
5
|
+
M ${i.x} ${i.y}
|
|
6
6
|
Q ${o.x} ${o.y} ${a.x} ${a.y}
|
|
7
7
|
Q ${r.x} ${r.y} ${t.x} ${t.y}
|
|
8
|
-
`;return n.raw?
|
|
8
|
+
`;return n.raw?j.parse(l):l},normal:(i,t,e,n={})=>{const s=[i,...e,t],o=new xt(s),r=new j(o);return n.raw?r:r.serialize()},rounded:(i,t,e,n={})=>{const s=new j;s.appendSegment(j.createSegment("M",i));const o=1/3,r=2/3,a=n.radius||10;let l,c;for(let h=0,u=e.length;h<u;h+=1){const d=A.create(e[h]),f=e[h-1]||i,m=e[h+1]||t;l=c||d.distance(f)/2,c=d.distance(m)/2;const p=-Math.min(a,l),b=-Math.min(a,c),y=d.clone().move(f,p).round(),C=d.clone().move(m,b).round(),w=new A(o*y.x+r*d.x,r*d.y+o*y.y),x=new A(o*C.x+r*d.x,r*d.y+o*C.y);s.appendSegment(j.createSegment("L",y)),s.appendSegment(j.createSegment("C",w,x,C))}return s.appendSegment(j.createSegment("L",t)),n.raw?s:s.serialize()},smooth:(i,t,e,n={})=>{let s,o=n.direction;if(e&&e.length!==0){const r=[i,...e,t],a=wt.throughPoints(r);s=new j(a)}else if(s=new j,s.appendSegment(j.createSegment("M",i)),o||(o=Math.abs(i.x-t.x)>=Math.abs(i.y-t.y)?"H":"V"),o==="H"){const r=(i.x+t.x)/2;s.appendSegment(j.createSegment("C",r,i.y,r,t.y,t.x,t.y))}else{const r=(i.y+t.y)/2;s.appendSegment(j.createSegment("C",i.x,r,t.x,r,t.x,t.y))}return n.raw?s:s.serialize()}},Symbol.toStringTag,{value:"Module"})),ai=bt.create({type:"connector"});ai.register(fh,!0);function Cs(i){return function(t,e,n,s){if(n instanceof Element){const o=this.graph.findViewByElem(n);let r;if(o)if(o.isEdgeElement(n)){const a=s.fixedAt!=null?s.fixedAt:"50%";r=ph(o,a)}else r=o.getBBoxOfElement(n).getCenter();else r=new A;return i.call(this,t,e,r,s)}return i.apply(this,arguments)}}function ph(i,t){const e=Ce(t),n=typeof t=="string"?parseFloat(t):t;return e?i.getPointAtRatio(n/100):i.getPointAtLength(n)}const mh=(i,t,e,n)=>{const s=i.getClosestPoint(e);return s??new A},D3=Cs(mh),L3=(i,t,e,n)=>{const s=n.length!=null?n.length:20;return i.getPointAtLength(s)},Q3=Cs(function(i,t,e,n){const o=i.getConnection(),r=i.getConnectionSubdivisions(),a=new z(e.clone().translate(0,1e6),e.clone().translate(0,-1e6)),l=new z(e.clone().translate(1e6,0),e.clone().translate(-1e6,0)),c=a.intersect(o,{segmentSubdivisions:r}),h=l.intersect(o,{segmentSubdivisions:r}),u=[];return c&&u.push(...c),h&&u.push(...h),u.length>0?e.closest(u):n.fallbackAt!=null?ph(i,n.fallbackAt):F(mh,this,i,t,e,n)}),V3=Object.freeze(Object.defineProperty({__proto__:null,closest:D3,length:L3,orth:Q3,ratio:(i,t,e,n)=>{let s=n.ratio!=null?n.ratio:.5;return s>1&&(s/=100),i.getPointAtRatio(s)}},Symbol.toStringTag,{value:"Module"})),li=bt.create({type:"edge endpoint"});li.register(V3,!0);function Zo(i,t){return i??t}function St(i,t){return i!=null&&Number.isFinite(i)?i:t}function z3(i={}){const t=Zo(i.color,"blue"),e=St(i.width,1),n=St(i.margin,2),s=St(i.opacity,1),o=n,r=n+e;return`
|
|
9
9
|
<filter>
|
|
10
|
-
<feFlood flood-color="${t}" flood-opacity="${
|
|
10
|
+
<feFlood flood-color="${t}" flood-opacity="${s}" result="colored"/>
|
|
11
11
|
<feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${r}" />
|
|
12
12
|
<feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${o}" />
|
|
13
13
|
<feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>
|
|
@@ -17,22 +17,22 @@
|
|
|
17
17
|
<feMergeNode in="SourceGraphic"/>
|
|
18
18
|
</feMerge>
|
|
19
19
|
</filter>
|
|
20
|
-
`.trim()}function
|
|
20
|
+
`.trim()}function F3(i={}){const t=Zo(i.color,"red"),e=St(i.blur,0),n=St(i.width,1),s=St(i.opacity,1);return`
|
|
21
21
|
<filter>
|
|
22
|
-
<feFlood flood-color="${t}" flood-opacity="${
|
|
22
|
+
<feFlood flood-color="${t}" flood-opacity="${s}" result="colored"/>
|
|
23
23
|
<feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${n}"/>
|
|
24
24
|
<feComposite result="composed" in="colored" in2="morphed" operator="in"/>
|
|
25
25
|
<feGaussianBlur result="blured" in="composed" stdDeviation="${e}"/>
|
|
26
26
|
<feBlend in="SourceGraphic" in2="blured" mode="normal"/>
|
|
27
27
|
</filter>
|
|
28
|
-
`.trim()}function
|
|
28
|
+
`.trim()}function U3(i={}){const t=St(i.x,2);return`
|
|
29
29
|
<filter>
|
|
30
|
-
<feGaussianBlur stdDeviation="${
|
|
30
|
+
<feGaussianBlur stdDeviation="${i.y!=null&&Number.isFinite(i.y)?[t,i.y]:t}"/>
|
|
31
31
|
</filter>
|
|
32
|
-
`.trim()}function
|
|
33
|
-
<feDropShadow stdDeviation="${
|
|
32
|
+
`.trim()}function K3(i={}){const t=St(i.dx,0),e=St(i.dy,0),n=Zo(i.color,"black"),s=St(i.blur,4),o=St(i.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
|
|
33
|
+
<feDropShadow stdDeviation="${s}" dx="${t}" dy="${e}" flood-color="${n}" flood-opacity="${o}" />
|
|
34
34
|
</filter>`.trim():`<filter>
|
|
35
|
-
<feGaussianBlur in="SourceAlpha" stdDeviation="${
|
|
35
|
+
<feGaussianBlur in="SourceAlpha" stdDeviation="${s}" />
|
|
36
36
|
<feOffset dx="${t}" dy="${e}" result="offsetblur" />
|
|
37
37
|
<feFlood flood-color="${n}" />
|
|
38
38
|
<feComposite in2="offsetblur" operator="in" />
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
<feMergeNode/>
|
|
44
44
|
<feMergeNode in="SourceGraphic"/>
|
|
45
45
|
</feMerge>
|
|
46
|
-
</filter>`.trim()}function
|
|
46
|
+
</filter>`.trim()}function J3(i={}){const t=St(i.amount,1),e=.2126+.7874*(1-t),n=.7152-.7152*(1-t),s=.0722-.0722*(1-t),o=.2126-.2126*(1-t),r=.7152+.2848*(1-t),a=.0722-.0722*(1-t),l=.2126-.2126*(1-t),c=.0722+.9278*(1-t);return`
|
|
47
47
|
<filter>
|
|
48
|
-
<feColorMatrix type="matrix" values="${e} ${n} ${
|
|
48
|
+
<feColorMatrix type="matrix" values="${e} ${n} ${s} 0 0 ${o} ${r} ${a} 0 0 ${l} ${n} ${c} 0 0 0 0 0 1 0"/>
|
|
49
49
|
</filter>
|
|
50
|
-
`.trim()}function
|
|
50
|
+
`.trim()}function j3(i={}){const t=St(i.amount,1),e=.393+.607*(1-t),n=.769-.769*(1-t),s=.189-.189*(1-t),o=.349-.349*(1-t),r=.686+.314*(1-t),a=.168-.168*(1-t),l=.272-.272*(1-t),c=.534-.534*(1-t),h=.131+.869*(1-t);return`
|
|
51
51
|
<filter>
|
|
52
|
-
<feColorMatrix type="matrix" values="${e} ${n} ${
|
|
52
|
+
<feColorMatrix type="matrix" values="${e} ${n} ${s} 0 0 ${o} ${r} ${a} 0 0 ${l} ${c} ${h} 0 0 0 0 0 1 0"/>
|
|
53
53
|
</filter>
|
|
54
|
-
`.trim()}function
|
|
54
|
+
`.trim()}function G3(i={}){return`
|
|
55
55
|
<filter>
|
|
56
|
-
<feColorMatrix type="saturate" values="${1-
|
|
56
|
+
<feColorMatrix type="saturate" values="${1-St(i.amount,1)}"/>
|
|
57
57
|
</filter>
|
|
58
|
-
`.trim()}function
|
|
58
|
+
`.trim()}function Y3(i={}){return`
|
|
59
59
|
<filter>
|
|
60
|
-
<feColorMatrix type="hueRotate" values="${
|
|
60
|
+
<feColorMatrix type="hueRotate" values="${St(i.angle,0)}"/>
|
|
61
61
|
</filter>
|
|
62
|
-
`.trim()}function
|
|
62
|
+
`.trim()}function H3(i={}){const t=St(i.amount,1),e=1-t;return`
|
|
63
63
|
<filter>
|
|
64
64
|
<feComponentTransfer>
|
|
65
65
|
<feFuncR type="table" tableValues="${t} ${e}"/>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
<feFuncB type="table" tableValues="${t} ${e}"/>
|
|
68
68
|
</feComponentTransfer>
|
|
69
69
|
</filter>
|
|
70
|
-
`.trim()}function
|
|
70
|
+
`.trim()}function _3(i={}){const t=St(i.amount,1);return`
|
|
71
71
|
<filter>
|
|
72
72
|
<feComponentTransfer>
|
|
73
73
|
<feFuncR type="linear" slope="${t}"/>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<feFuncB type="linear" slope="${t}"/>
|
|
76
76
|
</feComponentTransfer>
|
|
77
77
|
</filter>
|
|
78
|
-
`.trim()}function
|
|
78
|
+
`.trim()}function W3(i={}){const t=St(i.amount,1),e=.5-t/2;return`
|
|
79
79
|
<filter>
|
|
80
80
|
<feComponentTransfer>
|
|
81
81
|
<feFuncR type="linear" slope="${t}" intercept="${e}"/>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<feFuncB type="linear" slope="${t}" intercept="${e}"/>
|
|
84
84
|
</feComponentTransfer>
|
|
85
85
|
</filter>
|
|
86
|
-
`.trim()}const R2=Object.freeze(Object.defineProperty({__proto__:null,blur:S2,brightness:O2,contrast:N2,dropShadow:M2,grayScale:B2,highlight:E2,hueRotate:T2,invert:P2,outline:v2,saturate:I2,sepia:k2},Symbol.toStringTag,{value:"Module"})),oi=ut.create({type:"filter"});oi.register(R2,!0);const D2=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(s,t){const e=t.thickness*t.sx,n=t.thickness*t.sy;j(s,{width:e,height:n,rx:e,ry:n,fill:t.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(s,t){let e;const n=t.width,i=t.height,o=t.thickness;n-o>=0&&i-o>=0?e=["M",n,0,"H0 M0 0 V0",i].join(" "):e="M 0 0 0 0",j(s,{d:e,stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(s,t){let e;const n=t.factor||1,i=t.width*n,o=t.height*n,r=t.thickness;i-r>=0&&o-r>=0?e=["M",i,0,"H0 M0 0 V0",o].join(" "):e="M 0 0 0 0",t.width=i,t.height=o,j(s,{d:e,stroke:t.color,"stroke-width":t.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(s,t){const e=t.sx<=1?t.thickness*t.sx:t.thickness;j(s,{width:e,height:e,rx:e,ry:e,fill:t.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(s,t){let e;const n=t.width,i=t.height,o=t.thickness;n-o>=0&&i-o>=0?e=["M",n,0,"H0 M0 0 V0",i].join(" "):e="M 0 0 0 0",j(s,{d:e,stroke:t.color,"stroke-width":t.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Q2{constructor(){this.patterns={},this.root=L.create(qi(),{width:"100%",height:"100%"},[oe("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,L.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return this.patterns[t]!=null}}const rh=D2,ri=ut.create({type:"grid"});ri.register(rh,!0);const X={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(s){return`${X.prefixCls}-${s}`}},ah=X.prefix("highlighted"),L2={highlight(s,t,e){const n=e&&e.className||ah;O(t,n)},unhighlight(s,t,e){const n=e&&e.className||ah;st(t,n)}},lh=X.prefix("highlight-opacity"),z2={highlight(s,t){O(t,lh)},unhighlight(s,t){st(t,lh)}},F2={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},U2={highlight(s,t,e){const n=ch(t,e);if(K2(n))return;e=ml({},e,F2);const i=L.create(t);let o,r;try{o=i.toPathData()}catch{r=Mc(i.node),o=cc(Object.assign(Object.assign({},e),r))}const a=oe("path");if(j(a,Object.assign({d:o,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},e.attrs?Gn(e.attrs):null)),s.isEdgeElement(t))j(a,"d",s.getConnectionPathData());else{let h=i.getTransformToElement(s.container);const u=e.padding;if(u){r==null&&(r=Mc(i.node));const d=r.x+r.width/2,f=r.y+r.height/2;r=Ht(r,h);const p=Math.max(r.width,1),m=Math.max(r.height,1),b=(p+u)/p,y=(m+u)/m,C=wt({a:b,b:0,c:0,d:y,e:d-b*d,f:f-y*f});h=h.multiply(C)}fn(a,h)}O(a,X.prefix("highlight-stroke"));const l=s.cell,c=()=>hh(n);l.on("removed",c),l.model&&l.model.on("reseted",c),s.container.appendChild(a),V2(n,a)},unhighlight(s,t,e){hh(ch(t,e))}};function ch(s,t){return bo(s),s.id+JSON.stringify(t)}const ms={};function V2(s,t){ms[s]=t}function K2(s){return ms[s]!=null}function hh(s){const t=ms[s];t&&(Gt(t),delete ms[s])}const J2=Object.freeze(Object.defineProperty({__proto__:null,className:L2,opacity:z2,stroke:U2},Symbol.toStringTag,{value:"Module"}));function j2(s,t){if(typeof t.highlight!="function")throw new Error(`Highlighter '${s}' is missing required \`highlight()\` method`);if(typeof t.unhighlight!="function")throw new Error(`Highlighter '${s}' is missing required \`unhighlight()\` method`)}const G2=J2,ai=ut.create({type:"highlighter"});ai.register(G2,!0);const Y2=Ae("center"),H2=Ae("topCenter"),_2=Ae("bottomCenter"),W2=Ae("leftMiddle"),q2=Ae("rightMiddle"),X2=Ae("topLeft"),$2=Ae("topRight"),Z2=Ae("bottomLeft"),t3=Ae("bottomRight");function Ae(s){return(t,e,n,i={})=>{let o;t.cell.visible?o=i.rotate?t.getUnrotatedBBoxOfElement(e):t.getBBoxOfElement(e):o=t.cell.getBBox();const r=o[s];r.x+=Vt(i.dx,o.width),r.y+=Vt(i.dy,o.height);const a=t.cell;return i.rotate?r.rotate(-a.getAngle(),a.getBBox().getCenter()):r}}const e3=ps((s,t,e,n)=>{const i=Pt(s.cell.getAngle()),o=s.cell.visible?s.getBBoxOfElement(t):s.cell.getBBox(),r=o.getCenter(),a=o.getTopLeft(),l=o.getBottomRight();let c=n.padding;if(Number.isFinite(c)||(c=0),a.y+c<=e.y&&e.y<=l.y-c){const h=e.y-r.y;r.x+=i===0||i===180?0:h*1/Math.tan(It(i)),r.y+=h}else if(a.x+c<=e.x&&e.x<=l.x-c){const h=e.x-r.x;r.y+=i===90||i===270?0:h*Math.tan(It(i)),r.x+=h}return r}),n3=function(s,t,e,n,i){const o=s.cell.getConnectionPoint(this.cell,i);return(n.dx||n.dy)&&o.translate(n.dx||0,n.dy||0),o},i3=ps((s,t,e,n)=>{let i,o=0,r;const a=s.cell;n.rotate?(i=s.getUnrotatedBBoxOfElement(t),r=a.getBBox().getCenter(),o=a.getAngle()):a.visible?i=s.getBBoxOfElement(t):i=s.cell.getBBox();const l=n.padding;l!=null&&Number.isFinite(l)&&i.inflate(l),n.rotate&&e.rotate(o,r);const c=i.getNearestSideToPoint(e);let h;switch(c){case"left":h=i.getLeftMiddle();break;case"right":h=i.getRightMiddle();break;case"top":h=i.getTopCenter();break;case"bottom":h=i.getBottomCenter();break}const u=n.direction;return u==="H"?(c==="top"||c==="bottom")&&(e.x<=i.x+i.width?h=i.getLeftMiddle():h=i.getRightMiddle()):u==="V"&&(e.y<=i.y+i.height?h=i.getTopCenter():h=i.getBottomCenter()),n.rotate?h.rotate(-o,r):h}),s3=Object.freeze(Object.defineProperty({__proto__:null,bottom:_2,bottomLeft:Z2,bottomRight:t3,center:Y2,left:W2,midSide:i3,nodeCenter:n3,orth:e3,right:q2,top:H2,topLeft:X2,topRight:$2},Symbol.toStringTag,{value:"Module"})),li=ut.create({type:"node endpoint"});li.register(s3,!0);const o3={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Oe(s,t){const{x:e,y:n,angle:i,attrs:o}=t||{};return ml({},{angle:i,attrs:o,position:{x:e,y:n}},s,o3)}const r3=(s,t,e)=>Oe({position:t.getTopLeft()},e),a3=(s,t,e)=>Oe({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},e),l3=(s,t,e)=>Oe({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},e),c3=(s,t,e)=>Oe({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},e),h3=(s,t,e)=>Oe({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},e),u3=(s,t,e)=>uh(s,t,!1,e),d3=(s,t,e)=>uh(s,t,!0,e),g3=(s,t,e)=>dh(s,t,!1,e),f3=(s,t,e)=>dh(s,t,!0,e);function uh(s,t,e,n){const i=n.offset!=null?n.offset:15,o=t.getCenter().theta(s),r=gh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=i,c=0,h="start"):o<r[0]?(a="0",l=0,c=-i,e?(u=-90,h="start"):h="middle"):o<r[3]?(a=".3em",l=-i,c=0,h="end"):(a=".6em",l=0,c=i,e?(u=90,h="start"):h="middle"),Oe({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function dh(s,t,e,n){const i=n.offset!=null?n.offset:15,o=t.getCenter().theta(s),r=gh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=-i,c=0,h="end"):o<r[0]?(a=".6em",l=0,c=i,e?(u=90,h="start"):h="middle"):o<r[3]?(a=".3em",l=i,c=0,h="start"):(a="0em",l=0,c=-i,e?(u=-90,h="start"):h="middle"),Oe({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function gh(s){const t=s.getCenter(),e=t.theta(s.getTopLeft()),n=t.theta(s.getBottomLeft()),i=t.theta(s.getBottomRight()),o=t.theta(s.getTopRight());return[e,o,i,n]}const p3=(s,t,e)=>fh(s.diff(t.getCenter()),!1,e),m3=(s,t,e)=>fh(s.diff(t.getCenter()),!0,e);function fh(s,t,e){const n=e.offset!=null?e.offset:20,i=new w(0,0),o=-s.theta(i),r=s.clone().move(i,n).diff(s).round();let a=".3em",l,c=o;return(o+90)%180===0?(l=t?"end":"middle",!t&&o===-270&&(a="0em")):o>-270&&o<-90?(l="start",c=o-180):l="end",Oe({position:r.round().toJSON(),angle:t?c:0,attrs:{".":{y:a,"text-anchor":l}}},e)}const ph=Object.freeze(Object.defineProperty({__proto__:null,bottom:h3,inside:g3,insideOriented:f3,left:a3,manual:r3,outside:u3,outsideOriented:d3,radial:p3,radialOriented:m3,right:l3,top:c3},Symbol.toStringTag,{value:"Module"})),bs=ut.create({type:"port label layout"});bs.register(ph,!0);function Yo(s,t={}){return new w(Vt(t.x,s.width),Vt(t.y,s.height))}function Ho(s,t,e){return Object.assign({angle:t,position:s.toJSON()},e)}const b3=(s,t)=>s.map(({x:e,y:n,angle:i})=>Ho(Yo(t,{x:e,y:n}),i||0)),y3=(s,t,e)=>{const n=e.start||0,i=e.step||20;return mh(s,t,n,(o,r)=>(o+.5-r/2)*i)},C3=(s,t,e)=>{const n=e.start||0,i=e.step||360/s.length;return mh(s,t,n,o=>o*i)};function mh(s,t,e,n){const i=t.getCenter(),o=t.getTopCenter(),r=t.width/t.height,a=Ft.fromRect(t),l=s.length;return s.map((c,h)=>{const u=e+n(h,l),d=o.clone().rotate(-u,i).scale(r,1,i),f=c.compensateRotate?-a.tangentTheta(d):0;return(c.dx||c.dy)&&d.translate(c.dx||0,c.dy||0),c.dr&&d.move(i,c.dr),Ho(d.round(),f,c)})}const w3=(s,t,e)=>{const n=Yo(t,e.start||t.getOrigin()),i=Yo(t,e.end||t.getCorner());return ci(s,n,i,e)},A3=(s,t,e)=>ci(s,t.getTopLeft(),t.getBottomLeft(),e),x3=(s,t,e)=>ci(s,t.getTopRight(),t.getBottomRight(),e),v3=(s,t,e)=>ci(s,t.getTopLeft(),t.getTopRight(),e),E3=(s,t,e)=>ci(s,t.getBottomLeft(),t.getBottomRight(),e);function ci(s,t,e,n){const i=new N(t,e),o=s.length;return s.map((r,a)=>{var{strict:l}=r,c=V(r,["strict"]);const h=l||n.strict?(a+1)/(o+1):(a+.5)/o,u=i.pointAt(h);return(c.dx||c.dy)&&u.translate(c.dx||0,c.dy||0),Ho(u.round(),0,c)})}const bh=Object.freeze(Object.defineProperty({__proto__:null,absolute:b3,bottom:E3,ellipse:y3,ellipseSpread:C3,left:A3,line:w3,right:x3,top:v3},Symbol.toStringTag,{value:"Module"})),hi=ut.create({type:"port layout"});hi.register(bh,!0);const S3=s=>[...s],M3=(s,t,e)=>{const n=t.side||"bottom",i=ne(t.padding||40),o=e.sourceBBox,r=e.targetBBox,a=o.getCenter(),l=r.getCenter();let c,h,u;switch(n){case"top":u=-1,c="y",h="height";break;case"left":u=-1,c="x",h="width";break;case"right":u=1,c="x",h="width";break;case"bottom":default:u=1,c="y",h="height";break}return a[c]+=u*(o[h]/2+i[n]),l[c]+=u*(r[h]/2+i[n]),u*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...s,l.toJSON()]};function ys(s){return new I(s.x,s.y,0,0)}function Cs(s={}){const t=ne(s.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function yh(s,t={}){return s.sourceBBox.clone().moveAndExpand(Cs(t))}function Ch(s,t={}){return s.targetBBox.clone().moveAndExpand(Cs(t))}function B3(s,t={}){return s.sourceAnchor?s.sourceAnchor:yh(s,t).getCenter()}function k3(s,t={}){return s.targetAnchor?s.targetAnchor:Ch(s,t).getCenter()}const wh=(s,t,e)=>{let n=yh(e,t),i=Ch(e,t);const o=B3(e,t),r=k3(e,t);n=n.union(ys(o)),i=i.union(ys(r));const a=s.map(h=>w.create(h));a.unshift(o),a.push(r);let l=null;const c=[];for(let h=0,u=a.length-1;h<u;h+=1){let d=null;const f=a[h],p=a[h+1],m=Rt(f,p)!=null;if(h===0)h+1===u?n.intersectsWithRect(i.clone().inflate(1))?d=Wo(f,p,n,i):m||(d=O3(f,p,n,i)):n.containsPoint(p)?d=Wo(f,p,n,ys(p).moveAndExpand(Cs(t))):m||(d=As(f,p,n));else if(h+1===u){const b=m&&Rt(p,f)===l;i.containsPoint(f)||b?d=Wo(f,p,ys(f).moveAndExpand(Cs(t)),i,l):m||(d=P3(f,p,i,l))}else m||(d=Ah(f,p,l));d?(c.push(...d.points),l=d.direction):l=Rt(f,p),h+1<u&&c.push(p)}return c},I3={N:"S",S:"N",E:"W",W:"E"},T3={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function ws(s,t,e){let n=new w(s.x,t.y);return e.containsPoint(n)&&(n=new w(t.x,s.y)),n}function _o(s,t){return s[t==="W"||t==="E"?"width":"height"]}function Rt(s,t){return s.x===t.x?s.y>t.y?"N":"S":s.y===t.y?s.x>t.x?"W":"E":null}function Ah(s,t,e){const n=new w(s.x,t.y),i=new w(t.x,s.y),o=Rt(s,n),r=Rt(s,i),a=e?I3[e]:null,l=o===e||o!==a&&(r===a||r!==e)?n:i;return{points:[l],direction:Rt(l,t)}}function As(s,t,e){const n=ws(s,t,e);return{points:[n],direction:Rt(n,t)}}function P3(s,t,e,n){const i=[new w(s.x,t.y),new w(t.x,s.y)],o=i.filter(l=>!e.containsPoint(l)),r=o.filter(l=>Rt(l,s)!==n);let a;if(r.length>0)return a=r.filter(l=>Rt(s,l)===n).pop(),a=a||r[0],{points:[a],direction:Rt(a,t)};{a=nb(i,o)[0];const l=w.create(t).move(a,-_o(e,n)/2);return{points:[ws(l,s,e),l],direction:Rt(l,t)}}}function O3(s,t,e,n){let i=As(t,s,n);const o=i.points[0];if(e.containsPoint(o)){i=As(s,t,e);const r=i.points[0];if(n.containsPoint(r)){const a=w.create(s).move(r,-_o(e,Rt(s,r))/2),l=w.create(t).move(o,-_o(n,Rt(t,o))/2),c=new N(a,l).getCenter(),h=As(s,c,e),u=Ah(c,t,h.direction);i.points=[h.points[0],u.points[0]],i.direction=u.direction}}return i}function Wo(s,t,e,n,i){const o=e.union(n).inflate(1),r=o.getCenter(),a=r.distance(t)>r.distance(s),l=a?t:s,c=a?s:t;let h,u,d;i?(h=w.fromPolar(o.width+o.height,T3[i],l),h=o.getNearestPointToPoint(h).move(h,-1)):h=o.getNearestPointToPoint(l).move(l,1),u=ws(h,c,o);let f;h.round().equals(u.round())?(u=w.fromPolar(o.width+o.height,It(h.theta(l))+Math.PI/2,c),u=o.getNearestPointToPoint(u).move(c,1).round(),d=ws(h,u,o),f=a?[u,d,h]:[h,d,u]):f=a?[u,h]:[h,u];const p=Rt(a?h:u,t);return{points:f,direction:p}}const N3={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Ne(this.step,this)},directions(){const s=Ne(this.step,this),t=Ne(this.cost,this);return[{cost:t,offsetX:s,offsetY:0},{cost:t,offsetX:-s,offsetY:0},{cost:t,offsetX:0,offsetY:s},{cost:t,offsetX:0,offsetY:-s}]},penalties(){const s=Ne(this.step,this);return{0:0,45:s/2,90:s/2}},paddingBox(){const s=Ne(this.step,this);return{x:-s,y:-s,width:2*s,height:2*s}},fallbackRouter:wh,draggingRouter:null,snapToGrid:!0};function Ne(s,t){return typeof s=="function"?s.call(t):s}function R3(s){const t=Object.keys(s).reduce((e,n)=>{const i=e;return n==="fallbackRouter"||n==="draggingRouter"||n==="fallbackRoute"?i[n]=s[n]:i[n]=Ne(s[n],s),e},{});if(t.padding){const e=ne(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{const n=new w(0,0),i=new w(e.offsetX,e.offsetY);e.angle=Pt(n.theta(i))}),t}class D3{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,i=n.excludeTerminals.reduce((c,h)=>{const u=e[h];if(u){const d=t.getCell(u.cell);d&&c.push(d)}return c},[]);let o=[];const r=t.getCell(e.getSourceCellId());r&&(o=Al(o,r.getAncestors().map(c=>c.id)));const a=t.getCell(e.getTargetCellId());a&&(o=Al(o,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return t.getNodes().reduce((c,h)=>{const u=i.some(b=>b.id===h.id),d=h.shape?n.excludeShapes.includes(h.shape):!1,f=n.excludeNodes.some(b=>typeof b=="string"?h.id===b:b===h),p=o.includes(h.id),m=d||u||f||p;if(h.isVisible()&&!m){const b=h.getBBox().moveAndExpand(n.paddingBox),y=b.getOrigin().snapToGrid(l),C=b.getCorner().snapToGrid(l);for(let A=y.x;A<=C.x;A+=l)for(let x=y.y;x<=C.y;x+=l){const v=new w(A,x).toString();c[v]==null&&(c[v]=[]),c[v].push(b)}}return c},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return n?n.every(i=>!i.containsPoint(t)):!0}}const xh=1,vh=2;class Q3{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=xh,this.values[t]=e;const n=Nb(this.items,t,i=>this.values[i]);this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=vh),t}isOpen(t){return this.hash[t]===xh}isClose(t){return this.hash[t]===vh}isEmpty(){return this.items.length===0}}function Eh(s,t){const e=s.sourceBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Sh(s,t){const e=s.targetBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Mh(s,t){return s.sourceAnchor?s.sourceAnchor:Eh(s,t).getCenter()}function L3(s,t){return s.targetAnchor?s.targetAnchor:Sh(s,t).getCenter()}function qo(s,t,e,n,i){const o=360/e,r=s.theta(z3(s,t,n,i)),a=Pt(r+o/2);return o*Math.floor(a/o)}function z3(s,t,e,n){const i=n.step,o=t.x-s.x,r=t.y-s.y,a=o/e.x,l=r/e.y,c=a*i,h=l*i;return new w(s.x+c,s.y+h)}function Bh(s,t){const e=Math.abs(s-t);return e>180?360-e:e}function F3(s,t){const e=t.step;return t.directions.forEach(n=>{n.gridOffsetX=n.offsetX/e*s.x,n.gridOffsetY=n.offsetY/e*s.y}),t.directions}function U3(s,t,e){return{source:t.clone(),x:kh(e.x-t.x,s),y:kh(e.y-t.y,s)}}function kh(s,t){if(!s)return t;const e=Math.abs(s),n=Math.round(e/t);if(!n)return e;const i=n*t,r=(e-i)/n;return t+r}function V3(s,t){const e=t.source,n=ie(s.x-e.x,t.x)+e.x,i=ie(s.y-e.y,t.y)+e.y;return new w(n,i)}function ui(s,t){return s.round(t)}function xs(s,t,e){return ui(V3(s.clone(),t),e)}function di(s){return s.toString()}function Xo(s){return new w(s.x===0?0:Math.abs(s.x)/s.x,s.y===0?0:Math.abs(s.y)/s.y)}function Ih(s,t){let e=1/0;for(let n=0,i=t.length;n<i;n+=1){const o=s.manhattanDistance(t[n]);o<e&&(e=o)}return e}function Th(s,t,e,n,i){const o=i.precision,r=i.directionMap,a=s.diff(t.getCenter()),l=Object.keys(r).reduce((c,h)=>{if(e.includes(h)){const u=r[h],d=new w(s.x+u.x*(Math.abs(a.x)+t.width),s.y+u.y*(Math.abs(a.y)+t.height)),p=new N(s,d).intersect(t)||[];let m,b=null;for(let y=0;y<p.length;y+=1){const C=p[y],A=s.squaredDistance(C);(m==null||A>m)&&(m=A,b=C)}if(b){let y=xs(b,n,o);t.containsPoint(y)&&(y=xs(y.translate(u.x*n.x,u.y*n.y),n,o)),c.push(y)}}return c},[]);return t.containsPoint(s)||l.push(xs(s,n,o)),l}function K3(s,t,e,n,i){const o=[];let r=Xo(i.diff(e)),a=di(e),l=s[a],c;for(;l;){c=t[a];const d=Xo(c.diff(l));d.equals(r)||(o.unshift(c),r=d),a=di(l),l=s[a]}const h=t[a];return Xo(h.diff(n)).equals(r)||o.unshift(h),o}function J3(s,t,e,n,i){const o=i.precision;let r,a;I.isRectangle(t)?r=ui(Mh(s,i).clone(),o):r=ui(t.clone(),o),I.isRectangle(e)?a=ui(L3(s,i).clone(),o):a=ui(e.clone(),o);const l=U3(i.step,r,a),c=r,h=a;let u,d;if(I.isRectangle(t)?u=Th(c,t,i.startDirections,l,i):u=[c],I.isRectangle(e)?d=Th(a,e,i.endDirections,l,i):d=[h],u=u.filter(f=>n.isAccessible(f)),d=d.filter(f=>n.isAccessible(f)),u.length>0&&d.length>0){const f=new Q3,p={},m={},b={};for(let T=0,P=u.length;T<P;T+=1){const R=u[T],F=di(R);f.add(F,Ih(R,d)),p[F]=R,b[F]=0}const y=i.previousDirectionAngle,C=y===void 0;let A,x;const v=F3(l,i),B=v.length,E=d.reduce((T,P)=>{const R=di(P);return T.push(R),T},[]),M=w.equalPoints(u,d);let k=i.maxLoopCount;for(;!f.isEmpty()&&k>0;){const T=f.pop(),P=p[T],R=m[T],F=b[T],K=P.equals(c),Z=R==null;let Y;if(Z?C?K?Y=null:Y=qo(c,P,B,l,i):Y=y:Y=qo(R,P,B,l,i),!(Z&&M)&&E.indexOf(T)>=0)return i.previousDirectionAngle=Y,K3(m,p,P,c,h);for(let Qt=0;Qt<B;Qt+=1){A=v[Qt];const Lt=A.angle;if(x=Bh(Y,Lt),!(C&&K)&&x>i.maxDirectionChange)continue;const pt=xs(P.clone().translate(A.gridOffsetX||0,A.gridOffsetY||0),l,o),Q=di(pt);if(f.isClose(Q)||!n.isAccessible(pt))continue;if(E.indexOf(Q)>=0&&!pt.equals(h)){const mt=qo(pt,h,B,l,i);if(Bh(Lt,mt)>i.maxDirectionChange)continue}const q=A.cost,tt=K?0:i.penalties[x],J=F+q+tt;(!f.isOpen(Q)||J<b[Q])&&(p[Q]=pt,m[Q]=P,b[Q]=J,f.add(Q,J+Ih(pt,d)))}k-=1}}return i.fallbackRoute?D(i.fallbackRoute,this,c,h,i):null}function j3(s,t=10){if(s.length<=1)return s;for(let e=0,n=s.length;e<n-1;e+=1){const i=s[e],o=s[e+1];if(i.x===o.x){const r=t*Math.round(i.x/t);i.x!==r&&(i.x=r,o.x=r)}else if(i.y===o.y){const r=t*Math.round(i.y/t);i.y!==r&&(i.y=r,o.y=r)}}return s}const G3=function(s,t,e){const n=R3(t),i=Eh(e,n),o=Sh(e,n),r=Mh(e,n),a=new D3(n).build(e.graph.model,e.cell),l=s.map(f=>w.create(f)),c=[];let h=r,u,d;for(let f=0,p=l.length;f<=p;f+=1){let m=null;if(u=d||i,d=l[f],d==null){d=o;const y=e.cell;if((y.getSourceCellId()==null||y.getTargetCellId()==null)&&typeof n.draggingRouter=="function"){const A=u===i?r:u,x=d.getOrigin();m=D(n.draggingRouter,e,A,x,n)}}if(m==null&&(m=J3(e,u,d,a,n)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),D(n.fallbackRouter,this,s,n,e);const b=m[0];b&&b.equals(h)&&m.shift(),h=m[m.length-1]||h,c.push(...m)}return n.snapToGrid?j3(c,e.graph.grid.getGridSize()):c},Ph=function(s,t,e){return D(G3,this,s,Object.assign(Object.assign({},N3),t),e)},Y3={maxDirectionChange:45,directions(){const s=Ne(this.step,this),t=Ne(this.cost,this),e=Math.ceil(Math.sqrt(s*s<<1));return[{cost:t,offsetX:s,offsetY:0},{cost:e,offsetX:s,offsetY:s},{cost:t,offsetX:0,offsetY:s},{cost:e,offsetX:-s,offsetY:s},{cost:t,offsetX:-s,offsetY:0},{cost:e,offsetX:-s,offsetY:-s},{cost:t,offsetX:0,offsetY:-s},{cost:e,offsetX:s,offsetY:-s}]},fallbackRoute(s,t,e){const n=s.theta(t),i=[];let o={x:t.x,y:s.y},r={x:s.x,y:t.y};if(n%180>90){const A=o;o=r,r=A}const a=n%90<45?o:r,l=new N(s,a),c=90*Math.ceil(n/90),h=w.fromPolar(l.squaredLength(),It(c+135),a),u=new N(t,h),d=l.intersectsWithLine(u),f=d||t,p=d?f:s,m=360/e.directions.length,b=p.theta(t),y=Pt(b+m/2),C=m*Math.floor(y/m);return e.previousDirectionAngle=C,f&&i.push(f.round()),i.push(t),i}},H3=function(s,t,e){return D(Ph,this,s,Object.assign(Object.assign({},Y3),t),e)},_3=(s,t,e)=>{const n=t.offset||32,i=t.min==null?16:t.min;let o=0,r=t.direction;const a=e.sourceBBox,l=e.targetBBox,c=a.getCenter(),h=l.getCenter();if(typeof n=="number"&&(o=n),r==null){let y=l.left-a.right,C=l.top-a.bottom;y>=0&&C>=0?r=y>=C?"L":"T":y<=0&&C>=0?(y=a.left-l.right,y>=0?r=y>=C?"R":"T":r="T"):y>=0&&C<=0?(C=a.top-l.bottom,C>=0?r=y>=C?"L":"B":r="L"):(y=a.left-l.right,C=a.top-l.bottom,y>=0&&C>=0?r=y>=C?"R":"B":y<=0&&C>=0?r="B":y>=0&&C<=0?r="R":r=Math.abs(y)>Math.abs(C)?"R":"B")}r==="H"?r=h.x-c.x>=0?"L":"R":r==="V"&&(r=h.y-c.y>=0?"T":"B"),n==="center"&&(r==="L"?o=(l.left-a.right)/2:r==="R"?o=(a.left-l.right)/2:r==="T"?o=(l.top-a.bottom)/2:r==="B"&&(o=(a.top-l.bottom)/2));let u,d,f;const p=r==="L"||r==="R";if(p){if(h.y===c.y)return[...s];f=r==="L"?1:-1,u="x",d="width"}else{if(h.x===c.x)return[...s];f=r==="T"?1:-1,u="y",d="height"}const m=c.clone(),b=h.clone();if(m[u]+=f*(a[d]/2+o),b[u]-=f*(l[d]/2+o),p){const y=m.x,C=b.x,A=a.width/2+i,x=l.width/2+i;h.x>c.x?C<=y&&(m.x=Math.max(C,c.x+A),b.x=Math.min(y,h.x-x)):C>=y&&(m.x=Math.min(C,c.x-A),b.x=Math.max(y,h.x+x))}else{const y=m.y,C=b.y,A=a.height/2+i,x=l.height/2+i;h.y>c.y?C<=y&&(m.y=Math.max(C,c.y+A),b.y=Math.min(y,h.y-x)):C>=y&&(m.y=Math.min(C,c.y-A),b.y=Math.max(y,h.y+x))}return[m.toJSON(),...s,b.toJSON()]};function An(s,t){if(t!=null&&t!==!1){const e=typeof t=="boolean"?0:t;if(e>0){const n=w.create(s[1]).move(s[2],e),i=w.create(s[1]).move(s[0],e);return[n.toJSON(),...s,i.toJSON()]}{const n=s[1];return[Object.assign({},n),...s,Object.assign({},n)]}}return s}const $o=Object.freeze(Object.defineProperty({__proto__:null,er:_3,loop:(s,t,e)=>{const n=t.width||50,o=(t.height||80)/2,r=t.angle||"auto",a=e.sourceAnchor,l=e.targetAnchor,c=e.sourceBBox,h=e.targetBBox;if(a.equals(l)){const u=y=>{const C=It(y),A=Math.sin(C),x=Math.cos(C),v=new w(a.x+x*n,a.y+A*n),B=new w(v.x-x*o,v.y-A*o),E=B.clone().rotate(-90,v),M=B.clone().rotate(90,v);return[E.toJSON(),v.toJSON(),M.toJSON()]},d=y=>{const C=a.clone().move(y,-1),A=new N(C,y);return!c.containsPoint(y)&&!c.intersectsWithLine(A)},f=[0,90,180,270,45,135,225,315];if(typeof r=="number")return An(u(r),t.merge);const p=c.getCenter();if(p.equals(a))return An(u(0),t.merge);const m=p.angleBetween(a,p.clone().translate(1,0));let b=u(m);if(d(b[1]))return An(b,t.merge);for(let y=1,C=f.length;y<C;y+=1)if(b=u(m+f[y]),d(b[1]))return An(b,t.merge);return An(b,t.merge)}{const u=new N(a,l);let d=u.parallel(-n),f=d.getCenter(),p=d.start.clone().move(d.end,o),m=d.end.clone().move(d.start,o);const b=u.parallel(-1),y=new N(b.start,f),C=new N(b.end,f);if((c.containsPoint(f)||h.containsPoint(f)||c.intersectsWithLine(y)||c.intersectsWithLine(C)||h.intersectsWithLine(y)||h.intersectsWithLine(C))&&(d=u.parallel(n),f=d.getCenter(),p=d.start.clone().move(d.end,o),m=d.end.clone().move(d.start,o)),t.merge){const A=new N(a,l),x=new N(f,A.center).setLength(Number.MAX_SAFE_INTEGER),v=c.intersectsWithLine(x),B=h.intersectsWithLine(x),E=v?Array.isArray(v)?v:[v]:[];B&&(Array.isArray(B)?E.push(...B):E.push(B));const M=A.center.closest(E);M?(e.sourceAnchor=M.clone(),e.targetAnchor=M.clone()):(e.sourceAnchor=A.center.clone(),e.targetAnchor=A.center.clone())}return An([p.toJSON(),f.toJSON(),m.toJSON()],t.merge)}},manhattan:Ph,metro:H3,normal:S3,oneSide:M3,orth:wh},Symbol.toStringTag,{value:"Module"})),gi=ut.create({type:"router"});gi.register($o,!0);function W3(s){return s!=null&&!vs(s)}function vs(s){return s!=null&&typeof s=="string"}function q3(s){return s==null||vs(s)?s:at(s)}function X3(s){return`${s}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function Oh(s,t={ns:Ct.svg}){const e=document.createDocumentFragment(),n={},i={},o=[{markup:Array.isArray(s)?s:[s],parent:e,ns:t.ns}];for(;o.length>0;){const r=o.pop();let a=r.ns||Ct.svg;const l=r.markup,c=r.parent;l.forEach(h=>{const u=h.tagName;if(!u)throw new TypeError("Invalid tagName");h.ns&&(a=h.ns);const d=a?yo(u,a):Jl(u),f=h.attrs;f&&j(d,Gn(f));const p=h.style;p&&$(d,p);const m=h.className;m!=null&&d.setAttribute("class",Array.isArray(m)?m.join(" "):m),h.textContent&&(d.textContent=h.textContent);const b=h.selector;if(b!=null){if(i[b])throw new TypeError("Selector must be unique");i[b]=d}if(h.groupSelector){let C=h.groupSelector;Array.isArray(C)||(C=[C]),C.forEach(A=>{n[A]||(n[A]=[]),n[A].push(d)})}c.appendChild(d);const y=h.children;Array.isArray(y)&&o.push({ns:a,markup:y,parent:d})})}return Object.keys(n).forEach(r=>{if(i[r])throw new Error("Ambiguous group selector");i[r]=n[r]}),{fragment:e,selectors:i,groups:n}}function Zo(s){return s instanceof SVGElement?oe("g"):Jl("div")}function $3(s){if(vs(s)){const i=L.createVectors(s),o=i.length;if(o===1)return{elem:i[0].node};if(o>1){const r=Zo(i[0].node);return i.forEach(a=>{r.appendChild(a.node)}),{elem:r}}return{}}const t=Oh(s),e=t.fragment;let n=null;return e.childNodes.length>1?(n=Zo(e.firstChild),n.appendChild(e)):n=e.firstChild,{elem:n,selectors:t.selectors}}function Z3(s){const t=L.createVectors(s),e=document.createDocumentFragment();for(let n=0,i=t.length;n<i;n+=1){const o=t[n].node;e.appendChild(o)}return{fragment:e,selectors:{}}}function Nh(s,t,e){if(s!=null){let n;const i=s.tagName.toLowerCase();if(s===t)return typeof e=="string"?n=`> ${i} > ${e}`:n=`> ${i}`,n;const o=s.parentNode;if(o&&o.childNodes.length>1){const r=Co(s)+1;n=`${i}:nth-child(${r})`}else n=i;return e&&(n+=` > ${e}`),Nh(s.parentNode,t,n)}return e}function tw(){return"g"}function ew(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function nw(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}function iw(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}function sw(s=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:Ct.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:Ct.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:s?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}const Tt={isJSONMarkup:W3,isStringMarkup:vs,clone:q3,sanitize:X3,parseJSONMarkup:Oh,createContainer:Zo,renderMarkup:$3,parseLabelStringMarkup:Z3,getSelector:Nh,getPortContainerMarkup:tw,getPortMarkup:ew,getPortLabelMarkup:nw,getEdgeMarkup:iw,getForeignObjectMarkup:sw};function rE(s,t){}function aE(s){}function Ge(s,t){return t?oe(s||"g"):yo(s||"div")}function Rh(s,t,e){if(!s||s===".")return{elems:[t]};if(e){const n=e[s];if(n)return{elems:Array.isArray(n)?n:[n]}}{const n=s.includes(">")?`:scope ${s}`:s;return{isCSSSelector:!0,elems:Array.prototype.slice.call(t.querySelectorAll(n))}}}function ow(s){var t;let e=s;const n=s.originalEvent,i=(t=n==null?void 0:n.changedTouches)===null||t===void 0?void 0:t[0];if(i){for(const o in s)i[o]===void 0&&(i[o]=s[o]);e=i}return e}let Ut=class extends Nt{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=Vb("v"),this.cid}confirmUpdate(t,e){return 0}empty(t=this.container){return Jn(t),this}unmount(t=this.container){return Gt(t),this}remove(t=this.container){return t===this.container?(this.removeEventListeners(document),this.onRemove(),this.cid,this.disposeContainer&&this.unmount(t)):this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return O(e,Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return st(e,Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return $(e,t),this}setAttrs(t,e=this.container){return t!=null&&e!=null&&j(e,t),this}findAttr(t,e=this.container){let n=e;for(;n&&n.nodeType===1;){const i=n.getAttribute(t);if(i!=null)return i;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return Rh(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const i=this.find(t,e,n);return i.length>0?i[0]:null}findByAttr(t,e=this.container){let n=e;for(;n!=null&&n.getAttribute;){const i=n.getAttribute(t);if((i!=null||n===this.container)&&i!=="false")return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return typeof e=="string"&&(n=`> ${e}`),n;if(t){const i=Co(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${i})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return X.prefix(t)}delegateEvents(t,e){if(t==null)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(i=>{const o=i.match(n);if(o==null)return;const r=this.getEventHandler(t[i]);typeof r=="function"&&this.delegateEvent(o[1],o[2],r)}),this}undelegateEvents(){return nt.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return nt.on(this.container,t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const i=t+this.getEventNamespace();return e==null?nt.off(this.container,i):typeof e=="string"?nt.off(this.container,i,e,n):nt.off(this.container,i,e),this}addEventListeners(t,e,n){if(e==null)return this;const i=this.getEventNamespace();return Object.keys(e).forEach(o=>{const r=this.getEventHandler(e[o]);typeof r=="function"&&nt.on(t,o+i,n,r)}),this}removeEventListeners(t){return t!=null&&nt.off(t,this.getEventNamespace()),this}getEventNamespace(){return`.${X.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if(typeof t=="string"){const n=this[t];typeof n=="function"&&(e=(...i)=>n.call(this,...i))}else e=(...n)=>t.call(this,...n);return e}getEventTarget(t,e={}){const{target:n,type:i,clientX:o=0,clientY:r=0}=t;return e.fromPoint||i==="touchmove"||i==="touchend"?document.elementFromPoint(o,r):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return this.getEventData(t).propagationStopped===!0}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(t==null)throw new TypeError("Event object required");let n=t.data;const i=`__${this.cid}__`;return e==null?n==null?{}:n[i]||{}:(n==null&&(n=t.data={}),n[i]==null?n[i]=Object.assign({},e):n[i]=Object.assign(Object.assign({},n[i]),e),n[i])}normalizeEvent(t){return ow(t)}dispose(){this.remove()}};H([_()],Ut.prototype,"dispose",null);let Dh=0;function rw(s){return s?Ao(s):(Dh+=1,`CustomTool${Dh}`)}class lt extends Ut{static isToolItem(t){if(t==null)return!1;if(t instanceof lt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Qh)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"&&typeof n.isVisible=="function"}static define(t){const e=Io(rw(t.name),lt);return e.config(t),e}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return ct(at(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return Qh}constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=Ge(this.options.tagName||"g",this.options.isSVGElement!==!1),O(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&O(this.container,this.options.className),this.init()}init(){}getOptions(t){return this.constructor.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?O(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&O(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=Tt.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const t=this.options.focusOpacity;return t!=null&&Number.isFinite(t)&&(this.container.style.opacity=`${t}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(t,this.cellView)}}lt.toStringTag=`X6.${lt.name}`,lt.defaults={isSVGElement:!0,tagName:"g"};const Qh=`X6.${lt.name}`;class aw{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,i,o,r;const a=[];return Object.keys(e).forEach(l=>{const c=e[l],h=this.getDefinition(l),u=D(c2,this.view,h,c,{elem:t,attrs:e,cell:this.cell,view:this.view});if(h&&u)typeof h=="string"?(n==null&&(n={}),n[h]=c):c!==null&&a.push({name:l,definition:h});else{n==null&&(n={});const d=Wl.includes(l)?l:_l(l);n[d]=c}}),a.forEach(({name:l,definition:c})=>{const h=e[l];typeof c.set=="function"&&(i==null&&(i={}),i[l]=h),typeof c.offset=="function"&&(o==null&&(o={}),o[l]=h),typeof c.position=="function"&&(r==null&&(r={}),r[l]=h)}),{raw:e,normal:n,set:i,offset:o,position:r}}mergeProcessedAttrs(t,e){var n;t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const i=(n=t.normal)===null||n===void 0?void 0:n.transform;i!=null&&e.normal&&(e.normal.transform=i),t.normal=e.normal}findAttrs(t,e,n,i){const o=[],r=new Uo;return Object.keys(t).forEach(a=>{const l=t[a];if(!te(l))return;const{isCSSSelector:c,elems:h}=Rh(a,e,i);n[a]=h;for(let u=0,d=h.length;u<d;u+=1){const f=h[u],p=i&&i[a]===f,m=r.get(f);if(m){m.array||(o.push(f),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const b=m.attrs,y=m.priority;if(p)b.unshift(l),y.unshift(-1);else{const C=Ob(y,c?-1:d);b.splice(C,0,l),y.splice(C,0,d)}}else r.set(f,{elem:f,attrs:l,priority:p?-1:d,array:!1})}}),o.forEach(a=>{const l=r.get(a),c=l.attrs;l.attrs=c.reduceRight((h,u)=>ct(h,u),{})}),r}updateRelativeAttrs(t,e,n){const i=e.raw||{};let o=e.normal||{};const r=e.set,a=e.position,l=e.offset,c=()=>({elem:t,cell:this.cell,view:this.view,attrs:i,refBBox:n.clone()});if(r!=null&&Object.keys(r).forEach(b=>{const y=r[b],C=this.getDefinition(b);if(C!=null){const A=D(C.set,this.view,y,c());typeof A=="object"?o=Object.assign(Object.assign({},o),A):A!=null&&(o[b]=A)}}),t instanceof HTMLElement){this.view.setAttrs(o,t);return}const h=o.transform,u=h?`${h}`:null,d=Hn(u),f=new w(d.e,d.f);h&&(delete o.transform,d.e=0,d.f=0);let p=!1;a!=null&&Object.keys(a).forEach(b=>{const y=a[b],C=this.getDefinition(b);if(C!=null){const A=D(C.position,this.view,y,c());A!=null&&(p=!0,f.translate(w.create(A)))}}),this.view.setAttrs(o,t);let m=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(t);if(b.width>0&&b.height>0){const y=Ht(b,d);Object.keys(l).forEach(C=>{const A=l[C],x=this.getDefinition(C);if(x!=null){const v=D(x.offset,this.view,A,{elem:t,cell:this.cell,view:this.view,attrs:i,refBBox:y});v!=null&&(m=!0,f.translate(w.create(v)))}})}}(h!=null||p||m)&&(f.round(1),d.e=f.x,d.f=f.y,t.setAttribute("transform",_n(d)))}update(t,e,n){const i={},o=this.findAttrs(n.attrs||e,t,i,n.selectors),r=n.attrs?this.findAttrs(e,t,i,n.selectors):o,a=[];o.each(h=>{const u=h.elem,d=h.attrs,f=this.processAttrs(u,d);if(f.set==null&&f.position==null&&f.offset==null)this.view.setAttrs(f.normal,u);else{const p=r.get(u),m=p?p.attrs:null,b=m&&d.ref==null?m.ref:d.ref;let y;if(b){if(y=(i[b]||this.view.find(b,t,n.selectors))[0],!y)throw new Error(`"${b}" reference does not exist.`)}else y=null;const C={node:u,refNode:y,attributes:m,processedAttributes:f},A=a.findIndex(x=>x.refNode===u);A>-1?a.splice(A,0,C):a.push(C)}});const l=new Uo;let c;a.forEach(h=>{const u=h.node,d=h.refNode;let f;const p=d!=null&&n.rotatableNode!=null&&wo(n.rotatableNode,d);if(d&&(f=l.get(d)),!f){const y=p?n.rotatableNode:t;f=d?he(d,{target:y}):n.rootBBox,d&&l.set(d,f)}let m;n.attrs&&h.attributes?(m=this.processAttrs(u,h.attributes),this.mergeProcessedAttrs(m,h.processedAttributes)):m=h.processedAttributes;let b=f;p&&n.rotatableNode!=null&&!n.rotatableNode.contains(u)&&(c||(c=Hn(j(n.rotatableNode,"transform"))),b=Ht(f,c)),this.updateRelativeAttrs(u,m,b)})}}class lw{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Uo,this.pathCache={}}get(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(e.matrix==null){const n=this.view.container;e.matrix=i6(t,n)}return wt(e.matrix)}getShape(t){const e=this.get(t);return e.shape==null&&(e.shape=kc(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return e.boundingRect==null&&(e.boundingRect=x6(t)),e.boundingRect.clone()}}class cw{get cell(){return this.view.cell}constructor(t,e,n=[]){this.view=t;const i={},o={};let r=0;Object.keys(e).forEach(l=>{let c=e[l];Array.isArray(c)||(c=[c]),c.forEach(h=>{let u=i[h];u||(r+=1,u=i[h]=1<<r),o[l]|=u})});let a=n;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{i[l]||(r+=1,i[l]=1<<r)}),r>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=o,this.bootstrap=n}getFlag(t){const e=this.flags;return e==null?0:Array.isArray(t)?t.reduce((n,i)=>n|e[i],0):e[t]|0}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs&&Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t}}class xt extends Ut{static getDefaults(){return xt.defaults}static isCellView(t){if(t==null)return!1;if(t instanceof xt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Lh)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"}static config(t){xt.defaults=xt.getOptions(t)}static getOptions(t){const e=(c,h)=>h!=null?xl([...Array.isArray(c)?c:[c],...Array.isArray(h)?h:[h]]):Array.isArray(c)?[...c]:[c],n=at(xt.getDefaults()),{bootstrap:i,actions:o,events:r,documentEvents:a}=t,l=V(t,["bootstrap","actions","events","documentEvents"]);return i&&(n.bootstrap=e(n.bootstrap,i)),o&&Object.entries(o).forEach(([c,h])=>{const u=n.actions[c];h&&u?n.actions[c]=e(u,h):h&&(n.actions[c]=e(h))}),r&&(n.events=Object.assign(Object.assign({},n.events),r)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),a)),ct(n,l)}get[Symbol.toStringTag](){return Lh}constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new aw(this),this.flag=new cw(this,this.options.actions,this.options.bootstrap),this.cache=new lw(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return Ge(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,this.options.events!=null&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();e!=null&&this.setAttrs(e,t);const n=this.getContainerStyle();n!=null&&this.setStyle(n,t);const i=this.getContainerClassName();i!=null&&this.addClass(i,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,i){if(this.hasAction(t,e)){n();const o=[e];return i&&(typeof i=="string"?o.push(i):o.push(...i)),this.removeAction(t,o)}return t}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:t}){this.onAttrsChange(t)}onAttrsChange(t){let e=this.flag.getChangedFlag();t.updated||!e||(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,e,t))}parseJSONMarkup(t,e){const n=Tt.parseJSONMarkup(t),i=n.selectors,o=this.rootSelector;if(e&&o){if(i[o])throw new Error("Invalid root selector");i[o]=e}return n}can(t){let e=this.graph.options.interacting;if(typeof e=="function"&&(e=D(e,this.graph,this)),typeof e=="object"){let n=e[t];return typeof n=="function"&&(n=D(n,this.graph,this)),n!==!1}return typeof e=="boolean"?e:!1}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootRotatedMatrix(),o=this.getRootTranslatedMatrix();return Ht(e,o.multiply(i).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootTranslatedMatrix();return Ht(e,i.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const n=this.cell,i=n.isNode()?n.getAngle():0;e=n.getBBox().bbox(i)}else e=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return wt().translate(e.x,e.y)}getRootRotatedMatrix(){let t=wt();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const i=e.getBBox(),o=i.width/2,r=i.height/2;t=t.translate(o,r).rotate(n).translate(-o,-r)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){n.rootBBox==null&&(n.rootBBox=new I),n.selectors==null&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(t==null||t===this.container)}prepareHighlight(t,e={}){const n=t||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,i,o){const r=this.cell,a=this.findAttr("port",t),l=t.getAttribute("data-selector"),c={cell:r.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,r.isNode()&&!r.hasPort(a)&&l==null&&(c.selector=this.getSelector(t))):l==null&&this.container!==t&&(c.selector=this.getSelector(t)),c}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,i=t.port;let o=t.magnet,r;return i!=null&&e.isNode()&&e.hasPort(i)?r=this.findPortElem(i,o)||n:(o||(o=t.selector),!o&&i!=null&&(o=`[port="${i}"]`),r=this.findOne(o,n,this.selectors)),r}hasTools(t){const e=this.tools;return e==null?!1:t==null?!0:e.name===t}addTools(t){if(this.removeTools(),t){if(!this.can("toolsAddable"))return this;const e=Ye.isToolsView(t)?t:new Ye(t);this.tools=e,e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const i=this,o=i.cell;return e==null||n==null?{e:t,view:i,cell:o}:{e:t,x:e,y:n,view:i,cell:o}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),this.notify(e,Object.assign({},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){}onMagnetDblClick(t,e,n,i){}onMagnetContextMenu(t,e,n,i){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.getEventTarget(t,{fromPoint:!0}),n=this.graph.findViewByElem(e);n!==this&&(this.onMouseLeave(t),n&&n.onMouseEnter(t))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}xt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},xt.registry=ut.create({type:"view"}),H([_()],xt.prototype,"dispose",null);const Lh=`X6.${xt.name}`;class Ye extends Ut{static isToolsView(t){if(t==null)return!1;if(t instanceof Ye)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===zh)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return zh}constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}createContainer(t,e){const n=t?Ge("g",!0):Ge("div",!1);return O(n,this.prefixClassName("cell-tools")),e.className&&O(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!xt.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(O(this.svgContainer,this.prefixClassName("edge-tools")),O(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(O(this.svgContainer,this.prefixClassName("node-tools")),O(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach(i=>{lt.isToolItem(i)?i.name==="vertices"?n.unshift(i):n.push(i):(typeof i=="object"?i.name:i)==="vertices"?n.unshift(i):n.push(i)});for(let i=0;i<n.length;i+=1){const o=n[i];let r;if(lt.isToolItem(o))r=o;else{const a=typeof o=="object"?o.name:o,l=typeof o=="object"?o.args||{}:{};if(a){if(this.cell.isNode()){const c=yi.get(a);if(c)r=new c(l);else return yi.onNotFound(a)}else if(this.cell.isEdge()){const c=Ci.get(a);if(c)r=new c(l);else return Ci.onNotFound(a)}}}r&&(r.config(this.cellView,this),r.render(),(r.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(r.container),this.tools.push(r))}return this}update(t={}){const e=this.tools;return e&&e.forEach(n=>{t.toolId!==n.cid&&n.isVisible()&&n.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(n=>{t===n?n.show():n.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(n=>{n!==t&&!n.isVisible()&&(n.show(),n.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(e=>e.remove()),this.tools=null),Gt(this.svgContainer),Gt(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some(o=>o.options.isSVGElement!==!1),i=t.some(o=>o.options.isSVGElement===!1);n&&(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer),i&&this.graph.container.appendChild(this.htmlContainer)}return this}}Ye.toStringTag=`X6.${Ye.name}`;const zh=`X6.${Ye.name}`,hw=s=>s;function Fh(s,t){return t===0?"0%":`${Math.round(s/t*100)}%`}function Uh(s){return(e,n,i,o)=>n.isEdgeElement(i)?dw(s,e,n,i,o):uw(s,e,n,i,o)}function uw(s,t,e,n,i){const o=e.cell,r=o.getAngle(),a=e.getUnrotatedBBoxOfElement(n),l=o.getBBox().getCenter(),c=w.create(i).rotate(r,l);let h=c.x-a.x,u=c.y-a.y;return s&&(h=Fh(h,a.width),u=Fh(u,a.height)),t.anchor={name:"topLeft",args:{dx:h,dy:u,rotate:!0}},t}function dw(s,t,e,n,i){const o=e.getConnection();if(!o)return t;const r=o.closestPointLength(i);if(s){const a=o.length();t.anchor={name:"ratio",args:{ratio:r/a}}}else t.anchor={name:"length",args:{length:r}};return t}const gw=Uh(!0),fw=Uh(!1),Vh=Object.freeze(Object.defineProperty({__proto__:null,noop:hw,pinAbsolute:fw,pinRelative:gw},Symbol.toStringTag,{value:"Module"}));ut.create({type:"connection strategy"}).register(Vh,!0);function Kh(s,t,e,n){return D(Vh.pinRelative,this.graph,{},t,e,s,this.cell,n,{}).anchor}function Jh(s,t){return t?s.cell.getBBox():s.cell.isEdge()?s.getConnection().bbox():s.getUnrotatedBBoxOfElement(s.container)}class fi extends lt{get type(){return this.options.type}onRender(){O(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,i=this.cellView,o=this.options,r=i.getTerminalAnchor(n),a=i.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${r.x}, ${r.y})`);const l=a?o.customAnchorAttrs:o.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{e.setAttribute(c,l[c])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,i=this.cellView,o=i.getTerminalView(n);if(o){const r=o.cell,a=i.getTerminalMagnet(n);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,h,u;o.isEdgeElement(a)?(c=o.getBBox(),h=0,u=c.getCenter()):(c=o.getUnrotatedBBoxOfElement(a),h=r.getAngle(),u=c.getCenter(),h&&u.rotate(-h,r.getBBox().getCenter())),c.inflate(l),j(e,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${u.x}, ${u.y}) rotate(${h})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,n=this.cellView,i=n.getTerminalView(e);if(i==null)return;const o=this.normalizeEvent(t),r=i.cell,a=n.getTerminalMagnet(e);let l=this.graph.coord.clientToLocalPoint(o.clientX,o.clientY);const c=this.options.snap;if(typeof c=="function"){const d=D(c,n,l,i,a,e,n,this);l=w.create(d)}if(this.options.restrictArea)if(i.isEdgeElement(a)){const d=i.getClosestPoint(l);d&&(l=d)}else{const d=i.getUnrotatedBBoxOfElement(a),f=r.getAngle(),p=r.getBBox().getCenter(),m=l.clone().rotate(f,p);d.containsPoint(m)||(l=d.getNearestPointToPoint(m).rotate(-f,p))}let h;const u=this.options.anchor;typeof u=="function"&&(h=D(u,n,l,i,a,e,n,this)),this.resetAnchor(h),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(t===!0?void 0:t),this.update()}}fi.defaults=Object.assign(Object.assign({},lt.getDefaults()),{tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:Kh,snap(s,t,e,n,i,o){const r=o.options.snapRadius||0,a=n==="source",l=a?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return c&&(Math.abs(c.x-s.x)<r&&(s.x=c.x),Math.abs(c.y-s.y)<r&&(s.y=c.y)),s}});class jh extends fi{}jh.defaults=Object.assign(Object.assign({},fi.getDefaults()),{name:"source-anchor",type:"source"});class Gh extends fi{}Gh.defaults=Object.assign(Object.assign({},fi.getDefaults()),{name:"target-anchor",type:"target"});class pi extends lt{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=V(t,["class"]);this.setAttrs(n,this.container),e&&O(this.container,e)}}onRender(){O(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),i=n?n.start:e.getPointAtRatio(t),o=n&&n.vector().vectorAngle(new w(1,0))||0;if(!i)return this;const r=wt().translate(i.x,i.y).rotate(o);return fn(this.container,r,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),i=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(t,i),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,i=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}pi.defaults=Object.assign(Object.assign({},lt.getDefaults()),{tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}});class Yh extends pi{}Yh.defaults=Object.assign(Object.assign({},pi.getDefaults()),{name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Hh extends pi{}Hh.defaults=Object.assign(Object.assign({},pi.getDefaults()),{name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class tr extends lt{onRender(){if(O(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=V(t,["class"]);j(this.container,Gn(n)),e&&O(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:i}=e,o=ne(e.padding);let r=Jh(t,n);this.parent.options.local&&(r=r.translate({x:-r.x,y:-r.y})),r=r.moveAndExpand({x:-o.left,y:-o.top,width:o.left+o.right,height:o.top+o.bottom});const a=t.cell;if(a.isNode()){const l=a.getAngle();if(l!=null)if(i&&!this.parent.options.local){const c=a.getBBox().getCenter();No(this.container,l,c.x,c.y,{absolute:!0})}else i||(r=r.bbox(l))}return j(this.container,r.toJSON()),this}}tr.defaults=Object.assign(Object.assign({},lt.getDefaults()),{name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}});class mi extends lt{onRender(){O(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();fn(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:i=0}=e;const{offset:o,useCellGeometry:r,rotate:a}=e;let l=Jh(t,r);const c=t.cell.getAngle();a||(l=l.bbox(c));let h=0,u=0;typeof o=="number"?(h=o,u=o):typeof o=="object"&&(h=o.x,u=o.y),n=Vt(n,l.width),i=Vt(i,l.height);let d=wt();return this.parent.options.local?d=d.translate(l.width/2,l.height/2):d=d.translate(l.x+l.width/2,l.y+l.height/2),a&&(d=d.rotate(c)),d=d.translate(n+h-l.width/2,i+u-l.height/2),d}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:i=0,rotate:o}=e,r=Vt(i,1),a=r>=0&&r<=1?t.getTangentAtRatio(r):t.getTangentAtLength(r),l=a?a.start:t.getConnection().start,c=a&&a.vector().vectorAngle(new w(1,0))||0;let h=wt().translate(l.x,l.y).rotate(c);return typeof n=="object"?h=h.translate(n.x||0,n.y||0):h=h.translate(0,n),o||(h=h.rotate(-c)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;typeof e=="function"&&D(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}mi.defaults=Object.assign(Object.assign({},lt.getDefaults()),{name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}});class er extends mi{}er.defaults=Object.assign(Object.assign({},mi.getDefaults()),{name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:s,btn:t}){t.parent.remove(),s.cell.remove({ui:!0,toolId:t.cid})}});class bi extends lt{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const t=this.cellView;t&&t.on("cell:dblclick",this.dblClick)}createElement(){const t=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Ge("div",!1),this.addClass(t,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:t,editor:e}=this;if(!e)return;const{style:n}=e;t.isNode()?this.updateNodeEditorTransform():t.isEdge()&&this.updateEdgeEditorTransform();const{attrs:i}=this.options;n.fontSize=`${i.fontSize}px`,n.fontFamily=i.fontFamily,n.color=i.color,n.backgroundColor=i.backgroundColor;const o=this.getCellText()||"";return e.innerText=o,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:t,cell:e,editor:n}=this;if(!n)return;let i=w.create(),o=20,r="",{x:a,y:l}=this.options;const{width:c,height:h}=this.options;if(typeof a<"u"&&typeof l<"u"){const f=e.getBBox();a=Vt(a,f.width),l=Vt(l,f.height),i=f.topLeft.translate(a,l),o=f.width-a*2}else{const f=e.getBBox();i=f.center,o=f.width-4,r="translate(-50%, -50%)"}const u=t.scale(),{style:d}=n;i=t.localToGraph(i),d.left=`${i.x}px`,d.top=`${i.y}px`,d.transform=`scale(${u.sx}, ${u.sy}) ${r}`,d.minWidth=`${o}px`,typeof c=="number"&&(d.width=`${c}px`),typeof h=="number"&&(d.height=`${h}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:t,editor:e}=this;if(!e)return;let n=w.create(),i=20;const{style:o}=e,r=this.event.target,a=r.parentElement;if(a&&ce(a,this.prefixClassName("edge-label"))){const h=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);const u=a.getAttribute("transform"),{translation:d}=is(u);n=new w(d.tx,d.ty),i=he(r).width}else{if(!this.options.labelAddable)return this;n=t.clientToLocal(w.create(this.event.clientX,this.event.clientY));const u=this.cellView.path.closestPointLength(n);this.distance=u,this.labelIndex=-1}n=t.localToGraph(n);const c=t.scale();o.left=`${n.x}px`,o.top=`${n.y}px`,o.minWidth=`${i}px`,o.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}updateCell(){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}onDocumentMouseUp(t){this.editor&&t.target!==this.editor&&this.updateCell()}onCellDblClick({e:t}){this.editor||(t.stopPropagation(),this.removeElement(),this.event=t,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}getCellText(){const{getText:t}=this.options;if(typeof t=="function")return D(t,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof t=="string"){if(this.cell.isNode())return this.cell.attr(t);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${t}`)}}setCellText(t){const e=this.options.setText;if(typeof e=="function"){D(e,this.cellView,{cell:this.cell,value:t,index:this.labelIndex,distance:this.distance});return}if(typeof e=="string"){if(this.cell.isNode()){t!==null&&this.cell.attr(e,t);return}if(this.cell.isEdge()){const n=this.cell;if(this.labelIndex===-1){if(t){const i={position:{distance:this.distance},attrs:{}};gn(i,`attrs/${e}`,t),n.appendLabel(i)}}else t!==null?n.prop(`labels/${this.labelIndex}/attrs/${e}`,t):typeof this.labelIndex=="number"&&n.removeLabelAt(this.labelIndex)}}}onRemove(){const t=this.cellView;t&&t.off("cell:dblclick",this.dblClick),this.removeElement()}}bi.defaults=Object.assign(Object.assign({},lt.getDefaults()),{tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}});class _h extends bi{}_h.defaults=ct({},bi.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"});class Wh extends bi{}Wh.defaults=ct({},bi.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"});class nr extends lt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}getPoints(){const e=this.cellView.routePoints;if(e.length<=2)return e;const n=[e[0]];for(let i=1;i<e.length-1;i++){const o=n[n.length-1],r=e[i],a=e[i+1];(r.x-o.x)*(a.y-o.y)-(r.y-o.y)*(a.x-o.x)!==0&&n.push(r)}return n.push(e[e.length-1]),n}onRender(){O(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.getPoints()];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,i=e.length;n<i-1;n+=1){const o=e[n],r=e[n+1],a=this.renderHandle(o,r,n);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(t,e,n){const i=this.options.createHandle({index:n,graph:this.graph,guard:o=>this.guard(o),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.updateHandle(i,t,e),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let n=0,i=e.length;n<i;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,i={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,i):n.removeProp([t,"anchor"],i)}snapHandle(t,e,n){const i=t.options.axis,o=t.options.index,l=this.cellView.cell.getVertices(),c=l[o-2]||n.sourceAnchor,h=l[o+1]||n.targetAnchor,u=this.options.snapRadius;return Math.abs(e[i]-c[i])<u?e[i]=c[i]:Math.abs(e[i]-h[i])<u&&(e[i]=h[i]),e}onHandleChanging({handle:t,e}){const n=this.graph,i=this.options,o=this.cellView,r=i.anchor,a=t.options.axis,l=t.options.index-1,c=this.getEventData(e),h=this.normalizeEvent(e),u=n.snapToGrid(h.clientX,h.clientY),d=this.snapHandle(t,u.clone(),c),f=at(this.vertices);let p=f[l],m=f[l+1];const b=o.sourceView,y=o.sourceBBox;let C=!1,A=!1;if(p?l===0?y.containsPoint(p)?(f.shift(),this.shiftHandleIndexes(-1),C=!0):(p[a]=d[a],A=!0):p[a]=d[a]:(p=o.sourceAnchor.toJSON(),p[a]=d[a],y.containsPoint(p)?C=!0:(f.unshift(p),this.shiftHandleIndexes(1),A=!0)),typeof r=="function"&&b){if(C){const M=c.sourceAnchor.clone();M[a]=d[a];const k=D(r,o,M,b,o.sourceMagnet||b.container,"source",o,this);this.resetAnchor("source",k)}A&&this.resetAnchor("source",c.sourceAnchorDef)}const x=o.targetView,v=o.targetBBox;let B=!1,E=!1;if(m?l===f.length-2?v.containsPoint(m)?(f.pop(),B=!0):(m[a]=d[a],E=!0):m[a]=d[a]:(m=o.targetAnchor.toJSON(),m[a]=d[a],v.containsPoint(m)?B=!0:(f.push(m),E=!0)),typeof r=="function"&&x){if(B){const M=c.targetAnchor.clone();M[a]=d[a];const k=D(r,o,M,x,o.targetMagnet||x.container,"target",o,this);this.resetAnchor("target",k)}E&&this.resetAnchor("target",c.targetAnchorDef)}w.equalPoints(f,this.vertices)||this.cellView.cell.setVertices(f,{ui:!0,toolId:this.cid}),this.updateHandle(t,p,m,0),i.stopPropagation||o.notifyMouseMove(h,u.x,u.y)}onHandleChange({handle:t,e}){const n=this.options,i=this.handles,o=this.cellView,r=t.options.index;if(Array.isArray(i)){for(let a=0,l=i.length;a<l;a+=1)a!==r&&i[a].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:o.sourceAnchor.clone(),targetAnchor:o.targetAnchor.clone(),sourceAnchorDef:at(this.cell.prop(["source","anchor"])),targetAnchorDef:at(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const a=this.normalizeEvent(e),l=this.graph.snapToGrid(a.clientX,a.clientY);o.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(t),o=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(i,o.x,o.y),n.checkMouseleave(i),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,i=0){const o=this.options.precision||0,r=Math.abs(e.x-n.x)<o,a=Math.abs(e.y-n.y)<o;if(r||a){const l=new N(e,n);if(l.length()<this.options.threshold)t.hide();else{const h=l.getCenter(),u=r?"x":"y";h[u]+=i||0;const d=l.vector().vectorAngle(new w(1,0));t.updatePosition(h.x,h.y,d,this.cellView),t.show(),t.options.axis=u}}else t.hide()}onRemove(){this.resetHandles()}}nr.defaults=Object.assign(Object.assign({},lt.defaults),{name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:s=>new pw(s),anchor:Kh});let pw=class extends Ut{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Ge("rect",!0);const t=this.options.attrs;if(typeof t=="function"){const e=nr.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,i){const o=i.getClosestPoint(new w(t,e))||new w(t,e);let r=wt().translate(o.x,o.y);if(o.equals({x:t,y:e}))r=r.rotate(n);else{let l=new N(t,e,o.x,o.y).vector().vectorAngle(new w(1,0));l!==0&&(l+=90),r=r.rotate(l)}this.setAttrs({transform:_n(r),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}};const ir=X.prefix("edge-tool-vertex-path");class sr extends lt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const i=t[e],o=this.options.createHandle,r=this.options.processHandle,a=o({index:e,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});r&&r(a),a.updatePosition(i.x,i.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const i=t[e],o=this.handles[e];o&&o.updatePosition(i.x,i.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,i=t>0?n[t-1]:e.sourceAnchor,o=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:w.create(i),next:w.create(o)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:i}=this.graph.snapToGrid(e.clientX,e.clientY);return{e,x:n,y:i}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:i,y:o}=this.getMouseEventArgs(t);this.eventData(n,{start:{x:i,y:o}}),e.notifyMouseDown(n,i,o)}}onHandleChanging({handle:t,e}){const n=this.cellView,i=t.options.index,{e:o,x:r,y:a}=this.getMouseEventArgs(e),l={x:r,y:a};this.snapVertex(l,i),n.cell.setVertexAt(i,l,{ui:!0,toolId:this.cid}),t.updatePosition(l.x,l.y),this.options.stopPropagation||n.notifyMouseMove(o,r,a)}stopBatch(t){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),t&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies){this.stopBatch(this.eventData(t).vertexAdded);return}n.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(t).vertexAdded);const{e:o,x:r,y:a}=this.getMouseEventArgs(t);if(!this.options.stopPropagation){n.notifyMouseUp(o,r,a);const{start:l}=this.eventData(o);if(l){const{x:c,y:h}=l;c===r&&h===a&&n.onClick(o,r,a)}}n.checkMouseleave(o),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const i=this.getNeighborPoints(e),o=i.prev,r=i.next;Math.abs(t.x-o.x)<n?t.x=o.x:Math.abs(t.x-r.x)<n&&(t.x=r.x),Math.abs(t.y-o.y)<n?t.y=i.prev.y:Math.abs(t.y-r.y)<n&&(t.y=r.y)}}onHandleRemove({handle:t,e}){if(this.options.removable){const n=t.options.index,i=this.cellView;i.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(e))}}allowAddVertex(t){const e=this.guard(t),n=this.options.addable&&this.cellView.can("vertexAddable"),i=this.options.modifiers?Te(t,this.options.modifiers):!0;return!e&&n&&i}onPathMouseDown(t){const e=this.cellView;if(!this.allowAddVertex(t))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),i=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const o=e.getVertexIndex(i.x,i.y);this.snapVertex(i,o),e.cell.insertVertex(i,o,{ui:!0,toolId:this.cid}),this.render();const r=this.handles[o];this.eventData(n,{vertexAdded:!0}),r.onMouseDown(n)}onRemove(){this.resetHandles()}}sr.defaults=Object.assign(Object.assign({},lt.getDefaults()),{name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:s=>new mw(s),markup:[{tagName:"path",selector:"connection",className:ir,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${ir}`]:"onPathMouseDown",[`touchstart .${ir}`]:"onPathMouseDown"}});class mw extends Ut{get graph(){return this.options.graph}constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=Ge("circle",!0);const t=this.options.attrs;if(typeof t=="function"){const e=sr.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}const bw={boundary:tr,button:mi,"button-remove":er,"node-editor":_h},yi=ut.create({type:"node tool",process(s,t){if(typeof t=="function")return t;let e=lt;const{inherit:n}=t,i=V(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return i.name==null&&(i.name=s),e.define.call(e,i)}});yi.register(bw,!0);const yw={boundary:tr,vertices:sr,segments:nr,button:mi,"button-remove":er,"source-anchor":jh,"target-anchor":Gh,"source-arrowhead":Yh,"target-arrowhead":Hh,"edge-editor":Wh},Ci=ut.create({type:"edge tool",process(s,t){if(typeof t=="function")return t;let e=lt;const{inherit:n}=t,i=V(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return i.name==null&&(i.name=s),e.define.call(e,i)}});Ci.register(yw,!0);class qh{constructor(t,e,n,i){var o;this.target=t,this.cell=(o=this.target.effect)===null||o===void 0?void 0:o.target,this.type=e,this.bubbles=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=0,this.timeStamp=performance.now(),this.currentTime=n,this.timelineTime=i}}function Es(s){return s!=="offset"&&s!=="easing"&&s!=="composite"&&s!=="computedOffset"}function Xh(s,t){return s==="reverse"||s==="alternate"&&t%2===1||s==="alternate-reverse"&&t%2===0}class Cw{constructor(t,e){this._effect=null,this._currentTime=null,this._playbackRate=1,this._playState="idle",this._rafId=null,this._startTime=null,this._pausedTime=null,this._timeline=null,this.id="",this.onfinish=null,this.oncancel=null,this._effect=t,this._timeline=e??document.timeline}get effect(){return this._effect}get currentTime(){return this._currentTime}set currentTime(t){const e=this._timeline.currentTime;be(e)&&(this._startTime=e-t,this._currentTime=t)}get playbackRate(){return this._playbackRate}set playbackRate(t){const e=this._playbackRate;this._playbackRate=t;const n=this._timeline.currentTime;if(this._playState==="running"&&this._startTime!=null&&be(n)){const i=(n-this._startTime)*e;this._startTime=n-i/t}}get playState(){return this._playState}get timeline(){return this._timeline}play(){if(this._playState==="running"||!this._effect)return;const t=this._timeline.currentTime;be(t)&&(this._playState==="paused"?(this._startTime=t-this._pausedTime/this._playbackRate,this._pausedTime=null):(this._currentTime=0,this._startTime=t),this._playState="running",this._tick())}pause(){this._playState==="running"&&(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._pausedTime=this._currentTime,this._playState="paused")}finish(){var t;if(!this._effect)return;const e=this._effect.getComputedTiming(),n=this._playbackRate<0,{duration:i,endTime:o,direction:r,fill:a,iterations:l}=e;if(a==="forwards"||a==="both"){const h=n?0:l-1,u=Xh(r,h);this._effect.apply(u||n?0:i)}else(a==="none"||a==="backwards")&&this._effect.apply(null);this._currentTime=n?0:o,this._playState="finished",this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null);const c=new qh(this,"finish",this._currentTime,this._timeline.currentTime);(t=this.onfinish)===null||t===void 0||t.call(this,c),this._effect.target.notify("animation:finish",c)}cancel(){var t;if(!this._effect)return;this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._playState="idle",this._currentTime=null,this._startTime=null,this._pausedTime=null,this._effect.apply(null);const e=new qh(this,"cancel",this._currentTime,this._timeline.currentTime);(t=this.oncancel)===null||t===void 0||t.call(this,e),this._effect.target.notify("animation:cancel",e)}updatePlaybackRate(t){this.playbackRate=t}reverse(){this.playbackRate=this.playbackRate*-1}_tick(){const t=this._timeline.currentTime;if(this._playState!=="running"||!this._effect||!be(t))return;const e=this._effect.getComputedTiming(),{duration:n,delay:i,iterations:o,direction:r,endTime:a}=e,l=(t-this._startTime)*this._playbackRate,c=l-i;let h=Math.floor(c/n);if(l>=a||l<0||n<=0){this.finish();return}if(l>=i){let u=c%n;h=Math.min(h,o-1),Xh(r,h)&&(u=n-u),this._effect.apply(u)}this._currentTime=l,this._rafId=requestAnimationFrame(()=>this._tick())}}class ww{constructor(){this.animations=[]}addAnimation(t){this.animations.push(t)}getAnimations(){return this.animations}cancelAnimations(){this.animations.forEach(t=>{t.cancel()})}}class Aw{constructor(t,e,n){this._originProps={},this._target=t,this._options=be(n)?{duration:n}:Object.assign({},n),this.setKeyframes(e)}get target(){return this._target}getKeyframes(){if(!this._keyframes||this._keyframes.length===0)return[];let t=[];if(Array.isArray(this._keyframes)&&(t=[...this._keyframes]),te(this._keyframes)){const n=Object.values(this._keyframes).map(o=>Na(o).length),i=Math.max(...n);for(let o=0;o<i;o++){const r={};Object.entries(this._keyframes).forEach(([a,l])=>{const c=Na(l)[o];Es(a)&&c!=null&&(r[a]=c)}),t.push(r)}}return t=t.map((e,n,i)=>{var o,r,a;const l=e??{},c={};return c.offset=l.offset,c.easing=(a=(o=l.easing)!==null&&o!==void 0?o:(r=i[n-1])===null||r===void 0?void 0:r.easing)!==null&&a!==void 0?a:this.getComputedTiming().easing,Object.keys(l).forEach(h=>{Es(h)&&(c[h]=l[h])}),c}),t=t.map((e,n)=>(e.offset==null?n===t.length-1?e.computedOffset=1:n===0?e.computedOffset=0:e.computedOffset=n/(t.length-1):e.computedOffset=e.offset,e)),t}setKeyframes(t){this._keyframes=t,this._computedKeyframes=this.getKeyframes(),this._computedKeyframes.forEach(e=>{Object.keys(e).forEach(n=>{Es(n)&&this._originProps[n]==null&&(this._originProps[n]=this.target.getPropByPath(n))})})}getTiming(){return q1(this._options,xw)}getComputedTiming(){const t=this.getTiming(),e=t.duration*t.iterations;return Object.assign(Object.assign({},t),{activeDuration:e,endTime:e+t.delay})}apply(t){var e,n,i,o;if(!this._target||!this._computedKeyframes.length)return;if(t==null){Object.entries(this._originProps).forEach(([C,A])=>{this.target.setPropByPath(C,A)});return}const a=this.getComputedTiming().duration;if(a<0)return;const l=Math.min(t/a,1),c=this._computedKeyframes;if(c.length===0)return;let h={computedOffset:0},u={computedOffset:1};for(const C of c)if(l===0&&C.computedOffset===0&&(h=C),l===1&&C.computedOffset===1&&(u=C),C.computedOffset<l&&(h=C),C.computedOffset>l){u=C;break}const d=h.computedOffset,f=u.computedOffset,p=(l-d)/(f-d),m=(e=h.easing)!==null&&e!==void 0?e:u.easing,b=Fn(m),y=(n=lC[b])!==null&&n!==void 0?n:Pc;for(const C in Object.assign(Object.assign({},h),u))if(Es(C)&&(h[C]!=null||u[C]!=null)){const A=(i=h[C])!==null&&i!==void 0?i:this._originProps[C],x=(o=u[C])!==null&&o!==void 0?o:this._originProps[C];let v;String(A).startsWith("#")?v=M6:C.endsWith("transform")&&!be(A)?v=B6:Xn.test(String(A))||Xn.test(String(x))?v=Tc:v=Ic;const E=v(A,x)(y(p));this.target.setPropByPath(C,E)}}}const xw={delay:0,direction:"normal",duration:0,easing:"linear",fill:"none",iterations:1};class $h extends Nt{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(at(t)),this.changed={}}mutate(t,e={}){const n=e.unset===!0,i=e.silent===!0,o=[],r=this.changing;this.changing=!0,r||(this.previous=at(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(t).forEach(h=>{const u=h,d=t[u];me(a[u],d)||o.push(u),me(l[u],d)?delete c[u]:c[u]=d,n?delete a[u]:a[u]=d}),!i&&o.length>0&&(this.pending=!0,this.pendingOptions=e,o.forEach(h=>{this.emit("change:*",{key:h,options:e,store:this,current:a[h],previous:l[h]})})),r)return this;if(!i)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(t==null)return this.data;const n=this.data[t];return n??e}getPrevious(t){if(this.previous){const e=this.previous[t];return e??void 0}}set(t,e,n){return t!=null&&(typeof t=="object"?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const i={};let o;if(typeof t=="string")i[t]=void 0,o=e;else if(Array.isArray(t))t.forEach(r=>i[r]=void 0),o=e;else{for(const r in this.data)i[r]=void 0;o=t}return this.mutate(i,Object.assign(Object.assign({},o),{unset:!0})),this}getByPath(t){return To(this.data,t,"/")}setByPath(t,e,n={}){const i="/",o=Array.isArray(t)?[...t]:t.split(i),r=Array.isArray(t)?t.join(i):t,a=o[0],l=o.length;if(n.propertyPath=r,n.propertyValue=e,n.propertyPathArray=o,l===1)this.set(a,e,n);else{const c={};let h=c,u=a;for(let p=1;p<l;p+=1){const m=o[p],b=Number.isFinite(Number(m));h=h[u]=b?[]:{},u=m}gn(c,o,e,i);const d=at(this.data);n.rewrite&&nc(d,t,i);const f=ct(d,c);this.set(a,f[a],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),i=n[0];if(n.length===1)this.remove(i,e);else{const o=n.slice(1),r=at(this.get(i));r&&nc(r,o),this.set(i,r,e)}return this}hasChanged(t){return t==null?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(t==null)return this.hasChanged()?at(this.changed):null;const e=this.changing?this.previous:this.data,n={};let i;for(const o in t){const r=t[o];me(e[o],r)||(n[o]=r,i=!0)}return i?at(n):null}toJSON(){return at(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}H([_()],$h.prototype,"dispose",null);class G extends Nt{static isCell(t){if(t==null)return!1;if(t instanceof G)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===G.toStringTag)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"}static normalizeTools(t){if(typeof t=="string")return{items:[t]};if(Array.isArray(t))return{items:t};if(t.items)return t;if(Reflect.has(t,"local")){const e=t,{local:n}=e,i=V(e,["local"]);return{local:n,items:[i]}}return{items:[t]}}static getCommonAncestor(...t){const e=t.filter(i=>i!=null).map(i=>i.getAncestors()).sort((i,o)=>i.length-o.length);return e.shift().find(i=>e.every(o=>o.includes(i)))||null}static getCellsBBox(t,e={}){let n=null;for(let i=0,o=t.length;i<o;i+=1){const r=t[i];let a=r.getBBox(e);if(a){if(r.isNode()){const l=r.getAngle();l!=null&&l!==0&&(a=a.bbox(l))}n=n==null?a:n.union(a)}}return n}static deepClone(t){const e=[t,...t.getDescendants({deep:!0})];return G.cloneCells(e)}static cloneCells(t){const e=xl(t),n=e.reduce((i,o)=>(i[o.id]=o.clone(),i),{});return e.forEach(i=>{const o=n[i.id];if(o.isEdge()){const l=o.getSourceCellId(),c=o.getTargetCellId();l&&n[l]&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:n[l].id})),c&&n[c]&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:n[c].id}))}const r=i.getParent();r&&n[r.id]&&o.setParent(n[r.id]);const a=i.getChildren();if(a&&a.length){const l=a.reduce((c,h)=>(n[h.id]&&c.push(n[h.id]),c),[]);l.length>0&&o.setChildren(l)}}),n}static config(t){const{markup:e,propHooks:n,attrHooks:i}=t,o=V(t,["markup","propHooks","attrHooks"]);e!=null&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):typeof n=="function"?this.propHooks.push(n):Object.values(n).forEach(r=>{typeof r=="function"&&this.propHooks.push(r)})),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=ct({},this.defaults,o)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:at(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((n,i)=>i?D(i,t,n):n,e)}static generateId(t={}){return Bo()}get[Symbol.toStringTag](){return G.toStringTag}constructor(t={}){super();const n=this.constructor.getDefaults(!0),i=ct({},this.preprocess(n),this.preprocess(t));this.id=i.id||G.generateId(t),this.store=new $h(i),this.animationManager=new ww,this.setup(),this.init(),this.postprocess(t)}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,o=this.constructor.applyPropHooks(this,t);return n==null&&e!==!0&&(o.id=G.generateId(t)),o}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:n,previous:i,options:o}=t;this.notify("change:*",{key:e,options:o,current:n,previous:i,cell:this}),this.notify(`change:${e}`,{options:o,current:n,previous:i,cell:this});const r=e;(r==="source"||r==="target")&&this.notify("change:terminal",{type:r,current:n,previous:i,options:o,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this})),this.on("added",({cell:t})=>{const e=this.store.get("animation");lo(e)||e.forEach(n=>{t.animate(...n)})})}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify(`cell:${t}`,e),this.isNode()?n.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return t==null?this.store.get():this.store.get(t,e)}setProp(t,e,n){if(typeof t=="string")this.store.set(t,e,n);else{const i=this.preprocess(t,!0);this.store.set(ct({},this.getProp(),i),e),this.postprocess(t)}return this}removeProp(t,e){return typeof t=="string"||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return t==null?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&(t==="children"?this._children=e?e.map(i=>this.model.getCell(i)).filter(i=>i!=null):null:t==="parent"&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return n[0]==="attrs"&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return t==null?this.getProp():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getPropByPath(t):e==null?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){t==null?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n=e.getMaxZIndex(),i;t.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this],n=n-i.length+1;const o=e.total();let r=e.indexOf(this)!==o-i.length;r||(r=i.some((a,l)=>a.getZIndex()!==n+l)),r&&this.batchUpdate("to-front",()=>{n+=i.length,i.forEach((a,l)=>{a.setZIndex(n+l,t)})})}return this}toBack(t={}){const e=this.model;if(e){let n=e.getMinZIndex(),i;t.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this];let o=e.indexOf(this)!==0;o||(o=i.some((r,a)=>r.getZIndex()!==n+a)),o&&this.batchUpdate("to-back",()=>{n-=i.length,i.forEach((r,a)=>{r.setZIndex(n+a,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){t==null?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");return t==null&&(t=this.constructor.getMarkup()),t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){t==null?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(t==null)this.removeAttrs(e);else{const n=i=>this.store.set("attrs",i,e);if(e.overwrite===!0)n(t);else{const i=this.getAttrs();e.deep===!1?n(Object.assign(Object.assign({},i),t)):n(ct({},i,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const n=this.constructor.getAttrHooks()||{};let i=n[t]||ti.get(t);if(!i){const o=Fn(t);i=n[o]||ti.get(o)}return i||null}getAttrByPath(t){return t==null||t===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,n){return t==null?this.getAttrByPath():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getAttrByPath(t):e==null?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return this.store.get("visible")!==!1}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n=typeof t=="boolean"?t:!this.isVisible(),i=typeof t=="boolean"?e:t;return n?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(t==null)this.removeData(e);else{const n=i=>this.store.set("data",i,e);if(e.overwrite===!0)n(t);else{const i=this.getData();e.deep===!1?n(typeof t=="object"?Object.assign(Object.assign({},i),t):t):n(ct({},i,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(n=>{var i;return(i=this.model)===null||i===void 0?void 0:i.getCell(n)}).filter(n=>n!=null);return this._children=e,[...e]}return null}hasParent(){return this.parent!=null}isParentOf(t){return t!=null&&t.getParent()===this}isChildOf(t){return t!=null&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(t){return this.children==null?-1:this.children.indexOf(t)}getChildAt(t){return this.children!=null&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();for(;n;)e.push(n),n=t.deep!==!1?n.getParent():null;return e}getDescendants(t={}){if(t.deep!==!1){if(t.breadthFirst){const e=[],n=this.getChildren()||[];for(;n.length>0;){const i=n.shift(),o=i.getChildren();e.push(i),o&&n.push(...o)}return e}{const e=this.getChildren()||[];return e.forEach(n=>{e.push(...n.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(t==null)return!1;if(e.deep!==!1){let n=this.getParent();for(;n;){if(n===t)return!0;n=n.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return t==null?!1:t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return G.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,t!=null?this.store.set("children",t.map(n=>n.id),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(n!=null&&t!=null){const i=this.getChildIndex(t);i!==-1&&(n.splice(i,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return G.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(t!=null&&t!==this){const i=t.getParent(),o=this!==i;let r=e;if(r==null&&(r=this.getChildCount(),o||(r-=1)),i){const l=i.getChildren();if(l){const c=l.indexOf(t);c>=0&&(t.setParent(null,n),l.splice(c,1),i.setChildren(l,n))}}let a=this.children;if(a==null?(a=[],a.push(t)):a.splice(r,0,t),t.setParent(this,n),this.setChildren(a,n),o&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(h=>h.updateParent(n)),c&&c.forEach(h=>h.updateParent(n))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(e!=null){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t);return this.children!=null&&n!=null&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),t.deep!==!1&&this.eachChild(n=>n.remove(t)),this.model&&this.model.removeCell(this,t),this.dispose()}),this}animate(t,e){var n;const i=be(e)?{duration:e}:Object.assign({},e),o=new Aw(this,t,i),r=new Cw(o,i.timeline);return this.animationManager.addAnimation(r),r.id=(n=i.id)!==null&&n!==void 0?n:"",r.play(),r}getAnimations(){return this.animationManager.getAnimations()}translate(t,e,n){return this}scale(t,e,n,i){return this}addTools(t,e,n){const i=Array.isArray(t)?t:[t],o=typeof e=="string"?e:null,r=typeof e=="object"?e:typeof n=="object"?n:{};if(r.reset)return this.setTools({name:o,items:i,local:r.local},r);let a=at(this.getTools());if(a==null||o==null||a.name===o)return a==null&&(a={}),a.items||(a.items=[]),a.name=o,a.items=[...a.items,...i],this.setTools(Object.assign({},a),r)}setTools(t,e={}){return t==null?this.removeTools():this.store.set("tools",G.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return e==null?!1:t==null?!0:e.name===t}hasTool(t){const e=this.getTools();return e==null?!1:e.items.some(n=>typeof n=="string"?n===t:n.name===t)}removeTool(t,e={}){const n=at(this.getTools());if(n){let i=!1;const o=n.items.slice(),r=a=>{o.splice(a,1),i=!0};if(typeof t=="number")r(t);else for(let a=o.length-1;a>=0;a-=1){const l=o[a];(typeof l=="string"?l===t:l.name===t)&&r(a)}i&&(n.items=o,this.setTools(n,e))}return this}getBBox(t){return new I}getConnectionPoint(t,e){return new w}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const p=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${p.name||n.call(p)}"`)}const o=this.constructor,r=t.diff===!0,a=e.attrs||{},l=o.getDefaults(!0),c=r?this.preprocess(l,!0):l,h=c.attrs||{},u={};Object.entries(e).forEach(([p,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!te(m))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${n.call(m)}" type of key "${p}" on ${i} "${this.id}"`);if(p!=="attrs"&&p!=="shape"&&r){const b=c[p];me(m,b)&&delete e[p]}}),Object.keys(a).forEach(p=>{const m=a[p],b=h[p];Object.keys(m).forEach(y=>{const C=m[y],A=b?b[y]:null;C!=null&&typeof C=="object"&&!Array.isArray(C)?Object.keys(C).forEach(x=>{const v=C[x];if(b==null||A==null||!ht(A)||!me(A[x],v)){u[p]==null&&(u[p]={}),u[p][y]==null&&(u[p][y]={});const B=u[p][y];B[x]=v}}):(b==null||!me(A,C))&&(u[p]==null&&(u[p]={}),u[p][y]=C)})});const d=Object.assign(Object.assign({},e),{attrs:lo(u)?void 0:u});d.attrs==null&&delete d.attrs;const f=d;return f.angle===0&&delete f.angle,at(f)}clone(t={}){if(!t.deep){const n=Object.assign({},this.store.get());t.keepId||delete n.id,delete n.parent,delete n.children;const i=this.constructor;return new i(n)}return G.deepClone(this)[this.id]}findView(t){return t.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const i=this.model;this.startBatch(t,n,i);const o=e();return this.stopBatch(t,n,i),o}dispose(){this.removeFromParent(),this.animationManager.cancelAnimations(),this.store.dispose()}}G.toStringTag="X6.cell",G.defaults={},G.attrHooks={},G.propHooks=[],H([_()],G.prototype,"dispose",null),G.config({propHooks(s){var{tools:t}=s,e=V(s,["tools"]);return t&&(e.tools=G.normalizeTools(t)),e}});class vw{constructor(t){this.ports=[],this.groups={},this.init(at(t))}getPorts(){return this.ports}getGroup(t){return t!=null?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||e.group==null&&t==null)}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),i=t?this.getGroup(t):null,o=i?i.position:null,r=o?o.name:null;let a;if(r!=null){const u=hi.get(r);if(u==null)return hi.onNotFound(r);a=u}else a=bh.left;const l=n.map(u=>u&&u.position&&u.position.args||{}),c=o&&o.args||{};return a(l,e,c).map((u,d)=>{const f=n[d];return{portLayout:u,portId:f.id,portSize:f.size,portAttrs:f.attrs,labelSize:f.label.size,labelLayout:this.getPortLabelLayout(f,w.create(u.position),e)}})}init(t){const{groups:e,items:n}=t;e!=null&&Object.keys(e).forEach(i=>{this.groups[i]=this.parseGroup(e[i])}),Array.isArray(n)&&n.forEach(i=>{this.ports.push(this.parsePort(i))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=ct({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=ct({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return typeof e.zIndex=="number"?e.zIndex:typeof t.zIndex=="number"||t.zIndex==="auto"?t.zIndex:"auto"}createPosition(t,e){return ct({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if(typeof t=="object")return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(typeof t=="object")return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const i=t.label.position.name||"left",o=t.label.position.args||{},r=bs.get(i)||ph.left;return r?r(e,n,o):null}}let or,rr;function Zh(s,t){return t?or!=null&&or.exist(s):rr!=null&&rr.exist(s)}function Ew(s){or=s}function Sw(s){rr=s}const tu="X6.node";let eu=0;function Mw(s){return s?Ao(s):(eu+=1,`CustomNode${eu}`)}let vt=class In extends G{static isNode(t){if(t==null)return!1;if(t instanceof In)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===tu)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.size=="function"&&typeof n.position=="function"}static define(t){const{constructorName:e,overwrite:n}=t,i=V(t,["constructorName","overwrite"]),o=Io(Mw(e||i.shape),this);return o.config(i),i.shape&&In.registry.register(i.shape,o,n),o}static create(t){const e=t.shape||"rect",n=In.registry.get(e);return n?new n(t):In.registry.onNotFound(e)}get[Symbol.toStringTag](){return In.toStringTag}constructor(t={}){super(t),this.initPorts()}preprocess(t,e){const{x:n,y:i,width:o,height:r}=t,a=V(t,["x","y","width","height"]);if(n!=null||i!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:n??(l?l.x:0),y:i??(l?l.y:0)})}if(o!=null||r!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:o??(l?l.width:0),height:r??(l?l.height:0)})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,n){return t===void 0?this.getSize():typeof t=="number"?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return typeof t=="object"?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const i=n.direction;if(i){const o=this.getSize();switch(i){case"left":case"right":e=o.height;break;case"top":case"bottom":t=o.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i];const l=Pt(this.getAngle()||0);n.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let h;a===0?h=c.getBottomLeft():a===1?h=c.getCorner():a===2?h=c.getTopRight():h=c.getOrigin();const u=h.clone().rotate(-l,c.getCenter()),d=Math.sqrt(t*t+e*e)/2;let f=a*Math.PI/2;f+=Math.atan(a%2===0?e/t:t/e),f-=It(l);const m=w.fromPolar(d,f,u).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(m.x,m.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,i={}){const o=this.getBBox().scale(t,e,n??void 0);return this.startBatch("scale",i),this.setPosition(o.x,o.y,i),this.resize(o.width,o.height,i),this.stopBatch("scale"),this}position(t,e,n){return typeof t=="number"?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const n=this.getParent();if(n!=null&&n.isNode()){const i=this.getPosition(),o=n.getPosition();return{x:i.x-o.x,y:i.y-o.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let i,o,r;if(typeof t=="object"?(i=t.x,o=t.y,r=e||{}):(i=t,o=e,r=n||{}),r.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();i+=l.x,o+=l.y}}if(r.deep){const a=this.getPosition();this.translate(i-a.x,o-a.y,r)}else this.store.set("position",{x:i,y:o},r);return this}translate(t=0,e=0,n={}){if(t===0&&e===0)return this;n.translateBy=n.translateBy||this.id;const i=this.getPosition();if(n.restrict!=null&&n.translateBy===this.id){const r=this.getBBox({deep:!0}),a=n.restrict,l=i.x-r.x,c=i.y-r.y,h=Math.max(a.x+l,Math.min(a.x+a.width+l-r.width,i.x+t)),u=Math.max(a.y+c,Math.min(a.y+a.height+c-r.height,i.y+e));t=h-i.x,e=u-i.y}const o={x:i.x+t,y:i.y+e};if(n.tx=t,n.ty=e,n.transition){let r=typeof n.transition!="object"?{}:Object.assign({},n.transition);r=Object.assign({duration:100,fill:"forwards"},r),this.animate({"position/x":o.x,"position/y":o.y},r),this.eachChild(a=>{var l;((l=n.exclude)===null||l===void 0?void 0:l.includes(a))||a.translate(t,e,n)})}else this.startBatch("translate",n),this.store.set("position",o,n),this.eachChild(r=>{var a;((a=n.exclude)===null||a===void 0?void 0:a.includes(r))||r.translate(t,e,n)}),this.stopBatch("translate",n);return this}angle(t,e){return t==null?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const i=this.getSize(),o=this.getPosition(),r=this.getBBox().getCenter();r.rotate(n-t,e.center);const a=r.x-i.width/2-o.x,l=r.y-i.height/2-o.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(o.x+a,o.y+l,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),G.getCellsBBox(e)}return I.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),i=n.getCenter(),o=t.getTerminal(e);if(o==null)return i;const r=o.port;if(!r||!this.hasPort(r))return i;const a=this.getPort(r);if(!a||!a.group)return i;const c=this.getPortsPosition(a.group)[r].position,h=w.create(c).translate(n.getOrigin()),u=this.getAngle();return u&&h.rotate(-u,i),h}fit(t={}){const n=(this.getChildren()||[]).filter(c=>c.isNode());if(n.length===0)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach(c=>{c.fit(t)});let{x:i,y:o,width:r,height:a}=G.getCellsBBox(n);const l=ne(t.padding);return i-=l.left,o-=l.top,r+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:o},size:{width:r,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Tt.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Tt.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Tt.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Tt.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Tt.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Tt.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return t.items==null&&(t.items=[]),t}getPorts(){return at(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return at(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return this.getPortIndex(t)!==-1}getPortIndex(t){const e=typeof t=="string"?t:t.id;return e!=null?this.ports.items.findIndex(n=>n.id===e):-1}getPortsPosition(t){const e=this.getSize();return this.port.getPortsLayoutByGroup(t,new I(0,0,e.width,e.height)).reduce((i,o)=>{const r=o.portLayout;return i[o.portId]={position:Object.assign({},r.position),angle:r.angle||0},i},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,i){if(typeof e=="string"||Array.isArray(e)){const a=this.prefixPortPath(t,e),l=n;return this.setPropByPath(a,l,i)}const o=this.prefixPortPath(t),r=e;return this.setPropByPath(o,r,n)}removePortProp(t,e,n){return typeof e=="string"||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,i){return e==null?this.getPortProp(t):typeof e=="string"||Array.isArray(e)?arguments.length===2?this.getPortProp(t,e):n==null?this.removePortProp(t,e,i):this.setPortProp(t,e,n,i):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(n===-1)throw new Error(`Unable to find port with id: "${t}"`);return e==null||e===""?["ports","items",`${n}`]:Array.isArray(e)?["ports","items",`${n}`,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const i=[...this.ports.items];return i.splice(t,0,e),this.setPropByPath("ports/items",i,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const o=[...this.ports.items].filter(r=>!t.some(a=>{const l=typeof a=="string"?a:a.id;return r.id===l}));this.setPropByPath("ports/items",o,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(r=>{r.id&&(e[r.id]=!0)});const n={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(r=>{r.id&&!e[r.id]&&(n[r.id]=!0)});const o=this.model;o&&!lo(n)&&(o.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&n[c]&&l.remove()}),o.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&n[c]&&l.remove()}))}validatePorts(){const t={},e=[];return this.ports.items.forEach(n=>{typeof n!="object"&&e.push(`Invalid port ${n}.`),n.id==null&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0}),e}generatePortId(){return Bo()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new vw(this.ports);const n=this.port.getPorts(),i=e?n.filter(r=>e.find(a=>a.id===r.id)?null:r):[...n],o=e?e.filter(r=>n.find(a=>a.id===r.id)?null:r):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),o.length>0&&this.notify("ports:removed",{removed:o,cell:this,node:this})}};vt.toStringTag=tu,vt.registry=ut.create({type:"node",process(s,t){if(Zh(s,!0))throw new Error(`Node with name '${s}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:s}),t;let e=vt;const{inherit:n}=t,i=V(t,["inherit"]);if(n)if(typeof n=="string"){const r=this.get(n);r==null?this.onNotFound(n,"inherited"):e=r}else e=n;i.constructorName==null&&(i.constructorName=s);const o=e.define.call(e,i);return o.config({shape:s}),o}}),vt.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},vt.config({propHooks(s){var{ports:t}=s,e=V(s,["ports"]);return t&&(e.ports=Array.isArray(t)?{items:t}:t),e}}),Sw(vt.registry);const nu="X6.edge",iu="basic.edge";let su=0;function Bw(s){return s?Ao(s):(su+=1,`CustomEdge${su}`)}let ft=class Tn extends G{static parseStringLabel(t){return{attrs:{label:{text:t}}}}static isEdge(t){if(t==null)return!1;if(t instanceof Tn)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===nu)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.disconnect=="function"&&typeof n.getSource=="function"&&typeof n.getTarget=="function"}static equalTerminals(t,e){const n=t,i=e;return n.cell===i.cell?n.port===i.port||n.port==null&&i.port==null:!1}static define(t){const{constructorName:e,overwrite:n}=t,i=V(t,["constructorName","overwrite"]),o=Io(Bw(e||i.shape),this);return o.config(i),i.shape&&Tn.registry.register(i.shape,o,n),o}static create(t){const e=t.shape||"edge",n=Tn.registry.get(e);return n?new n(t):Tn.registry.onNotFound(e)}get[Symbol.toStringTag](){return Tn.toStringTag}constructor(t={}){super(t)}preprocess(t,e){const{source:n,sourceCell:i,sourcePort:o,sourcePoint:r,target:a,targetCell:l,targetPort:c,targetPoint:h}=t,d=V(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),f=p=>typeof p=="string"||typeof p=="number";if(n!=null)if(G.isCell(n))d.source={cell:n.id};else if(f(n))d.source={cell:n};else if(w.isPoint(n))d.source=n.toJSON();else if(Array.isArray(n))d.source={x:n[0],y:n[1]};else{const p=n.cell;G.isCell(p)?d.source=Object.assign(Object.assign({},n),{cell:p.id}):d.source=n}if(i!=null||o!=null){let p=d.source;if(i!=null){const m=f(i)?i:i.id;p?p.cell=m:p=d.source={cell:m}}o!=null&&p&&(p.port=o)}else r!=null&&(d.source=w.create(r).toJSON());if(a!=null)if(G.isCell(a))d.target={cell:a.id};else if(f(a))d.target={cell:a};else if(w.isPoint(a))d.target=a.toJSON();else if(Array.isArray(a))d.target={x:a[0],y:a[1]};else{const p=a.cell;G.isCell(p)?d.target=Object.assign(Object.assign({},a),{cell:p.id}):d.target=a}if(l!=null||c!=null){let p=d.target;if(l!=null){const m=f(l)?l:l.id;p?p.cell=m:p=d.target={cell:m}}c!=null&&p&&(p.port=c)}else h!=null&&(d.target=w.create(h).toJSON());return super.preprocess(d,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,i={}){if(G.isCell(e))return this.store.set(t,ct({},n,{cell:e.id}),i),this;const o=e;return w.isPoint(e)||o.x!=null&&o.y!=null?(this.store.set(t,ct({},n,{x:o.x,y:o.y}),i),this):(this.store.set(t,at(e),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(w.isPointLike(e))return w.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new w}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e=t==="source"?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};for(;e&&e.isEdge();){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){t==null?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return typeof t=="object"?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){t==null?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return typeof t=="object"?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return at(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const i=this.getLabels(),o=i.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),i.splice(r,0,this.parseLabel(t)),this.setLabels(i,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return t!=null&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const i=this.getLabels();i[t]=this.parseLabel(e),this.setLabels(i,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),i=t!=null&&Number.isFinite(t)?t:-1,o=n.splice(i,1);return this.setLabels(n,e),o.length?o[0]:null}parseLabel(t){return typeof t=="string"?this.constructor.parseStringLabel(t):t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>o===r||me(o,r))?null:o):e?[...e]:[],i=t&&e?t.filter(o=>e.find(r=>o===r||me(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map(i=>w.toJSON(i)),e),this}insertVertex(t,e,n={}){const i=this.getVertices(),o=i.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),i.splice(r,0,w.toJSON(t)),this.setVertices(i,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){return t!=null&&Number.isFinite(t)?this.getVertices()[t]:null}setVertexAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const i=this.getVertices();i[t]=e,this.setVertices(i,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),i=t!=null&&Number.isFinite(t)?t:-1;return n.splice(i,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>w.equals(o,r))?null:o):e?[...e]:[],i=t&&e?t.filter(o=>e.find(r=>w.equals(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Tt.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints(i=>({x:(i.x||0)+t,y:(i.y||0)+e}),n)}scale(t,e,n,i={}){return this.applyToPoints(o=>w.create(o).scale(t,e,n).toJSON(),i)}applyToPoints(t,e={}){const n={},i=this.getSource(),o=this.getTarget();w.isPointLike(i)&&(n.source=t(i)),w.isPointLike(o)&&(n.target=t(o));const r=this.getVertices();return r.length>0&&(n.vertices=r.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(e=>w.create(e)),this.getTargetPoint()];return new yt(t)}updateParent(t){let e=null;const n=this.getSourceCell(),i=this.getTargetCell(),o=this.getParent();return n&&i&&(n===i||n.isDescendantOf(i)?e=i:i.isDescendantOf(n)?e=n:e=G.getCommonAncestor(n,i)),o&&e&&e.id!==o.id&&o.unembed(this,t),e&&(!o||o.id!==e.id)&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),i=e.cell,o=n.cell;if(!i||!o)return!1;let r=i===o;if(!r&&t.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(r=a.isAncestorOf(l,t)||l.isAncestorOf(a,t))}return r}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>e!=null);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}};ft.toStringTag=nu,ft.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},ft.registry=ut.create({type:"edge",process(s,t){if(Zh(s,!1))throw new Error(`Edge with name '${s}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:s}),t;let e=ft;const{inherit:n="edge"}=t,i=V(t,["inherit"]);if(typeof n=="string"){const r=this.get(n||"edge");r==null&&n?this.onNotFound(n,"inherited"):e=r}else e=n;i.constructorName==null&&(i.constructorName=s);const o=e.define.call(e,i);return o.config({shape:s}),o}}),ft.defaults={},Ew(ft.registry),ft.config({shape:iu,propHooks(s){const{label:t,vertices:e}=s,n=V(s,["label","vertices"]);if(t){n.labels==null&&(n.labels=[]);const i=typeof t=="string"?ft.parseStringLabel(t):t;n.labels.push(i)}return e&&Array.isArray(e)&&(n.vertices=e.map(i=>w.create(i).toJSON())),n}}),ft.registry.register(iu,ft);class ar extends Nt{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,n){let i,o;typeof e=="number"?(i=e,o=Object.assign({merge:!1},n)):(i=this.length,o=Object.assign({merge:!1},e)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const r=Array.isArray(t)?t:[t],a=this.comparator&&typeof e!="number"&&o.sort!==!1,l=this.comparator||null;let c=!1;const h=[],u=[];return r.forEach(d=>{const f=this.get(d);f?o.merge&&!d.isSameStore(f)&&(f.setProp(d.getProp(),n),u.push(f),a&&!c&&(l==null||typeof l=="function"?c=f.hasChanged():typeof l=="string"?c=f.hasChanged(l):c=l.some(p=>f.hasChanged(p)))):(h.push(d),this.reference(d))}),h.length&&(a&&(c=!0),this.cells.splice(i,0,...h),this.length=this.cells.length),c&&this.sort({silent:!0}),o.silent||(h.forEach((d,f)=>{const p={cell:d,index:i+f,options:o};this.trigger("added",p),o.dryrun||d.notify("added",Object.assign({},p))}),c&&this.trigger("sorted"),(h.length||u.length)&&this.trigger("updated",{added:h,merged:u,removed:[],options:o})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],i=this.removeCells(n,e);return!e.silent&&i.length>0&&this.trigger("updated",{options:e,removed:i,added:[],merged:[]}),Array.isArray(t)?i:i[0]}removeCells(t,e){const n=[];for(let i=0;i<t.length;i+=1){const o=this.get(t[i]);if(o==null)continue;const r=this.cells.indexOf(o);this.cells.splice(r,1),this.length-=1,delete this.map[o.id],n.push(o),this.unreference(o),e.silent||(this.trigger("removed",{cell:o,index:r,options:e}),e.dryrun||o.notify("removed",{cell:o,index:r,options:e})),e.dryrun||o.remove()}return n}reset(t,e={}){const n=this.cells.slice();if(e.diff||(n.forEach(i=>{this.unreference(i),i.remove()}),this.clean()),this.add(t,Object.assign({silent:!0},e)),!e.silent){const i=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:i});const o=[],r=[];i.forEach(a=>{n.some(c=>c.id===a.id)||o.push(a)}),n.forEach(a=>{i.some(c=>c.id===a.id)||r.push(a)}),this.trigger("updated",{options:e,added:o,removed:r,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return e?this.remove(e,t):null}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return e?this.remove(e,t):null}get(t){if(t==null)return null;const e=typeof t=="string"||typeof t=="number"?t:t.id;return this.map[e]||null}has(t){return this.get(t)!=null}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return this.comparator!=null&&(this.cells=co(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger(`cell:${t}`,e),n&&(n.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}H([_()],ar.prototype,"dispose",null);const kw="X6.Model";class Kt extends Nt{static isModel(t){if(t==null)return!1;if(t instanceof Kt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===kw)&&typeof n.addNode=="function"&&typeof n.addEdge=="function"&&n.collection!=null}static toJSON(t,e={}){return{cells:t.map(n=>n.toJSON(e))}}static fromJSON(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach(n=>{n.shape==null&&(n.shape="rect"),e.push(n)}),t.edges&&t.edges.forEach(n=>{n.shape==null&&(n.shape="edge"),e.push(n)})),e.map(n=>{const i=n.shape;if(i){if(vt.registry.exist(i))return vt.create(n);if(ft.registry.exist(i))return ft.create(n)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new ar(t),this.setup()}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&(t==="sorted"||t==="reseted"||t==="updated"?n.trigger(`model:${t}`,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",e=>this.notify("updated",e)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:e})=>{this.onCellAdded(e)}),t.on("removed",e=>{const n=e.cell;this.onCellRemoved(n,e.options),this.notify("cell:removed",e),n.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:n}))}),t.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),t.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),t.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const i=t.getSource(),o=t.getTarget();if(i!=null&&i.cell){const r=this.outgoings[i.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.outgoings[i.cell])}if(o!=null&&o.cell){const r=this.incomings[o.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.incomings[o.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(e=>{this.onCellAdded(e)})}onEdgeTerminalChanged(t,e){const n=e==="source"?this.outgoings:this.incomings,i=t.previous(e);if(i!=null&&i.cell){const r=G.isCell(i.cell)?i.cell.id:i.cell,a=n[r],l=a?a.indexOf(t.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete n[r])}const o=t.getTerminal(e);if(o!=null&&o.cell){const r=G.isCell(o.cell)?o.cell.id:o.cell,a=n[r]||[];a.indexOf(t.id)===-1&&a.push(t.id),n[r]=a}}prepareCell(t,e){return!t.model&&(!e||!e.dryrun)&&(t.model=this),t.zIndex==null&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(n=>this.prepareCell(n,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(n=>this.prepareCell(n,{options:e})),this}clear(t={}){const e=this.getCells();if(e.length===0)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const i=e.sort((o,r)=>{const a=o.isEdge()?1:2,l=r.isEdge()?1:2;return a-l});for(;i.length>0;){const o=i.shift();o&&o.remove(n)}},n),this}addNode(t,e={}){const n=vt.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}updateNode(t,e={}){const n=this.createNode(t),i=n.getProp();return n.dispose(),this.updateCell(i,e)}createNode(t){return vt.create(t)}addEdge(t,e={}){const n=ft.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return ft.create(t)}updateEdge(t,e={}){const n=this.createEdge(t),i=n.getProp();return n.dispose(),this.updateCell(i,e)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(!this.collection.has(t)&&!this.addings.has(t)&&(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild(n=>this.addCell(n,e)),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(n===0)return this;const i=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:t})),t.forEach(o=>{this.addCell(o,i),i.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:t})),this}updateCell(t,e={}){const n=t.id&&this.getCell(t.id);return n?this.batchUpdate("update",()=>(Object.entries(t).forEach(([i,o])=>{n.setProp(i,o,e)}),!0),t):!1}removeCell(t,e={}){const n=typeof t=="string"?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){if(t.id===e)return;this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});return this.addCell(n),this.getConnectedEdges(t).forEach(o=>{const r=o.getSourceCell(),a=o.getTargetCell();r===t&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:e})),a===t&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(n=>this.removeCell(n,e))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach(i=>{i.remove(e)}),n}disconnectConnectedEdges(t,e={}){const n=typeof t=="string"?t:t.id;this.getConnectedEdges(t).forEach(i=>{const o=i.getSourceCellId(),r=i.getTargetCellId();o===n&&i.setSource({x:0,y:0},e),r===n&&i.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(e=>this.getCell(e)).filter(e=>e!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e=typeof t=="string"?t:t.id,n=this.outgoings[e];return n?n.map(i=>this.getCell(i)).filter(i=>i==null?void 0:i.isEdge()):null}getIncomingEdges(t){const e=typeof t=="string"?t:t.id,n=this.incomings[e];return n?n.map(i=>this.getCell(i)).filter(i=>i==null?void 0:i.isEdge()):null}getConnectedEdges(t,e={}){const n=[],i=typeof t=="string"?this.getCell(t):t;if(i==null)return n;const o={},r=e.indirect;let a=e.incoming,l=e.outgoing;a==null&&l==null&&(a=l=!0);const c=(h,u)=>{const d=u?this.getOutgoingEdges(h):this.getIncomingEdges(h);if(d!=null&&d.forEach(f=>{o[f.id]||(n.push(f),o[f.id]=!0,r&&(a&&c(f,!1),l&&c(f,!0)))}),r&&h.isEdge()){const f=u?h.getTargetCell():h.getSourceCell();f!=null&&f.isEdge()&&(o[f.id]||(n.push(f),c(f,u)))}};if(l&&c(i,!0),a&&c(i,!1),e.deep){const h=i.getDescendants({deep:!0}),u={};h.forEach(f=>{f.isNode()&&(u[f.id]=!0)});const d=(f,p)=>{const m=p?this.getOutgoingEdges(f.id):this.getIncomingEdges(f.id);m!=null&&m.forEach(b=>{if(!o[b.id]){const y=b.getSourceCell(),C=b.getTargetCell();if(!e.enclosed&&y&&u[y.id]&&C&&u[C.id])return;n.push(b),o[b.id]=!0}})};h.forEach(f=>{f.isEdge()||(l&&d(f,!0),a&&d(f,!1))})}return n}isBoundary(t,e){const n=typeof t=="string"?this.getCell(t):t,i=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return i==null||i.length===0}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,t)){const i=this.getCell(n);i&&e.push(i)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,i=e.outgoing;n==null&&i==null&&(n=i=!0);const r=this.getConnectedEdges(t,e).reduce((a,l)=>{const c=l.hasLoop(e),h=l.getSourceCell(),u=l.getTargetCell();return n&&h&&h.isNode()&&!a[h.id]&&(c||h!==t&&(!e.deep||!h.isDescendantOf(t)))&&(a[h.id]=h),i&&u&&u.isNode()&&!a[u.id]&&(c||u!==t&&(!e.deep||!u.isDescendantOf(t)))&&(a[u.id]=u),a},{});if(t.isEdge()){if(n){const a=t.getSourceCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}if(i){const a=t.getTargetCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}}return Object.keys(r).map(a=>r[a])}isNeighbor(t,e,n={}){let i=n.incoming,o=n.outgoing;return i==null&&o==null&&(i=o=!0),this.getConnectedEdges(t,n).some(r=>{const a=r.getSourceCell(),l=r.getTargetCell();return!!(i&&a&&a.id===e.id||o&&l&&l.id===e.id)})}getSuccessors(t,e={}){const n=[];return this.search(t,(i,o)=>{i!==t&&this.matchDistance(o,e.distance)&&n.push(i)},Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let i=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return i=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),i}getPredecessors(t,e={}){const n=[];return this.search(t,(i,o)=>{i!==t&&this.matchDistance(o,e.distance)&&n.push(i)},Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let i=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return i=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),i}matchDistance(t,e){return e==null?!0:typeof e=="function"?e(t):Array.isArray(e)&&e.includes(t)?!0:t===e}getCommonAncestor(...t){const e=[];return t.forEach(n=>{n&&(Array.isArray(n)?e.push(...n):e.push(n))}),G.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],i={},o=[],r=[],a=l=>{i[l.id]||(n.push(l),i[l.id]=l,l.isEdge()&&r.push(l),l.isNode()&&o.push(l))};return t.forEach(l=>{a(l),e.deep&&l.getDescendants({deep:!0}).forEach(h=>{a(h)})}),r.forEach(l=>{const c=l.getSourceCell(),h=l.getTargetCell();c&&!i[c.id]&&(n.push(c),i[c.id]=c,c.isNode()&&o.push(c)),h&&!i[h.id]&&(n.push(h),i[h.id]=h,h.isNode()&&o.push(h))}),o.forEach(l=>{this.getConnectedEdges(l,e).forEach(h=>{const u=h.getSourceCell(),d=h.getTargetCell();!i[h.id]&&u&&i[u.id]&&d&&i[d.id]&&(n.push(h),i[h.id]=h)})}),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return G.cloneCells(t)}getNodesFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e||0}:t;return this.getNodes().filter(i=>i.getBBox().containsPoint(n))}getNodesInArea(t,e,n,i,o){const r=typeof t=="number"?new I(t,e,n,i):I.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getNodes().filter(c=>{const h=c.angle(),u=c.getBBox().bbox(h);return l?r.containsRect(u):r.isIntersectWithRect(u)})}getEdgesInArea(t,e,n,i,o){const r=typeof t=="number"?new I(t,e,n,i):I.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getEdges().filter(c=>{const h=c.getBBox();return h.width===0?h.inflate(1,0):h.height===0&&h.inflate(0,1),l?r.containsRect(h):r.isIntersectWithRect(h)})}getNodesUnderNode(t,e={}){const n=t.getBBox();return(e.by==null||e.by==="bbox"?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by])).filter(o=>t.id!==o.id&&!o.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return G.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const i=[],o={},r={};for(i.push(t),r[t.id]=0;i.length>0;){const a=i.shift();if(a==null||o[a.id]||(o[a.id]=!0,D(e,this,a,r[a.id])===!1))continue;this.getNeighbors(a,n).forEach(c=>{r[c.id]=r[a.id]+1,i.push(c)})}}depthFirstSearch(t,e,n={}){const i=[],o={},r={};for(i.push(t),r[t.id]=0;i.length>0;){const a=i.pop();if(a==null||o[a.id]||(o[a.id]=!0,D(e,this,a,r[a.id])===!1))continue;const l=this.getNeighbors(a,n),c=i.length;l.forEach(h=>{r[h.id]=r[a.id]+1,i.splice(c,0,h)})}}getShortestPath(t,e,n={}){const i={};this.getEdges().forEach(c=>{const h=c.getSourceCellId(),u=c.getTargetCellId();h&&u&&(i[h]||(i[h]=[]),i[u]||(i[u]=[]),i[h].push(u),n.directed||i[u].push(h))});const o=typeof t=="string"?t:t.id,r=S6(i,o,n.weight),a=[];let l=typeof e=="string"?e:e.id;for(r[l]&&a.push(l);r[l];){const c=r[l];a.unshift(c),l=c}return a}translate(t,e,n){return this.getCells().filter(i=>!i.hasParent()).forEach(i=>{i.translate(t,e,n)}),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,i={}){const o=this.getCellsBBox(n);if(o){const r=Math.max(t/o.width,0),a=Math.max(e/o.height,0),l=o.getOrigin();n.forEach(c=>{c.scale(r,a,l,i)})}return this}toJSON(t={}){return Kt.toJSON(this.getCells(),t)}parseJSON(t){return Kt.fromJSON(t)}fromJSON(t,e={}){let n=[];if(!e.diff)n=this.parseJSON(t);else{const i=t,{nodes:o=[],edges:r=[]}=i,a=V(i,["nodes","edges"]),l=o.filter(h=>!this.nodes[h.id])||[],c=r.filter(h=>!this.edges[h.id])||[];n=this.parseJSON(Object.assign(Object.assign({},a),{nodes:l,edges:c}))}return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const i=e();return this.stopBatch(t,n),i}hasActiveBatch(t=Object.keys(this.batches)){return(Array.isArray(t)?t:[t]).some(n=>this.batches[n]>0)}dispose(){this.collection.dispose()}}H([_()],Kt.prototype,"dispose",null);const ou={fill:"#ffffff",stroke:"#333333",strokeWidth:2},Iw={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"};let wi=class extends vt{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return t==null?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};wi.config({attrs:{text:Object.assign({},Iw)},propHooks(s){const{label:t}=s,e=V(s,["label"]);return t&&gn(e,"attrs/text/text",t),e},visible:!0});function Tw(s,t="body"){return[{tagName:s,selector:t},{tagName:"text",selector:"label"}]}function Pw(s="xlink:href"){return e=>{const{imageUrl:n,imageWidth:i,imageHeight:o}=e,r=V(e,["imageUrl","imageWidth","imageHeight"]);if(n!=null||i!=null||o!=null){const a=()=>{if(r.attrs){const l=r.attrs.image;n!=null&&(l[s]=n),i!=null&&(l.width=i),o!=null&&(l.height=o),r.attrs.image=l}};r.attrs?(r.attrs.image==null&&(r.attrs.image={}),a()):(r.attrs={image:{}},a())}return r}}function xn(s,t,e={}){const n={constructorName:s,markup:Tw(s,e.selector),attrs:{[s]:Object.assign({},ou)}};return(e.parent||wi).define(ct(n,t,{shape:s}))}function ru(s){return typeof s=="string"?s:s.map(t=>Array.isArray(t)?t.join(","):w.isPointLike(t)?`${t.x}, ${t.y}`:"").join(" ")}xn("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const Ow=ft.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});xn("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});class _t extends Cn{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(t){super(),this.graph=t,this.init()}init(){}}const au={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onDragEnd"},Re=1<<30,Nw=1<<29;class Wt extends xt{constructor(){super(...arguments),this.portsCache={}}static isNodeView(t){if(t==null)return!1;if(t instanceof Wt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===lu)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"&&typeof n.update=="function"&&typeof n.findPortElem=="function"&&typeof n.resize=="function"&&typeof n.rotate=="function"&&typeof n.translate=="function"}get[Symbol.toStringTag](){return lu}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const n=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?st(e,n):O(e,n)}else{const n=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(n):this.addClass(n)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(),"update"),n=this.handleAction(n,"update",()=>this.update(),"ports"),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>{this.getFlag("tools")===t?this.renderTools():this.updateTools(e)})),n}update(t){this.cleanCache(),this.removePorts();const e=this.cell,n=e.getSize(),i=e.getAttrs();this.updateAttrs(this.container,i,{attrs:t===i?null:t,rootBBox:new I(0,0,n.width,n.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.appendChild(e.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this.notify("view:render",{view:this}),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const i=n.portContentElement,o=n.portContentSelectors||{};return this.findOne(e,i,o)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(t=>{Gt(t.portElement)})}renderPorts(){const t=this.container,e=[];t.childNodes.forEach(r=>{e.push(r)});const n=this.cell.getParsedPorts(),i=bl(n,"zIndex"),o="auto";i[o]&&i[o].forEach(r=>{const a=this.getPortElement(r);t.append(a),e.push(a)}),Object.keys(i).forEach(r=>{if(r!==o){const a=parseInt(r,10);this.appendPorts(i[r],a,e)}}),this.updatePorts()}appendPorts(t,e,n){const i=t.map(o=>this.getPortElement(o));n[e]||e<0?jn(n[Math.max(e,0)],i):Mt(this.container,i)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Tt.renderMarkup(this.cell.getPortContainerMarkup());const n=e.elem;if(n==null)throw new Error("Invalid port container markup.");e=Tt.renderMarkup(this.getPortMarkup(t));const i=e.elem,o=e.selectors;if(i==null)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},i);let r="x6-port";t.group&&(r+=` x6-port-${t.group}`),O(n,r),O(n,"x6-port"),O(i,"x6-port-body"),n.appendChild(i);let a=o,l,c;if(this.existPortLabel(t)){if(e=Tt.renderMarkup(this.getPortLabelMarkup(t.label)),l=e.elem,c=e.selectors,l==null)throw new Error("Invalid port label markup.");if(o&&c){for(const u in c)if(o[u]&&u!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},o),c)}O(l,"x6-port-label"),n.appendChild(l)}return this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:i,portContentSelectors:o},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:i,contentSelectors:o}),n}updatePorts(){const t=this.cell.getParsedGroups(),e=Object.keys(t);e.length===0?this.updatePortGroup():e.forEach(n=>{this.updatePortGroup(n)})}updatePortGroup(t){const e=I.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let i=0,o=n.length;i<o;i+=1){const r=n[i],a=r.portId,l=this.portsCache[a]||{},c=r.portLayout;if(this.applyPortTransform(l.portElement,c),r.portAttrs!=null){const u={selectors:l.portSelectors||{}};r.portSize&&(u.rootBBox=I.fromSize(r.portSize)),this.updateAttrs(l.portElement,r.portAttrs,u)}const h=r.labelLayout;if(h&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,h,-(c.angle||0)),h.attrs)){const u={selectors:l.portLabelSelectors||{}};r.labelSize&&(u.rootBBox=I.fromSize(r.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,u)}}}applyPortTransform(t,e,n=0){const i=e.angle,o=e.position,r=wt().rotate(n).translate(o.x||0,o.y||0).rotate(i||0);fn(t,r,{absolute:!0})}getPortMarkup(t){return t.markup||this.cell.portMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup}existPortLabel(t){return t.attrs&&t.attrs.text}getEventArgs(t,e,n){const i=this,o=i.cell,r=o;return e==null||n==null?{e:t,view:i,node:o,cell:r}:{e:t,x:e,y:n,view:i,node:o,cell:r}}getPortEventArgs(t,e,n){const i=this,o=i.cell,r=o;return n?{e:t,x:n.x,y:n.y,view:i,node:o,cell:r,port:e}:{e:t,view:i,node:o,cell:r,port:e}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}notifyPortEvent(t,e,n){const i=this.findAttr("port",e.target);if(i){const o=e.type;t==="node:port:mouseenter"?e.type="mouseenter":t==="node:port:mouseleave"&&(e.type="mouseleave"),this.notify(t,this.getPortEventArgs(e,i,n)),e.type=o}}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:click",t,{x:e,y:n})}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:dblclick",t,{x:e,y:n})}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:contextmenu",t,{x:e,y:n})}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.notifyPortEvent("node:port:mousedown",t,{x:e,y:n}),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const i=this.getEventData(t),o=i.action;if(o==="magnet")this.dragMagnet(t,e,n);else{if(o==="move"){const a=i.targetView||this;a.dragNode(t,e,n),a.notify("node:moving",{e:t,x:e,y:n,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(t,e,n),this.notifyPortEvent("node:port:mousemove",t,{x:e,y:n})}this.setEventData(t,i)}onMouseUp(t,e,n){const i=this.getEventData(t),o=i.action;o==="magnet"?this.stopMagnetDragging(t,e,n):(this.notifyMouseUp(t,e,n),this.notifyPortEvent("node:port:mouseup",t,{x:e,y:n}),o==="move"&&(i.targetView||this).stopNodeDragging(t,e,n));const r=i.targetMagnet;r&&this.onMagnetClick(t,r,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseenter",t),this.notifyPortEvent("node:port:mouseover",t)}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseleave",t),this.notifyPortEvent("node:port:mouseout",t)}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,i){const o=this.graph;o.view.getMouseMovedCount(t)>o.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetDblClick(t,e,n,i){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetContextMenu(t,e,n,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){this.startMagnetDragging(t,n,i)}onCustomEvent(t,e,n,i){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}prepareEmbedding(t){const e=this.graph,i=this.getEventData(t).cell||this.cell,o=e.findViewByCell(i),r=e.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:i,view:o,cell:i,x:r.x,y:r.y,currentParent:i.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,o=i.options.embedding,r=o.findParent;let a=typeof r=="function"?D(r,i,{view:this,node:this.cell}).filter(d=>G.isCell(d)&&this.cell.id!==d.id&&!d.isDescendantOf(this.cell)):i.model.getNodesUnderNode(n,{by:r});if(o.frontOnly&&a.length>0){const d=bl(a,"zIndex"),f=bb(Object.keys(d).map(p=>parseInt(p,10)));f&&(a=d[f])}a=a.filter(d=>d.visible);let l=null;const c=e.candidateEmbedView,h=o.validate;for(let d=a.length-1;d>=0;d-=1){const f=a[d];if(c&&c.cell.id===f.id){l=c;break}else{const p=f.findView(i);if(h&&D(h,i,{child:this.cell,parent:p.cell,childView:this,parentView:p})){l=p;break}}}this.clearEmbedding(e),l&&l.highlight(null,{type:"embedding"}),e.candidateEmbedView=l;const u=i.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:i.findViewByCell(n),x:u.x,y:u.y,currentParent:n.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const n=e.cell||this.cell,i=e.graph||this.graph,o=i.findViewByCell(n),r=n.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,(r==null||r.id!==a.cell.id)&&a.cell.insertChild(n,void 0,{ui:!0})):r&&r.unembed(n,{ui:!0}),i.model.getConnectedEdges(n,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),o&&a){const l=i.snapToGrid(t.clientX,t.clientY);o.notify("node:embedded",{e:t,cell:n,x:l.x,y:l.y,node:n,view:i.findViewByCell(n),previousParent:r,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.findViewByCell(t)}return null}validateMagnet(t,e,n){if(e.getAttribute("magnet")!=="passive"){const i=this.graph.options.connecting.validateMagnet;return i?D(i,this.graph,{e:n,magnet:e,view:t,cell:t.cell}):!0}return!1}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const i=t.currentTarget,o=this.graph;this.setEventData(t,{targetMagnet:i}),this.validateMagnet(this,i,t)?(o.options.magnetThreshold<=0&&this.startConnectting(t,i,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,n),o.view.delegateDragEvents(t,this)}startConnectting(t,e,n,i){this.graph.model.startBatch("add-edge");const o=this.createEdgeFromMagnet(e,n,i);o.setEventData(t,o.prepareArrowheadDragging("target",{x:n,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:o}),o.notifyMouseDown(t,n,i)}getDefaultEdge(t,e){let n;const i=this.graph.options.connecting.createEdge;return i&&(n=D(i,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),n}createEdgeFromMagnet(t,e,n){const i=this.graph,o=i.model,r=this.getDefaultEdge(this,t);return r.setSource(Object.assign(Object.assign({},r.getSource()),this.getEdgeTerminal(t,e,n,r,"source"))),r.setTarget(Object.assign(Object.assign({},r.getTarget()),{x:e,y:n})),r.addTo(o,{async:!1,ui:!0}),r.findView(i)}dragMagnet(t,e,n){const i=this.getEventData(t),o=i.edgeView;if(o)o.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const r=this.graph,a=r.options.magnetThreshold,l=this.getEventTarget(t),c=i.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(r.view.getMouseMovedCount(t)<=a)return;this.startConnectting(t,c,e,n)}}stopMagnetDragging(t,e,n){const o=this.eventData(t).edgeView;o&&(o.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,i,o){let r=[o];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(o)&&(r=l.filter(c=>c.isNode()))}r.forEach(l=>{this.notify(t,{e,x:n,y:i,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?D(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}startNodeDragging(t,e,n){const i=this.getDelegatedView();if(i==null||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:i,action:"move"});const o=w.create(i.cell.getPosition());i.setEventData(t,{moving:!1,offset:o.diff(e,n),restrict:this.getRestrictArea(i)})}dragNode(t,e,n){const i=this.cell,o=this.graph,r=o.getGridSize(),a=this.getEventData(t),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=ie(e+l.x,r),u=ie(n+l.y,r);i.setPosition(h,u,{restrict:c,deep:!0,ui:!0}),o.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}autoOffsetNode(){const t=this.cell,e=this.graph,n=Object.assign({id:t.id},t.getPosition()),o=e.getNodes().map(c=>{const h=c.getPosition();return{id:c.id,x:h.x,y:h.y}}).filter(c=>c.id!==n.id),r=[[1,1],[1,-1],[-1,1],[-1,-1]];let a=e.getGridSize();const l=c=>o.some(h=>h.x===c.x&&h.y===c.y);for(;l(n);){let c=!1;for(let h=0;h<r.length;h+=1){const u=r[h],d={x:n.x+u[0]*a,y:n.y+u[1]*a};if(!l(d)){t.translate(u[0]*a,u[1]*a),c=!0;break}}if(c)break;a+=e.getGridSize()}}stopNodeDragging(t,e,n){const i=this.getEventData(t),o=this.graph;i.embedding&&this.finalizeEmbedding(t,i),i.moving&&(o.options.translating.autoOffset&&this.autoOffsetNode(),this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");n&&n.autoScroll(t,e)}}const lu=`X6.${Wt.name}`;Wt.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),Wt.registry.register("node",Wt,!0);class De extends xt{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}static isEdgeView(t){if(t==null)return!1;if(t instanceof De)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===cu)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"&&typeof n.update=="function"&&typeof n.getConnection=="function"}get[Symbol.toStringTag](){return cu}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const n=this.cell.getSource();return new I(n.x,n.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new I(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const n=this.cell.getTarget();return new I(n.x,n.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new I(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}return this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","labels","tools"]),n):(n=this.handleAction(n,"update",()=>this.update(e)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(e)),n=this.handleAction(n,"tools",()=>this.renderTools()),n)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this.notify("view:render",{view:this}),this}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}customizeLabels(){if(this.labelContainer){const t=this.cell,e=t.labels;for(let n=0,i=e.length;n<i;n+=1){const o=e[n],r=this.labelCache[n],a=this.labelSelectors[n],l=this.graph.options.onEdgeLabelRendered;if(l){const c=l({edge:t,label:o,container:r,selectors:a});c&&(this.labelDestroyFn[n]=c)}}}}destroyCustomizeLabels(){const t=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let e=0,n=t.length;e<n;e+=1){const i=this.labelDestroyFn[e],o=this.labelCache[e],r=this.labelSelectors[e];i&&o&&r&&i({edge:this.cell,label:t[e],container:o,selectors:r})}this.labelDestroyFn={}}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let i=this.labelContainer;if(this.labelCache={},this.labelSelectors={},n<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=oe("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.labelContainer=i);for(let o=0,r=e.length;o<r;o+=1){const a=e[o],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,h;if(l)c=l.node,h=l.selectors;else{const d=t.getDefaultLabel(),f=this.normalizeLabelMarkup(this.parseLabelMarkup(d.markup));c=f.node,h=f.selectors}c.setAttribute("data-index",`${o}`),i.appendChild(c);const u=this.rootSelector;if(h[u])throw new Error("Ambiguous label root selector.");h[u]=c,this.labelCache[o]=c,this.labelSelectors[o]=h}return i.parentNode==null&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(t={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(e==null)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],i=n.length;if(i>1){const o=n[1];if(e[o]){if(i===2)return typeof t.propertyValue=="object"&&Hi(t.propertyValue,"markup");if(n[2]!=="markup")return!1}}}return!0}parseLabelMarkup(t){return t?typeof t=="string"?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=L.createVectors(t),n=document.createDocumentFragment();for(let i=0,o=e.length;i<o;i+=1){const r=e[i].node;n.appendChild(r)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(t==null)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const i=e.childNodes;return i.length>1||i[0].nodeName.toUpperCase()!=="G"?n=L.create("g").append(e):n=L.create(i[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.labelContainer){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),i=t.getDefaultLabel();for(let o=0,r=e.length;o<r;o+=1){const a=this.labelCache[o],l=this.labelSelectors[o];a.setAttribute("cursor",n?"move":"default");const c=e[o],h=ct({},i.attrs,c.attrs);this.updateAttrs(a,h,{selectors:l,rootBBox:c.size?I.fromSize(c.size):void 0})}}}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}update(t={}){var e;this.cleanCache(),this.updateConnection(t);const n=this.cell.getAttrs(),{text:i}=n,o=V(n,["text"]);if(o!=null){if(((e=this.container)===null||e===void 0?void 0:e.tagName)==="g"&&this.isEdgeElement(this.container)&&Jb){const r=this.container.parentNode;if(r){const a=this.container.nextSibling;r.removeChild(this.container),r.insertBefore(this.container,a)}}this.updateAttrs(this.container,o,{selectors:this.selectors})}return this.updateLabelPositions(),this.updateTools(t),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),i=[this.sourceAnchor,...n,this.targetAnchor],o=i.length,r=new yt(i);r.simplify({threshold:.01});const a=r.points.map(c=>c.toJSON()),l=a.length;return o===l?0:(e.setVertices(a.slice(1,l-1),t),o-l)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return w.create(this.sourceAnchor);case"target":return w.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return w.create(this.sourcePoint);case"target":return w.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const n=this.sourceView;return n?this.sourceMagnet||n.container:null}case"target":{if(e.raw)return this.targetMagnet;const n=this.targetView;return n?this.targetMagnet||n.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const n=t.tx||0,i=t.ty||0;this.routePoints=new yt(this.routePoints).translate(n,i).points,this.translateConnectionPoints(n,i),this.path.translate(n,i)}else{const n=e.getVertices(),i=this.findAnchors(n);this.sourceAnchor=i.source,this.targetAnchor=i.target,this.routePoints=this.findRoutePoints(n);const o=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=o.source,this.targetPoint=o.target;const r=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,r.source||this.sourcePoint,r.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,i=e.target,o=t[0],r=t[t.length-1];return i.priority&&!n.priority?this.findAnchorsOrdered("target",r,"source",o):this.findAnchorsOrdered("source",o,"target",r)}findAnchorsOrdered(t,e,n,i){let o,r;const a=this.cell,l=a[t],c=a[n],h=this.getTerminalView(t),u=this.getTerminalView(n),d=this.getTerminalMagnet(t),f=this.getTerminalMagnet(n);if(h){let p;e?p=w.create(e):u?p=f:p=w.create(c),o=this.getAnchor(l.anchor,h,d,p,t)}else o=w.create(l);if(u){const p=w.create(i||o);r=this.getAnchor(c.anchor,u,f,p,n)}else r=w.isPointLike(c)?w.create(c):new w;return{[t]:o,[n]:r}}getAnchor(t,e,n,i,o){const r=e.isEdgeElement(n),a=this.graph.options.connecting;let l=typeof t=="string"?{name:t}:t;if(!l){const u=r?(o==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(o==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof u=="string"?{name:u}:u}if(!l)throw new Error("Anchor should be specified.");let c;const h=l.name;if(r){const u=si.get(h);if(typeof u!="function")return si.onNotFound(h);c=D(u,this,e,n,i,l.args||{},o)}else{const u=li.get(h);if(typeof u!="function")return li.onNotFound(h);c=D(u,this,e,n,i,l.args||{},o)}return c?c.round(this.POINT_ROUNDING):new w}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||$o.normal,n=this.cell.getRouter()||e;let i;if(typeof n=="function")i=D(n,this,t,{},this);else{const o=typeof n=="string"?n:n.name,r=typeof n=="string"?{}:n.args||{},a=o?gi.get(o):$o.normal;if(typeof a!="function")return gi.onNotFound(o);i=D(a,this,t,r,this)}return i==null?t.map(o=>w.create(o)):i.map(o=>w.create(o))}findConnectionPoints(t,e,n){const i=this.cell,o=this.graph.options.connecting,r=i.getSource(),a=i.getTarget(),l=this.sourceView,c=this.targetView,h=t[0],u=t[t.length-1];let d;if(l&&!l.isEdgeElement(this.sourceMagnet)){const p=this.sourceMagnet||l.container,m=h||n,b=new N(m,e),y=r.connectionPoint||o.sourceConnectionPoint||o.connectionPoint;d=this.getConnectionPoint(y,l,p,b,"source")}else d=e;let f;if(c&&!c.isEdgeElement(this.targetMagnet)){const p=this.targetMagnet||c.container,m=a.connectionPoint||o.targetConnectionPoint||o.connectionPoint,b=u||e,y=new N(b,n);f=this.getConnectionPoint(m,c,p,y,"target")}else f=n;return{source:d,target:f}}getConnectionPoint(t,e,n,i,o){const r=i.end;if(t==null)return r;const a=typeof t=="string"?t:t.name,l=typeof t=="string"?{}:t.args,c=ei.get(a);if(typeof c!="function")return ei.onNotFound(a);const h=D(c,this,i,e,n,l||{},o);return h?h.round(this.POINT_ROUNDING):r}findMarkerPoints(t,e,n){const i=u=>{const d=this.cell.getAttrs(),f=Object.keys(d);for(let p=0,m=f.length;p<m;p+=1){const b=d[f[p]];if(b[`${u}Marker`]||b[`${u}-marker`]){const y=b.strokeWidth||b["stroke-width"];if(y)return parseFloat(y);break}}return null},o=t[0],r=t[t.length-1];let a,l;const c=i("source");c&&(a=e.clone().move(o||n,-c));const h=i("target");return h&&(l=n.clone().move(r||e,-h)),this.sourceMarkerPoint=a||e.clone(),this.targetMarkerPoint=l||n.clone(),{source:a,target:l}}findPath(t,e,n){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let o,r,a;if(typeof i=="string"?o=i:(o=i.name,r=i.args),o){const c=ii.get(o);if(typeof c!="function")return ii.onNotFound(o);a=c}else a=ih.normal;const l=D(a,this,e,n,t,Object.assign(Object.assign({},r),{raw:!0}),this);return typeof l=="string"?z.parse(l):l}translateConnectionPoints(t,e){this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e),this.sourceMarkerPoint.translate(t,e),this.targetMarkerPoint.translate(t,e)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const e=this.cell,n=e.getLabels();if(n.length===0)return this;const i=e.getDefaultLabel(),o=this.normalizeLabelPosition(i.position);for(let r=0,a=n.length;r<a;r+=1){const l=n[r],c=this.labelCache[r];if(!c)continue;const h=this.normalizeLabelPosition(l.position),u=ct({},o,h),d=this.getLabelTransformationMatrix(u);c.setAttribute("transform",_n(d))}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,i=e[t],o=i&&i.cell,r=`${t}View`;if(!o)return this[r]=null,this.updateTerminalMagnet(t),!0;const a=n.getCellById(o);if(!a)throw new Error(`Edge's ${t} node with id "${o}" not exists`);const l=a.findView(n);return l?(this[r]=l,this.updateTerminalMagnet(t),!0):!1}updateTerminalMagnet(t){const e=`${t}Magnet`,n=this.getTerminalView(t);if(n){let i=n.getMagnetFromEdgeTerminal(this.cell[t]);i===n.container&&(i=null),this[e]=i}else this[e]=null}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&typeof e.position=="object"&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&typeof e.position=="object")return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&typeof t.position=="object")return t.position.options}mergeLabelPositionArgs(t,e){return t===null?null:t===void 0?e===null?null:e:ct({},e,t)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const t=this.cache.pathCache;return Hi(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const t=this.cache.pathCache;return Hi(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const t=this.cache.pathCache;return Hi(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return this.path==null?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return this.path==null?null:(ye(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return this.path==null?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return this.path==null?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return this.path==null?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return this.path==null?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return this.path==null?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,i){const o={distance:0};let r=0,a;typeof n=="number"?(r=n,a=i):a=n,a!=null&&(o.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),h=a&&a.absoluteDistance&&a.reverseDistance,u=this.path,d={segmentSubdivisions:this.getConnectionSubdivisions()},f=new w(t,e),p=u.closestPointT(f,d),m=this.getConnectionLength()||0;let b=u.lengthAtT(p,d);c&&(b=m>0?b/m:0),h&&(b=-1*(m-b)||1),o.distance=b;let y;l||(y=u.tangentAtT(p));let C;if(y)C=y.pointOffset(f);else{const A=u.pointAtT(p),x=f.diff(A);C={x:x.x,y:x.y}}return o.offset=C,o.angle=r,o}normalizeLabelPosition(t){return typeof t=="number"?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},i=e.angle||0,o=e.distance,r=o>0&&o<=1;let a=0;const l={x:0,y:0},c=e.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const h=l.x!==0||l.y!==0||a===0,u=n.keepGradient,d=n.ensureLegibility,f=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},m=r?o*this.getConnectionLength():o,b=f.tangentAtLength(m,p);let y,C=i;if(b){if(h)y=b.start,y.translate(l);else{const A=b.clone();A.rotate(-90,b.start),A.setLength(a),y=A.end}u&&(C=b.angle()+i,d&&(C=Pt((C+90)%180-90)))}else y=f.start,h&&y.translate(l);return wt().translate(y.x,y.y).rotate(C)}getVertexIndex(t,e){const i=this.cell.getVertices(),o=this.getClosestPointLength(new w(t,e));let r=0;if(o!=null)for(const a=i.length;r<a;r+=1){const l=i[r],c=this.getClosestPointLength(l);if(c!=null&&o<c)break}return r}getEventArgs(t,e,n){const i=this,o=i.cell,r=o;return e==null||n==null?{e:t,view:i,edge:o,cell:r}:{e:t,x:e,y:n,view:i,edge:o,cell:r}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-label":{this.dragLabel(t,e,n);break}case"drag-arrowhead":{this.dragArrowhead(t,e,n);break}case"drag-edge":{this.dragEdge(t,e,n);break}}return this.notifyMouseMove(t,e,n),i}onMouseUp(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-label":{this.stopLabelDragging(t,e,n);break}case"drag-arrowhead":{this.stopArrowheadDragging(t,e,n);break}case"drag-edge":{this.stopEdgeDragging(t,e,n);break}}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),i}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){if(jl(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if(e==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i)))}this.notifyMouseDown(t,n,i)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n),this.getEventData(t).stopPropagation&&t.stopPropagation()}startEdgeDragging(t,e,n){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(t,e,n);return}this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"})}dragEdge(t,e,n){const i=this.getEventData(t);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-i.x,n-i.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,n){const i=this.getEventData(t);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),i={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:e.isNewEdge===!0,terminalType:t,initialMagnet:n,initialTerminal:to(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(t){const e=[];e[4]=t,e[5]=this;let n,i=0,o=0;t==="source"?(i=2,n="target"):(o=2,n="source");const r=this.cell[n],a=r.cell;if(a){let l;const c=e[i]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(r),l===c.container&&(l=void 0)),e[i+1]=l}return(l,c)=>(e[o]=l,e[o+1]=l.container===c?void 0:c,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){t.zIndex!=null&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}validateConnection(t,e,n,i,o,r,a){const l=this.graph.options.connecting,c=l.allowLoop,h=l.allowNode,u=l.allowEdge,d=l.allowPort,f=l.allowMulti,p=l.validateConnection,m=r?r.cell:null,b=o==="target"?n:t,y=o==="target"?i:e;let C=!0;const A=x=>{const v=o==="source"?a?a.port:null:m?m.getSourcePortId():null,B=o==="target"?a?a.port:null:m?m.getTargetPortId():null;return D(x,this.graph,{edge:m,edgeView:r,sourceView:t,targetView:n,sourcePort:v,targetPort:B,sourceMagnet:e,targetMagnet:i,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:o})};if(c!=null&&(typeof c=="boolean"?!c&&t===n&&(C=!1):C=A(c)),C&&d!=null&&(typeof d=="boolean"?!d&&y&&(C=!1):C=A(d)),C&&u!=null&&(typeof u=="boolean"?!u&&De.isEdgeView(b)&&(C=!1):C=A(u)),C&&h!=null&&y==null&&(typeof h=="boolean"?!h&&Wt.isNodeView(b)&&(C=!1):C=A(h)),C&&f!=null&&r){const x=r.cell,v=o==="source"?a:x.getSource(),B=o==="target"?a:x.getTarget(),E=a?this.graph.getCellById(a.cell):null;if(v&&B&&v.cell&&B.cell&&E)if(typeof f=="function")C=A(f);else{const M=this.graph.model.getConnectedEdges(E,{outgoing:o==="source",incoming:o==="target"});M.length&&(f==="withPort"?M.some(T=>{const P=T.getSource(),R=T.getTarget();return P&&R&&P.cell===v.cell&&R.cell===B.cell&&P.port!=null&&P.port===v.port&&R.port!=null&&R.port===B.port})&&(C=!1):f||M.some(T=>{const P=T.getSource(),R=T.getTarget();return P&&R&&P.cell===v.cell&&R.cell===B.cell})&&(C=!1))}}return C&&p!=null&&(C=A(p)),C}allowConnectToBlank(t){const e=this.graph,i=e.options.connecting.allowBlank;if(typeof i!="function")return!!i;const o=e.findViewByCell(t),r=t.getSourceCell(),a=t.getTargetCell(),l=e.findViewByCell(r),c=e.findViewByCell(a);return D(i,e,{edge:t,edgeView:o,sourceCell:r,targetCell:a,sourceView:l,targetView:c,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:o.sourceMagnet,targetMagnet:o.targetMagnet})}validateEdge(t,e,n){const i=this.graph;if(!this.allowConnectToBlank(t)){const r=t.getSourceCellId(),a=t.getTargetCellId();if(!(r&&a))return!1}const o=i.options.connecting.validateEdge;return o?D(o,i,{edge:t,type:e,previous:n}):!0}arrowheadDragging(t,e,n,i){i.x=e,i.y=n,i.currentTarget!==t&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.findViewByElem(t),i.currentView?(i.currentMagnet=i.currentView.findMagnet(t),i.currentMagnet&&this.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,e,n,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=t,this.cell.prop(i.terminalType,{x:e,y:n},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(t,e,n){const i=t.currentView,o=t.currentMagnet;if(!o||!i)return;i.unhighlight(o,{type:"magnetAdsorbed"});const r=t.terminalType,a=i.getEdgeTerminal(o,e,n,this.cell,r);this.cell.setTerminal(r,a,{ui:!0})}snapArrowhead(t,e,n){const i=this.graph,{snap:o,allowEdge:r}=i.options.connecting,a=typeof o=="object"&&o.radius||50,l=typeof o=="object"&&o.anchor||"center",c=i.renderer.findViewsInArea({x:t-a,y:e-a,width:2*a,height:2*a},{nodeOnly:!0});if(r){const x=i.renderer.findEdgeViewsFromPoint({x:t,y:e},a).filter(v=>v!==this);c.push(...x)}const h=n.closestView||null,u=n.closestMagnet||null;n.closestView=null,n.closestMagnet=null;let d,f=Number.MAX_SAFE_INTEGER;const p=new w(t,e);c.forEach(x=>{if(x.container.getAttribute("magnet")!=="false"){if(x.isNodeView())d=l==="center"?x.cell.getBBox().getCenter().distance(p):x.cell.getBBox().getNearestPointToPoint(p).distance(p);else if(x.isEdgeView()){const v=x.getClosestPoint(p);v?d=v.distance(p):d=Number.MAX_SAFE_INTEGER}d<a&&d<f&&(u===x.container||this.validateConnection(...n.getValidateConnectionArgs(x,null),x.getEdgeTerminal(x.container,t,e,this.cell,n.terminalType)))&&(f=d,n.closestView=x,n.closestMagnet=x.container)}x.container.querySelectorAll("[magnet]").forEach(v=>{if(v.getAttribute("magnet")!=="false"){const B=x.getBBoxOfElement(v);d=p.distance(B.getCenter()),d<a&&d<f&&(u===v||this.validateConnection(...n.getValidateConnectionArgs(x,v),x.getEdgeTerminal(v,t,e,this.cell,n.terminalType)))&&(f=d,n.closestView=x,n.closestMagnet=v)}})});let m;const b=n.terminalType,y=n.closestView,C=n.closestMagnet,A=u!==C;if(h&&A&&h.unhighlight(u,{type:"magnetAdsorbed"}),y){if(!A)return;y.highlight(C,{type:"magnetAdsorbed"}),m=y.getEdgeTerminal(C,t,e,this.cell,b)}else m={x:t,y:e};this.cell.setTerminal(b,m,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,i=t.initialTerminal,o=this.cell[n];if(o&&!ft.equalTerminals(i,o)){const a=this.graph,l=i,c=l.cell?a.getCellById(l.cell):null,h=l.port,u=c?a.findViewByCell(c):null,d=c||t.isNewEdge?null:w.create(i).toJSON(),f=o,p=f.cell?a.getCellById(f.cell):null,m=f.port,b=p?a.findViewByCell(p):null,y=p?null:w.create(o).toJSON();this.notify("edge:connected",{e,previousCell:c,previousPort:h,previousView:u,previousPoint:d,currentCell:p,currentView:b,currentPort:m,currentPoint:y,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let i=0,o=n.length;i<o;i+=1){const r=e.findViewByCell(n[i]);if(!r||r.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(r.container.querySelectorAll("[magnet]"));r.container.getAttribute("magnet")!=="false"&&a.push(r.container);const l=a.filter(c=>this.validateConnection(...t.getValidateConnectionArgs(r,c),r.getEdgeTerminal(c,t.x,t.y,this.cell,t.terminalType)));if(l.length>0){for(let c=0,h=l.length;c<h;c+=1)r.highlight(l[c],{type:"magnetAvailable"});r.highlight(null,{type:"nodeAvailable"}),t.marked[r.cell.id]=l}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(n=>{const i=this.graph.findViewByCell(n);i&&(e[n].forEach(r=>{i.unhighlight(r,{type:"magnetAvailable"})}),i.unhighlight(null,{type:"nodeAvailable"}))}),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(t,e,n);return}const o=t.target.getAttribute("data-terminal"),r=this.prepareArrowheadDragging(o,{x:e,y:n});this.setEventData(t,r)}dragArrowhead(t,e,n){const i=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,i):this.arrowheadDragging(this.getEventTarget(t),e,n,i)}stopArrowheadDragging(t,e,n){const i=this.graph,o=this.getEventData(t);i.options.connecting.snap?this.snapArrowheadEnd(o):this.arrowheadDragged(o,e,n),this.validateEdge(this.cell,o.terminalType,o.initialTerminal)?(this.finishEmbedding(o),this.notifyConnectionEvent(o,t)):this.fallbackConnection(o),this.afterArrowheadDragging(o)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const i=t.currentTarget,o=parseInt(i.getAttribute("data-index"),10),r=this.getLabelPositionAngle(o),a=this.getLabelPositionArgs(o),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(t,{index:o,positionAngle:r,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const i=this.getEventData(t),o=this.cell.getLabelAt(i.index),r=ct({},o,{position:this.getLabelPosition(e,n,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,r)}stopLabelDragging(t,e,n){}}const cu=`X6.${De.name}`;De.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),De.registry.register("edge",De,!0);const vn={idle:"idle",raf:"raf",timeout:"timeout"};class Rw{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=16,this.initialTime=Date.now(),this.pendingJobs=new Map,this.scheduleMode=null}queueJob(t){if(t.priority&xe.PRIOR)t.cb();else{const e=this.pendingJobs.get(t.id);if(e){if(e.cb=t.cb,t.priority!==e.priority){e.priority=t.priority;const n=this.queue.indexOf(e);if(n>=0){this.queue.splice(n,1);const i=this.findInsertionIndex(e);this.queue.splice(i,0,e)}}}else{const n=this.findInsertionIndex(t);this.queue.splice(n,0,t),this.pendingJobs.set(t.id,t)}}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.pendingJobs.clear(),this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(t){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let n=this.frameInterval;if(t&&typeof t.timeRemaining=="function"){const i=t.timeRemaining();n=Math.max(0,Math.min(n,i))}for(;this.queue.length>0;){const i=this.queue.shift();if(i.cb(),this.pendingJobs.delete(i.id),this.getCurrentTime()-e>=n)break}this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){for(this.isFlushPending=!1,this.isFlushing=!0;this.queue.length>0;){const t=this.queue.shift();try{t.cb()}catch(e){console.error(e)}this.pendingJobs.delete(t.id)}this.isFlushing=!1}findInsertionIndex(t){let e=0,n=this.queue.length,i=n-1;const o=t.priority;for(;e<=i;){const r=(i-e>>1)+e;o<=this.queue[r].priority?e=r+1:(n=r,i=r-1)}return n}scheduleJob(){this.scheduleId&&this.cancelScheduleJob(),"requestAnimationFrame"in window?(this.scheduleMode=vn.raf,this.scheduleId=window.requestAnimationFrame(()=>this.flushJobs())):"requestIdleCallback"in window?(this.scheduleMode=vn.idle,this.scheduleId=window.requestIdleCallback(t=>this.flushJobs(t),{timeout:100})):(this.scheduleMode=vn.timeout,this.scheduleId=window.setTimeout(()=>this.flushJobs()))}cancelScheduleJob(){if(!this.scheduleId)return;const t={[vn.idle]:window==null?void 0:window.cancelIdleCallback,[vn.raf]:window==null?void 0:window.cancelAnimationFrame,[vn.timeout]:window==null?void 0:window.clearTimeout},e=this.scheduleMode,n=e?t[e]:void 0;typeof n=="function"&&n(this.scheduleId),this.scheduleId=0,this.scheduleMode=null}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var xe;(function(s){s[s.Update=2]="Update",s[s.RenderEdge=4]="RenderEdge",s[s.RenderNode=8]="RenderNode",s[s.PRIOR=1048576]="PRIOR"})(xe||(xe={}));const Dw="#insert";var ue;(function(s){s[s.CREATED=0]="CREATED",s[s.MOUNTED=1]="MOUNTED",s[s.WAITING=2]="WAITING"})(ue||(ue={}));class hu extends Cn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(t){super(),this.views={},this.willRemoveViews={},this.queue=new Rw,this.graph=t,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:t,previous:e}){let n=this.model.getCells();if(!(t!=null&&t.diff))this.queue.clearJobs(),this.removeZPivots(),this.resetViews();else{const i=new Set(e);n=n.filter(o=>!i.has(o))}this.renderViews(n,Object.assign(Object.assign({},t),{queue:n.map(i=>i.id)}))}onCellAdded({cell:t,options:e}){this.renderViews([t],e)}onCellRemoved({cell:t}){this.removeViews([t])}onCellZIndexChanged({cell:t,options:e}){const n=this.views[t.id];n&&this.requestViewUpdate(n.view,Re,e,xe.Update,!0)}onCellVisibleChanged({cell:t,current:e}){this.toggleVisible(t,!!e)}requestViewUpdate(t,e,n={},i=xe.Update,o=!0){const r=t.cell.id,a=this.views[r];if(!a)return;a.flag=e,a.options=n,(t.hasAction(e,["translate","resize","rotate"])||n.async===!1)&&(i=xe.PRIOR,o=!1);const c=e&Re?`${r}${Dw}`:r;this.queue.queueJob({id:c,priority:i,cb:()=>{this.renderViewInArea(t,e,n);const u=n.queue;if(u){const d=u.indexOf(t.cell.id);d>=0&&u.splice(d,1),u.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(t).forEach(u=>{this.requestViewUpdate(u.view,u.flag,n,i,!1)}),o&&this.flush()}setRenderArea(t){this.renderArea=t,Object.values(this.views).forEach(e=>{if(!e)return;const{view:n}=e;e.state===ue.MOUNTED&&(this.isUpdatable(n)||(n.remove(),this.graph.trigger("view:unmounted",{view:n}),e.state=ue.WAITING,e.flag|=Re|n.getBootstrapFlag()))}),this.flushWaitingViews()}isViewMounted(t){if(t==null)return!1;const e=this.views[t.cell.id];return e?e.state===ue.MOUNTED:!1}renderViews(t,e={}){t.sort((n,i)=>n.isNode()&&i.isEdge()?-1:0),t.forEach(n=>{const i=n.id,o=this.views;let r=0,a=o[i];if(a)r=Re;else{const l=this.createCellView(n);l&&(l.graph=this.graph,r=Re|l.getBootstrapFlag(),a={view:l,flag:r,options:e,state:ue.CREATED},this.views[i]=a)}a&&this.requestViewUpdate(a.view,r,e,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(t,e,n={}){const i=t.cell,o=i.id,r=this.views[o];if(!r)return;let a=0;this.isUpdatable(t)?(a=this.updateView(t,e,n),r.flag=a):(r.state===ue.MOUNTED&&(t.remove(),this.graph.trigger("view:unmounted",{view:t}),a=0),r.state=ue.WAITING,r.flag=e|Re|t.getBootstrapFlag()),a&&i.isEdge()&&!(a&t.getFlag(["source","target"]))&&this.queue.queueJob({id:o,priority:xe.RenderEdge,cb:()=>{this.updateView(t,e,n)}})}removeViews(t){t.forEach(e=>{const n=e.id,i=this.views[n];i&&(this.willRemoveViews[n]=i,delete this.views[n],this.queue.queueJob({id:n,priority:this.getRenderPriority(i.view),cb:()=>{this.removeView(i.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(t=>{if(t&&t.state===ue.WAITING){const{view:e,flag:n,options:i}=t;this.requestViewUpdate(e,n,i,this.getRenderPriority(e),!1)}}),this.flush()}updateView(t,e,n={}){if(t==null)return 0;if(xt.isCellView(t)){if(e&Nw)return this.removeView(t.cell),0;e&Re&&(this.insertView(t),e^=Re)}return e?t.confirmUpdate(e,n):0}insertView(t){const e=this.views[t.cell.id];if(e){const n=t.cell.getZIndex(),i=this.addZPivot(n);this.container.insertBefore(t.container,i),t.cell.isVisible()||this.toggleVisible(t.cell,!1),e.state=ue.MOUNTED,this.graph.trigger("view:mounted",{view:t})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(t=>{t&&this.removeView(t.view)}),this.views={},this.willRemoveViews={}}removeView(t){const e=t.cell,n=this.willRemoveViews[e.id];n&&t&&(n.view.remove(),delete this.willRemoveViews[e.id],this.graph.trigger("view:unmounted",{view:t}))}toggleVisible(t,e){const n=this.model.getConnectedEdges(t);for(let o=0,r=n.length;o<r;o+=1){const a=n[o];if(e){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const i=this.views[t.id];i&&$(i.view.container,{display:e?"unset":"none"})}addZPivot(t=0){this.zPivots==null&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment(`z-index:${t+1}`);let i=-1/0;for(const r in e){const a=+r;a<t&&a>i&&(i=a)}const o=this.container;if(i!==-1/0){const r=e[i];o.insertBefore(n,r.nextSibling)}else o.insertBefore(n,o.firstChild);return n}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),this.zPivots={}}createCellView(t){const e={graph:this.graph},n=this.graph.options.createCellView;if(n){const o=D(n,this.graph,t);if(o)return new o(t,e);if(o===null)return null}const i=t.view;if(i!=null&&typeof i=="string"){const o=xt.registry.get(i);return o?new o(t,e):xt.registry.onNotFound(i)}return t.isNode()?new Wt(t,e):t.isEdge()?new De(t,e):null}getEffectedEdges(t){const e=[],n=t.cell,i=this.model.getConnectedEdges(n);for(let o=0,r=i.length;o<r;o+=1){const a=i[o],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const h=["update"];a.getTargetCell()===n&&h.push("target"),a.getSourceCell()===n&&h.push("source"),e.push({id:a.id,view:c,flag:c.getFlag(h)})}return e}isUpdatable(t){if(t.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(t.cell.getBBox()):!0;if(t.isEdgeView()){const e=t.cell,n=this.renderArea?this.renderArea.isIntersectWithRect(e.getBBox()):!0;if(this.graph.virtualRender.isVirtualEnabled())return n;const i=e.getSourceCell(),o=e.getTargetCell();if(this.renderArea&&i&&o)return this.renderArea.isIntersectWithRect(i.getBBox())||this.renderArea.isIntersectWithRect(o.getBBox())}return!0}getRenderPriority(t){return t.cell.isNode()?xe.RenderNode:xe.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(t=>{this.views[t].view.dispose()}),this.views={}}}H([_()],hu.prototype,"dispose",null);class uu extends _t{constructor(){super(...arguments),this.schedule=new hu(this.graph)}requestViewUpdate(t,e,n={}){this.schedule.requestViewUpdate(t,e,n)}isViewMounted(t){return this.schedule.isViewMounted(t)}setRenderArea(t){this.schedule.setRenderArea(t)}findViewByElem(t){if(t==null)return null;const e=this.options.container,n=typeof t=="string"?e.querySelector(t):t instanceof Element?t:t[0];if(n){const i=this.graph.view.findAttr("data-cell-id",n);if(i){const o=this.schedule.views;if(o[i])return o[i].view}}return null}findViewByCell(t){if(t==null)return null;const e=G.isCell(t)?t.id:t,n=this.schedule.views;return n[e]?n[e].view:null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(n=>this.findViewByCell(n)).filter(n=>n!=null?he(n.container,{target:this.view.stage}).containsPoint(e):!1)}findEdgeViewsFromPoint(t,e=5){return this.model.getEdges().map(n=>this.findViewByCell(n)).filter(n=>{if(n!=null){const i=n.getClosestPoint(t);if(i)return i.distance(t)<=e}return!1})}findViewsInArea(t,e={}){const n=I.create(t);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(e.nodeOnly&&!i.isNodeView())return!1;const o=he(i.container,{target:this.view.stage});return o.width===0?o.inflate(1,0):o.height===0&&o.inflate(0,1),e.strict?n.containsRect(o):n.isIntersectWithRect(o)}return!1})}dispose(){this.schedule.dispose()}}H([_()],uu.prototype,"dispose",null);class lr extends _t{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const i=this.graph.transform.getScale(),o=this.graph.translate();if(typeof n=="object"){const r=o.tx+i.sx*(n.x||0),a=o.ty+i.sy*(n.y||0);n=`${r}px ${a}px`}typeof e=="object"&&(e=I.fromSize(e).scale(i.sx,i.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const n=this.optionsCache;if(n&&n.image!==e.image)return;let i;const o=e.opacity,r=e.size;let a=e.repeat||"no-repeat";const l=cs.get(a);if(typeof l=="function"){const h=e.quality||1;t.width*=h,t.height*=h;const u=l(t,e);if(!(u instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=u.toDataURL("image/png"),e.repeat&&a!==e.repeat?a=e.repeat:a="repeat",typeof r=="object"?(r.width*=u.width/t.width,r.height*=u.height/t.height):r===void 0&&(e.size={width:u.width/h,height:u.height/h})}else i=t.src,r===void 0&&(e.size={width:t.width,height:t.height});n!=null&&typeof e.size=="object"&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=to(e.size));const c=this.elem.style;c.backgroundImage=`url(${i})`,c.backgroundRepeat=a,c.opacity=o==null||o>=1?"":`${o}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=to(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}H([_()],lr.prototype,"dispose",null);class Qw extends _t{getClientMatrix(){return wt(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new w(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return(typeof t=="number"?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=w.create(t,e);return we(n,this.graph.matrix())}localToClientPoint(t,e){const n=w.create(t,e);return we(n,this.getClientMatrix())}localToPagePoint(t,e){return(typeof t=="number"?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,n,i){const o=I.create(t,e,n,i);return Ht(o,this.graph.matrix())}localToClientRect(t,e,n,i){const o=I.create(t,e,n,i);return Ht(o,this.getClientMatrix())}localToPageRect(t,e,n,i){return(typeof t=="number"?this.localToGraphRect(t,e,n,i):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=w.create(t,e);return we(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=w.create(t,e);return we(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=w.create(t,e);return we(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const i=w.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(t,e,n,i){const o=I.create(t,e,n,i);return Ht(o,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,i){const o=I.create(t,e,n,i);return Ht(o,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,i){const o=I.create(t,e,n,i);return Ht(o,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,i){const o=I.create(t,e,n,i),r=this.getPageOffset();return o.x-=r.x,o.y-=r.y,this.graphToLocalRect(o)}}const Lw=`.x6-graph {
|
|
86
|
+
`.trim()}const q3=Object.freeze(Object.defineProperty({__proto__:null,blur:U3,brightness:_3,contrast:W3,dropShadow:K3,grayScale:J3,highlight:F3,hueRotate:Y3,invert:H3,outline:z3,saturate:G3,sepia:j3},Symbol.toStringTag,{value:"Module"})),ci=bt.create({type:"filter"});ci.register(q3,!0);const X3=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(i,t){const e=t.thickness*t.sx,n=t.thickness*t.sy;W(i,{width:e,height:n,rx:e,ry:n,fill:t.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(i,t){let e;const n=t.width,s=t.height,o=t.thickness;n-o>=0&&s-o>=0?e=["M",n,0,"H0 M0 0 V0",s].join(" "):e="M 0 0 0 0",W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(i,t){let e;const n=t.factor||1,s=t.width*n,o=t.height*n,r=t.thickness;s-r>=0&&o-r>=0?e=["M",s,0,"H0 M0 0 V0",o].join(" "):e="M 0 0 0 0",t.width=s,t.height=o,W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(i,t){const e=t.sx<=1?t.thickness*t.sx:t.thickness;W(i,{width:e,height:e,rx:e,ry:e,fill:t.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(i,t){let e;const n=t.width,s=t.height,o=t.thickness;n-o>=0&&s-o>=0?e=["M",n,0,"H0 M0 0 V0",s].join(" "):e="M 0 0 0 0",W(i,{d:e,stroke:t.color,"stroke-width":t.thickness})}}},Symbol.toStringTag,{value:"Module"}));class $3{constructor(){this.patterns={},this.root=K.create(es(),{width:"100%",height:"100%"},[ae("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,K.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return this.patterns[t]!=null}}const bh=X3,hi=bt.create({type:"grid"});hi.register(bh,!0);const et={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(i){return`${et.prefixCls}-${i}`}},yh=et.prefix("highlighted"),Z3={highlight(i,t,e){const n=e&&e.className||yh;L(t,n)},unhighlight(i,t,e){const n=e&&e.className||yh;at(t,n)}},wh=et.prefix("highlight-opacity"),tw={highlight(i,t){L(t,wh)},unhighlight(i,t){at(t,wh)}},ew={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},nw={highlight(i,t,e){const n=Ch(t,e);if(sw(n))return;e=Bl({},e,ew);const s=K.create(t);let o,r;try{o=s.toPathData()}catch{r=Qc(s.node),o=Cc(Object.assign(Object.assign({},e),r))}const a=ae("path");if(W(a,Object.assign({d:o,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},e.attrs?Wn(e.attrs):null)),i.isEdgeElement(t))W(a,"d",i.getConnectionPathData());else{let h=s.getTransformToElement(i.container);const u=e.padding;if(u){r==null&&(r=Qc(s.node));const d=r.x+r.width/2,f=r.y+r.height/2;r=qt(r,h);const m=Math.max(r.width,1),p=Math.max(r.height,1),b=(m+u)/m,y=(p+u)/p,C=Et({a:b,b:0,c:0,d:y,e:d-b*d,f:f-y*f});h=h.multiply(C)}pn(a,h)}L(a,et.prefix("highlight-stroke"));const l=i.cell,c=()=>Ah(n);l.on("removed",c),l.model&&l.model.on("reseted",c),i.container.appendChild(a),iw(n,a)},unhighlight(i,t,e){Ah(Ch(t,e))}};function Ch(i,t){return So(i),i.id+JSON.stringify(t)}const As={};function iw(i,t){As[i]=t}function sw(i){return As[i]!=null}function Ah(i){const t=As[i];t&&(_t(t),delete As[i])}const ow=Object.freeze(Object.defineProperty({__proto__:null,className:Z3,opacity:tw,stroke:nw},Symbol.toStringTag,{value:"Module"}));function rw(i,t){if(typeof t.highlight!="function")throw new Error(`Highlighter '${i}' is missing required \`highlight()\` method`);if(typeof t.unhighlight!="function")throw new Error(`Highlighter '${i}' is missing required \`unhighlight()\` method`)}const aw=ow,ui=bt.create({type:"highlighter"});ui.register(aw,!0);const lw=ve("center"),cw=ve("topCenter"),hw=ve("bottomCenter"),uw=ve("leftMiddle"),dw=ve("rightMiddle"),gw=ve("topLeft"),fw=ve("topRight"),pw=ve("bottomLeft"),mw=ve("bottomRight");function ve(i){return(t,e,n,s={})=>{let o;t.cell.visible?o=s.rotate?t.getUnrotatedBBoxOfElement(e):t.getBBoxOfElement(e):o=t.cell.getBBox();const r=o[i];r.x+=jt(s.dx,o.width),r.y+=jt(s.dy,o.height);const a=t.cell;return s.rotate?r.rotate(-a.getAngle(),a.getBBox().getCenter()):r}}const bw=Cs((i,t,e,n)=>{const s=Qt(i.cell.getAngle()),o=i.cell.visible?i.getBBoxOfElement(t):i.cell.getBBox(),r=o.getCenter(),a=o.getTopLeft(),l=o.getBottomRight();let c=n.padding;if(Number.isFinite(c)||(c=0),a.y+c<=e.y&&e.y<=l.y-c){const h=e.y-r.y;r.x+=s===0||s===180?0:h*1/Math.tan(Rt(s)),r.y+=h}else if(a.x+c<=e.x&&e.x<=l.x-c){const h=e.x-r.x;r.y+=s===90||s===270?0:h*Math.tan(Rt(s)),r.x+=h}return r}),yw=function(i,t,e,n,s){const o=i.cell.getConnectionPoint(this.cell,s);return(n.dx||n.dy)&&o.translate(n.dx||0,n.dy||0),o},ww=Cs((i,t,e,n)=>{let s,o=0,r;const a=i.cell;n.rotate?(s=i.getUnrotatedBBoxOfElement(t),r=a.getBBox().getCenter(),o=a.getAngle()):a.visible?s=i.getBBoxOfElement(t):s=i.cell.getBBox();const l=n.padding;l!=null&&Number.isFinite(l)&&s.inflate(l),n.rotate&&e.rotate(o,r);const c=s.getNearestSideToPoint(e);let h;switch(c){case"left":h=s.getLeftMiddle();break;case"right":h=s.getRightMiddle();break;case"top":h=s.getTopCenter();break;case"bottom":h=s.getBottomCenter();break}const u=n.direction;return u==="H"?(c==="top"||c==="bottom")&&(e.x<=s.x+s.width?h=s.getLeftMiddle():h=s.getRightMiddle()):u==="V"&&(e.y<=s.y+s.height?h=s.getTopCenter():h=s.getBottomCenter()),n.rotate?h.rotate(-o,r):h}),Cw=Object.freeze(Object.defineProperty({__proto__:null,bottom:hw,bottomLeft:pw,bottomRight:mw,center:lw,left:uw,midSide:ww,nodeCenter:yw,orth:bw,right:dw,top:cw,topLeft:gw,topRight:fw},Symbol.toStringTag,{value:"Module"})),di=bt.create({type:"node endpoint"});di.register(Cw,!0);const Aw={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ne(i,t){const{x:e,y:n,angle:s,attrs:o}=t||{};return Bl({},{angle:s,attrs:o,position:{x:e,y:n}},i,Aw)}const xw=(i,t,e)=>Ne({position:t.getTopLeft()},e),vw=(i,t,e)=>Ne({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},e),Ew=(i,t,e)=>Ne({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},e),Sw=(i,t,e)=>Ne({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},e),Mw=(i,t,e)=>Ne({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},e),Bw=(i,t,e)=>xh(i,t,!1,e),kw=(i,t,e)=>xh(i,t,!0,e),Tw=(i,t,e)=>vh(i,t,!1,e),Iw=(i,t,e)=>vh(i,t,!0,e);function xh(i,t,e,n){const s=n.offset!=null?n.offset:15,o=t.getCenter().theta(i),r=Eh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=s,c=0,h="start"):o<r[0]?(a="0",l=0,c=-s,e?(u=-90,h="start"):h="middle"):o<r[3]?(a=".3em",l=-s,c=0,h="end"):(a=".6em",l=0,c=s,e?(u=90,h="start"):h="middle"),Ne({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function vh(i,t,e,n){const s=n.offset!=null?n.offset:15,o=t.getCenter().theta(i),r=Eh(t);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=-s,c=0,h="end"):o<r[0]?(a=".6em",l=0,c=s,e?(u=90,h="start"):h="middle"):o<r[3]?(a=".3em",l=s,c=0,h="start"):(a="0em",l=0,c=-s,e?(u=-90,h="start"):h="middle"),Ne({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},n)}function Eh(i){const t=i.getCenter(),e=t.theta(i.getTopLeft()),n=t.theta(i.getBottomLeft()),s=t.theta(i.getBottomRight()),o=t.theta(i.getTopRight());return[e,o,s,n]}const Pw=(i,t,e)=>Sh(i.diff(t.getCenter()),!1,e),Ow=(i,t,e)=>Sh(i.diff(t.getCenter()),!0,e);function Sh(i,t,e){const n=e.offset!=null?e.offset:20,s=new A(0,0),o=-i.theta(s),r=i.clone().move(s,n).diff(i).round();let a=".3em",l,c=o;return(o+90)%180===0?(l=t?"end":"middle",!t&&o===-270&&(a="0em")):o>-270&&o<-90?(l="start",c=o-180):l="end",Ne({position:r.round().toJSON(),angle:t?c:0,attrs:{".":{y:a,"text-anchor":l}}},e)}const Mh=Object.freeze(Object.defineProperty({__proto__:null,bottom:Mw,inside:Tw,insideOriented:Iw,left:vw,manual:xw,outside:Bw,outsideOriented:kw,radial:Pw,radialOriented:Ow,right:Ew,top:Sw},Symbol.toStringTag,{value:"Module"})),xs=bt.create({type:"port label layout"});xs.register(Mh,!0);function tr(i,t={}){return new A(jt(t.x,i.width),jt(t.y,i.height))}function er(i,t,e){return Object.assign({angle:t,position:i.toJSON()},e)}const Nw=(i,t)=>i.map(({x:e,y:n,angle:s})=>er(tr(t,{x:e,y:n}),s||0)),Rw=(i,t,e)=>{const n=e.start||0,s=e.step||20;return Bh(i,t,n,(o,r)=>(o+.5-r/2)*s)},Dw=(i,t,e)=>{const n=e.start||0,s=e.step||360/i.length;return Bh(i,t,n,o=>o*s)};function Bh(i,t,e,n){const s=t.getCenter(),o=t.getTopCenter(),r=t.width/t.height,a=Kt.fromRect(t),l=i.length;return i.map((c,h)=>{const u=e+n(h,l),d=o.clone().rotate(-u,s).scale(r,1,s),f=c.compensateRotate?-a.tangentTheta(d):0;return(c.dx||c.dy)&&d.translate(c.dx||0,c.dy||0),c.dr&&d.move(s,c.dr),er(d.round(),f,c)})}const Lw=(i,t,e)=>{const n=tr(t,e.start||t.getOrigin()),s=tr(t,e.end||t.getCorner());return gi(i,n,s,e)},Qw=(i,t,e)=>gi(i,t.getTopLeft(),t.getBottomLeft(),e),Vw=(i,t,e)=>gi(i,t.getTopRight(),t.getBottomRight(),e),zw=(i,t,e)=>gi(i,t.getTopLeft(),t.getTopRight(),e),Fw=(i,t,e)=>gi(i,t.getBottomLeft(),t.getBottomRight(),e);function gi(i,t,e,n){const s=new z(t,e),o=i.length;return i.map((r,a)=>{var{strict:l}=r,c=_(r,["strict"]);const h=l||n.strict?(a+1)/(o+1):(a+.5)/o,u=s.pointAt(h);return(c.dx||c.dy)&&u.translate(c.dx||0,c.dy||0),er(u.round(),0,c)})}const kh=Object.freeze(Object.defineProperty({__proto__:null,absolute:Nw,bottom:Fw,ellipse:Rw,ellipseSpread:Dw,left:Qw,line:Lw,right:Vw,top:zw},Symbol.toStringTag,{value:"Module"})),fi=bt.create({type:"port layout"});fi.register(kh,!0);const Uw=i=>[...i],Kw=(i,t,e)=>{const n=t.side||"bottom",s=se(t.padding||40),o=e.sourceBBox,r=e.targetBBox,a=o.getCenter(),l=r.getCenter();let c,h,u;switch(n){case"top":u=-1,c="y",h="height";break;case"left":u=-1,c="x",h="width";break;case"right":u=1,c="x",h="width";break;case"bottom":default:u=1,c="y",h="height";break}return a[c]+=u*(o[h]/2+s[n]),l[c]+=u*(r[h]/2+s[n]),u*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...i,l.toJSON()]};function vs(i){return new I(i.x,i.y,0,0)}function Es(i={}){const t=se(i.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function Th(i,t={}){return i.sourceBBox.clone().moveAndExpand(Es(t))}function Ih(i,t={}){return i.targetBBox.clone().moveAndExpand(Es(t))}function Jw(i,t={}){return i.sourceAnchor?i.sourceAnchor:Th(i,t).getCenter()}function jw(i,t={}){return i.targetAnchor?i.targetAnchor:Ih(i,t).getCenter()}const Ph=(i,t,e)=>{let n=Th(e,t),s=Ih(e,t);const o=Jw(e,t),r=jw(e,t);n=n.union(vs(o)),s=s.union(vs(r));const a=i.map(h=>A.create(h));a.unshift(o),a.push(r);let l=null;const c=[];for(let h=0,u=a.length-1;h<u;h+=1){let d=null;const f=a[h],m=a[h+1],p=Ft(f,m)!=null;if(h===0)h+1===u?n.intersectsWithRect(s.clone().inflate(1))?d=ir(f,m,n,s):p||(d=_w(f,m,n,s)):n.containsPoint(m)?d=ir(f,m,n,vs(m).moveAndExpand(Es(t))):p||(d=Ms(f,m,n));else if(h+1===u){const b=p&&Ft(m,f)===l;s.containsPoint(f)||b?d=ir(f,m,vs(f).moveAndExpand(Es(t)),s,l):p||(d=Hw(f,m,s,l))}else p||(d=Oh(f,m,l));d?(c.push(...d.points),l=d.direction):l=Ft(f,m),h+1<u&&c.push(m)}return c},Gw={N:"S",S:"N",E:"W",W:"E"},Yw={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function Ss(i,t,e){let n=new A(i.x,t.y);return e.containsPoint(n)&&(n=new A(t.x,i.y)),n}function nr(i,t){return i[t==="W"||t==="E"?"width":"height"]}function Ft(i,t){return i.x===t.x?i.y>t.y?"N":"S":i.y===t.y?i.x>t.x?"W":"E":null}function Oh(i,t,e){const n=new A(i.x,t.y),s=new A(t.x,i.y),o=Ft(i,n),r=Ft(i,s),a=e?Gw[e]:null,l=o===e||o!==a&&(r===a||r!==e)?n:s;return{points:[l],direction:Ft(l,t)}}function Ms(i,t,e){const n=Ss(i,t,e);return{points:[n],direction:Ft(n,t)}}function Hw(i,t,e,n){const s=[new A(i.x,t.y),new A(t.x,i.y)],o=s.filter(l=>!e.containsPoint(l)),r=o.filter(l=>Ft(l,i)!==n);let a;if(r.length>0)return a=r.filter(l=>Ft(i,l)===n).pop(),a=a||r[0],{points:[a],direction:Ft(a,t)};{a=yb(s,o)[0];const l=A.create(t).move(a,-nr(e,n)/2);return{points:[Ss(l,i,e),l],direction:Ft(l,t)}}}function _w(i,t,e,n){let s=Ms(t,i,n);const o=s.points[0];if(e.containsPoint(o)){s=Ms(i,t,e);const r=s.points[0];if(n.containsPoint(r)){const a=A.create(i).move(r,-nr(e,Ft(i,r))/2),l=A.create(t).move(o,-nr(n,Ft(t,o))/2),c=new z(a,l).getCenter(),h=Ms(i,c,e),u=Oh(c,t,h.direction);s.points=[h.points[0],u.points[0]],s.direction=u.direction}}return s}function ir(i,t,e,n,s){const o=e.union(n).inflate(1),r=o.getCenter(),a=r.distance(t)>r.distance(i),l=a?t:i,c=a?i:t;let h,u,d;s?(h=A.fromPolar(o.width+o.height,Yw[s],l),h=o.getNearestPointToPoint(h).move(h,-1)):h=o.getNearestPointToPoint(l).move(l,1),u=Ss(h,c,o);let f;h.round().equals(u.round())?(u=A.fromPolar(o.width+o.height,Rt(h.theta(l))+Math.PI/2,c),u=o.getNearestPointToPoint(u).move(c,1).round(),d=Ss(h,u,o),f=a?[u,d,h]:[h,d,u]):f=a?[u,h]:[h,u];const m=Ft(a?h:u,t);return{points:f,direction:m}}const Ww={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Re(this.step,this)},directions(){const i=Re(this.step,this),t=Re(this.cost,this);return[{cost:t,offsetX:i,offsetY:0},{cost:t,offsetX:-i,offsetY:0},{cost:t,offsetX:0,offsetY:i},{cost:t,offsetX:0,offsetY:-i}]},penalties(){const i=Re(this.step,this);return{0:0,45:i/2,90:i/2}},paddingBox(){const i=Re(this.step,this);return{x:-i,y:-i,width:2*i,height:2*i}},fallbackRouter:Ph,draggingRouter:null,snapToGrid:!0};function Re(i,t){return typeof i=="function"?i.call(t):i}function qw(i){const t=Object.keys(i).reduce((e,n)=>{const s=e;return n==="fallbackRouter"||n==="draggingRouter"||n==="fallbackRoute"?s[n]=i[n]:s[n]=Re(i[n],i),e},{});if(t.padding){const e=se(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{const n=new A(0,0),s=new A(e.offsetX,e.offsetY);e.angle=Qt(n.theta(s))}),t}class Xw{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,s=n.excludeTerminals.reduce((c,h)=>{const u=e[h];if(u){const d=t.getCell(u.cell);d&&c.push(d)}return c},[]);let o=[];const r=t.getCell(e.getSourceCellId());r&&(o=Ol(o,r.getAncestors().map(c=>c.id)));const a=t.getCell(e.getTargetCellId());a&&(o=Ol(o,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return t.getNodes().reduce((c,h)=>{const u=s.some(b=>b.id===h.id),d=h.shape?n.excludeShapes.includes(h.shape):!1,f=n.excludeNodes.some(b=>typeof b=="string"?h.id===b:b===h),m=o.includes(h.id),p=d||u||f||m;if(h.isVisible()&&!p){const b=h.getBBox().moveAndExpand(n.paddingBox),y=b.getOrigin().snapToGrid(l),C=b.getCorner().snapToGrid(l);for(let w=y.x;w<=C.x;w+=l)for(let x=y.y;x<=C.y;x+=l){const E=new A(w,x).toString();c[E]==null&&(c[E]=[]),c[E].push(b)}}return c},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return n?n.every(s=>!s.containsPoint(t)):!0}}const Nh=1,Rh=2;class $w{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=Nh,this.values[t]=e;const n=Wb(this.items,t,s=>this.values[s]);this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=Rh),t}isOpen(t){return this.hash[t]===Nh}isClose(t){return this.hash[t]===Rh}isEmpty(){return this.items.length===0}}function Dh(i,t){const e=i.sourceBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Lh(i,t){const e=i.targetBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function Qh(i,t){return i.sourceAnchor?i.sourceAnchor:Dh(i,t).getCenter()}function Zw(i,t){return i.targetAnchor?i.targetAnchor:Lh(i,t).getCenter()}function sr(i,t,e,n,s){const o=360/e,r=i.theta(tC(i,t,n,s)),a=Qt(r+o/2);return o*Math.floor(a/o)}function tC(i,t,e,n){const s=n.step,o=t.x-i.x,r=t.y-i.y,a=o/e.x,l=r/e.y,c=a*s,h=l*s;return new A(i.x+c,i.y+h)}function Vh(i,t){const e=Math.abs(i-t);return e>180?360-e:e}function eC(i,t){const e=t.step;return t.directions.forEach(n=>{n.gridOffsetX=n.offsetX/e*i.x,n.gridOffsetY=n.offsetY/e*i.y}),t.directions}function nC(i,t,e){return{source:t.clone(),x:zh(e.x-t.x,i),y:zh(e.y-t.y,i)}}function zh(i,t){if(!i)return t;const e=Math.abs(i),n=Math.round(e/t);if(!n)return e;const s=n*t,r=(e-s)/n;return t+r}function iC(i,t){const e=t.source,n=oe(i.x-e.x,t.x)+e.x,s=oe(i.y-e.y,t.y)+e.y;return new A(n,s)}function pi(i,t){return i.round(t)}function Bs(i,t,e){return pi(iC(i.clone(),t),e)}function mi(i){return i.toString()}function or(i){return new A(i.x===0?0:Math.abs(i.x)/i.x,i.y===0?0:Math.abs(i.y)/i.y)}function Fh(i,t){let e=1/0;for(let n=0,s=t.length;n<s;n+=1){const o=i.manhattanDistance(t[n]);o<e&&(e=o)}return e}function Uh(i,t,e,n,s){const o=s.precision,r=s.directionMap,a=i.diff(t.getCenter()),l=Object.keys(r).reduce((c,h)=>{if(e.includes(h)){const u=r[h],d=new A(i.x+u.x*(Math.abs(a.x)+t.width),i.y+u.y*(Math.abs(a.y)+t.height)),m=new z(i,d).intersect(t)||[];let p,b=null;for(let y=0;y<m.length;y+=1){const C=m[y],w=i.squaredDistance(C);(p==null||w>p)&&(p=w,b=C)}if(b){let y=Bs(b,n,o);t.containsPoint(y)&&(y=Bs(y.translate(u.x*n.x,u.y*n.y),n,o)),c.push(y)}}return c},[]);return t.containsPoint(i)||l.push(Bs(i,n,o)),l}function sC(i,t,e,n,s){const o=[];let r=or(s.diff(e)),a=mi(e),l=i[a],c;for(;l;){c=t[a];const d=or(c.diff(l));d.equals(r)||(o.unshift(c),r=d),a=mi(l),l=i[a]}const h=t[a];return or(h.diff(n)).equals(r)||o.unshift(h),o}function oC(i,t,e,n,s){const o=s.precision;let r,a;I.isRectangle(t)?r=pi(Qh(i,s).clone(),o):r=pi(t.clone(),o),I.isRectangle(e)?a=pi(Zw(i,s).clone(),o):a=pi(e.clone(),o);const l=nC(s.step,r,a),c=r,h=a;let u,d;if(I.isRectangle(t)?u=Uh(c,t,s.startDirections,l,s):u=[c],I.isRectangle(e)?d=Uh(a,e,s.endDirections,l,s):d=[h],u=u.filter(f=>n.isAccessible(f)),d=d.filter(f=>n.isAccessible(f)),u.length>0&&d.length>0){const f=new $w,m={},p={},b={};for(let T=0,P=u.length;T<P;T+=1){const R=u[T],J=mi(R);f.add(J,Fh(R,d)),m[J]=R,b[J]=0}const y=s.previousDirectionAngle,C=y===void 0;let w,x;const E=eC(l,s),S=E.length,v=d.reduce((T,P)=>{const R=mi(P);return T.push(R),T},[]),M=A.equalPoints(u,d);let k=s.maxLoopCount;for(;!f.isEmpty()&&k>0;){const T=f.pop(),P=m[T],R=p[T],J=b[T],D=P.equals(c),N=R==null;let G;if(N?C?D?G=null:G=sr(c,P,S,l,s):G=y:G=sr(R,P,S,l,s),!(N&&M)&&v.indexOf(T)>=0)return s.previousDirectionAngle=G,sC(p,m,P,c,h);for(let yt=0;yt<S;yt+=1){w=E[yt];const gt=w.angle;if(x=Vh(G,gt),!(C&&D)&&x>s.maxDirectionChange)continue;const lt=Bs(P.clone().translate(w.gridOffsetX||0,w.gridOffsetY||0),l,o),V=mi(lt);if(f.isClose(V)||!n.isAccessible(lt))continue;if(v.indexOf(V)>=0&&!lt.equals(h)){const Q=sr(lt,h,S,l,s);if(Vh(gt,Q)>s.maxDirectionChange)continue}const Z=w.cost,it=D?0:s.penalties[x],H=J+Z+it;(!f.isOpen(V)||H<b[V])&&(m[V]=lt,p[V]=P,b[V]=H,f.add(V,H+Fh(lt,d)))}k-=1}}return s.fallbackRoute?F(s.fallbackRoute,this,c,h,s):null}function rC(i,t=10){if(i.length<=1)return i;for(let e=0,n=i.length;e<n-1;e+=1){const s=i[e],o=i[e+1];if(s.x===o.x){const r=t*Math.round(s.x/t);s.x!==r&&(s.x=r,o.x=r)}else if(s.y===o.y){const r=t*Math.round(s.y/t);s.y!==r&&(s.y=r,o.y=r)}}return i}const aC=function(i,t,e){const n=qw(t),s=Dh(e,n),o=Lh(e,n),r=Qh(e,n),a=new Xw(n).build(e.graph.model,e.cell),l=i.map(f=>A.create(f)),c=[];let h=r,u,d;for(let f=0,m=l.length;f<=m;f+=1){let p=null;if(u=d||s,d=l[f],d==null){d=o;const y=e.cell;if((y.getSourceCellId()==null||y.getTargetCellId()==null)&&typeof n.draggingRouter=="function"){const w=u===s?r:u,x=d.getOrigin();p=F(n.draggingRouter,e,w,x,n)}}if(p==null&&(p=oC(e,u,d,a,n)),p===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),F(n.fallbackRouter,this,i,n,e);const b=p[0];b&&b.equals(h)&&p.shift(),h=p[p.length-1]||h,c.push(...p)}return n.snapToGrid?rC(c,e.graph.grid.getGridSize()):c},Kh=function(i,t,e){return F(aC,this,i,Object.assign(Object.assign({},Ww),t),e)},lC={maxDirectionChange:45,directions(){const i=Re(this.step,this),t=Re(this.cost,this),e=Math.ceil(Math.sqrt(i*i<<1));return[{cost:t,offsetX:i,offsetY:0},{cost:e,offsetX:i,offsetY:i},{cost:t,offsetX:0,offsetY:i},{cost:e,offsetX:-i,offsetY:i},{cost:t,offsetX:-i,offsetY:0},{cost:e,offsetX:-i,offsetY:-i},{cost:t,offsetX:0,offsetY:-i},{cost:e,offsetX:i,offsetY:-i}]},fallbackRoute(i,t,e){const n=i.theta(t),s=[];let o={x:t.x,y:i.y},r={x:i.x,y:t.y};if(n%180>90){const w=o;o=r,r=w}const a=n%90<45?o:r,l=new z(i,a),c=90*Math.ceil(n/90),h=A.fromPolar(l.squaredLength(),Rt(c+135),a),u=new z(t,h),d=l.intersectsWithLine(u),f=d||t,m=d?f:i,p=360/e.directions.length,b=m.theta(t),y=Qt(b+p/2),C=p*Math.floor(y/p);return e.previousDirectionAngle=C,f&&s.push(f.round()),s.push(t),s}},cC=function(i,t,e){return F(Kh,this,i,Object.assign(Object.assign({},lC),t),e)},hC=(i,t,e)=>{const n=t.offset||32,s=t.min==null?16:t.min;let o=0,r=t.direction;const a=e.sourceBBox,l=e.targetBBox,c=a.getCenter(),h=l.getCenter();if(typeof n=="number"&&(o=n),r==null){let y=l.left-a.right,C=l.top-a.bottom;y>=0&&C>=0?r=y>=C?"L":"T":y<=0&&C>=0?(y=a.left-l.right,y>=0?r=y>=C?"R":"T":r="T"):y>=0&&C<=0?(C=a.top-l.bottom,C>=0?r=y>=C?"L":"B":r="L"):(y=a.left-l.right,C=a.top-l.bottom,y>=0&&C>=0?r=y>=C?"R":"B":y<=0&&C>=0?r="B":y>=0&&C<=0?r="R":r=Math.abs(y)>Math.abs(C)?"R":"B")}r==="H"?r=h.x-c.x>=0?"L":"R":r==="V"&&(r=h.y-c.y>=0?"T":"B"),n==="center"&&(r==="L"?o=(l.left-a.right)/2:r==="R"?o=(a.left-l.right)/2:r==="T"?o=(l.top-a.bottom)/2:r==="B"&&(o=(a.top-l.bottom)/2));let u,d,f;const m=r==="L"||r==="R";if(m){if(h.y===c.y)return[...i];f=r==="L"?1:-1,u="x",d="width"}else{if(h.x===c.x)return[...i];f=r==="T"?1:-1,u="y",d="height"}const p=c.clone(),b=h.clone();if(p[u]+=f*(a[d]/2+o),b[u]-=f*(l[d]/2+o),m){const y=p.x,C=b.x,w=a.width/2+s,x=l.width/2+s;h.x>c.x?C<=y&&(p.x=Math.max(C,c.x+w),b.x=Math.min(y,h.x-x)):C>=y&&(p.x=Math.min(C,c.x-w),b.x=Math.max(y,h.x+x))}else{const y=p.y,C=b.y,w=a.height/2+s,x=l.height/2+s;h.y>c.y?C<=y&&(p.y=Math.max(C,c.y+w),b.y=Math.min(y,h.y-x)):C>=y&&(p.y=Math.min(C,c.y-w),b.y=Math.max(y,h.y+x))}return[p.toJSON(),...i,b.toJSON()]};function xn(i,t){if(t!=null&&t!==!1){const e=typeof t=="boolean"?0:t;if(e>0){const n=A.create(i[1]).move(i[2],e),s=A.create(i[1]).move(i[0],e);return[n.toJSON(),...i,s.toJSON()]}{const n=i[1];return[Object.assign({},n),...i,Object.assign({},n)]}}return i}const rr=Object.freeze(Object.defineProperty({__proto__:null,er:hC,loop:(i,t,e)=>{const n=t.width||50,o=(t.height||80)/2,r=t.angle||"auto",a=e.sourceAnchor,l=e.targetAnchor,c=e.sourceBBox,h=e.targetBBox;if(a.equals(l)){const u=y=>{const C=Rt(y),w=Math.sin(C),x=Math.cos(C),E=new A(a.x+x*n,a.y+w*n),S=new A(E.x-x*o,E.y-w*o),v=S.clone().rotate(-90,E),M=S.clone().rotate(90,E);return[v.toJSON(),E.toJSON(),M.toJSON()]},d=y=>{const C=a.clone().move(y,-1),w=new z(C,y);return!c.containsPoint(y)&&!c.intersectsWithLine(w)},f=[0,90,180,270,45,135,225,315];if(typeof r=="number")return xn(u(r),t.merge);const m=c.getCenter();if(m.equals(a))return xn(u(0),t.merge);const p=m.angleBetween(a,m.clone().translate(1,0));let b=u(p);if(d(b[1]))return xn(b,t.merge);for(let y=1,C=f.length;y<C;y+=1)if(b=u(p+f[y]),d(b[1]))return xn(b,t.merge);return xn(b,t.merge)}{const u=new z(a,l);let d=u.parallel(-n),f=d.getCenter(),m=d.start.clone().move(d.end,o),p=d.end.clone().move(d.start,o);const b=u.parallel(-1),y=new z(b.start,f),C=new z(b.end,f);if((c.containsPoint(f)||h.containsPoint(f)||c.intersectsWithLine(y)||c.intersectsWithLine(C)||h.intersectsWithLine(y)||h.intersectsWithLine(C))&&(d=u.parallel(n),f=d.getCenter(),m=d.start.clone().move(d.end,o),p=d.end.clone().move(d.start,o)),t.merge){const w=new z(a,l),x=new z(f,w.center).setLength(Number.MAX_SAFE_INTEGER),E=c.intersectsWithLine(x),S=h.intersectsWithLine(x),v=E?Array.isArray(E)?E:[E]:[];S&&(Array.isArray(S)?v.push(...S):v.push(S));const M=w.center.closest(v);M?(e.sourceAnchor=M.clone(),e.targetAnchor=M.clone()):(e.sourceAnchor=w.center.clone(),e.targetAnchor=w.center.clone())}return xn([m.toJSON(),f.toJSON(),p.toJSON()],t.merge)}},manhattan:Kh,metro:cC,normal:Uw,oneSide:Kw,orth:Ph},Symbol.toStringTag,{value:"Module"})),bi=bt.create({type:"router"});bi.register(rr,!0);function uC(i){return i!=null&&!ks(i)}function ks(i){return i!=null&&typeof i=="string"}function dC(i){return i==null||ks(i)?i:ut(i)}function gC(i){return`${i}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function Jh(i,t={ns:vt.svg}){const e=document.createDocumentFragment(),n={},s={},o=[{markup:Array.isArray(i)?i:[i],parent:e,ns:t.ns}];for(;o.length>0;){const r=o.pop();let a=r.ns||vt.svg;const l=r.markup,c=r.parent;l.forEach(h=>{const u=h.tagName;if(!u)throw new TypeError("Invalid tagName");h.ns&&(a=h.ns);const d=a?Mo(u,a):tc(u),f=h.attrs;f&&W(d,Wn(f));const m=h.style;m&&nt(d,m);const p=h.className;p!=null&&d.setAttribute("class",Array.isArray(p)?p.join(" "):p),h.textContent&&(d.textContent=h.textContent);const b=h.selector;if(b!=null){if(s[b])throw new TypeError("Selector must be unique");s[b]=d}if(h.groupSelector){let C=h.groupSelector;Array.isArray(C)||(C=[C]),C.forEach(w=>{n[w]||(n[w]=[]),n[w].push(d)})}c.appendChild(d);const y=h.children;Array.isArray(y)&&o.push({ns:a,markup:y,parent:d})})}return Object.keys(n).forEach(r=>{if(s[r])throw new Error("Ambiguous group selector");s[r]=n[r]}),{fragment:e,selectors:s,groups:n}}function ar(i){return i instanceof SVGElement?ae("g"):tc("div")}function fC(i){if(ks(i)){const s=K.createVectors(i),o=s.length;if(o===1)return{elem:s[0].node};if(o>1){const r=ar(s[0].node);return s.forEach(a=>{r.appendChild(a.node)}),{elem:r}}return{}}const t=Jh(i),e=t.fragment;let n=null;return e.childNodes.length>1?(n=ar(e.firstChild),n.appendChild(e)):n=e.firstChild,{elem:n,selectors:t.selectors}}function pC(i){const t=K.createVectors(i),e=document.createDocumentFragment();for(let n=0,s=t.length;n<s;n+=1){const o=t[n].node;e.appendChild(o)}return{fragment:e,selectors:{}}}function jh(i,t,e){if(i!=null){let n;const s=i.tagName.toLowerCase();if(i===t)return typeof e=="string"?n=`> ${s} > ${e}`:n=`> ${s}`,n;const o=i.parentNode;if(o&&o.childNodes.length>1){const r=Bo(i)+1;n=`${s}:nth-child(${r})`}else n=s;return e&&(n+=` > ${e}`),jh(i.parentNode,t,n)}return e}function mC(){return"g"}function bC(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function yC(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}function wC(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}function CC(i=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:vt.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:vt.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:i?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}const Dt={isJSONMarkup:uC,isStringMarkup:ks,clone:dC,sanitize:gC,parseJSONMarkup:Jh,createContainer:ar,renderMarkup:fC,parseLabelStringMarkup:pC,getSelector:jh,getPortContainerMarkup:mC,getPortMarkup:bC,getPortLabelMarkup:yC,getEdgeMarkup:wC,getForeignObjectMarkup:CC};function DE(i,t){}function LE(i){}function Ye(i,t){return t?ae(i||"g"):Mo(i||"div")}function Gh(i,t,e){if(!i||i===".")return{elems:[t]};if(e){const n=e[i];if(n)return{elems:Array.isArray(n)?n:[n]}}{const n=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(t.querySelectorAll(n))}}}function AC(i){var t;let e=i;const n=i.originalEvent,s=(t=n==null?void 0:n.changedTouches)===null||t===void 0?void 0:t[0];if(s){for(const o in i)s[o]===void 0&&(s[o]=i[o]);e=s}return e}let Jt=class extends zt{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=iy("v"),this.cid}confirmUpdate(t,e){return 0}empty(t=this.container){return Hn(t),this}unmount(t=this.container){return _t(t),this}remove(t=this.container){return t===this.container?(this.removeEventListeners(document),this.onRemove(),this.cid,this.disposeContainer&&this.unmount(t)):this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return L(e,Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return at(e,Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return nt(e,t),this}setAttrs(t,e=this.container){return t!=null&&e!=null&&W(e,t),this}findAttr(t,e=this.container){let n=e;for(;n&&n.nodeType===1;){const s=n.getAttribute(t);if(s!=null)return s;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return Gh(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const s=this.find(t,e,n);return s.length>0?s[0]:null}findByAttr(t,e=this.container){let n=e;for(;n!=null&&n.getAttribute;){const s=n.getAttribute(t);if((s!=null||n===this.container)&&s!=="false")return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return typeof e=="string"&&(n=`> ${e}`),n;if(t){const s=Bo(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${s})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return et.prefix(t)}delegateEvents(t,e){if(t==null)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(s=>{const o=s.match(n);if(o==null)return;const r=this.getEventHandler(t[s]);typeof r=="function"&&this.delegateEvent(o[1],o[2],r)}),this}undelegateEvents(){return st.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return st.on(this.container,t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const s=t+this.getEventNamespace();return e==null?st.off(this.container,s):typeof e=="string"?st.off(this.container,s,e,n):st.off(this.container,s,e),this}addEventListeners(t,e,n){if(e==null)return this;const s=this.getEventNamespace();return Object.keys(e).forEach(o=>{const r=this.getEventHandler(e[o]);typeof r=="function"&&st.on(t,o+s,n,r)}),this}removeEventListeners(t){return t!=null&&st.off(t,this.getEventNamespace()),this}getEventNamespace(){return`.${et.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if(typeof t=="string"){const n=this[t];typeof n=="function"&&(e=(...s)=>n.call(this,...s))}else e=(...n)=>t.call(this,...n);return e}getEventTarget(t,e={}){const{target:n,type:s,clientX:o=0,clientY:r=0}=t;return e.fromPoint||s==="touchmove"||s==="touchend"?document.elementFromPoint(o,r):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return this.getEventData(t).propagationStopped===!0}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(t==null)throw new TypeError("Event object required");let n=t.data;const s=`__${this.cid}__`;return e==null?n==null?{}:n[s]||{}:(n==null&&(n=t.data={}),n[s]==null?n[s]=Object.assign({},e):n[s]=Object.assign(Object.assign({},n[s]),e),n[s])}normalizeEvent(t){return AC(t)}dispose(){this.remove()}};X([$()],Jt.prototype,"dispose",null);let Yh=0;function xC(i){return i?To(i):(Yh+=1,`CustomTool${Yh}`)}class dt extends Jt{static isToolItem(t){if(t==null)return!1;if(t instanceof dt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Hh)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"&&typeof n.isVisible=="function"}static define(t){const e=Qo(xC(t.name),dt);return e.config(t),e}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return pt(ut(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return Hh}constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=Ye(this.options.tagName||"g",this.options.isSVGElement!==!1),L(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&L(this.container,this.options.className),this.init()}init(){}getOptions(t){return this.constructor.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?L(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&L(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=Dt.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const t=this.options.focusOpacity;return t!=null&&Number.isFinite(t)&&(this.container.style.opacity=`${t}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(t,this.cellView)}}dt.toStringTag=`X6.${dt.name}`,dt.defaults={isSVGElement:!0,tagName:"g"};const Hh=`X6.${dt.name}`;class vC{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,s,o,r;const a=[];return Object.keys(e).forEach(l=>{const c=e[l],h=this.getDefinition(l),u=F(S3,this.view,h,c,{elem:t,attrs:e,cell:this.cell,view:this.view});if(h&&u)typeof h=="string"?(n==null&&(n={}),n[h]=c):c!==null&&a.push({name:l,definition:h});else{n==null&&(n={});const d=rc.includes(l)?l:oc(l);n[d]=c}}),a.forEach(({name:l,definition:c})=>{const h=e[l];typeof c.set=="function"&&(s==null&&(s={}),s[l]=h),typeof c.offset=="function"&&(o==null&&(o={}),o[l]=h),typeof c.position=="function"&&(r==null&&(r={}),r[l]=h)}),{raw:e,normal:n,set:s,offset:o,position:r}}mergeProcessedAttrs(t,e){var n;t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const s=(n=t.normal)===null||n===void 0?void 0:n.transform;s!=null&&e.normal&&(e.normal.transform=s),t.normal=e.normal}findAttrs(t,e,n,s){const o=[],r=new _o;return Object.keys(t).forEach(a=>{const l=t[a];if(!ne(l))return;const{isCSSSelector:c,elems:h}=Gh(a,e,s);n[a]=h;for(let u=0,d=h.length;u<d;u+=1){const f=h[u],m=s&&s[a]===f,p=r.get(f);if(p){p.array||(o.push(f),p.array=!0,p.attrs=[p.attrs],p.priority=[p.priority]);const b=p.attrs,y=p.priority;if(m)b.unshift(l),y.unshift(-1);else{const C=_b(y,c?-1:d);b.splice(C,0,l),y.splice(C,0,d)}}else r.set(f,{elem:f,attrs:l,priority:m?-1:d,array:!1})}}),o.forEach(a=>{const l=r.get(a),c=l.attrs;l.attrs=c.reduceRight((h,u)=>pt(h,u),{})}),r}updateRelativeAttrs(t,e,n){const s=e.raw||{};let o=e.normal||{};const r=e.set,a=e.position,l=e.offset,c=()=>({elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:n.clone()});if(r!=null&&Object.keys(r).forEach(b=>{const y=r[b],C=this.getDefinition(b);if(C!=null){const w=F(C.set,this.view,y,c());typeof w=="object"?o=Object.assign(Object.assign({},o),w):w!=null&&(o[b]=w)}}),t instanceof HTMLElement){this.view.setAttrs(o,t);return}const h=o.transform,u=h?`${h}`:null,d=Xn(u),f=new A(d.e,d.f);h&&(delete o.transform,d.e=0,d.f=0);let m=!1;a!=null&&Object.keys(a).forEach(b=>{const y=a[b],C=this.getDefinition(b);if(C!=null){const w=F(C.position,this.view,y,c());w!=null&&(m=!0,f.translate(A.create(w)))}}),this.view.setAttrs(o,t);let p=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(t);if(b.width>0&&b.height>0){const y=qt(b,d);Object.keys(l).forEach(C=>{const w=l[C],x=this.getDefinition(C);if(x!=null){const E=F(x.offset,this.view,w,{elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:y});E!=null&&(p=!0,f.translate(A.create(E)))}})}}(h!=null||m||p)&&(f.round(1),d.e=f.x,d.f=f.y,t.setAttribute("transform",$n(d)))}update(t,e,n){const s={},o=this.findAttrs(n.attrs||e,t,s,n.selectors),r=n.attrs?this.findAttrs(e,t,s,n.selectors):o,a=[];o.each(h=>{const u=h.elem,d=h.attrs,f=this.processAttrs(u,d);if(f.set==null&&f.position==null&&f.offset==null)this.view.setAttrs(f.normal,u);else{const m=r.get(u),p=m?m.attrs:null,b=p&&d.ref==null?p.ref:d.ref;let y;if(b){if(y=(s[b]||this.view.find(b,t,n.selectors))[0],!y)throw new Error(`"${b}" reference does not exist.`)}else y=null;const C={node:u,refNode:y,attributes:p,processedAttributes:f},w=a.findIndex(x=>x.refNode===u);w>-1?a.splice(w,0,C):a.push(C)}});const l=new _o;let c;a.forEach(h=>{const u=h.node,d=h.refNode;let f;const m=d!=null&&n.rotatableNode!=null&&ko(n.rotatableNode,d);if(d&&(f=l.get(d)),!f){const y=m?n.rotatableNode:t;f=d?de(d,{target:y}):n.rootBBox,d&&l.set(d,f)}let p;n.attrs&&h.attributes?(p=this.processAttrs(u,h.attributes),this.mergeProcessedAttrs(p,h.processedAttributes)):p=h.processedAttributes;let b=f;m&&n.rotatableNode!=null&&!n.rotatableNode.contains(u)&&(c||(c=Xn(W(n.rotatableNode,"transform"))),b=qt(f,c)),this.updateRelativeAttrs(u,p,b)})}}class EC{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new _o,this.pathCache={}}get(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(e.matrix==null){const n=this.view.container;e.matrix=w6(t,n)}return Et(e.matrix)}getShape(t){const e=this.get(t);return e.shape==null&&(e.shape=zc(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return e.boundingRect==null&&(e.boundingRect=V6(t)),e.boundingRect.clone()}}class SC{get cell(){return this.view.cell}constructor(t,e,n=[]){this.view=t;const s={},o={};let r=0;Object.keys(e).forEach(l=>{let c=e[l];Array.isArray(c)||(c=[c]),c.forEach(h=>{let u=s[h];u||(r+=1,u=s[h]=1<<r),o[l]|=u})});let a=n;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{s[l]||(r+=1,s[l]=1<<r)}),r>25)throw new Error("Maximum number of flags exceeded.");this.flags=s,this.attrs=o,this.bootstrap=n}getFlag(t){const e=this.flags;return e==null?0:Array.isArray(t)?t.reduce((n,s)=>n|e[s],0):e[t]|0}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs&&Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t}}class Mt extends Jt{static getDefaults(){return Mt.defaults}static isCellView(t){if(t==null)return!1;if(t instanceof Mt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===_h)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"}static config(t){Mt.defaults=Mt.getOptions(t)}static getOptions(t){const e=(c,h)=>h!=null?Nl([...Array.isArray(c)?c:[c],...Array.isArray(h)?h:[h]]):Array.isArray(c)?[...c]:[c],n=ut(Mt.getDefaults()),{bootstrap:s,actions:o,events:r,documentEvents:a}=t,l=_(t,["bootstrap","actions","events","documentEvents"]);return s&&(n.bootstrap=e(n.bootstrap,s)),o&&Object.entries(o).forEach(([c,h])=>{const u=n.actions[c];h&&u?n.actions[c]=e(u,h):h&&(n.actions[c]=e(h))}),r&&(n.events=Object.assign(Object.assign({},n.events),r)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),a)),pt(n,l)}get[Symbol.toStringTag](){return _h}constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new vC(this),this.flag=new SC(this,this.options.actions,this.options.bootstrap),this.cache=new EC(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return Ye(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,this.options.events!=null&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();e!=null&&this.setAttrs(e,t);const n=this.getContainerStyle();n!=null&&this.setStyle(n,t);const s=this.getContainerClassName();s!=null&&this.addClass(s,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,s){if(this.hasAction(t,e)){n();const o=[e];return s&&(typeof s=="string"?o.push(s):o.push(...s)),this.removeAction(t,o)}return t}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:t}){this.onAttrsChange(t)}onAttrsChange(t){let e=this.flag.getChangedFlag();t.updated||!e||(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,e,t))}parseJSONMarkup(t,e){const n=Dt.parseJSONMarkup(t),s=n.selectors,o=this.rootSelector;if(e&&o){if(s[o])throw new Error("Invalid root selector");s[o]=e}return n}can(t){let e=this.graph.options.interacting;if(typeof e=="function"&&(e=F(e,this.graph,this)),typeof e=="object"){let n=e[t];return typeof n=="function"&&(n=F(n,this.graph,this)),n!==!1}return typeof e=="boolean"?e:!1}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),s=this.getRootRotatedMatrix(),o=this.getRootTranslatedMatrix();return qt(e,o.multiply(s).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),s=this.getRootTranslatedMatrix();return qt(e,s.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const n=this.cell,s=n.isNode()?n.getAngle():0;e=n.getBBox().bbox(s)}else e=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return Et().translate(e.x,e.y)}getRootRotatedMatrix(){let t=Et();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const s=e.getBBox(),o=s.width/2,r=s.height/2;t=t.translate(o,r).rotate(n).translate(-o,-r)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){n.rootBBox==null&&(n.rootBBox=new I),n.selectors==null&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(t==null||t===this.container)}prepareHighlight(t,e={}){const n=t||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,s,o){const r=this.cell,a=this.findAttr("port",t),l=t.getAttribute("data-selector"),c={cell:r.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,r.isNode()&&!r.hasPort(a)&&l==null&&(c.selector=this.getSelector(t))):l==null&&this.container!==t&&(c.selector=this.getSelector(t)),c}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,s=t.port;let o=t.magnet,r;return s!=null&&e.isNode()&&e.hasPort(s)?r=this.findPortElem(s,o)||n:(o||(o=t.selector),!o&&s!=null&&(o=`[port="${s}"]`),r=this.findOne(o,n,this.selectors)),r}hasTools(t){const e=this.tools;return e==null?!1:t==null?!0:e.name===t}addTools(t){if(this.removeTools(),t){if(!this.can("toolsAddable"))return this;const e=He.isToolsView(t)?t:new He(t);this.tools=e,e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const s=this,o=s.cell;return e==null||n==null?{e:t,view:s,cell:o}:{e:t,x:e,y:n,view:s,cell:o}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){this.notify("cell:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,s){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),this.notify(e,Object.assign({},this.getEventArgs(t,n,s)))}onMagnetMouseDown(t,e,n,s){}onMagnetDblClick(t,e,n,s){}onMagnetContextMenu(t,e,n,s){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.getEventTarget(t,{fromPoint:!0}),n=this.graph.findViewByElem(e);n!==this&&(this.onMouseLeave(t),n&&n.onMouseEnter(t))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}Mt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},Mt.registry=bt.create({type:"view"}),X([$()],Mt.prototype,"dispose",null);const _h=`X6.${Mt.name}`;class He extends Jt{static isToolsView(t){if(t==null)return!1;if(t instanceof He)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Wh)&&n.graph!=null&&n.cell!=null&&typeof n.config=="function"&&typeof n.update=="function"&&typeof n.focus=="function"&&typeof n.blur=="function"&&typeof n.show=="function"&&typeof n.hide=="function"}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Wh}constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}createContainer(t,e){const n=t?Ye("g",!0):Ye("div",!1);return L(n,this.prefixClassName("cell-tools")),e.className&&L(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!Mt.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(L(this.svgContainer,this.prefixClassName("edge-tools")),L(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(L(this.svgContainer,this.prefixClassName("node-tools")),L(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach(s=>{dt.isToolItem(s)?s.name==="vertices"?n.unshift(s):n.push(s):(typeof s=="object"?s.name:s)==="vertices"?n.unshift(s):n.push(s)});for(let s=0;s<n.length;s+=1){const o=n[s];let r;if(dt.isToolItem(o))r=o;else{const a=typeof o=="object"?o.name:o,l=typeof o=="object"?o.args||{}:{};if(a){if(this.cell.isNode()){const c=xi.get(a);if(c)r=new c(l);else return xi.onNotFound(a)}else if(this.cell.isEdge()){const c=vi.get(a);if(c)r=new c(l);else return vi.onNotFound(a)}}}r&&(r.config(this.cellView,this),r.render(),(r.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(r.container),this.tools.push(r))}return this}update(t={}){const e=this.tools;return e&&e.forEach(n=>{t.toolId!==n.cid&&n.isVisible()&&n.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(n=>{t===n?n.show():n.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(n=>{n!==t&&!n.isVisible()&&(n.show(),n.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(e=>e.remove()),this.tools=null),_t(this.svgContainer),_t(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some(o=>o.options.isSVGElement!==!1),s=t.some(o=>o.options.isSVGElement===!1);n&&(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer),s&&this.graph.container.appendChild(this.htmlContainer)}return this}}He.toStringTag=`X6.${He.name}`;const Wh=`X6.${He.name}`,MC=i=>i;function qh(i,t){return t===0?"0%":`${Math.round(i/t*100)}%`}function Xh(i){return(e,n,s,o)=>n.isEdgeElement(s)?kC(i,e,n,s,o):BC(i,e,n,s,o)}function BC(i,t,e,n,s){const o=e.cell,r=o.getAngle(),a=e.getUnrotatedBBoxOfElement(n),l=o.getBBox().getCenter(),c=A.create(s).rotate(r,l);let h=c.x-a.x,u=c.y-a.y;return i&&(h=qh(h,a.width),u=qh(u,a.height)),t.anchor={name:"topLeft",args:{dx:h,dy:u,rotate:!0}},t}function kC(i,t,e,n,s){const o=e.getConnection();if(!o)return t;const r=o.closestPointLength(s);if(i){const a=o.length();t.anchor={name:"ratio",args:{ratio:r/a}}}else t.anchor={name:"length",args:{length:r}};return t}const TC=Xh(!0),IC=Xh(!1),$h=Object.freeze(Object.defineProperty({__proto__:null,noop:MC,pinAbsolute:IC,pinRelative:TC},Symbol.toStringTag,{value:"Module"}));bt.create({type:"connection strategy"}).register($h,!0);function Zh(i,t,e,n){return F($h.pinRelative,this.graph,{},t,e,i,this.cell,n,{}).anchor}function tu(i,t){return t?i.cell.getBBox():i.cell.isEdge()?i.getConnection().bbox():i.getUnrotatedBBoxOfElement(i.container)}class yi extends dt{get type(){return this.options.type}onRender(){L(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,s=this.cellView,o=this.options,r=s.getTerminalAnchor(n),a=s.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${r.x}, ${r.y})`);const l=a?o.customAnchorAttrs:o.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{e.setAttribute(c,l[c])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,s=this.cellView,o=s.getTerminalView(n);if(o){const r=o.cell,a=s.getTerminalMagnet(n);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,h,u;o.isEdgeElement(a)?(c=o.getBBox(),h=0,u=c.getCenter()):(c=o.getUnrotatedBBoxOfElement(a),h=r.getAngle(),u=c.getCenter(),h&&u.rotate(-h,r.getBBox().getCenter())),c.inflate(l),W(e,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${u.x}, ${u.y}) rotate(${h})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,n=this.cellView,s=n.getTerminalView(e);if(s==null)return;const o=this.normalizeEvent(t),r=s.cell,a=n.getTerminalMagnet(e);let l=this.graph.coord.clientToLocalPoint(o.clientX,o.clientY);const c=this.options.snap;if(typeof c=="function"){const d=F(c,n,l,s,a,e,n,this);l=A.create(d)}if(this.options.restrictArea)if(s.isEdgeElement(a)){const d=s.getClosestPoint(l);d&&(l=d)}else{const d=s.getUnrotatedBBoxOfElement(a),f=r.getAngle(),m=r.getBBox().getCenter(),p=l.clone().rotate(f,m);d.containsPoint(p)||(l=d.getNearestPointToPoint(p).rotate(-f,m))}let h;const u=this.options.anchor;typeof u=="function"&&(h=F(u,n,l,s,a,e,n,this)),this.resetAnchor(h),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(t===!0?void 0:t),this.update()}}yi.defaults=Object.assign(Object.assign({},dt.getDefaults()),{tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:Zh,snap(i,t,e,n,s,o){const r=o.options.snapRadius||0,a=n==="source",l=a?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return c&&(Math.abs(c.x-i.x)<r&&(i.x=c.x),Math.abs(c.y-i.y)<r&&(i.y=c.y)),i}});class eu extends yi{}eu.defaults=Object.assign(Object.assign({},yi.getDefaults()),{name:"source-anchor",type:"source"});class nu extends yi{}nu.defaults=Object.assign(Object.assign({},yi.getDefaults()),{name:"target-anchor",type:"target"});class wi extends dt{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=_(t,["class"]);this.setAttrs(n,this.container),e&&L(this.container,e)}}onRender(){L(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),s=n?n.start:e.getPointAtRatio(t),o=n&&n.vector().vectorAngle(new A(1,0))||0;if(!s)return this;const r=Et().translate(s.x,s.y).rotate(o);return pn(this.container,r,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),s=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(t,s),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,s=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,s.x,s.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}wi.defaults=Object.assign(Object.assign({},dt.getDefaults()),{tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}});class iu extends wi{}iu.defaults=Object.assign(Object.assign({},wi.getDefaults()),{name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class su extends wi{}su.defaults=Object.assign(Object.assign({},wi.getDefaults()),{name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class lr extends dt{onRender(){if(L(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=_(t,["class"]);W(this.container,Wn(n)),e&&L(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:s}=e,o=se(e.padding);let r=tu(t,n);this.parent.options.local&&(r=r.translate({x:-r.x,y:-r.y})),r=r.moveAndExpand({x:-o.left,y:-o.top,width:o.left+o.right,height:o.top+o.bottom});const a=t.cell;if(a.isNode()){const l=a.getAngle();if(l!=null)if(s&&!this.parent.options.local){const c=a.getBBox().getCenter();Uo(this.container,l,c.x,c.y,{absolute:!0})}else s||(r=r.bbox(l))}return W(this.container,r.toJSON()),this}}lr.defaults=Object.assign(Object.assign({},dt.getDefaults()),{name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}});class Ci extends dt{onRender(){L(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();pn(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:s=0}=e;const{offset:o,useCellGeometry:r,rotate:a}=e;let l=tu(t,r);const c=t.cell.getAngle();a||(l=l.bbox(c));let h=0,u=0;typeof o=="number"?(h=o,u=o):typeof o=="object"&&(h=o.x,u=o.y),n=jt(n,l.width),s=jt(s,l.height);let d=Et();return this.parent.options.local?d=d.translate(l.width/2,l.height/2):d=d.translate(l.x+l.width/2,l.y+l.height/2),a&&(d=d.rotate(c)),d=d.translate(n+h-l.width/2,s+u-l.height/2),d}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:s=0,rotate:o}=e,r=jt(s,1),a=r>=0&&r<=1?t.getTangentAtRatio(r):t.getTangentAtLength(r),l=a?a.start:t.getConnection().start,c=a&&a.vector().vectorAngle(new A(1,0))||0;let h=Et().translate(l.x,l.y).rotate(c);return typeof n=="object"?h=h.translate(n.x||0,n.y||0):h=h.translate(0,n),o||(h=h.rotate(-c)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;typeof e=="function"&&F(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}Ci.defaults=Object.assign(Object.assign({},dt.getDefaults()),{name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}});class cr extends Ci{}cr.defaults=Object.assign(Object.assign({},Ci.getDefaults()),{name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:i,btn:t}){t.parent.remove(),i.cell.remove({ui:!0,toolId:t.cid})}});class Ai extends dt{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const t=this.cellView;t&&t.on("cell:dblclick",this.dblClick)}createElement(){const t=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Ye("div",!1),this.addClass(t,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:t,editor:e}=this;if(!e)return;const{style:n}=e;t.isNode()?this.updateNodeEditorTransform():t.isEdge()&&this.updateEdgeEditorTransform();const{attrs:s}=this.options;n.fontSize=`${s.fontSize}px`,n.fontFamily=s.fontFamily,n.color=s.color,n.backgroundColor=s.backgroundColor;const o=this.getCellText()||"";return e.innerText=o,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:t,cell:e,editor:n}=this;if(!n)return;let s=A.create(),o=20,r="",{x:a,y:l}=this.options;const{width:c,height:h}=this.options;if(typeof a<"u"&&typeof l<"u"){const f=e.getBBox();a=jt(a,f.width),l=jt(l,f.height),s=f.topLeft.translate(a,l),o=f.width-a*2}else{const f=e.getBBox();s=f.center,o=f.width-4,r="translate(-50%, -50%)"}const u=t.scale(),{style:d}=n;s=t.localToGraph(s),d.left=`${s.x}px`,d.top=`${s.y}px`,d.transform=`scale(${u.sx}, ${u.sy}) ${r}`,d.minWidth=`${o}px`,typeof c=="number"&&(d.width=`${c}px`),typeof h=="number"&&(d.height=`${h}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:t,editor:e}=this;if(!e)return;let n=A.create(),s=20;const{style:o}=e,r=this.event.target,a=r.parentElement;if(a&&ue(a,this.prefixClassName("edge-label"))){const h=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);const u=a.getAttribute("transform"),{translation:d}=ls(u);n=new A(d.tx,d.ty),s=de(r).width}else{if(!this.options.labelAddable)return this;n=t.clientToLocal(A.create(this.event.clientX,this.event.clientY));const u=this.cellView.path.closestPointLength(n);this.distance=u,this.labelIndex=-1}n=t.localToGraph(n);const c=t.scale();o.left=`${n.x}px`,o.top=`${n.y}px`,o.minWidth=`${s}px`,o.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}updateCell(){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}onDocumentMouseUp(t){this.editor&&t.target!==this.editor&&this.updateCell()}onCellDblClick({e:t}){this.editor||(t.stopPropagation(),this.removeElement(),this.event=t,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}getCellText(){const{getText:t}=this.options;if(typeof t=="function")return F(t,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof t=="string"){if(this.cell.isNode())return this.cell.attr(t);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${t}`)}}setCellText(t){const e=this.options.setText;if(typeof e=="function"){F(e,this.cellView,{cell:this.cell,value:t,index:this.labelIndex,distance:this.distance});return}if(typeof e=="string"){if(this.cell.isNode()){t!==null&&this.cell.attr(e,t);return}if(this.cell.isEdge()){const n=this.cell;if(this.labelIndex===-1){if(t){const s={position:{distance:this.distance},attrs:{}};fn(s,`attrs/${e}`,t),n.appendLabel(s)}}else t!==null?n.prop(`labels/${this.labelIndex}/attrs/${e}`,t):typeof this.labelIndex=="number"&&n.removeLabelAt(this.labelIndex)}}}onRemove(){const t=this.cellView;t&&t.off("cell:dblclick",this.dblClick),this.removeElement()}}Ai.defaults=Object.assign(Object.assign({},dt.getDefaults()),{tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}});class ou extends Ai{}ou.defaults=pt({},Ai.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"});class ru extends Ai{}ru.defaults=pt({},Ai.defaults,{attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"});class hr extends dt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}getPoints(){const e=this.cellView.routePoints;if(e.length<=2)return e;const n=[e[0]];for(let s=1;s<e.length-1;s++){const o=n[n.length-1],r=e[s],a=e[s+1];(r.x-o.x)*(a.y-o.y)-(r.y-o.y)*(a.x-o.x)!==0&&n.push(r)}return n.push(e[e.length-1]),n}onRender(){L(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.getPoints()];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,s=e.length;n<s-1;n+=1){const o=e[n],r=e[n+1],a=this.renderHandle(o,r,n);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(t,e,n){const s=this.options.createHandle({index:n,graph:this.graph,guard:o=>this.guard(o),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(s),this.updateHandle(s,t,e),this.container.appendChild(s.container),this.startHandleListening(s),s}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let n=0,s=e.length;n<s;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,s={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,s):n.removeProp([t,"anchor"],s)}snapHandle(t,e,n){const s=t.options.axis,o=t.options.index,l=this.cellView.cell.getVertices(),c=l[o-2]||n.sourceAnchor,h=l[o+1]||n.targetAnchor,u=this.options.snapRadius;return Math.abs(e[s]-c[s])<u?e[s]=c[s]:Math.abs(e[s]-h[s])<u&&(e[s]=h[s]),e}onHandleChanging({handle:t,e}){const n=this.graph,s=this.options,o=this.cellView,r=s.anchor,a=t.options.axis,l=t.options.index-1,c=this.getEventData(e),h=this.normalizeEvent(e),u=n.snapToGrid(h.clientX,h.clientY),d=this.snapHandle(t,u.clone(),c),f=ut(this.vertices);let m=f[l],p=f[l+1];const b=o.sourceView,y=o.sourceBBox;let C=!1,w=!1;if(m?l===0?y.containsPoint(m)?(f.shift(),this.shiftHandleIndexes(-1),C=!0):(m[a]=d[a],w=!0):m[a]=d[a]:(m=o.sourceAnchor.toJSON(),m[a]=d[a],y.containsPoint(m)?C=!0:(f.unshift(m),this.shiftHandleIndexes(1),w=!0)),typeof r=="function"&&b){if(C){const M=c.sourceAnchor.clone();M[a]=d[a];const k=F(r,o,M,b,o.sourceMagnet||b.container,"source",o,this);this.resetAnchor("source",k)}w&&this.resetAnchor("source",c.sourceAnchorDef)}const x=o.targetView,E=o.targetBBox;let S=!1,v=!1;if(p?l===f.length-2?E.containsPoint(p)?(f.pop(),S=!0):(p[a]=d[a],v=!0):p[a]=d[a]:(p=o.targetAnchor.toJSON(),p[a]=d[a],E.containsPoint(p)?S=!0:(f.push(p),v=!0)),typeof r=="function"&&x){if(S){const M=c.targetAnchor.clone();M[a]=d[a];const k=F(r,o,M,x,o.targetMagnet||x.container,"target",o,this);this.resetAnchor("target",k)}v&&this.resetAnchor("target",c.targetAnchorDef)}A.equalPoints(f,this.vertices)||this.cellView.cell.setVertices(f,{ui:!0,toolId:this.cid}),this.updateHandle(t,m,p,0),s.stopPropagation||o.notifyMouseMove(h,u.x,u.y)}onHandleChange({handle:t,e}){const n=this.options,s=this.handles,o=this.cellView,r=t.options.index;if(Array.isArray(s)){for(let a=0,l=s.length;a<l;a+=1)a!==r&&s[a].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:o.sourceAnchor.clone(),targetAnchor:o.targetAnchor.clone(),sourceAnchorDef:ut(this.cell.prop(["source","anchor"])),targetAnchorDef:ut(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const a=this.normalizeEvent(e),l=this.graph.snapToGrid(a.clientX,a.clientY);o.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(s,o.x,o.y),n.checkMouseleave(s),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,s=0){const o=this.options.precision||0,r=Math.abs(e.x-n.x)<o,a=Math.abs(e.y-n.y)<o;if(r||a){const l=new z(e,n);if(l.length()<this.options.threshold)t.hide();else{const h=l.getCenter(),u=r?"x":"y";h[u]+=s||0;const d=l.vector().vectorAngle(new A(1,0));t.updatePosition(h.x,h.y,d,this.cellView),t.show(),t.options.axis=u}}else t.hide()}onRemove(){this.resetHandles()}}hr.defaults=Object.assign(Object.assign({},dt.defaults),{name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:i=>new PC(i),anchor:Zh});let PC=class extends Jt{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Ye("rect",!0);const t=this.options.attrs;if(typeof t=="function"){const e=hr.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,s){const o=s.getClosestPoint(new A(t,e))||new A(t,e);let r=Et().translate(o.x,o.y);if(o.equals({x:t,y:e}))r=r.rotate(n);else{let l=new z(t,e,o.x,o.y).vector().vectorAngle(new A(1,0));l!==0&&(l+=90),r=r.rotate(l)}this.setAttrs({transform:$n(r),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}};const ur=et.prefix("edge-tool-vertex-path");class dr extends dt{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=this.options.createHandle,r=this.options.processHandle,a=o({index:e,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});r&&r(a),a.updatePosition(s.x,s.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const s=t[e],o=this.handles[e];o&&o.updatePosition(s.x,s.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,s=t>0?n[t-1]:e.sourceAnchor,o=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:A.create(s),next:A.create(o)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:s}=this.graph.snapToGrid(e.clientX,e.clientY);return{e,x:n,y:s}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:s,y:o}=this.getMouseEventArgs(t);this.eventData(n,{start:{x:s,y:o}}),e.notifyMouseDown(n,s,o)}}onHandleChanging({handle:t,e}){const n=this.cellView,s=t.options.index,{e:o,x:r,y:a}=this.getMouseEventArgs(e),l={x:r,y:a};this.snapVertex(l,s),n.cell.setVertexAt(s,l,{ui:!0,toolId:this.cid}),t.updatePosition(l.x,l.y),this.options.stopPropagation||n.notifyMouseMove(o,r,a)}stopBatch(t){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),t&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies){this.stopBatch(this.eventData(t).vertexAdded);return}n.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(t).vertexAdded);const{e:o,x:r,y:a}=this.getMouseEventArgs(t);if(!this.options.stopPropagation){n.notifyMouseUp(o,r,a);const{start:l}=this.eventData(o);if(l){const{x:c,y:h}=l;c===r&&h===a&&n.onClick(o,r,a)}}n.checkMouseleave(o),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const s=this.getNeighborPoints(e),o=s.prev,r=s.next;Math.abs(t.x-o.x)<n?t.x=o.x:Math.abs(t.x-r.x)<n&&(t.x=r.x),Math.abs(t.y-o.y)<n?t.y=s.prev.y:Math.abs(t.y-r.y)<n&&(t.y=r.y)}}onHandleRemove({handle:t,e}){if(this.options.removable){const n=t.options.index,s=this.cellView;s.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),s.checkMouseleave(this.normalizeEvent(e))}}allowAddVertex(t){const e=this.guard(t),n=this.options.addable&&this.cellView.can("vertexAddable"),s=this.options.modifiers?Pe(t,this.options.modifiers):!0;return!e&&n&&s}onPathMouseDown(t){const e=this.cellView;if(!this.allowAddVertex(t))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),s=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const o=e.getVertexIndex(s.x,s.y);this.snapVertex(s,o),e.cell.insertVertex(s,o,{ui:!0,toolId:this.cid}),this.render();const r=this.handles[o];this.eventData(n,{vertexAdded:!0}),r.onMouseDown(n)}onRemove(){this.resetHandles()}}dr.defaults=Object.assign(Object.assign({},dt.getDefaults()),{name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:i=>new OC(i),markup:[{tagName:"path",selector:"connection",className:ur,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${ur}`]:"onPathMouseDown",[`touchstart .${ur}`]:"onPathMouseDown"}});class OC extends Jt{get graph(){return this.options.graph}constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=Ye("circle",!0);const t=this.options.attrs;if(typeof t=="function"){const e=dr.getDefaults();this.setAttrs(Object.assign(Object.assign({},e.attrs),t(this)))}else this.setAttrs(t);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}const NC={boundary:lr,button:Ci,"button-remove":cr,"node-editor":ou},xi=bt.create({type:"node tool",process(i,t){if(typeof t=="function")return t;let e=dt;const{inherit:n}=t,s=_(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return s.name==null&&(s.name=i),e.define.call(e,s)}});xi.register(NC,!0);const RC={boundary:lr,vertices:dr,segments:hr,button:Ci,"button-remove":cr,"source-anchor":eu,"target-anchor":nu,"source-arrowhead":iu,"target-arrowhead":su,"edge-editor":ru},vi=bt.create({type:"edge tool",process(i,t){if(typeof t=="function")return t;let e=dt;const{inherit:n}=t,s=_(t,["inherit"]);if(n){const o=this.get(n);o==null?this.onNotFound(n,"inherited"):e=o}return s.name==null&&(s.name=i),e.define.call(e,s)}});vi.register(RC,!0);class au{constructor(t,e,n,s){var o;this.target=t,this.cell=(o=this.target.effect)===null||o===void 0?void 0:o.target,this.type=e,this.bubbles=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=0,this.timeStamp=performance.now(),this.currentTime=n,this.timelineTime=s}}function Ts(i){return i!=="offset"&&i!=="easing"&&i!=="composite"&&i!=="computedOffset"}function lu(i,t){return i==="reverse"||i==="alternate"&&t%2===1||i==="alternate-reverse"&&t%2===0}class DC{constructor(t,e){this._effect=null,this._currentTime=null,this._playbackRate=1,this._playState="idle",this._rafId=null,this._startTime=null,this._pausedTime=null,this._timeline=null,this.id="",this.onfinish=null,this.oncancel=null,this._effect=t,this._timeline=e??document.timeline}get effect(){return this._effect}get currentTime(){return this._currentTime}set currentTime(t){const e=this._timeline.currentTime;we(e)&&(this._startTime=e-t,this._currentTime=t)}get playbackRate(){return this._playbackRate}set playbackRate(t){const e=this._playbackRate;this._playbackRate=t;const n=this._timeline.currentTime;if(this._playState==="running"&&this._startTime!=null&&we(n)){const s=(n-this._startTime)*e;this._startTime=n-s/t}}get playState(){return this._playState}get timeline(){return this._timeline}play(){if(this._playState==="running"||!this._effect)return;const t=this._timeline.currentTime;we(t)&&(this._playState==="paused"?(this._startTime=t-this._pausedTime/this._playbackRate,this._pausedTime=null):(this._currentTime=0,this._startTime=t),this._playState="running",this._tick())}pause(){this._playState==="running"&&(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._pausedTime=this._currentTime,this._playState="paused")}finish(){var t;if(!this._effect)return;const e=this._effect.getComputedTiming(),n=this._playbackRate<0,{duration:s,endTime:o,direction:r,fill:a,iterations:l}=e;if(a==="forwards"||a==="both"){const h=n?0:l-1,u=lu(r,h);this._effect.apply(u||n?0:s)}else(a==="none"||a==="backwards")&&this._effect.apply(null);this._currentTime=n?0:o,this._playState="finished",this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null);const c=new au(this,"finish",this._currentTime,this._timeline.currentTime);(t=this.onfinish)===null||t===void 0||t.call(this,c),this._effect.target.notify("animation:finish",c)}cancel(){var t;if(!this._effect)return;this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._playState="idle",this._currentTime=null,this._startTime=null,this._pausedTime=null,this._effect.apply(null);const e=new au(this,"cancel",this._currentTime,this._timeline.currentTime);(t=this.oncancel)===null||t===void 0||t.call(this,e),this._effect.target.notify("animation:cancel",e)}updatePlaybackRate(t){this.playbackRate=t}reverse(){this.playbackRate=this.playbackRate*-1}_tick(){const t=this._timeline.currentTime;if(this._playState!=="running"||!this._effect||!we(t))return;const e=this._effect.getComputedTiming(),{duration:n,delay:s,iterations:o,direction:r,endTime:a}=e,l=(t-this._startTime)*this._playbackRate,c=l-s;let h=Math.floor(c/n);if(l>=a||l<0||n<=0){this.finish();return}if(l>=s){let u=c%n;h=Math.min(h,o-1),lu(r,h)&&(u=n-u),this._effect.apply(u)}this._currentTime=l,this._rafId=requestAnimationFrame(()=>this._tick())}}class LC{constructor(){this.animations=[]}addAnimation(t){this.animations.push(t)}getAnimations(){return this.animations}cancelAnimations(){this.animations.forEach(t=>{t.cancel()})}}class QC{constructor(t,e,n){this._originProps={},this._target=t,this._options=we(n)?{duration:n}:Object.assign({},n),this.setKeyframes(e)}get target(){return this._target}getKeyframes(){if(!this._keyframes||this._keyframes.length===0)return[];let t=[];if(Array.isArray(this._keyframes)&&(t=[...this._keyframes]),ne(this._keyframes)){const n=Object.values(this._keyframes).map(o=>ja(o).length),s=Math.max(...n);for(let o=0;o<s;o++){const r={};Object.entries(this._keyframes).forEach(([a,l])=>{const c=ja(l)[o];Ts(a)&&c!=null&&(r[a]=c)}),t.push(r)}}return t=t.map((e,n,s)=>{var o,r,a;const l=e??{},c={};return c.offset=l.offset,c.easing=(a=(o=l.easing)!==null&&o!==void 0?o:(r=s[n-1])===null||r===void 0?void 0:r.easing)!==null&&a!==void 0?a:this.getComputedTiming().easing,Object.keys(l).forEach(h=>{Ts(h)&&(c[h]=l[h])}),c}),t=t.map((e,n)=>(e.offset==null?n===t.length-1?e.computedOffset=1:n===0?e.computedOffset=0:e.computedOffset=n/(t.length-1):e.computedOffset=e.offset,e)),t}setKeyframes(t){this._keyframes=t,this._computedKeyframes=this.getKeyframes(),this._computedKeyframes.forEach(e=>{Object.keys(e).forEach(n=>{Ts(n)&&this._originProps[n]==null&&(this._originProps[n]=this.target.getPropByPath(n))})})}getTiming(){return db(this._options,VC)}getComputedTiming(){const t=this.getTiming(),e=t.duration*t.iterations;return Object.assign(Object.assign({},t),{activeDuration:e,endTime:e+t.delay})}apply(t){var e,n,s,o;if(!this._target||!this._computedKeyframes.length)return;if(t==null){Object.entries(this._originProps).forEach(([C,w])=>{this.target.setPropByPath(C,w)});return}const a=this.getComputedTiming().duration;if(a<0)return;const l=Math.min(t/a,1),c=this._computedKeyframes;if(c.length===0)return;let h={computedOffset:0},u={computedOffset:1};for(const C of c)if(l===0&&C.computedOffset===0&&(h=C),l===1&&C.computedOffset===1&&(u=C),C.computedOffset<l&&(h=C),C.computedOffset>l){u=C;break}const d=h.computedOffset,f=u.computedOffset,m=(l-d)/(f-d),p=(e=h.easing)!==null&&e!==void 0?e:u.easing,b=Jn(p),y=(n=E2[b])!==null&&n!==void 0?n:Kc;for(const C in Object.assign(Object.assign({},h),u))if(Ts(C)&&(h[C]!=null||u[C]!=null)){const w=(s=h[C])!==null&&s!==void 0?s:this._originProps[C],x=(o=u[C])!==null&&o!==void 0?o:this._originProps[C];let E;String(w).startsWith("#")?E=K6:C.endsWith("transform")&&!we(w)?E=J6:ei.test(String(w))||ei.test(String(x))?E=Uc:E=Fc;const v=E(w,x)(y(m));this.target.setPropByPath(C,v)}}}const VC={delay:0,direction:"normal",duration:0,easing:"linear",fill:"none",iterations:1};class cu extends zt{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ut(t)),this.changed={}}mutate(t,e={}){const n=e.unset===!0,s=e.silent===!0,o=[],r=this.changing;this.changing=!0,r||(this.previous=ut(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(t).forEach(h=>{const u=h,d=t[u];ye(a[u],d)||o.push(u),ye(l[u],d)?delete c[u]:c[u]=d,n?delete a[u]:a[u]=d}),!s&&o.length>0&&(this.pending=!0,this.pendingOptions=e,o.forEach(h=>{this.emit("change:*",{key:h,options:e,store:this,current:a[h],previous:l[h]})})),r)return this;if(!s)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(t==null)return this.data;const n=this.data[t];return n??e}getPrevious(t){if(this.previous){const e=this.previous[t];return e??void 0}}set(t,e,n){return t!=null&&(typeof t=="object"?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const s={};let o;if(typeof t=="string")s[t]=void 0,o=e;else if(Array.isArray(t))t.forEach(r=>s[r]=void 0),o=e;else{for(const r in this.data)s[r]=void 0;o=t}return this.mutate(s,Object.assign(Object.assign({},o),{unset:!0})),this}getByPath(t){return Vo(this.data,t,"/")}setByPath(t,e,n={}){const s="/",o=Array.isArray(t)?[...t]:t.split(s),r=Array.isArray(t)?t.join(s):t,a=o[0],l=o.length;if(n.propertyPath=r,n.propertyValue=e,n.propertyPathArray=o,l===1)this.set(a,e,n);else{const c={};let h=c,u=a;for(let m=1;m<l;m+=1){const p=o[m],b=Number.isFinite(Number(p));h=h[u]=b?[]:{},u=p}fn(c,o,e,s);const d=ut(this.data);n.rewrite&&gc(d,t,s);const f=pt(d,c);this.set(a,f[a],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),s=n[0];if(n.length===1)this.remove(s,e);else{const o=n.slice(1),r=ut(this.get(s));r&&gc(r,o),this.set(s,r,e)}return this}hasChanged(t){return t==null?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(t==null)return this.hasChanged()?ut(this.changed):null;const e=this.changing?this.previous:this.data,n={};let s;for(const o in t){const r=t[o];ye(e[o],r)||(n[o]=r,s=!0)}return s?ut(n):null}toJSON(){return ut(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}X([$()],cu.prototype,"dispose",null);class q extends zt{static isCell(t){if(t==null)return!1;if(t instanceof q)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===q.toStringTag)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"}static normalizeTools(t){if(typeof t=="string")return{items:[t]};if(Array.isArray(t))return{items:t};if(t.items)return t;if(Reflect.has(t,"local")){const e=t,{local:n}=e,s=_(e,["local"]);return{local:n,items:[s]}}return{items:[t]}}static getCommonAncestor(...t){const e=t.filter(s=>s!=null).map(s=>s.getAncestors()).sort((s,o)=>s.length-o.length);return e.shift().find(s=>e.every(o=>o.includes(s)))||null}static getCellsBBox(t,e={}){let n=null;for(let s=0,o=t.length;s<o;s+=1){const r=t[s];let a=r.getBBox(e);if(a){if(r.isNode()){const l=r.getAngle();l!=null&&l!==0&&(a=a.bbox(l))}n=n==null?a:n.union(a)}}return n}static deepClone(t){const e=[t,...t.getDescendants({deep:!0})];return q.cloneCells(e)}static cloneCells(t){const e=Nl(t),n=e.reduce((s,o)=>(s[o.id]=o.clone(),s),{});return e.forEach(s=>{const o=n[s.id];if(o.isEdge()){const l=o.getSourceCellId(),c=o.getTargetCellId();l&&n[l]&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:n[l].id})),c&&n[c]&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:n[c].id}))}const r=s.getParent();r&&n[r.id]&&o.setParent(n[r.id]);const a=s.getChildren();if(a&&a.length){const l=a.reduce((c,h)=>(n[h.id]&&c.push(n[h.id]),c),[]);l.length>0&&o.setChildren(l)}}),n}static config(t){const{markup:e,propHooks:n,attrHooks:s}=t,o=_(t,["markup","propHooks","attrHooks"]);e!=null&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):typeof n=="function"?this.propHooks.push(n):Object.values(n).forEach(r=>{typeof r=="function"&&this.propHooks.push(r)})),s&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),s)),this.defaults=pt({},this.defaults,o)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:ut(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((n,s)=>s?F(s,t,n):n,e)}static generateId(t={}){return Do()}get[Symbol.toStringTag](){return q.toStringTag}constructor(t={}){super();const n=this.constructor.getDefaults(!0),s=pt({},this.preprocess(n),this.preprocess(t));this.id=s.id||q.generateId(t),this.store=new cu(s),this.animationManager=new LC,this.setup(),this.init(),this.postprocess(t)}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,o=this.constructor.applyPropHooks(this,t);return n==null&&e!==!0&&(o.id=q.generateId(t)),o}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:n,previous:s,options:o}=t;this.notify("change:*",{key:e,options:o,current:n,previous:s,cell:this}),this.notify(`change:${e}`,{options:o,current:n,previous:s,cell:this});const r=e;(r==="source"||r==="target")&&this.notify("change:terminal",{type:r,current:n,previous:s,options:o,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this})),this.on("added",({cell:t})=>{const e=this.store.get("animation");bo(e)||e.forEach(n=>{t.animate(...n)})})}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify(`cell:${t}`,e),this.isNode()?n.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return t==null?this.store.get():this.store.get(t,e)}setProp(t,e,n){if(typeof t=="string")this.store.set(t,e,n);else{const s=this.preprocess(t,!0);this.store.set(pt({},this.getProp(),s),e),this.postprocess(t)}return this}removeProp(t,e){return typeof t=="string"||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return t==null?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&(t==="children"?this._children=e?e.map(s=>this.model.getCell(s)).filter(s=>s!=null):null:t==="parent"&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return n[0]==="attrs"&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return t==null?this.getProp():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getPropByPath(t):e==null?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){t==null?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n=e.getMaxZIndex(),s;t.deep?(s=this.getDescendants({deep:!0,breadthFirst:!0}),s.unshift(this)):s=[this],n=n-s.length+1;const o=e.total();let r=e.indexOf(this)!==o-s.length;r||(r=s.some((a,l)=>a.getZIndex()!==n+l)),r&&this.batchUpdate("to-front",()=>{n+=s.length,s.forEach((a,l)=>{a.setZIndex(n+l,t)})})}return this}toBack(t={}){const e=this.model;if(e){let n=e.getMinZIndex(),s;t.deep?(s=this.getDescendants({deep:!0,breadthFirst:!0}),s.unshift(this)):s=[this];let o=e.indexOf(this)!==0;o||(o=s.some((r,a)=>r.getZIndex()!==n+a)),o&&this.batchUpdate("to-back",()=>{n-=s.length,s.forEach((r,a)=>{r.setZIndex(n+a,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){t==null?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");return t==null&&(t=this.constructor.getMarkup()),t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){t==null?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(t==null)this.removeAttrs(e);else{const n=s=>this.store.set("attrs",s,e);if(e.overwrite===!0)n(t);else{const s=this.getAttrs();e.deep===!1?n(Object.assign(Object.assign({},s),t)):n(pt({},s,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const n=this.constructor.getAttrHooks()||{};let s=n[t]||si.get(t);if(!s){const o=Jn(t);s=n[o]||si.get(o)}return s||null}getAttrByPath(t){return t==null||t===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,n){return t==null?this.getAttrByPath():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getAttrByPath(t):e==null?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return this.store.get("visible")!==!1}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n=typeof t=="boolean"?t:!this.isVisible(),s=typeof t=="boolean"?e:t;return n?this.show(s):this.hide(s),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(t==null)this.removeData(e);else{const n=s=>this.store.set("data",s,e);if(e.overwrite===!0)n(t);else{const s=this.getData();e.deep===!1?n(typeof t=="object"?Object.assign(Object.assign({},s),t):t):n(pt({},s,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(n=>{var s;return(s=this.model)===null||s===void 0?void 0:s.getCell(n)}).filter(n=>n!=null);return this._children=e,[...e]}return null}hasParent(){return this.parent!=null}isParentOf(t){return t!=null&&t.getParent()===this}isChildOf(t){return t!=null&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(t){return this.children==null?-1:this.children.indexOf(t)}getChildAt(t){return this.children!=null&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();for(;n;)e.push(n),n=t.deep!==!1?n.getParent():null;return e}getDescendants(t={}){if(t.deep!==!1){if(t.breadthFirst){const e=[],n=this.getChildren()||[];for(;n.length>0;){const s=n.shift(),o=s.getChildren();e.push(s),o&&n.push(...o)}return e}{const e=this.getChildren()||[];return e.forEach(n=>{e.push(...n.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(t==null)return!1;if(e.deep!==!1){let n=this.getParent();for(;n;){if(n===t)return!0;n=n.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return t==null?!1:t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return q.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,t!=null?this.store.set("children",t.map(n=>n.id),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(n!=null&&t!=null){const s=this.getChildIndex(t);s!==-1&&(n.splice(s,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return q.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(t!=null&&t!==this){const s=t.getParent(),o=this!==s;let r=e;if(r==null&&(r=this.getChildCount(),o||(r-=1)),s){const l=s.getChildren();if(l){const c=l.indexOf(t);c>=0&&(t.setParent(null,n),l.splice(c,1),s.setChildren(l,n))}}let a=this.children;if(a==null?(a=[],a.push(t)):a.splice(r,0,t),t.setParent(this,n),this.setChildren(a,n),o&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(h=>h.updateParent(n)),c&&c.forEach(h=>h.updateParent(n))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(e!=null){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t);return this.children!=null&&n!=null&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),t.deep!==!1&&this.eachChild(n=>n.remove(t)),this.model&&this.model.removeCell(this,t),this.dispose()}),this}animate(t,e){var n;const s=we(e)?{duration:e}:Object.assign({},e),o=new QC(this,t,s),r=new DC(o,s.timeline);return this.animationManager.addAnimation(r),r.id=(n=s.id)!==null&&n!==void 0?n:"",r.play(),r}getAnimations(){return this.animationManager.getAnimations()}translate(t,e,n){return this}scale(t,e,n,s){return this}addTools(t,e,n){const s=Array.isArray(t)?t:[t],o=typeof e=="string"?e:null,r=typeof e=="object"?e:typeof n=="object"?n:{};if(r.reset)return this.setTools({name:o,items:s,local:r.local},r);let a=ut(this.getTools());if(a==null||o==null||a.name===o)return a==null&&(a={}),a.items||(a.items=[]),a.name=o,a.items=[...a.items,...s],this.setTools(Object.assign({},a),r)}setTools(t,e={}){return t==null?this.removeTools():this.store.set("tools",q.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return e==null?!1:t==null?!0:e.name===t}hasTool(t){const e=this.getTools();return e==null?!1:e.items.some(n=>typeof n=="string"?n===t:n.name===t)}removeTool(t,e={}){const n=ut(this.getTools());if(n){let s=!1;const o=n.items.slice(),r=a=>{o.splice(a,1),s=!0};if(typeof t=="number")r(t);else for(let a=o.length-1;a>=0;a-=1){const l=o[a];(typeof l=="string"?l===t:l.name===t)&&r(a)}s&&(n.items=o,this.setTools(n,e))}return this}getBBox(t){return new I}getConnectionPoint(t,e){return new A}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,s=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const m=this.constructor;throw new Error(`Unable to serialize ${s} missing "shape" prop, check the ${s} "${m.name||n.call(m)}"`)}const o=this.constructor,r=t.diff===!0,a=e.attrs||{},l=o.getDefaults(!0),c=r?this.preprocess(l,!0):l,h=c.attrs||{},u={};Object.entries(e).forEach(([m,p])=>{if(p!=null&&!Array.isArray(p)&&typeof p=="object"&&!ne(p))throw new Error(`Can only serialize ${s} with plain-object props, but got a "${n.call(p)}" type of key "${m}" on ${s} "${this.id}"`);if(m!=="attrs"&&m!=="shape"&&r){const b=c[m];ye(p,b)&&delete e[m]}}),Object.keys(a).forEach(m=>{const p=a[m],b=h[m];Object.keys(p).forEach(y=>{const C=p[y],w=b?b[y]:null;C!=null&&typeof C=="object"&&!Array.isArray(C)?Object.keys(C).forEach(x=>{const E=C[x];if(b==null||w==null||!mt(w)||!ye(w[x],E)){u[m]==null&&(u[m]={}),u[m][y]==null&&(u[m][y]={});const S=u[m][y];S[x]=E}}):(b==null||!ye(w,C))&&(u[m]==null&&(u[m]={}),u[m][y]=C)})});const d=Object.assign(Object.assign({},e),{attrs:bo(u)?void 0:u});d.attrs==null&&delete d.attrs;const f=d;return f.angle===0&&delete f.angle,ut(f)}clone(t={}){if(!t.deep){const n=Object.assign({},this.store.get());t.keepId||delete n.id,delete n.parent,delete n.children;const s=this.constructor;return new s(n)}return q.deepClone(this)[this.id]}findView(t){return t.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const s=this.model;this.startBatch(t,n,s);const o=e();return this.stopBatch(t,n,s),o}dispose(){this.removeFromParent(),this.animationManager.cancelAnimations(),this.store.dispose()}}q.toStringTag="X6.cell",q.defaults={},q.attrHooks={},q.propHooks=[],X([$()],q.prototype,"dispose",null),q.config({propHooks(i){var{tools:t}=i,e=_(i,["tools"]);return t&&(e.tools=q.normalizeTools(t)),e}});class zC{constructor(t){this.ports=[],this.groups={},this.init(ut(t))}getPorts(){return this.ports}getGroup(t){return t!=null?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||e.group==null&&t==null)}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),s=t?this.getGroup(t):null,o=s?s.position:null,r=o?o.name:null;let a;if(r!=null){const u=fi.get(r);if(u==null)return fi.onNotFound(r);a=u}else a=kh.left;const l=n.map(u=>u&&u.position&&u.position.args||{}),c=o&&o.args||{};return a(l,e,c).map((u,d)=>{const f=n[d];return{portLayout:u,portId:f.id,portSize:f.size,portAttrs:f.attrs,labelSize:f.label.size,labelLayout:this.getPortLabelLayout(f,A.create(u.position),e)}})}init(t){const{groups:e,items:n}=t;e!=null&&Object.keys(e).forEach(s=>{this.groups[s]=this.parseGroup(e[s])}),Array.isArray(n)&&n.forEach(s=>{this.ports.push(this.parsePort(s))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=pt({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=pt({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return typeof e.zIndex=="number"?e.zIndex:typeof t.zIndex=="number"||t.zIndex==="auto"?t.zIndex:"auto"}createPosition(t,e){return pt({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if(typeof t=="object")return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(typeof t=="object")return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const s=t.label.position.name||"left",o=t.label.position.args||{},r=xs.get(s)||Mh.left;return r?r(e,n,o):null}}let gr,fr;function hu(i,t){return t?gr!=null&&gr.exist(i):fr!=null&&fr.exist(i)}function FC(i){gr=i}function UC(i){fr=i}const uu="X6.node";let du=0;function KC(i){return i?To(i):(du+=1,`CustomNode${du}`)}let Bt=class Nn extends q{static isNode(t){if(t==null)return!1;if(t instanceof Nn)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===uu)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.size=="function"&&typeof n.position=="function"}static define(t){const{constructorName:e,overwrite:n}=t,s=_(t,["constructorName","overwrite"]),o=Qo(KC(e||s.shape),this);return o.config(s),s.shape&&Nn.registry.register(s.shape,o,n),o}static create(t){const e=t.shape||"rect",n=Nn.registry.get(e);return n?new n(t):Nn.registry.onNotFound(e)}get[Symbol.toStringTag](){return Nn.toStringTag}constructor(t={}){super(t),this.initPorts()}preprocess(t,e){const{x:n,y:s,width:o,height:r}=t,a=_(t,["x","y","width","height"]);if(n!=null||s!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:n??(l?l.x:0),y:s??(l?l.y:0)})}if(o!=null||r!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:o??(l?l.width:0),height:r??(l?l.height:0)})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,n){return t===void 0?this.getSize():typeof t=="number"?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return typeof t=="object"?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const s=n.direction;if(s){const o=this.getSize();switch(s){case"left":case"right":e=o.height;break;case"top":case"bottom":t=o.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[s];const l=Qt(this.getAngle()||0);n.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let h;a===0?h=c.getBottomLeft():a===1?h=c.getCorner():a===2?h=c.getTopRight():h=c.getOrigin();const u=h.clone().rotate(-l,c.getCenter()),d=Math.sqrt(t*t+e*e)/2;let f=a*Math.PI/2;f+=Math.atan(a%2===0?e/t:t/e),f-=Rt(l);const p=A.fromPolar(d,f,u).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(p.x,p.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,s={}){const o=this.getBBox().scale(t,e,n??void 0);return this.startBatch("scale",s),this.setPosition(o.x,o.y,s),this.resize(o.width,o.height,s),this.stopBatch("scale"),this}position(t,e,n){return typeof t=="number"?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const n=this.getParent();if(n!=null&&n.isNode()){const s=this.getPosition(),o=n.getPosition();return{x:s.x-o.x,y:s.y-o.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let s,o,r;if(typeof t=="object"?(s=t.x,o=t.y,r=e||{}):(s=t,o=e,r=n||{}),r.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();s+=l.x,o+=l.y}}if(r.deep){const a=this.getPosition();this.translate(s-a.x,o-a.y,r)}else this.store.set("position",{x:s,y:o},r);return this}translate(t=0,e=0,n={}){if(t===0&&e===0)return this;n.translateBy=n.translateBy||this.id;const s=this.getPosition();if(n.restrict!=null&&n.translateBy===this.id){const r=this.getBBox({deep:!0}),a=n.restrict,l=s.x-r.x,c=s.y-r.y,h=Math.max(a.x+l,Math.min(a.x+a.width+l-r.width,s.x+t)),u=Math.max(a.y+c,Math.min(a.y+a.height+c-r.height,s.y+e));t=h-s.x,e=u-s.y}const o={x:s.x+t,y:s.y+e};if(n.tx=t,n.ty=e,n.transition){let r=typeof n.transition!="object"?{}:Object.assign({},n.transition);r=Object.assign({duration:100,fill:"forwards"},r),this.animate({"position/x":o.x,"position/y":o.y},r),this.eachChild(a=>{var l;((l=n.exclude)===null||l===void 0?void 0:l.includes(a))||a.translate(t,e,n)})}else this.startBatch("translate",n),this.store.set("position",o,n),this.eachChild(r=>{var a;((a=n.exclude)===null||a===void 0?void 0:a.includes(r))||r.translate(t,e,n)}),this.stopBatch("translate",n);return this}angle(t,e){return t==null?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const s=this.getSize(),o=this.getPosition(),r=this.getBBox().getCenter();r.rotate(n-t,e.center);const a=r.x-s.width/2-o.x,l=r.y-s.height/2-o.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(o.x+a,o.y+l,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),q.getCellsBBox(e)}return I.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),s=n.getCenter(),o=t.getTerminal(e);if(o==null)return s;const r=o.port;if(!r||!this.hasPort(r))return s;const a=this.getPort(r);if(!a||!a.group)return s;const c=this.getPortsPosition(a.group)[r].position,h=A.create(c).translate(n.getOrigin()),u=this.getAngle();return u&&h.rotate(-u,s),h}fit(t={}){const n=(this.getChildren()||[]).filter(c=>c.isNode());if(n.length===0)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach(c=>{c.fit(t)});let{x:s,y:o,width:r,height:a}=q.getCellsBBox(n);const l=se(t.padding);return s-=l.left,o-=l.top,r+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:s,y:o},size:{width:r,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Dt.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Dt.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Dt.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Dt.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Dt.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Dt.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return t.items==null&&(t.items=[]),t}getPorts(){return ut(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return ut(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return this.getPortIndex(t)!==-1}getPortIndex(t){const e=typeof t=="string"?t:t.id;return e!=null?this.ports.items.findIndex(n=>n.id===e):-1}getPortsPosition(t){const e=this.getSize();return this.port.getPortsLayoutByGroup(t,new I(0,0,e.width,e.height)).reduce((s,o)=>{const r=o.portLayout;return s[o.portId]={position:Object.assign({},r.position),angle:r.angle||0},s},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,s){if(typeof e=="string"||Array.isArray(e)){const a=this.prefixPortPath(t,e),l=n;return this.setPropByPath(a,l,s)}const o=this.prefixPortPath(t),r=e;return this.setPropByPath(o,r,n)}removePortProp(t,e,n){return typeof e=="string"||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,s){return e==null?this.getPortProp(t):typeof e=="string"||Array.isArray(e)?arguments.length===2?this.getPortProp(t,e):n==null?this.removePortProp(t,e,s):this.setPortProp(t,e,n,s):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(n===-1)throw new Error(`Unable to find port with id: "${t}"`);return e==null||e===""?["ports","items",`${n}`]:Array.isArray(e)?["ports","items",`${n}`,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const s=[...this.ports.items];return s.splice(t,0,e),this.setPropByPath("ports/items",s,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const o=[...this.ports.items].filter(r=>!t.some(a=>{const l=typeof a=="string"?a:a.id;return r.id===l}));this.setPropByPath("ports/items",o,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(r=>{r.id&&(e[r.id]=!0)});const n={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(r=>{r.id&&!e[r.id]&&(n[r.id]=!0)});const o=this.model;o&&!bo(n)&&(o.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&n[c]&&l.remove()}),o.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&n[c]&&l.remove()}))}validatePorts(){const t={},e=[];return this.ports.items.forEach(n=>{typeof n!="object"&&e.push(`Invalid port ${n}.`),n.id==null&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0}),e}generatePortId(){return Do()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new zC(this.ports);const n=this.port.getPorts(),s=e?n.filter(r=>e.find(a=>a.id===r.id)?null:r):[...n],o=e?e.filter(r=>n.find(a=>a.id===r.id)?null:r):[];s.length>0&&this.notify("ports:added",{added:s,cell:this,node:this}),o.length>0&&this.notify("ports:removed",{removed:o,cell:this,node:this})}};Bt.toStringTag=uu,Bt.registry=bt.create({type:"node",process(i,t){if(hu(i,!0))throw new Error(`Node with name '${i}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:i}),t;let e=Bt;const{inherit:n}=t,s=_(t,["inherit"]);if(n)if(typeof n=="string"){const r=this.get(n);r==null?this.onNotFound(n,"inherited"):e=r}else e=n;s.constructorName==null&&(s.constructorName=i);const o=e.define.call(e,s);return o.config({shape:i}),o}}),Bt.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},Bt.config({propHooks(i){var{ports:t}=i,e=_(i,["ports"]);return t&&(e.ports=Array.isArray(t)?{items:t}:t),e}}),UC(Bt.registry);const gu="X6.edge",fu="basic.edge";let pu=0;function JC(i){return i?To(i):(pu+=1,`CustomEdge${pu}`)}let At=class Rn extends q{static parseStringLabel(t){return{attrs:{label:{text:t}}}}static isEdge(t){if(t==null)return!1;if(t instanceof Rn)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===gu)&&typeof n.isNode=="function"&&typeof n.isEdge=="function"&&typeof n.prop=="function"&&typeof n.attr=="function"&&typeof n.disconnect=="function"&&typeof n.getSource=="function"&&typeof n.getTarget=="function"}static equalTerminals(t,e){const n=t,s=e;return n.cell===s.cell?n.port===s.port||n.port==null&&s.port==null:!1}static define(t){const{constructorName:e,overwrite:n}=t,s=_(t,["constructorName","overwrite"]),o=Qo(JC(e||s.shape),this);return o.config(s),s.shape&&Rn.registry.register(s.shape,o,n),o}static create(t){const e=t.shape||"edge",n=Rn.registry.get(e);return n?new n(t):Rn.registry.onNotFound(e)}get[Symbol.toStringTag](){return Rn.toStringTag}constructor(t={}){super(t)}preprocess(t,e){const{source:n,sourceCell:s,sourcePort:o,sourcePoint:r,target:a,targetCell:l,targetPort:c,targetPoint:h}=t,d=_(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),f=m=>typeof m=="string"||typeof m=="number";if(n!=null)if(q.isCell(n))d.source={cell:n.id};else if(f(n))d.source={cell:n};else if(A.isPoint(n))d.source=n.toJSON();else if(Array.isArray(n))d.source={x:n[0],y:n[1]};else{const m=n.cell;q.isCell(m)?d.source=Object.assign(Object.assign({},n),{cell:m.id}):d.source=n}if(s!=null||o!=null){let m=d.source;if(s!=null){const p=f(s)?s:s.id;m?m.cell=p:m=d.source={cell:p}}o!=null&&m&&(m.port=o)}else r!=null&&(d.source=A.create(r).toJSON());if(a!=null)if(q.isCell(a))d.target={cell:a.id};else if(f(a))d.target={cell:a};else if(A.isPoint(a))d.target=a.toJSON();else if(Array.isArray(a))d.target={x:a[0],y:a[1]};else{const m=a.cell;q.isCell(m)?d.target=Object.assign(Object.assign({},a),{cell:m.id}):d.target=a}if(l!=null||c!=null){let m=d.target;if(l!=null){const p=f(l)?l:l.id;m?m.cell=p:m=d.target={cell:p}}c!=null&&m&&(m.port=c)}else h!=null&&(d.target=A.create(h).toJSON());return super.preprocess(d,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,s={}){if(q.isCell(e))return this.store.set(t,pt({},n,{cell:e.id}),s),this;const o=e;return A.isPoint(e)||o.x!=null&&o.y!=null?(this.store.set(t,pt({},n,{x:o.x,y:o.y}),s),this):(this.store.set(t,ut(e),s),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(A.isPointLike(e))return A.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new A}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e=t==="source"?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};for(;e&&e.isEdge();){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){t==null?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return typeof t=="object"?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){t==null?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return typeof t=="object"?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return ut(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const s=this.getLabels(),o=s.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),s.splice(r,0,this.parseLabel(t)),this.setLabels(s,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return t!=null&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const s=this.getLabels();s[t]=this.parseLabel(e),this.setLabels(s,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),s=t!=null&&Number.isFinite(t)?t:-1,o=n.splice(s,1);return this.setLabels(n,e),o.length?o[0]:null}parseLabel(t){return typeof t=="string"?this.constructor.parseStringLabel(t):t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>o===r||ye(o,r))?null:o):e?[...e]:[],s=t&&e?t.filter(o=>e.find(r=>o===r||ye(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),s.length>0&&this.notify("labels:removed",{removed:s,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map(s=>A.toJSON(s)),e),this}insertVertex(t,e,n={}){const s=this.getVertices(),o=s.length;let r=e!=null&&Number.isFinite(e)?e:o;return r<0&&(r=o+r+1),s.splice(r,0,A.toJSON(t)),this.setVertices(s,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){return t!=null&&Number.isFinite(t)?this.getVertices()[t]:null}setVertexAt(t,e,n={}){if(t!=null&&Number.isFinite(t)){const s=this.getVertices();s[t]=e,this.setVertices(s,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),s=t!=null&&Number.isFinite(t)?t:-1;return n.splice(s,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter(o=>t.find(r=>A.equals(o,r))?null:o):e?[...e]:[],s=t&&e?t.filter(o=>e.find(r=>A.equals(o,r))?null:o):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),s.length>0&&this.notify("vertexs:removed",{removed:s,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Dt.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints(s=>({x:(s.x||0)+t,y:(s.y||0)+e}),n)}scale(t,e,n,s={}){return this.applyToPoints(o=>A.create(o).scale(t,e,n).toJSON(),s)}applyToPoints(t,e={}){const n={},s=this.getSource(),o=this.getTarget();A.isPointLike(s)&&(n.source=t(s)),A.isPointLike(o)&&(n.target=t(o));const r=this.getVertices();return r.length>0&&(n.vertices=r.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(e=>A.create(e)),this.getTargetPoint()];return new xt(t)}updateParent(t){let e=null;const n=this.getSourceCell(),s=this.getTargetCell(),o=this.getParent();return n&&s&&(n===s||n.isDescendantOf(s)?e=s:s.isDescendantOf(n)?e=n:e=q.getCommonAncestor(n,s)),o&&e&&e.id!==o.id&&o.unembed(this,t),e&&(!o||o.id!==e.id)&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),s=e.cell,o=n.cell;if(!s||!o)return!1;let r=s===o;if(!r&&t.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(r=a.isAncestorOf(l,t)||l.isAncestorOf(a,t))}return r}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>e!=null);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}};At.toStringTag=gu,At.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},At.registry=bt.create({type:"edge",process(i,t){if(hu(i,!1))throw new Error(`Edge with name '${i}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:i}),t;let e=At;const{inherit:n="edge"}=t,s=_(t,["inherit"]);if(typeof n=="string"){const r=this.get(n||"edge");r==null&&n?this.onNotFound(n,"inherited"):e=r}else e=n;s.constructorName==null&&(s.constructorName=i);const o=e.define.call(e,s);return o.config({shape:i}),o}}),At.defaults={},FC(At.registry),At.config({shape:fu,propHooks(i){const{label:t,vertices:e}=i,n=_(i,["label","vertices"]);if(t){n.labels==null&&(n.labels=[]);const s=typeof t=="string"?At.parseStringLabel(t):t;n.labels.push(s)}return e&&Array.isArray(e)&&(n.vertices=e.map(s=>A.create(s).toJSON())),n}}),At.registry.register(fu,At);class pr extends zt{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,n){let s,o;typeof e=="number"?(s=e,o=Object.assign({merge:!1},n)):(s=this.length,o=Object.assign({merge:!1},e)),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);const r=Array.isArray(t)?t:[t],a=this.comparator&&typeof e!="number"&&o.sort!==!1,l=this.comparator||null;let c=!1;const h=[],u=[];return r.forEach(d=>{const f=this.get(d);f?o.merge&&!d.isSameStore(f)&&(f.setProp(d.getProp(),n),u.push(f),a&&!c&&(l==null||typeof l=="function"?c=f.hasChanged():typeof l=="string"?c=f.hasChanged(l):c=l.some(m=>f.hasChanged(m)))):(h.push(d),this.reference(d))}),h.length&&(a&&(c=!0),this.cells.splice(s,0,...h),this.length=this.cells.length),c&&this.sort({silent:!0}),o.silent||(h.forEach((d,f)=>{const m={cell:d,index:s+f,options:o};this.trigger("added",m),o.dryrun||d.notify("added",Object.assign({},m))}),c&&this.trigger("sorted"),(h.length||u.length)&&this.trigger("updated",{added:h,merged:u,removed:[],options:o})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],s=this.removeCells(n,e);return!e.silent&&s.length>0&&this.trigger("updated",{options:e,removed:s,added:[],merged:[]}),Array.isArray(t)?s:s[0]}removeCells(t,e){const n=[];for(let s=0;s<t.length;s+=1){const o=this.get(t[s]);if(o==null)continue;const r=this.cells.indexOf(o);this.cells.splice(r,1),this.length-=1,delete this.map[o.id],n.push(o),this.unreference(o),e.silent||(this.trigger("removed",{cell:o,index:r,options:e}),e.dryrun||o.notify("removed",{cell:o,index:r,options:e})),e.dryrun||o.remove()}return n}reset(t,e={}){const n=this.cells.slice();if(e.diff||(n.forEach(s=>{this.unreference(s),s.remove()}),this.clean()),this.add(t,Object.assign({silent:!0},e)),!e.silent){const s=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:s});const o=[],r=[];s.forEach(a=>{n.some(c=>c.id===a.id)||o.push(a)}),n.forEach(a=>{s.some(c=>c.id===a.id)||r.push(a)}),this.trigger("updated",{options:e,added:o,removed:r,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return e?this.remove(e,t):null}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return e?this.remove(e,t):null}get(t){if(t==null)return null;const e=typeof t=="string"||typeof t=="number"?t:t.id;return this.map[e]||null}has(t){return this.get(t)!=null}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return this.comparator!=null&&(this.cells=yo(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger(`cell:${t}`,e),n&&(n.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}X([$()],pr.prototype,"dispose",null);const jC="X6.Model";class Gt extends zt{static isModel(t){if(t==null)return!1;if(t instanceof Gt)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===jC)&&typeof n.addNode=="function"&&typeof n.addEdge=="function"&&n.collection!=null}static toJSON(t,e={}){return{cells:t.map(n=>n.toJSON(e))}}static fromJSON(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach(n=>{n.shape==null&&(n.shape="rect"),e.push(n)}),t.edges&&t.edges.forEach(n=>{n.shape==null&&(n.shape="edge"),e.push(n)})),e.map(n=>{const s=n.shape;if(s){if(Bt.registry.exist(s))return Bt.create(n);if(At.registry.exist(s))return At.create(n)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new pr(t),this.setup()}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&(t==="sorted"||t==="reseted"||t==="updated"?n.trigger(`model:${t}`,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",e=>this.notify("updated",e)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:e})=>{this.onCellAdded(e)}),t.on("removed",e=>{const n=e.cell;this.onCellRemoved(n,e.options),this.notify("cell:removed",e),n.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:n}))}),t.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),t.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),t.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const s=t.getSource(),o=t.getTarget();if(s!=null&&s.cell){const r=this.outgoings[s.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.outgoings[s.cell])}if(o!=null&&o.cell){const r=this.incomings[o.cell],a=r?r.indexOf(n):-1;a>=0&&(r.splice(a,1),r.length===0&&delete this.incomings[o.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(e=>{this.onCellAdded(e)})}onEdgeTerminalChanged(t,e){const n=e==="source"?this.outgoings:this.incomings,s=t.previous(e);if(s!=null&&s.cell){const r=q.isCell(s.cell)?s.cell.id:s.cell,a=n[r],l=a?a.indexOf(t.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete n[r])}const o=t.getTerminal(e);if(o!=null&&o.cell){const r=q.isCell(o.cell)?o.cell.id:o.cell,a=n[r]||[];a.indexOf(t.id)===-1&&a.push(t.id),n[r]=a}}prepareCell(t,e){return!t.model&&(!e||!e.dryrun)&&(t.model=this),t.zIndex==null&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(n=>this.prepareCell(n,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(n=>this.prepareCell(n,{options:e})),this}clear(t={}){const e=this.getCells();if(e.length===0)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const s=e.sort((o,r)=>{const a=o.isEdge()?1:2,l=r.isEdge()?1:2;return a-l});for(;s.length>0;){const o=s.shift();o&&o.remove(n)}},n),this}addNode(t,e={}){const n=Bt.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}updateNode(t,e={}){const n=this.createNode(t),s=n.getProp();return n.dispose(),this.updateCell(s,e)}createNode(t){return Bt.create(t)}addEdge(t,e={}){const n=At.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return At.create(t)}updateEdge(t,e={}){const n=this.createEdge(t),s=n.getProp();return n.dispose(),this.updateCell(s,e)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(!this.collection.has(t)&&!this.addings.has(t)&&(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild(n=>this.addCell(n,e)),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(n===0)return this;const s=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},s),{cells:t})),t.forEach(o=>{this.addCell(o,s),s.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},s),{cells:t})),this}updateCell(t,e={}){const n=t.id&&this.getCell(t.id);return n?this.batchUpdate("update",()=>(Object.entries(t).forEach(([s,o])=>{n.setProp(s,o,e)}),!0),t):!1}removeCell(t,e={}){const n=typeof t=="string"?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){if(t.id===e)return;this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});return this.addCell(n),this.getConnectedEdges(t).forEach(o=>{const r=o.getSourceCell(),a=o.getTargetCell();r===t&&o.setSource(Object.assign(Object.assign({},o.getSource()),{cell:e})),a===t&&o.setTarget(Object.assign(Object.assign({},o.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(n=>this.removeCell(n,e))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach(s=>{s.remove(e)}),n}disconnectConnectedEdges(t,e={}){const n=typeof t=="string"?t:t.id;this.getConnectedEdges(t).forEach(s=>{const o=s.getSourceCellId(),r=s.getTargetCellId();o===n&&s.setSource({x:0,y:0},e),r===n&&s.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(e=>this.getCell(e)).filter(e=>e!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e=typeof t=="string"?t:t.id,n=this.outgoings[e];return n?n.map(s=>this.getCell(s)).filter(s=>s==null?void 0:s.isEdge()):null}getIncomingEdges(t){const e=typeof t=="string"?t:t.id,n=this.incomings[e];return n?n.map(s=>this.getCell(s)).filter(s=>s==null?void 0:s.isEdge()):null}getConnectedEdges(t,e={}){const n=[],s=typeof t=="string"?this.getCell(t):t;if(s==null)return n;const o={},r=e.indirect;let a=e.incoming,l=e.outgoing;a==null&&l==null&&(a=l=!0);const c=(h,u)=>{const d=u?this.getOutgoingEdges(h):this.getIncomingEdges(h);if(d!=null&&d.forEach(f=>{o[f.id]||(n.push(f),o[f.id]=!0,r&&(a&&c(f,!1),l&&c(f,!0)))}),r&&h.isEdge()){const f=u?h.getTargetCell():h.getSourceCell();f!=null&&f.isEdge()&&(o[f.id]||(n.push(f),c(f,u)))}};if(l&&c(s,!0),a&&c(s,!1),e.deep){const h=s.getDescendants({deep:!0}),u={};h.forEach(f=>{f.isNode()&&(u[f.id]=!0)});const d=(f,m)=>{const p=m?this.getOutgoingEdges(f.id):this.getIncomingEdges(f.id);p!=null&&p.forEach(b=>{if(!o[b.id]){const y=b.getSourceCell(),C=b.getTargetCell();if(!e.enclosed&&y&&u[y.id]&&C&&u[C.id])return;n.push(b),o[b.id]=!0}})};h.forEach(f=>{f.isEdge()||(l&&d(f,!0),a&&d(f,!1))})}return n}isBoundary(t,e){const n=typeof t=="string"?this.getCell(t):t,s=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return s==null||s.length===0}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,t)){const s=this.getCell(n);s&&e.push(s)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,s=e.outgoing;n==null&&s==null&&(n=s=!0);const r=this.getConnectedEdges(t,e).reduce((a,l)=>{const c=l.hasLoop(e),h=l.getSourceCell(),u=l.getTargetCell();return n&&h&&h.isNode()&&!a[h.id]&&(c||h!==t&&(!e.deep||!h.isDescendantOf(t)))&&(a[h.id]=h),s&&u&&u.isNode()&&!a[u.id]&&(c||u!==t&&(!e.deep||!u.isDescendantOf(t)))&&(a[u.id]=u),a},{});if(t.isEdge()){if(n){const a=t.getSourceCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}if(s){const a=t.getTargetCell();a!=null&&a.isNode()&&!r[a.id]&&(r[a.id]=a)}}return Object.keys(r).map(a=>r[a])}isNeighbor(t,e,n={}){let s=n.incoming,o=n.outgoing;return s==null&&o==null&&(s=o=!0),this.getConnectedEdges(t,n).some(r=>{const a=r.getSourceCell(),l=r.getTargetCell();return!!(s&&a&&a.id===e.id||o&&l&&l.id===e.id)})}getSuccessors(t,e={}){const n=[];return this.search(t,(s,o)=>{s!==t&&this.matchDistance(o,e.distance)&&n.push(s)},Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let s=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return s=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),s}getPredecessors(t,e={}){const n=[];return this.search(t,(s,o)=>{s!==t&&this.matchDistance(o,e.distance)&&n.push(s)},Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let s=!1;return this.search(t,(o,r)=>{if(o===e&&o!==t&&this.matchDistance(r,n.distance))return s=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),s}matchDistance(t,e){return e==null?!0:typeof e=="function"?e(t):Array.isArray(e)&&e.includes(t)?!0:t===e}getCommonAncestor(...t){const e=[];return t.forEach(n=>{n&&(Array.isArray(n)?e.push(...n):e.push(n))}),q.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],s={},o=[],r=[],a=l=>{s[l.id]||(n.push(l),s[l.id]=l,l.isEdge()&&r.push(l),l.isNode()&&o.push(l))};return t.forEach(l=>{a(l),e.deep&&l.getDescendants({deep:!0}).forEach(h=>{a(h)})}),r.forEach(l=>{const c=l.getSourceCell(),h=l.getTargetCell();c&&!s[c.id]&&(n.push(c),s[c.id]=c,c.isNode()&&o.push(c)),h&&!s[h.id]&&(n.push(h),s[h.id]=h,h.isNode()&&o.push(h))}),o.forEach(l=>{this.getConnectedEdges(l,e).forEach(h=>{const u=h.getSourceCell(),d=h.getTargetCell();!s[h.id]&&u&&s[u.id]&&d&&s[d.id]&&(n.push(h),s[h.id]=h)})}),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return q.cloneCells(t)}getNodesFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e||0}:t;return this.getNodes().filter(s=>s.getBBox().containsPoint(n))}getNodesInArea(t,e,n,s,o){const r=typeof t=="number"?new I(t,e,n,s):I.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getNodes().filter(c=>{const h=c.angle(),u=c.getBBox().bbox(h);return l?r.containsRect(u):r.isIntersectWithRect(u)})}getEdgesInArea(t,e,n,s,o){const r=typeof t=="number"?new I(t,e,n,s):I.create(t),a=typeof t=="number"?o:e,l=a==null?void 0:a.strict;return this.getEdges().filter(c=>{const h=c.getBBox();return h.width===0?h.inflate(1,0):h.height===0&&h.inflate(0,1),l?r.containsRect(h):r.isIntersectWithRect(h)})}getNodesUnderNode(t,e={}){const n=t.getBBox();return(e.by==null||e.by==="bbox"?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by])).filter(o=>t.id!==o.id&&!o.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return q.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const s=[],o={},r={};for(s.push(t),r[t.id]=0;s.length>0;){const a=s.shift();if(a==null||o[a.id]||(o[a.id]=!0,F(e,this,a,r[a.id])===!1))continue;this.getNeighbors(a,n).forEach(c=>{r[c.id]=r[a.id]+1,s.push(c)})}}depthFirstSearch(t,e,n={}){const s=[],o={},r={};for(s.push(t),r[t.id]=0;s.length>0;){const a=s.pop();if(a==null||o[a.id]||(o[a.id]=!0,F(e,this,a,r[a.id])===!1))continue;const l=this.getNeighbors(a,n),c=s.length;l.forEach(h=>{r[h.id]=r[a.id]+1,s.splice(c,0,h)})}}getShortestPath(t,e,n={}){const s={};this.getEdges().forEach(c=>{const h=c.getSourceCellId(),u=c.getTargetCellId();h&&u&&(s[h]||(s[h]=[]),s[u]||(s[u]=[]),s[h].push(u),n.directed||s[u].push(h))});const o=typeof t=="string"?t:t.id,r=U6(s,o,n.weight),a=[];let l=typeof e=="string"?e:e.id;for(r[l]&&a.push(l);r[l];){const c=r[l];a.unshift(c),l=c}return a}translate(t,e,n){return this.getCells().filter(s=>!s.hasParent()).forEach(s=>{s.translate(t,e,n)}),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,s={}){const o=this.getCellsBBox(n);if(o){const r=Math.max(t/o.width,0),a=Math.max(e/o.height,0),l=o.getOrigin();n.forEach(c=>{c.scale(r,a,l,s)})}return this}toJSON(t={}){return Gt.toJSON(this.getCells(),t)}parseJSON(t){return Gt.fromJSON(t)}fromJSON(t,e={}){let n=[];if(!e.diff)n=this.parseJSON(t);else{const s=t,{nodes:o=[],edges:r=[]}=s,a=_(s,["nodes","edges"]),l=o.filter(h=>!this.nodes[h.id])||[],c=r.filter(h=>!this.edges[h.id])||[];n=this.parseJSON(Object.assign(Object.assign({},a),{nodes:l,edges:c}))}return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const s=e();return this.stopBatch(t,n),s}hasActiveBatch(t=Object.keys(this.batches)){return(Array.isArray(t)?t:[t]).some(n=>this.batches[n]>0)}dispose(){this.collection.dispose()}}X([$()],Gt.prototype,"dispose",null);const mu={fill:"#ffffff",stroke:"#333333",strokeWidth:2},GC={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"};let Ei=class extends Bt{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return t==null?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};Ei.config({attrs:{text:Object.assign({},GC)},propHooks(i){const{label:t}=i,e=_(i,["label"]);return t&&fn(e,"attrs/text/text",t),e},visible:!0});function YC(i,t="body"){return[{tagName:i,selector:t},{tagName:"text",selector:"label"}]}function HC(i="xlink:href"){return e=>{const{imageUrl:n,imageWidth:s,imageHeight:o}=e,r=_(e,["imageUrl","imageWidth","imageHeight"]);if(n!=null||s!=null||o!=null){const a=()=>{if(r.attrs){const l=r.attrs.image;n!=null&&(l[i]=n),s!=null&&(l.width=s),o!=null&&(l.height=o),r.attrs.image=l}};r.attrs?(r.attrs.image==null&&(r.attrs.image={}),a()):(r.attrs={image:{}},a())}return r}}function vn(i,t,e={}){const n={constructorName:i,markup:YC(i,e.selector),attrs:{[i]:Object.assign({},mu)}};return(e.parent||Ei).define(pt(n,t,{shape:i}))}function bu(i){return typeof i=="string"?i:i.map(t=>Array.isArray(t)?t.join(","):A.isPointLike(t)?`${t.x}, ${t.y}`:"").join(" ")}vn("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const _C=At.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});vn("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});class Xt extends Cn{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(t){super(),this.graph=t,this.init()}init(){}}const yu={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onDragEnd"},De=1<<30,WC=1<<29;class $t extends Mt{constructor(){super(...arguments),this.portsCache={}}static isNodeView(t){if(t==null)return!1;if(t instanceof $t)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===wu)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"&&typeof n.update=="function"&&typeof n.findPortElem=="function"&&typeof n.resize=="function"&&typeof n.rotate=="function"&&typeof n.translate=="function"}get[Symbol.toStringTag](){return wu}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const n=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?at(e,n):L(e,n)}else{const n=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(n):this.addClass(n)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(),"update"),n=this.handleAction(n,"update",()=>this.update(),"ports"),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>{this.getFlag("tools")===t?this.renderTools():this.updateTools(e)})),n}update(t){this.cleanCache(),this.removePorts();const e=this.cell,n=e.getSize(),s=e.getAttrs();this.updateAttrs(this.container,s,{attrs:t===s?null:t,rootBBox:new I(0,0,n.width,n.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.appendChild(e.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this.notify("view:render",{view:this}),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const s=n.portContentElement,o=n.portContentSelectors||{};return this.findOne(e,s,o)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(t=>{_t(t.portElement)})}renderPorts(){const t=this.container,e=[];t.childNodes.forEach(r=>{e.push(r)});const n=this.cell.getParsedPorts(),s=kl(n,"zIndex"),o="auto";s[o]&&s[o].forEach(r=>{const a=this.getPortElement(r);t.append(a),e.push(a)}),Object.keys(s).forEach(r=>{if(r!==o){const a=parseInt(r,10);this.appendPorts(s[r],a,e)}}),this.updatePorts()}appendPorts(t,e,n){const s=t.map(o=>this.getPortElement(o));n[e]||e<0?_n(n[Math.max(e,0)],s):Ot(this.container,s)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Dt.renderMarkup(this.cell.getPortContainerMarkup());const n=e.elem;if(n==null)throw new Error("Invalid port container markup.");e=Dt.renderMarkup(this.getPortMarkup(t));const s=e.elem,o=e.selectors;if(s==null)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},s);let r="x6-port";t.group&&(r+=` x6-port-${t.group}`),L(n,r),L(n,"x6-port"),L(s,"x6-port-body"),n.appendChild(s);let a=o,l,c;if(this.existPortLabel(t)){if(e=Dt.renderMarkup(this.getPortLabelMarkup(t.label)),l=e.elem,c=e.selectors,l==null)throw new Error("Invalid port label markup.");if(o&&c){for(const u in c)if(o[u]&&u!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},o),c)}L(l,"x6-port-label"),n.appendChild(l)}return this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:s,portContentSelectors:o},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:s,contentSelectors:o}),n}updatePorts(){const t=this.cell.getParsedGroups(),e=Object.keys(t);e.length===0?this.updatePortGroup():e.forEach(n=>{this.updatePortGroup(n)})}updatePortGroup(t){const e=I.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let s=0,o=n.length;s<o;s+=1){const r=n[s],a=r.portId,l=this.portsCache[a]||{},c=r.portLayout;if(this.applyPortTransform(l.portElement,c),r.portAttrs!=null){const u={selectors:l.portSelectors||{}};r.portSize&&(u.rootBBox=I.fromSize(r.portSize)),this.updateAttrs(l.portElement,r.portAttrs,u)}const h=r.labelLayout;if(h&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,h,-(c.angle||0)),h.attrs)){const u={selectors:l.portLabelSelectors||{}};r.labelSize&&(u.rootBBox=I.fromSize(r.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,u)}}}applyPortTransform(t,e,n=0){const s=e.angle,o=e.position,r=Et().rotate(n).translate(o.x||0,o.y||0).rotate(s||0);pn(t,r,{absolute:!0})}getPortMarkup(t){return t.markup||this.cell.portMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup}existPortLabel(t){return t.attrs&&t.attrs.text}getEventArgs(t,e,n){const s=this,o=s.cell,r=o;return e==null||n==null?{e:t,view:s,node:o,cell:r}:{e:t,x:e,y:n,view:s,node:o,cell:r}}getPortEventArgs(t,e,n){const s=this,o=s.cell,r=o;return n?{e:t,x:n.x,y:n.y,view:s,node:o,cell:r,port:e}:{e:t,view:s,node:o,cell:r,port:e}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}notifyPortEvent(t,e,n){const s=this.findAttr("port",e.target);if(s){const o=e.type;t==="node:port:mouseenter"?e.type="mouseenter":t==="node:port:mouseleave"&&(e.type="mouseleave"),this.notify(t,this.getPortEventArgs(e,s,n)),e.type=o}}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:click",t,{x:e,y:n})}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:dblclick",t,{x:e,y:n})}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n)),this.notifyPortEvent("node:port:contextmenu",t,{x:e,y:n})}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.notifyPortEvent("node:port:mousedown",t,{x:e,y:n}),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const s=this.getEventData(t),o=s.action;if(o==="magnet")this.dragMagnet(t,e,n);else{if(o==="move"){const a=s.targetView||this;a.dragNode(t,e,n),a.notify("node:moving",{e:t,x:e,y:n,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(t,e,n),this.notifyPortEvent("node:port:mousemove",t,{x:e,y:n})}this.setEventData(t,s)}onMouseUp(t,e,n){const s=this.getEventData(t),o=s.action;o==="magnet"?this.stopMagnetDragging(t,e,n):(this.notifyMouseUp(t,e,n),this.notifyPortEvent("node:port:mouseup",t,{x:e,y:n}),o==="move"&&(s.targetView||this).stopNodeDragging(t,e,n));const r=s.targetMagnet;r&&this.onMagnetClick(t,r,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseenter",t),this.notifyPortEvent("node:port:mouseover",t)}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseleave",t),this.notifyPortEvent("node:port:mouseout",t)}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){super.onMouseWheel(t,e,n,s),this.notify("node:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,s){const o=this.graph;o.view.getMouseMovedCount(t)>o.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetDblClick(t,e,n,s){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetContextMenu(t,e,n,s){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,s)))}onMagnetMouseDown(t,e,n,s){this.startMagnetDragging(t,n,s)}onCustomEvent(t,e,n,s){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),super.onCustomEvent(t,e,n,s)}prepareEmbedding(t){const e=this.graph,s=this.getEventData(t).cell||this.cell,o=e.findViewByCell(s),r=e.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:s,view:o,cell:s,x:r.x,y:r.y,currentParent:s.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,s=e.graph||this.graph,o=s.options.embedding,r=o.findParent;let a=typeof r=="function"?F(r,s,{view:this,node:this.cell}).filter(d=>q.isCell(d)&&this.cell.id!==d.id&&!d.isDescendantOf(this.cell)):s.model.getNodesUnderNode(n,{by:r});if(o.frontOnly&&a.length>0){const d=kl(a,"zIndex"),f=Nb(Object.keys(d).map(m=>parseInt(m,10)));f&&(a=d[f])}a=a.filter(d=>d.visible);let l=null;const c=e.candidateEmbedView,h=o.validate;for(let d=a.length-1;d>=0;d-=1){const f=a[d];if(c&&c.cell.id===f.id){l=c;break}else{const m=f.findView(s);if(h&&F(h,s,{child:this.cell,parent:m.cell,childView:this,parentView:m})){l=m;break}}}this.clearEmbedding(e),l&&l.highlight(null,{type:"embedding"}),e.candidateEmbedView=l;const u=s.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:s.findViewByCell(n),x:u.x,y:u.y,currentParent:n.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const n=e.cell||this.cell,s=e.graph||this.graph,o=s.findViewByCell(n),r=n.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,(r==null||r.id!==a.cell.id)&&a.cell.insertChild(n,void 0,{ui:!0})):r&&r.unembed(n,{ui:!0}),s.model.getConnectedEdges(n,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),o&&a){const l=s.snapToGrid(t.clientX,t.clientY);o.notify("node:embedded",{e:t,cell:n,x:l.x,y:l.y,node:n,view:s.findViewByCell(n),previousParent:r,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.findViewByCell(t)}return null}validateMagnet(t,e,n){if(e.getAttribute("magnet")!=="passive"){const s=this.graph.options.connecting.validateMagnet;return s?F(s,this.graph,{e:n,magnet:e,view:t,cell:t.cell}):!0}return!1}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const s=t.currentTarget,o=this.graph;this.setEventData(t,{targetMagnet:s}),this.validateMagnet(this,s,t)?(o.options.magnetThreshold<=0&&this.startConnectting(t,s,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,n),o.view.delegateDragEvents(t,this)}startConnectting(t,e,n,s){this.graph.model.startBatch("add-edge");const o=this.createEdgeFromMagnet(e,n,s);o.setEventData(t,o.prepareArrowheadDragging("target",{x:n,y:s,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:o}),o.notifyMouseDown(t,n,s)}getDefaultEdge(t,e){let n;const s=this.graph.options.connecting.createEdge;return s&&(n=F(s,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),n}createEdgeFromMagnet(t,e,n){const s=this.graph,o=s.model,r=this.getDefaultEdge(this,t);return r.setSource(Object.assign(Object.assign({},r.getSource()),this.getEdgeTerminal(t,e,n,r,"source"))),r.setTarget(Object.assign(Object.assign({},r.getTarget()),{x:e,y:n})),r.addTo(o,{async:!1,ui:!0}),r.findView(s)}dragMagnet(t,e,n){const s=this.getEventData(t),o=s.edgeView;if(o)o.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const r=this.graph,a=r.options.magnetThreshold,l=this.getEventTarget(t),c=s.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(r.view.getMouseMovedCount(t)<=a)return;this.startConnectting(t,c,e,n)}}stopMagnetDragging(t,e,n){const o=this.eventData(t).edgeView;o&&(o.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,s,o){let r=[o];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(o)&&(r=l.filter(c=>c.isNode()))}r.forEach(l=>{this.notify(t,{e,x:n,y:s,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?F(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}startNodeDragging(t,e,n){const s=this.getDelegatedView();if(s==null||!s.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:s,action:"move"});const o=A.create(s.cell.getPosition());s.setEventData(t,{moving:!1,offset:o.diff(e,n),restrict:this.getRestrictArea(s)})}dragNode(t,e,n){const s=this.cell,o=this.graph,r=o.getGridSize(),a=this.getEventData(t),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=oe(e+l.x,r),u=oe(n+l.y,r);s.setPosition(h,u,{restrict:c,deep:!0,ui:!0}),o.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}autoOffsetNode(){const t=this.cell,e=this.graph,n=Object.assign({id:t.id},t.getPosition()),o=e.getNodes().map(c=>{const h=c.getPosition();return{id:c.id,x:h.x,y:h.y}}).filter(c=>c.id!==n.id),r=[[1,1],[1,-1],[-1,1],[-1,-1]];let a=e.getGridSize();const l=c=>o.some(h=>h.x===c.x&&h.y===c.y);for(;l(n);){let c=!1;for(let h=0;h<r.length;h+=1){const u=r[h],d={x:n.x+u[0]*a,y:n.y+u[1]*a};if(!l(d)){t.translate(u[0]*a,u[1]*a),c=!0;break}}if(c)break;a+=e.getGridSize()}}stopNodeDragging(t,e,n){const s=this.getEventData(t),o=this.graph;s.embedding&&this.finalizeEmbedding(t,s),s.moving&&(o.options.translating.autoOffset&&this.autoOffsetNode(),this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),s.moving=!1,s.embedding=!1}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");n&&n.autoScroll(t,e)}}const wu=`X6.${$t.name}`;$t.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),$t.registry.register("node",$t,!0);class Le extends Mt{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}static isEdgeView(t){if(t==null)return!1;if(t instanceof Le)return!0;const e=t[Symbol.toStringTag],n=t;return(e==null||e===Cu)&&typeof n.isNodeView=="function"&&typeof n.isEdgeView=="function"&&typeof n.confirmUpdate=="function"&&typeof n.update=="function"&&typeof n.getConnection=="function"}get[Symbol.toStringTag](){return Cu}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const n=this.cell.getSource();return new I(n.x,n.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new I(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const n=this.cell.getTarget();return new I(n.x,n.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new I(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}return this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","labels","tools"]),n):(n=this.handleAction(n,"update",()=>this.update(e)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(e)),n=this.handleAction(n,"tools",()=>this.renderTools()),n)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this.notify("view:render",{view:this}),this}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}customizeLabels(){if(this.labelContainer){const t=this.cell,e=t.labels;for(let n=0,s=e.length;n<s;n+=1){const o=e[n],r=this.labelCache[n],a=this.labelSelectors[n],l=this.graph.options.onEdgeLabelRendered;if(l){const c=l({edge:t,label:o,container:r,selectors:a});c&&(this.labelDestroyFn[n]=c)}}}}destroyCustomizeLabels(){const t=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let e=0,n=t.length;e<n;e+=1){const s=this.labelDestroyFn[e],o=this.labelCache[e],r=this.labelSelectors[e];s&&o&&r&&s({edge:this.cell,label:t[e],container:o,selectors:r})}this.labelDestroyFn={}}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let s=this.labelContainer;if(this.labelCache={},this.labelSelectors={},n<=0)return s&&s.parentNode&&s.parentNode.removeChild(s),this;s?this.empty(s):(s=ae("g"),this.addClass(this.prefixClassName("edge-labels"),s),this.labelContainer=s);for(let o=0,r=e.length;o<r;o+=1){const a=e[o],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,h;if(l)c=l.node,h=l.selectors;else{const d=t.getDefaultLabel(),f=this.normalizeLabelMarkup(this.parseLabelMarkup(d.markup));c=f.node,h=f.selectors}c.setAttribute("data-index",`${o}`),s.appendChild(c);const u=this.rootSelector;if(h[u])throw new Error("Ambiguous label root selector.");h[u]=c,this.labelCache[o]=c,this.labelSelectors[o]=h}return s.parentNode==null&&this.container.appendChild(s),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(t={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(e==null)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],s=n.length;if(s>1){const o=n[1];if(e[o]){if(s===2)return typeof t.propertyValue=="object"&&$i(t.propertyValue,"markup");if(n[2]!=="markup")return!1}}}return!0}parseLabelMarkup(t){return t?typeof t=="string"?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=K.createVectors(t),n=document.createDocumentFragment();for(let s=0,o=e.length;s<o;s+=1){const r=e[s].node;n.appendChild(r)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(t==null)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const s=e.childNodes;return s.length>1||s[0].nodeName.toUpperCase()!=="G"?n=K.create("g").append(e):n=K.create(s[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.labelContainer){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),s=t.getDefaultLabel();for(let o=0,r=e.length;o<r;o+=1){const a=this.labelCache[o],l=this.labelSelectors[o];a.setAttribute("cursor",n?"move":"default");const c=e[o],h=pt({},s.attrs,c.attrs);this.updateAttrs(a,h,{selectors:l,rootBBox:c.size?I.fromSize(c.size):void 0})}}}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}update(t={}){var e;this.cleanCache(),this.updateConnection(t);const n=this.cell.getAttrs(),{text:s}=n,o=_(n,["text"]);if(o!=null){if(((e=this.container)===null||e===void 0?void 0:e.tagName)==="g"&&this.isEdgeElement(this.container)&&oy){const r=this.container.parentNode;if(r){const a=this.container.nextSibling;r.removeChild(this.container),r.insertBefore(this.container,a)}}this.updateAttrs(this.container,o,{selectors:this.selectors})}return this.updateLabelPositions(),this.updateTools(t),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),s=[this.sourceAnchor,...n,this.targetAnchor],o=s.length,r=new xt(s);r.simplify({threshold:.01});const a=r.points.map(c=>c.toJSON()),l=a.length;return o===l?0:(e.setVertices(a.slice(1,l-1),t),o-l)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return A.create(this.sourceAnchor);case"target":return A.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return A.create(this.sourcePoint);case"target":return A.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const n=this.sourceView;return n?this.sourceMagnet||n.container:null}case"target":{if(e.raw)return this.targetMagnet;const n=this.targetView;return n?this.targetMagnet||n.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const n=t.tx||0,s=t.ty||0;this.routePoints=new xt(this.routePoints).translate(n,s).points,this.translateConnectionPoints(n,s),this.path.translate(n,s)}else{const n=e.getVertices(),s=this.findAnchors(n);this.sourceAnchor=s.source,this.targetAnchor=s.target,this.routePoints=this.findRoutePoints(n);const o=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=o.source,this.targetPoint=o.target;const r=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,r.source||this.sourcePoint,r.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,s=e.target,o=t[0],r=t[t.length-1];return s.priority&&!n.priority?this.findAnchorsOrdered("target",r,"source",o):this.findAnchorsOrdered("source",o,"target",r)}findAnchorsOrdered(t,e,n,s){let o,r;const a=this.cell,l=a[t],c=a[n],h=this.getTerminalView(t),u=this.getTerminalView(n),d=this.getTerminalMagnet(t),f=this.getTerminalMagnet(n);if(h){let m;e?m=A.create(e):u?m=f:m=A.create(c),o=this.getAnchor(l.anchor,h,d,m,t)}else o=A.create(l);if(u){const m=A.create(s||o);r=this.getAnchor(c.anchor,u,f,m,n)}else r=A.isPointLike(c)?A.create(c):new A;return{[t]:o,[n]:r}}getAnchor(t,e,n,s,o){const r=e.isEdgeElement(n),a=this.graph.options.connecting;let l=typeof t=="string"?{name:t}:t;if(!l){const u=r?(o==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(o==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof u=="string"?{name:u}:u}if(!l)throw new Error("Anchor should be specified.");let c;const h=l.name;if(r){const u=li.get(h);if(typeof u!="function")return li.onNotFound(h);c=F(u,this,e,n,s,l.args||{},o)}else{const u=di.get(h);if(typeof u!="function")return di.onNotFound(h);c=F(u,this,e,n,s,l.args||{},o)}return c?c.round(this.POINT_ROUNDING):new A}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||rr.normal,n=this.cell.getRouter()||e;let s;if(typeof n=="function")s=F(n,this,t,{},this);else{const o=typeof n=="string"?n:n.name,r=typeof n=="string"?{}:n.args||{},a=o?bi.get(o):rr.normal;if(typeof a!="function")return bi.onNotFound(o);s=F(a,this,t,r,this)}return s==null?t.map(o=>A.create(o)):s.map(o=>A.create(o))}findConnectionPoints(t,e,n){const s=this.cell,o=this.graph.options.connecting,r=s.getSource(),a=s.getTarget(),l=this.sourceView,c=this.targetView,h=t[0],u=t[t.length-1];let d;if(l&&!l.isEdgeElement(this.sourceMagnet)){const m=this.sourceMagnet||l.container,p=h||n,b=new z(p,e),y=r.connectionPoint||o.sourceConnectionPoint||o.connectionPoint;d=this.getConnectionPoint(y,l,m,b,"source")}else d=e;let f;if(c&&!c.isEdgeElement(this.targetMagnet)){const m=this.targetMagnet||c.container,p=a.connectionPoint||o.targetConnectionPoint||o.connectionPoint,b=u||e,y=new z(b,n);f=this.getConnectionPoint(p,c,m,y,"target")}else f=n;return{source:d,target:f}}getConnectionPoint(t,e,n,s,o){const r=s.end;if(t==null)return r;const a=typeof t=="string"?t:t.name,l=typeof t=="string"?{}:t.args,c=oi.get(a);if(typeof c!="function")return oi.onNotFound(a);const h=F(c,this,s,e,n,l||{},o);return h?h.round(this.POINT_ROUNDING):r}findMarkerPoints(t,e,n){const s=u=>{const d=this.cell.getAttrs(),f=Object.keys(d);for(let m=0,p=f.length;m<p;m+=1){const b=d[f[m]];if(b[`${u}Marker`]||b[`${u}-marker`]){const y=b.strokeWidth||b["stroke-width"];if(y)return parseFloat(y);break}}return null},o=t[0],r=t[t.length-1];let a,l;const c=s("source");c&&(a=e.clone().move(o||n,-c));const h=s("target");return h&&(l=n.clone().move(r||e,-h)),this.sourceMarkerPoint=a||e.clone(),this.targetMarkerPoint=l||n.clone(),{source:a,target:l}}findPath(t,e,n){const s=this.cell.getConnector()||this.graph.options.connecting.connector;let o,r,a;if(typeof s=="string"?o=s:(o=s.name,r=s.args),o){const c=ai.get(o);if(typeof c!="function")return ai.onNotFound(o);a=c}else a=fh.normal;const l=F(a,this,e,n,t,Object.assign(Object.assign({},r),{raw:!0}),this);return typeof l=="string"?j.parse(l):l}translateConnectionPoints(t,e){this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e),this.sourceMarkerPoint.translate(t,e),this.targetMarkerPoint.translate(t,e)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const e=this.cell,n=e.getLabels();if(n.length===0)return this;const s=e.getDefaultLabel(),o=this.normalizeLabelPosition(s.position);for(let r=0,a=n.length;r<a;r+=1){const l=n[r],c=this.labelCache[r];if(!c)continue;const h=this.normalizeLabelPosition(l.position),u=pt({},o,h),d=this.getLabelTransformationMatrix(u);c.setAttribute("transform",$n(d))}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,s=e[t],o=s&&s.cell,r=`${t}View`;if(!o)return this[r]=null,this.updateTerminalMagnet(t),!0;const a=n.getCellById(o);if(!a)throw new Error(`Edge's ${t} node with id "${o}" not exists`);const l=a.findView(n);return l?(this[r]=l,this.updateTerminalMagnet(t),!0):!1}updateTerminalMagnet(t){const e=`${t}Magnet`,n=this.getTerminalView(t);if(n){let s=n.getMagnetFromEdgeTerminal(this.cell[t]);s===n.container&&(s=null),this[e]=s}else this[e]=null}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&typeof e.position=="object"&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&typeof e.position=="object")return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&typeof t.position=="object")return t.position.options}mergeLabelPositionArgs(t,e){return t===null?null:t===void 0?e===null?null:e:pt({},e,t)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const t=this.cache.pathCache;return $i(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const t=this.cache.pathCache;return $i(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const t=this.cache.pathCache;return $i(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return this.path==null?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return this.path==null?null:(Ce(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return this.path==null?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return this.path==null?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return this.path==null?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return this.path==null?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return this.path==null?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,s){const o={distance:0};let r=0,a;typeof n=="number"?(r=n,a=s):a=n,a!=null&&(o.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),h=a&&a.absoluteDistance&&a.reverseDistance,u=this.path,d={segmentSubdivisions:this.getConnectionSubdivisions()},f=new A(t,e),m=u.closestPointT(f,d),p=this.getConnectionLength()||0;let b=u.lengthAtT(m,d);c&&(b=p>0?b/p:0),h&&(b=-1*(p-b)||1),o.distance=b;let y;l||(y=u.tangentAtT(m));let C;if(y)C=y.pointOffset(f);else{const w=u.pointAtT(m),x=f.diff(w);C={x:x.x,y:x.y}}return o.offset=C,o.angle=r,o}normalizeLabelPosition(t){return typeof t=="number"?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},s=e.angle||0,o=e.distance,r=o>0&&o<=1;let a=0;const l={x:0,y:0},c=e.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const h=l.x!==0||l.y!==0||a===0,u=n.keepGradient,d=n.ensureLegibility,f=this.path,m={segmentSubdivisions:this.getConnectionSubdivisions()},p=r?o*this.getConnectionLength():o,b=f.tangentAtLength(p,m);let y,C=s;if(b){if(h)y=b.start,y.translate(l);else{const w=b.clone();w.rotate(-90,b.start),w.setLength(a),y=w.end}u&&(C=b.angle()+s,d&&(C=Qt((C+90)%180-90)))}else y=f.start,h&&y.translate(l);return Et().translate(y.x,y.y).rotate(C)}getVertexIndex(t,e){const s=this.cell.getVertices(),o=this.getClosestPointLength(new A(t,e));let r=0;if(o!=null)for(const a=s.length;r<a;r+=1){const l=s[r],c=this.getClosestPointLength(l);if(c!=null&&o<c)break}return r}getEventArgs(t,e,n){const s=this,o=s.cell,r=o;return e==null||n==null?{e:t,view:s,edge:o,cell:r}:{e:t,x:e,y:n,view:s,edge:o,cell:r}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const s=this.getEventData(t);switch(s.action){case"drag-label":{this.dragLabel(t,e,n);break}case"drag-arrowhead":{this.dragArrowhead(t,e,n);break}case"drag-edge":{this.dragEdge(t,e,n);break}}return this.notifyMouseMove(t,e,n),s}onMouseUp(t,e,n){const s=this.getEventData(t);switch(s.action){case"drag-label":{this.stopLabelDragging(t,e,n);break}case"drag-arrowhead":{this.stopArrowheadDragging(t,e,n);break}case"drag-edge":{this.stopEdgeDragging(t,e,n);break}}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),s}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,s){super.onMouseWheel(t,e,n,s),this.notify("edge:mousewheel",Object.assign({delta:s},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,s){if(ec(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if(e==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,s)))}this.notifyMouseDown(t,n,s)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,s))),super.onCustomEvent(t,e,n,s)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n),this.getEventData(t).stopPropagation&&t.stopPropagation()}startEdgeDragging(t,e,n){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(t,e,n);return}this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"})}dragEdge(t,e,n){const s=this.getEventData(t);s.moving||(s.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-s.x,n-s.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,n){const s=this.getEventData(t);s.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),s.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),s={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:e.isNewEdge===!0,terminalType:t,initialMagnet:n,initialTerminal:lo(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(s),s}createValidateConnectionArgs(t){const e=[];e[4]=t,e[5]=this;let n,s=0,o=0;t==="source"?(s=2,n="target"):(o=2,n="source");const r=this.cell[n],a=r.cell;if(a){let l;const c=e[s]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(r),l===c.container&&(l=void 0)),e[s+1]=l}return(l,c)=>(e[o]=l,e[o+1]=l.container===c?void 0:c,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){t.zIndex!=null&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}validateConnection(t,e,n,s,o,r,a){const l=this.graph.options.connecting,c=l.allowLoop,h=l.allowNode,u=l.allowEdge,d=l.allowPort,f=l.allowMulti,m=l.validateConnection,p=r?r.cell:null,b=o==="target"?n:t,y=o==="target"?s:e;let C=!0;const w=x=>{const E=o==="source"?a?a.port:null:p?p.getSourcePortId():null,S=o==="target"?a?a.port:null:p?p.getTargetPortId():null;return F(x,this.graph,{edge:p,edgeView:r,sourceView:t,targetView:n,sourcePort:E,targetPort:S,sourceMagnet:e,targetMagnet:s,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:o})};if(c!=null&&(typeof c=="boolean"?!c&&t===n&&(C=!1):C=w(c)),C&&d!=null&&(typeof d=="boolean"?!d&&y&&(C=!1):C=w(d)),C&&u!=null&&(typeof u=="boolean"?!u&&Le.isEdgeView(b)&&(C=!1):C=w(u)),C&&h!=null&&y==null&&(typeof h=="boolean"?!h&&$t.isNodeView(b)&&(C=!1):C=w(h)),C&&f!=null&&r){const x=r.cell,E=o==="source"?a:x.getSource(),S=o==="target"?a:x.getTarget(),v=a?this.graph.getCellById(a.cell):null;if(E&&S&&E.cell&&S.cell&&v)if(typeof f=="function")C=w(f);else{const M=this.graph.model.getConnectedEdges(v,{outgoing:o==="source",incoming:o==="target"});M.length&&(f==="withPort"?M.some(T=>{const P=T.getSource(),R=T.getTarget();return P&&R&&P.cell===E.cell&&R.cell===S.cell&&P.port!=null&&P.port===E.port&&R.port!=null&&R.port===S.port})&&(C=!1):f||M.some(T=>{const P=T.getSource(),R=T.getTarget();return P&&R&&P.cell===E.cell&&R.cell===S.cell})&&(C=!1))}}return C&&m!=null&&(C=w(m)),C}allowConnectToBlank(t){const e=this.graph,s=e.options.connecting.allowBlank;if(typeof s!="function")return!!s;const o=e.findViewByCell(t),r=t.getSourceCell(),a=t.getTargetCell(),l=e.findViewByCell(r),c=e.findViewByCell(a);return F(s,e,{edge:t,edgeView:o,sourceCell:r,targetCell:a,sourceView:l,targetView:c,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:o.sourceMagnet,targetMagnet:o.targetMagnet})}validateEdge(t,e,n){const s=this.graph;if(!this.allowConnectToBlank(t)){const r=t.getSourceCellId(),a=t.getTargetCellId();if(!(r&&a))return!1}const o=s.options.connecting.validateEdge;return o?F(o,s,{edge:t,type:e,previous:n}):!0}arrowheadDragging(t,e,n,s){s.x=e,s.y=n,s.currentTarget!==t&&(s.currentMagnet&&s.currentView&&s.currentView.unhighlight(s.currentMagnet,{type:"magnetAdsorbed"}),s.currentView=this.graph.findViewByElem(t),s.currentView?(s.currentMagnet=s.currentView.findMagnet(t),s.currentMagnet&&this.validateConnection(...s.getValidateConnectionArgs(s.currentView,s.currentMagnet),s.currentView.getEdgeTerminal(s.currentMagnet,e,n,this.cell,s.terminalType))?s.currentView.highlight(s.currentMagnet,{type:"magnetAdsorbed"}):s.currentMagnet=null):s.currentMagnet=null),s.currentTarget=t,this.cell.prop(s.terminalType,{x:e,y:n},Object.assign(Object.assign({},s.options),{ui:!0}))}arrowheadDragged(t,e,n){const s=t.currentView,o=t.currentMagnet;if(!o||!s)return;s.unhighlight(o,{type:"magnetAdsorbed"});const r=t.terminalType,a=s.getEdgeTerminal(o,e,n,this.cell,r);this.cell.setTerminal(r,a,{ui:!0})}snapArrowhead(t,e,n){const s=this.graph,{snap:o,allowEdge:r}=s.options.connecting,a=typeof o=="object"&&o.radius||50,l=typeof o=="object"&&o.anchor||"center",c=s.renderer.findViewsInArea({x:t-a,y:e-a,width:2*a,height:2*a},{nodeOnly:!0});if(r){const x=s.renderer.findEdgeViewsFromPoint({x:t,y:e},a).filter(E=>E!==this);c.push(...x)}const h=n.closestView||null,u=n.closestMagnet||null;n.closestView=null,n.closestMagnet=null;let d,f=Number.MAX_SAFE_INTEGER;const m=new A(t,e);c.forEach(x=>{if(x.container.getAttribute("magnet")!=="false"){if(x.isNodeView())d=l==="center"?x.cell.getBBox().getCenter().distance(m):x.cell.getBBox().getNearestPointToPoint(m).distance(m);else if(x.isEdgeView()){const E=x.getClosestPoint(m);E?d=E.distance(m):d=Number.MAX_SAFE_INTEGER}d<a&&d<f&&(u===x.container||this.validateConnection(...n.getValidateConnectionArgs(x,null),x.getEdgeTerminal(x.container,t,e,this.cell,n.terminalType)))&&(f=d,n.closestView=x,n.closestMagnet=x.container)}x.container.querySelectorAll("[magnet]").forEach(E=>{if(E.getAttribute("magnet")!=="false"){const S=x.getBBoxOfElement(E);d=m.distance(S.getCenter()),d<a&&d<f&&(u===E||this.validateConnection(...n.getValidateConnectionArgs(x,E),x.getEdgeTerminal(E,t,e,this.cell,n.terminalType)))&&(f=d,n.closestView=x,n.closestMagnet=E)}})});let p;const b=n.terminalType,y=n.closestView,C=n.closestMagnet,w=u!==C;if(h&&w&&h.unhighlight(u,{type:"magnetAdsorbed"}),y){if(!w)return;y.highlight(C,{type:"magnetAdsorbed"}),p=y.getEdgeTerminal(C,t,e,this.cell,b)}else p={x:t,y:e};this.cell.setTerminal(b,p,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,s=t.initialTerminal,o=this.cell[n];if(o&&!At.equalTerminals(s,o)){const a=this.graph,l=s,c=l.cell?a.getCellById(l.cell):null,h=l.port,u=c?a.findViewByCell(c):null,d=c||t.isNewEdge?null:A.create(s).toJSON(),f=o,m=f.cell?a.getCellById(f.cell):null,p=f.port,b=m?a.findViewByCell(m):null,y=m?null:A.create(o).toJSON();this.notify("edge:connected",{e,previousCell:c,previousPort:h,previousView:u,previousPoint:d,currentCell:m,currentView:b,currentPort:p,currentPoint:y,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let s=0,o=n.length;s<o;s+=1){const r=e.findViewByCell(n[s]);if(!r||r.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(r.container.querySelectorAll("[magnet]"));r.container.getAttribute("magnet")!=="false"&&a.push(r.container);const l=a.filter(c=>this.validateConnection(...t.getValidateConnectionArgs(r,c),r.getEdgeTerminal(c,t.x,t.y,this.cell,t.terminalType)));if(l.length>0){for(let c=0,h=l.length;c<h;c+=1)r.highlight(l[c],{type:"magnetAvailable"});r.highlight(null,{type:"nodeAvailable"}),t.marked[r.cell.id]=l}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(n=>{const s=this.graph.findViewByCell(n);s&&(e[n].forEach(r=>{s.unhighlight(r,{type:"magnetAvailable"})}),s.unhighlight(null,{type:"nodeAvailable"}))}),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(t,e,n);return}const o=t.target.getAttribute("data-terminal"),r=this.prepareArrowheadDragging(o,{x:e,y:n});this.setEventData(t,r)}dragArrowhead(t,e,n){const s=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,s):this.arrowheadDragging(this.getEventTarget(t),e,n,s)}stopArrowheadDragging(t,e,n){const s=this.graph,o=this.getEventData(t);s.options.connecting.snap?this.snapArrowheadEnd(o):this.arrowheadDragged(o,e,n),this.validateEdge(this.cell,o.terminalType,o.initialTerminal)?(this.finishEmbedding(o),this.notifyConnectionEvent(o,t)):this.fallbackConnection(o),this.afterArrowheadDragging(o)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const s=t.currentTarget,o=parseInt(s.getAttribute("data-index"),10),r=this.getLabelPositionAngle(o),a=this.getLabelPositionArgs(o),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(t,{index:o,positionAngle:r,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const s=this.getEventData(t),o=this.cell.getLabelAt(s.index),r=pt({},o,{position:this.getLabelPosition(e,n,s.positionAngle,s.positionArgs)});this.cell.setLabelAt(s.index,r)}stopLabelDragging(t,e,n){}}const Cu=`X6.${Le.name}`;Le.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),Le.registry.register("edge",Le,!0);const En={idle:"idle",raf:"raf",timeout:"timeout"};class qC{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=16,this.initialTime=Date.now(),this.pendingJobs=new Map,this.scheduleMode=null}queueJob(t){if(t.priority&Ee.PRIOR)t.cb();else{const e=this.pendingJobs.get(t.id);if(e){if(e.cb=t.cb,t.priority!==e.priority){e.priority=t.priority;const n=this.queue.indexOf(e);if(n>=0){this.queue.splice(n,1);const s=this.findInsertionIndex(e);this.queue.splice(s,0,e)}}}else{const n=this.findInsertionIndex(t);this.queue.splice(n,0,t),this.pendingJobs.set(t.id,t)}}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.pendingJobs.clear(),this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(t){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let n=this.frameInterval;if(t&&typeof t.timeRemaining=="function"){const s=t.timeRemaining();n=Math.max(0,Math.min(n,s))}for(;this.queue.length>0;){const s=this.queue.shift();if(s.cb(),this.pendingJobs.delete(s.id),this.getCurrentTime()-e>=n)break}this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){for(this.isFlushPending=!1,this.isFlushing=!0;this.queue.length>0;){const t=this.queue.shift();try{t.cb()}catch(e){console.error(e)}this.pendingJobs.delete(t.id)}this.isFlushing=!1}findInsertionIndex(t){let e=0,n=this.queue.length,s=n-1;const o=t.priority;for(;e<=s;){const r=(s-e>>1)+e;o<=this.queue[r].priority?e=r+1:(n=r,s=r-1)}return n}scheduleJob(){this.scheduleId&&this.cancelScheduleJob(),"requestAnimationFrame"in window?(this.scheduleMode=En.raf,this.scheduleId=window.requestAnimationFrame(()=>this.flushJobs())):"requestIdleCallback"in window?(this.scheduleMode=En.idle,this.scheduleId=window.requestIdleCallback(t=>this.flushJobs(t),{timeout:100})):(this.scheduleMode=En.timeout,this.scheduleId=window.setTimeout(()=>this.flushJobs()))}cancelScheduleJob(){if(!this.scheduleId)return;const t={[En.idle]:window==null?void 0:window.cancelIdleCallback,[En.raf]:window==null?void 0:window.cancelAnimationFrame,[En.timeout]:window==null?void 0:window.clearTimeout},e=this.scheduleMode,n=e?t[e]:void 0;typeof n=="function"&&n(this.scheduleId),this.scheduleId=0,this.scheduleMode=null}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Ee;(function(i){i[i.Update=2]="Update",i[i.RenderEdge=4]="RenderEdge",i[i.RenderNode=8]="RenderNode",i[i.PRIOR=1048576]="PRIOR"})(Ee||(Ee={}));const XC="#insert";var ge;(function(i){i[i.CREATED=0]="CREATED",i[i.MOUNTED=1]="MOUNTED",i[i.WAITING=2]="WAITING"})(ge||(ge={}));class Au extends Cn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(t){super(),this.views={},this.willRemoveViews={},this.queue=new qC,this.graph=t,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:t,previous:e}){let n=this.model.getCells();if(!(t!=null&&t.diff))this.queue.clearJobs(),this.removeZPivots(),this.resetViews();else{const s=new Set(e);n=n.filter(o=>!s.has(o))}this.renderViews(n,Object.assign(Object.assign({},t),{queue:n.map(s=>s.id)}))}onCellAdded({cell:t,options:e}){this.renderViews([t],e)}onCellRemoved({cell:t}){this.removeViews([t])}onCellZIndexChanged({cell:t,options:e}){const n=this.views[t.id];n&&this.requestViewUpdate(n.view,De,e,Ee.Update,!0)}onCellVisibleChanged({cell:t,current:e}){this.toggleVisible(t,!!e)}requestViewUpdate(t,e,n={},s=Ee.Update,o=!0){const r=t.cell.id,a=this.views[r];if(!a)return;a.flag=e,a.options=n,(t.hasAction(e,["translate","resize","rotate"])||n.async===!1)&&(s=Ee.PRIOR,o=!1);const c=e&De?`${r}${XC}`:r;this.queue.queueJob({id:c,priority:s,cb:()=>{this.renderViewInArea(t,e,n);const u=n.queue;if(u){const d=u.indexOf(t.cell.id);d>=0&&u.splice(d,1),u.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(t).forEach(u=>{this.requestViewUpdate(u.view,u.flag,n,s,!1)}),o&&this.flush()}setRenderArea(t){this.renderArea=t,Object.values(this.views).forEach(e=>{if(!e)return;const{view:n}=e;e.state===ge.MOUNTED&&(this.isUpdatable(n)||(n.remove(),this.graph.trigger("view:unmounted",{view:n}),e.state=ge.WAITING,e.flag|=De|n.getBootstrapFlag()))}),this.flushWaitingViews()}isViewMounted(t){if(t==null)return!1;const e=this.views[t.cell.id];return e?e.state===ge.MOUNTED:!1}renderViews(t,e={}){t.sort((n,s)=>n.isNode()&&s.isEdge()?-1:0),t.forEach(n=>{const s=n.id,o=this.views;let r=0,a=o[s];if(a)r=De;else{const l=this.createCellView(n);l&&(l.graph=this.graph,r=De|l.getBootstrapFlag(),a={view:l,flag:r,options:e,state:ge.CREATED},this.views[s]=a)}a&&this.requestViewUpdate(a.view,r,e,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(t,e,n={}){const s=t.cell,o=s.id,r=this.views[o];if(!r)return;let a=0;this.isUpdatable(t)?(a=this.updateView(t,e,n),r.flag=a):(r.state===ge.MOUNTED&&(t.remove(),this.graph.trigger("view:unmounted",{view:t}),a=0),r.state=ge.WAITING,r.flag=e|De|t.getBootstrapFlag()),a&&s.isEdge()&&!(a&t.getFlag(["source","target"]))&&this.queue.queueJob({id:o,priority:Ee.RenderEdge,cb:()=>{this.updateView(t,e,n)}})}removeViews(t){t.forEach(e=>{const n=e.id,s=this.views[n];s&&(this.willRemoveViews[n]=s,delete this.views[n],this.queue.queueJob({id:n,priority:this.getRenderPriority(s.view),cb:()=>{this.removeView(s.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(t=>{if(t&&t.state===ge.WAITING){const{view:e,flag:n,options:s}=t;this.requestViewUpdate(e,n,s,this.getRenderPriority(e),!1)}}),this.flush()}updateView(t,e,n={}){if(t==null)return 0;if(Mt.isCellView(t)){if(e&WC)return this.removeView(t.cell),0;e&De&&(this.insertView(t),e^=De)}return e?t.confirmUpdate(e,n):0}insertView(t){const e=this.views[t.cell.id];if(e){const n=t.cell.getZIndex(),s=this.addZPivot(n);this.container.insertBefore(t.container,s),t.cell.isVisible()||this.toggleVisible(t.cell,!1),e.state=ge.MOUNTED,this.graph.trigger("view:mounted",{view:t})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(t=>{t&&this.removeView(t.view)}),this.views={},this.willRemoveViews={}}removeView(t){const e=t.cell,n=this.willRemoveViews[e.id];n&&t&&(n.view.remove(),delete this.willRemoveViews[e.id],this.graph.trigger("view:unmounted",{view:t}))}toggleVisible(t,e){const n=this.model.getConnectedEdges(t);for(let o=0,r=n.length;o<r;o+=1){const a=n[o];if(e){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const s=this.views[t.id];s&&nt(s.view.container,{display:e?"unset":"none"})}addZPivot(t=0){this.zPivots==null&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment(`z-index:${t+1}`);let s=-1/0;for(const r in e){const a=+r;a<t&&a>s&&(s=a)}const o=this.container;if(s!==-1/0){const r=e[s];o.insertBefore(n,r.nextSibling)}else o.insertBefore(n,o.firstChild);return n}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),this.zPivots={}}createCellView(t){const e={graph:this.graph},n=this.graph.options.createCellView;if(n){const o=F(n,this.graph,t);if(o)return new o(t,e);if(o===null)return null}const s=t.view;if(s!=null&&typeof s=="string"){const o=Mt.registry.get(s);return o?new o(t,e):Mt.registry.onNotFound(s)}return t.isNode()?new $t(t,e):t.isEdge()?new Le(t,e):null}getEffectedEdges(t){const e=[],n=t.cell,s=this.model.getConnectedEdges(n);for(let o=0,r=s.length;o<r;o+=1){const a=s[o],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const h=["update"];a.getTargetCell()===n&&h.push("target"),a.getSourceCell()===n&&h.push("source"),e.push({id:a.id,view:c,flag:c.getFlag(h)})}return e}isUpdatable(t){if(t.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(t.cell.getBBox()):!0;if(t.isEdgeView()){const e=t.cell,n=this.renderArea?this.renderArea.isIntersectWithRect(e.getBBox()):!0;if(this.graph.virtualRender.isVirtualEnabled())return n;const s=e.getSourceCell(),o=e.getTargetCell();if(this.renderArea&&s&&o)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(o.getBBox())}return!0}getRenderPriority(t){return t.cell.isNode()?Ee.RenderNode:Ee.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(t=>{this.views[t].view.dispose()}),this.views={}}}X([$()],Au.prototype,"dispose",null);class xu extends Xt{constructor(){super(...arguments),this.schedule=new Au(this.graph)}requestViewUpdate(t,e,n={}){this.schedule.requestViewUpdate(t,e,n)}isViewMounted(t){return this.schedule.isViewMounted(t)}setRenderArea(t){this.schedule.setRenderArea(t)}findViewByElem(t){if(t==null)return null;const e=this.options.container,n=typeof t=="string"?e.querySelector(t):t instanceof Element?t:t[0];if(n){const s=this.graph.view.findAttr("data-cell-id",n);if(s){const o=this.schedule.views;if(o[s])return o[s].view}}return null}findViewByCell(t){if(t==null)return null;const e=q.isCell(t)?t.id:t,n=this.schedule.views;return n[e]?n[e].view:null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(n=>this.findViewByCell(n)).filter(n=>n!=null?de(n.container,{target:this.view.stage}).containsPoint(e):!1)}findEdgeViewsFromPoint(t,e=5){return this.model.getEdges().map(n=>this.findViewByCell(n)).filter(n=>{if(n!=null){const s=n.getClosestPoint(t);if(s)return s.distance(t)<=e}return!1})}findViewsInArea(t,e={}){const n=I.create(t);return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>{if(s){if(e.nodeOnly&&!s.isNodeView())return!1;const o=de(s.container,{target:this.view.stage});return o.width===0?o.inflate(1,0):o.height===0&&o.inflate(0,1),e.strict?n.containsRect(o):n.isIntersectWithRect(o)}return!1})}dispose(){this.schedule.dispose()}}X([$()],xu.prototype,"dispose",null);class mr extends Xt{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const s=this.graph.transform.getScale(),o=this.graph.translate();if(typeof n=="object"){const r=o.tx+s.sx*(n.x||0),a=o.ty+s.sy*(n.y||0);n=`${r}px ${a}px`}typeof e=="object"&&(e=I.fromSize(e).scale(s.sx,s.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const n=this.optionsCache;if(n&&n.image!==e.image)return;let s;const o=e.opacity,r=e.size;let a=e.repeat||"no-repeat";const l=fs.get(a);if(typeof l=="function"){const h=e.quality||1;t.width*=h,t.height*=h;const u=l(t,e);if(!(u instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");s=u.toDataURL("image/png"),e.repeat&&a!==e.repeat?a=e.repeat:a="repeat",typeof r=="object"?(r.width*=u.width/t.width,r.height*=u.height/t.height):r===void 0&&(e.size={width:u.width/h,height:u.height/h})}else s=t.src,r===void 0&&(e.size={width:t.width,height:t.height});n!=null&&typeof e.size=="object"&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=lo(e.size));const c=this.elem.style;c.backgroundImage=`url(${s})`,c.backgroundRepeat=a,c.opacity=o==null||o>=1?"":`${o}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=lo(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}X([$()],mr.prototype,"dispose",null);class $C extends Xt{getClientMatrix(){return Et(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new A(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return(typeof t=="number"?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=A.create(t,e);return xe(n,this.graph.matrix())}localToClientPoint(t,e){const n=A.create(t,e);return xe(n,this.getClientMatrix())}localToPagePoint(t,e){return(typeof t=="number"?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,n,s){const o=I.create(t,e,n,s);return qt(o,this.graph.matrix())}localToClientRect(t,e,n,s){const o=I.create(t,e,n,s);return qt(o,this.getClientMatrix())}localToPageRect(t,e,n,s){return(typeof t=="number"?this.localToGraphRect(t,e,n,s):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=A.create(t,e);return xe(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=A.create(t,e);return xe(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=A.create(t,e);return xe(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const s=A.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(s)}graphToLocalRect(t,e,n,s){const o=I.create(t,e,n,s);return qt(o,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,s){const o=I.create(t,e,n,s);return qt(o,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,s){const o=I.create(t,e,n,s);return qt(o,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,s){const o=I.create(t,e,n,s),r=this.getPageOffset();return o.x-=r.x,o.y-=r.y,this.graphToLocalRect(o)}}const ZC=`.x6-graph {
|
|
87
87
|
position: relative;
|
|
88
88
|
overflow: hidden;
|
|
89
89
|
outline: none;
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
border: 1px solid #275fc5;
|
|
244
244
|
border-radius: 2px;
|
|
245
245
|
}
|
|
246
|
-
`;class du extends _t{init(){Me("core",Lw)}dispose(){Be("core")}}H([_()],du.prototype,"dispose",null);class zw extends _t{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return this.svg.getElementById(t)!=null}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${Mo(JSON.stringify(t))}`),!this.isDefined(e)){const i=oi.get(n);if(i==null)return oi.onNotFound(n);const o=i(t.args||{}),r=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});L.create(Tt.sanitize(o),r).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Mo(JSON.stringify(t))}`),!this.isDefined(e)){const o=t.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),r=`<${n}>${o.join("")}</${n}>`,a=Object.assign({id:e},t.attrs);L.create(r,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:i,markerUnits:o,markerOrient:r,tagName:a,children:l}=t,c=V(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Mo(JSON.stringify(t))}`),!this.isDefined(h)){a!=="path"&&delete c.d;const u=L.create("marker",{refX:n,refY:i,id:h,overflow:"visible",orient:r??"auto",markerUnits:o||"userSpaceOnUse"},l?l.map(d=>{var{tagName:f}=d,p=V(d,["tagName"]);return L.create(`${f}`||"path",Gn(Object.assign(Object.assign({},c),p)))}):[L.create(a||"path",Gn(c))]);this.defs.appendChild(u.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}class gu extends _t{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),i=this.getInstance(),o=Array.isArray(t)?t:[t];this.patterns.forEach((l,c)=>{const h=`pattern_${c}`,u=n.a||1,d=n.d||1,{update:f,markup:p}=l,m=V(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},m),o[c]),{sx:u,sy:d,ox:n.e||0,oy:n.f||0,width:e*u,height:e*d});i.has(h)||i.add(h,L.create("pattern",{id:h,patternUnits:"userSpaceOnUse"},L.createVectors(p)).node);const y=i.get(h);typeof f=="function"&&f(y.childNodes[0],b);let C=b.ox%b.width;C<0&&(C+=b.width);let A=b.oy%b.height;A<0&&(A+=b.height),j(y,{x:C,y:A,width:b.width,height:b.height})});const r=new XMLSerializer().serializeToString(i.root),a=`url(data:image/svg+xml;base64,${btoa(r)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new Q2),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(e==null)return[Object.assign(Object.assign({},rh.dot),t.args)];const n=ri.get(e);if(n){let i=t.args||[];return Array.isArray(i)||(i=[i]),Array.isArray(n)?n.map((o,r)=>Object.assign(Object.assign({},o),i[r])):[Object.assign(Object.assign({},n),i[0])]}return ri.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}H([_()],gu.prototype,"dispose",null);class fu extends _t{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const i=this.resolveHighlighter(n);if(!i)return;const o=this.getHighlighterId(e,i);if(!this.highlights[o]){const r=i.highlighter;r.highlight(t,e,Object.assign({},i.args)),this.highlights[o]={cellView:t,magnet:e,highlighter:r,args:i.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const i=this.getHighlighterId(t,n);this.unhighlight(i)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(n==null){const a=t.type;n=a&&e.highlighting[a]||e.highlighting.default}if(n==null)return null;const i=typeof n=="string"?{name:n}:n,o=i.name,r=ai.get(o);return r==null?ai.onNotFound(o):(j2(o,r),{name:o,highlighter:r,args:i.args||{}})}getHighlighterId(t,e){return bo(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}H([_()],fu.prototype,"dispose",null);class pu extends _t{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Sc(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(t){(this.disabled||t)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=this.widgetOptions.guard;return(e==null||e(t))&&Te(t,this.widgetOptions.modifiers)}onMouseWheel(t){const e=this.widgetOptions.guard;if((e==null||e(t))&&Te(t,this.widgetOptions.modifiers)){const n=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.transform.getScale().sx),t.deltaY<0?(this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*n*20)/20/this.currentScale,this.cumulatedFactor<=1&&(this.cumulatedFactor=1.05)):(this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/n)*20)/20/this.currentScale,this.cumulatedFactor>=1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const o=this.currentScale;let r=this.graph.transform.clampScale(o*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(r=Ke(r,a,l),r!==o)if(this.widgetOptions.zoomAtMousePosition){const h=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(r,{absolute:!0,center:h.clone()})}else this.graph.zoom(r,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}H([_()],pu.prototype,"dispose",null);function Fw(s){const{grid:t,panning:e,mousewheel:n,embedding:i}=s,o=V(s,["grid","panning","mousewheel","embedding"]),r=s.container;if(r!=null)o.width==null&&(o.width=r.clientWidth),o.height==null&&(o.height=r.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const a=ct({},Uw,o),l={size:10,visible:!1};return typeof t=="number"?a.grid={size:t,visible:!1}:typeof t=="boolean"?a.grid=Object.assign(Object.assign({},l),{visible:t}):a.grid=Object.assign(Object.assign({},l),t),["panning","mousewheel","embedding"].forEach(h=>{const u=s[h];typeof u=="boolean"?a[h].enabled=u:u!=null&&(a[h]=Object.assign(Object.assign({},a[h]),u))}),a}const Uw={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!0,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:X.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:X.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:s,sourceView:t,targetView:e}){return(s==="target"?e:t)!=null},createEdge(){return new Ow}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1};class mu extends _t{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),nt.on(this.graph.container,"mousedown",this.onRightMouseDown),nt.on(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle=new Sc(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),nt.off(this.graph.container,"mousedown",this.onRightMouseDown),nt.off(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(t,e){return t.spaceKey=this.isSpaceKeyPressed,this.pannable&&Te(t,this.widgetOptions.modifiers,e)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(t),nt.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),nt.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(n,i)}stopPanning(t){this.panning=!1,this.updateClassName(t),nt.off(document.body,".panning"),nt.off(window,".panning")}updateClassName(t){const e=this.widgetOptions.eventTypes;if((e==null?void 0:e.length)===1&&e.includes("mouseWheel"))return;const n=this.view.container,i=this.view.prefixClassName("graph-panning"),o=this.view.prefixClassName("graph-pannable"),r=this.graph.getPlugin("selection"),a=r&&r.allowRubberband(t,!0),l=(e==null?void 0:e.includes("leftMouseDown"))&&!a;this.allowPanning(t??{},!0)||this.allowPanning(t??{})&&l?this.panning?(O(n,i),st(n,o)):(st(n,i),O(n,o)):this.panning||(st(n,i),st(n,o))}onMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.getPlugin("selection"),n=e&&e.allowRubberband(t,!0);(this.allowPanning(t,!0)||this.allowPanning(t)&&!n)&&this.startPanning(t)}onRightMouseDown(t){const e=this.widgetOptions.eventTypes;e!=null&&e.includes("rightMouseDown")&&t.button===2&&this.allowPanning(t,!0)&&this.startPanning(t)}onMouseWheel(t,e,n){this.graph.translateBy(-e,-n)}onKeyDown(t){t.which===32&&(this.isSpaceKeyPressed=!0),this.updateClassName(t)}onKeyUp(t){t.which===32&&(this.isSpaceKeyPressed=!1),this.updateClassName(t)}allowBlankMouseDown(t){const e=this.widgetOptions.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}allowMouseWheel(t){var e;return this.pannable&&!t.ctrlKey&&((e=this.widgetOptions.eventTypes)===null||e===void 0?void 0:e.includes("mouseWheel"))}autoPanning(t,e){const i=this.graph.getGraphArea();let o=0,r=0;t<=i.left+10&&(o=-10),e<=i.top+10&&(r=-10),t>=i.right-10&&(o=10),e>=i.bottom-10&&(r=10),(o!==0||r!==0)&&this.graph.translateBy(-o,-r)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}H([_()],mu.prototype,"dispose",null);class bu extends _t{getScroller(){const t=this.graph.getPlugin("scroller");return t&&t.options.enabled?t:null}getContainer(){const t=this.getScroller();return t?t.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const t=this.options.autoResize;if(t)return typeof t=="boolean"?this.getContainer()||void 0:t}init(){if(this.options.autoResize){const e=this.getSensorTarget();if(e){if(typeof ResizeObserver>"u")return;this.ro=new ResizeObserver(o=>{if(!o||o.length===0)return;const{width:r,height:a}=o[0].contentRect;this.resize(Math.round(r),Math.round(a))}),this.ro.observe(e);const n=e.offsetWidth,i=e.offsetHeight;this.resize(n,i)}}}resize(t,e){const n=this.getScroller();n?n.resize(t,e):this.graph.transform.resize(t,e)}dispose(){this.ro&&(this.ro.disconnect(),this.ro=void 0)}}H([_()],bu.prototype,"dispose",null);class Vw extends _t{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),wt(this.viewportMatrix)}setMatrix(t){const e=wt(t),n=_n(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=t===void 0?this.options.width:t,i=e===void 0?this.options.height:e;this.options.width=n,this.options.height=i,typeof n=="number"&&(n=Math.round(n)),typeof i=="number"&&(i=Math.round(i)),this.container.style.width=n==null?"":`${n}px`,this.container.style.height=i==null?"":`${i}px`;const o=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},o)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return be(t)||(t=this.container.clientWidth),be(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return t6(this.getMatrix())}scale(t,e=t,n=0,i=0,o=!0){if(t=this.clampScale(t),e=this.clampScale(e),o&&(n||i)){const a=this.getTranslation(),l=this.getScale(),c=n-(n-a.tx)*(t/l.sx),h=i-(i-a.ty)*(e/l.sy);(c!==a.tx||h!==a.ty)&&this.translate(c,h)}const r=this.getMatrix();return r.a=t,r.d=e,this.setMatrix(r),this.graph.trigger("scale",{sx:t,sy:e,ox:n,oy:i}),this}clampScale(t){const e=this.graph.options.scaling;return Ke(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,i=t;const o=this.getScale(),r=this.getComputedSize();let a=r.width/2,l=r.height/2;return e.absolute||(n+=o.sx,i+=o.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,i=Math.round(i/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),i=Math.min(e.maxScale,i)),e.minScale&&(n=Math.max(e.minScale,n),i=Math.max(e.minScale,i)),e.center&&(a=e.center.x,l=e.center.y),n=this.clampScale(n),i=this.clampScale(i),this.scale(n,i,a,l),this}getRotation(){return e6(this.getMatrix())}rotate(t,e,n){if(e==null||n==null){const o=he(this.stage);e=o.width/2,n=o.height/2}const i=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(i),this}getTranslation(){return n6(this.getMatrix())}translate(t,e){const n=this.getMatrix();n.e=t||0,n.f=e||0,this.setMatrix(n);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign({},i)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,i){if(typeof t=="object"){const A=t;t=A.gridWidth||1,e=A.gridHeight||1,n=A.padding||0,i=A}else t=t||1,e=e||1,n=n||0,i==null&&(i={});const o=ne(n),r=i.border||0,a=i.contentArea?I.create(i.contentArea):this.getContentArea(i);r>0&&a.inflate(r);const l=this.getScale(),c=this.getTranslation(),h=l.sx,u=l.sy;a.x*=h,a.y*=u,a.width*=h,a.height*=u;let d=Math.max(Math.ceil((a.width+a.x)/t),1)*t,f=Math.max(Math.ceil((a.height+a.y)/e),1)*e,p=0,m=0;(i.allowNewOrigin==="negative"&&a.x<0||i.allowNewOrigin==="positive"&&a.x>=0||i.allowNewOrigin==="any")&&(p=Math.ceil(-a.x/t)*t,p+=o.left,d+=p),(i.allowNewOrigin==="negative"&&a.y<0||i.allowNewOrigin==="positive"&&a.y>=0||i.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/e)*e,m+=o.top,f+=m),d+=o.right,f+=o.bottom,d=Math.max(d,i.minWidth||0),f=Math.max(f,i.minHeight||0),d=Math.min(d,i.maxWidth||Number.MAX_SAFE_INTEGER),f=Math.min(f,i.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),y=d!==b.width||f!==b.height;return(p!==c.tx||m!==c.ty)&&this.translate(p,m),y&&this.resize(d,f),new I(-p/h,-m/u,d/h,f/u)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,i;if(t.contentArea){const y=t.contentArea;n=this.graph.localToGraph(y),i=w.create(y)}else n=this.getContentBBox(t),i=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const o=ne(t.padding),r=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||r,c=t.maxScaleX||a,h=t.minScaleY||r,u=t.maxScaleY||a;let d;if(t.viewportArea)d=t.viewportArea;else{const y=this.getComputedSize(),C=this.getTranslation();d={x:C.tx,y:C.ty,width:y.width,height:y.height}}d=I.create(d).moveAndExpand({x:o.left,y:o.top,width:-o.left-o.right,height:-o.top-o.bottom});const f=this.getScale();let p=d.width/n.width*f.sx,m=d.height/n.height*f.sy;t.preserveAspectRatio!==!1&&(p=m=Math.min(p,m));const b=t.scaleGrid;if(b&&(p=b*Math.floor(p/b),m=b*Math.floor(m/b)),p=Ke(p,l,c),m=Ke(m,h,u),this.scale(p,m),e){const y=this.options,C=d.x-i.x*p-y.x,A=d.y-i.y*m-y.y;this.translate(C,A)}}getContentArea(t={}){return t.useCellGeometry!==!1?this.model.getAllCellsBBox()||new I:he(this.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=I.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=I.create(t),i=this.graph;e.contentArea=n,e.viewportArea==null&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),i=this.getScale(),o=this.getTranslation(),r=n.width/2,a=n.height/2;t=typeof t=="number"?t:r,e=typeof e=="number"?e:a,t=r-t*i.sx,e=a-e*i.sy,(o.tx!==t||o.ty!==e)&&this.translate(t,e)}centerContent(t){const n=this.graph.getContentArea(t).getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const i=this.getComputedSize();e=Vt(e,Math.max(0,i.width)),e<0&&(e=i.width+e),n=Vt(n,Math.max(0,i.height)),n<0&&(n=i.height+n);const o=this.getTranslation(),r=this.getScale(),a=e-t.x*r.sx,l=n-t.y*r.sy;(o.tx!==a||o.ty!==l)&&this.translate(a,l)}positionRect(t,e){const n=I.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}}const Qe=`${X.prefixCls}-graph`;class ve extends Ut{static snapshoot(t){const e=t.cloneNode();return t.childNodes.forEach(n=>{e.appendChild(n)}),()=>{for(Jn(t);t.attributes.length>0;)t.removeAttribute(t.attributes[0].name);for(let n=0,i=e.attributes.length;n<i;n+=1){const o=e.attributes[n];t.setAttribute(o.name,o.value)}e.childNodes.forEach(n=>{t.appendChild(n)})}}get disposeContainer(){return!1}get options(){return this.graph.options}constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Tt.parseJSONMarkup(ve.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=ve.snapshoot(this.container),O(this.container,this.prefixClassName("graph")),Mt(this.container,n),this.delegateEvents()}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return t.type==="mousedown"&&t.button===2||this.options.guard&&this.options.guard(t,e)?!0:t.data&&t.data.guarded!==void 0?t.data.guarded:!(e&&e.cell&&G.isCell(e.cell)||this.svg===t.target||this.container===t.target||this.svg.contains(t.target))}findView(t){return this.graph.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,i.x,i.y):this.graph.trigger("blank:dblclick",{e,x:i.x,y:i.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,i.x,i.y):this.graph.trigger("blank:click",{e,x:i.x,y:i.y})}}isPreventDefaultContextMenu(t){let e=this.options.preventDefaultContextMenu;return typeof e=="function"&&(e=D(e,this.graph,{view:t})),e}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(n)&&t.preventDefault(),this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,i.x,i.y):this.graph.trigger("blank:contextmenu",{e,x:i.x,y:i.y})}delegateDragEvents(t,e){t.data==null&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){return this.getEventData(t).mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&t.preventDefault();const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,i.x,i.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&t.preventDefault(),this.graph.trigger("blank:mousedown",{e,x:i.x,y:i.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY||(e.mouseMovedCount==null&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,e.mouseMovedCount<=this.options.moveThreshold))return;const o=this.normalizeEvent(t),r=this.graph.snapToGrid(o.clientX,o.clientY),a=e.currentView;a?a.onMouseMove(o,r.x,r.y):this.graph.trigger("blank:mousemove",{e:o,x:r.x,y:r.y}),this.setEventData(o,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),o=this.getEventData(t).currentView;if(o?o.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e,x:n.x,y:n.y}),!t.isPropagationStopped()){const r=new Ce(t,{type:"click",data:t.data});this.onClick(r)}t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e})}}onMouseOut(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseEnter(e)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseLeave(e)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=e.originalEvent,o=this.graph.snapToGrid(i.clientX,i.clientY),r=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));n?n.onMouseWheel(e,o.x,o.y,r):this.graph.trigger("blank:mousewheel",{e,delta:r,x:o.x,y:o.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const i=this.findView(e);if(i){const o=this.normalizeEvent(t);if(this.guard(o,i))return;const r=this.graph.snapToGrid(o.clientX,o.clientY);i.onCustomEvent(o,n,r.x,r.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,i=n.getAttribute("magnet");if(i&&i.toLowerCase()!=="false"){const o=this.findView(n);if(o){const r=this.normalizeEvent(t);if(this.guard(r,o))return;const a=this.graph.snapToGrid(r.clientX,r.clientY);D(e,this.graph,o,r,n,a.x,a.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(e,n,i,o,r)=>{e.onMagnetMouseDown(n,i,o,r)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(e,n,i,o,r)=>{e.onMagnetDblClick(n,i,o,r)})}onMagnetContextMenu(t){const e=this.findView(t.target);this.isPreventDefaultContextMenu(e)&&t.preventDefault(),this.handleMagnetEvent(t,(n,i,o,r,a)=>{n.onMagnetContextMenu(i,o,r,a)})}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const i=this.normalizeEvent(t);if(this.guard(i,n))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);n.onLabelMouseDown(i,o.x,o.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}ve.markup=[{ns:Ct.xhtml,tagName:"div",selector:"background",className:`${Qe}-background`},{ns:Ct.xhtml,tagName:"div",selector:"grid",className:`${Qe}-grid`},{ns:Ct.svg,tagName:"svg",selector:"svg",className:`${Qe}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":Ct.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${Qe}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${Qe}-svg-primer`},{tagName:"g",selector:"stage",className:`${Qe}-svg-stage`},{tagName:"g",selector:"decorator",className:`${Qe}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${Qe}-svg-overlay`}]}]}],ve.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${X.prefixCls}-cell`]:"onMouseEnter",[`mouseleave .${X.prefixCls}-cell`]:"onMouseLeave",[`mouseenter .${X.prefixCls}-cell-tools`]:"onMouseEnter",[`mouseleave .${X.prefixCls}-cell-tools`]:"onMouseLeave",[`mousedown .${X.prefixCls}-cell [event]`]:"onCustomEvent",[`touchstart .${X.prefixCls}-cell [event]`]:"onCustomEvent",[`mousedown .${X.prefixCls}-cell [data-event]`]:"onCustomEvent",[`touchstart .${X.prefixCls}-cell [data-event]`]:"onCustomEvent",[`dblclick .${X.prefixCls}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${X.prefixCls}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${X.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${X.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${X.prefixCls}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${X.prefixCls}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${X.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${X.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${X.prefixCls}-cell image`]:"onImageDragStart",[`mousedown .${X.prefixCls}-edge .${X.prefixCls}-edge-label`]:"onLabelMouseDown",[`touchstart .${X.prefixCls}-edge .${X.prefixCls}-edge-label`]:"onLabelMouseDown"},ve.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},H([_()],ve.prototype,"dispose",null);const yu=120;class Cu extends _t{init(){this.resetRenderArea=Qb(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}bindScrollerEvents(t){this.scrollerRef=t,typeof t.on=="function"&&(t.on("pan:start",this.resetRenderArea,this),t.on("panning",this.resetRenderArea,this),t.on("pan:stop",this.resetRenderArea,this));const e=t.container;e&&(this.scrollerScrollHandler=n=>{this.resetRenderArea()},nt.on(e,"scroll",this.scrollerScrollHandler))}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this);const t=this.graph.getPlugin("scroller");t&&this.bindScrollerEvents(t)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this),this.unbindScroller()}onScrollerReady(t){this.scrollerRef!==t&&(this.unbindScroller(),this.bindScrollerEvents(t),this.resetRenderArea())}unbindScroller(){if(this.scrollerRef){typeof this.scrollerRef.off=="function"&&(this.scrollerRef.off("pan:start",this.resetRenderArea,this),this.scrollerRef.off("panning",this.resetRenderArea,this),this.scrollerRef.off("pan:stop",this.resetRenderArea,this));const t=this.scrollerRef.container;t&&this.scrollerScrollHandler&&nt.off(t,"scroll",this.scrollerScrollHandler),this.scrollerRef=void 0,this.scrollerScrollHandler=void 0}}setVirtualEnabled(t){const e=this.options.virtual;if(typeof e=="object"){const n=e;this.options.virtual=Object.assign(Object.assign({},n),{enabled:t})}else this.options.virtual=t}enableVirtualRender(){this.setVirtualEnabled(!0),this.resetRenderArea()}disableVirtualRender(){this.setVirtualEnabled(!1),this.graph.renderer.setRenderArea(void 0)}isVirtualEnabled(){const t=this.options.virtual;return t!=null&&typeof t=="object"?t.enabled!==!1:!!t}getVirtualMargin(){const t=this.options.virtual;if(typeof t=="object"){const e=t.margin;return typeof e=="number"?e:yu}return yu}resetRenderArea(){if(this.isVirtualEnabled()){const e=this.graph.getGraphArea();if(e){const n=this.getVirtualMargin(),i=e.clone();i.inflate(n,n),this.graph.renderer.setRenderArea(i);return}}}dispose(){this.stopListening()}}H([_()],Cu.prototype,"dispose",null);class S extends Nt{static isGraph(t){if(t==null)return!1;if(t instanceof S)return!0;const e=t[Symbol.toStringTag];return e==null||e===S.toStringTag}static render(t,e){const n=t instanceof HTMLElement?new S({container:t}):new S(t);return e!=null&&n.fromJSON(e),n}get container(){return this.options.container}get[Symbol.toStringTag](){return S.toStringTag}constructor(t){super(),this.installedPlugins=new Set,this.options=Fw(t),this.css=new du(this),this.view=new ve(this),this.defs=new zw(this),this.coord=new Qw(this),this.transform=new Vw(this),this.highlight=new fu(this),this.grid=new gu(this),this.background=new lr(this),this.options.model?this.model=this.options.model:(this.model=new Kt,this.model.graph=this),this.renderer=new uu(this),this.panning=new mu(this),this.mousewheel=new pu(this),this.virtualRender=new Cu(this),this.size=new bu(this)}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(n=>vt.isNode(n)?n:this.createNode(n)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(n=>ft.isEdge(n)?n:this.createEdge(n)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,i,o){return this.model.getNodesInArea(t,e,n,i,o)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const i=typeof t=="string"?t:"update",o=typeof t=="string"?e:t,r=typeof e=="function"?n:e;this.startBatch(i,r);const a=o();return this.stopBatch(i,r),a}updateCellId(t,e){return this.model.updateCellId(t,e)}findView(t){return G.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return I.isRectangleLike(t)?this.findViewsInArea(t):w.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,i,o){const r=typeof t=="number"?{x:t,y:e,width:n,height:i}:t,a=typeof t=="number"?o:e;return this.renderer.findViewsInArea(r,a)}matrix(t){return typeof t>"u"?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){const n=this.getPlugin("scroller");return n?n.resize(t,e):this.transform.resize(t,e),this}scale(t,e=t,n=0,i=0){return typeof t>"u"?this.transform.getScale():(this.transform.scale(t,e,n,i),this)}zoom(t,e){const n=this.getPlugin("scroller");if(n){if(typeof t>"u")return n.zoom();n.zoom(t,e)}else{if(typeof t>"u")return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.getPlugin("scroller");return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.getPlugin("scroller");return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.getPlugin("scroller");return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return typeof t>"u"?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return typeof t>"u"?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),i=n.tx+t,o=n.ty+e;return this.translate(i,o)}getGraphArea(){var t;const e=this.getPlugin("scroller");if(e){const n=(t=e.getVisibleArea)===null||t===void 0?void 0:t.call(e);if(n)return n}return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,i){return this.transform.fitToContent(t,e,n,i)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.getPlugin("scroller");return i?i.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.getPlugin("scroller");return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.getPlugin("scroller");return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,i={}){const o=this.getPlugin("scroller");return o?o.positionPoint(t,e,n,i):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const i=this.getPlugin("scroller");return i?i.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const i=this.getPlugin("scroller");return i?i.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.getPlugin("scroller");return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,i){return I.isRectangleLike(t)?this.coord.pageToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.pageToLocalRect(t,e,n,i):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,i){return I.isRectangleLike(t)?this.coord.localToPageRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.localToPageRect(t,e,n,i):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,i){return I.isRectangleLike(t)?this.coord.clientToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.clientToLocalRect(t,e,n,i):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,i){return I.isRectangleLike(t)?this.coord.localToClientRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.localToClientRect(t,e,n,i):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,i){return I.isRectangleLike(t)?this.coord.localToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.localToGraphRect(t,e,n,i):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,i){return I.isRectangleLike(t)?this.coord.graphToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.graphToLocalRect(t,e,n,i):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,i){return I.isRectangleLike(t)?this.coord.clientToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof i=="number"?this.coord.clientToGraphRect(t,e,n,i):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.getPlugin("scroller");return n!=null&&(this.options.background==null||!e)?n.drawBackground(t,e):this.background.draw(t),this}clearBackground(t){const e=this.getPlugin("scroller");return e!=null&&(this.options.background==null||!t)?e.clearBackground(t):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return t==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.getPlugin("scroller");return t?t.isPannable():this.panning.pannable}enablePanning(){const t=this.getPlugin("scroller");return t?t.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.getPlugin("scroller");return t?t.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}handleScrollerPluginStateChange(t,e){t.name==="scroller"&&(e?this.virtualRender.onScrollerReady(t):this.virtualRender.unbindScroller())}use(t,...e){return this.installedPlugins.has(t)||(this.installedPlugins.add(t),t.init(this,...e),this.handleScrollerPluginStateChange(t,!0)),this}getPlugin(t){return Array.from(this.installedPlugins).find(e=>e.name===t)}getPlugins(t){return Array.from(this.installedPlugins).filter(e=>t.includes(e.name))}enablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(i=>{var o;(o=i==null?void 0:i.enable)===null||o===void 0||o.call(i),this.handleScrollerPluginStateChange(i,!0)}),this}disablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(i=>{var o;(o=i==null?void 0:i.disable)===null||o===void 0||o.call(i),this.handleScrollerPluginStateChange(i,!1)}),this}isPluginEnabled(t){var e;const n=this.getPlugin(t);return(e=n==null?void 0:n.isEnabled)===null||e===void 0?void 0:e.call(n)}disposePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(i=>{i.dispose(),this.handleScrollerPluginStateChange(i,!1),this.installedPlugins.delete(i)}),this}dispose(t=!0){t&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}S.toStringTag=`X6.${S.name}`,S.registerNode=vt.registry.register,S.registerEdge=ft.registry.register,S.registerView=xt.registry.register,S.registerAttr=ti.register,S.registerGrid=ri.register,S.registerFilter=oi.register,S.registerNodeTool=yi.register,S.registerEdgeTool=Ci.register,S.registerBackground=cs.register,S.registerHighlighter=ai.register,S.registerPortLayout=hi.register,S.registerPortLabelLayout=bs.register,S.registerMarker=$n.register,S.registerRouter=gi.register,S.registerConnector=ii.register,S.registerAnchor=li.register,S.registerEdgeAnchor=si.register,S.registerConnectionPoint=ei.register,S.unregisterNode=vt.registry.unregister,S.unregisterEdge=ft.registry.unregister,S.unregisterView=xt.registry.unregister,S.unregisterAttr=ti.unregister,S.unregisterGrid=ri.unregister,S.unregisterFilter=oi.unregister,S.unregisterNodeTool=yi.unregister,S.unregisterEdgeTool=Ci.unregister,S.unregisterBackground=cs.unregister,S.unregisterHighlighter=ai.unregister,S.unregisterPortLayout=hi.unregister,S.unregisterPortLabelLayout=bs.unregister,S.unregisterMarker=$n.unregister,S.unregisterRouter=gi.unregister,S.unregisterConnector=ii.unregister,S.unregisterAnchor=li.unregister,S.unregisterEdgeAnchor=si.unregister,S.unregisterConnectionPoint=ei.unregister,H([_()],S.prototype,"dispose",null);const cr="html",hr={};class wu extends vt{static register(t){const{shape:e,html:n,effect:i,inherit:o}=t,r=V(t,["shape","html","effect","inherit"]);if(!e)throw new Error("HTML.register should specify `shape` in config.");hr[e]={html:n,effect:i},S.registerNode(e,Object.assign({inherit:o||"html"},r),!0)}}wu.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Tt.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),vt.registry.register("html",wu,!0);class ur extends Wt{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:t}){const e=hr[this.cell.shape];if(e){const{effect:n}=e;(!n||n.includes(t))&&this.renderHTMLComponent()}}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,cr,()=>this.renderHTMLComponent())}renderHTMLComponent(){const t=this.selectors&&this.selectors.foContent;if(t){Jn(t);const e=hr[this.cell.shape];if(!e)return;let{html:n}=e;typeof n=="function"&&(n=n(this.cell)),n&&(typeof n=="string"?t.innerHTML=n:Mt(t,n))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}H([_()],ur.prototype,"dispose",null),ur.config({bootstrap:[cr],actions:{html:cr}}),Wt.registry.register("html-view",ur,!0),xn("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:Pw()},{selector:"image"}),wi.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(s){const{path:t}=s,e=V(s,["path"]);return t&&gn(e,"attrs/body/refD",t),e}});class dr extends wi{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return t==null?this.removePoints():this.setAttrByPath("body/refPoints",ru(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}dr.config({propHooks(s){const{points:t}=s,e=V(s,["points"]);if(t){const n=ru(t);n&&gn(e,"attrs/body/refPoints",n)}return e}}),xn("polygon",{},{parent:dr}),xn("polyline",{},{parent:dr}),xn("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});function Kw(s){return s?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:Ct.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}}const Jw={shape:"text-block",markup:[{tagName:"rect",selector:"body"},Kw(jb)],attrs:{body:Object.assign(Object.assign({},ou),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(s){const{text:t}=s,e=V(s,["text"]);return t&&gn(e,"attrs/label/text",t),e},attrHooks:{text:{set(s,{cell:t,view:e,refBBox:n,elem:i,attrs:o}){if(i instanceof HTMLElement)i.textContent=s;else{const r=o.style||{},a={text:s,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},r),c=Wc.textWrap;return D(c.set,this,a,{cell:t,view:e,elem:i,refBBox:n,attrs:l}),{fill:r.color||null}}},position(s,{refBBox:t,elem:e}){if(e instanceof SVGElement)return t.getCenter()}}}};wi.define(Jw);const gr=`${X.prefixCls}.clipboard.cells`;function jw(s){if(window.localStorage){const t=s.map(e=>e.toJSON());localStorage.setItem(gr,JSON.stringify(t))}}function Gw(){if(window.localStorage){const s=localStorage.getItem(gr),t=s?JSON.parse(s):[];if(t)return Kt.fromJSON(t)}}function Yw(){window.localStorage&&localStorage.removeItem(gr)}class Hw{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const o=(Kt.isModel(e)?e:e.model).cloneSubGraph(t,n);this.cells=co(Object.keys(o).map(r=>o[r]),r=>r.isEdge()?2:1),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n),(S.isGraph(e)?e.model:e).batchUpdate("cut",()=>{t.forEach(o=>o.remove())})}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:i,edgeProps:o,nodeProps:r}=n;let a=20,l=20;i&&(a=typeof i=="number"?i:i.dx,l=typeof i=="number"?i:i.dy),this.deserialize(n);const c=this.cells;c.forEach(u=>{u.model=null,u.removeProp("zIndex"),(a||l)&&u.translate(a,l),r&&u.isNode()&&u.prop(r),o&&u.isEdge()&&u.prop(o)});const h=S.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(c,t,e),c}serialize(t){t.useLocalStorage!==!1&&jw(this.cells)}deserialize(t){if(t.useLocalStorage){const e=Gw();e&&(this.cells=e)}}isEmpty(t={}){return t.useLocalStorage&&this.deserialize(t),this.cells.length<=0}clean(){this.options={},this.cells=[],Yw()}}S.prototype.isClipboardEnabled=function(){const s=this.getPlugin("clipboard");return s?s.isEnabled():!1},S.prototype.enableClipboard=function(){const s=this.getPlugin("clipboard");return s&&s.enable(),this},S.prototype.disableClipboard=function(){const s=this.getPlugin("clipboard");return s&&s.disable(),this},S.prototype.toggleClipboard=function(s){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(s),this},S.prototype.isClipboardEmpty=function(s){const t=this.getPlugin("clipboard");return t?t.isEmpty(s):!0},S.prototype.getCellsInClipboard=function(){const s=this.getPlugin("clipboard");return s?s.getCellsInClipboard():[]},S.prototype.cleanClipboard=function(){const s=this.getPlugin("clipboard");return s&&s.clean(),this},S.prototype.copy=function(s,t){const e=this.getPlugin("clipboard");return e&&e.copy(s,t),this},S.prototype.cut=function(s,t){const e=this.getPlugin("clipboard");return e&&e.cut(s,t),this},S.prototype.paste=function(s,t){const e=this.getPlugin("clipboard");return e?e.paste(s,t):[]};class Au extends Nt{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(t={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},t)}init(t){this.graph=t,this.clipboardImpl=new Hw,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}isEmpty(t={}){return this.clipboardImpl.isEmpty(t)}getCellsInClipboard(){return this.cells}clean(t){return(!this.disabled||t)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(t,e={}){return this.disabled||(this.clipboardImpl.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}cut(t,e={}){return this.disabled||(this.clipboardImpl.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}paste(t={},e=this.graph){return this.disabled?[]:this.clipboardImpl.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}get commonOptions(){const t=this.options,{enabled:e}=t;return V(t,["enabled"])}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.clean(!0),this.off()}}H([_()],Au.prototype,"dispose",null);function xu(s,t){var e=Object.keys(s);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(s);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),e.push.apply(e,n)}return e}function vu(s){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?xu(Object(e),!0).forEach(function(n){_w(s,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(e)):xu(Object(e)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(e,n))})}return s}function fr(s){"@babel/helpers - typeof";return fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(s)}function _w(s,t,e){return t in s?Object.defineProperty(s,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):s[t]=e,s}var Ai,Ww={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Ss(){if(Ai!==void 0)return Ai;Ai="";var s=document.createElement("p").style,t="Transform";for(var e in Ww)e+t in s&&(Ai=e);return Ai}function Eu(){return Ss()?"".concat(Ss(),"TransitionProperty"):"transitionProperty"}function Ms(){return Ss()?"".concat(Ss(),"Transform"):"transform"}function Su(s,t){var e=Eu();e&&(s.style[e]=t,e!=="transitionProperty"&&(s.style.transitionProperty=t))}function pr(s,t){var e=Ms();e&&(s.style[e]=t,e!=="transform"&&(s.style.transform=t))}function qw(s){return s.style.transitionProperty||s.style[Eu()]}function Xw(s){var t=window.getComputedStyle(s,null),e=t.getPropertyValue("transform")||t.getPropertyValue(Ms());if(e&&e!=="none"){var n=e.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}var $w=/matrix\((.*)\)/,Zw=/matrix3d\((.*)\)/;function tA(s,t){var e=window.getComputedStyle(s,null),n=e.getPropertyValue("transform")||e.getPropertyValue(Ms());if(n&&n!=="none"){var i,o=n.match($w);if(o)o=o[1],i=o.split(",").map(function(a){return parseFloat(a,10)}),i[4]=t.x,i[5]=t.y,pr(s,"matrix(".concat(i.join(","),")"));else{var r=n.match(Zw)[1];i=r.split(",").map(function(a){return parseFloat(a,10)}),i[12]=t.x,i[13]=t.y,pr(s,"matrix3d(".concat(i.join(","),")"))}}else pr(s,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}var eA=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,xi;function Mu(s){var t=s.style.display;s.style.display="none",s.offsetHeight,s.style.display=t}function En(s,t,e){var n=e;if(fr(t)==="object"){for(var i in t)t.hasOwnProperty(i)&&En(s,i,t[i]);return}if(typeof n<"u"){typeof n=="number"&&(n="".concat(n,"px")),s.style[t]=n;return}return xi(s,t)}function nA(s){var t,e,n,i=s.ownerDocument,o=i.body,r=i&&i.documentElement;return t=s.getBoundingClientRect(),e=Math.floor(t.left),n=Math.floor(t.top),e-=r.clientLeft||o.clientLeft||0,n-=r.clientTop||o.clientTop||0,{left:e,top:n}}function Bu(s,t){var e=s["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof e!="number"){var i=s.document;e=i.documentElement[n],typeof e!="number"&&(e=i.body[n])}return e}function ku(s){return Bu(s)}function Iu(s){return Bu(s,!0)}function vi(s){var t=nA(s),e=s.ownerDocument,n=e.defaultView||e.parentWindow;return t.left+=ku(n),t.top+=Iu(n),t}function mr(s){return s!=null&&s==s.window}function Tu(s){return mr(s)?s.document:s.nodeType===9?s:s.ownerDocument}function iA(s,t,e){var n=e,i="",o=Tu(s);return n=n||o.defaultView.getComputedStyle(s,null),n&&(i=n.getPropertyValue(t)||n[t]),i}var sA=new RegExp("^(".concat(eA,")(?!px)[a-z%]+$"),"i"),oA=/^(top|right|bottom|left)$/,br="currentStyle",yr="runtimeStyle",He="left",rA="px";function aA(s,t){var e=s[br]&&s[br][t];if(sA.test(e)&&!oA.test(t)){var n=s.style,i=n[He],o=s[yr][He];s[yr][He]=s[br][He],n[He]=t==="fontSize"?"1em":e||0,e=n.pixelLeft+rA,n[He]=i,s[yr][He]=o}return e===""?"auto":e}typeof window<"u"&&(xi=window.getComputedStyle?iA:aA);function Bs(s,t){return s==="left"?t.useCssRight?"right":s:t.useCssBottom?"bottom":s}function Pu(s){if(s==="left")return"right";if(s==="right")return"left";if(s==="top")return"bottom";if(s==="bottom")return"top"}function Ou(s,t,e){En(s,"position")==="static"&&(s.style.position="relative");var n=-999,i=-999,o=Bs("left",e),r=Bs("top",e),a=Pu(o),l=Pu(r);o!=="left"&&(n=999),r!=="top"&&(i=999);var c="",h=vi(s);("left"in t||"top"in t)&&(c=qw(s)||"",Su(s,"none")),"left"in t&&(s.style[a]="",s.style[o]="".concat(n,"px")),"top"in t&&(s.style[l]="",s.style[r]="".concat(i,"px")),Mu(s);var u=vi(s),d={};for(var f in t)if(t.hasOwnProperty(f)){var p=Bs(f,e),m=f==="left"?n:i,b=h[f]-u[f];p===f?d[p]=m+b:d[p]=m-b}En(s,d),Mu(s),("left"in t||"top"in t)&&Su(s,c);var y={};for(var C in t)if(t.hasOwnProperty(C)){var A=Bs(C,e),x=t[C]-h[C];C===A?y[A]=d[A]+x:y[A]=d[A]-x}En(s,y)}function lA(s,t){var e=vi(s),n=Xw(s),i={x:n.x,y:n.y};"left"in t&&(i.x=n.x+t.left-e.left),"top"in t&&(i.y=n.y+t.top-e.top),tA(s,i)}function cA(s,t,e){if(e.ignoreShake){var n=vi(s),i=n.left.toFixed(0),o=n.top.toFixed(0),r=t.left.toFixed(0),a=t.top.toFixed(0);if(i===r&&o===a)return}e.useCssRight||e.useCssBottom?Ou(s,t,e):e.useCssTransform&&Ms()in document.body.style?lA(s,t):Ou(s,t,e)}function Cr(s,t){for(var e=0;e<s.length;e++)t(s[e])}function Nu(s){return xi(s,"boxSizing")==="border-box"}var hA=["margin","border","padding"],wr=-1,uA=2,Ar=1,dA=0;function gA(s,t,e){var n={},i=s.style,o;for(o in t)t.hasOwnProperty(o)&&(n[o]=i[o],i[o]=t[o]);e.call(s);for(o in t)t.hasOwnProperty(o)&&(i[o]=n[o])}function Ei(s,t,e){var n=0,i,o,r;for(o=0;o<t.length;o++)if(i=t[o],i)for(r=0;r<e.length;r++){var a=void 0;i==="border"?a="".concat(i).concat(e[r],"Width"):a=i+e[r],n+=parseFloat(xi(s,a))||0}return n}var de={getParent:function(t){var e=t;do e.nodeType===11&&e.host?e=e.host:e=e.parentNode;while(e&&e.nodeType!==1&&e.nodeType!==9);return e}};Cr(["Width","Height"],function(s){de["doc".concat(s)]=function(t){var e=t.document;return Math.max(e.documentElement["scroll".concat(s)],e.body["scroll".concat(s)],de["viewport".concat(s)](e))},de["viewport".concat(s)]=function(t){var e="client".concat(s),n=t.document,i=n.body,o=n.documentElement,r=o[e];return n.compatMode==="CSS1Compat"&&r||i&&i[e]||r}});function Ru(s,t,e){var n=e;if(mr(s))return t==="width"?de.viewportWidth(s):de.viewportHeight(s);if(s.nodeType===9)return t==="width"?de.docWidth(s):de.docHeight(s);var i=t==="width"?["Left","Right"]:["Top","Bottom"],o=Math.floor(t==="width"?s.getBoundingClientRect().width:s.getBoundingClientRect().height),r=Nu(s),a=0;(o==null||o<=0)&&(o=void 0,a=xi(s,t),(a==null||Number(a)<0)&&(a=s.style[t]||0),a=Math.floor(parseFloat(a))||0),n===void 0&&(n=r?Ar:wr);var l=o!==void 0||r,c=o||a;return n===wr?l?c-Ei(s,["border","padding"],i):a:l?n===Ar?c:c+(n===uA?-Ei(s,["border"],i):Ei(s,["margin"],i)):a+Ei(s,hA.slice(n),i)}var fA={position:"absolute",visibility:"hidden",display:"block"};function Du(){for(var s=arguments.length,t=new Array(s),e=0;e<s;e++)t[e]=arguments[e];var n,i=t[0];return i.offsetWidth!==0?n=Ru.apply(void 0,t):gA(i,fA,function(){n=Ru.apply(void 0,t)}),n}Cr(["width","height"],function(s){var t=s.charAt(0).toUpperCase()+s.slice(1);de["outer".concat(t)]=function(n,i){return n&&Du(n,s,i?dA:Ar)};var e=s==="width"?["Left","Right"]:["Top","Bottom"];de[s]=function(n,i){var o=i;if(o!==void 0){if(n){var r=Nu(n);return r&&(o+=Ei(n,["padding","border"],e)),En(n,s,o)}return}return n&&Du(n,s,wr)}});function Qu(s,t){for(var e in t)t.hasOwnProperty(e)&&(s[e]=t[e]);return s}var U={getWindow:function(t){if(t&&t.document&&t.setTimeout)return t;var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},getDocument:Tu,offset:function(t,e,n){if(typeof e<"u")cA(t,e,n||{});else return vi(t)},isWindow:mr,each:Cr,css:En,clone:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);var i=t.overflow;if(i)for(e in t)t.hasOwnProperty(e)&&(n.overflow[e]=t.overflow[e]);return n},mix:Qu,getWindowScrollLeft:function(t){return ku(t)},getWindowScrollTop:function(t){return Iu(t)},merge:function(){for(var t={},e=0;e<arguments.length;e++)U.mix(t,e<0||arguments.length<=e?void 0:arguments[e]);return t},viewportWidth:0,viewportHeight:0};Qu(U,de);var xr=U.getParent;function Lu(s){if(U.isWindow(s)||s.nodeType===9)return null;var t=U.getDocument(s),e=t.body,n,i=U.css(s,"position"),o=i==="fixed"||i==="absolute";if(!o)return s.nodeName.toLowerCase()==="html"?null:xr(s);for(n=xr(s);n&&n!==e&&n.nodeType!==9;n=xr(n))if(i=U.css(n,"position"),i!=="static")return n;return null}var zu=U.getParent;function pA(s){if(U.isWindow(s)||s.nodeType===9)return!1;var t=U.getDocument(s),e=t.body,n=null;for(n=zu(s);n&&n!==e&&n!==t;n=zu(n)){var i=U.css(n,"position");if(i==="fixed")return!0}return!1}function mA(s,t){for(var e={left:0,right:1/0,top:0,bottom:1/0},n=Lu(s),i=U.getDocument(s),o=i.defaultView||i.parentWindow,r=i.body,a=i.documentElement;n;){if((navigator.userAgent.indexOf("MSIE")===-1||n.clientWidth!==0)&&n!==r&&n!==a&&U.css(n,"overflow")!=="visible"){var l=U.offset(n);l.left+=n.clientLeft,l.top+=n.clientTop,e.top=Math.max(e.top,l.top),e.right=Math.min(e.right,l.left+n.clientWidth),e.bottom=Math.min(e.bottom,l.top+n.clientHeight),e.left=Math.max(e.left,l.left)}else if(n===r||n===a)break;n=Lu(n)}var c=null;if(!U.isWindow(s)&&s.nodeType!==9){c=s.style.position;var h=U.css(s,"position");h==="absolute"&&(s.style.position="fixed")}var u=U.getWindowScrollLeft(o),d=U.getWindowScrollTop(o),f=U.viewportWidth(o),p=U.viewportHeight(o),m=a.scrollWidth,b=a.scrollHeight,y=window.getComputedStyle(r);if(y.overflowX==="hidden"&&(m=o.innerWidth),y.overflowY==="hidden"&&(b=o.innerHeight),s.style&&(s.style.position=c),t||pA(s))e.left=Math.max(e.left,u),e.top=Math.max(e.top,d),e.right=Math.min(e.right,u+f),e.bottom=Math.min(e.bottom,d+p);else{var C=Math.max(m,u+f);e.right=Math.min(e.right,C);var A=Math.max(b,d+p);e.bottom=Math.min(e.bottom,A)}return e.top>=0&&e.left>=0&&e.bottom>e.top&&e.right>e.left?e:null}function bA(s,t,e,n){var i=U.clone(s),o={width:t.width,height:t.height};return n.adjustX&&i.left<e.left&&(i.left=e.left),n.resizeWidth&&i.left>=e.left&&i.left+o.width>e.right&&(o.width-=i.left+o.width-e.right),n.adjustX&&i.left+o.width>e.right&&(i.left=Math.max(e.right-o.width,e.left)),n.adjustY&&i.top<e.top&&(i.top=e.top),n.resizeHeight&&i.top>=e.top&&i.top+o.height>e.bottom&&(o.height-=i.top+o.height-e.bottom),n.adjustY&&i.top+o.height>e.bottom&&(i.top=Math.max(e.bottom-o.height,e.top)),U.mix(i,o)}function yA(s){var t,e,n;if(!U.isWindow(s)&&s.nodeType!==9)t=U.offset(s),e=U.outerWidth(s),n=U.outerHeight(s);else{var i=U.getWindow(s);t={left:U.getWindowScrollLeft(i),top:U.getWindowScrollTop(i)},e=U.viewportWidth(i),n=U.viewportHeight(i)}return t.width=e,t.height=n,t}function Fu(s,t){var e=t.charAt(0),n=t.charAt(1),i=s.width,o=s.height,r=s.left,a=s.top;return e==="c"?a+=o/2:e==="b"&&(a+=o),n==="c"?r+=i/2:n==="r"&&(r+=i),{left:r,top:a}}function ks(s,t,e,n,i){var o=Fu(t,e[1]),r=Fu(s,e[0]),a=[r.left-o.left,r.top-o.top];return{left:Math.round(s.left-a[0]+n[0]-i[0]),top:Math.round(s.top-a[1]+n[1]-i[1])}}function Uu(s,t,e){return s.left<e.left||s.left+t.width>e.right}function Vu(s,t,e){return s.top<e.top||s.top+t.height>e.bottom}function CA(s,t,e){return s.left>e.right||s.left+t.width<e.left}function wA(s,t,e){return s.top>e.bottom||s.top+t.height<e.top}function Is(s,t,e){var n=[];return U.each(s,function(i){n.push(i.replace(t,function(o){return e[o]}))}),n}function Ts(s,t){return s[t]=-s[t],s}function Ku(s,t){var e;return/%$/.test(s)?e=parseInt(s.substring(0,s.length-1),10)/100*t:e=parseInt(s,10),e||0}function Ju(s,t){s[0]=Ku(s[0],t.width),s[1]=Ku(s[1],t.height)}function AA(s,t,e,n){var i=e.points,o=e.offset||[0,0],r=e.targetOffset||[0,0],a=e.overflow,l=e.source||s;o=[].concat(o),r=[].concat(r),a=a||{};var c={},h=0,u=!!(a&&a.alwaysByViewport),d=mA(l,u),f=yA(l);Ju(o,f),Ju(r,t);var p=ks(f,t,i,o,r),m=U.merge(f,p);if(d&&(a.adjustX||a.adjustY)&&n){if(a.adjustX&&Uu(p,f,d)){var b=Is(i,/[lr]/gi,{l:"r",r:"l"}),y=Ts(o,0),C=Ts(r,0),A=ks(f,t,b,y,C);CA(A,f,d)||(h=1,i=b,o=y,r=C)}if(a.adjustY&&Vu(p,f,d)){var x=Is(i,/[tb]/gi,{t:"b",b:"t"}),v=Ts(o,1),B=Ts(r,1),E=ks(f,t,x,v,B);wA(E,f,d)||(h=1,i=x,o=v,r=B)}h&&(p=ks(f,t,i,o,r),U.mix(m,p));var M=Uu(p,f,d),k=Vu(p,f,d);if(M||k){var T=i;M&&(T=Is(i,/[lr]/gi,{l:"r",r:"l"})),k&&(T=Is(i,/[tb]/gi,{t:"b",b:"t"})),i=T,o=e.offset||[0,0],r=e.targetOffset||[0,0]}c.adjustX=a.adjustX&&M,c.adjustY=a.adjustY&&k,(c.adjustX||c.adjustY)&&(m=bA(p,f,d,c))}return m.width!==f.width&&U.css(l,"width",U.width(l)+m.width-f.width),m.height!==f.height&&U.css(l,"height",U.height(l)+m.height-f.height),U.offset(l,{left:m.left,top:m.top},{useCssRight:e.useCssRight,useCssBottom:e.useCssBottom,useCssTransform:e.useCssTransform,ignoreShake:e.ignoreShake}),{points:i,offset:o,targetOffset:r,overflow:c}}function xA(s,t,e){var n,i,o=U.getDocument(s),r=o.defaultView||o.parentWindow,a=U.getWindowScrollLeft(r),l=U.getWindowScrollTop(r),c=U.viewportWidth(r),h=U.viewportHeight(r);"pageX"in t?n=t.pageX:n=a+t.clientX,"pageY"in t?i=t.pageY:i=l+t.clientY;var u={left:n,top:i,width:0,height:0},d=n>=0&&n<=a+c&&i>=0&&i<=l+h,f=[e.points[0],"cc"];return AA(s,u,vu(vu({},e),{},{points:f}),d)}const vA=`.x6-widget-dnd {
|
|
246
|
+
`;class vu extends Xt{init(){Be("core",ZC)}dispose(){ke("core")}}X([$()],vu.prototype,"dispose",null);class tA extends Xt{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return this.svg.getElementById(t)!=null}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${Ro(JSON.stringify(t))}`),!this.isDefined(e)){const s=ci.get(n);if(s==null)return ci.onNotFound(n);const o=s(t.args||{}),r=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});K.create(Dt.sanitize(o),r).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Ro(JSON.stringify(t))}`),!this.isDefined(e)){const o=t.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),r=`<${n}>${o.join("")}</${n}>`,a=Object.assign({id:e},t.attrs);K.create(r,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:s,markerUnits:o,markerOrient:r,tagName:a,children:l}=t,c=_(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Ro(JSON.stringify(t))}`),!this.isDefined(h)){a!=="path"&&delete c.d;const u=K.create("marker",{refX:n,refY:s,id:h,overflow:"visible",orient:r??"auto",markerUnits:o||"userSpaceOnUse"},l?l.map(d=>{var{tagName:f}=d,m=_(d,["tagName"]);return K.create(`${f}`||"path",Wn(Object.assign(Object.assign({},c),m)))}):[K.create(a||"path",Wn(c))]);this.defs.appendChild(u.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}class Eu extends Xt{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),s=this.getInstance(),o=Array.isArray(t)?t:[t];this.patterns.forEach((l,c)=>{const h=`pattern_${c}`,u=n.a||1,d=n.d||1,{update:f,markup:m}=l,p=_(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},p),o[c]),{sx:u,sy:d,ox:n.e||0,oy:n.f||0,width:e*u,height:e*d});s.has(h)||s.add(h,K.create("pattern",{id:h,patternUnits:"userSpaceOnUse"},K.createVectors(m)).node);const y=s.get(h);typeof f=="function"&&f(y.childNodes[0],b);let C=b.ox%b.width;C<0&&(C+=b.width);let w=b.oy%b.height;w<0&&(w+=b.height),W(y,{x:C,y:w,width:b.width,height:b.height})});const r=new XMLSerializer().serializeToString(s.root),a=`url(data:image/svg+xml;base64,${btoa(r)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new $3),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(e==null)return[Object.assign(Object.assign({},bh.dot),t.args)];const n=hi.get(e);if(n){let s=t.args||[];return Array.isArray(s)||(s=[s]),Array.isArray(n)?n.map((o,r)=>Object.assign(Object.assign({},o),s[r])):[Object.assign(Object.assign({},n),s[0])]}return hi.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}X([$()],Eu.prototype,"dispose",null);class Su extends Xt{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const s=this.resolveHighlighter(n);if(!s)return;const o=this.getHighlighterId(e,s);if(!this.highlights[o]){const r=s.highlighter;r.highlight(t,e,Object.assign({},s.args)),this.highlights[o]={cellView:t,magnet:e,highlighter:r,args:s.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const s=this.getHighlighterId(t,n);this.unhighlight(s)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(n==null){const a=t.type;n=a&&e.highlighting[a]||e.highlighting.default}if(n==null)return null;const s=typeof n=="string"?{name:n}:n,o=s.name,r=ui.get(o);return r==null?ui.onNotFound(o):(rw(o,r),{name:o,highlighter:r,args:s.args||{}})}getHighlighterId(t,e){return So(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}X([$()],Su.prototype,"dispose",null);class Mu extends Xt{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Lc(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(t){(this.disabled||t)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=this.widgetOptions.guard;return(e==null||e(t))&&Pe(t,this.widgetOptions.modifiers)}onMouseWheel(t){const e=this.widgetOptions.guard;if((e==null||e(t))&&Pe(t,this.widgetOptions.modifiers)){const n=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.transform.getScale().sx),t.deltaY<0?(this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*n*20)/20/this.currentScale,this.cumulatedFactor<=1&&(this.cumulatedFactor=1.05)):(this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/n)*20)/20/this.currentScale,this.cumulatedFactor>=1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const o=this.currentScale;let r=this.graph.transform.clampScale(o*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(r=Je(r,a,l),r!==o)if(this.widgetOptions.zoomAtMousePosition){const h=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(r,{absolute:!0,center:h.clone()})}else this.graph.zoom(r,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}X([$()],Mu.prototype,"dispose",null);function eA(i){const{grid:t,panning:e,mousewheel:n,embedding:s}=i,o=_(i,["grid","panning","mousewheel","embedding"]),r=i.container;if(r!=null)o.width==null&&(o.width=r.clientWidth),o.height==null&&(o.height=r.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const a=pt({},nA,o),l={size:10,visible:!1};return typeof t=="number"?a.grid={size:t,visible:!1}:typeof t=="boolean"?a.grid=Object.assign(Object.assign({},l),{visible:t}):a.grid=Object.assign(Object.assign({},l),t),["panning","mousewheel","embedding"].forEach(h=>{const u=i[h];typeof u=="boolean"?a[h].enabled=u:u!=null&&(a[h]=Object.assign(Object.assign({},a[h]),u))}),a}const nA={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!0,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:et.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:et.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:i,sourceView:t,targetView:e}){return(i==="target"?e:t)!=null},createEdge(){return new _C}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1};class Bu extends Xt{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),st.on(this.graph.container,"mousedown",this.onRightMouseDown),st.on(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle=new Lc(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),st.off(this.graph.container,"mousedown",this.onRightMouseDown),st.off(document.body,{keydown:this.onKeyDown,keyup:this.onKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(t,e){return t.spaceKey=this.isSpaceKeyPressed,this.pannable&&Pe(t,this.widgetOptions.modifiers,e)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(t),st.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),st.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,s=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(n,s)}stopPanning(t){this.panning=!1,this.updateClassName(t),st.off(document.body,".panning"),st.off(window,".panning")}updateClassName(t){const e=this.widgetOptions.eventTypes;if((e==null?void 0:e.length)===1&&e.includes("mouseWheel"))return;const n=this.view.container,s=this.view.prefixClassName("graph-panning"),o=this.view.prefixClassName("graph-pannable"),r=this.graph.getPlugin("selection"),a=r&&r.allowRubberband(t,!0),l=(e==null?void 0:e.includes("leftMouseDown"))&&!a;this.allowPanning(t??{},!0)||this.allowPanning(t??{})&&l?this.panning?(L(n,s),at(n,o)):(at(n,s),L(n,o)):this.panning||(at(n,s),at(n,o))}onMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.getPlugin("selection"),n=e&&e.allowRubberband(t,!0);(this.allowPanning(t,!0)||this.allowPanning(t)&&!n)&&this.startPanning(t)}onRightMouseDown(t){const e=this.widgetOptions.eventTypes;e!=null&&e.includes("rightMouseDown")&&t.button===2&&this.allowPanning(t,!0)&&this.startPanning(t)}onMouseWheel(t,e,n){this.graph.translateBy(-e,-n)}onKeyDown(t){t.which===32&&(this.isSpaceKeyPressed=!0),this.updateClassName(t)}onKeyUp(t){t.which===32&&(this.isSpaceKeyPressed=!1),this.updateClassName(t)}allowBlankMouseDown(t){const e=this.widgetOptions.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}allowMouseWheel(t){var e;return this.pannable&&!t.ctrlKey&&((e=this.widgetOptions.eventTypes)===null||e===void 0?void 0:e.includes("mouseWheel"))}autoPanning(t,e){const s=this.graph.getGraphArea();let o=0,r=0;t<=s.left+10&&(o=-10),e<=s.top+10&&(r=-10),t>=s.right-10&&(o=10),e>=s.bottom-10&&(r=10),(o!==0||r!==0)&&this.graph.translateBy(-o,-r)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}X([$()],Bu.prototype,"dispose",null);class ku extends Xt{getScroller(){const t=this.graph.getPlugin("scroller");return t&&t.options.enabled?t:null}getContainer(){const t=this.getScroller();return t?t.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const t=this.options.autoResize;if(t)return typeof t=="boolean"?this.getContainer()||void 0:t}init(){if(this.options.autoResize){const e=this.getSensorTarget();if(e){if(typeof ResizeObserver>"u")return;this.ro=new ResizeObserver(o=>{if(!o||o.length===0)return;const{width:r,height:a}=o[0].contentRect;this.resize(Math.round(r),Math.round(a))}),this.ro.observe(e);const n=e.offsetWidth,s=e.offsetHeight;this.resize(n,s)}}}resize(t,e){const n=this.getScroller();n?n.resize(t,e):this.graph.transform.resize(t,e)}dispose(){this.ro&&(this.ro.disconnect(),this.ro=void 0)}}X([$()],ku.prototype,"dispose",null);class iA extends Xt{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),Et(this.viewportMatrix)}setMatrix(t){const e=Et(t),n=$n(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=t===void 0?this.options.width:t,s=e===void 0?this.options.height:e;this.options.width=n,this.options.height=s,typeof n=="number"&&(n=Math.round(n)),typeof s=="number"&&(s=Math.round(s)),this.container.style.width=n==null?"":`${n}px`,this.container.style.height=s==null?"":`${s}px`;const o=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},o)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return we(t)||(t=this.container.clientWidth),we(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return m6(this.getMatrix())}scale(t,e=t,n=0,s=0,o=!0){if(t=this.clampScale(t),e=this.clampScale(e),o&&(n||s)){const a=this.getTranslation(),l=this.getScale(),c=n-(n-a.tx)*(t/l.sx),h=s-(s-a.ty)*(e/l.sy);(c!==a.tx||h!==a.ty)&&this.translate(c,h)}const r=this.getMatrix();return r.a=t,r.d=e,this.setMatrix(r),this.graph.trigger("scale",{sx:t,sy:e,ox:n,oy:s}),this}clampScale(t){const e=this.graph.options.scaling;return Je(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,s=t;const o=this.getScale(),r=this.getComputedSize();let a=r.width/2,l=r.height/2;return e.absolute||(n+=o.sx,s+=o.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,s=Math.round(s/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),s=Math.min(e.maxScale,s)),e.minScale&&(n=Math.max(e.minScale,n),s=Math.max(e.minScale,s)),e.center&&(a=e.center.x,l=e.center.y),n=this.clampScale(n),s=this.clampScale(s),this.scale(n,s,a,l),this}getRotation(){return b6(this.getMatrix())}rotate(t,e,n){if(e==null||n==null){const o=de(this.stage);e=o.width/2,n=o.height/2}const s=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(s),this}getTranslation(){return y6(this.getMatrix())}translate(t,e){const n=this.getMatrix();n.e=t||0,n.f=e||0,this.setMatrix(n);const s=this.getTranslation();return this.options.x=s.tx,this.options.y=s.ty,this.graph.trigger("translate",Object.assign({},s)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,s){if(typeof t=="object"){const w=t;t=w.gridWidth||1,e=w.gridHeight||1,n=w.padding||0,s=w}else t=t||1,e=e||1,n=n||0,s==null&&(s={});const o=se(n),r=s.border||0,a=s.contentArea?I.create(s.contentArea):this.getContentArea(s);r>0&&a.inflate(r);const l=this.getScale(),c=this.getTranslation(),h=l.sx,u=l.sy;a.x*=h,a.y*=u,a.width*=h,a.height*=u;let d=Math.max(Math.ceil((a.width+a.x)/t),1)*t,f=Math.max(Math.ceil((a.height+a.y)/e),1)*e,m=0,p=0;(s.allowNewOrigin==="negative"&&a.x<0||s.allowNewOrigin==="positive"&&a.x>=0||s.allowNewOrigin==="any")&&(m=Math.ceil(-a.x/t)*t,m+=o.left,d+=m),(s.allowNewOrigin==="negative"&&a.y<0||s.allowNewOrigin==="positive"&&a.y>=0||s.allowNewOrigin==="any")&&(p=Math.ceil(-a.y/e)*e,p+=o.top,f+=p),d+=o.right,f+=o.bottom,d=Math.max(d,s.minWidth||0),f=Math.max(f,s.minHeight||0),d=Math.min(d,s.maxWidth||Number.MAX_SAFE_INTEGER),f=Math.min(f,s.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),y=d!==b.width||f!==b.height;return(m!==c.tx||p!==c.ty)&&this.translate(m,p),y&&this.resize(d,f),new I(-m/h,-p/u,d/h,f/u)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,s;if(t.contentArea){const y=t.contentArea;n=this.graph.localToGraph(y),s=A.create(y)}else n=this.getContentBBox(t),s=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const o=se(t.padding),r=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||r,c=t.maxScaleX||a,h=t.minScaleY||r,u=t.maxScaleY||a;let d;if(t.viewportArea)d=t.viewportArea;else{const y=this.getComputedSize(),C=this.getTranslation();d={x:C.tx,y:C.ty,width:y.width,height:y.height}}d=I.create(d).moveAndExpand({x:o.left,y:o.top,width:-o.left-o.right,height:-o.top-o.bottom});const f=this.getScale();let m=d.width/n.width*f.sx,p=d.height/n.height*f.sy;t.preserveAspectRatio!==!1&&(m=p=Math.min(m,p));const b=t.scaleGrid;if(b&&(m=b*Math.floor(m/b),p=b*Math.floor(p/b)),m=Je(m,l,c),p=Je(p,h,u),this.scale(m,p),e){const y=this.options,C=d.x-s.x*m-y.x,w=d.y-s.y*p-y.y;this.translate(C,w)}}getContentArea(t={}){return t.useCellGeometry!==!1?this.model.getAllCellsBBox()||new I:de(this.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=I.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=I.create(t),s=this.graph;e.contentArea=n,e.viewportArea==null&&(e.viewportArea={x:s.options.x,y:s.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),s=this.getScale(),o=this.getTranslation(),r=n.width/2,a=n.height/2;t=typeof t=="number"?t:r,e=typeof e=="number"?e:a,t=r-t*s.sx,e=a-e*s.sy,(o.tx!==t||o.ty!==e)&&this.translate(t,e)}centerContent(t){const n=this.graph.getContentArea(t).getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const s=this.getComputedSize();e=jt(e,Math.max(0,s.width)),e<0&&(e=s.width+e),n=jt(n,Math.max(0,s.height)),n<0&&(n=s.height+n);const o=this.getTranslation(),r=this.getScale(),a=e-t.x*r.sx,l=n-t.y*r.sy;(o.tx!==a||o.ty!==l)&&this.translate(a,l)}positionRect(t,e){const n=I.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}}const Qe=`${et.prefixCls}-graph`;class Se extends Jt{static snapshoot(t){const e=t.cloneNode();return t.childNodes.forEach(n=>{e.appendChild(n)}),()=>{for(Hn(t);t.attributes.length>0;)t.removeAttribute(t.attributes[0].name);for(let n=0,s=e.attributes.length;n<s;n+=1){const o=e.attributes[n];t.setAttribute(o.name,o.value)}e.childNodes.forEach(n=>{t.appendChild(n)})}}get disposeContainer(){return!1}get options(){return this.graph.options}constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Dt.parseJSONMarkup(Se.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=Se.snapshoot(this.container),L(this.container,this.prefixClassName("graph")),Ot(this.container,n),this.delegateEvents()}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return t.type==="mousedown"&&t.button===2||this.options.guard&&this.options.guard(t,e)?!0:t.data&&t.data.guarded!==void 0?t.data.guarded:!(e&&e.cell&&q.isCell(e.cell)||this.svg===t.target||this.container===t.target||this.svg.contains(t.target))}findView(t){return this.graph.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,s.x,s.y):this.graph.trigger("blank:dblclick",{e,x:s.x,y:s.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,s.x,s.y):this.graph.trigger("blank:click",{e,x:s.x,y:s.y})}}isPreventDefaultContextMenu(t){let e=this.options.preventDefaultContextMenu;return typeof e=="function"&&(e=F(e,this.graph,{view:t})),e}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(n)&&t.preventDefault(),this.guard(e,n))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,s.x,s.y):this.graph.trigger("blank:contextmenu",{e,x:s.x,y:s.y})}delegateDragEvents(t,e){t.data==null&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){return this.getEventData(t).mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&t.preventDefault();const s=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,s.x,s.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&t.preventDefault(),this.graph.trigger("blank:mousedown",{e,x:s.x,y:s.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY||(e.mouseMovedCount==null&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,e.mouseMovedCount<=this.options.moveThreshold))return;const o=this.normalizeEvent(t),r=this.graph.snapToGrid(o.clientX,o.clientY),a=e.currentView;a?a.onMouseMove(o,r.x,r.y):this.graph.trigger("blank:mousemove",{e:o,x:r.x,y:r.y}),this.setEventData(o,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),o=this.getEventData(t).currentView;if(o?o.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e,x:n.x,y:n.y}),!t.isPropagationStopped()){const r=new Ae(t,{type:"click",data:t.data});this.onClick(r)}t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e})}}onMouseOut(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.findViewByElem(e.relatedTarget);if(n){if(s===n)return;n.onMouseEnter(e)}else{if(s)return;this.graph.trigger("graph:mouseenter",{e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=this.graph.findViewByElem(e.relatedTarget);if(n){if(s===n)return;n.onMouseLeave(e)}else{if(s)return;this.graph.trigger("graph:mouseleave",{e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const s=e.originalEvent,o=this.graph.snapToGrid(s.clientX,s.clientY),r=Math.max(-1,Math.min(1,s.wheelDelta||-s.detail));n?n.onMouseWheel(e,o.x,o.y,r):this.graph.trigger("blank:mousewheel",{e,delta:r,x:o.x,y:o.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const s=this.findView(e);if(s){const o=this.normalizeEvent(t);if(this.guard(o,s))return;const r=this.graph.snapToGrid(o.clientX,o.clientY);s.onCustomEvent(o,n,r.x,r.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,s=n.getAttribute("magnet");if(s&&s.toLowerCase()!=="false"){const o=this.findView(n);if(o){const r=this.normalizeEvent(t);if(this.guard(r,o))return;const a=this.graph.snapToGrid(r.clientX,r.clientY);F(e,this.graph,o,r,n,a.x,a.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(e,n,s,o,r)=>{e.onMagnetMouseDown(n,s,o,r)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(e,n,s,o,r)=>{e.onMagnetDblClick(n,s,o,r)})}onMagnetContextMenu(t){const e=this.findView(t.target);this.isPreventDefaultContextMenu(e)&&t.preventDefault(),this.handleMagnetEvent(t,(n,s,o,r,a)=>{n.onMagnetContextMenu(s,o,r,a)})}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const s=this.normalizeEvent(t);if(this.guard(s,n))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);n.onLabelMouseDown(s,o.x,o.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}Se.markup=[{ns:vt.xhtml,tagName:"div",selector:"background",className:`${Qe}-background`},{ns:vt.xhtml,tagName:"div",selector:"grid",className:`${Qe}-grid`},{ns:vt.svg,tagName:"svg",selector:"svg",className:`${Qe}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":vt.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${Qe}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${Qe}-svg-primer`},{tagName:"g",selector:"stage",className:`${Qe}-svg-stage`},{tagName:"g",selector:"decorator",className:`${Qe}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${Qe}-svg-overlay`}]}]}],Se.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${et.prefixCls}-cell`]:"onMouseEnter",[`mouseleave .${et.prefixCls}-cell`]:"onMouseLeave",[`mouseenter .${et.prefixCls}-cell-tools`]:"onMouseEnter",[`mouseleave .${et.prefixCls}-cell-tools`]:"onMouseLeave",[`mousedown .${et.prefixCls}-cell [event]`]:"onCustomEvent",[`touchstart .${et.prefixCls}-cell [event]`]:"onCustomEvent",[`mousedown .${et.prefixCls}-cell [data-event]`]:"onCustomEvent",[`touchstart .${et.prefixCls}-cell [data-event]`]:"onCustomEvent",[`dblclick .${et.prefixCls}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${et.prefixCls}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${et.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${et.prefixCls}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${et.prefixCls}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${et.prefixCls}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${et.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${et.prefixCls}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${et.prefixCls}-cell image`]:"onImageDragStart",[`mousedown .${et.prefixCls}-edge .${et.prefixCls}-edge-label`]:"onLabelMouseDown",[`touchstart .${et.prefixCls}-edge .${et.prefixCls}-edge-label`]:"onLabelMouseDown"},Se.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},X([$()],Se.prototype,"dispose",null);const Tu=120;class Iu extends Xt{init(){this.resetRenderArea=$b(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}bindScrollerEvents(t){this.scrollerRef=t,typeof t.on=="function"&&(t.on("pan:start",this.resetRenderArea,this),t.on("panning",this.resetRenderArea,this),t.on("pan:stop",this.resetRenderArea,this));const e=t.container;e&&(this.scrollerScrollHandler=n=>{this.resetRenderArea()},st.on(e,"scroll",this.scrollerScrollHandler))}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this);const t=this.graph.getPlugin("scroller");t&&this.bindScrollerEvents(t)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this),this.unbindScroller()}onScrollerReady(t){this.scrollerRef!==t&&(this.unbindScroller(),this.bindScrollerEvents(t),this.resetRenderArea())}unbindScroller(){if(this.scrollerRef){typeof this.scrollerRef.off=="function"&&(this.scrollerRef.off("pan:start",this.resetRenderArea,this),this.scrollerRef.off("panning",this.resetRenderArea,this),this.scrollerRef.off("pan:stop",this.resetRenderArea,this));const t=this.scrollerRef.container;t&&this.scrollerScrollHandler&&st.off(t,"scroll",this.scrollerScrollHandler),this.scrollerRef=void 0,this.scrollerScrollHandler=void 0}}setVirtualEnabled(t){const e=this.options.virtual;if(typeof e=="object"){const n=e;this.options.virtual=Object.assign(Object.assign({},n),{enabled:t})}else this.options.virtual=t}enableVirtualRender(){this.setVirtualEnabled(!0),this.resetRenderArea()}disableVirtualRender(){this.setVirtualEnabled(!1),this.graph.renderer.setRenderArea(void 0)}isVirtualEnabled(){const t=this.options.virtual;return t!=null&&typeof t=="object"?t.enabled!==!1:!!t}getVirtualMargin(){const t=this.options.virtual;if(typeof t=="object"){const e=t.margin;return typeof e=="number"?e:Tu}return Tu}resetRenderArea(){if(this.isVirtualEnabled()){const e=this.graph.getGraphArea();if(e){const n=this.getVirtualMargin(),s=e.clone();s.inflate(n,n),this.graph.renderer.setRenderArea(s);return}}}dispose(){this.stopListening()}}X([$()],Iu.prototype,"dispose",null);class B extends zt{static isGraph(t){if(t==null)return!1;if(t instanceof B)return!0;const e=t[Symbol.toStringTag];return e==null||e===B.toStringTag}static render(t,e){const n=t instanceof HTMLElement?new B({container:t}):new B(t);return e!=null&&n.fromJSON(e),n}get container(){return this.options.container}get[Symbol.toStringTag](){return B.toStringTag}constructor(t){super(),this.installedPlugins=new Set,this.options=eA(t),this.css=new vu(this),this.view=new Se(this),this.defs=new tA(this),this.coord=new $C(this),this.transform=new iA(this),this.highlight=new Su(this),this.grid=new Eu(this),this.background=new mr(this),this.options.model?this.model=this.options.model:(this.model=new Gt,this.model.graph=this),this.renderer=new xu(this),this.panning=new Bu(this),this.mousewheel=new Mu(this),this.virtualRender=new Iu(this),this.size=new ku(this)}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(n=>Bt.isNode(n)?n:this.createNode(n)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(n=>At.isEdge(n)?n:this.createEdge(n)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,s,o){return this.model.getNodesInArea(t,e,n,s,o)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const s=typeof t=="string"?t:"update",o=typeof t=="string"?e:t,r=typeof e=="function"?n:e;this.startBatch(s,r);const a=o();return this.stopBatch(s,r),a}updateCellId(t,e){return this.model.updateCellId(t,e)}findView(t){return q.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return I.isRectangleLike(t)?this.findViewsInArea(t):A.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n=typeof t=="number"?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,s,o){const r=typeof t=="number"?{x:t,y:e,width:n,height:s}:t,a=typeof t=="number"?o:e;return this.renderer.findViewsInArea(r,a)}matrix(t){return typeof t>"u"?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){const n=this.getPlugin("scroller");return n?n.resize(t,e):this.transform.resize(t,e),this}scale(t,e=t,n=0,s=0){return typeof t>"u"?this.transform.getScale():(this.transform.scale(t,e,n,s),this)}zoom(t,e){const n=this.getPlugin("scroller");if(n){if(typeof t>"u")return n.zoom();n.zoom(t,e)}else{if(typeof t>"u")return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.getPlugin("scroller");return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.getPlugin("scroller");return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.getPlugin("scroller");return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return typeof t>"u"?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return typeof t>"u"?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),s=n.tx+t,o=n.ty+e;return this.translate(s,o)}getGraphArea(){var t;const e=this.getPlugin("scroller");if(e){const n=(t=e.getVisibleArea)===null||t===void 0?void 0:t.call(e);if(n)return n}return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,s){return this.transform.fitToContent(t,e,n,s)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const s=this.getPlugin("scroller");return s?s.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.getPlugin("scroller");return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.getPlugin("scroller");return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,s={}){const o=this.getPlugin("scroller");return o?o.positionPoint(t,e,n,s):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const s=this.getPlugin("scroller");return s?s.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const s=this.getPlugin("scroller");return s?s.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.getPlugin("scroller");return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,s){return I.isRectangleLike(t)?this.coord.pageToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.pageToLocalRect(t,e,n,s):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,s){return I.isRectangleLike(t)?this.coord.localToPageRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToPageRect(t,e,n,s):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,s){return I.isRectangleLike(t)?this.coord.clientToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.clientToLocalRect(t,e,n,s):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,s){return I.isRectangleLike(t)?this.coord.localToClientRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToClientRect(t,e,n,s):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,s){return I.isRectangleLike(t)?this.coord.localToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.localToGraphRect(t,e,n,s):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,s){return I.isRectangleLike(t)?this.coord.graphToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.graphToLocalRect(t,e,n,s):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,s){return I.isRectangleLike(t)?this.coord.clientToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof s=="number"?this.coord.clientToGraphRect(t,e,n,s):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.getPlugin("scroller");return n!=null&&(this.options.background==null||!e)?n.drawBackground(t,e):this.background.draw(t),this}clearBackground(t){const e=this.getPlugin("scroller");return e!=null&&(this.options.background==null||!t)?e.clearBackground(t):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return t==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.getPlugin("scroller");return t?t.isPannable():this.panning.pannable}enablePanning(){const t=this.getPlugin("scroller");return t?t.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.getPlugin("scroller");return t?t.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}handleScrollerPluginStateChange(t,e){t.name==="scroller"&&(e?this.virtualRender.onScrollerReady(t):this.virtualRender.unbindScroller())}use(t,...e){return this.installedPlugins.has(t)||(this.installedPlugins.add(t),t.init(this,...e),this.handleScrollerPluginStateChange(t,!0)),this}getPlugin(t){return Array.from(this.installedPlugins).find(e=>e.name===t)}getPlugins(t){return Array.from(this.installedPlugins).filter(e=>t.includes(e.name))}enablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{var o;(o=s==null?void 0:s.enable)===null||o===void 0||o.call(s),this.handleScrollerPluginStateChange(s,!0)}),this}disablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{var o;(o=s==null?void 0:s.disable)===null||o===void 0||o.call(s),this.handleScrollerPluginStateChange(s,!1)}),this}isPluginEnabled(t){var e;const n=this.getPlugin(t);return(e=n==null?void 0:n.isEnabled)===null||e===void 0?void 0:e.call(n)}disposePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const n=this.getPlugins(e);return n==null||n.forEach(s=>{s.dispose(),this.handleScrollerPluginStateChange(s,!1),this.installedPlugins.delete(s)}),this}dispose(t=!0){t&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}B.toStringTag=`X6.${B.name}`,B.registerNode=Bt.registry.register,B.registerEdge=At.registry.register,B.registerView=Mt.registry.register,B.registerAttr=si.register,B.registerGrid=hi.register,B.registerFilter=ci.register,B.registerNodeTool=xi.register,B.registerEdgeTool=vi.register,B.registerBackground=fs.register,B.registerHighlighter=ui.register,B.registerPortLayout=fi.register,B.registerPortLabelLayout=xs.register,B.registerMarker=ni.register,B.registerRouter=bi.register,B.registerConnector=ai.register,B.registerAnchor=di.register,B.registerEdgeAnchor=li.register,B.registerConnectionPoint=oi.register,B.unregisterNode=Bt.registry.unregister,B.unregisterEdge=At.registry.unregister,B.unregisterView=Mt.registry.unregister,B.unregisterAttr=si.unregister,B.unregisterGrid=hi.unregister,B.unregisterFilter=ci.unregister,B.unregisterNodeTool=xi.unregister,B.unregisterEdgeTool=vi.unregister,B.unregisterBackground=fs.unregister,B.unregisterHighlighter=ui.unregister,B.unregisterPortLayout=fi.unregister,B.unregisterPortLabelLayout=xs.unregister,B.unregisterMarker=ni.unregister,B.unregisterRouter=bi.unregister,B.unregisterConnector=ai.unregister,B.unregisterAnchor=di.unregister,B.unregisterEdgeAnchor=li.unregister,B.unregisterConnectionPoint=oi.unregister,X([$()],B.prototype,"dispose",null);const br="html",yr={};class Pu extends Bt{static register(t){const{shape:e,html:n,effect:s,inherit:o}=t,r=_(t,["shape","html","effect","inherit"]);if(!e)throw new Error("HTML.register should specify `shape` in config.");yr[e]={html:n,effect:s},B.registerNode(e,Object.assign({inherit:o||"html"},r),!0)}}Pu.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Dt.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Bt.registry.register("html",Pu,!0);class wr extends $t{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:t}){const e=yr[this.cell.shape];if(e){const{effect:n}=e;(!n||n.includes(t))&&this.renderHTMLComponent()}}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,br,()=>this.renderHTMLComponent())}renderHTMLComponent(){const t=this.selectors&&this.selectors.foContent;if(t){Hn(t);const e=yr[this.cell.shape];if(!e)return;let{html:n}=e;typeof n=="function"&&(n=n(this.cell)),n&&(typeof n=="string"?t.innerHTML=n:Ot(t,n))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}X([$()],wr.prototype,"dispose",null),wr.config({bootstrap:[br],actions:{html:br}}),$t.registry.register("html-view",wr,!0),vn("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:HC()},{selector:"image"}),Ei.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(i){const{path:t}=i,e=_(i,["path"]);return t&&fn(e,"attrs/body/refD",t),e}});class Cr extends Ei{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return t==null?this.removePoints():this.setAttrByPath("body/refPoints",bu(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}Cr.config({propHooks(i){const{points:t}=i,e=_(i,["points"]);if(t){const n=bu(t);n&&fn(e,"attrs/body/refPoints",n)}return e}}),vn("polygon",{},{parent:Cr}),vn("polyline",{},{parent:Cr}),vn("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});function sA(i){return i?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:vt.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}}const oA={shape:"text-block",markup:[{tagName:"rect",selector:"body"},sA(ry)],attrs:{body:Object.assign(Object.assign({},mu),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(i){const{text:t}=i,e=_(i,["text"]);return t&&fn(e,"attrs/label/text",t),e},attrHooks:{text:{set(i,{cell:t,view:e,refBBox:n,elem:s,attrs:o}){if(s instanceof HTMLElement)s.textContent=i;else{const r=o.style||{},a={text:i,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},r),c=rh.textWrap;return F(c.set,this,a,{cell:t,view:e,elem:s,refBBox:n,attrs:l}),{fill:r.color||null}}},position(i,{refBBox:t,elem:e}){if(e instanceof SVGElement)return t.getCenter()}}}};Ei.define(oA);const Ar=`${et.prefixCls}.clipboard.cells`;function rA(i){if(window.localStorage){const t=i.map(e=>e.toJSON());localStorage.setItem(Ar,JSON.stringify(t))}}function aA(){if(window.localStorage){const i=localStorage.getItem(Ar),t=i?JSON.parse(i):[];if(t)return Gt.fromJSON(t)}}function lA(){window.localStorage&&localStorage.removeItem(Ar)}class cA{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const o=(Gt.isModel(e)?e:e.model).cloneSubGraph(t,n);this.cells=yo(Object.keys(o).map(r=>o[r]),r=>r.isEdge()?2:1),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n),(B.isGraph(e)?e.model:e).batchUpdate("cut",()=>{t.forEach(o=>o.remove())})}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:s,edgeProps:o,nodeProps:r}=n;let a=20,l=20;s&&(a=typeof s=="number"?s:s.dx,l=typeof s=="number"?s:s.dy),this.deserialize(n);const c=this.cells;c.forEach(u=>{u.model=null,u.removeProp("zIndex"),(a||l)&&u.translate(a,l),r&&u.isNode()&&u.prop(r),o&&u.isEdge()&&u.prop(o)});const h=B.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(c,t,e),c}serialize(t){t.useLocalStorage!==!1&&rA(this.cells)}deserialize(t){if(t.useLocalStorage){const e=aA();e&&(this.cells=e)}}isEmpty(t={}){return t.useLocalStorage&&this.deserialize(t),this.cells.length<=0}clean(){this.options={},this.cells=[],lA()}}B.prototype.isClipboardEnabled=function(){const i=this.getPlugin("clipboard");return i?i.isEnabled():!1},B.prototype.enableClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.enable(),this},B.prototype.disableClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.disable(),this},B.prototype.toggleClipboard=function(i){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(i),this},B.prototype.isClipboardEmpty=function(i){const t=this.getPlugin("clipboard");return t?t.isEmpty(i):!0},B.prototype.getCellsInClipboard=function(){const i=this.getPlugin("clipboard");return i?i.getCellsInClipboard():[]},B.prototype.cleanClipboard=function(){const i=this.getPlugin("clipboard");return i&&i.clean(),this},B.prototype.copy=function(i,t){const e=this.getPlugin("clipboard");return e&&e.copy(i,t),this},B.prototype.cut=function(i,t){const e=this.getPlugin("clipboard");return e&&e.cut(i,t),this},B.prototype.paste=function(i,t){const e=this.getPlugin("clipboard");return e?e.paste(i,t):[]};class Ou extends zt{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(t={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},t)}init(t){this.graph=t,this.clipboardImpl=new cA,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}isEmpty(t={}){return this.clipboardImpl.isEmpty(t)}getCellsInClipboard(){return this.cells}clean(t){return(!this.disabled||t)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(t,e={}){return this.disabled||(this.clipboardImpl.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}cut(t,e={}){return this.disabled||(this.clipboardImpl.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}paste(t={},e=this.graph){return this.disabled?[]:this.clipboardImpl.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}get commonOptions(){const t=this.options,{enabled:e}=t;return _(t,["enabled"])}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.clean(!0),this.off()}}X([$()],Ou.prototype,"dispose",null);function Nu(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,n)}return e}function Ru(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Nu(Object(e),!0).forEach(function(n){hA(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Nu(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}function xr(i){"@babel/helpers - typeof";return xr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xr(i)}function hA(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Si,uA={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Is(){if(Si!==void 0)return Si;Si="";var i=document.createElement("p").style,t="Transform";for(var e in uA)e+t in i&&(Si=e);return Si}function Du(){return Is()?"".concat(Is(),"TransitionProperty"):"transitionProperty"}function Ps(){return Is()?"".concat(Is(),"Transform"):"transform"}function Lu(i,t){var e=Du();e&&(i.style[e]=t,e!=="transitionProperty"&&(i.style.transitionProperty=t))}function vr(i,t){var e=Ps();e&&(i.style[e]=t,e!=="transform"&&(i.style.transform=t))}function dA(i){return i.style.transitionProperty||i.style[Du()]}function gA(i){var t=window.getComputedStyle(i,null),e=t.getPropertyValue("transform")||t.getPropertyValue(Ps());if(e&&e!=="none"){var n=e.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}var fA=/matrix\((.*)\)/,pA=/matrix3d\((.*)\)/;function mA(i,t){var e=window.getComputedStyle(i,null),n=e.getPropertyValue("transform")||e.getPropertyValue(Ps());if(n&&n!=="none"){var s,o=n.match(fA);if(o)o=o[1],s=o.split(",").map(function(a){return parseFloat(a,10)}),s[4]=t.x,s[5]=t.y,vr(i,"matrix(".concat(s.join(","),")"));else{var r=n.match(pA)[1];s=r.split(",").map(function(a){return parseFloat(a,10)}),s[12]=t.x,s[13]=t.y,vr(i,"matrix3d(".concat(s.join(","),")"))}}else vr(i,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}var bA=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,Mi;function Qu(i){var t=i.style.display;i.style.display="none",i.offsetHeight,i.style.display=t}function Sn(i,t,e){var n=e;if(xr(t)==="object"){for(var s in t)t.hasOwnProperty(s)&&Sn(i,s,t[s]);return}if(typeof n<"u"){typeof n=="number"&&(n="".concat(n,"px")),i.style[t]=n;return}return Mi(i,t)}function yA(i){var t,e,n,s=i.ownerDocument,o=s.body,r=s&&s.documentElement;return t=i.getBoundingClientRect(),e=Math.floor(t.left),n=Math.floor(t.top),e-=r.clientLeft||o.clientLeft||0,n-=r.clientTop||o.clientTop||0,{left:e,top:n}}function Vu(i,t){var e=i["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof e!="number"){var s=i.document;e=s.documentElement[n],typeof e!="number"&&(e=s.body[n])}return e}function zu(i){return Vu(i)}function Fu(i){return Vu(i,!0)}function Bi(i){var t=yA(i),e=i.ownerDocument,n=e.defaultView||e.parentWindow;return t.left+=zu(n),t.top+=Fu(n),t}function Er(i){return i!=null&&i==i.window}function Uu(i){return Er(i)?i.document:i.nodeType===9?i:i.ownerDocument}function wA(i,t,e){var n=e,s="",o=Uu(i);return n=n||o.defaultView.getComputedStyle(i,null),n&&(s=n.getPropertyValue(t)||n[t]),s}var CA=new RegExp("^(".concat(bA,")(?!px)[a-z%]+$"),"i"),AA=/^(top|right|bottom|left)$/,Sr="currentStyle",Mr="runtimeStyle",_e="left",xA="px";function vA(i,t){var e=i[Sr]&&i[Sr][t];if(CA.test(e)&&!AA.test(t)){var n=i.style,s=n[_e],o=i[Mr][_e];i[Mr][_e]=i[Sr][_e],n[_e]=t==="fontSize"?"1em":e||0,e=n.pixelLeft+xA,n[_e]=s,i[Mr][_e]=o}return e===""?"auto":e}typeof window<"u"&&(Mi=window.getComputedStyle?wA:vA);function Os(i,t){return i==="left"?t.useCssRight?"right":i:t.useCssBottom?"bottom":i}function Ku(i){if(i==="left")return"right";if(i==="right")return"left";if(i==="top")return"bottom";if(i==="bottom")return"top"}function Ju(i,t,e){Sn(i,"position")==="static"&&(i.style.position="relative");var n=-999,s=-999,o=Os("left",e),r=Os("top",e),a=Ku(o),l=Ku(r);o!=="left"&&(n=999),r!=="top"&&(s=999);var c="",h=Bi(i);("left"in t||"top"in t)&&(c=dA(i)||"",Lu(i,"none")),"left"in t&&(i.style[a]="",i.style[o]="".concat(n,"px")),"top"in t&&(i.style[l]="",i.style[r]="".concat(s,"px")),Qu(i);var u=Bi(i),d={};for(var f in t)if(t.hasOwnProperty(f)){var m=Os(f,e),p=f==="left"?n:s,b=h[f]-u[f];m===f?d[m]=p+b:d[m]=p-b}Sn(i,d),Qu(i),("left"in t||"top"in t)&&Lu(i,c);var y={};for(var C in t)if(t.hasOwnProperty(C)){var w=Os(C,e),x=t[C]-h[C];C===w?y[w]=d[w]+x:y[w]=d[w]-x}Sn(i,y)}function EA(i,t){var e=Bi(i),n=gA(i),s={x:n.x,y:n.y};"left"in t&&(s.x=n.x+t.left-e.left),"top"in t&&(s.y=n.y+t.top-e.top),mA(i,s)}function SA(i,t,e){if(e.ignoreShake){var n=Bi(i),s=n.left.toFixed(0),o=n.top.toFixed(0),r=t.left.toFixed(0),a=t.top.toFixed(0);if(s===r&&o===a)return}e.useCssRight||e.useCssBottom?Ju(i,t,e):e.useCssTransform&&Ps()in document.body.style?EA(i,t):Ju(i,t,e)}function Br(i,t){for(var e=0;e<i.length;e++)t(i[e])}function ju(i){return Mi(i,"boxSizing")==="border-box"}var MA=["margin","border","padding"],kr=-1,BA=2,Tr=1,kA=0;function TA(i,t,e){var n={},s=i.style,o;for(o in t)t.hasOwnProperty(o)&&(n[o]=s[o],s[o]=t[o]);e.call(i);for(o in t)t.hasOwnProperty(o)&&(s[o]=n[o])}function ki(i,t,e){var n=0,s,o,r;for(o=0;o<t.length;o++)if(s=t[o],s)for(r=0;r<e.length;r++){var a=void 0;s==="border"?a="".concat(s).concat(e[r],"Width"):a=s+e[r],n+=parseFloat(Mi(i,a))||0}return n}var fe={getParent:function(t){var e=t;do e.nodeType===11&&e.host?e=e.host:e=e.parentNode;while(e&&e.nodeType!==1&&e.nodeType!==9);return e}};Br(["Width","Height"],function(i){fe["doc".concat(i)]=function(t){var e=t.document;return Math.max(e.documentElement["scroll".concat(i)],e.body["scroll".concat(i)],fe["viewport".concat(i)](e))},fe["viewport".concat(i)]=function(t){var e="client".concat(i),n=t.document,s=n.body,o=n.documentElement,r=o[e];return n.compatMode==="CSS1Compat"&&r||s&&s[e]||r}});function Gu(i,t,e){var n=e;if(Er(i))return t==="width"?fe.viewportWidth(i):fe.viewportHeight(i);if(i.nodeType===9)return t==="width"?fe.docWidth(i):fe.docHeight(i);var s=t==="width"?["Left","Right"]:["Top","Bottom"],o=Math.floor(t==="width"?i.getBoundingClientRect().width:i.getBoundingClientRect().height),r=ju(i),a=0;(o==null||o<=0)&&(o=void 0,a=Mi(i,t),(a==null||Number(a)<0)&&(a=i.style[t]||0),a=Math.floor(parseFloat(a))||0),n===void 0&&(n=r?Tr:kr);var l=o!==void 0||r,c=o||a;return n===kr?l?c-ki(i,["border","padding"],s):a:l?n===Tr?c:c+(n===BA?-ki(i,["border"],s):ki(i,["margin"],s)):a+ki(i,MA.slice(n),s)}var IA={position:"absolute",visibility:"hidden",display:"block"};function Yu(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];var n,s=t[0];return s.offsetWidth!==0?n=Gu.apply(void 0,t):TA(s,IA,function(){n=Gu.apply(void 0,t)}),n}Br(["width","height"],function(i){var t=i.charAt(0).toUpperCase()+i.slice(1);fe["outer".concat(t)]=function(n,s){return n&&Yu(n,i,s?kA:Tr)};var e=i==="width"?["Left","Right"]:["Top","Bottom"];fe[i]=function(n,s){var o=s;if(o!==void 0){if(n){var r=ju(n);return r&&(o+=ki(n,["padding","border"],e)),Sn(n,i,o)}return}return n&&Yu(n,i,kr)}});function Hu(i,t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}var Y={getWindow:function(t){if(t&&t.document&&t.setTimeout)return t;var e=t.ownerDocument||t;return e.defaultView||e.parentWindow},getDocument:Uu,offset:function(t,e,n){if(typeof e<"u")SA(t,e,n||{});else return Bi(t)},isWindow:Er,each:Br,css:Sn,clone:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);var s=t.overflow;if(s)for(e in t)t.hasOwnProperty(e)&&(n.overflow[e]=t.overflow[e]);return n},mix:Hu,getWindowScrollLeft:function(t){return zu(t)},getWindowScrollTop:function(t){return Fu(t)},merge:function(){for(var t={},e=0;e<arguments.length;e++)Y.mix(t,e<0||arguments.length<=e?void 0:arguments[e]);return t},viewportWidth:0,viewportHeight:0};Hu(Y,fe);var Ir=Y.getParent;function _u(i){if(Y.isWindow(i)||i.nodeType===9)return null;var t=Y.getDocument(i),e=t.body,n,s=Y.css(i,"position"),o=s==="fixed"||s==="absolute";if(!o)return i.nodeName.toLowerCase()==="html"?null:Ir(i);for(n=Ir(i);n&&n!==e&&n.nodeType!==9;n=Ir(n))if(s=Y.css(n,"position"),s!=="static")return n;return null}var Wu=Y.getParent;function PA(i){if(Y.isWindow(i)||i.nodeType===9)return!1;var t=Y.getDocument(i),e=t.body,n=null;for(n=Wu(i);n&&n!==e&&n!==t;n=Wu(n)){var s=Y.css(n,"position");if(s==="fixed")return!0}return!1}function OA(i,t){for(var e={left:0,right:1/0,top:0,bottom:1/0},n=_u(i),s=Y.getDocument(i),o=s.defaultView||s.parentWindow,r=s.body,a=s.documentElement;n;){if((navigator.userAgent.indexOf("MSIE")===-1||n.clientWidth!==0)&&n!==r&&n!==a&&Y.css(n,"overflow")!=="visible"){var l=Y.offset(n);l.left+=n.clientLeft,l.top+=n.clientTop,e.top=Math.max(e.top,l.top),e.right=Math.min(e.right,l.left+n.clientWidth),e.bottom=Math.min(e.bottom,l.top+n.clientHeight),e.left=Math.max(e.left,l.left)}else if(n===r||n===a)break;n=_u(n)}var c=null;if(!Y.isWindow(i)&&i.nodeType!==9){c=i.style.position;var h=Y.css(i,"position");h==="absolute"&&(i.style.position="fixed")}var u=Y.getWindowScrollLeft(o),d=Y.getWindowScrollTop(o),f=Y.viewportWidth(o),m=Y.viewportHeight(o),p=a.scrollWidth,b=a.scrollHeight,y=window.getComputedStyle(r);if(y.overflowX==="hidden"&&(p=o.innerWidth),y.overflowY==="hidden"&&(b=o.innerHeight),i.style&&(i.style.position=c),t||PA(i))e.left=Math.max(e.left,u),e.top=Math.max(e.top,d),e.right=Math.min(e.right,u+f),e.bottom=Math.min(e.bottom,d+m);else{var C=Math.max(p,u+f);e.right=Math.min(e.right,C);var w=Math.max(b,d+m);e.bottom=Math.min(e.bottom,w)}return e.top>=0&&e.left>=0&&e.bottom>e.top&&e.right>e.left?e:null}function NA(i,t,e,n){var s=Y.clone(i),o={width:t.width,height:t.height};return n.adjustX&&s.left<e.left&&(s.left=e.left),n.resizeWidth&&s.left>=e.left&&s.left+o.width>e.right&&(o.width-=s.left+o.width-e.right),n.adjustX&&s.left+o.width>e.right&&(s.left=Math.max(e.right-o.width,e.left)),n.adjustY&&s.top<e.top&&(s.top=e.top),n.resizeHeight&&s.top>=e.top&&s.top+o.height>e.bottom&&(o.height-=s.top+o.height-e.bottom),n.adjustY&&s.top+o.height>e.bottom&&(s.top=Math.max(e.bottom-o.height,e.top)),Y.mix(s,o)}function RA(i){var t,e,n;if(!Y.isWindow(i)&&i.nodeType!==9)t=Y.offset(i),e=Y.outerWidth(i),n=Y.outerHeight(i);else{var s=Y.getWindow(i);t={left:Y.getWindowScrollLeft(s),top:Y.getWindowScrollTop(s)},e=Y.viewportWidth(s),n=Y.viewportHeight(s)}return t.width=e,t.height=n,t}function qu(i,t){var e=t.charAt(0),n=t.charAt(1),s=i.width,o=i.height,r=i.left,a=i.top;return e==="c"?a+=o/2:e==="b"&&(a+=o),n==="c"?r+=s/2:n==="r"&&(r+=s),{left:r,top:a}}function Ns(i,t,e,n,s){var o=qu(t,e[1]),r=qu(i,e[0]),a=[r.left-o.left,r.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-s[0]),top:Math.round(i.top-a[1]+n[1]-s[1])}}function Xu(i,t,e){return i.left<e.left||i.left+t.width>e.right}function $u(i,t,e){return i.top<e.top||i.top+t.height>e.bottom}function DA(i,t,e){return i.left>e.right||i.left+t.width<e.left}function LA(i,t,e){return i.top>e.bottom||i.top+t.height<e.top}function Rs(i,t,e){var n=[];return Y.each(i,function(s){n.push(s.replace(t,function(o){return e[o]}))}),n}function Ds(i,t){return i[t]=-i[t],i}function Zu(i,t){var e;return/%$/.test(i)?e=parseInt(i.substring(0,i.length-1),10)/100*t:e=parseInt(i,10),e||0}function td(i,t){i[0]=Zu(i[0],t.width),i[1]=Zu(i[1],t.height)}function QA(i,t,e,n){var s=e.points,o=e.offset||[0,0],r=e.targetOffset||[0,0],a=e.overflow,l=e.source||i;o=[].concat(o),r=[].concat(r),a=a||{};var c={},h=0,u=!!(a&&a.alwaysByViewport),d=OA(l,u),f=RA(l);td(o,f),td(r,t);var m=Ns(f,t,s,o,r),p=Y.merge(f,m);if(d&&(a.adjustX||a.adjustY)&&n){if(a.adjustX&&Xu(m,f,d)){var b=Rs(s,/[lr]/gi,{l:"r",r:"l"}),y=Ds(o,0),C=Ds(r,0),w=Ns(f,t,b,y,C);DA(w,f,d)||(h=1,s=b,o=y,r=C)}if(a.adjustY&&$u(m,f,d)){var x=Rs(s,/[tb]/gi,{t:"b",b:"t"}),E=Ds(o,1),S=Ds(r,1),v=Ns(f,t,x,E,S);LA(v,f,d)||(h=1,s=x,o=E,r=S)}h&&(m=Ns(f,t,s,o,r),Y.mix(p,m));var M=Xu(m,f,d),k=$u(m,f,d);if(M||k){var T=s;M&&(T=Rs(s,/[lr]/gi,{l:"r",r:"l"})),k&&(T=Rs(s,/[tb]/gi,{t:"b",b:"t"})),s=T,o=e.offset||[0,0],r=e.targetOffset||[0,0]}c.adjustX=a.adjustX&&M,c.adjustY=a.adjustY&&k,(c.adjustX||c.adjustY)&&(p=NA(m,f,d,c))}return p.width!==f.width&&Y.css(l,"width",Y.width(l)+p.width-f.width),p.height!==f.height&&Y.css(l,"height",Y.height(l)+p.height-f.height),Y.offset(l,{left:p.left,top:p.top},{useCssRight:e.useCssRight,useCssBottom:e.useCssBottom,useCssTransform:e.useCssTransform,ignoreShake:e.ignoreShake}),{points:s,offset:o,targetOffset:r,overflow:c}}function VA(i,t,e){var n,s,o=Y.getDocument(i),r=o.defaultView||o.parentWindow,a=Y.getWindowScrollLeft(r),l=Y.getWindowScrollTop(r),c=Y.viewportWidth(r),h=Y.viewportHeight(r);"pageX"in t?n=t.pageX:n=a+t.clientX,"pageY"in t?s=t.pageY:s=l+t.clientY;var u={left:n,top:s,width:0,height:0},d=n>=0&&n<=a+c&&s>=0&&s<=l+h,f=[e.points[0],"cc"];return QA(i,u,Ru(Ru({},e),{},{points:f}),d)}const zA=`.x6-widget-dnd {
|
|
247
247
|
position: absolute;
|
|
248
248
|
top: -10000px;
|
|
249
249
|
left: -10000px;
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
background: transparent;
|
|
263
263
|
box-shadow: none;
|
|
264
264
|
}
|
|
265
|
-
`,ju={getDragNode:s=>s.clone(),getDropNode:s=>s.clone()};class vr extends Ut{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(t){super(),this.name="dnd",this.options=Object.assign(Object.assign({},ju),t),this.init()}init(){Me(this.name,vA),this.container=document.createElement("div"),O(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new S(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Mt(this.container,this.draggingGraph.container)}start(t,e){var n;const i=e;i.preventDefault(),this.targetModel.startBatch("dnd"),O(this.container,"dragging"),Yt(this.container,this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,i.clientX,i.clientY);const o=this.updateNodePosition(i.clientX,i.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:i,node:t,cell:t,view:this.draggingView,x:o.x,y:o.y}),(n=this.draggingNode)===null||n===void 0||n.on("change:position",this.snap,this)),this.delegateDocumentEvents(au,i.data)}isSnaplineEnabled(){var t;return(t=this.snapline)===null||t===void 0?void 0:t.isEnabled()}prepareDragging(t,e,n){const i=this.draggingGraph,o=i.model,r=this.options.getDragNode(t,{sourceNode:t,draggingGraph:i,targetGraph:this.targetGraph});r.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const h=this.targetGraph.transform.getScale();i.scale(h.sx,h.sy),a*=Math.max(h.sx,h.sy)}else i.scale(1,1);this.clearDragging(),o.resetCells([r]);const l=i.findViewByCell(r);l.undelegateEvents(),l.cell.off("changed"),i.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const c=l.getBBox();this.geometryBBox=l.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(c.getTopLeft()),this.draggingNode=r,this.draggingView=l,this.draggingBBox=r.getBBox(),this.padding=a,this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=this.delta,i=this.geometryBBox,o=this.padding||5,r={left:t-n.x-i.width/2-o,top:e-n.y-i.height/2-o};this.draggingGraph&&xA(this.container,{clientX:r.left,clientY:r.top},{points:["tl"]})}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),i=this.draggingBBox;return i&&(n.x-=i.width/2,n.y-=i.height/2,this.draggingNode.position(n.x,n.y)),n}snap({cell:t,current:e,options:n}){const i=t;if(n.snapped){const o=this.draggingBBox;i.position(o.x+n.tx,o.y+n.ty,{silent:!0}),this.draggingView.translate(),i.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onMouseMove(t){this.onDragging(t)}onMouseUp(t){this.onDragEnd(t)}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),i=n.clientX,o=n.clientY;this.updateGraphPosition(i,o);const r=this.updateNodePosition(i,o),a=this.targetGraph.options.embedding.enabled,l=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:i,y:o});if(a){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const c=e.getEventData(n);l?e.processEmbedding(n,c):e.clearEmbedding(c),this.candidateEmbedView=c.candidateEmbedView}this.isSnaplineEnabled()&&(l?this.snapline.snapOnMoving({e:n,view:e,x:r.x,y:r.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),i=this.draggingView,o=this.draggingBBox,r=this.snapOffset;let a=o.x,l=o.y;r&&(a+=r.x,l+=r.y),e.position(a,l,{silent:!0});const c=this.drop(e,{x:n.clientX,y:n.clientY}),h=u=>{u?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&i&&(i.setEventData(n,{cell:u,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),i.finalizeEmbedding(n,i.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};uo(c)?(this.undelegateDocumentEvents(),c.then(h)):h(c)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),st(this.container,"dragging"),Gt(this.container))}onDropInvalid(){const t=this.draggingNode;t&&this.onDropped(t)}isInsideValidArea(t){let e,n=null;const i=this.targetGraph,o=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const r=n==null?void 0:n.containsPoint(t);if(o)if(o.options.autoResize)e=this.getDropArea(o.container);else{const a=this.getDropArea(o.container);e=this.getDropArea(i.container).intersectsWithRect(a)}else e=this.getDropArea(i.container);return!r&&e&&e.containsPoint(t)}getDropArea(t){const e=yn(t),n=document.body.scrollTop||document.documentElement.scrollTop,i=document.body.scrollLeft||document.documentElement.scrollLeft;return I.create({x:e.left+parseInt($(t,"border-left-width"),10)-i,y:e.top+parseInt($(t,"border-top-width"),10)-n,width:t.clientWidth,height:t.clientHeight})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,i=n.model,o=n.clientToLocal(e),r=this.sourceNode,a=this.options.getDropNode(t,{sourceNode:r,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=a.getBBox();o.x+=l.x-l.width/2,o.y+=l.y-l.height/2;const c=this.snapOffset?1:n.getGridSize();a.position(ie(o.x,c),ie(o.y,c)),a.removeZIndex();const h=this.options.validateNode,u=h?h(a,{sourceNode:r,draggingNode:t,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph}):!0;return typeof u=="boolean"?u?(i.addCell(a,{stencil:this.cid}),a):null:ey(u).then(d=>d?(i.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Be(this.name)}}H([_()],vr.prototype,"dispose",null),S.prototype.toSVG=function(s,t){const e=this.getPlugin("export");e&&e.toSVG(s,t)},S.prototype.toSVGAsync=function(s){return Qs(this,void 0,void 0,function*(){return new Promise(t=>{this.toSVG(t,s)})})},S.prototype.toPNG=function(s,t){const e=this.getPlugin("export");e&&e.toPNG(s,t)},S.prototype.toPNGAsync=function(s){return Qs(this,void 0,void 0,function*(){return new Promise(t=>{this.toPNG(t,s)})})},S.prototype.toJPEG=function(s,t){const e=this.getPlugin("export");e&&e.toJPEG(s,t)},S.prototype.toJPEGAsync=function(s){return Qs(this,void 0,void 0,function*(){return new Promise(t=>{this.toJPEG(t,s)})})},S.prototype.exportPNG=function(s,t){const e=this.getPlugin("export");e&&e.exportPNG(s,t)},S.prototype.exportJPEG=function(s,t){const e=this.getPlugin("export");e&&e.exportJPEG(s,t)},S.prototype.exportSVG=function(s,t){const e=this.getPlugin("export");e&&e.exportSVG(s,t)};class EA extends Nt{constructor(){super(...arguments),this.name="export"}get view(){return this.graph.view}init(t){this.graph=t}exportPNG(t="chart",e={}){this.toPNG(n=>{ho(n,t)},e)}exportJPEG(t="chart",e={}){this.toJPEG(n=>{ho(n,t)},e)}exportSVG(t="chart",e={}){this.toSVG(n=>{ho(Zb(n),t)},e)}toSVG(t,e={}){this.notify("before:export",e),Object.hasOwn(e,"copyStyles")||(e.copyStyles=!0),Object.hasOwn(e,"serializeImages")||(e.serializeImages=!0);const n=this.view.svg,i=L.create(n).clone();let o=i.node;const r=i.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),l=e.preserveDimensions;if(l){const u=typeof l=="boolean"?a:l;i.attr({width:u.width,height:u.height})}if(i.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),r.removeAttribute("transform"),e.copyStyles){const u=n.ownerDocument,d=Array.from(n.querySelectorAll("*")),f=Array.from(o.querySelectorAll("*")),p=u.implementation.createHTMLDocument("x6-export-defaults"),m=p.importNode(n,!0);p.body.appendChild(m);const b=Array.from(m.querySelectorAll("*")),y={};b.forEach((A,x)=>{const v=window.getComputedStyle(A,null),B={};for(let E=0;E<v.length;E+=1){const M=v[E],k=v.getPropertyValue(M);B[M]=k}y[x]=B});const C={};d.forEach((A,x)=>{const v=window.getComputedStyle(A,null),B=y[x]||{},E={};for(let M=0;M<v.length;M+=1){const k=v[M],T=v.getPropertyValue(k);T!==B[k]&&(E[k]=T)}C[x]=E}),f.forEach((A,x)=>{$(A,C[x])})}const c=e.stylesheet;if(typeof c=="string"){const u=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(c);i.prepend(L.create("style",{type:"text/css"},[u]))}const h=()=>{const u=e.beforeSerialize;if(typeof u=="function"){const f=D(u,this.graph,o);f instanceof SVGSVGElement&&(o=f)}const d=new XMLSerializer().serializeToString(o).replace(/ /g," ");this.notify("after:export",e),t(d)};if(e.serializeImages){const u=i.find("image").map(d=>new Promise(f=>{const p=d.attr("xlink:href")||d.attr("href");qb(p,(m,b)=>{!m&&b&&(d.attr("xlink:href",b),d.attr("href",b)),f()})}));Promise.all(u).then(h)}else h()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const i=ne(e.padding);e.width&&e.height&&(i.left+i.right>=e.width&&(i.left=i.right=0),i.top+i.bottom>=e.height&&(i.top=i.bottom=0));const o=new I(-i.left,-i.top,i.left+i.right,i.top+i.bottom);if(e.width&&e.height){const h=n.width+i.left+i.right,u=n.height+i.top+i.bottom;o.scale(h/e.width,u/e.height)}n=I.create(n).moveAndExpand(o);const r=typeof e.width=="number"&&typeof e.height=="number"?{width:e.width,height:e.height}:n;let a=e.ratio?e.ratio:1;(!Number.isFinite(a)||a===0)&&(a=1);const l={width:Math.max(Math.round(r.width*a),1),height:Math.max(Math.round(r.height*a),1)};{const h=document.createElement("canvas"),u=h.getContext("2d");h.width=l.width,h.height=l.height;const d=l.width-1,f=l.height-1;u.fillStyle="rgb(1,1,1)",u.fillRect(d,f,1,1);const p=u.getImageData(d,f,1,1).data;if(p[0]!==1||p[1]!==1||p[2]!==1)throw new Error("size exceeded")}const c=new Image;c.onload=()=>{const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const u=h.getContext("2d");u.fillStyle=e.backgroundColor||"white",u.fillRect(0,0,l.width,l.height);try{u.drawImage(c,0,0,l.width,l.height);const d=h.toDataURL(e.type,e.quality);t(d)}catch{}},this.toSVG(h=>{c.src=`data:image/svg+xml,${encodeURIComponent(h)}`},Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.off()}}H([_()],EA.prototype,"dispose",null);function Le(s){return s==="cell:added"}function _e(s){return s==="cell:removed"}function Si(s){return s!=null&&s.startsWith("cell:change:")}function SA(s){const t=["cell:added","cell:removed","cell:change:*"],e=["batch:start","batch:stop"],n=s.eventNames?s.eventNames.filter(i=>!(Si(i)||t.includes(i)||e.includes(i))):t;return Object.assign(Object.assign({enabled:!0},s),{eventNames:n,applyOptionsList:s.applyOptionsList||["propertyPath"],revertOptionsList:s.revertOptionsList||["propertyPath"]})}function Gu(s){const t=[];for(let e=0,n=s.length;e<n;e+=1){const i=s[e];let o=null;if(Le(i.event)){const r=i.data.id;for(let a=0;a<e;a+=1)if(s[a].data.id===r){o=a;break}}o!==null?t.splice(o,0,i):t.push(i)}return t}class Yu extends Nt{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=t.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every(e=>this.isValidCommand(e)):this.isValidCommand(t)}isValidCommand(t){if(t.options&&t.options.validation===!1)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach(i=>{let o=0;const r=a=>{const l=i[o];o+=1;try{l?l(a,t,r):n=a}catch(c){r(c)}};r(n)}),n?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1):!0}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach(i=>{if(typeof i!="function")throw new Error(`${n.join(" ")} requires callback functions.`)}),n.forEach(i=>{this.map[i]==null&&(this.map[i]=[]),this.map[i].push(e)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}H([_()],Yu.prototype,"dispose",null),S.prototype.isHistoryEnabled=function(){const s=this.getPlugin("history");return s?s.isEnabled():!1},S.prototype.enableHistory=function(){const s=this.getPlugin("history");return s&&s.enable(),this},S.prototype.disableHistory=function(){const s=this.getPlugin("history");return s&&s.disable(),this},S.prototype.toggleHistory=function(s){const t=this.getPlugin("history");return t&&t.toggleEnabled(s),this},S.prototype.undo=function(s){const t=this.getPlugin("history");return t&&t.undo(s),this},S.prototype.redo=function(s){const t=this.getPlugin("history");return t&&t.redo(s),this},S.prototype.undoAndCancel=function(s){const t=this.getPlugin("history");return t&&t.cancel(s),this},S.prototype.canUndo=function(){const s=this.getPlugin("history");return s?s.canUndo():!1},S.prototype.canRedo=function(){const s=this.getPlugin("history");return s?s.canRedo():!1},S.prototype.cleanHistory=function(s){const t=this.getPlugin("history");return t&&t.clean(s),this},S.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},S.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},S.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},S.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};class Hu extends Nt{constructor(t={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:e=0}=t;this.stackSize=e,this.options=SA(t),this.validator=new Yu({history:this,cancelInvalid:this.options.cancelInvalid})}init(t){this.graph=t,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStackPush(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const t=this.undoStack.length;return this.stackSize-t}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}get disabled(){return this.options.enabled!==!0}validate(t,...e){return this.validator.validate(t,...e),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:t?t.batch:!1,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?Gu(t):[t];for(let i=n.length-1;i>=0;i-=1){const o=n[i],r=Object.assign(Object.assign({},e),yl(o.options,this.options.revertOptionsList||[]));this.executeCommand(o,!0,r)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?Gu(t):[t];for(let i=0;i<n.length;i+=1){const o=n[i],r=Object.assign(Object.assign({},e),yl(o.options,this.options.applyOptionsList||[]));this.executeCommand(o,!1,r)}this.freezed=!1}executeCommand(t,e,n){const i=this.model,o=i.getCell(t.data.id),r=t.event;if(Le(r)&&e||_e(r)&&!e)o&&o.remove(n);else if(Le(r)&&!e||_e(r)&&e){const a=t.data;a.node?i.addNode(a.props,n):a.edge&&i.addEdge(a.props,n)}else if(Si(r)){const a=t.data,l=a.key;if(l&&o){const c=e?a.prev[l]:a.next[l];a.key==="attrs"&&this.ensureUndefinedAttrs(c,e?a.next[l]:a.prev[l])&&(n.dirty=!0),o.prop(l,c,n)}}else{const a=this.options.executeCommand;a&&D(a,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,i=n.options||{};if(i.dryrun||Le(t)&&this.options.ignoreAdd||_e(t)&&this.options.ignoreRemove||Si(t)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(o!=null&&D(o,this,t,e)===!1)return;t==="cell:change:*"&&(t=`cell:change:${n.key}`);const r=n.cell,a=Kt.isModel(r);let l;if(this.batchCommands){l=this.batchCommands[Math.max(this.lastBatchIndex,0)];const h=a&&!l.modelChange||l.data.id!==r.id,u=l.event!==t;if(this.lastBatchIndex>=0&&(h||u)){const d=this.batchCommands.findIndex(f=>(a&&f.modelChange||f.data.id===r.id)&&f.event===t);d<0||Le(t)||_e(t)?l=this.createCommand({batch:!0}):(l=this.batchCommands[d],this.batchCommands.splice(d,1)),this.batchCommands.push(l),this.lastBatchIndex=this.batchCommands.length-1}}else l=this.createCommand({batch:!1});if(Le(t)||_e(t)){const h=l.data;return l.event=t,l.options=i,h.id=r.id,h.props=at(r.toJSON()),r.isEdge()?h.edge=!0:r.isNode()&&(h.node=!0),this.push(l,i)}if(Si(t)){const h=e.key,u=l.data;return(!l.batch||!l.event)&&(l.event=t,l.options=i,u.key=h,u.prev==null&&(u.prev={}),u.prev[h]=at(r.previous(h)),a?l.modelChange=!0:u.id=r.id),u.next==null&&(u.next={}),u.next[h]=at(r.prop(h)),this.push(l,i)}const c=this.options.afterAddCommand;c&&D(c,this,t,e,l),this.push(l,i)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];for(;e.length>0;){const i=e.shift(),o=i.event,r=i.data.id;if(o!=null&&(r!=null||i.modelChange)){if(Le(o)){const a=e.findIndex(l=>_e(l.event)&&l.data.id===r);if(a>=0){e=e.filter((l,c)=>a<c||l.data.id!==r);continue}}else if(_e(o)){const a=e.findIndex(l=>Le(l.event)&&l.data.id===r);if(a>=0){e.splice(a,1);continue}}else if(Si(o)){const a=i.data;if(me(a.prev,a.next))continue}n.push(i)}}return n}notify(t,e,n){const i=e==null?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:i,options:n}),this.graph.trigger(`history:${t}`,{cmds:i,options:n}),this.emit("change",{cmds:i,options:n}),this.graph.trigger("history:change",{cmds:i,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const i=new Set(e.map(r=>r.event));if(i.size!==2||!i.has("cell:change:parent")||!i.has("cell:change:children")||!e.every(r=>{var a;return r.batch&&((a=r.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(n)||n.length!==1)return;const o=n[0];o.event!=="cell:change:position"||!(!((t=o.options)===null||t===void 0)&&t.ui)||(n.push(...e),this.undoStack.pop())}undoStackPush(t){if(this.stackSize===0){this.undoStack.push(t);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(t)}ensureUndefinedAttrs(t,e){let n=!1;return t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(i=>{t[i]===void 0&&e[i]!==void 0?(t[i]=void 0,n=!0):typeof t[i]=="object"&&typeof e[i]=="object"&&(n=this.ensureUndefinedAttrs(t[i],e[i]))}),n}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}H([_()],Hu.prototype,"dispose",null);function MA(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var _u={exports:{}};(function(s){(function(t,e,n){if(!t)return;for(var i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,c=1;c<20;++c)i[111+c]="f"+c;for(c=0;c<=9;++c)i[c+96]=c.toString();function h(E,M,k){if(E.addEventListener){E.addEventListener(M,k,!1);return}E.attachEvent("on"+M,k)}function u(E){if(E.type=="keypress"){var M=String.fromCharCode(E.which);return E.shiftKey||(M=M.toLowerCase()),M}return i[E.which]?i[E.which]:o[E.which]?o[E.which]:String.fromCharCode(E.which).toLowerCase()}function d(E,M){return E.sort().join(",")===M.sort().join(",")}function f(E){var M=[];return E.shiftKey&&M.push("shift"),E.altKey&&M.push("alt"),E.ctrlKey&&M.push("ctrl"),E.metaKey&&M.push("meta"),M}function p(E){if(E.preventDefault){E.preventDefault();return}E.returnValue=!1}function m(E){if(E.stopPropagation){E.stopPropagation();return}E.cancelBubble=!0}function b(E){return E=="shift"||E=="ctrl"||E=="alt"||E=="meta"}function y(){if(!l){l={};for(var E in i)E>95&&E<112||i.hasOwnProperty(E)&&(l[i[E]]=E)}return l}function C(E,M,k){return k||(k=y()[E]?"keydown":"keypress"),k=="keypress"&&M.length&&(k="keydown"),k}function A(E){return E==="+"?["+"]:(E=E.replace(/\+{2}/g,"+plus"),E.split("+"))}function x(E,M){var k,T,P,R=[];for(k=A(E),P=0;P<k.length;++P)T=k[P],a[T]&&(T=a[T]),M&&M!="keypress"&&r[T]&&(T=r[T],R.push("shift")),b(T)&&R.push(T);return M=C(T,R,M),{key:T,modifiers:R,action:M}}function v(E,M){return E===null||E===e?!1:E===M?!0:v(E.parentNode,M)}function B(E){var M=this;if(E=E||e,!(M instanceof B))return new B(E);M.target=E,M._callbacks={},M._directMap={};var k={},T,P=!1,R=!1,F=!1;function K(Q){Q=Q||{};var q=!1,tt;for(tt in k){if(Q[tt]){q=!0;continue}k[tt]=0}q||(F=!1)}function Z(Q,q,tt,J,et,mt){var W,bt,Ee=[],zt=tt.type;if(!M._callbacks[Q])return[];for(zt=="keyup"&&b(Q)&&(q=[Q]),W=0;W<M._callbacks[Q].length;++W)if(bt=M._callbacks[Q][W],!(!J&&bt.seq&&k[bt.seq]!=bt.level)&&zt==bt.action&&(zt=="keypress"&&!tt.metaKey&&!tt.ctrlKey||d(q,bt.modifiers))){var Iv=!J&&bt.combo==et,Tv=J&&bt.seq==J&&bt.level==mt;(Iv||Tv)&&M._callbacks[Q].splice(W,1),Ee.push(bt)}return Ee}function Y(Q,q,tt,J){M.stopCallback(q,q.target||q.srcElement,tt,J)||Q(q,tt)===!1&&(p(q),m(q))}M._handleKey=function(Q,q,tt){var J=Z(Q,q,tt),et,mt={},W=0,bt=!1;for(et=0;et<J.length;++et)J[et].seq&&(W=Math.max(W,J[et].level));for(et=0;et<J.length;++et){if(J[et].seq){if(J[et].level!=W)continue;bt=!0,mt[J[et].seq]=1,Y(J[et].callback,tt,J[et].combo,J[et].seq);continue}bt||Y(J[et].callback,tt,J[et].combo)}var Ee=tt.type=="keypress"&&R;tt.type==F&&!b(Q)&&!Ee&&K(mt),R=bt&&tt.type=="keydown"};function Et(Q){typeof Q.which!="number"&&(Q.which=Q.keyCode);var q=u(Q);if(q){if(Q.type=="keyup"&&P===q){P=!1;return}M.handleKey(q,f(Q),Q)}}function Qt(){clearTimeout(T),T=setTimeout(K,1e3)}function Lt(Q,q,tt,J){k[Q]=0;function et(zt){return function(){F=zt,++k[Q],Qt()}}function mt(zt){Y(tt,zt,Q),J!=="keyup"&&(P=u(zt)),setTimeout(K,10)}for(var W=0;W<q.length;++W){var bt=W+1===q.length,Ee=bt?mt:et(J||x(q[W+1]).action);pt(q[W],Ee,J,Q,W)}}function pt(Q,q,tt,J,et){M._directMap[Q+":"+tt]=q,Q=Q.replace(/\s+/g," ");var mt=Q.split(" "),W;if(mt.length>1){Lt(Q,mt,q,tt);return}W=x(Q,tt),M._callbacks[W.key]=M._callbacks[W.key]||[],Z(W.key,W.modifiers,{type:W.action},J,Q,et),M._callbacks[W.key][J?"unshift":"push"]({callback:q,modifiers:W.modifiers,action:W.action,seq:J,level:et,combo:Q})}M._bindMultiple=function(Q,q,tt){for(var J=0;J<Q.length;++J)pt(Q[J],q,tt)},h(E,"keypress",Et),h(E,"keydown",Et),h(E,"keyup",Et)}B.prototype.bind=function(E,M,k){var T=this;return E=E instanceof Array?E:[E],T._bindMultiple.call(T,E,M,k),T},B.prototype.unbind=function(E,M){var k=this;return k.bind.call(k,E,function(){},M)},B.prototype.trigger=function(E,M){var k=this;return k._directMap[E+":"+M]&&k._directMap[E+":"+M]({},E),k},B.prototype.reset=function(){var E=this;return E._callbacks={},E._directMap={},E},B.prototype.stopCallback=function(E,M){var k=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||v(M,k.target))return!1;if("composedPath"in E&&typeof E.composedPath=="function"){var T=E.composedPath()[0];T!==E.target&&(M=T)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},B.prototype.handleKey=function(){var E=this;return E._handleKey.apply(E,arguments)},B.addKeycodes=function(E){for(var M in E)E.hasOwnProperty(M)&&(i[M]=E[M]);l=null},B.init=function(){var E=B(e);for(var M in E)M.charAt(0)!=="_"&&(B[M]=function(k){return function(){return E[k].apply(E,arguments)}}(M))},B.init(),t.Mousetrap=B,s.exports&&(s.exports=B)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(_u);var BA=_u.exports;const kA=MA(BA);function Wu(s,t,e){const n=s.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left");return t?D(t,e,n):n}function qu(s){var t;const e=s.target,n=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase();let i=["input","textarea"].includes(n);return j(e,"contenteditable")==="true"&&(i=!0),i}function IA(s,t,e){const n=s.target,i=s.currentTarget;return n?n===t||i===t||n===document.body?!0:wo(e,n):!1}function TA(s){const t=new kA(s.target),e=t.stopCallback;return t.stopCallback=(n,i,o)=>s.isEnabledForEvent(n)?e?e.call(t,n,i,o):!1:!0,t}class Xu extends Cn{get graph(){return this.options.graph}constructor(t){super(),this.options=t;const e=this.graph.getPlugin("scroller");this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus.bind(this),this),this.graph.on("blank:mouseup",this.focus.bind(this),this)),this.mousetrap=TA(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}clear(){this.mousetrap.reset()}trigger(t,e){this.mousetrap.trigger(Wu(t,this.options.format,this.graph),e)}focus(t){if(qu(t.e))return;this.target.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(e=>Wu(e,this.options.format,this.graph))}isEnabledForEvent(t){const e=!this.disabled&&IA(t,this.target,this.container),n=qu(t);if(e){if(n&&(t.key==="Backspace"||t.key==="Delete"))return!1;if(this.options.guard)return D(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}H([_()],Xu.prototype,"dispose",null),S.prototype.isKeyboardEnabled=function(){const s=this.getPlugin("keyboard");return s?s.isEnabled():!1},S.prototype.enableKeyboard=function(){const s=this.getPlugin("keyboard");return s&&s.enable(),this},S.prototype.disableKeyboard=function(){const s=this.getPlugin("keyboard");return s&&s.disable(),this},S.prototype.toggleKeyboard=function(s){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(s),this},S.prototype.bindKey=function(s,t,e){const n=this.getPlugin("keyboard");return n&&n.bindKey(s,t,e),this},S.prototype.unbindKey=function(s,t){const e=this.getPlugin("keyboard");return e&&e.unbindKey(s,t),this},S.prototype.clearKeys=function(){const s=this.getPlugin("keyboard");return s&&s.clear(),this},S.prototype.triggerKey=function(s,t){const e=this.getPlugin("keyboard");return e&&e.trigger(s,t),this};class $u extends Cn{constructor(t={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},t)}init(t){this.keyboardImpl=new Xu(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}bindKey(t,e,n){return this.keyboardImpl.on(t,e,n),this}trigger(t,e){return this.keyboardImpl.trigger(t,e),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(t,e){return this.keyboardImpl.off(t,e),this}dispose(){this.keyboardImpl.dispose()}}H([_()],$u.prototype,"dispose",null);class Zu extends Ut{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(re.box)}get $boxes(){return by(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(t){super(),this.updateThrottleTimer=null,this.isDragging=!1,this.batchUpdating=!1,this.dragRafId=null,this.transformRafId=null,this.dragPendingOffset=null,this.containerOffsetX=0,this.containerOffsetY=0,this.translatingCache=null,this.options=t,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new ar([],{comparator:PA}),this.options.collection=this.collection),this.boxCount=0,this.boxesUpdated=!1,this.createContainer(),this.startListening()}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`mousedown .${this.prefixClassName(re.inner)}`]:"onSelectionContainerMouseDown",[`touchstart .${this.prefixClassName(re.inner)}`]:"onSelectionContainerMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),this.transformRafId!=null&&(cancelAnimationFrame(this.transformRafId),this.transformRafId=null),this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),this.transformRafId==null&&(this.transformRafId=window.requestAnimationFrame(()=>{this.transformRafId=null,!this.isDragging&&this.collection.length>0&&this.refreshSelectionBoxes()}))}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:i}=this.options,{ui:o,selection:r,translateBy:a,snapped:l}=e,c=(n!==!0||i&&this.getPointerEventsValue(i)==="none")&&!this.translating&&!r,h=o&&a&&t.id===a;if(c&&(h||l)){this.translating=!0;const u=t.position(),d=t.previous("position");if(d){const f=u.x-d.x,p=u.y-d.y;(f!==0||p!==0)&&this.translateSelectedNodes(f,p,t,e)}this.translating=!1}}onModelUpdated({removed:t}){t!=null&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){this.batchUpdating=!!e.batch;const n=this.cells,i=this.filter(Array.isArray(t)?t:[t]),o={},r={};for(const c of n)o[c.id]=c;for(const c of i)r[c.id]=c;const a=[],l=[];return i.forEach(c=>{o[c.id]||a.push(c)}),n.forEach(c=>{r[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),this.updateContainer(),this.batchUpdating=!1,this}return this.clean(e)}clean(t={}){return this.length&&this.unselect(this.cells,t),this.containerOffsetX=0,this.containerOffsetY=0,$(this.container,"transform",""),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){t=this.normalizeEvent(t),this.clean();let e,n;const i=this.graph.container;if(t.offsetX!=null&&t.offsetY!=null&&i.contains(t.target))e=t.offsetX,n=t.offsetY;else{const o=yn(i),r=i.scrollLeft,a=i.scrollTop;e=t.clientX-o.left+window.pageXOffset+r,n=t.clientY-o.top+window.pageYOffset+a}$(this.container,{top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(td,t.data)}filter(t){const e=this.options.filter;return t.filter(n=>Array.isArray(e)?e.some(i=>typeof i=="string"?n.shape===i:n.id===i.id):typeof e=="function"?D(e,this.graph,n):!0)}stopSelecting(t){this.isDragging=!1,this.boxesUpdated=!1,this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null);const e=this.graph;switch(this.getEventData(t).action){case"selecting":{let o=b6(this.container),r=y6(this.container);const a=yn(this.container),l=e.pageToLocal(a.left,a.top),c=e.transform.getScale();o/=c.sx,r/=c.sy;const h=new I(l.x,l.y,o,r),u=this.getCellViewsInArea(h).map(d=>d.cell);this.reset(u,{batch:!0}),this.hideRubberband();break}case"translating":{const o=e.snapToGrid(t.clientX,t.clientY);if(this.dragPendingOffset){const r=this.dragPendingOffset;this.dragPendingOffset=null,this.translateSelectedNodes(r.dx,r.dy),this.updateContainerPosition(r)}this.dragRafId!=null&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=null),this.containerOffsetX=0,this.containerOffsetY=0,$(this.container,"transform",""),this.graph.model.stopBatch("move-selection"),this.translatingCache=null,this.notifyBoxEvent("box:mouseup",t,o.x,o.y),this.repositionSelectionBoxesInPlace();break}default:{this.clean();break}}this.undelegateDocumentEvents()}onMouseUp(t){const e=this.normalizeEvent(t);this.getEventData(e)&&this.stopSelecting(t)}onSelectionBoxMouseDown(t){this.handleSelectionMouseDown(t,!0)}onSelectionContainerMouseDown(t){this.handleSelectionMouseDown(t,!1)}handleSelectionMouseDown(t,e){var n;t.stopPropagation(),(n=t.preventDefault)===null||n===void 0||n.call(t);const i=this.normalizeEvent(t),o=this.graph.snapToGrid(i.clientX,i.clientY);if(!e&&Te(i,this.options.multipleSelectionModifiers)){const l=this.graph.findViewsFromPoint(o.x,o.y).find(c=>c.isNodeView());if(l){const c=l.cell;this.isSelected(c)?this.unselect(c,{ui:!0}):this.options.multiple===!1?this.reset(c,{ui:!0}):this.select(c,{ui:!0})}return}this.options.movable&&this.startTranslating(i);let r=e?this.getCellViewFromElem(i.target):null;if(!r&&(r=this.graph.findViewsFromPoint(o.x,o.y).filter(l=>this.isSelected(l.cell))[0]||null,!r)){const l=this.collection.first();l&&(r=this.graph.renderer.findViewByCell(l))}r&&(this.setEventData(i,{activeView:r}),e&&this.notifyBoxEvent("box:mousedown",i,o.x,o.y),this.delegateDocumentEvents(td,i.data))}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y}),this.prepareTranslatingCache()}getRestrictArea(){const t=this.graph.options.translating.restrict,e=typeof t=="function"?D(t,this.graph,null):t;return typeof e=="number"?this.graph.transform.getGraphArea().inflate(e):e===!0?this.graph.transform.getGraphArea():e||null}prepareTranslatingCache(){const t=this.collection.toArray().filter(r=>r.isNode()),e=new Set(t.map(r=>r.id)),n=this.collection.toArray().filter(r=>r.isEdge()),i=new Set,o=r=>r.getVertices().length>0||!r.getSourceCellId()||!r.getTargetCellId();this.graph.model.getEdges().forEach(r=>{const a=r.getSourceCellId(),l=r.getTargetCellId();(a!=null&&e.has(a)||l!=null&&e.has(l))&&o(r)&&i.add(r)}),n.forEach(r=>{o(r)&&i.add(r)}),this.translatingCache={selectedNodes:t,nodeIdSet:e,edgesToTranslate:Array.from(i)}}getSelectionOffset(t,e){let n=t.x-e.clientX,i=t.y-e.clientY;const o=this.getRestrictArea();if(o){const r=this.collection.toArray(),a=G.getCellsBBox(r,{deep:!0})||I.create(),l=o.x-a.x,c=o.y-a.y,h=o.x+o.width-(a.x+a.width),u=o.y+o.height-(a.y+a.height);if(n<l&&(n=l),i<c&&(i=c),h<n&&(n=h),u<i&&(i=u),!this.options.following){const d=t.x-e.originX,f=t.y-e.originY;n=d<=l||d>=h?0:n,i=f<=c||f>=u?0:i}}return{dx:n,dy:i}}updateSelectedNodesPosition(t){t.dx===0&&t.dy===0||(this.dragPendingOffset?(this.dragPendingOffset.dx+=t.dx,this.dragPendingOffset.dy+=t.dy):this.dragPendingOffset={dx:t.dx,dy:t.dy},this.dragRafId==null&&(this.dragRafId=requestAnimationFrame(()=>{const e=this.dragPendingOffset||{dx:0,dy:0};this.dragPendingOffset=null,this.dragRafId=null,this.translateSelectedNodes(e.dx,e.dy),this.updateContainerPosition(e),this.boxesUpdated=!0,this.isDragging=!0})))}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");return n!=null&&n.autoScroll?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e);switch(n.action){case"selecting":{const o=n;o.moving!==!0&&(Yt(this.container,this.graph.container),this.showRubberband(),o.moving=!0);const{scrollerX:r,scrollerY:a}=this.autoScrollGraph(e.clientX,e.clientY);o.scrollerX+=r,o.scrollerY+=a;const l=e.clientX-o.clientX+o.scrollerX,c=e.clientY-o.clientY+o.scrollerY;$(this.container,{left:l<0?o.offsetX+l:o.offsetX,top:c<0?o.offsetY+c:o.offsetY,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{this.isDragging=!0;const o=this.graph.snapToGrid(e.clientX,e.clientY),r=n,a=this.getSelectionOffset(o,r);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(r.clientX=o.x),a.dy&&(r.clientY=o.y),this.notifyBoxEvent("box:mousemove",t,o.x,o.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,i){var o,r;const a={},l=[];if(n&&(a[n.id]=!0),this.collection.toArray().forEach(m=>{m.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0})}),i!=null&&i.translateBy){const m=this.graph.getCellById(i.translateBy);m&&(a[m.id]=!0,m.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0}),l.push(m))}const c=Object.assign(Object.assign({},i),{selection:this.cid,exclude:l}),h=(o=this.translatingCache)===null||o===void 0?void 0:o.selectedNodes,u=(h??this.collection.toArray().filter(m=>m.isNode())).filter(m=>!a[m.id]);u.forEach(m=>{m.translate(t,e,c)});const d=(r=this.translatingCache)===null||r===void 0?void 0:r.edgesToTranslate,f=new Set;if(d)d.forEach(m=>{f.add(m)});else{const m=new Set(u.map(b=>b.id));this.graph.model.getEdges().forEach(b=>{const y=b.getSourceCellId(),C=b.getTargetCellId(),A=y?m.has(y):!1,x=C?m.has(C):!1;(A||x)&&(b.getVertices().length>0||(!y||!C))&&f.add(b)})}this.collection.toArray().filter(m=>m.isEdge()&&!a[m.id]).forEach(m=>{const b=m.getVertices().length>0,y=!m.getSourceCellId()||!m.getTargetCellId();(b||y)&&f.add(m)}),f.forEach(m=>{m.translate(t,e,c)})}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=i.concat(e.model.getNodesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),this.options.rubberEdge&&(i=i.concat(e.model.getEdgesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),i}notifyBoxEvent(t,e,n,i){const r=this.getEventData(e).activeView;this.trigger(t,{e,view:r,x:n,y:i,cell:r.cell})}getSelectedClassName(t){return this.prefixClassName(`${t.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(Gt(this.container.querySelector(`[data-cell-id="${t.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(e=>{this.removeCellUnSelectedClassName(e)}),this.hide(),Gt(this.$boxes),this.boxCount=0}hide(){st(this.container,this.prefixClassName(re.rubberband)),st(this.container,this.prefixClassName(re.selected))}showRubberband(){O(this.container,this.prefixClassName(re.rubberband))}hideRubberband(){st(this.container,this.prefixClassName(re.rubberband))}showSelected(){xo(this.container,"style"),O(this.container,this.prefixClassName(re.selected))}createContainer(){this.container=document.createElement("div"),O(this.container,this.prefixClassName(re.root)),this.options.className&&O(this.container,this.options.className),$(this.container,{willChange:"transform"}),this.selectionContainer=document.createElement("div"),O(this.selectionContainer,this.prefixClassName(re.inner)),this.selectionContent=document.createElement("div"),O(this.selectionContent,this.prefixClassName(re.content)),Mt(this.selectionContainer,this.selectionContent),j(this.selectionContainer,"data-selection-length",this.collection.length),Gl(this.container,this.selectionContainer)}updateContainerPosition(t){if(t.dx||t.dy){const e=this.graph.transform.getScale();this.containerOffsetX+=t.dx*e.sx,this.containerOffsetY+=t.dy*e.sy,$(this.container,"transform",`translate3d(${this.containerOffsetX}px, ${this.containerOffsetY}px, 0)`)}}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0};this.collection.toArray().filter(o=>this.canShowSelectionBox(o)).forEach(o=>{const r=this.graph.renderer.findViewByCell(o);if(r){const a=r.getBBox({useCellGeometry:!0});t.x=Math.min(t.x,a.x),t.y=Math.min(t.y,a.y),e.x=Math.max(e.x,a.x+a.width),e.y=Math.max(e.y,a.y+a.height)}}),$(this.selectionContainer,{position:"absolute",pointerEvents:this.options.movable?"auto":"none",cursor:this.options.movable?"move":"default",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}),j(this.selectionContainer,"data-selection-length",this.collection.length);const i=this.options.content;if(i)if(typeof i=="function"){const o=D(i,this.graph,this,this.selectionContent);o&&(this.selectionContent.innerHTML=o)}else this.selectionContent.innerHTML=i;this.collection.length>0&&!this.container.parentNode?Yt(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&this.options.showNodeSelectionBox===!0||t.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(t){return typeof t=="string"?t:t(this.cells)}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:!0}),i=this.boxClassName,o=document.createElement("div"),r=this.options.pointerEvents;O(o,i),O(o,`${i}-${t.isNode()?"node":"edge"}`),j(o,"data-cell-id",t.id),$(o,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:r?this.getPointerEventsValue(r):"auto"}),Yt(o,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){if(this.collection.length>0){if(this.isDragging)return;this.updateThrottleTimer&&clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=setTimeout(()=>{this.refreshSelectionBoxes(),this.updateThrottleTimer=null},16)}}refreshSelectionBoxes(){Gt(this.$boxes),this.boxCount=0,this.collection.toArray().forEach(t=>{this.createSelectionBox(t)}),this.updateContainer(),this.boxesUpdated=!0}repositionSelectionBoxesInPlace(){const t=this.$boxes;if(t.length===0){this.refreshSelectionBoxes();return}for(const e of t){const n=e.getAttribute("data-cell-id");if(!n)continue;const i=this.collection.get(n);if(!i)continue;const o=this.graph.renderer.findViewByCell(i);if(!o)continue;const r=o.getBBox({useCellGeometry:!0});$(e,{left:r.x,top:r.y,width:r.width,height:r.height})}this.updateContainer(),this.boxesUpdated=!0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const n=this.collection.get(e);if(n)return this.graph.renderer.findViewByCell(n)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.batchUpdating||this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(n=>{this.listenCellRemoveEvent(n),this.createSelectionBox(n)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.batchUpdating||this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach(o=>{this.trigger("cell:selected",{cell:o,options:n}),o.isNode()?this.trigger("node:selected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:selected",{cell:o,options:n,edge:o})}),e.forEach(o=>{this.trigger("cell:unselected",{cell:o,options:n}),o.isNode()?this.trigger("node:unselected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:unselected",{cell:o,options:n,edge:o})});const i={added:t,removed:e,options:n,selected:this.cells.filter(o=>!!this.graph.getCellById(o.id))};this.trigger("selection:changed",i)}dispose(){this.clean(),this.remove(),this.off()}}H([_()],Zu.prototype,"dispose",null);const Sn="widget-selection",re={root:Sn,inner:`${Sn}-inner`,box:`${Sn}-box`,content:`${Sn}-content`,rubberband:`${Sn}-rubberband`,selected:`${Sn}-selected`},td={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function PA(s){return s.getAncestors().length}const OA=`.x6-widget-selection {
|
|
265
|
+
`,ed={getDragNode:i=>i.clone(),getDropNode:i=>i.clone()};class Pr extends Jt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(t){super(),this.name="dnd",this.options=Object.assign(Object.assign({},ed),t),this.init()}init(){Be(this.name,zA),this.container=document.createElement("div"),L(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new B(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Ot(this.container,this.draggingGraph.container)}start(t,e){var n;const s=e;s.preventDefault(),this.targetModel.startBatch("dnd"),L(this.container,"dragging"),Wt(this.container,this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,s.clientX,s.clientY);const o=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:t,cell:t,view:this.draggingView,x:o.x,y:o.y}),(n=this.draggingNode)===null||n===void 0||n.on("change:position",this.snap,this)),this.delegateDocumentEvents(yu,s.data)}isSnaplineEnabled(){var t;return(t=this.snapline)===null||t===void 0?void 0:t.isEnabled()}prepareDragging(t,e,n){const s=this.draggingGraph,o=s.model,r=this.options.getDragNode(t,{sourceNode:t,draggingGraph:s,targetGraph:this.targetGraph});r.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const h=this.targetGraph.transform.getScale();s.scale(h.sx,h.sy),a*=Math.max(h.sx,h.sy)}else s.scale(1,1);this.clearDragging(),o.resetCells([r]);const l=s.findViewByCell(r);l.undelegateEvents(),l.cell.off("changed"),s.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const c=l.getBBox();this.geometryBBox=l.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(c.getTopLeft()),this.draggingNode=r,this.draggingView=l,this.draggingBBox=r.getBBox(),this.padding=a,this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=this.delta,s=this.geometryBBox,o=this.padding||5,r={left:t-n.x-s.width/2-o,top:e-n.y-s.height/2-o};this.draggingGraph&&VA(this.container,{clientX:r.left,clientY:r.top},{points:["tl"]})}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),s=this.draggingBBox;return s&&(n.x-=s.width/2,n.y-=s.height/2,this.draggingNode.position(n.x,n.y)),n}snap({cell:t,current:e,options:n}){const s=t;if(n.snapped){const o=this.draggingBBox;s.position(o.x+n.tx,o.y+n.ty,{silent:!0}),this.draggingView.translate(),s.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onMouseMove(t){this.onDragging(t)}onMouseUp(t){this.onDragEnd(t)}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),s=n.clientX,o=n.clientY;this.updateGraphPosition(s,o);const r=this.updateNodePosition(s,o),a=this.targetGraph.options.embedding.enabled,l=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:s,y:o});if(a){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const c=e.getEventData(n);l?e.processEmbedding(n,c):e.clearEmbedding(c),this.candidateEmbedView=c.candidateEmbedView}this.isSnaplineEnabled()&&(l?this.snapline.snapOnMoving({e:n,view:e,x:r.x,y:r.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),s=this.draggingView,o=this.draggingBBox,r=this.snapOffset;let a=o.x,l=o.y;r&&(a+=r.x,l+=r.y),e.position(a,l,{silent:!0});const c=this.drop(e,{x:n.clientX,y:n.clientY}),h=u=>{u?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&s&&(s.setEventData(n,{cell:u,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),s.finalizeEmbedding(n,s.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Co(c)?(this.undelegateDocumentEvents(),c.then(h)):h(c)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),at(this.container,"dragging"),_t(this.container))}onDropInvalid(){const t=this.draggingNode;t&&this.onDropped(t)}isInsideValidArea(t){let e,n=null;const s=this.targetGraph,o=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const r=n==null?void 0:n.containsPoint(t);if(o)if(o.options.autoResize)e=this.getDropArea(o.container);else{const a=this.getDropArea(o.container);e=this.getDropArea(s.container).intersectsWithRect(a)}else e=this.getDropArea(s.container);return!r&&e&&e.containsPoint(t)}getDropArea(t){const e=wn(t),n=document.body.scrollTop||document.documentElement.scrollTop,s=document.body.scrollLeft||document.documentElement.scrollLeft;return I.create({x:e.left+parseInt(nt(t,"border-left-width"),10)-s,y:e.top+parseInt(nt(t,"border-top-width"),10)-n,width:t.clientWidth,height:t.clientHeight})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,s=n.model,o=n.clientToLocal(e),r=this.sourceNode,a=this.options.getDropNode(t,{sourceNode:r,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=a.getBBox();o.x+=l.x-l.width/2,o.y+=l.y-l.height/2;const c=this.snapOffset?1:n.getGridSize();a.position(oe(o.x,c),oe(o.y,c)),a.removeZIndex();const h=this.options.validateNode,u=h?h(a,{sourceNode:r,draggingNode:t,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph}):!0;return typeof u=="boolean"?u?(s.addCell(a,{stencil:this.cid}),a):null:by(u).then(d=>d?(s.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),ke(this.name)}}X([$()],Pr.prototype,"dispose",null),B.prototype.toSVG=function(i,t){const e=this.getPlugin("export");e&&e.toSVG(i,t)},B.prototype.toSVGAsync=function(i){return js(this,void 0,void 0,function*(){return new Promise(t=>{this.toSVG(t,i)})})},B.prototype.toPNG=function(i,t){const e=this.getPlugin("export");e&&e.toPNG(i,t)},B.prototype.toPNGAsync=function(i){return js(this,void 0,void 0,function*(){return new Promise(t=>{this.toPNG(t,i)})})},B.prototype.toJPEG=function(i,t){const e=this.getPlugin("export");e&&e.toJPEG(i,t)},B.prototype.toJPEGAsync=function(i){return js(this,void 0,void 0,function*(){return new Promise(t=>{this.toJPEG(t,i)})})},B.prototype.exportPNG=function(i,t){const e=this.getPlugin("export");e&&e.exportPNG(i,t)},B.prototype.exportJPEG=function(i,t){const e=this.getPlugin("export");e&&e.exportJPEG(i,t)},B.prototype.exportSVG=function(i,t){const e=this.getPlugin("export");e&&e.exportSVG(i,t)};class FA extends zt{constructor(){super(...arguments),this.name="export"}get view(){return this.graph.view}init(t){this.graph=t}exportPNG(t="chart",e={}){this.toPNG(n=>{wo(n,t)},e)}exportJPEG(t="chart",e={}){this.toJPEG(n=>{wo(n,t)},e)}exportSVG(t="chart",e={}){this.toSVG(n=>{wo(py(n),t)},e)}toSVG(t,e={}){this.notify("before:export",e),Object.hasOwn(e,"copyStyles")||(e.copyStyles=!0),Object.hasOwn(e,"serializeImages")||(e.serializeImages=!0);const n=this.view.svg,s=K.create(n).clone();let o=s.node;const r=s.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),l=e.preserveDimensions;if(l){const u=typeof l=="boolean"?a:l;s.attr({width:u.width,height:u.height})}if(s.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),r.removeAttribute("transform"),e.copyStyles){const u=n.ownerDocument,d=Array.from(n.querySelectorAll("*")),f=Array.from(o.querySelectorAll("*")),m=u.implementation.createHTMLDocument("x6-export-defaults"),p=m.importNode(n,!0);m.body.appendChild(p);const b=Array.from(p.querySelectorAll("*")),y={};b.forEach((w,x)=>{const E=window.getComputedStyle(w,null),S={};for(let v=0;v<E.length;v+=1){const M=E[v],k=E.getPropertyValue(M);S[M]=k}y[x]=S});const C={};d.forEach((w,x)=>{const E=window.getComputedStyle(w,null),S=y[x]||{},v={};for(let M=0;M<E.length;M+=1){const k=E[M],T=E.getPropertyValue(k);T!==S[k]&&(v[k]=T)}C[x]=v}),f.forEach((w,x)=>{nt(w,C[x])})}const c=e.stylesheet;if(typeof c=="string"){const u=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(c);s.prepend(K.create("style",{type:"text/css"},[u]))}const h=()=>{const u=e.beforeSerialize;if(typeof u=="function"){const f=F(u,this.graph,o);f instanceof SVGSVGElement&&(o=f)}const d=new XMLSerializer().serializeToString(o).replace(/ /g," ");this.notify("after:export",e),t(d)};if(e.serializeImages){const u=s.find("image").map(d=>new Promise(f=>{const m=d.attr("xlink:href")||d.attr("href");dy(m,(p,b)=>{!p&&b&&(d.attr("xlink:href",b),d.attr("href",b)),f()})}));Promise.all(u).then(h)}else h()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const s=se(e.padding);e.width&&e.height&&(s.left+s.right>=e.width&&(s.left=s.right=0),s.top+s.bottom>=e.height&&(s.top=s.bottom=0));const o=new I(-s.left,-s.top,s.left+s.right,s.top+s.bottom);if(e.width&&e.height){const h=n.width+s.left+s.right,u=n.height+s.top+s.bottom;o.scale(h/e.width,u/e.height)}n=I.create(n).moveAndExpand(o);const r=typeof e.width=="number"&&typeof e.height=="number"?{width:e.width,height:e.height}:n;let a=e.ratio?e.ratio:1;(!Number.isFinite(a)||a===0)&&(a=1);const l={width:Math.max(Math.round(r.width*a),1),height:Math.max(Math.round(r.height*a),1)};{const h=document.createElement("canvas"),u=h.getContext("2d");h.width=l.width,h.height=l.height;const d=l.width-1,f=l.height-1;u.fillStyle="rgb(1,1,1)",u.fillRect(d,f,1,1);const m=u.getImageData(d,f,1,1).data;if(m[0]!==1||m[1]!==1||m[2]!==1)throw new Error("size exceeded")}const c=new Image;c.onload=()=>{const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const u=h.getContext("2d");u.fillStyle=e.backgroundColor||"white",u.fillRect(0,0,l.width,l.height);try{u.drawImage(c,0,0,l.width,l.height);const d=h.toDataURL(e.type,e.quality);t(d)}catch{}},this.toSVG(h=>{c.src=`data:image/svg+xml,${encodeURIComponent(h)}`},Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.off()}}X([$()],FA.prototype,"dispose",null);function Ve(i){return i==="cell:added"}function We(i){return i==="cell:removed"}function Ti(i){return i!=null&&i.startsWith("cell:change:")}function UA(i){const t=["cell:added","cell:removed","cell:change:*"],e=["batch:start","batch:stop"],n=i.eventNames?i.eventNames.filter(s=>!(Ti(s)||t.includes(s)||e.includes(s))):t;return Object.assign(Object.assign({enabled:!0},i),{eventNames:n,applyOptionsList:i.applyOptionsList||["propertyPath"],revertOptionsList:i.revertOptionsList||["propertyPath"]})}function nd(i){const t=[];for(let e=0,n=i.length;e<n;e+=1){const s=i[e];let o=null;if(Ve(s.event)){const r=s.data.id;for(let a=0;a<e;a+=1)if(i[a].data.id===r){o=a;break}}o!==null?t.splice(o,0,s):t.push(s)}return t}class id extends zt{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=t.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every(e=>this.isValidCommand(e)):this.isValidCommand(t)}isValidCommand(t){if(t.options&&t.options.validation===!1)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach(s=>{let o=0;const r=a=>{const l=s[o];o+=1;try{l?l(a,t,r):n=a}catch(c){r(c)}};r(n)}),n?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1):!0}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach(s=>{if(typeof s!="function")throw new Error(`${n.join(" ")} requires callback functions.`)}),n.forEach(s=>{this.map[s]==null&&(this.map[s]=[]),this.map[s].push(e)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}X([$()],id.prototype,"dispose",null),B.prototype.isHistoryEnabled=function(){const i=this.getPlugin("history");return i?i.isEnabled():!1},B.prototype.enableHistory=function(){const i=this.getPlugin("history");return i&&i.enable(),this},B.prototype.disableHistory=function(){const i=this.getPlugin("history");return i&&i.disable(),this},B.prototype.toggleHistory=function(i){const t=this.getPlugin("history");return t&&t.toggleEnabled(i),this},B.prototype.undo=function(i){const t=this.getPlugin("history");return t&&t.undo(i),this},B.prototype.redo=function(i){const t=this.getPlugin("history");return t&&t.redo(i),this},B.prototype.undoAndCancel=function(i){const t=this.getPlugin("history");return t&&t.cancel(i),this},B.prototype.canUndo=function(){const i=this.getPlugin("history");return i?i.canUndo():!1},B.prototype.canRedo=function(){const i=this.getPlugin("history");return i?i.canRedo():!1},B.prototype.cleanHistory=function(i){const t=this.getPlugin("history");return t&&t.clean(i),this},B.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},B.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},B.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},B.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};class sd extends zt{constructor(t={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:e=0}=t;this.stackSize=e,this.options=UA(t),this.validator=new id({history:this,cancelInvalid:this.options.cancelInvalid})}init(t){this.graph=t,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStackPush(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const t=this.undoStack.length;return this.stackSize-t}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}get disabled(){return this.options.enabled!==!0}validate(t,...e){return this.validator.validate(t,...e),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:t?t.batch:!1,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?nd(t):[t];for(let s=n.length-1;s>=0;s-=1){const o=n[s],r=Object.assign(Object.assign({},e),Tl(o.options,this.options.revertOptionsList||[]));this.executeCommand(o,!0,r)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?nd(t):[t];for(let s=0;s<n.length;s+=1){const o=n[s],r=Object.assign(Object.assign({},e),Tl(o.options,this.options.applyOptionsList||[]));this.executeCommand(o,!1,r)}this.freezed=!1}executeCommand(t,e,n){const s=this.model,o=s.getCell(t.data.id),r=t.event;if(Ve(r)&&e||We(r)&&!e)o&&o.remove(n);else if(Ve(r)&&!e||We(r)&&e){const a=t.data;a.node?s.addNode(a.props,n):a.edge&&s.addEdge(a.props,n)}else if(Ti(r)){const a=t.data,l=a.key;if(l&&o){const c=e?a.prev[l]:a.next[l];a.key==="attrs"&&this.ensureUndefinedAttrs(c,e?a.next[l]:a.prev[l])&&(n.dirty=!0),o.prop(l,c,n)}}else{const a=this.options.executeCommand;a&&F(a,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,s=n.options||{};if(s.dryrun||Ve(t)&&this.options.ignoreAdd||We(t)&&this.options.ignoreRemove||Ti(t)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(o!=null&&F(o,this,t,e)===!1)return;t==="cell:change:*"&&(t=`cell:change:${n.key}`);const r=n.cell,a=Gt.isModel(r);let l;if(this.batchCommands){l=this.batchCommands[Math.max(this.lastBatchIndex,0)];const h=a&&!l.modelChange||l.data.id!==r.id,u=l.event!==t;if(this.lastBatchIndex>=0&&(h||u)){const d=this.batchCommands.findIndex(f=>(a&&f.modelChange||f.data.id===r.id)&&f.event===t);d<0||Ve(t)||We(t)?l=this.createCommand({batch:!0}):(l=this.batchCommands[d],this.batchCommands.splice(d,1)),this.batchCommands.push(l),this.lastBatchIndex=this.batchCommands.length-1}}else l=this.createCommand({batch:!1});if(Ve(t)||We(t)){const h=l.data;return l.event=t,l.options=s,h.id=r.id,h.props=ut(r.toJSON()),r.isEdge()?h.edge=!0:r.isNode()&&(h.node=!0),this.push(l,s)}if(Ti(t)){const h=e.key,u=l.data;return(!l.batch||!l.event)&&(l.event=t,l.options=s,u.key=h,u.prev==null&&(u.prev={}),u.prev[h]=ut(r.previous(h)),a?l.modelChange=!0:u.id=r.id),u.next==null&&(u.next={}),u.next[h]=ut(r.prop(h)),this.push(l,s)}const c=this.options.afterAddCommand;c&&F(c,this,t,e,l),this.push(l,s)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];for(;e.length>0;){const s=e.shift(),o=s.event,r=s.data.id;if(o!=null&&(r!=null||s.modelChange)){if(Ve(o)){const a=e.findIndex(l=>We(l.event)&&l.data.id===r);if(a>=0){e=e.filter((l,c)=>a<c||l.data.id!==r);continue}}else if(We(o)){const a=e.findIndex(l=>Ve(l.event)&&l.data.id===r);if(a>=0){e.splice(a,1);continue}}else if(Ti(o)){const a=s.data;if(ye(a.prev,a.next))continue}n.push(s)}}return n}notify(t,e,n){const s=e==null?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:s,options:n}),this.graph.trigger(`history:${t}`,{cmds:s,options:n}),this.emit("change",{cmds:s,options:n}),this.graph.trigger("history:change",{cmds:s,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const s=new Set(e.map(r=>r.event));if(s.size!==2||!s.has("cell:change:parent")||!s.has("cell:change:children")||!e.every(r=>{var a;return r.batch&&((a=r.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(n)||n.length!==1)return;const o=n[0];o.event!=="cell:change:position"||!(!((t=o.options)===null||t===void 0)&&t.ui)||(n.push(...e),this.undoStack.pop())}undoStackPush(t){if(this.stackSize===0){this.undoStack.push(t);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(t)}ensureUndefinedAttrs(t,e){let n=!1;return t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(s=>{t[s]===void 0&&e[s]!==void 0?(t[s]=void 0,n=!0):typeof t[s]=="object"&&typeof e[s]=="object"&&(n=this.ensureUndefinedAttrs(t[s],e[s]))}),n}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}X([$()],sd.prototype,"dispose",null);function KA(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var od={exports:{}};(function(i){(function(t,e,n){if(!t)return;for(var s={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,c=1;c<20;++c)s[111+c]="f"+c;for(c=0;c<=9;++c)s[c+96]=c.toString();function h(v,M,k){if(v.addEventListener){v.addEventListener(M,k,!1);return}v.attachEvent("on"+M,k)}function u(v){if(v.type=="keypress"){var M=String.fromCharCode(v.which);return v.shiftKey||(M=M.toLowerCase()),M}return s[v.which]?s[v.which]:o[v.which]?o[v.which]:String.fromCharCode(v.which).toLowerCase()}function d(v,M){return v.sort().join(",")===M.sort().join(",")}function f(v){var M=[];return v.shiftKey&&M.push("shift"),v.altKey&&M.push("alt"),v.ctrlKey&&M.push("ctrl"),v.metaKey&&M.push("meta"),M}function m(v){if(v.preventDefault){v.preventDefault();return}v.returnValue=!1}function p(v){if(v.stopPropagation){v.stopPropagation();return}v.cancelBubble=!0}function b(v){return v=="shift"||v=="ctrl"||v=="alt"||v=="meta"}function y(){if(!l){l={};for(var v in s)v>95&&v<112||s.hasOwnProperty(v)&&(l[s[v]]=v)}return l}function C(v,M,k){return k||(k=y()[v]?"keydown":"keypress"),k=="keypress"&&M.length&&(k="keydown"),k}function w(v){return v==="+"?["+"]:(v=v.replace(/\+{2}/g,"+plus"),v.split("+"))}function x(v,M){var k,T,P,R=[];for(k=w(v),P=0;P<k.length;++P)T=k[P],a[T]&&(T=a[T]),M&&M!="keypress"&&r[T]&&(T=r[T],R.push("shift")),b(T)&&R.push(T);return M=C(T,R,M),{key:T,modifiers:R,action:M}}function E(v,M){return v===null||v===e?!1:v===M?!0:E(v.parentNode,M)}function S(v){var M=this;if(v=v||e,!(M instanceof S))return new S(v);M.target=v,M._callbacks={},M._directMap={};var k={},T,P=!1,R=!1,J=!1;function D(V){V=V||{};var Z=!1,it;for(it in k){if(V[it]){Z=!0;continue}k[it]=0}Z||(J=!1)}function N(V,Z,it,H,O,Q){var U,tt,Tt=[],ft=it.type;if(!M._callbacks[V])return[];for(ft=="keyup"&&b(V)&&(Z=[V]),U=0;U<M._callbacks[V].length;++U)if(tt=M._callbacks[V][U],!(!H&&tt.seq&&k[tt.seq]!=tt.level)&&ft==tt.action&&(ft=="keypress"&&!it.metaKey&&!it.ctrlKey||d(Z,tt.modifiers))){var On=!H&&tt.combo==O,Us=H&&tt.seq==H&&tt.level==Q;(On||Us)&&M._callbacks[V].splice(U,1),Tt.push(tt)}return Tt}function G(V,Z,it,H){M.stopCallback(Z,Z.target||Z.srcElement,it,H)||V(Z,it)===!1&&(m(Z),p(Z))}M._handleKey=function(V,Z,it){var H=N(V,Z,it),O,Q={},U=0,tt=!1;for(O=0;O<H.length;++O)H[O].seq&&(U=Math.max(U,H[O].level));for(O=0;O<H.length;++O){if(H[O].seq){if(H[O].level!=U)continue;tt=!0,Q[H[O].seq]=1,G(H[O].callback,it,H[O].combo,H[O].seq);continue}tt||G(H[O].callback,it,H[O].combo)}var Tt=it.type=="keypress"&&R;it.type==J&&!b(V)&&!Tt&&D(Q),R=tt&&it.type=="keydown"};function ot(V){typeof V.which!="number"&&(V.which=V.keyCode);var Z=u(V);if(Z){if(V.type=="keyup"&&P===Z){P=!1;return}M.handleKey(Z,f(V),V)}}function yt(){clearTimeout(T),T=setTimeout(D,1e3)}function gt(V,Z,it,H){k[V]=0;function O(ft){return function(){J=ft,++k[V],yt()}}function Q(ft){G(it,ft,V),H!=="keyup"&&(P=u(ft)),setTimeout(D,10)}for(var U=0;U<Z.length;++U){var tt=U+1===Z.length,Tt=tt?Q:O(H||x(Z[U+1]).action);lt(Z[U],Tt,H,V,U)}}function lt(V,Z,it,H,O){M._directMap[V+":"+it]=Z,V=V.replace(/\s+/g," ");var Q=V.split(" "),U;if(Q.length>1){gt(V,Q,Z,it);return}U=x(V,it),M._callbacks[U.key]=M._callbacks[U.key]||[],N(U.key,U.modifiers,{type:U.action},H,V,O),M._callbacks[U.key][H?"unshift":"push"]({callback:Z,modifiers:U.modifiers,action:U.action,seq:H,level:O,combo:V})}M._bindMultiple=function(V,Z,it){for(var H=0;H<V.length;++H)lt(V[H],Z,it)},h(v,"keypress",ot),h(v,"keydown",ot),h(v,"keyup",ot)}S.prototype.bind=function(v,M,k){var T=this;return v=v instanceof Array?v:[v],T._bindMultiple.call(T,v,M,k),T},S.prototype.unbind=function(v,M){var k=this;return k.bind.call(k,v,function(){},M)},S.prototype.trigger=function(v,M){var k=this;return k._directMap[v+":"+M]&&k._directMap[v+":"+M]({},v),k},S.prototype.reset=function(){var v=this;return v._callbacks={},v._directMap={},v},S.prototype.stopCallback=function(v,M){var k=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||E(M,k.target))return!1;if("composedPath"in v&&typeof v.composedPath=="function"){var T=v.composedPath()[0];T!==v.target&&(M=T)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},S.prototype.handleKey=function(){var v=this;return v._handleKey.apply(v,arguments)},S.addKeycodes=function(v){for(var M in v)v.hasOwnProperty(M)&&(s[M]=v[M]);l=null},S.init=function(){var v=S(e);for(var M in v)M.charAt(0)!=="_"&&(S[M]=function(k){return function(){return v[k].apply(v,arguments)}}(M))},S.init(),t.Mousetrap=S,i.exports&&(i.exports=S)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(od);var JA=od.exports;const jA=KA(JA);function rd(i,t,e){const n=i.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left");return t?F(t,e,n):n}function ad(i){var t;const e=i.target,n=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase();let s=["input","textarea"].includes(n);return W(e,"contenteditable")==="true"&&(s=!0),s}function GA(i,t,e){const n=i.target,s=i.currentTarget;return n?n===t||s===t||n===document.body?!0:ko(e,n):!1}function YA(i){const t=new jA(i.target),e=t.stopCallback;return t.stopCallback=(n,s,o)=>i.isEnabledForEvent(n)?e?e.call(t,n,s,o):!1:!0,t}class ld extends Cn{get graph(){return this.options.graph}constructor(t){super(),this.options=t;const e=this.graph.getPlugin("scroller");this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus.bind(this),this),this.graph.on("blank:mouseup",this.focus.bind(this),this)),this.mousetrap=YA(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}clear(){this.mousetrap.reset()}trigger(t,e){this.mousetrap.trigger(rd(t,this.options.format,this.graph),e)}focus(t){if(ad(t.e))return;this.target.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(e=>rd(e,this.options.format,this.graph))}isEnabledForEvent(t){const e=!this.disabled&&GA(t,this.target,this.container),n=ad(t);if(e){if(n&&(t.key==="Backspace"||t.key==="Delete"))return!1;if(this.options.guard)return F(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}X([$()],ld.prototype,"dispose",null),B.prototype.isKeyboardEnabled=function(){const i=this.getPlugin("keyboard");return i?i.isEnabled():!1},B.prototype.enableKeyboard=function(){const i=this.getPlugin("keyboard");return i&&i.enable(),this},B.prototype.disableKeyboard=function(){const i=this.getPlugin("keyboard");return i&&i.disable(),this},B.prototype.toggleKeyboard=function(i){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(i),this},B.prototype.bindKey=function(i,t,e){const n=this.getPlugin("keyboard");return n&&n.bindKey(i,t,e),this},B.prototype.unbindKey=function(i,t){const e=this.getPlugin("keyboard");return e&&e.unbindKey(i,t),this},B.prototype.clearKeys=function(){const i=this.getPlugin("keyboard");return i&&i.clear(),this},B.prototype.triggerKey=function(i,t){const e=this.getPlugin("keyboard");return e&&e.trigger(i,t),this};class cd extends Cn{constructor(t={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},t)}init(t){this.keyboardImpl=new ld(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(t){return t===void 0&&(t=!this.isEnabled()),t?this.enable():this.disable(),this}bindKey(t,e,n){return this.keyboardImpl.on(t,e,n),this}trigger(t,e){return this.keyboardImpl.trigger(t,e),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(t,e){return this.keyboardImpl.off(t,e),this}dispose(){this.keyboardImpl.dispose()}}X([$()],cd.prototype,"dispose",null);class hd extends Jt{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(le.box)}get $boxes(){return Ny(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(t){super(),this.updateThrottleTimer=null,this.isDragging=!1,this.batchUpdating=!1,this.dragRafId=null,this.transformRafId=null,this.dragPendingOffset=null,this.containerOffsetX=0,this.containerOffsetY=0,this.translatingCache=null,this.options=t,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new pr([],{comparator:HA}),this.options.collection=this.collection),this.boxCount=0,this.boxesUpdated=!1,this.createContainer(),this.startListening()}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`mousedown .${this.prefixClassName(le.inner)}`]:"onSelectionContainerMouseDown",[`touchstart .${this.prefixClassName(le.inner)}`]:"onSelectionContainerMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),this.transformRafId!=null&&(cancelAnimationFrame(this.transformRafId),this.transformRafId=null),this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null),this.transformRafId==null&&(this.transformRafId=window.requestAnimationFrame(()=>{this.transformRafId=null,!this.isDragging&&this.collection.length>0&&this.refreshSelectionBoxes()}))}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:s}=this.options,{ui:o,selection:r,translateBy:a,snapped:l}=e,c=(n!==!0||s&&this.getPointerEventsValue(s)==="none")&&!this.translating&&!r,h=o&&a&&t.id===a;if(c&&(h||l)){this.translating=!0;const u=t.position(),d=t.previous("position");if(d){const f=u.x-d.x,m=u.y-d.y;(f!==0||m!==0)&&this.translateSelectedNodes(f,m,t,e)}this.translating=!1}}onModelUpdated({removed:t}){t!=null&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){this.batchUpdating=!!e.batch;const n=this.cells,s=this.filter(Array.isArray(t)?t:[t]),o={},r={};for(const c of n)o[c.id]=c;for(const c of s)r[c.id]=c;const a=[],l=[];return s.forEach(c=>{o[c.id]||a.push(c)}),n.forEach(c=>{r[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),this.updateContainer(),this.batchUpdating=!1,this}return this.clean(e)}clean(t={}){return this.length&&this.unselect(this.cells,t),this.containerOffsetX=0,this.containerOffsetY=0,nt(this.container,"transform",""),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){t=this.normalizeEvent(t),this.clean();let e,n;const s=this.graph.container;if(t.offsetX!=null&&t.offsetY!=null&&s.contains(t.target))e=t.offsetX,n=t.offsetY;else{const o=wn(s),r=s.scrollLeft,a=s.scrollTop;e=t.clientX-o.left+window.pageXOffset+r,n=t.clientY-o.top+window.pageYOffset+a}nt(this.container,{top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(ud,t.data)}filter(t){const e=this.options.filter;return t.filter(n=>Array.isArray(e)?e.some(s=>typeof s=="string"?n.shape===s:n.id===s.id):typeof e=="function"?F(e,this.graph,n):!0)}stopSelecting(t){this.isDragging=!1,this.boxesUpdated=!1,this.updateThrottleTimer&&(clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=null);const e=this.graph;switch(this.getEventData(t).action){case"selecting":{let o=N6(this.container),r=R6(this.container);const a=wn(this.container),l=e.pageToLocal(a.left,a.top),c=e.transform.getScale();o/=c.sx,r/=c.sy;const h=new I(l.x,l.y,o,r),u=this.getCellViewsInArea(h).map(d=>d.cell);this.reset(u,{batch:!0}),this.hideRubberband();break}case"translating":{const o=e.snapToGrid(t.clientX,t.clientY);if(this.dragPendingOffset){const r=this.dragPendingOffset;this.dragPendingOffset=null,this.translateSelectedNodes(r.dx,r.dy),this.updateContainerPosition(r)}this.dragRafId!=null&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=null),this.containerOffsetX=0,this.containerOffsetY=0,nt(this.container,"transform",""),this.graph.model.stopBatch("move-selection"),this.translatingCache=null,this.notifyBoxEvent("box:mouseup",t,o.x,o.y),this.repositionSelectionBoxesInPlace();break}default:{this.clean();break}}this.undelegateDocumentEvents()}onMouseUp(t){const e=this.normalizeEvent(t);this.getEventData(e)&&this.stopSelecting(t)}onSelectionBoxMouseDown(t){this.handleSelectionMouseDown(t,!0)}onSelectionContainerMouseDown(t){this.handleSelectionMouseDown(t,!1)}handleSelectionMouseDown(t,e){var n;t.stopPropagation(),(n=t.preventDefault)===null||n===void 0||n.call(t);const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY);if(!e&&Pe(s,this.options.multipleSelectionModifiers)){const l=this.graph.findViewsFromPoint(o.x,o.y).find(c=>c.isNodeView());if(l){const c=l.cell;this.isSelected(c)?this.unselect(c,{ui:!0}):this.options.multiple===!1?this.reset(c,{ui:!0}):this.select(c,{ui:!0})}return}this.options.movable&&this.startTranslating(s);let r=e?this.getCellViewFromElem(s.target):null;if(!r&&(r=this.graph.findViewsFromPoint(o.x,o.y).filter(l=>this.isSelected(l.cell))[0]||null,!r)){const l=this.collection.first();l&&(r=this.graph.renderer.findViewByCell(l))}r&&(this.setEventData(s,{activeView:r}),e&&this.notifyBoxEvent("box:mousedown",s,o.x,o.y),this.delegateDocumentEvents(ud,s.data))}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y}),this.prepareTranslatingCache()}getRestrictArea(){const t=this.graph.options.translating.restrict,e=typeof t=="function"?F(t,this.graph,null):t;return typeof e=="number"?this.graph.transform.getGraphArea().inflate(e):e===!0?this.graph.transform.getGraphArea():e||null}prepareTranslatingCache(){const t=this.collection.toArray().filter(r=>r.isNode()),e=new Set(t.map(r=>r.id)),n=this.collection.toArray().filter(r=>r.isEdge()),s=new Set,o=r=>r.getVertices().length>0||!r.getSourceCellId()||!r.getTargetCellId();this.graph.model.getEdges().forEach(r=>{const a=r.getSourceCellId(),l=r.getTargetCellId();(a!=null&&e.has(a)||l!=null&&e.has(l))&&o(r)&&s.add(r)}),n.forEach(r=>{o(r)&&s.add(r)}),this.translatingCache={selectedNodes:t,nodeIdSet:e,edgesToTranslate:Array.from(s)}}getSelectionOffset(t,e){let n=t.x-e.clientX,s=t.y-e.clientY;const o=this.getRestrictArea();if(o){const r=this.collection.toArray(),a=q.getCellsBBox(r,{deep:!0})||I.create(),l=o.x-a.x,c=o.y-a.y,h=o.x+o.width-(a.x+a.width),u=o.y+o.height-(a.y+a.height);if(n<l&&(n=l),s<c&&(s=c),h<n&&(n=h),u<s&&(s=u),!this.options.following){const d=t.x-e.originX,f=t.y-e.originY;n=d<=l||d>=h?0:n,s=f<=c||f>=u?0:s}}return{dx:n,dy:s}}updateSelectedNodesPosition(t){t.dx===0&&t.dy===0||(this.dragPendingOffset?(this.dragPendingOffset.dx+=t.dx,this.dragPendingOffset.dy+=t.dy):this.dragPendingOffset={dx:t.dx,dy:t.dy},this.dragRafId==null&&(this.dragRafId=requestAnimationFrame(()=>{const e=this.dragPendingOffset||{dx:0,dy:0};this.dragPendingOffset=null,this.dragRafId=null,this.translateSelectedNodes(e.dx,e.dy),this.updateContainerPosition(e),this.boxesUpdated=!0,this.isDragging=!0})))}autoScrollGraph(t,e){const n=this.graph.getPlugin("scroller");return n!=null&&n.autoScroll?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e);switch(n.action){case"selecting":{const o=n;o.moving!==!0&&(Wt(this.container,this.graph.container),this.showRubberband(),o.moving=!0);const{scrollerX:r,scrollerY:a}=this.autoScrollGraph(e.clientX,e.clientY);o.scrollerX+=r,o.scrollerY+=a;const l=e.clientX-o.clientX+o.scrollerX,c=e.clientY-o.clientY+o.scrollerY;nt(this.container,{left:l<0?o.offsetX+l:o.offsetX,top:c<0?o.offsetY+c:o.offsetY,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{this.isDragging=!0;const o=this.graph.snapToGrid(e.clientX,e.clientY),r=n,a=this.getSelectionOffset(o,r);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(r.clientX=o.x),a.dy&&(r.clientY=o.y),this.notifyBoxEvent("box:mousemove",t,o.x,o.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,s){var o,r;const a={},l=[];if(n&&(a[n.id]=!0),this.collection.toArray().forEach(p=>{p.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0})}),s!=null&&s.translateBy){const p=this.graph.getCellById(s.translateBy);p&&(a[p.id]=!0,p.getDescendants({deep:!0}).forEach(b=>{a[b.id]=!0}),l.push(p))}const c=Object.assign(Object.assign({},s),{selection:this.cid,exclude:l}),h=(o=this.translatingCache)===null||o===void 0?void 0:o.selectedNodes,u=(h??this.collection.toArray().filter(p=>p.isNode())).filter(p=>!a[p.id]);u.forEach(p=>{p.translate(t,e,c)});const d=(r=this.translatingCache)===null||r===void 0?void 0:r.edgesToTranslate,f=new Set;if(d)d.forEach(p=>{f.add(p)});else{const p=new Set(u.map(b=>b.id));this.graph.model.getEdges().forEach(b=>{const y=b.getSourceCellId(),C=b.getTargetCellId(),w=y?p.has(y):!1,x=C?p.has(C):!1;(w||x)&&(b.getVertices().length>0||(!y||!C))&&f.add(b)})}this.collection.toArray().filter(p=>p.isEdge()&&!a[p.id]).forEach(p=>{const b=p.getVertices().length>0,y=!p.getSourceCellId()||!p.getTargetCellId();(b||y)&&f.add(p)}),f.forEach(p=>{p.translate(t,e,c)})}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let s=[];return this.options.rubberNode&&(s=s.concat(e.model.getNodesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),this.options.rubberEdge&&(s=s.concat(e.model.getEdgesInArea(t,n).map(o=>e.renderer.findViewByCell(o)).filter(o=>o!=null))),s}notifyBoxEvent(t,e,n,s){const r=this.getEventData(e).activeView;this.trigger(t,{e,view:r,x:n,y:s,cell:r.cell})}getSelectedClassName(t){return this.prefixClassName(`${t.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(_t(this.container.querySelector(`[data-cell-id="${t.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(e=>{this.removeCellUnSelectedClassName(e)}),this.hide(),_t(this.$boxes),this.boxCount=0}hide(){at(this.container,this.prefixClassName(le.rubberband)),at(this.container,this.prefixClassName(le.selected))}showRubberband(){L(this.container,this.prefixClassName(le.rubberband))}hideRubberband(){at(this.container,this.prefixClassName(le.rubberband))}showSelected(){Io(this.container,"style"),L(this.container,this.prefixClassName(le.selected))}createContainer(){this.container=document.createElement("div"),L(this.container,this.prefixClassName(le.root)),this.options.className&&L(this.container,this.options.className),nt(this.container,{willChange:"transform"}),this.selectionContainer=document.createElement("div"),L(this.selectionContainer,this.prefixClassName(le.inner)),this.selectionContent=document.createElement("div"),L(this.selectionContent,this.prefixClassName(le.content)),Ot(this.selectionContainer,this.selectionContent),W(this.selectionContainer,"data-selection-length",this.collection.length),nc(this.container,this.selectionContainer)}updateContainerPosition(t){if(t.dx||t.dy){const e=this.graph.transform.getScale();this.containerOffsetX+=t.dx*e.sx,this.containerOffsetY+=t.dy*e.sy,nt(this.container,"transform",`translate3d(${this.containerOffsetX}px, ${this.containerOffsetY}px, 0)`)}}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0};this.collection.toArray().filter(o=>this.canShowSelectionBox(o)).forEach(o=>{const r=this.graph.renderer.findViewByCell(o);if(r){const a=r.getBBox({useCellGeometry:!0});t.x=Math.min(t.x,a.x),t.y=Math.min(t.y,a.y),e.x=Math.max(e.x,a.x+a.width),e.y=Math.max(e.y,a.y+a.height)}}),nt(this.selectionContainer,{position:"absolute",pointerEvents:this.options.movable?"auto":"none",cursor:this.options.movable?"move":"default",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}),W(this.selectionContainer,"data-selection-length",this.collection.length);const s=this.options.content;if(s)if(typeof s=="function"){const o=F(s,this.graph,this,this.selectionContent);o&&(this.selectionContent.innerHTML=o)}else this.selectionContent.innerHTML=s;this.collection.length>0&&!this.container.parentNode?Wt(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&this.options.showNodeSelectionBox===!0||t.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(t){return typeof t=="string"?t:t(this.cells)}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:!0}),s=this.boxClassName,o=document.createElement("div"),r=this.options.pointerEvents;L(o,s),L(o,`${s}-${t.isNode()?"node":"edge"}`),W(o,"data-cell-id",t.id),nt(o,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:r?this.getPointerEventsValue(r):"auto"}),Wt(o,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){if(this.collection.length>0){if(this.isDragging)return;this.updateThrottleTimer&&clearTimeout(this.updateThrottleTimer),this.updateThrottleTimer=setTimeout(()=>{this.refreshSelectionBoxes(),this.updateThrottleTimer=null},16)}}refreshSelectionBoxes(){_t(this.$boxes),this.boxCount=0,this.collection.toArray().forEach(t=>{this.createSelectionBox(t)}),this.updateContainer(),this.boxesUpdated=!0}repositionSelectionBoxesInPlace(){const t=this.$boxes;if(t.length===0){this.refreshSelectionBoxes();return}for(const e of t){const n=e.getAttribute("data-cell-id");if(!n)continue;const s=this.collection.get(n);if(!s)continue;const o=this.graph.renderer.findViewByCell(s);if(!o)continue;const r=o.getBBox({useCellGeometry:!0});nt(e,{left:r.x,top:r.y,width:r.width,height:r.height})}this.updateContainer(),this.boxesUpdated=!0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const n=this.collection.get(e);if(n)return this.graph.renderer.findViewByCell(n)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.batchUpdating||this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(n=>{this.listenCellRemoveEvent(n),this.createSelectionBox(n)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.batchUpdating||this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach(o=>{this.trigger("cell:selected",{cell:o,options:n}),o.isNode()?this.trigger("node:selected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:selected",{cell:o,options:n,edge:o})}),e.forEach(o=>{this.trigger("cell:unselected",{cell:o,options:n}),o.isNode()?this.trigger("node:unselected",{cell:o,options:n,node:o}):o.isEdge()&&this.trigger("edge:unselected",{cell:o,options:n,edge:o})});const s={added:t,removed:e,options:n,selected:this.cells.filter(o=>!!this.graph.getCellById(o.id))};this.trigger("selection:changed",s)}dispose(){this.clean(),this.remove(),this.off()}}X([$()],hd.prototype,"dispose",null);const Mn="widget-selection",le={root:Mn,inner:`${Mn}-inner`,box:`${Mn}-box`,content:`${Mn}-content`,rubberband:`${Mn}-rubberband`,selected:`${Mn}-selected`},ud={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function HA(i){return i.getAncestors().length}const _A=`.x6-widget-selection {
|
|
266
266
|
position: absolute;
|
|
267
267
|
top: 0;
|
|
268
268
|
left: 0;
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
font-size: 10px;
|
|
328
328
|
background-color: #6a6b8a;
|
|
329
329
|
}
|
|
330
|
-
`;S.prototype.isSelectionEnabled=function(){const s=this.getPlugin("selection");return s?s.isEnabled():!1},S.prototype.enableSelection=function(){const s=this.getPlugin("selection");return s&&s.enable(),this},S.prototype.disableSelection=function(){const s=this.getPlugin("selection");return s&&s.disable(),this},S.prototype.toggleSelection=function(s){const t=this.getPlugin("selection");return t&&t.toggleEnabled(s),this},S.prototype.isMultipleSelection=function(){const s=this.getPlugin("selection");return s?s.isMultipleSelection():!1},S.prototype.enableMultipleSelection=function(){const s=this.getPlugin("selection");return s&&s.enableMultipleSelection(),this},S.prototype.disableMultipleSelection=function(){const s=this.getPlugin("selection");return s&&s.disableMultipleSelection(),this},S.prototype.toggleMultipleSelection=function(s){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(s),this},S.prototype.isSelectionMovable=function(){const s=this.getPlugin("selection");return s?s.isSelectionMovable():!1},S.prototype.enableSelectionMovable=function(){const s=this.getPlugin("selection");return s&&s.enableSelectionMovable(),this},S.prototype.disableSelectionMovable=function(){const s=this.getPlugin("selection");return s&&s.disableSelectionMovable(),this},S.prototype.toggleSelectionMovable=function(s){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(s),this},S.prototype.isRubberbandEnabled=function(){const s=this.getPlugin("selection");return s?s.isRubberbandEnabled():!1},S.prototype.enableRubberband=function(){const s=this.getPlugin("selection");return s&&s.enableRubberband(),this},S.prototype.disableRubberband=function(){const s=this.getPlugin("selection");return s&&s.disableRubberband(),this},S.prototype.toggleRubberband=function(s){const t=this.getPlugin("selection");return t&&t.toggleRubberband(s),this},S.prototype.isStrictRubberband=function(){const s=this.getPlugin("selection");return s?s.isStrictRubberband():!1},S.prototype.enableStrictRubberband=function(){const s=this.getPlugin("selection");return s&&s.enableStrictRubberband(),this},S.prototype.disableStrictRubberband=function(){const s=this.getPlugin("selection");return s&&s.disableStrictRubberband(),this},S.prototype.toggleStrictRubberband=function(s){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(s),this},S.prototype.setRubberbandModifiers=function(s){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(s),this},S.prototype.setSelectionFilter=function(s){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(s),this},S.prototype.setSelectionDisplayContent=function(s){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(s),this},S.prototype.isSelectionEmpty=function(){const s=this.getPlugin("selection");return s?s.isEmpty():!0},S.prototype.cleanSelection=function(s){const t=this.getPlugin("selection");return t&&t.clean(s),this},S.prototype.resetSelection=function(s,t){const e=this.getPlugin("selection");return e&&e.reset(s,t),this},S.prototype.getSelectedCells=function(){const s=this.getPlugin("selection");return s?s.getSelectedCells():[]},S.prototype.getSelectedCellCount=function(){const s=this.getPlugin("selection");return s?s.getSelectedCellCount():0},S.prototype.isSelected=function(s){const t=this.getPlugin("selection");return t?t.isSelected(s):!1},S.prototype.select=function(s,t){const e=this.getPlugin("selection");return e&&e.select(s,t),this},S.prototype.unselect=function(s,t){const e=this.getPlugin("selection");return e&&e.unselect(s,t),this};const NA={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};class ed extends Nt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(t={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},NA),t),Me(this.name,OA)}init(t){this.graph=t,this.selectionImpl=new Zu(Object.assign(Object.assign({},this.options),{graph:t})),this.resolvePanningSelectionConflict(),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(t){return t!=null?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(t){return t!=null?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(t){return t!=null?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(t){return t!=null?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.setModifiers(t)}setSelectionFilter(t){return this.setFilter(t),this}setSelectionDisplayContent(t){return this.setContent(t),this}isEmpty(){return this.length<=0}clean(t={}){return this.selectionImpl.clean(t),this}reset(t,e={}){return this.selectionImpl.reset(t?this.getCells(t):[],e),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(t){return this.selectionImpl.isSelected(t)}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.selectionImpl.unselect(this.getCells(t),e),this}setup(){this.selectionImpl.on("*",(t,e)=>{this.trigger(t,e),this.graph.trigger(t,e)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.panning.allowPanning(t,!0),n=this.graph.getPlugin("scroller"),i=n&&n.allowPanning(t,!0);(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!i&&!e)&&this.startRubberband(t)}allowBlankMouseDown(t){const e=this.options.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}onBlankClick(){this.clean()}allowRubberband(t,e){const n=t??{altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1};return!this.rubberbandDisabled&&Te(n,this.options.modifiers,e)}resolvePanningSelectionConflict(){if(this.options.enabled!==!0||this.options.rubberband!==!0)return;const t=this.graph.options.panning;if(!t||t.enabled===!1)return;(()=>{var n,i;const o=(n=this.options.eventTypes)!==null&&n!==void 0?n:[],r=(i=t.eventTypes)!==null&&i!==void 0?i:[],a=new Set(r),l=o.some(h=>a.has(h)),c=hC(t.modifiers,this.options.modifiers);return l&&c})()&&this.graph.panning.disablePanning()}allowMultipleSelection(t){return this.isMultiple()&&Te(t,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.options;let i=this.disabled;!i&&this.movedMap.has(e)&&(i=n.selectCellOnMoved===!1,i||(i=n.selectNodeOnMoved===!1&&e.isNode()),i||(i=n.selectEdgeOnMoved===!1&&e.isEdge())),i||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}getCells(t){return(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?this.graph.getCellById(e):e).filter(e=>e!=null)}startRubberband(t){return this.rubberbandDisabled||this.selectionImpl.startSelecting(t),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(t){return this.options.modifiers=t,this}setContent(t){return this.selectionImpl.setContent(t),this}setFilter(t){return this.selectionImpl.setFilter(t),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Be(this.name)}}H([_()],ed.prototype,"dispose",null);const RA=`.x6-widget-minimap {
|
|
330
|
+
`;B.prototype.isSelectionEnabled=function(){const i=this.getPlugin("selection");return i?i.isEnabled():!1},B.prototype.enableSelection=function(){const i=this.getPlugin("selection");return i&&i.enable(),this},B.prototype.disableSelection=function(){const i=this.getPlugin("selection");return i&&i.disable(),this},B.prototype.toggleSelection=function(i){const t=this.getPlugin("selection");return t&&t.toggleEnabled(i),this},B.prototype.isMultipleSelection=function(){const i=this.getPlugin("selection");return i?i.isMultipleSelection():!1},B.prototype.enableMultipleSelection=function(){const i=this.getPlugin("selection");return i&&i.enableMultipleSelection(),this},B.prototype.disableMultipleSelection=function(){const i=this.getPlugin("selection");return i&&i.disableMultipleSelection(),this},B.prototype.toggleMultipleSelection=function(i){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(i),this},B.prototype.isSelectionMovable=function(){const i=this.getPlugin("selection");return i?i.isSelectionMovable():!1},B.prototype.enableSelectionMovable=function(){const i=this.getPlugin("selection");return i&&i.enableSelectionMovable(),this},B.prototype.disableSelectionMovable=function(){const i=this.getPlugin("selection");return i&&i.disableSelectionMovable(),this},B.prototype.toggleSelectionMovable=function(i){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(i),this},B.prototype.isRubberbandEnabled=function(){const i=this.getPlugin("selection");return i?i.isRubberbandEnabled():!1},B.prototype.enableRubberband=function(){const i=this.getPlugin("selection");return i&&i.enableRubberband(),this},B.prototype.disableRubberband=function(){const i=this.getPlugin("selection");return i&&i.disableRubberband(),this},B.prototype.toggleRubberband=function(i){const t=this.getPlugin("selection");return t&&t.toggleRubberband(i),this},B.prototype.isStrictRubberband=function(){const i=this.getPlugin("selection");return i?i.isStrictRubberband():!1},B.prototype.enableStrictRubberband=function(){const i=this.getPlugin("selection");return i&&i.enableStrictRubberband(),this},B.prototype.disableStrictRubberband=function(){const i=this.getPlugin("selection");return i&&i.disableStrictRubberband(),this},B.prototype.toggleStrictRubberband=function(i){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(i),this},B.prototype.setRubberbandModifiers=function(i){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(i),this},B.prototype.setSelectionFilter=function(i){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(i),this},B.prototype.setSelectionDisplayContent=function(i){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(i),this},B.prototype.isSelectionEmpty=function(){const i=this.getPlugin("selection");return i?i.isEmpty():!0},B.prototype.cleanSelection=function(i){const t=this.getPlugin("selection");return t&&t.clean(i),this},B.prototype.resetSelection=function(i,t){const e=this.getPlugin("selection");return e&&e.reset(i,t),this},B.prototype.getSelectedCells=function(){const i=this.getPlugin("selection");return i?i.getSelectedCells():[]},B.prototype.getSelectedCellCount=function(){const i=this.getPlugin("selection");return i?i.getSelectedCellCount():0},B.prototype.isSelected=function(i){const t=this.getPlugin("selection");return t?t.isSelected(i):!1},B.prototype.select=function(i,t){const e=this.getPlugin("selection");return e&&e.select(i,t),this},B.prototype.unselect=function(i,t){const e=this.getPlugin("selection");return e&&e.unselect(i,t),this};const WA={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};class dd extends zt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(t={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},WA),t),Be(this.name,_A)}init(t){this.graph=t,this.selectionImpl=new hd(Object.assign(Object.assign({},this.options),{graph:t})),this.resolvePanningSelectionConflict(),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(t){return t!=null?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(t){return t!=null?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(t){return t!=null?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(t){return t!=null?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.setModifiers(t)}setSelectionFilter(t){return this.setFilter(t),this}setSelectionDisplayContent(t){return this.setContent(t),this}isEmpty(){return this.length<=0}clean(t={}){return this.selectionImpl.clean(t),this}reset(t,e={}){return this.selectionImpl.reset(t?this.getCells(t):[],e),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(t){return this.selectionImpl.isSelected(t)}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.selectionImpl.unselect(this.getCells(t),e),this}setup(){this.selectionImpl.on("*",(t,e)=>{this.trigger(t,e),this.graph.trigger(t,e)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.panning.allowPanning(t,!0),n=this.graph.getPlugin("scroller"),s=n&&n.allowPanning(t,!0);(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!s&&!e)&&this.startRubberband(t)}allowBlankMouseDown(t){const e=this.options.eventTypes;return typeof t.type=="string"&&t.type.startsWith("touch")||t.pointerType==="touch"?e==null?void 0:e.includes("leftMouseDown"):(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}onBlankClick(){this.clean()}allowRubberband(t,e){const n=t??{altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1};return!this.rubberbandDisabled&&Pe(n,this.options.modifiers,e)}resolvePanningSelectionConflict(){if(this.options.enabled!==!0||this.options.rubberband!==!0)return;const t=this.graph.options.panning;if(!t||t.enabled===!1)return;(()=>{var n,s;const o=(n=this.options.eventTypes)!==null&&n!==void 0?n:[],r=(s=t.eventTypes)!==null&&s!==void 0?s:[],a=new Set(r),l=o.some(h=>a.has(h)),c=M2(t.modifiers,this.options.modifiers);return l&&c})()&&this.graph.panning.disablePanning()}allowMultipleSelection(t){return this.isMultiple()&&Pe(t,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.options;let s=this.disabled;!s&&this.movedMap.has(e)&&(s=n.selectCellOnMoved===!1,s||(s=n.selectNodeOnMoved===!1&&e.isNode()),s||(s=n.selectEdgeOnMoved===!1&&e.isEdge())),s||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}getCells(t){return(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?this.graph.getCellById(e):e).filter(e=>e!=null)}startRubberband(t){return this.rubberbandDisabled||this.selectionImpl.startSelecting(t),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(t){return this.options.modifiers=t,this}setContent(t){return this.selectionImpl.setContent(t),this}setFilter(t){return this.selectionImpl.setFilter(t),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),ke(this.name)}}X([$()],dd.prototype,"dispose",null);const qA=`.x6-widget-minimap {
|
|
331
331
|
position: relative;
|
|
332
332
|
display: table-cell;
|
|
333
333
|
box-sizing: border-box;
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
border-radius: 50%;
|
|
371
371
|
cursor: nwse-resize;
|
|
372
372
|
}
|
|
373
|
-
`,DA={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:s=>new S(s)},QA={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"},nd="widget-minimap",id=`${nd}-viewport`,LA=`${id}-zoom`;class zA extends Ut{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(t){super(),this.name="minimap",this.options=Object.assign(Object.assign({},DA),t),Me(this.name,RA)}init(t){this.graph=t,this.updateViewport=ji(this.updateViewport.bind(this),0),this.container=document.createElement("div"),O(this.container,this.prefixClassName(nd));const e=document.createElement("div");this.container.appendChild(e),this.viewport=document.createElement("div"),O(this.viewport,this.prefixClassName(id)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),O(this.zoomHandle,this.prefixClassName(LA)),Yt(this.zoomHandle,this.viewport)),Mt(this.container,this.viewport),$(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1,panning:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new S(n),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?nt.on(this.graphContainer,`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?nt.off(this.graphContainer,this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.stopListening(),this.targetGraph.dispose(!1)}onTransform(t){(t.ui||this.targetGraphTransforming||!this.scroller)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,i;typeof t=="object"?(n=t.width,i=t.height):(n=t,i=e);const o=this.sourceGraph.options,r=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;n/=r.sx,i/=r.sy,this.ratio=Math.min(a/n,l/i);const c=this.ratio,h=o.x*c/r.sx,u=o.y*c/r.sy;return n*=c,i*=c,this.targetGraph.resize(n,i),this.targetGraph.translate(h,u),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale(),n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0),i=C6(this.targetGraph.container),o=this.targetGraph.translate();o.ty=o.ty||0,this.geometry={top:i.top+n.y*e.sy+o.ty,left:i.left+n.x*e.sx+o.tx,width:this.graphContainer.clientWidth*e.sx/t.sx,height:this.graphContainer.clientHeight*e.sy/t.sy},$(this.viewport,this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:o}=this.sourceGraph.translate(),r={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:o};this.targetGraphTransforming=!0,this.delegateDocumentEvents(QA,r)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,i=e.clientY,o=e.data;switch(o.action){case"panning":{const r=this.sourceGraph.transform.getScale(),a=(n-o.clientX)*r.sx,l=(i-o.clientY)*r.sy;this.scroller?(this.graphContainer.scrollLeft=o.scrollLeft+a/this.ratio,this.graphContainer.scrollTop=o.scrollTop+l/this.ratio):this.sourceGraph.translate(o.translateX-a/this.ratio,o.translateY-l/this.ratio);break}case"zooming":{const r=o.scale,a=o.geometry,l=1+(o.clientX-n)/a.width/r.sx;o.frameId&&cancelAnimationFrame(o.frameId),o.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*o.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,i;const o=this.targetGraph.translate();if(o.ty=o.ty||0,e.offsetX==null){const l=yn(this.targetGraph.container);n=e.pageX-l.left,i=e.pageY-l.top}else n=e.offsetX,i=e.offsetY;const r=(n-o.tx)/this.ratio,a=(i-o.ty)/this.ratio;this.sourceGraph.centerPoint(r,a)}dispose(){this.remove(),Be(this.name)}}H([_()],zA.prototype,"dispose",null);const Ps="graph-scroller",FA=`${Ps}-paged`,UA=`${Ps}-content`,VA=`${Ps}-background`,sd="transition-in-progress",Er="transitionend.graph-scroller-transition",KA={padding(){const s=this.getClientSize(),t=Math.max(this.options.minVisibleWidth||0,1)||1,e=Math.max(this.options.minVisibleHeight||0,1)||1,n=Math.max(s.width-t,0),i=Math.max(s.height-e,0);return{left:n,top:i,right:n,bottom:i}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function od(s){const t=ct({},KA,s);t.pageWidth==null&&(t.pageWidth=s.graph.options.width),t.pageHeight==null&&(t.pageHeight=s.graph.options.height);const e=s.graph.options;return e.background&&t.enabled&&t.background==null&&(t.background=e.background,s.graph.background.clear()),t}class rd extends Ut{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=od(t),this.onUpdate=ji(this.onUpdate,200);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),O(this.container,this.prefixClassName(Ps)),$(this.container,{width:n,height:i}),this.options.pageVisible&&O(this.container,this.prefixClassName(FA)),this.options.className&&O(this.container,this.options.className);const o=this.graph.container;o.parentNode&&jn(o,this.container),this.content=document.createElement("div"),O(this.content,this.prefixClassName(UA)),$(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),O(this.background,this.prefixClassName(VA)),Mt(this.content,this.background),this.options.pageVisible||Mt(this.content,this.graph.view.grid),Mt(this.content,o),Yt(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new JA(this),this.options.autoResize||this.update()}startListening(){const t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),this.delegateBackgroundEvents()}stopListening(){const t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(t){const e=t||ve.events;this.delegatedHandlers=Object.keys(e).reduce((n,i)=>{const o=e[i];if(i.indexOf(" ")===-1)if(typeof o=="function")n[i]=o;else{let r=this.graph.view[o];typeof r=="function"&&(r=r.bind(this.graph.view),n[i]=r)}return n},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(n=>{this.delegateEvent(n,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(t=>{this.undelegateEvent(t,this.onBackgroundEvent)})}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)this.options.background?e=this.background===n:e=this.content===n;else{const i=this.graph.view;e=i.background===n||i.grid===n}if(e){const i=this.delegatedHandlers[t.type];typeof i=="function"&&i.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:i}){this.updateScale(t,e),(n||i)&&(this.centerPoint(n,i),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(Bl||kl)&&$(this.container,{visibility:"hidden"})}afterManipulation(){(Bl||kl)&&$(this.container,{visibility:"visible"})}updatePageSize(t,e){t!=null&&(this.options.pageWidth=t),e!=null&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(n===0||i===0)return;if(t>n||e>i){let o=!1;const r=document.createElement("div");for(let a=1,l=Math.floor(t/n);a<l;a+=1){const c=document.createElement("div");O(c,this.prefixClassName("graph-pagebreak-vertical")),$(c,{left:a*n}),Yt(c,r),o=!0}for(let a=1,l=Math.floor(e/i);a<l;a+=1){const c=document.createElement("div");O(c,this.prefixClassName("graph-pagebreak-horizontal")),$(c,{top:a*i}),Yt(c,r),o=!0}o&&(O(r,this.prefixClassName("graph-pagebreak")),py(this.graph.view.grid,r),this.pageBreak=r)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions;typeof e=="function"&&(e=D(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),typeof t.padding=="object"?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:typeof t.padding=="number"&&(t.padding*=e),this.options.autoResize||(t.contentArea=I.create()),t}updateScale(t,e){const n=this.graph.options,i=t/this.sx,o=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*i,n.y*o),this.graph.transform.resize(n.width*i,n.height*o)}scrollbarPosition(t,e){if(t==null&&e==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const n={};return typeof t=="number"&&(n.scrollLeft=t),typeof e=="number"&&(n.scrollTop=e),ko(this.container,n),this}scrollToPoint(t,e){const n=this.getClientSize(),i=this.graph.matrix(),o={};return typeof t=="number"&&(o.scrollLeft=t-n.width/2+i.e+(this.padding.left||0)),typeof e=="number"&&(o.scrollTop=e-n.height/2+i.f+(this.padding.top||0)),ko(this.container,o),this}scrollToContent(){const t=this.sx,e=this.sy,n=this.graph.getContentArea().getCenter();return this.scrollToPoint(n.x*t,n.y*e)}scrollToCell(t){const e=this.sx,n=this.sy,i=t.getBBox().getCenter();return this.scrollToPoint(i.x*e,i.y*n)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.graph.matrix(),o=i.a,r=i.d,a=-i.e,l=-i.f,c=a+this.graph.options.width,h=l+this.graph.options.height;let u;if(this.storeClientSize(),typeof t=="number"||typeof e=="number"){u=n;const v=this.getVisibleArea().getCenter();typeof t=="number"?t*=o:t=v.x,typeof e=="number"?e*=r:e=v.y}else u=t,t=(a+c)/2,e=(l+h)/2;if(u&&u.padding)return this.positionPoint({x:t,y:e},"50%","50%",u);const d=this.getPadding(),f=this.getClientSize(),p=f.width/2,m=f.height/2,b=p-d.left-t+a,y=p-d.right+t-c,C=m-d.top-e+l,A=m-d.bottom+e-h;this.addPadding(Math.max(b,0),Math.max(y,0),Math.max(C,0),Math.max(A,0));const x=this.scrollToPoint(t,e);return this.restoreClientSize(),x}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const i=t.getBBox();return this.positionRect(i,e,n)}positionRect(t,e,n){const i=I.create(t);switch(e){case"center":return this.positionPoint(i.getCenter(),"50%","50%",n);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,n);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,i={}){const{padding:o}=i,r=V(i,["padding"]),a=ne(o),l=I.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});e=Vt(e,Math.max(0,c.width)),e<0&&(e=c.width+e),n=Vt(n,Math.max(0,c.height)),n<0&&(n=c.height+n);const h=c.getTopLeft().translate(e,n),u=l.getCenter().diff(h),d=this.zoom(),f=u.scale(1/d,1/d),p=w.create(t).translate(f);return this.centerPoint(p.x,p.y,r)}zoom(t,e){if(t==null)return this.sx;e=e||{};let n,i;const o=this.getClientSize(),r=this.clientToLocalPoint(o.width/2,o.height/2);let a=t,l=t;if(e.absolute||(a+=this.sx,l+=this.sy),e.scaleGrid&&(a=Math.round(a/e.scaleGrid)*e.scaleGrid,l=Math.round(l/e.scaleGrid)*e.scaleGrid),e.maxScale&&(a=Math.min(e.maxScale,a),l=Math.min(e.maxScale,l)),e.minScale&&(a=Math.max(e.minScale,a),l=Math.max(e.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),e.center){const c=a/this.sx,h=l/this.sy;n=e.center.x-(e.center.x-r.x)/c,i=e.center.y-(e.center.y-r.y)/h}else n=r.x,i=r.y;return this.beforeManipulation(),this.graph.transform.scale(a,l,n,i,!1),this.centerPoint(n,i),this.afterManipulation(),this}zoomToRect(t,e={}){const n=I.create(t),i=this.graph;if(e.contentArea=n,e.viewportArea==null){const r=this.container.getBoundingClientRect();e.viewportArea={x:i.options.x,y:i.options.y,width:r.width,height:r.height}}this.beforeManipulation(),i.transform.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){typeof t=="object"?(n=e,e=t.y,t=t.x):e=e,n==null&&(n={});let i,o;const r=this.sx,a=Math.max(n.scale||r,1e-6),l=this.getClientSize(),c=new w(t,e),h=this.clientToLocalPoint(l.width/2,l.height/2);if(r===a){const d=h.diff(c).scale(r,r).round();i=`translate(${d.x}px,${d.y}px)`}else{const d=a/(r-a)*c.distance(h),f=h.clone().move(c,d),p=this.localToBackgroundPoint(f).round();i=`scale(${a/r})`,o=`${p.x}px ${p.y}px`}const u=n.onTransitionEnd;return O(this.container,sd),nt.off(this.content,Er),nt.on(this.content,Er,d=>{this.syncTransition(a,{x:t,y:e}),typeof u=="function"&&D(u,this,d.originalEvent)}),$(this.content,{transform:i,transformOrigin:o,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return st(this.container,sd),nt.off(this.content,Er),$(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=I.create(t),i=e.maxScale||1/0,o=e.minScale||Number.MIN_VALUE,r=e.scaleGrid||null,a=e.visibility||1,l=e.center?w.create(e.center):n.getCenter(),c=this.getClientSize(),h=c.width*a,u=c.height*a;let d=new I(l.x-h/2,l.y-u/2,h,u).getMaxUniformScaleToFit(n,l);return d=Math.min(d,i),r&&(d=Math.floor(d/r)*r),d=Math.max(o,d),this.transitionToPoint(l,Object.assign({scale:d},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e}),nt.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),nt.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e})}stopPanning(t){nt.off(document.body,".panning"),nt.off(window,".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n=typeof t=="object"?t.x:t,i=typeof t=="object"?t.y:e;const o=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-o.e,i+=this.container.scrollTop-this.padding.top-o.f,new w(n/o.a,i/o.d)}localToBackgroundPoint(t,e){const n=typeof t=="object"?w.create(t):new w(t,e),i=this.graph.matrix(),o=this.padding;return we(n,i).translate(o.left,o.top)}resize(t,e){let n=t??this.container.offsetWidth,i=e??this.container.offsetHeight;typeof n=="number"&&(n=Math.round(n)),typeof i=="number"&&(i=Math.round(i)),this.options.width=n,this.options.height=i,$(this.container,{width:n,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const i=this.container,o=i.getBoundingClientRect();let r=0,a=0;return t<=o.left+10&&(r=-10),e<=o.top+10&&(a=-10),t>=o.right-10&&(r=10),e>=o.bottom-10&&(a=10),r!==0&&(i.scrollLeft+=r),a!==0&&(i.scrollTop+=a),{scrollerX:r,scrollerY:a}}addPadding(t,e,n,i){let o=this.getPadding();this.padding={left:Math.round(o.left+(t||0)),top:Math.round(o.top+(n||0)),bottom:Math.round(o.bottom+(i||0)),right:Math.round(o.right+(e||0))},o=this.padding,$(this.content,{width:o.left+this.graph.options.width+o.right,height:o.top+this.graph.options.height+o.bottom});const r=this.graph.container;return r.style.left=`${this.padding.left}px`,r.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return ne(typeof t=="function"?D(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},i=Ht(n,t.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(t,e={}){const n=t.getBBox(),i=this.getVisibleArea();return e.strict?i.containsRect(n):i.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return $(this.container,{overflow:"hidden"}),this}unlock(){return $(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){jn(this.container,this.graph.container),this.remove()}}H([_()],rd.prototype,"dispose",null);class JA extends lr{get elem(){return this.scroller.background}constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}const jA=`.x6-graph-scroller {
|
|
373
|
+
`,XA={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:i=>new B(i)},$A={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"},gd="widget-minimap",fd=`${gd}-viewport`,ZA=`${fd}-zoom`;class tx extends Jt{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(t){super(),this.name="minimap",this.options=Object.assign(Object.assign({},XA),t),Be(this.name,qA)}init(t){this.graph=t,this.updateViewport=Wi(this.updateViewport.bind(this),0),this.container=document.createElement("div"),L(this.container,this.prefixClassName(gd));const e=document.createElement("div");this.container.appendChild(e),this.viewport=document.createElement("div"),L(this.viewport,this.prefixClassName(fd)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),L(this.zoomHandle,this.prefixClassName(ZA)),Wt(this.zoomHandle,this.viewport)),Ot(this.container,this.viewport),nt(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1,panning:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new B(n),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?st.on(this.graphContainer,`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?st.off(this.graphContainer,this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.stopListening(),this.targetGraph.dispose(!1)}onTransform(t){(t.ui||this.targetGraphTransforming||!this.scroller)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,s;typeof t=="object"?(n=t.width,s=t.height):(n=t,s=e);const o=this.sourceGraph.options,r=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;n/=r.sx,s/=r.sy,this.ratio=Math.min(a/n,l/s);const c=this.ratio,h=o.x*c/r.sx,u=o.y*c/r.sy;return n*=c,s*=c,this.targetGraph.resize(n,s),this.targetGraph.translate(h,u),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale(),n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0),s=D6(this.targetGraph.container),o=this.targetGraph.translate();o.ty=o.ty||0,this.geometry={top:s.top+n.y*e.sy+o.ty,left:s.left+n.x*e.sx+o.tx,width:this.graphContainer.clientWidth*e.sx/t.sx,height:this.graphContainer.clientHeight*e.sy/t.sy},nt(this.viewport,this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:s,ty:o}=this.sourceGraph.translate(),r={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:s,translateY:o};this.targetGraphTransforming=!0,this.delegateDocumentEvents($A,r)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,s=e.clientY,o=e.data;switch(o.action){case"panning":{const r=this.sourceGraph.transform.getScale(),a=(n-o.clientX)*r.sx,l=(s-o.clientY)*r.sy;this.scroller?(this.graphContainer.scrollLeft=o.scrollLeft+a/this.ratio,this.graphContainer.scrollTop=o.scrollTop+l/this.ratio):this.sourceGraph.translate(o.translateX-a/this.ratio,o.translateY-l/this.ratio);break}case"zooming":{const r=o.scale,a=o.geometry,l=1+(o.clientX-n)/a.width/r.sx;o.frameId&&cancelAnimationFrame(o.frameId),o.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*o.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,s;const o=this.targetGraph.translate();if(o.ty=o.ty||0,e.offsetX==null){const l=wn(this.targetGraph.container);n=e.pageX-l.left,s=e.pageY-l.top}else n=e.offsetX,s=e.offsetY;const r=(n-o.tx)/this.ratio,a=(s-o.ty)/this.ratio;this.sourceGraph.centerPoint(r,a)}dispose(){this.remove(),ke(this.name)}}X([$()],tx.prototype,"dispose",null);const Ls="graph-scroller",ex=`${Ls}-paged`,nx=`${Ls}-content`,ix=`${Ls}-background`,pd="transition-in-progress",Or="transitionend.graph-scroller-transition",sx={padding(){const i=this.getClientSize(),t=Math.max(this.options.minVisibleWidth||0,1)||1,e=Math.max(this.options.minVisibleHeight||0,1)||1,n=Math.max(i.width-t,0),s=Math.max(i.height-e,0);return{left:n,top:s,right:n,bottom:s}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function md(i){const t=pt({},sx,i);t.pageWidth==null&&(t.pageWidth=i.graph.options.width),t.pageHeight==null&&(t.pageHeight=i.graph.options.height);const e=i.graph.options;return e.background&&t.enabled&&t.background==null&&(t.background=e.background,i.graph.background.clear()),t}class bd extends Jt{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=md(t),this.onUpdate=Wi(this.onUpdate,200);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,s=this.options.height||this.graph.options.height;this.container=document.createElement("div"),L(this.container,this.prefixClassName(Ls)),nt(this.container,{width:n,height:s}),this.options.pageVisible&&L(this.container,this.prefixClassName(ex)),this.options.className&&L(this.container,this.options.className);const o=this.graph.container;o.parentNode&&_n(o,this.container),this.content=document.createElement("div"),L(this.content,this.prefixClassName(nx)),nt(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),L(this.background,this.prefixClassName(ix)),Ot(this.content,this.background),this.options.pageVisible||Ot(this.content,this.graph.view.grid),Ot(this.content,o),Wt(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new ox(this),this.options.autoResize||this.update()}startListening(){const t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),this.delegateBackgroundEvents()}stopListening(){const t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(t){const e=t||Se.events;this.delegatedHandlers=Object.keys(e).reduce((n,s)=>{const o=e[s];if(s.indexOf(" ")===-1)if(typeof o=="function")n[s]=o;else{let r=this.graph.view[o];typeof r=="function"&&(r=r.bind(this.graph.view),n[s]=r)}return n},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(n=>{this.delegateEvent(n,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(t=>{this.undelegateEvent(t,this.onBackgroundEvent)})}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)this.options.background?e=this.background===n:e=this.content===n;else{const s=this.graph.view;e=s.background===n||s.grid===n}if(e){const s=this.delegatedHandlers[t.type];typeof s=="function"&&s.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:s}){this.updateScale(t,e),(n||s)&&(this.centerPoint(n,s),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(Vl||zl)&&nt(this.container,{visibility:"hidden"})}afterManipulation(){(Vl||zl)&&nt(this.container,{visibility:"visible"})}updatePageSize(t,e){t!=null&&(this.options.pageWidth=t),e!=null&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,s=this.options.pageHeight*this.sy;if(n===0||s===0)return;if(t>n||e>s){let o=!1;const r=document.createElement("div");for(let a=1,l=Math.floor(t/n);a<l;a+=1){const c=document.createElement("div");L(c,this.prefixClassName("graph-pagebreak-vertical")),nt(c,{left:a*n}),Wt(c,r),o=!0}for(let a=1,l=Math.floor(e/s);a<l;a+=1){const c=document.createElement("div");L(c,this.prefixClassName("graph-pagebreak-horizontal")),nt(c,{top:a*s}),Wt(c,r),o=!0}o&&(L(r,this.prefixClassName("graph-pagebreak")),Py(this.graph.view.grid,r),this.pageBreak=r)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions;typeof e=="function"&&(e=F(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),typeof t.padding=="object"?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:typeof t.padding=="number"&&(t.padding*=e),this.options.autoResize||(t.contentArea=I.create()),t}updateScale(t,e){const n=this.graph.options,s=t/this.sx,o=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*s,n.y*o),this.graph.transform.resize(n.width*s,n.height*o)}scrollbarPosition(t,e){if(t==null&&e==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const n={};return typeof t=="number"&&(n.scrollLeft=t),typeof e=="number"&&(n.scrollTop=e),Lo(this.container,n),this}scrollToPoint(t,e){const n=this.getClientSize(),s=this.graph.matrix(),o={};return typeof t=="number"&&(o.scrollLeft=t-n.width/2+s.e+(this.padding.left||0)),typeof e=="number"&&(o.scrollTop=e-n.height/2+s.f+(this.padding.top||0)),Lo(this.container,o),this}scrollToContent(){const t=this.sx,e=this.sy,n=this.graph.getContentArea().getCenter();return this.scrollToPoint(n.x*t,n.y*e)}scrollToCell(t){const e=this.sx,n=this.sy,s=t.getBBox().getCenter();return this.scrollToPoint(s.x*e,s.y*n)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const s=this.graph.matrix(),o=s.a,r=s.d,a=-s.e,l=-s.f,c=a+this.graph.options.width,h=l+this.graph.options.height;let u;if(this.storeClientSize(),typeof t=="number"||typeof e=="number"){u=n;const E=this.getVisibleArea().getCenter();typeof t=="number"?t*=o:t=E.x,typeof e=="number"?e*=r:e=E.y}else u=t,t=(a+c)/2,e=(l+h)/2;if(u&&u.padding)return this.positionPoint({x:t,y:e},"50%","50%",u);const d=this.getPadding(),f=this.getClientSize(),m=f.width/2,p=f.height/2,b=m-d.left-t+a,y=m-d.right+t-c,C=p-d.top-e+l,w=p-d.bottom+e-h;this.addPadding(Math.max(b,0),Math.max(y,0),Math.max(C,0),Math.max(w,0));const x=this.scrollToPoint(t,e);return this.restoreClientSize(),x}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const s=t.getBBox();return this.positionRect(s,e,n)}positionRect(t,e,n){const s=I.create(t);switch(e){case"center":return this.positionPoint(s.getCenter(),"50%","50%",n);case"top":return this.positionPoint(s.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0,n);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(s.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,s={}){const{padding:o}=s,r=_(s,["padding"]),a=se(o),l=I.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});e=jt(e,Math.max(0,c.width)),e<0&&(e=c.width+e),n=jt(n,Math.max(0,c.height)),n<0&&(n=c.height+n);const h=c.getTopLeft().translate(e,n),u=l.getCenter().diff(h),d=this.zoom(),f=u.scale(1/d,1/d),m=A.create(t).translate(f);return this.centerPoint(m.x,m.y,r)}zoom(t,e){if(t==null)return this.sx;e=e||{};let n,s;const o=this.getClientSize(),r=this.clientToLocalPoint(o.width/2,o.height/2);let a=t,l=t;if(e.absolute||(a+=this.sx,l+=this.sy),e.scaleGrid&&(a=Math.round(a/e.scaleGrid)*e.scaleGrid,l=Math.round(l/e.scaleGrid)*e.scaleGrid),e.maxScale&&(a=Math.min(e.maxScale,a),l=Math.min(e.maxScale,l)),e.minScale&&(a=Math.max(e.minScale,a),l=Math.max(e.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),e.center){const c=a/this.sx,h=l/this.sy;n=e.center.x-(e.center.x-r.x)/c,s=e.center.y-(e.center.y-r.y)/h}else n=r.x,s=r.y;return this.beforeManipulation(),this.graph.transform.scale(a,l,n,s,!1),this.centerPoint(n,s),this.afterManipulation(),this}zoomToRect(t,e={}){const n=I.create(t),s=this.graph;if(e.contentArea=n,e.viewportArea==null){const r=this.container.getBoundingClientRect();e.viewportArea={x:s.options.x,y:s.options.y,width:r.width,height:r.height}}this.beforeManipulation(),s.transform.scaleContentToFitImpl(e,!1);const o=n.getCenter();return this.centerPoint(o.x,o.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){typeof t=="object"?(n=e,e=t.y,t=t.x):e=e,n==null&&(n={});let s,o;const r=this.sx,a=Math.max(n.scale||r,1e-6),l=this.getClientSize(),c=new A(t,e),h=this.clientToLocalPoint(l.width/2,l.height/2);if(r===a){const d=h.diff(c).scale(r,r).round();s=`translate(${d.x}px,${d.y}px)`}else{const d=a/(r-a)*c.distance(h),f=h.clone().move(c,d),m=this.localToBackgroundPoint(f).round();s=`scale(${a/r})`,o=`${m.x}px ${m.y}px`}const u=n.onTransitionEnd;return L(this.container,pd),st.off(this.content,Or),st.on(this.content,Or,d=>{this.syncTransition(a,{x:t,y:e}),typeof u=="function"&&F(u,this,d.originalEvent)}),nt(this.content,{transform:s,transformOrigin:o,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return at(this.container,pd),st.off(this.content,Or),nt(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=I.create(t),s=e.maxScale||1/0,o=e.minScale||Number.MIN_VALUE,r=e.scaleGrid||null,a=e.visibility||1,l=e.center?A.create(e.center):n.getCenter(),c=this.getClientSize(),h=c.width*a,u=c.height*a;let d=new I(l.x-h/2,l.y-u/2,h,u).getMaxUniformScaleToFit(n,l);return d=Math.min(d,s),r&&(d=Math.floor(d/r)*r),d=Math.max(o,d),this.transitionToPoint(l,Object.assign({scale:d},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e}),st.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),st.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,s=e.clientY-this.clientY;this.container.scrollTop-=s,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e})}stopPanning(t){st.off(document.body,".panning"),st.off(window,".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n=typeof t=="object"?t.x:t,s=typeof t=="object"?t.y:e;const o=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-o.e,s+=this.container.scrollTop-this.padding.top-o.f,new A(n/o.a,s/o.d)}localToBackgroundPoint(t,e){const n=typeof t=="object"?A.create(t):new A(t,e),s=this.graph.matrix(),o=this.padding;return xe(n,s).translate(o.left,o.top)}resize(t,e){let n=t??this.container.offsetWidth,s=e??this.container.offsetHeight;typeof n=="number"&&(n=Math.round(n)),typeof s=="number"&&(s=Math.round(s)),this.options.width=n,this.options.height=s,nt(this.container,{width:n,height:s}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const s=this.container,o=s.getBoundingClientRect();let r=0,a=0;return t<=o.left+10&&(r=-10),e<=o.top+10&&(a=-10),t>=o.right-10&&(r=10),e>=o.bottom-10&&(a=10),r!==0&&(s.scrollLeft+=r),a!==0&&(s.scrollTop+=a),{scrollerX:r,scrollerY:a}}addPadding(t,e,n,s){let o=this.getPadding();this.padding={left:Math.round(o.left+(t||0)),top:Math.round(o.top+(n||0)),bottom:Math.round(o.bottom+(s||0)),right:Math.round(o.right+(e||0))},o=this.padding,nt(this.content,{width:o.left+this.graph.options.width+o.right,height:o.top+this.graph.options.height+o.bottom});const r=this.graph.container;return r.style.left=`${this.padding.left}px`,r.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return se(typeof t=="function"?F(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},s=qt(n,t.inverse());return s.x-=(this.padding.left||0)/this.sx,s.y-=(this.padding.top||0)/this.sy,s}isCellVisible(t,e={}){const n=t.getBBox(),s=this.getVisibleArea();return e.strict?s.containsRect(n):s.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return nt(this.container,{overflow:"hidden"}),this}unlock(){return nt(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){_n(this.container,this.graph.container),this.remove()}}X([$()],bd.prototype,"dispose",null);class ox extends mr{get elem(){return this.scroller.background}constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}const rx=`.x6-graph-scroller {
|
|
374
374
|
position: relative;
|
|
375
375
|
box-sizing: border-box;
|
|
376
376
|
overflow: scroll;
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
height: 1px;
|
|
429
429
|
border-top: 1px dashed #bdbdbd;
|
|
430
430
|
}
|
|
431
|
-
`;
|
|
431
|
+
`;B.prototype.lockScroller=function(){const i=this.getPlugin("scroller");return i&&i.lockScroller(),this},B.prototype.unlockScroller=function(){const i=this.getPlugin("scroller");return i&&i.unlockScroller(),this},B.prototype.updateScroller=function(){const i=this.getPlugin("scroller");return i&&i.updateScroller(),this},B.prototype.getScrollbarPosition=function(){const i=this.getPlugin("scroller");return i?i.getScrollbarPosition():{left:0,top:0}},B.prototype.setScrollbarPosition=function(i,t){const e=this.getPlugin("scroller");return e&&e.setScrollbarPosition(i,t),this};class yd extends zt{get pannable(){return this.options?typeof this.options.pannable=="object"?this.options.pannable.enabled:!!this.options.pannable:!1}get container(){return this.scrollerImpl.container}constructor(t={}){super(),this.name="scroller",this.options=t,Be(this.name,rx)}init(t){this.graph=t;const e=md(Object.assign(Object.assign({enabled:!0},this.options),{graph:t}));this.options=e,this.scrollerImpl=new bd(e),this.setup(),this.autoDisableGraphPanning(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(t,e){this.scrollerImpl.resize(t,e)}resizePage(t,e){this.scrollerImpl.updatePageSize(t,e)}zoom(t,e){return typeof t>"u"?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(t,e),this)}zoomTo(t,e={}){return this.scrollerImpl.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){return this.scrollerImpl.zoomToRect(t,e),this}zoomToFit(t={}){return this.scrollerImpl.zoomToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){return this.scrollerImpl.centerPoint(t,e,n),this}centerContent(t){return this.scrollerImpl.centerContent(t),this}centerCell(t,e){return this.scrollerImpl.centerCell(t,e),this}positionPoint(t,e,n,s={}){return this.scrollerImpl.positionPoint(t,e,n,s),this}positionRect(t,e,n){return this.scrollerImpl.positionRect(t,e,n),this}positionCell(t,e,n){return this.scrollerImpl.positionCell(t,e,n),this}positionContent(t,e){return this.scrollerImpl.positionContent(t,e),this}drawBackground(t,e){return(this.graph.options.background==null||!e)&&this.scrollerImpl.backgroundManager.draw(t),this}clearBackground(t){return(this.graph.options.background==null||!t)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){this.pannable||(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(t,e){return this.scrollerImpl.scrollbarPosition(t,e),this}scrollToPoint(t,e){return this.scrollerImpl.scrollToPoint(t,e),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(t){return this.scrollerImpl.scrollToCell(t),this}transitionToPoint(t,e,n){return this.scrollerImpl.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){return this.scrollerImpl.transitionToRect(t,e),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(t,e){return this.scrollerImpl.autoScroll(t,e)}clientToLocalPoint(t,e){return this.scrollerImpl.clientToLocalPoint(t,e)}getVisibleArea(){return this.scrollerImpl.getVisibleArea()}isCellVisible(t,e={}){return this.scrollerImpl.isCellVisible(t,e)}isPointVisible(t){return this.scrollerImpl.isPointVisible(t)}setup(){this.scrollerImpl.on("*",(t,e)=>{this.trigger(t,e)})}startListening(){let t=[];const e=this.options.pannable;typeof e=="object"?t=e.eventTypes||[]:t=["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),st.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.options.pannable;typeof e=="object"?t=e.eventTypes||[]:t=["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&st.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(t){t.button===2&&this.allowPanning(t,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(t),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e:t}){const e=this.allowPanning(t,!0),n=this.graph.getPlugin("selection"),s=n&&n.allowRubberband(t,!0);(e||this.allowPanning(t)&&!s)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(t),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(t,e){return this.pannable&&Pe(t,this.options.modifiers,e)}updateClassName(t){const e=this.scrollerImpl.container,n=et.prefix("graph-scroller-pannable");this.pannable?(L(e,n),e.dataset.panning=(!!t).toString()):at(e,n)}autoDisableGraphPanning(){var t;const e=(t=this.graph)===null||t===void 0?void 0:t.panning;e!=null&&e.pannable&&(e.disablePanning(),console.warn("Detected Scroller plugin; Graph panning has been disabled by default to avoid conflicts."))}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),ke(this.name)}}X([$()],yd.prototype,"dispose",null);function Qs(i,t){return i.reduce((e,n)=>Math.max(n==null?void 0:n.getSize()[t],e),0)}function ax(i,t,e){const n=[];for(let s=e*t,o=s+e;s<o;s+=1)i[s]&&n.push(i[s]);return n}function lx(i,t,e){const n=[];for(let s=t,o=i.length;s<o;s+=e)i[s]&&n.push(i[s]);return n}function wd(i,t){return i.reduce((e,n,s)=>(e.push(e[s]+n),e),[t||0])}function cx(i,t={}){const e=Gt.isModel(i)?i:new Gt().resetCells(i,{sort:!1,dryrun:!0}),n=e.getNodes(),s=t.columns||1,o=Math.ceil(n.length/s),r=t.dx||0,a=t.dy||0,l=t.center!==!1,c=t.resizeToFit===!0,h=t.marginX||0,u=t.marginY||0,d=[];let f=t.columnWidth;if(f==="compact")for(let C=0;C<s;C+=1){const w=lx(n,C,s);d.push(Qs(w,"width")+r)}else{(f==null||f==="auto")&&(f=Qs(n,"width")+r);for(let C=0;C<s;C+=1)d.push(f)}const m=wd(d,h),p=[];let b=t.rowHeight;if(b==="compact")for(let C=0;C<o;C+=1){const w=ax(n,C,s);p.push(Qs(w,"height")+a)}else{(b==null||b==="auto")&&(b=Qs(n,"height")+a);for(let C=0;C<o;C+=1)p.push(b)}const y=wd(p,u);e.startBatch("layout"),n.forEach((C,w)=>{const x=w%s,E=Math.floor(w/s),S=d[x],v=p[E];let M=0,k=0,T=C.getSize();if(c){let P=S-2*r,R=v-2*a;const J=T.height*(T.width?P/T.width:1),D=T.width*(T.height?R/T.height:1);v<J?P=D:R=J,T={width:P,height:R},C.setSize(T,t)}l&&(M=(S-T.width)/2,k=(v-T.height)/2),C.position(m[x]+r+M,y[E]+a+k,t)}),e.stopBatch("layout")}const hx=`.x6-widget-dnd {
|
|
432
432
|
position: absolute;
|
|
433
433
|
top: -10000px;
|
|
434
434
|
left: -10000px;
|
|
@@ -665,7 +665,7 @@
|
|
|
665
665
|
font-size: 12px;
|
|
666
666
|
background: 0 0;
|
|
667
667
|
}
|
|
668
|
-
`,qt={base:"widget-stencil",title:"widget-stencil-title",search:"widget-stencil-search",searchText:"widget-stencil-search-text",content:"widget-stencil-content",group:"widget-stencil-group",groupTitle:"widget-stencil-group-title",groupContent:"widget-stencil-group-content"},Sr="__default__",WA=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(s,t){const e={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};HA(s,Object.assign(Object.assign(Object.assign({},e),this.options.layoutOptions),t?t.layoutOptions:{}))}},ju);class qA extends Ut{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(t={}){super(),this.name="stencil",Me(this.name,_A),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},WA),t),this.init()}init(){this.dnd=new vr(this.options),this.onSearch=ji(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n)}),this}unload(t,e){return Array.isArray(t)?this.loadGroup(t,e,!0):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n,!0)}),this}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),O(e,"collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),st(e,"collapsed"))}return this}isGroupCollapsable(t){const e=this.groups[t];return ce(e,"collapsable")}isGroupCollapsed(t){const e=this.groups[t];return e&&ce(e,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(t=>{this.collapseGroup(t)}),this}expandGroups(){return Object.keys(this.groups).forEach(t=>{this.expandGroup(t)}),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}addGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups?this.options.groups.push(...e):this.options.groups=e,e.forEach(n=>{this.initGroup(n)})}removeGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups&&(this.options.groups=this.options.groups.filter(n=>!e.includes(n.name)),e.forEach(n=>{const i=this.graphs[n];this.unregisterGraphEvents(i),i.dispose(),delete this.graphs[n];const o=this.groups[n];Gt(o),delete this.groups[n]}))}initContainer(){this.container=document.createElement("div"),O(this.container,this.prefixClassName(qt.base)),j(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),O(this.content,this.prefixClassName(qt.content)),Yt(this.content,this.container)}buildGraphConfig(t){const e=this.options.stencilGraphOptions||{},n=t==null?void 0:t.graphOptions,i=Object.assign(Object.assign({},e),n);i.panning==null&&(i.panning=!1);const o=t&&t.graphWidth||this.options.stencilGraphWidth,r=t&&t.graphHeight||this.options.stencilGraphHeight,a=i.model||new Kt;return{mergedGraphOptions:i,width:o,height:r,model:a}}createStencilGraph(t,e,n,i){const o=new S(Object.assign(Object.assign({},t),{container:document.createElement("div"),model:i,width:e,height:n,interacting:!1,preventDefaultBlankAction:!1}));return this.registerGraphEvents(o),o}initSearch(){this.options.search&&(O(this.container,"searchable"),Mt(this.container,this.renderSearch()))}initGroup(t){const e=document.createElement("div");O(e,this.prefixClassName(qt.group)),j(e,"data-name",t.name),(t.collapsable==null&&this.options.collapsable||t.collapsable!==!1)&&O(e,"collapsable"),se(e,"collapsed",t.collapsed===!0);const n=document.createElement("h3");O(n,this.prefixClassName(qt.groupTitle)),n.innerHTML=t.title||t.name;const i=document.createElement("div");O(i,this.prefixClassName(qt.groupContent));const{mergedGraphOptions:o,width:r,height:a,model:l}=this.buildGraphConfig(t),c=this.createStencilGraph(o,r,a,l);Mt(i,c.container),Mt(e,[n,i]),Yt(e,this.content),this.groups[t.name]=e,this.graphs[t.name]=c}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(t=>{this.initGroup(t)});else{const{mergedGraphOptions:t,width:e,height:n,model:i}=this.buildGraphConfig(),o=this.createStencilGraph(t,e,n,i);Mt(this.content,o.container),this.graphs[Sr]=o}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(t=>t.collapsable!==!1),this.options.collapsable?(O(this.container,"collapsable"),this.options.groups&&this.options.groups.every(e=>e.collapsed||e.collapsable===!1)?O(this.container,"collapsed"):st(this.container,"collapsed")):st(this.container,"collapsable")}setTitle(){const t=document.createElement("div");O(t,this.prefixClassName(qt.title)),t.innerHTML=this.options.title,Yt(t,this.container)}renderSearch(){const t=document.createElement("div");O(t,this.prefixClassName(qt.search));const e=document.createElement("input");return j(e,{type:"search",placeholder:this.options.placeholder||"Search"}),O(e,this.prefixClassName(qt.searchText)),Mt(t,e),t}startListening(){const t=this.prefixClassName(qt.title),e=this.prefixClassName(qt.searchText),n=this.prefixClassName(qt.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${n}`]:"onGroupTitleClick",[`touchstart .${n}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(t){t.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(t){t.off("cell:mousedown",this.onDragStart,this)}loadGroup(t,e,n){const i=this.getModel(e);if(i){const l=t.map(c=>vt.isNode(c)?c:vt.create(c));n===!0?i.removeCells(l):i.resetCells(l)}const o=this.getGroup(e);let r=this.options.stencilGraphHeight;o&&o.graphHeight!=null&&(r=o.graphHeight);const a=o&&o.layout||this.options.layout;if(a&&i&&D(a,this,i,o),!r){const l=this.getGraph(e);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:o&&o.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e,node:n}=t,i=this.getGroupByNode(n);if(i&&i.nodeMovable===!1)return;const o=this.getGraph(i?i.name:void 0),r=o&&typeof o.isPannable=="function"?o.isPannable():!1;r&&o.disablePanning();const a=()=>{r&&o.enablePanning(),this.undelegateDocumentEvents()};this.delegateDocumentEvents({mouseup:a,touchend:a,touchcancel:a}),this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce((i,o)=>{const r=this.graphs[o],a=o===Sr?null:o,l=r.model.getNodes().filter(d=>{let f=!1;typeof e=="function"?f=D(e,this,d,t,a,this):typeof e=="boolean"?f=e:f=this.isCellMatched(d,t,e,t.toLowerCase()!==t);const p=r.renderer.findViewByCell(d);return p&&se(p.container,"unmatched",!f),f}),c=l.length>0,h=this.options,u=new Kt;return u.resetCells(l),h.layout&&D(h.layout,this,u,this.getGroup(o)),this.groups[o]&&se(this.groups[o],"unmatched",!c),r.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),i||c},!1);se(this.container,"not-found",!n)}isCellMatched(t,e,n,i){return e&&n?Object.keys(n).some(o=>{if(o==="*"||t.shape===o){const r=n[o];return typeof r=="boolean"?r:(Array.isArray(r)?r:[r]).some(l=>{let c=t.getPropByPath(l);return c!=null?(c=`${c}`,i||(c=c.toLowerCase()),c.indexOf(e)>=0):!1})}return!1}):!0}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){O(this.container,"is-focused")}onSearchFocusOut(){st(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(se(this.container,"collapsed"),ce(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=t.target.closest(`.${this.prefixClassName(qt.group)}`);e&&this.toggleGroup(j(e,"data-name")||"");const n=Object.keys(this.groups).every(i=>{const o=this.getGroup(i),r=this.groups[i];return o&&o.collapsable===!1||ce(r,"collapsed")});se(this.container,"collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||Sr]}getGroup(t){const e=this.options.groups;return t!=null&&e&&e.length?e.find(n=>n.name===t):null}getGroupByNode(t){const e=this.options.groups;return e?e.find(n=>{const i=this.getModel(n.name);return i?i.has(t.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];this.unregisterGraphEvents(e),e.dispose()}),Object.keys(this.groups).forEach(t=>{const e=this.groups[t];Gt(e)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Be(this.name)}}H([_()],qA.prototype,"dispose",null);class cd extends Ut{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(t){super();const{graph:e}=t,n=V(t,["graph"]);this.graph=e,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t}render(){const t=this.containerWrapper=new L("svg"),e=this.horizontal=new L("line"),n=this.vertical=new L("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:t,data:e}){t==="resize"&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const i=t.getDelegatedView();if(i&&this.isNodeMovable(i)){const o=t.cell.getPosition();this.offset={x:e-o.x,y:n-o.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?D(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const i=t.getBBox(),o=i.bbox(t.getAngle()),r=o.getTopLeft(),a=o.getBottomRight(),l=Pt(t.getAngle()),c=this.options.tolerance||0;let h,u,d,f,p,m;const b={vertical:0,horizontal:0},y=e.direction,C=e.trueDirection,A=e.relativeDirection;C.indexOf("right")!==-1?b.vertical=a.x:b.vertical=r.x,C.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=r.y,this.model.getNodes().some(R=>{if(this.isIgnored(t,R))return!1;const F=R.getBBox().bbox(R.getAngle()),K=F.getTopLeft(),Z=F.getBottomRight(),Y={vertical:[K.x,Z.x],horizontal:[K.y,Z.y]},Et={};return Object.keys(Y).forEach(Qt=>{const Lt=Qt,pt=Y[Lt].map(Q=>({position:Q,distance:Math.abs(Q-b[Lt])})).filter(Q=>Q.distance<=c);Et[Lt]=co(pt,Q=>Q.distance)}),h==null&&Et.vertical.length>0&&(h=Et.vertical[0].position,u=Math.min(o.y,F.y),d=Math.max(a.y,Z.y)-u),f==null&&Et.horizontal.length>0&&(f=Et.horizontal[0].position,p=Math.min(o.x,F.x),m=Math.max(a.x,Z.x)-p),h!=null&&f!=null}),this.hide();let x=0,v=0;(f!=null||h!=null)&&(h!=null&&(x=C.indexOf("right")!==-1?h-a.x:r.x-h),f!=null&&(v=C.indexOf("bottom")!==-1?f-a.y:r.y-f));let B=0,E=0;if(l%90===0)l===90||l===270?(B=v,E=x):(B=x,E=v);else{const R=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;f!=null&&h!=null&&(x<v?(v=0,f=void 0):(x=0,h=void 0));const F=It(l%90);x&&(B=R===3?x/Math.cos(F):x/Math.sin(F)),v&&(E=R===3?v/Math.cos(F):v/Math.sin(F));const K=R===1||R===3;switch(A){case"top":case"bottom":E=v?v/(K?Math.cos(F):Math.sin(F)):x/(K?Math.sin(F):Math.cos(F));break;case"left":case"right":B=x?x/(K?Math.cos(F):Math.sin(F)):v/(K?Math.sin(F):Math.cos(F));break}}switch(A){case"top":case"bottom":B=0;break;case"left":case"right":E=0;break}const M=this.graph.getGridSize();let k=Math.max(i.width+B,M),T=Math.max(i.height+E,M);e.minWidth&&e.minWidth>M&&(k=Math.max(k,e.minWidth)),e.minHeight&&e.minHeight>M&&(T=Math.max(T,e.minHeight)),e.maxWidth&&(k=Math.min(k,e.maxWidth)),e.maxHeight&&(T=Math.min(T,e.maxHeight)),e.preserveAspectRatio&&(E<B?T=k*(i.height/i.width):k=T*(i.width/i.height)),(k!==i.width||T!==i.height)&&(t.resize(k,T,{direction:y,relativeDirection:A,trueDirection:C,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),d&&(d+=T-i.height),m&&(m+=k-i.width));const P=t.getBBox().bbox(l);h&&Math.abs(P.x-h)>1&&Math.abs(P.width+P.x-h)>1&&(h=void 0),f&&Math.abs(P.y-f)>1&&Math.abs(P.height+P.y-f)>1&&(f=void 0),this.update({verticalLeft:h,verticalTop:u,verticalHeight:d,horizontalTop:f,horizontalLeft:p,horizontalWidth:m})}}}snapOnMoving({view:t,e,x:n,y:i}){const o=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(o))return;const r=o.cell,a=r.getSize(),l=r.getPosition(),c=new I(n-this.offset.x,i-this.offset.y,a.width,a.height),h=r.getAngle(),u=c.getCenter(),d=c.bbox(h),f=d.getTopLeft(),p=d.getBottomRight(),m=this.options.tolerance||0;let b,y,C,A,x,v,B=0,E=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(r,M))return!1;const k=M.getBBox().bbox(M.getAngle()),T=k.getCenter(),P=k.getTopLeft(),R=k.getBottomRight();return b==null&&(Math.abs(T.x-u.x)<m?(b=T.x,B=.5):Math.abs(P.x-f.x)<m?(b=P.x,B=0):Math.abs(P.x-p.x)<m?(b=P.x,B=1):Math.abs(R.x-p.x)<m?(b=R.x,B=1):Math.abs(R.x-f.x)<m&&(b=R.x),b!=null&&(y=Math.min(d.y,k.y),C=Math.max(p.y,R.y)-y)),A==null&&(Math.abs(T.y-u.y)<m?(A=T.y,E=.5):Math.abs(P.y-f.y)<m?A=P.y:Math.abs(P.y-p.y)<m?(A=P.y,E=1):Math.abs(R.y-p.y)<m?(A=R.y,E=1):Math.abs(R.y-f.y)<m&&(A=R.y),A!=null&&(x=Math.min(d.x,k.x),v=Math.max(p.x,R.x)-x)),b!=null&&A!=null}),this.hide(),A!=null||b!=null){A!=null&&(d.y=A-E*d.height),b!=null&&(d.x=b-B*d.width);const M=d.getCenter(),k=M.x-c.width/2,T=M.y-c.height/2,P=k-l.x,R=T-l.y;(P!==0||R!==0)&&(r.translate(P,R,{snapped:!0,restrict:this.getRestrictArea(o)}),v&&(v+=P),C&&(C+=R)),this.update({verticalLeft:b,verticalTop:y,verticalHeight:C,horizontalTop:A,horizontalLeft:x,horizontalWidth:v})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||!this.filter(e)}filter(t){const e=this.options.filter;return Array.isArray(e)?e.some(n=>typeof n=="string"?t.shape===n:t.id===n.id):typeof e=="function"?D(e,this.graph,t):!0}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new w(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new w(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new w(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new w(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e=typeof t=="number"?t:t!==!1?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}H([_()],cd.prototype,"dispose",null);const XA=`.x6-widget-snapline {
|
|
668
|
+
`,Zt={base:"widget-stencil",title:"widget-stencil-title",search:"widget-stencil-search",searchText:"widget-stencil-search-text",content:"widget-stencil-content",group:"widget-stencil-group",groupTitle:"widget-stencil-group-title",groupContent:"widget-stencil-group-content"},Nr="__default__",ux=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(i,t){const e={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};cx(i,Object.assign(Object.assign(Object.assign({},e),this.options.layoutOptions),t?t.layoutOptions:{}))}},ed);class dx extends Jt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(t={}){super(),this.name="stencil",Be(this.name,hx),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},ux),t),this.init()}init(){this.dnd=new Pr(this.options),this.onSearch=Wi(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n)}),this}unload(t,e){return Array.isArray(t)?this.loadGroup(t,e,!0):this.options.groups&&Object.keys(this.options.groups).forEach(n=>{t[n]&&this.loadGroup(t[n],n,!0)}),this}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),L(e,"collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),at(e,"collapsed"))}return this}isGroupCollapsable(t){const e=this.groups[t];return ue(e,"collapsable")}isGroupCollapsed(t){const e=this.groups[t];return e&&ue(e,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(t=>{this.collapseGroup(t)}),this}expandGroups(){return Object.keys(this.groups).forEach(t=>{this.expandGroup(t)}),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}addGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups?this.options.groups.push(...e):this.options.groups=e,e.forEach(n=>{this.initGroup(n)})}removeGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups&&(this.options.groups=this.options.groups.filter(n=>!e.includes(n.name)),e.forEach(n=>{const s=this.graphs[n];this.unregisterGraphEvents(s),s.dispose(),delete this.graphs[n];const o=this.groups[n];_t(o),delete this.groups[n]}))}initContainer(){this.container=document.createElement("div"),L(this.container,this.prefixClassName(Zt.base)),W(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),L(this.content,this.prefixClassName(Zt.content)),Wt(this.content,this.container)}buildGraphConfig(t){const e=this.options.stencilGraphOptions||{},n=t==null?void 0:t.graphOptions,s=Object.assign(Object.assign({},e),n);s.panning==null&&(s.panning=!1);const o=t&&t.graphWidth||this.options.stencilGraphWidth,r=t&&t.graphHeight||this.options.stencilGraphHeight,a=s.model||new Gt;return{mergedGraphOptions:s,width:o,height:r,model:a}}createStencilGraph(t,e,n,s){const o=new B(Object.assign(Object.assign({},t),{container:document.createElement("div"),model:s,width:e,height:n,interacting:!1,preventDefaultBlankAction:!1}));return this.registerGraphEvents(o),o}initSearch(){this.options.search&&(L(this.container,"searchable"),Ot(this.container,this.renderSearch()))}initGroup(t){const e=document.createElement("div");L(e,this.prefixClassName(Zt.group)),W(e,"data-name",t.name),(t.collapsable==null&&this.options.collapsable||t.collapsable!==!1)&&L(e,"collapsable"),re(e,"collapsed",t.collapsed===!0);const n=document.createElement("h3");L(n,this.prefixClassName(Zt.groupTitle)),n.innerHTML=t.title||t.name;const s=document.createElement("div");L(s,this.prefixClassName(Zt.groupContent));const{mergedGraphOptions:o,width:r,height:a,model:l}=this.buildGraphConfig(t),c=this.createStencilGraph(o,r,a,l);Ot(s,c.container),Ot(e,[n,s]),Wt(e,this.content),this.groups[t.name]=e,this.graphs[t.name]=c}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(t=>{this.initGroup(t)});else{const{mergedGraphOptions:t,width:e,height:n,model:s}=this.buildGraphConfig(),o=this.createStencilGraph(t,e,n,s);Ot(this.content,o.container),this.graphs[Nr]=o}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(t=>t.collapsable!==!1),this.options.collapsable?(L(this.container,"collapsable"),this.options.groups&&this.options.groups.every(e=>e.collapsed||e.collapsable===!1)?L(this.container,"collapsed"):at(this.container,"collapsed")):at(this.container,"collapsable")}setTitle(){const t=document.createElement("div");L(t,this.prefixClassName(Zt.title)),t.innerHTML=this.options.title,Wt(t,this.container)}renderSearch(){const t=document.createElement("div");L(t,this.prefixClassName(Zt.search));const e=document.createElement("input");return W(e,{type:"search",placeholder:this.options.placeholder||"Search"}),L(e,this.prefixClassName(Zt.searchText)),Ot(t,e),t}startListening(){const t=this.prefixClassName(Zt.title),e=this.prefixClassName(Zt.searchText),n=this.prefixClassName(Zt.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${n}`]:"onGroupTitleClick",[`touchstart .${n}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(t){t.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(t){t.off("cell:mousedown",this.onDragStart,this)}loadGroup(t,e,n){const s=this.getModel(e);if(s){const l=t.map(c=>Bt.isNode(c)?c:Bt.create(c));n===!0?s.removeCells(l):s.resetCells(l)}const o=this.getGroup(e);let r=this.options.stencilGraphHeight;o&&o.graphHeight!=null&&(r=o.graphHeight);const a=o&&o.layout||this.options.layout;if(a&&s&&F(a,this,s,o),!r){const l=this.getGraph(e);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:o&&o.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e,node:n}=t,s=this.getGroupByNode(n);if(s&&s.nodeMovable===!1)return;const o=this.getGraph(s?s.name:void 0),r=o&&typeof o.isPannable=="function"?o.isPannable():!1;r&&o.disablePanning();const a=()=>{r&&o.enablePanning(),this.undelegateDocumentEvents()};this.delegateDocumentEvents({mouseup:a,touchend:a,touchcancel:a}),this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce((s,o)=>{const r=this.graphs[o],a=o===Nr?null:o,l=r.model.getNodes().filter(d=>{let f=!1;typeof e=="function"?f=F(e,this,d,t,a,this):typeof e=="boolean"?f=e:f=this.isCellMatched(d,t,e,t.toLowerCase()!==t);const m=r.renderer.findViewByCell(d);return m&&re(m.container,"unmatched",!f),f}),c=l.length>0,h=this.options,u=new Gt;return u.resetCells(l),h.layout&&F(h.layout,this,u,this.getGroup(o)),this.groups[o]&&re(this.groups[o],"unmatched",!c),r.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),s||c},!1);re(this.container,"not-found",!n)}isCellMatched(t,e,n,s){return e&&n?Object.keys(n).some(o=>{if(o==="*"||t.shape===o){const r=n[o];return typeof r=="boolean"?r:(Array.isArray(r)?r:[r]).some(l=>{let c=t.getPropByPath(l);return c!=null?(c=`${c}`,s||(c=c.toLowerCase()),c.indexOf(e)>=0):!1})}return!1}):!0}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){L(this.container,"is-focused")}onSearchFocusOut(){at(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(re(this.container,"collapsed"),ue(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=t.target.closest(`.${this.prefixClassName(Zt.group)}`);e&&this.toggleGroup(W(e,"data-name")||"");const n=Object.keys(this.groups).every(s=>{const o=this.getGroup(s),r=this.groups[s];return o&&o.collapsable===!1||ue(r,"collapsed")});re(this.container,"collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||Nr]}getGroup(t){const e=this.options.groups;return t!=null&&e&&e.length?e.find(n=>n.name===t):null}getGroupByNode(t){const e=this.options.groups;return e?e.find(n=>{const s=this.getModel(n.name);return s?s.has(t.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];this.unregisterGraphEvents(e),e.dispose()}),Object.keys(this.groups).forEach(t=>{const e=this.groups[t];_t(e)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),ke(this.name)}}X([$()],dx.prototype,"dispose",null);class Cd extends Jt{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(t){super();const{graph:e}=t,n=_(t,["graph"]);this.graph=e,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t}render(){const t=this.containerWrapper=new K("svg"),e=this.horizontal=new K("line"),n=this.vertical=new K("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:t,data:e}){t==="resize"&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const s=t.getDelegatedView();if(s&&this.isNodeMovable(s)){const o=t.cell.getPosition();this.offset={x:e-o.x,y:n-o.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}getRestrictArea(t){const e=this.graph.options.translating.restrict,n=typeof e=="function"?F(e,this.graph,t):e;return typeof n=="number"?this.graph.transform.getGraphArea().inflate(n):n===!0?this.graph.transform.getGraphArea():n||null}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const s=t.getBBox(),o=s.bbox(t.getAngle()),r=o.getTopLeft(),a=o.getBottomRight(),l=Qt(t.getAngle()),c=this.options.tolerance||0;let h,u,d,f,m,p;const b={vertical:0,horizontal:0},y=e.direction,C=e.trueDirection,w=e.relativeDirection;C.indexOf("right")!==-1?b.vertical=a.x:b.vertical=r.x,C.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=r.y,this.model.getNodes().some(R=>{if(this.isIgnored(t,R))return!1;const J=R.getBBox().bbox(R.getAngle()),D=J.getTopLeft(),N=J.getBottomRight(),G={vertical:[D.x,N.x],horizontal:[D.y,N.y]},ot={};return Object.keys(G).forEach(yt=>{const gt=yt,lt=G[gt].map(V=>({position:V,distance:Math.abs(V-b[gt])})).filter(V=>V.distance<=c);ot[gt]=yo(lt,V=>V.distance)}),h==null&&ot.vertical.length>0&&(h=ot.vertical[0].position,u=Math.min(o.y,J.y),d=Math.max(a.y,N.y)-u),f==null&&ot.horizontal.length>0&&(f=ot.horizontal[0].position,m=Math.min(o.x,J.x),p=Math.max(a.x,N.x)-m),h!=null&&f!=null}),this.hide();let x=0,E=0;(f!=null||h!=null)&&(h!=null&&(x=C.indexOf("right")!==-1?h-a.x:r.x-h),f!=null&&(E=C.indexOf("bottom")!==-1?f-a.y:r.y-f));let S=0,v=0;if(l%90===0)l===90||l===270?(S=E,v=x):(S=x,v=E);else{const R=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;f!=null&&h!=null&&(x<E?(E=0,f=void 0):(x=0,h=void 0));const J=Rt(l%90);x&&(S=R===3?x/Math.cos(J):x/Math.sin(J)),E&&(v=R===3?E/Math.cos(J):E/Math.sin(J));const D=R===1||R===3;switch(w){case"top":case"bottom":v=E?E/(D?Math.cos(J):Math.sin(J)):x/(D?Math.sin(J):Math.cos(J));break;case"left":case"right":S=x?x/(D?Math.cos(J):Math.sin(J)):E/(D?Math.sin(J):Math.cos(J));break}}switch(w){case"top":case"bottom":S=0;break;case"left":case"right":v=0;break}const M=this.graph.getGridSize();let k=Math.max(s.width+S,M),T=Math.max(s.height+v,M);e.minWidth&&e.minWidth>M&&(k=Math.max(k,e.minWidth)),e.minHeight&&e.minHeight>M&&(T=Math.max(T,e.minHeight)),e.maxWidth&&(k=Math.min(k,e.maxWidth)),e.maxHeight&&(T=Math.min(T,e.maxHeight)),e.preserveAspectRatio&&(v<S?T=k*(s.height/s.width):k=T*(s.width/s.height)),(k!==s.width||T!==s.height)&&(t.resize(k,T,{direction:y,relativeDirection:w,trueDirection:C,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),d&&(d+=T-s.height),p&&(p+=k-s.width));const P=t.getBBox().bbox(l);h&&Math.abs(P.x-h)>1&&Math.abs(P.width+P.x-h)>1&&(h=void 0),f&&Math.abs(P.y-f)>1&&Math.abs(P.height+P.y-f)>1&&(f=void 0),this.update({verticalLeft:h,verticalTop:u,verticalHeight:d,horizontalTop:f,horizontalLeft:m,horizontalWidth:p})}}}snapOnMoving({view:t,e,x:n,y:s}){const o=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(o))return;const r=o.cell,a=r.getSize(),l=r.getPosition(),c=new I(n-this.offset.x,s-this.offset.y,a.width,a.height),h=r.getAngle(),u=c.getCenter(),d=c.bbox(h),f=d.getTopLeft(),m=d.getBottomRight(),p=this.options.tolerance||0;let b,y,C,w,x,E,S=0,v=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(r,M))return!1;const k=M.getBBox().bbox(M.getAngle()),T=k.getCenter(),P=k.getTopLeft(),R=k.getBottomRight();return b==null&&(Math.abs(T.x-u.x)<p?(b=T.x,S=.5):Math.abs(P.x-f.x)<p?(b=P.x,S=0):Math.abs(P.x-m.x)<p?(b=P.x,S=1):Math.abs(R.x-m.x)<p?(b=R.x,S=1):Math.abs(R.x-f.x)<p&&(b=R.x),b!=null&&(y=Math.min(d.y,k.y),C=Math.max(m.y,R.y)-y)),w==null&&(Math.abs(T.y-u.y)<p?(w=T.y,v=.5):Math.abs(P.y-f.y)<p?w=P.y:Math.abs(P.y-m.y)<p?(w=P.y,v=1):Math.abs(R.y-m.y)<p?(w=R.y,v=1):Math.abs(R.y-f.y)<p&&(w=R.y),w!=null&&(x=Math.min(d.x,k.x),E=Math.max(m.x,R.x)-x)),b!=null&&w!=null}),this.hide(),w!=null||b!=null){w!=null&&(d.y=w-v*d.height),b!=null&&(d.x=b-S*d.width);const M=d.getCenter(),k=M.x-c.width/2,T=M.y-c.height/2,P=k-l.x,R=T-l.y;(P!==0||R!==0)&&(r.translate(P,R,{snapped:!0,restrict:this.getRestrictArea(o)}),E&&(E+=P),C&&(C+=R)),this.update({verticalLeft:b,verticalTop:y,verticalHeight:C,horizontalTop:w,horizontalLeft:x,horizontalWidth:E})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||!this.filter(e)}filter(t){const e=this.options.filter;return Array.isArray(e)?e.some(n=>typeof n=="string"?t.shape===n:t.id===n.id):typeof e=="function"?F(e,this.graph,t):!0}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new A(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new A(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new A(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new A(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e=typeof t=="number"?t:t!==!1?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}X([$()],Cd.prototype,"dispose",null);const gx=`.x6-widget-snapline {
|
|
669
669
|
position: absolute;
|
|
670
670
|
top: 0;
|
|
671
671
|
right: 0;
|
|
@@ -678,7 +678,7 @@
|
|
|
678
678
|
stroke: #2ecc71;
|
|
679
679
|
stroke-width: 1px;
|
|
680
680
|
}
|
|
681
|
-
`;
|
|
681
|
+
`;B.prototype.isSnaplineEnabled=function(){const i=this.getPlugin("snapline");return i?i.isEnabled():!1},B.prototype.enableSnapline=function(){const i=this.getPlugin("snapline");return i&&i.enable(),this},B.prototype.disableSnapline=function(){const i=this.getPlugin("snapline");return i&&i.disable(),this},B.prototype.toggleSnapline=function(){const i=this.getPlugin("snapline");return i&&i.toggleEnabled(),this},B.prototype.hideSnapline=function(){const i=this.getPlugin("snapline");return i&&i.hide(),this},B.prototype.setSnaplineFilter=function(i){const t=this.getPlugin("snapline");return t&&t.setFilter(i),this},B.prototype.isSnaplineOnResizingEnabled=function(){const i=this.getPlugin("snapline");return i?i.isOnResizingEnabled():!1},B.prototype.enableSnaplineOnResizing=function(){const i=this.getPlugin("snapline");return i&&i.enableOnResizing(),this},B.prototype.disableSnaplineOnResizing=function(){const i=this.getPlugin("snapline");return i&&i.disableOnResizing(),this},B.prototype.toggleSnaplineOnResizing=function(i){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(i),this},B.prototype.isSharpSnapline=function(){const i=this.getPlugin("snapline");return i?i.isSharp():!1},B.prototype.enableSharpSnapline=function(){const i=this.getPlugin("snapline");return i&&i.enableSharp(),this},B.prototype.disableSharpSnapline=function(){const i=this.getPlugin("snapline");return i&&i.disableSharp(),this},B.prototype.toggleSharpSnapline=function(i){const t=this.getPlugin("snapline");return t&&t.toggleSharp(i),this},B.prototype.getSnaplineTolerance=function(){const i=this.getPlugin("snapline");if(i)return i.getTolerance()},B.prototype.setSnaplineTolerance=function(i){const t=this.getPlugin("snapline");return t&&t.setTolerance(i),this};class Ad extends Cn{constructor(t={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},t),Be(this.name,gx)}init(t){this.snaplineImpl=new Cd(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(t){if(t!=null)t!==this.isEnabled()&&(t?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(t){return this.snaplineImpl.setFilter(t),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(t){return t!=null?t!==this.isOnResizingEnabled()&&(t?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(t){return t!=null?t!==this.isSharp()&&(t?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(t){return this.snaplineImpl.options.tolerance=t,this}captureCursorOffset(t){this.snaplineImpl.captureCursorOffset(t)}snapOnMoving(t){this.snaplineImpl.snapOnMoving(t)}dispose(){this.snaplineImpl.dispose(),ke(this.name)}}X([$()],Ad.prototype,"dispose",null);const fx=`.x6-widget-transform {
|
|
682
682
|
position: absolute;
|
|
683
683
|
box-sizing: content-box !important;
|
|
684
684
|
margin: -5px 0 0 -5px;
|
|
@@ -804,4 +804,36 @@
|
|
|
804
804
|
display: block;
|
|
805
805
|
background-color: #808080;
|
|
806
806
|
}
|
|
807
|
-
`,ud="has-widget-transform",Mn=["nw","n","ne","e","se","s","sw","w"],We=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],ZA={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0};class dd extends Ut{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(t,e,n){super(),this.node=e,this.graph=n,this.options=Object.assign(Object.assign({},ZA),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const t=document.createElement("div");j(t,"draggable","false");const e=t.cloneNode(!0);O(e,this.rotateClassName);const n=We.map(i=>{const o=t.cloneNode(!0);return O(o,this.resizeClassName),j(o,"data-position",i),o});this.empty(),Mt(this.container,[...n,e])}render(){return this.renderHandles(),this.view&&this.view.addClass(ud),O(this.container,this.containerClassName),se(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),se(this.container,"no-resize",!this.options.resizable),se(this.container,"no-rotate",!this.options.rotatable),this.options.className&&O(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=Pt(this.node.getAngle()),i=n!==0?`rotate(${n}deg)`:"";return $(this.container,{transform:i,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(ud),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Pt(this.node.getAngle()),e=Math.floor(t*(Mn.length/360));if(e!==this.prevShift){const n=Mn.slice(e).concat(Mn.slice(0,e)),i=r=>`${this.containerClassName}-cursor-${r}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((r,a)=>{st(r,Mn.map(l=>i(l)).join(" ")),O(r,i(n[a]))}),this.prevShift=e}}getTrueDirection(t){const e=Pt(this.node.getAngle());let n=We.indexOf(t);return n+=Math.floor(e*(We.length/360)),n%=We.length,We[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=j(t.target,"data-position");this.prepareResizing(t,e),this.startAction(t)}prepareResizing(t,e){const n=this.getTrueDirection(e);let i=0,o=0;e.split("-").forEach(c=>{i={left:-1,right:1}[c]||i,o={top:-1,bottom:1}[c]||o});const r=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[r],l=Pt(this.node.getAngle());this.setEventData(t,{selector:a,direction:r,trueDirection:n,relativeDirection:e,angle:l,resizeX:i,resizeY:o,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.node.getBBox().getCenter(),n=this.normalizeEvent(t),i=this.graph.snapToGrid(n.clientX,n.clientY);this.setEventData(t,{center:e,action:"rotating",angle:Pt(this.node.getAngle()),start:w.create(i).theta(e)}),this.startAction(t)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const i=this.normalizeEvent(t);let o=i.clientX,r=i.clientY;const a=this.graph.getPlugin("scroller"),l=this.options.restrictedResizing;if(l===!0||typeof l=="number"){const f=l===!0?0:l,p=a?Math.max(f,8):f,m=this.graph.container.getBoundingClientRect();o=Ke(o,m.left+p,m.right-p),r=Ke(r,m.top+p,m.bottom-p)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,r);const c=this.graph.snapToGrid(o,r),h=this.graph.getGridSize(),u=this.node,d=this.options;if(n.action==="resizing"){n=n,n.resized||(e&&(e.addClass("node-resizing"),this.notify("node:resize",t,e)),n.resized=!0);const f=u.getBBox(),p=w.create(c).rotate(n.angle,f.getCenter()).diff(f[n.selector]);let m=n.resizeX?p.x*n.resizeX:f.width,b=n.resizeY?p.y*n.resizeY:f.height;const y=m,C=b;if(m=ie(m,h),b=ie(b,h),m=Math.max(m,d.minWidth||h),b=Math.max(b,d.minHeight||h),m=Math.min(m,d.maxWidth||1/0),b=Math.min(b,d.maxHeight||1/0),d.preserveAspectRatio){const x=f.width*b/f.height,v=f.height*m/f.width;m<x?b=v:m=x}const A=n.relativeDirection;if(d.allowReverse&&(y<=-m||C<=-b)){let x;A==="left"?y<=-m&&(x="right"):A==="right"?y<=-m&&(x="left"):A==="top"?C<=-b&&(x="bottom"):A==="bottom"?C<=-b&&(x="top"):A==="top-left"?y<=-m&&C<=-b?x="bottom-right":y<=-m?x="top-right":C<=-b&&(x="bottom-left"):A==="top-right"?y<=-m&&C<=-b?x="bottom-left":y<=-m?x="top-left":C<=-b&&(x="bottom-right"):A==="bottom-left"?y<=-m&&C<=-b?x="top-right":y<=-m?x="bottom-right":C<=-b&&(x="top-left"):A==="bottom-right"&&(y<=-m&&C<=-b?x="top-left":y<=-m?x="bottom-left":C<=-b&&(x="top-right"));const v=x;this.stopHandle();const B=this.container.querySelector(`.${this.resizeClassName}[data-position="${v}"]`);this.startHandle(B),this.prepareResizing(t,v),this.onMouseMove(t)}if(f.width!==m||f.height!==b){const x={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:d.preserveAspectRatio===!0};u.resize(m,b,x),this.notify("node:resizing",t,e)}}else if(n.action==="rotating"){n=n,n.rotated||(e&&(e.addClass("node-rotating"),this.notify("node:rotate",t,e)),n.rotated=!0);const f=u.getAngle(),p=n.start-w.create(c).theta(n.center);let m=n.angle+p;d.rotateGrid&&(m=ie(m,d.rotateGrid)),m=Pt(m),f!==m&&(u.rotate(m,{absolute:!0}),this.notify("node:rotating",t,e))}}}onMouseUp(t){const e=this.getEventData(t);e.action&&(this.stopAction(t),this.model.stopBatch(e.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(t){if(this.handle=t||null,O(this.container,`${this.containerClassName}-active`),t){O(t,`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const n=Mn[We.indexOf(e)];O(this.container,`${this.containerClassName}-cursor-${n}`)}}}stopHandle(){if(st(this.container,`${this.containerClassName}-active`),this.handle){st(this.handle,`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=Mn[We.indexOf(t)];st(this.container,`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(au,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass(`node-${n.action}`),n.action==="resizing"&&n.resized?this.notify("node:resized",t,e):n.action==="rotating"&&n.rotated&&this.notify("node:rotated",t,e))}notify(t,e,n,i={}){if(n){const o=n.graph,r=o.view.normalizeEvent(e),a=o.snapToGrid(r.clientX,r.clientY);this.trigger(t,Object.assign({e:r,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},i))}}dispose(){this.stopListening(),this.remove(),this.off()}}H([_()],dd.prototype,"dispose",null),S.prototype.createTransformWidget=function(s){const t=this.getPlugin("transform");return t&&t.createWidget(s),this},S.prototype.clearTransformWidgets=function(){const s=this.getPlugin("transform");return s&&s.clearWidgets(),this};class gd extends Nt{constructor(t={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=t,Me(this.name,$A)}init(t){this.graph=t,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(t){this.clearWidgets();const e=this.createTransform(t);e&&(this.widgets.set(t,e),e.on("*",(n,i)=>{this.trigger(n,i),this.graph.trigger(n,i)}))}onNodeClick({node:t}){this.createWidget(t)}onBlankMouseDown(){this.clearWidgets()}createTransform(t){const e=this.getTransformOptions(t);return e.resizable||e.rotatable?new dd(e,t,this.graph):null}parseOptionGroup(t,e,n){const i={};return Object.keys(n||{}).forEach(o=>{const r=n[o];i[o]=typeof r=="function"?r.call(t,e):r}),i}getTransformOptions(t){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const e=this.parseOptionGroup(this.graph,t,this.options.resizing),n=this.parseOptionGroup(this.graph,t,this.options.rotating);return{resizable:!!e.enabled,minWidth:e.minWidth||0,maxWidth:e.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:e.minHeight||0,maxHeight:e.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof e.orthogonal=="boolean"?e.orthogonal:!0,restrictedResizing:!!e.restrict,autoScrollOnResizing:typeof e.autoScroll=="boolean"?e.autoScroll:!0,preserveAspectRatio:!!e.preserveAspectRatio,allowReverse:typeof e.allowReverse=="boolean"?e.allowReverse:!0,rotatable:!!n.enabled,rotateGrid:n.grid||15}}clearWidgets(){this.widgets.forEach((t,e)=>{this.graph.getCellById(e.id)&&t.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Be(this.name)}}H([_()],gd.prototype,"dispose",null);function fd(s){const t=Tt.getForeignObjectMarkup();return s?[{tagName:s,selector:"body"},t]:[t]}S.registerNode("vue-shape",{view:"vue-shape-view",markup:fd(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(s){if(s.markup==null){const t=s.primer;if(t){s.markup=fd(t);let e={};switch(t){case"circle":e={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":e={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}s.attrs=ct({},{body:Object.assign({refWidth:null,refHeight:null},e)},s.attrs||{})}}return s}},!0);var tx=function(s,t){var e={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&t.indexOf(n)<0&&(e[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(s);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(s,n[i])&&(e[n[i]]=s[n[i]]);return e};const pd={};function ex(s){const{shape:t,component:e,inherit:n}=s,i=tx(s,["shape","component","inherit"]);if(!t)throw new Error("should specify shape in config");pd[t]={component:e},S.registerNode(t,Object.assign({inherit:n||"vue-shape"},i),!0)}let Mi=!1;const Ns=g.reactive({});function nx(s,t,e,n,i){Mi&&(Ns[s]=g.markRaw(g.defineComponent({render:()=>g.h(g.Teleport,{to:e},[g.h(t,{node:n,graph:i})]),provide:()=>({getNode:()=>n,getGraph:()=>i})})))}function ix(s){Mi&&delete Ns[s]}function md(){return Mi}let Rs=null;function Mr(){return Rs&&Mi?null:(Mi=!0,Rs=g.defineComponent({setup(){return g.onBeforeUnmount(()=>{Rs=null}),()=>g.h(g.Fragment,{},Object.keys(Ns).map(s=>g.h(Ns[s])))}}),Rs)}class qe extends Wt{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,qe.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,n=this.graph;if(t){const{component:i}=pd[e.shape];i&&(md()?nx(this.targetId(),i,t,e,n):(this.vm=g.createApp({render(){return g.h(i,{node:e,graph:n})},provide(){return{getNode:()=>e,getGraph:()=>n}}}),this.vm.mount(t)))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,e,n){const i=t.target;if(i.tagName.toLowerCase()==="input"){const r=i.getAttribute("type");if(r==null||["text","password","number","email","search","tel","url"].includes(r))return}super.onMouseDown(t,e,n)}unmount(){return md()&&ix(this.targetId()),this.unmountVueComponent(),super.unmount(),this}}qe.action="vue",qe.config({bootstrap:[qe.action],actions:{component:qe.action}}),Wt.registry.register("vue-shape-view",qe,!0);const kt=(s,t)=>{const e=s.__vccOpts||s;for(const[n,i]of t)e[n]=i;return e},sx=kt({__name:"vueNode",setup(s){g.useCssVars(l=>({d8dfc212:n.value.color,v6be3529f:n.value.opacity,v324d6579:n.value.borderStyle,v6de6f73f:n.value.borderWidth+"px",v3169772b:n.value.borderColor,v28e858fa:n.value.borderRadius+"px",v2fb97d69:n.value.backgroundColor}));let e=g.inject("getNode")();const n=g.ref(e.getData()),i=g.ref(128),o=g.ref(128),r=({current:l})=>{i.value=l.width,o.value=l.height},a=({current:l})=>{n.value={...n.value,...l}};return g.provide("x6NodeData",n),g.provide("width",i),g.provide("height",o),g.onMounted(()=>{i.value=e.size().width,o.value=e.size().height,e.on("change:data",a),e.on("change:size",r)}),g.onBeforeUnmount(()=>{e.off("change:data",a),e.off("change:size",r)}),(l,c)=>(g.openBlock(),g.createElementBlock("div",{style:g.normalizeStyle({width:i.value+"px",height:o.value+"px",backgroundImage:n.value.backgroundImage&&n.value.backgroundImage!=="none"?`url(${n.value.backgroundImage})`:"none"}),class:"vueNode"},[g.renderSlot(l.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-c87e42ba"]]),ox={class:"svgNode"},rx=["xlink:href"],ax=kt({__name:"svgNode",setup(s){g.inject("getNode");const t=g.inject("width"),e=g.inject("height"),n=g.inject("x6NodeData"),i=g.computed(()=>{var o;return{fontSize:`${Math.min(t.value,e.value)}px`,color:((o=n.value)==null?void 0:o.color)||"#ffffff"}});return g.onMounted(()=>{}),g.onBeforeUnmount(()=>{}),(o,r)=>(g.openBlock(),g.createElementBlock("div",ox,[(g.openBlock(),g.createElementBlock("svg",{class:"svg-icon","aria-hidden":"true",style:g.normalizeStyle(i.value)},[g.createElementVNode("use",{"xlink:href":"#"+g.unref(n).icon},null,8,rx)],4))]))}},[["__scopeId","data-v-88b0fd56"]]),lx=["title"],cx=kt({__name:"textNode",setup(s){const t=g.inject("x6NodeData"),e=g.computed(()=>{const i=t.value||{};return{justifyContent:i.justifyContent||"center",alignItems:i.alignItems||"center",padding:i.padding||"0",overflow:i.overflow||"hidden",backgroundColor:"transparent"}}),n=g.computed(()=>{const i=t.value||{},o=i.textOverflow==="ellipsis",r=i.whiteSpace||(o?"nowrap":"pre-wrap"),a=!i.lineHeight&&i.lineHeight!==0?"1.4":typeof i.lineHeight=="number"?i.lineHeight<=10?`${i.lineHeight}`:`${i.lineHeight}px`:i.lineHeight;return{color:i.color||"#ffffff",fontWeight:i.fontWeight||400,fontSize:`${i.fontSize||16}px`,letterSpacing:`${i.letterSpacing||0}px`,fontFamily:i.fontFamily||"inherit",fontStyle:i.fontStyle||"normal",textDecoration:i.textDecoration||"none",textAlign:i.textAlign||"center",lineHeight:a,whiteSpace:r,wordBreak:i.wordBreak||"break-word",textOverflow:i.textOverflow||"clip",overflow:"hidden",display:i.display||"block"}});return(i,o)=>(g.openBlock(),g.createElementBlock("div",{class:"textNode",style:g.normalizeStyle(e.value),title:g.unref(t).text},[g.createElementVNode("span",{class:"textContent",style:g.normalizeStyle(n.value)},g.toDisplayString(g.unref(t).text),5)],12,lx))}},[["__scopeId","data-v-98979c16"]]),hx={name:"",borderStyle:"none",borderRadius:0,borderWidth:0,borderColor:"#5F95FF",opacity:1,backgroundImage:"none",backgroundColor:"transparent",color:"#ffffff",realData:[],bindData:[],status:[]},Br={"svg-node":ax,"text-node":cx},kr=()=>{Object.keys(Br).forEach(s=>{ex({shape:s,width:50,height:50,data:{...hx},component:{render(){return g.h(sx,null,{default:()=>g.h(Br[s])})}}})})},bd={Blank:"blank"},Bn=ge.defineStore("property",{state:()=>({targetType:bd.Blank,cellId:null,tabs:["画布"],activeTab:0}),getters:{},actions:{setTarget(s,t){this.targetType=s,s===bd.Blank?this.tabs=["画布"]:this.tabs=["外观","数据","动画","状态","交互"],this.activeTab=0,this.cellId=t}}}),Ir={backgroundColor:"#6b6b6b26",backgroundImage:null},Dt=ge.defineStore("editor-graph",{state:()=>({el:null,graph:null,dnd:null,style:{...Ir,width:1920,height:1080},name:"",id:"",zoom:100}),getters:{hasGraph:s=>!!s.graph},actions:{init(){if(this.el===null)return;this.graph&&this.graph.dispose(),this.graph=new S({container:this.el,autoResize:!0,mousewheel:{enabled:!0,factor:.1},panning:!1,scaling:{min:.5,max:2},background:{color:"#000000"},grid:{size:5,visible:!0,type:"mesh",args:{color:"rgba(100, 100, 100, 0.6)",thickness:1}},translating:{restrict:!0},connecting:{router:"orth",connector:{name:"normal"},args:{padding:0,direction:"H"},anchor:"center",connectionPoint:"anchor",allowBlank:!0,allowLoop:!1,allowMulti:!1,snap:{radius:20},validateConnection({targetMagnet:t}){return!!t}},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{fill:"#5F95FF",stroke:"#5F95FF"}}}}}),this.graph.use(new hd({enabled:!0}));const s=new ad({pageWidth:this.style.width,pageHeight:this.style.height,enabled:!0,pannable:!0,autoResize:!1});this.graph.use(s),this.dnd=new vr({target:this.graph,validateNode(){return!0}}),this.graph.use(new gd({resizing:!0,rotating:!0})),this.graph.use(new Au({enabled:!0})),this.graph.use(new $u({enabled:!0,global:!0})).use(new ed({rubberband:!0,showNodeSelectionBox:!0,showEdgeSelectionBox:!1,modifiers:["meta","shift","ctrl"]})).use(new Hu),kr(),this.initEvent()},loadMenu({name:s,id:t,value:e,style:n}){if(!this.graph)return;this.name=s,this.id=t,this.graph.fromJSON(e||{}),n?this.style={...this.style,...Ir,...n}:this.style={...this.style,...Ir};const i=Math.min(1280/this.style.width,840/this.style.height);console.log(i,this.style.width,this.style.height),this.graph.zoomTo(i),setTimeout(()=>{this.graph.center(),console.log(this.graph.getScrollbarPosition()),Bn().setTarget("blank",null)},100)},setZoom(s){this.zoom=Number(s),this.graph.zoomTo(s)},updateSize(s,t,e){this.style.width=s,this.style.height=t,this.init(),setTimeout(()=>{e&&e()},100)},syncDataToAttrs(s){if(!s||Object.keys(Br).includes(s.shape))return;const t=s.getData?s.getData()||{}:{},e={dashed:"6 4",dotted:"2 2",solid:null,none:null},n={};t.backgroundColor!==void 0&&(n.fill=t.backgroundColor),t.borderColor!==void 0&&(n.stroke=t.borderColor),t.borderWidth!==void 0&&(n.strokeWidth=t.borderWidth),t.borderStyle!==void 0&&e.hasOwnProperty(t.borderStyle)&&(t.borderStyle==="none"?(n.strokeDasharray=null,n.strokeWidth=0):n.strokeDasharray=e[t.borderStyle]),t.borderRadius!==void 0&&(n.rx=n.ry=t.borderRadius),t.opacity!==void 0&&(n.opacity=t.opacity);const i={};Object.keys(n).length&&(i.body=n),Object.keys(i).length&&s.setAttrs(i)},groupSelectedNodes(){if(!this.graph)return null;const s=this.graph.getSelectedCells(),t=s.filter(a=>a.isNode()&&!a.id.includes("group"));if(t.length<2)return null;const e=s.filter(a=>a.isNode()&&a.id.includes("group"));e.length>0&&this.graph.removeCells(e);const n=t.reduce((a,l)=>{const c=l.getBBox();return a.minX=Math.min(a.minX,c.x),a.minY=Math.min(a.minY,c.y),a.maxX=Math.max(a.maxX,c.x+c.width),a.maxY=Math.max(a.maxY,c.y+c.height),a},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),i=10,o=this.graph.addNode({id:`group-${Date.now()}`,shape:"rect",x:n.minX-i,y:n.minY-i,width:n.maxX-n.minX+i*2,height:n.maxY-n.minY+i*2,attrs:{body:{fill:"rgba(69, 131, 255, 0.08)",stroke:"#4583ff",strokeWidth:1,strokeDasharray:"6 4"}},data:{type:"group",name:"组合",opacity:1,borderStyle:"dashed",borderRadius:0,borderWidth:1,borderColor:"#4583ff",backgroundColor:"rgba(69, 131, 255, 0.08)"},zIndex:1e3});return t.forEach(a=>{o.addChild(a)}),this.graph.cleanSelection(),this.graph.select(o),Bn().setTarget("node",o.id),o},initEvent(){this.graph.on("node:moving",i=>{}),this.graph.on("scale",({sx:i,sy:o})=>{console.log(i,o),this.zoom=Number((i*100).toFixed(0))});const s=Bn();this.graph.on("blank:click",({e:i,x:o,y:r})=>{console.log("Blank click at:",o,r,i),s.setTarget("blank",null)}),this.graph.on("edge:click",({e:i,x:o,y:r,edge:a})=>{console.log("edge:click",o,r,a.id),s.setTarget("edge",a.id),this.graph.select([a.getSourceNode(),a.getTargetNode()])}),this.graph.on("node:click",({e:i,x:o,y:r,node:a})=>{var l;if(console.log("node:click",o,r,a.id),(l=a.id)!=null&&l.includes("line")){this.graph.clearTransformWidgets(),i.stopPropagation();return}s.setTarget("node",a.id)}),this.graph.on("node:change:data",({node:i})=>{this.syncDataToAttrs(i)}),this.graph.on("node:added",({node:i})=>{this.syncDataToAttrs(i)}),this.graph.on("edge:mouseenter",({cell:i})=>{i.addTools([{name:"vertices",args:{attrs:{fill:"#666"},modifiers:["meta","shift","ctrl"]}}])}),this.graph.on("edge:mouseleave",({cell:i})=>{i.hasTool("vertices")&&i.removeTool("vertices"),i.hasTool("source-arrowhead")&&i.removeTool("source-arrowhead"),i.hasTool("target-arrowhead")&&i.removeTool("target-arrowhead")}),this.graph.bindKey(["meta+c","ctrl+c"],()=>{const i=this.graph.getSelectedCells();if(!i.length)return!1;const r=i.filter(d=>d.isNode()&&d.id.includes("group")).flatMap(d=>d.getChildren?d.getChildren()||[]:[]),a=i.filter(d=>d.isNode()),l=i.filter(d=>d.isEdge()),c=[...a,...r],h=this.graph.getEdges().filter(d=>{const f=d.getSourceCell&&d.getSourceCell(),p=d.getTargetCell&&d.getTargetCell();return c.includes(f)||c.includes(p)}),u=[...i,...c,...l,...h].reduce((d,f)=>(d.set(f.id,f),d),new Map);return this.graph.copy([...u.values()]),!1}),this.graph.bindKey(["meta+x","ctrl+x"],()=>{const i=this.graph.getSelectedCells();return i.length&&this.graph.cut(i),!1}),this.graph.bindKey(["meta+v","ctrl+v"],()=>{if(!this.graph.isClipboardEmpty()){const i=this.graph.paste({offset:32});this.graph.cleanSelection(),this.graph.select(i)}return!1}),this.graph.bindKey(["meta+z","ctrl+z"],()=>(this.graph.canUndo()&&this.graph.undo(),!1)),this.graph.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(this.graph.canRedo()&&this.graph.redo(),!1)),this.graph.bindKey(["meta+a","ctrl+alt+a"],()=>{const i=this.graph.getNodes();i&&this.graph.select(i)}),this.graph.bindKey("backspace",()=>{const i=this.graph.getSelectedCells();i.length&&(this.graph.removeCells(i),s.setTarget("blank",null))});const t=(i=0,o=0)=>{const r=this.graph.getSelectedCells().filter(a=>a.isNode());if(r.length)return r.forEach(a=>{const{x:l,y:c}=a.getPosition();a.position(l+i,c+o)}),!1},e=5;this.graph.bindKey(["meta+up","ctrl+up"],()=>t(0,-e)),this.graph.bindKey(["meta+down","ctrl+down"],()=>t(0,e)),this.graph.bindKey(["meta+left","ctrl+left"],()=>t(-e,0)),this.graph.bindKey(["meta+right","ctrl+right"],()=>t(e,0));const n=(i,o)=>{for(let r=0,a=i.length;r<a;r+=1)i[r].style.visibility=o?"visible":"hidden"};this.graph.on("node:mouseenter",()=>{const i=this.el.querySelectorAll(".x6-port-body");n(i,!0)}),this.graph.on("node:mouseleave",()=>{const i=this.el.querySelectorAll(".x6-port-body");n(i,!1)})}}}),kn=ge.defineStore("menus",{state:()=>({menus:[],current:[],services:{}}),getters:{currentMenu:s=>{var t;return(t=s.menus.find(e=>e.id===s.current[0]))==null?void 0:t.children.find(e=>e.id===s.current[1])}},actions:{async setCurrentMenu(s,t=!1){const e=Dt();if(JSON.stringify(s)===JSON.stringify(this.current)&&t===!1)return!1;this.current=s,e.loadMenu(await this.services.getMenu(s[1]))},async loadAllMenus(s=!1){var t;this.menus=await((t=this.services)==null?void 0:t.getAllMenus()),s&&this.menus[0]&&this.menus[0].children[0]&&this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id])},async addMenu(s,t){var n;const e=await((n=this.services)==null?void 0:n.addMenu(s));this.loadAllMenus(),this.setCurrentMenu([e.parentId,e.id]),t&&t()},async saveMenu(s){const t=Dt(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:t.graph.toJSON()};await this.services.saveMenus(e),s&&s()},clearMenu(s){const t=Dt(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:{}};this.services.saveMenus(e),t.graph.clearCells(),s&&s()},async removeMenu(s){if(await this.services.removeMenu(this.current[1]),await this.loadAllMenus(),this.menus[0]&&this.menus[0].children[0])this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id]);else{const t=Dt();t.graph.clearCells(),t.name="",t.id=""}s&&s()}}}),ux={class:"dialog-footer"},dx={__name:"addMenu",emits:["close"],setup(s,{emit:t}){const e=kn(),{menus:n}=ge.storeToRefs(e),i=t,o=g.ref(!1);function r(){o.value=!1,i("close")}const a=g.ref(null),l=g.ref({parent:null,parentNameNew:"",name:""}),c=g.ref({parent:[{required:!0,message:"请选择上级目录",trigger:"change"}],parentNameNew:{required:!0,message:"请输入一级目录名称",trigger:"blur"},name:[{required:!0,message:"请输入二级目录名称",trigger:"blur"}]}),h=g.ref(!1),u=async()=>{if(a.value){h.value=!0;try{await a.value.validate((d,f)=>{d?(console.log("submit!"),e.addMenu(l.value,()=>{r()})):console.log("error submit!",f)})}catch(d){console.log("表单验证失败:",d)}finally{h.value=!1}}};return g.onMounted(()=>{o.value=!0}),(d,f)=>{const p=g.resolveComponent("el-option"),m=g.resolveComponent("el-select"),b=g.resolveComponent("el-form-item"),y=g.resolveComponent("el-input"),C=g.resolveComponent("el-form"),A=g.resolveComponent("el-button"),x=g.resolveComponent("el-dialog");return g.openBlock(),g.createBlock(x,{modelValue:o.value,"onUpdate:modelValue":f[3]||(f[3]=v=>o.value=v),title:"新增目录",width:"500"},{footer:g.withCtx(()=>[g.createElementVNode("div",ux,[g.createVNode(A,{onClick:r},{default:g.withCtx(()=>[...f[4]||(f[4]=[g.createTextVNode("取消",-1)])]),_:1}),g.createVNode(A,{type:"primary",onClick:u},{default:g.withCtx(()=>[...f[5]||(f[5]=[g.createTextVNode("确定",-1)])]),_:1})])]),default:g.withCtx(()=>[g.createVNode(C,{ref_key:"formRef",ref:a,model:l.value,"label-width":"auto",style:{padding:"10px 20px"},rules:c.value},{default:g.withCtx(()=>[g.createVNode(b,{label:"上级目录",prop:"parent"},{default:g.withCtx(()=>[g.createVNode(m,{modelValue:l.value.parent,"onUpdate:modelValue":f[0]||(f[0]=v=>l.value.parent=v),placeholder:"请选择上级目录"},{default:g.withCtx(()=>[g.createVNode(p,{value:"0",label:"根目录"}),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(g.unref(n),v=>(g.openBlock(),g.createBlock(p,{key:v.id,label:v.name,value:v.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value.parent=="0"?(g.openBlock(),g.createBlock(b,{key:0,label:"一级目录名称",prop:"parentNameNew"},{default:g.withCtx(()=>[g.createVNode(y,{modelValue:l.value.parentNameNew,"onUpdate:modelValue":f[1]||(f[1]=v=>l.value.parentNameNew=v)},null,8,["modelValue"])]),_:1})):g.createCommentVNode("",!0),g.createVNode(b,{label:"二级目录名称",prop:"name"},{default:g.withCtx(()=>[g.createVNode(y,{modelValue:l.value.name,"onUpdate:modelValue":f[2]||(f[2]=v=>l.value.name=v)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}},gx=kt({__name:"previewBox",emits:["close"],setup(s,{emit:t}){const e=Dt(),n=g.ref(null),i=Mr(),o=t;function r(){o("close")}let a=null;return g.onMounted(()=>{const{width:l,height:c}=e.style;a=new S({container:n.value,width:l,height:c,interacting:!1,selecting:!1,keyboard:!1,mousewheel:!1,panning:!1}),kr(),a.fromJSON(e.graph.toJSON()),a.drawBackground({color:e.style.backgroundColor,image:e.style.backgroundImage,size:"cover"})}),g.onBeforeUnmount(()=>{a&&a.dispose()}),(l,c)=>(g.openBlock(),g.createElementBlock("div",{class:"previewBox",onClick:r},[g.createElementVNode("div",{ref_key:"container",ref:n,class:"ems-preview"},null,512),g.createVNode(g.unref(i))]))}},[["__scopeId","data-v-513d27ee"]]),fx={class:"toolBox"},px={class:"left"},mx={style:{"line-height":"40px",width:"100px","text-align":"center"}},bx={class:"right"},yx={key:0,class:"iconfont icon-suoding1",style:{color:"#4583ff"}},Cx={key:1,class:"iconfont icon-jiesuo1"},wx=kt({__name:"index",setup(s){const t=kn(),e=Dt(),{zoom:n}=ge.storeToRefs(e),i=g.ref(!1),o=()=>{i.value=!0},r=()=>{t.saveMenu(()=>{Xt.ElMessage.success("保存成功!"),t.loadAllMenus()})};function a(C){const A=/Mac|iPod|iPhone|iPad/.test(navigator.platform);(A&&C.metaKey&&C.key==="s"||!A&&C.ctrlKey&&C.key==="s")&&(C.preventDefault(),r())}const l=()=>{Xt.ElMessageBox.confirm("确认清空画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.clearMenu(()=>{Xt.ElMessage.success("清空成功!")})})},c=()=>{if(!e.groupSelectedNodes()){Xt.ElMessage.warning("请先框选至少两个节点后再组合");return}Xt.ElMessage.success("组合完成")},h=()=>{Xt.ElMessageBox.confirm("确认删除画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.removeMenu(()=>{Xt.ElMessage.success("删除成功!")})})},u=g.ref(!1),d=()=>{u.value=!0},f=C=>{e.setZoom(+C*.1)},p=e.graph;p.on("blank:click",({x:C,y:A})=>{}),p.on("mousemove",({x:C,y:A})=>{}),p.on("blank:contextmenu",({e:C})=>{});const m=g.ref(!1),b=()=>{p.isMouseWheelEnabled()?(m.value=!0,p.disablePanning(),p.disableMouseWheel()):(m.value=!1,p.enablePanning(),p.enableMouseWheel())},y=()=>{console.log(p.toJSON())};return g.onMounted(()=>{window.addEventListener("keydown",a)}),g.onBeforeUnmount(()=>{window.removeEventListener("keydown",a)}),(C,A)=>{const x=g.resolveComponent("el-tooltip"),v=g.resolveComponent("el-dropdown-item"),B=g.resolveComponent("el-dropdown-menu"),E=g.resolveComponent("el-dropdown");return g.openBlock(),g.createElementBlock(g.Fragment,null,[g.createElementVNode("div",fx,[g.createElementVNode("div",px,[g.createElementVNode("a",{onClick:o},[g.createVNode(x,{effect:"light",content:"新增",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[2]||(A[2]=[g.createElementVNode("i",{class:"iconfont icon-xinjian"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:r},[g.createVNode(x,{effect:"light",content:"保存",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[3]||(A[3]=[g.createElementVNode("i",{class:"iconfont icon-baocun"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:l},[g.createVNode(x,{effect:"light",content:"清空",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[4]||(A[4]=[g.createElementVNode("i",{class:"iconfont icon-qingkong"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:c},[g.createVNode(x,{effect:"light",content:"组合",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[5]||(A[5]=[g.createElementVNode("i",{class:"iconfont icon-jianlizuhe1"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:h},[g.createVNode(x,{effect:"light",content:"删除",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[6]||(A[6]=[g.createElementVNode("i",{class:"iconfont icon-shanchu"},null,-1)])]),_:1})])]),A[10]||(A[10]=g.createElementVNode("div",{style:{flex:"1"}},null,-1)),g.createElementVNode("div",mx,[g.createVNode(E,{onCommand:f,"split-button":"",type:"primary",plain:"",size:"small",style:{"margin-top":"8px"}},{dropdown:g.withCtx(()=>[g.createVNode(B,null,{default:g.withCtx(()=>[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(20,M=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[M>=5&&M<=20?(g.openBlock(),g.createBlock(v,{key:0,command:M},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(M)+"0%",1)]),_:2},1032,["command"])):g.createCommentVNode("",!0)],64))),64))]),_:1})]),default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(n))+"% ",1)]),_:1})]),A[11]||(A[11]=g.createElementVNode("div",{style:{flex:"1"}},null,-1)),g.createElementVNode("div",bx,[g.createElementVNode("a",{onClick:b},[g.createVNode(x,{effect:"light",content:"锁定/解锁画布",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[m.value?(g.openBlock(),g.createElementBlock("i",yx)):(g.openBlock(),g.createElementBlock("i",Cx))]),_:1})]),g.createElementVNode("a",{onClick:d},[g.createVNode(x,{effect:"light",content:"预览",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[7]||(A[7]=[g.createElementVNode("i",{class:"iconfont icon-yulan"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:y},[g.createVNode(x,{effect:"light",content:"导出",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[8]||(A[8]=[g.createElementVNode("i",{class:"iconfont icon-daochu"},null,-1)])]),_:1})]),g.createElementVNode("a",null,[g.createVNode(x,{effect:"light",content:"导入",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...A[9]||(A[9]=[g.createElementVNode("i",{class:"iconfont icon-daoru"},null,-1)])]),_:1})])])]),i.value?(g.openBlock(),g.createBlock(dx,{key:0,onClose:A[0]||(A[0]=M=>i.value=!1)})):g.createCommentVNode("",!0),u.value?(g.openBlock(),g.createBlock(gx,{key:1,onClose:A[1]||(A[1]=M=>u.value=!1)})):g.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7ddbf68a"]]),Ax={class:"editorArea"},xx={class:"drawBox"},vx={style:{width:"100%",height:"100%"}},Ex=kt({__name:"editorArea",props:["width","height"],setup(s){const t=kn(),e=Dt(),{style:n}=ge.storeToRefs(e),i=s,o=g.ref(null),r=Mr(),a=g.inject("topoApi");return g.onMounted(()=>{e.el=o.value,e.style.height=i.height||1080,e.style.width=i.width||1920,e.init(),t.services=a,t.loadAllMenus(!0)}),g.onBeforeUnmount(()=>{e.graph&&e.graph.dispose()}),(l,c)=>(g.openBlock(),g.createElementBlock("div",Ax,[g.unref(e).graph?(g.openBlock(),g.createBlock(wx,{key:0})):g.createCommentVNode("",!0),g.createElementVNode("div",xx,[g.createElementVNode("div",vx,[g.createElementVNode("div",{ref_key:"container",ref:o,class:"editor-container",style:g.normalizeStyle({backgroundColor:g.unref(n).backgroundColor,backgroundImage:g.unref(n).backgroundImage?`url(${g.unref(n).backgroundImage})`:"none"})},null,4),g.createVNode(g.unref(r))])])]))}},[["__scopeId","data-v-0d80170d"]]),Sx={class:"groups-menus"},Mx=kt({__name:"menus",setup(s){const t=kn(),{menus:e,current:n}=ge.storeToRefs(t),i=(o,r)=>{t.setCurrentMenu(r)};return g.onMounted(()=>{console.log(e,n)}),(o,r)=>{const a=g.resolveComponent("el-icon"),l=g.resolveComponent("el-menu-item"),c=g.resolveComponent("el-sub-menu"),h=g.resolveComponent("el-menu");return g.openBlock(),g.createElementBlock("div",Sx,[g.createVNode(h,{"default-active":g.unref(n)[1],onSelect:i,"background-color":"transparent"},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(g.unref(e),u=>(g.openBlock(),g.createBlock(c,{key:u.id,index:u.id,"popper-offset":100},{title:g.withCtx(()=>[g.createVNode(a,null,{default:g.withCtx(()=>[g.createVNode(g.unref(Id))]),_:1}),g.createElementVNode("span",null,g.toDisplayString(u.name),1)]),default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.children,d=>(g.openBlock(),g.createBlock(l,{key:d.id,index:d.id},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(d.name),1)]),default:g.withCtx(()=>[g.createVNode(a,null,{default:g.withCtx(()=>[g.createVNode(g.unref(Pr))]),_:1})]),_:2},1032,["index"]))),128))]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])}}},[["__scopeId","data-v-4ccd6e37"]]),Bx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAEo1JREFUeF7t3E3I5mUVBvD/DGPISBnF5Ec5FkxFG1FykYQLK7BFi2rppo1tgkBqVeJKrFURBG1q48ZluHAjVC4MbKEEbsRamFl+NEz0QcOgw0y8Ay7H68Ccns5zP7+29/F+7ud33t6La/HOsdNn7ry8+R8BAgQIELhGgWMC5RoF/ecECBAgcEVAoPhBIECAAIEWAYHSwugSAgQIEBAofgYIECBAoEVAoLQwuoQAAQIEBIqfAQIECBBoERAoLYwuIUCAAAGB4meAAAECBFoEBEoLo0sIECBAoBwot93/8+3kzXcTI0CAAIEDEzj/5vPba09/M37rcqB8+hu/315+/K54oQECBAgQWEug+vtfoKy1d9+GAAEC7QICpZ3UhQQIEDhMAYFymHv3rQkQINAuIFDaSV1IgACBwxQQKIe5d9+aAAEC7QICpZ3UhQQIEDhMgZ0Hir9TyT9ob//z1e2NZ7+3XTj3Uh42QYDANQtc/+HPbLfc+8PtfTfefs13rXxB+juTnQdK9QNXXkr6brd/5YntreceFSgJyjmBJoGjQLnpnke2V596oOnGNa9Jv7/T+bsqbX+HUv3ANddR+1YCpeZkikCXgECpSabf3+lcoNScW6cESiunywhEAYESia4MpMBI5wKl5tw6JVBaOV1GIAoIlEgkUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJJrZUD7xtSe3S++cr73+QKdOnPzI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DM24kXrS0gUGr7TQ0knWsoNefWKYHSyukyAlFAoEQiDaVGNG9KoMzbiRetLSBQavtNDSSdayg159YpgdLK6TICUUCgRCINpUY0b0qgzNuJF60tIFBq+00NJJ1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knWsoNefWKYHSyukyAlFAoEQiDaVGNG9KoMzbiRetLSBQavtNDSSdayg159YpgdLK6TICUUCgRCINpUY0b0qgzNuJF60tIFBq+00NJJ1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knWsoNefWKYHSyukyAlFAoEQiDaVGNG9KoMzbiRetLSBQavtNDSSdayg159YpgdLK6TICUUCgRCINpUY0b0qgzNuJF60tIFBq+00NJJ1rKDXn1imB0srpMgJRQKBEIg2lRjRvSqDM24kXrS0gUGr7TQ0knf9PGspbzz1ae/2BTn3ojge315/57nbh3EsHKuBrE9itwFGg3Hrfj7a/v/iL3X7wnn3aTfc8sr38+F1XffXOA+XU3d/Zjl93w54x7va5x09cv5194SfbxfNnd/vBPo3AgQqcOHlqO/XZh7ZLFy8cqEDta1965z/b2ed/PCdQas82RYAAAQL7JrDzhrJvQN5LgAABAjUBgVJzMkWAAAECQUCg+BEhQIAAgRYBgdLC6BICBAgQECh+BggQIECgRUCgtDC6hAABAgTaA+W2+3++nbz5brIECBAgcGAC5998fnvt6W/Gb33s9Jk7L8cpAwQIECBAIAgIFD8iBAgQINAiIFBaGF1CgAABAgLFzwABAgQItAgIlBZGlxAgQICAQPEzQIAAAQItAgKlhdElBAgQICBQ/AwQIECAQIuAQGlhdAkBAgQI/BceBmwYFkhKEgAAAABJRU5ErkJggg==",kx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAFO1JREFUeF7tnD3I32f1h78JUUpEK0qsrZpaqIqLtNjBIhV8gQo6qGNBXHQRBLGTlU5FnRRBcNGlCI7iUJGCL0OFOrQIXUoV1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35Zd07BSHNBuax9ehoCBI4QSMFI8yNuuckfScFIc0HZ5GfhpQjsSyAFI833pXX4bVMw0lxQfEkECIwXSMFI8/EAK71ACkaaC8pKi3AZAgTOJ5CCkebne/LLunMKRpoLymXt09MQIHCEQApGmh9xy03+SApGmgvKJj8LL0VgXwIpGGm+Ly1/h2LfBAgQOCiQgpHmaG8LpN9A0txvKL4kAgTGC6RgpPl4gJVeIAUjzQVlpUW4DAEC5xNIwUjz8z35Zd05BSPNBeWy9ulpCBA4QiAFI82PuOUmfyQFI80FZZOfhZcisC+BFIw035fW4bdNwUhzQfElESAwXiAFI83HA6z0AikYaS4oKy3CZQgQOJ9ACkaan+/JL+vOKRhpLiiXtU9PQ4DAEQIpGGl+xC03+SMpGGkuKJv8LLwUgX0JpGCk+b60hv0dyu9/8AX7IUCAwMkErt33wPL6h55Yfvn0x171nreC8tYPfnn584+/cbJnmnij+x9/cnn2qUcPPvrJf0O58dhnl6v33DfR0jMTIDBU4Oq1e5ebz/1wef7n337VN7h2/cZy472fWV568YWhb3iax37pH39b/vjMVy4nKKd5bXchQIAAgVMLnPw3lFO/oPsRIECAwGkEBOU0zu5CgACBzQsIyuZX7AUJECBwGgFBOY2zuxAgQGDzAoKy+RV7QQIECJxGQFBO4+wuBAgQ2LzA6kF5xxNfX66/5bHNw3lBAgQIEPhvgZu/e2b57Xc/HVmuPPjwIy/HUw4QIECAAIEgICg+EQIECBBYRUBQVmF0EQIECBAQFN8AAQIECKwiICirMLoIAQIECAiKb4AAAQIEVhEQlFUYXYQAAQIEBMU3QIAAAQKrCAjKKowuQoAAAQL/BNGmU82l5+MXAAAAAElFTkSuQmCC",Dx=Object.assign({"../../../assets/iconfont/svg/A相手车刀闸合.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M511.9872 921.5232l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 76.8768 76.864 76.864-76.864 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 921.6z m0-102.4l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 54.4896 54.4832V290.6176l-54.4896 54.464-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68-54.4512-54.432v442.7008l54.4512-54.4512 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 819.2z m0-653.2864L435.1104 242.6816l-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68z" fill="#EF5317" /></svg>',"../../../assets/iconfont/svg/三绕组变压器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M544 64v268.256a192.064 192.064 0 0 1 147.84 256.704A192 192 0 1 1 512 904.608a192 192 0 1 1-179.84-315.68A192.064 192.064 0 0 1 480 332.256V64h64z m-197.44 555.072l-5.856 0.832A160.032 160.032 0 0 0 368 937.6a159.68 159.68 0 0 0 124.48-59.456 190.72 190.72 0 0 1-28.48-100.544c0-23.68 4.288-46.4 12.16-67.36a192 192 0 0 1-125.12-83.904l-4.48-7.264z m330.88-0.064l-0.8 1.44a192.192 192.192 0 0 1-128.832 89.824A190.72 190.72 0 0 1 560 777.6a191.104 191.104 0 0 1-28.384 100.544 160 160 0 1 0 145.824-259.104zM509.344 713.6l-2.016 4.8A159.584 159.584 0 0 0 496 777.6c0 25.024 5.76 48.672 16 69.76a158.72 158.72 0 0 0 16-69.76c0-22.784-4.768-44.448-13.344-64.064l-5.312 0.032z m-124.608-95.104l1.28 1.76a159.84 159.84 0 0 0 104.544 59.968l1.824-3.136a159.456 159.456 0 0 0-107.648-58.592z m254.56 0.064l-3.872 0.384a159.808 159.808 0 0 0-103.872 58.144l1.92 3.072a159.488 159.488 0 0 0 100.96-55.52l4.864-6.08zM512 361.6a160 160 0 0 0-146.656 224.064l2.656-0.064c57.344 0 108.8 25.152 144 64.992a191.552 191.552 0 0 1 144-64.992h2.688a160 160 0 0 0-146.688-224z" /></svg>',"../../../assets/iconfont/svg/变压器_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.0944 534.3232c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#E60012" /><path d="M633.6512 459.9808h-200.704l98.7136-158.1056 101.9904 158.1056z m-163.84-20.48h126.1568l-64.1024-99.5328-62.0544 99.5328z" fill="#E60012" /><path d="M533.0944 694.272c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896c0 81.92-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#EF7C1B" /><path d="M522.8544 611.9424h20.48v317.0304h-20.48z" fill="#EF7C1B" /><path d="M522.8544 57.9584h20.48v192.512h-20.48z" fill="#E60012" /><path d="M534.7328 632.832l-90.9312-101.9904 15.1552-13.5168 75.3664 84.3776 72.704-84.3776 15.5648 13.5168z" fill="#EF7C1B" /></svg>',"../../../assets/iconfont/svg/变压器_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 170.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333S629.824 170.666667 512 170.666667zM256 384c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M512 426.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333-95.509333-213.333333-213.333333-213.333333zM256 640c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M490.666667 981.333333v-106.666666h42.666666v106.666666h-42.666666zM490.666667 149.333333V42.666667h42.666666v106.666666h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/手持开关盒.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M431.431671 299.041479h159.572225v426.308151H431.431671z" fill="#d81e06" /><path d="M609.777099 744.122832H412.658468v-463.854556h197.118631v463.854556z m-159.572225-37.546405h122.025819v-388.761745H450.204874v388.761745z" fill="#d81e06" /><path d="M492.44458 131.568864h37.546406v186.167596h-37.546406zM492.44458 707.280422h37.546406v186.167596h-37.546406z" fill="#d81e06" /><path d="M594.993201 252.656023L511.06134 145.414101 427.129478 252.656023l-29.567794-23.153617L511.06134 84.479413l113.499656 145.022993z" fill="#d81e06" /><path d="M594.993201 168.17661L511.06134 60.934688 427.129478 168.17661l-29.567794-23.153617 113.499656-145.022993L624.560996 145.022993z" fill="#d81e06" /><path d="M511.06134 939.520587L397.561684 794.497594l29.567794-23.075396 83.931862 107.241922L594.993201 771.422198l29.567795 23.075396z" fill="#d81e06" /><path d="M511.06134 1024L397.561684 878.977007l29.567794-23.075395 83.931862 107.241922L594.993201 855.901612l29.567795 23.075395z" fill="#d81e06" /></svg>',"../../../assets/iconfont/svg/手持断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M494.481834 206.967196l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196l71.51746 87.410229-8.668783 7.223986-67.544268-82.714639-67.544268 82.714639zM566.360494 119.195767c0 0.361199 0 0.361199 0 0z" fill="#FF0000" /><path d="M494.481834 148.091711l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196L638.600353 140.867725l-8.668783 7.223986-67.544268-82.714639L494.481834 148.091711z m71.87866-87.771429c0 0.361199 0 0.361199 0 0zM562.026102 913.834215c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196z" fill="#FF0000" /><path d="M562.026102 972.7097c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196zM567.805291 849.179541h-11.197178V617.650794l-171.208466-252.839507 9.391182-6.140388 171.930864 254.284304c0.722399 1.083598 1.083598 2.167196 1.083598 3.250793v232.973545zM556.608113 178.071252h11.197178v183.489242h-11.197178z" fill="#FF0000" /><path d="M510.898342 402.654138l94.446392-90.429856 7.740501 8.087252-94.44278 90.429856z" fill="#FF0000" /><path d="M511.158406 320.35849l7.744113-8.087252 94.457227 90.415408-7.744113 8.090864zM556.608113 849.179541h11.197178v58.875485h-11.197178zM556.608113 119.195767h11.197178v58.875485h-11.197178z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/抽屉式断路器断开.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M85.18656007 375.38588444l-13.9264 0 0-387.28817777 13.9264 0z" fill="#EF1616" /><path d="M12.7726934 188.10538666l-9.84746666-9.84746666 72.41500444-72.41500444 9.84746666 9.84746666z" fill="#EF1616" /><path d="M71.25674674 115.69038222l9.84746666-9.84746665 72.41500443 72.41500443-9.84746665 9.84746667zM12.77496896 261.79811556l-9.84746667-9.84746667 72.41500445-72.41500445 9.84746666 9.84746667z" fill="#EF1616" /><path d="M71.25447117 189.38311111l9.84746667-9.84746667 72.41500445 72.41500445-9.84746667 9.84746667zM85.1797334 1037.94346667l-13.9264 0 0-387.28817778 13.9264 0z" fill="#EF1616" /><path d="M85.18769784 910.336l-9.84746665 9.84746667-72.41500445-72.41500445 9.84746666-9.84746666z" fill="#EF1616" /><path d="M143.67175118 837.92099556l9.84746666 9.84746665-72.41500444 72.41500446-9.84746666-9.84746667z" fill="#EF1616" /><path d="M85.18542229 836.64668444l-9.84746667 9.84746667-72.41500444-72.41500444 9.84746666-9.84746667z" fill="#EF1616" /><path d="M143.67402674 764.23168l9.84746666 9.84746667-72.41614222 72.41500444-9.84632889-9.84746667z" fill="#EF1616" /><path d="M19.62666674 375.38702222l118.32888888 0L137.95555561 650.33102222l-118.32888886 0-1e-8-274.944z m104.41386666 13.91502222l-90.48746666 0L33.55306674 636.40462222l90.48746666 0 0-247.10257778z" fill="#EF1616" /></svg>',"../../../assets/iconfont/svg/接地_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M531.791456 701.961295a17.407498 17.407498 0 0 1-15.824998-16.616247v-316.499956a15.824998 15.824998 0 0 1 15.824998-15.824998 17.407498 17.407498 0 0 1 15.824998 16.616248v320.456205a15.824998 15.824998 0 0 1-15.824998 11.868748zM533.373956 377.548841a18.989997 18.989997 0 0 1-11.077499 0L172.564006 27.02514a15.033748 15.033748 0 0 1 0-22.154997 15.033748 15.033748 0 0 1 22.154997 0l349.732451 345.776202a15.033748 15.033748 0 0 1 0 22.154996 14.242498 14.242498 0 0 1-11.077498 4.7475zM609.333945 1024H455.040217a15.824998 15.824998 0 0 1 0-31.649996h158.249977a15.824998 15.824998 0 0 1 0 31.649996zM762.836423 870.497522H300.746488a15.824998 15.824998 0 0 1 0-31.649996h462.089935a15.824998 15.824998 0 1 1 0 31.649996zM840.378913 716.203793H223.995249a15.824998 15.824998 0 0 1-15.824998-15.824998 15.824998 15.824998 0 0 1 15.824998-16.616247H840.378913a15.824998 15.824998 0 0 1 15.824997 16.616247 15.824998 15.824998 0 0 1-15.824997 15.824998z" /></svg>',"../../../assets/iconfont/svg/接地_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 704H213.333333v-42.666667h597.333334v42.666667zM725.333333 810.666667H298.666667v-42.666667h426.666666v42.666667zM640 917.333333H384v-42.666666h256v42.666666z" fill="#000000" /><path d="M490.666667 704V106.666667h42.666666v597.333333h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/断路器-he.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M640 176H528V0h-32v176H384v672h112v176h32V848h112z" fill="#D81E06" /></svg>',"../../../assets/iconfont/svg/断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M700.16 341.333333l55.04-55.04a42.666667 42.666667 0 0 0-60.16-60.16l-12.373333 12.373334V42.666667a42.666667 42.666667 0 0 0-85.333334 0v195.84l-12.373333-12.373334a42.666667 42.666667 0 0 0-60.16 60.16L579.84 341.333333l-55.466667 55.04a42.666667 42.666667 0 1 0 60.16 60.16L640 401.493333l55.04 55.04a42.666667 42.666667 0 1 0 60.16-60.16zM333.226667 230.826667a42.666667 42.666667 0 0 0-69.12 50.346666L597.333333 739.413333V981.333333a42.666667 42.666667 0 0 0 85.333334 0v-256a42.666667 42.666667 0 0 0-8.106667-25.173333z" /></svg>',"../../../assets/iconfont/svg/母线.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="98.08px" viewBox="0 0 2088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2088.44 442.576H5.726v138.848H2088.44V442.576z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/电池.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="100.64px" viewBox="0 0 2035 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2538.89999992 217.3c2.9-0.1 5.7-0.1 8.6-0.1" /><path d="M1344.19999992 960.2H703.99999992V130.3h640.1v829.9z m-567.5-70.1h494.8V200.4H776.69999992v689.7z" fill="#03E086" /><path d="M896.09999992 61h254.4v70H896.09999992zM1064.99999992 755.9l-80.7-39.7 63.6-129.1H855.49999992l128.3-255.3 80.4 40.5-62.7 124.8h191z" fill="#03E086" /></svg>',"../../../assets/iconfont/svg/直流逆变器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M207.36 359.936l58.624-58.624c9.216-9.216 21.418667-14.250667 34.389333-14.250667s25.173333 5.034667 34.389334 14.250667l41.557333 41.557333c17.749333 17.749333 40.96 26.88 64.341333 26.88 18.773333 0 37.632-5.802667 53.930667-17.749333l45.909333-33.621333c9.472-6.912 11.52-20.224 4.608-29.696a21.265067 21.265067 0 0 0-29.696-4.608l-45.909333 33.621333a48.452267 48.452267 0 0 1-63.146667-4.864l-41.557333-41.557333c-17.237333-17.237333-40.106667-26.709333-64.426667-26.709334-24.32 0-47.274667 9.472-64.426666 26.709334l-58.624 58.624c-8.277333 8.277333-8.277333 21.76 0 30.037333 8.277333 8.277333 21.76 8.277333 30.037333 0zM119.466667 119.466667v785.066666h785.066666V119.466667H119.466667z m706.645333 42.496L161.962667 826.112V161.962667h664.149333z m-640 700.074666l675.925333-675.925333v675.925333H186.112zM490.837333 685.568h339.882667v42.496H490.837333zM736.682667 790.101333h94.122666v42.496H736.682667zM613.717333 790.101333h94.122667v42.496H613.717333zM490.837333 790.101333h94.122667v42.496H490.837333z" /></svg>'});function Qx(s){return s?(s=s.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"').replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),s=s.replace(/<([a-z]+)([^>]*?)\/?>/gi,(t,e,n)=>{const i=t.endsWith("/>")?"/>":">";return!/(fill=)/i.test(n)&&/^(path|circle|rect|polygon|polyline)$/i.test(e)?`<${e}${n} fill="currentColor"${i}`:t}),s):""}const yd="__node_panel_svg_sprite__";function Lx(){if(typeof document>"u")return null;let s=document.getElementById(yd);s||(s=document.createElementNS("http://www.w3.org/2000/svg","svg"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.overflow="hidden",s.id=yd,document.body.prepend(s));let t=s.querySelector("defs");return t||(t=document.createElementNS("http://www.w3.org/2000/svg","defs"),s.appendChild(t)),t}function zx(s){const t=s.match(/viewBox="([^"]+)"/i),e=s.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i);return{viewBox:t?t[1]:"",content:e?e[1]:s}}function Fx(s,t){const e=Lx();if(!e||e.querySelector(`#${s}`))return s;const{viewBox:n,content:i}=zx(Qx(t)),o=document.createElementNS("http://www.w3.org/2000/svg","symbol");return o.setAttribute("id",s),n&&o.setAttribute("viewBox",n),o.innerHTML=i,e.appendChild(o),s}const Ux=Object.entries(Dx).map(([s,t])=>({name:s.split("/").pop().replace(".svg",""),id:Fx(`node-icon-${s.split("/").pop().replace(".svg","")}`,t)})),Vx={class:"nodes"},Kx={class:"groups"},Jx=["onClick"],jx={class:"list"},Gx={style:{width:"100%",display:"flex","justify-content":"space-between","align-items":"center",padding:"20px 10px 10px 10px"}},Yx={style:{padding:"10px"}},Hx=["onMousedown","title"],_x={key:1,class:"svg-icon"},Wx={"aria-hidden":"true"},qx=["xlink:href"],Xx=kt({__name:"nodes",setup(s){const t=Dt(),e={IMG:"img",SVG:"svg",OTHER:"other"},n=g.ref(0),i=g.ref([{name:"控件",icon:"iconfont icon-icon-relativity",active:[],children:[{name:"基础",layout:"1fr 1fr 1fr",list:[{name:"线段",renderType:"svg",icon:"icon-xianduan",data:{type:"line"}},{name:"基础文字",renderType:"svg",icon:"icon-wenzi",data:{type:"text",text:"测试"}},{name:"数值",renderType:"svg",icon:"icon-shuzhi",data:{type:"svg"}},{name:"图标",renderType:"svg",icon:"icon-tubiao",data:{type:"svg"}},{name:"图片",renderType:"svg",icon:"icon-tupian",data:{type:"svg"}},{name:"自定义",renderType:"svg",icon:"icon-tupian",data:{type:"icon"}}]},{name:"图形",list:[]},{name:"表格",list:[]},{name:"图表",list:[]},{name:"表单",list:[]}]},{name:"模板",icon:"iconfont icon-root-list",active:[],children:[{name:"布局",layout:"1fr 1fr",list:[{name:"布局1",renderType:"img",icon:Bx,data:{type:"layout"}},{name:"布局2",renderType:"img",icon:kx,data:{type:"layout"}},{name:"布局3",renderType:"img",icon:Ix,data:{type:"layout"}},{name:"布局4",renderType:"img",icon:Tx,data:{type:"layout"}},{name:"布局5",renderType:"img",icon:Px,data:{type:"layout"}},{name:"布局6",renderType:"img",icon:Ox,data:{type:"layout"}},{name:"布局7",renderType:"img",icon:Nx,data:{type:"layout"}},{name:"布局8",renderType:"img",icon:Rx,data:{type:"layout"}}]}]},{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"图表",icon:"iconfont icon-icon_chart",children:[],active:[]},{name:"素材",icon:"iconfont icon-icon_image",children:[{name:"电器svg",layout:"1fr 1fr 1fr",list:Ux.map(h=>({name:h.name,renderType:"svg",icon:h.id,data:{type:"svg"}}))}],active:[]}]),o=g.ref(""),r=h=>{n.value=h},a=()=>{if(i.value[n.value].active.length>0)i.value[n.value].active=[];else{const h=[];i.value[n.value].children.forEach((u,d)=>{h.push(d)}),i.value[n.value].active=h}},l=(h,u)=>{console.log(u);let d;["line"].includes(u.data.type)?d=t.graph.createNode({shape:"svg-node"}):d=t.graph.createNode({shape:u.data.type+"-node"}),d.setData({icon:u.icon,name:u.name,...u.data}),t.dnd.start(d,h)},c=({node:h})=>{var u;if(((u=h.data)==null?void 0:u.type)==="line"){const d=h.position();console.log(h,h.position()),h.remove();const f=t.graph.addNode({id:"line"+crypto.randomUUID(),x:d.x-50,y:d.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),p=t.graph.addNode({id:"line"+crypto.randomUUID(),x:d.x+50,y:d.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),m=t.graph.addEdge({source:f,target:p,router:"normal",markup:[{tagName:"path",selector:"line"},{tagName:"path",selector:"line1"}],attrs:{line:{stroke:"#1bc8de80",strokeWidth:2,connection:!0,sourceMarker:"",targetMarker:""},line1:{display:"none",connection:!0,x:0,y:0,strokeWidth:4,stroke:"#91f4ffff",fill:"none",strokeDasharray:"8 8",pointerEvents:"none",style:{animation:"ant-line 30s infinite linear"}}},zIndex:0,data:{name:"line",status:[],bindData:[],realData:[]}});t.graph.select(m)}};return g.onMounted(()=>{t.graph.on("node:added",c)}),g.onBeforeUnmount(()=>{t.graph.off("node:added",c)}),(h,u)=>{const d=g.resolveComponent("el-input"),f=g.resolveComponent("el-tooltip"),p=g.resolveComponent("el-image"),m=g.resolveComponent("el-collapse-item"),b=g.resolveComponent("el-collapse");return g.openBlock(),g.createElementBlock("div",Vx,[g.createElementVNode("div",Kx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.value,(y,C)=>(g.openBlock(),g.createElementBlock("div",{key:y.index,class:g.normalizeClass(["group",{active:n.value===C}]),onClick:A=>r(C)},[g.createElementVNode("i",{class:g.normalizeClass(y.icon)},null,2),g.createElementVNode("span",null,g.toDisplayString(y.name),1)],10,Jx))),128))]),g.createElementVNode("div",jx,[g.createElementVNode("div",Gx,[g.createVNode(d,{modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=y=>o.value=y),style:{width:"180px"},placeholder:"请输入过滤","prefix-icon":g.unref(Or),clearable:""},null,8,["modelValue","prefix-icon"]),g.createVNode(f,{effect:"light",content:"展开/折叠",placement:"top"},{default:g.withCtx(()=>[g.createElementVNode("div",{style:{cursor:"pointer","font-size":"20px"},onClick:a},[...u[2]||(u[2]=[g.createElementVNode("i",{class:"iconfont icon-menu-fold"},null,-1)])])]),_:1})]),g.createElementVNode("div",Yx,[g.createVNode(b,{modelValue:i.value[n.value].active,"onUpdate:modelValue":u[1]||(u[1]=y=>i.value[n.value].active=y),"expand-icon-position":"left",style:{border:"none","background-color":"transparent"}},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.value[n.value].children,(y,C)=>(g.openBlock(),g.createBlock(m,{key:C,title:y.name,name:C},{default:g.withCtx(()=>[g.createElementVNode("div",{class:"expand-content",style:g.normalizeStyle({gridTemplateColumns:y.layout?y.layout:"1fr 1fr 1fr"})},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(y.list.filter(A=>A.name.includes(o.value)),(A,x)=>(g.openBlock(),g.createElementBlock("div",{key:x,class:"graphic",onMousedown:v=>l(v,A),title:A.name},[A.renderType===e.IMG?(g.openBlock(),g.createBlock(p,{key:0,src:A.icon,style:{width:"100px",height:"60px",margin:"auto"}},null,8,["src"])):g.createCommentVNode("",!0),A.renderType===e.SVG?(g.openBlock(),g.createElementBlock("div",_x,[(g.openBlock(),g.createElementBlock("svg",Wx,[g.createElementVNode("use",{"xlink:href":"#"+A.icon},null,8,qx)]))])):g.createCommentVNode("",!0),A.renderType===e.OTHER?(g.openBlock(),g.createElementBlock("i",{key:2,class:g.normalizeClass(["iconfont",A.icon]),style:{"font-size":"24px"}},null,2)):g.createCommentVNode("",!0),g.createElementVNode("p",null,g.toDisplayString(A.name),1)],40,Hx))),128))],4)]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])])])}}},[["__scopeId","data-v-5f1bd2e4"]]),$x={class:"datas"},Zx={class:"groups"},tv=["onClick"],ev={class:"list"},nv={style:{padding:"10px"}},iv=["onMousedown"],sv=kt({__name:"datas",setup(s){const t=Dt(),e=g.inject("topoApi"),n=g.ref([]);(async()=>{n.value=await e.getDeviceList()})();const o=g.ref([{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"接口",icon:"iconfont icon-icon_chart",children:[],active:[]}]),r=g.ref(0),a=u=>{r.value=u};g.ref({});const l=g.ref(""),c={value:"id",label:"name",children:"children"},h=(u,d)=>{console.log(d);const f=d.data,{id:p,deviceName:m,deviceType:b,deviceNo:y,templateName:C,templateId:A}=d.parent;f.parent={id:p,deviceName:m,deviceType:b,deviceNo:y,templateName:C,templateId:A};const x={type:"text",text:f.name,bindData:f,name:f.name};let v=t.graph.createNode({shape:"text-node",width:120,height:60});v.setData(x),t.dnd.start(v,u)};return(u,d)=>{const f=g.resolveComponent("el-button"),p=g.resolveComponent("el-input"),m=g.resolveComponent("el-icon"),b=g.resolveComponent("el-tree-v2");return g.openBlock(),g.createElementBlock("div",$x,[g.createElementVNode("div",Zx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(o.value,(y,C)=>(g.openBlock(),g.createElementBlock("div",{key:y.index,class:g.normalizeClass(["group",{active:r.value===C}]),onClick:A=>a(C)},[g.createElementVNode("i",{class:g.normalizeClass(y.icon)},null,2),g.createElementVNode("span",null,g.toDisplayString(y.name),1)],10,tv))),128))]),g.createElementVNode("div",ev,[g.createElementVNode("div",nv,[g.createVNode(p,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=y=>l.value=y),style:{height:"30px"},placeholder:"输入TAG搜索",size:"small"},{append:g.withCtx(()=>[g.createVNode(f,{icon:g.unref(Or)},null,8,["icon"])]),_:1},8,["modelValue"])]),g.createVNode(b,{style:{width:"100%"},data:n.value,props:c,height:800},{default:g.withCtx(({node:y})=>[g.createVNode(m,{class:"el-icon--left"},{default:g.withCtx(()=>[y.isLeaf?(g.openBlock(),g.createBlock(g.unref(Pr),{key:0})):y.expanded?(g.openBlock(),g.createBlock(g.unref(Sd),{key:2})):(g.openBlock(),g.createBlock(g.unref(Bd),{key:1}))]),_:2},1024),g.createElementVNode("span",{onMousedown:C=>h(C,y)},g.toDisplayString(y.label),41,iv)]),_:1},8,["data"])])])}}},[["__scopeId","data-v-6ebb7a76"]]),ov={class:"graphics"},rv={class:"menus"},av=kt({__name:"index",setup(s){const t=g.ref(0);return(e,n)=>(g.openBlock(),g.createElementBlock("div",ov,[g.createElementVNode("div",rv,[g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===0}]),onClick:n[0]||(n[0]=i=>t.value=0)},"菜单目录",2),g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===1}]),onClick:n[1]||(n[1]=i=>t.value=1)},"系统资源",2),g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===2}]),onClick:n[2]||(n[2]=i=>t.value=2)},"我的资源",2),g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===3}]),onClick:n[3]||(n[3]=i=>t.value=3)},"数据模拟",2)]),t.value===0?(g.openBlock(),g.createBlock(Mx,{key:0})):g.createCommentVNode("",!0),t.value===1?(g.openBlock(),g.createBlock(Xx,{key:1})):g.createCommentVNode("",!0),t.value===3?(g.openBlock(),g.createBlock(sv,{key:2})):g.createCommentVNode("",!0)]))}},[["__scopeId","data-v-5d4afd5a"]]),lv=["src"],cv=kt({__name:"graphProperty",setup(s){kn();const t=Dt(),{style:e,name:n}=ge.storeToRefs(t),i=g.ref(["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]);function o(a){return new Promise((l,c)=>{const h=new FileReader;h.onload=()=>l(h.result),h.onerror=c,h.readAsDataURL(a)})}const r=async a=>{if(!a.type.startsWith("image/"))return Xt.ElMessage.error("只能上传图片文件"),!1;if(!(a.size/1024/1024<2))return Xt.ElMessage.error("图片大小不能超过 2MB"),!1;try{const c=await o(a);e.value.backgroundImage=c}catch{return Xt.ElMessage.error("图片读取失败"),!1}return!1};return g.ref(1920),g.ref(1080),(a,l)=>{const c=g.resolveComponent("el-input"),h=g.resolveComponent("el-form-item");g.resolveComponent("el-input-number"),g.resolveComponent("el-button");const u=g.resolveComponent("el-color-picker"),d=g.resolveComponent("el-icon"),f=g.resolveComponent("el-upload"),p=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(p,{class:"graphProperty",size:"small","label-width":"auto",onSubmit:l[4]||(l[4]=g.withModifiers(()=>{},["prevent"]))},{default:g.withCtx(()=>[g.createVNode(h,{label:"目录名称"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:g.unref(n),"onUpdate:modelValue":l[0]||(l[0]=m=>g.isRef(n)?n.value=m:null)},null,8,["modelValue"])]),_:1}),g.createCommentVNode("",!0),g.createVNode(h,{label:"背景颜色"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:g.unref(e).backgroundColor,"onUpdate:modelValue":l[3]||(l[3]=m=>g.unref(e).backgroundColor=m),"show-alpha":"",predefine:i.value,style:{width:"100%",height:"30px"}},null,8,["modelValue","predefine"])]),_:1}),g.createVNode(h,{label:"背景图片"},{default:g.withCtx(()=>[g.createVNode(f,{accept:"image/*","show-file-list":!1,"before-upload":r},{default:g.withCtx(()=>[g.unref(e).backgroundImage?(g.openBlock(),g.createElementBlock("img",{key:0,src:g.unref(e).backgroundImage,style:{width:"100%",height:"100%"}},null,8,lv)):(g.openBlock(),g.createBlock(d,{key:1,class:"avatar-uploader-icon"},{default:g.withCtx(()=>[g.createVNode(g.unref(Pd))]),_:1}))]),_:1})]),_:1})]),_:1})}}},[["__scopeId","data-v-3a1238a6"]]),hv=kt({__name:"nodePanel",setup(s){var r;const t=Dt(),e=g.inject("cellId"),n=g.inject("getCurCell")(),i=n.getData()||{},o=g.ref({name:((r=n.getData())==null?void 0:r.name)||"",x:n.position().x,y:n.position().y,width:n.size().width,height:n.size().height,zIndex:n.prop("zIndex"),opacity:i.opacity||1,borderStyle:i.borderStyle,borderRadius:i.borderRadius,borderWidth:i.borderWidth,borderColor:i.borderColor,backgroundColor:i.backgroundColor});return g.watch(o.value,()=>{n.prop("position",{x:o.value.x,y:o.value.y}),n.prop("size",{width:o.value.width,height:o.value.height}),n.prop("zIndex",o.value.zIndex);const{name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:d,backgroundColor:f,backgroundImage:p,color:m}=o.value;n.setData({name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:d,backgroundColor:f})}),g.onMounted(()=>{t.graph.on("node:resized",({node:a})=>{a.id===e.value&&(o.value.width=a.size().width,o.value.height=a.size().height)}),t.graph.on("node:change:position",({node:a})=>{console.log(a.position()),a.id===e.value&&(o.value.x=+a.position().x.toFixed(0),o.value.y=+a.position().y.toFixed(0))})}),g.onBeforeUnmount(()=>{t.graph.off("node:resized"),t.graph.off("node:change:position")}),(a,l)=>{const c=g.resolveComponent("el-input"),h=g.resolveComponent("el-form-item"),u=g.resolveComponent("el-input-number"),d=g.resolveComponent("el-slider"),f=g.resolveComponent("el-option"),p=g.resolveComponent("el-select"),m=g.resolveComponent("el-color-picker"),b=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(b,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:g.withCtx(()=>[l[17]||(l[17]=g.createElementVNode("div",{class:"baseTitle"},"基础",-1)),g.createVNode(h,{label:"元素名称"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:o.value.name,"onUpdate:modelValue":l[0]||(l[0]=y=>o.value.name=y)},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"位置"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:o.value.x,"onUpdate:modelValue":l[1]||(l[1]=y=>o.value.x=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...l[12]||(l[12]=[g.createElementVNode("span",null,"X",-1)])]),_:1},8,["modelValue"]),g.createVNode(u,{modelValue:o.value.y,"onUpdate:modelValue":l[2]||(l[2]=y=>o.value.y=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:g.withCtx(()=>[...l[13]||(l[13]=[g.createElementVNode("span",null,"Y",-1)])]),_:1},8,["modelValue"])]),_:1}),g.createVNode(h,{label:"宽高"},{default:g.withCtx(()=>[l[16]||(l[16]=g.createElementVNode("span",null,null,-1)),g.createVNode(u,{modelValue:o.value.width,"onUpdate:modelValue":l[3]||(l[3]=y=>o.value.width=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...l[14]||(l[14]=[g.createElementVNode("span",null,"W",-1)])]),_:1},8,["modelValue"]),g.createVNode(u,{modelValue:o.value.height,"onUpdate:modelValue":l[4]||(l[4]=y=>o.value.height=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:g.withCtx(()=>[...l[15]||(l[15]=[g.createElementVNode("span",null,"H",-1)])]),_:1},8,["modelValue"])]),_:1}),g.createVNode(h,{label:"层级"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:o.value.zIndex,"onUpdate:modelValue":l[5]||(l[5]=y=>o.value.zIndex=y),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"透明度"},{default:g.withCtx(()=>[g.createVNode(d,{modelValue:o.value.opacity,"onUpdate:modelValue":l[6]||(l[6]=y=>o.value.opacity=y),min:0,max:1,step:.01,style:{width:"160px"}},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"边框"},{default:g.withCtx(()=>[g.createVNode(p,{modelValue:o.value.borderStyle,"onUpdate:modelValue":l[7]||(l[7]=y=>o.value.borderStyle=y),style:{width:"60px","margin-right":"10px"},placeholder:"样式"},{default:g.withCtx(()=>[g.createVNode(f,{label:"无",value:"none"}),g.createVNode(f,{label:"实线",value:"solid"}),g.createVNode(f,{label:"虚线",value:"dashed"}),g.createVNode(f,{label:"点线",value:"dotted"})]),_:1},8,["modelValue"]),g.createVNode(u,{modelValue:o.value.borderWidth,"onUpdate:modelValue":l[8]||(l[8]=y=>o.value.borderWidth=y),"controls-position":"right",min:0,step:1,style:{width:"60px","margin-right":"10px"},placeholder:"宽度"},null,8,["modelValue"]),g.createVNode(m,{modelValue:o.value.borderColor,"onUpdate:modelValue":l[9]||(l[9]=y=>o.value.borderColor=y),"show-alpha":"",placeholder:"颜色"},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"圆角"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:o.value.borderRadius,"onUpdate:modelValue":l[10]||(l[10]=y=>o.value.borderRadius=y),min:0,max:100,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"背景颜色"},{default:g.withCtx(()=>[g.createVNode(m,{modelValue:o.value.backgroundColor,"onUpdate:modelValue":l[11]||(l[11]=y=>o.value.backgroundColor=y),"show-alpha":"",placeholder:"颜色",style:{width:"180px",height:"30px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-71c57f2d"]]),uv={class:"inline-row"},dv=kt({__name:"linePanel",setup(s){var l,c;const t=g.inject("getCurCell")(),e=((l=t.getAttrs())==null?void 0:l.line)||{},n=((c=t.getAttrs())==null?void 0:c.line1)||{},i=h=>!h||h==="none"?"none":typeof h=="string"?h:h.name||"none",o=(h,u)=>!h||h==="none"?u:typeof h=="object"&&h.size?h.size:u,r=g.ref({name:"line",trackColor:e.stroke||"#754c3c",strokeWidth:e.strokeWidth??2,strokeOpacity:e.strokeOpacity??1,sourceMarker:i(e.sourceMarker)||"none",targetMarker:i(e.targetMarker)||"none",markerSize:o(e.targetMarker||e.sourceMarker,8),flowEnabled:n.display!=="none"}),a=()=>{const h=r.value;t.setData({...t.getData(),name:h.name}),t.prop("zIndex",h.zIndex),t.attr("line/stroke",h.trackColor),t.attr("line/strokeWidth",h.strokeWidth),t.attr("line/strokeOpacity",h.strokeOpacity),t.attr("line/fill","none"),t.attr("line/strokeDasharray",null),t.attr("line/strokeDashoffset",0);const u=d=>!d||d==="none"?"":{name:d,size:h.markerSize};t.attr("line/sourceMarker",u(h.sourceMarker)),t.attr("line/targetMarker",u(h.targetMarker)),h.flowEnabled?(t.attr("line/strokeWidth",8),t.attr("line1/display","inline")):t.attr("line1/display","none")};return g.watch(r,a,{deep:!0,immediate:!0}),(h,u)=>{const d=g.resolveComponent("el-input"),f=g.resolveComponent("el-form-item"),p=g.resolveComponent("el-input-number"),m=g.resolveComponent("el-color-picker"),b=g.resolveComponent("el-slider"),y=g.resolveComponent("el-option"),C=g.resolveComponent("el-select"),A=g.resolveComponent("el-switch"),x=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(x,{size:"small","label-width":"90px","label-position":"left"},{default:g.withCtx(()=>[u[9]||(u[9]=g.createElementVNode("div",{class:"baseTitle"},"连线样式",-1)),g.createVNode(f,{label:"名称"},{default:g.withCtx(()=>[g.createVNode(d,{modelValue:r.value.name,"onUpdate:modelValue":u[0]||(u[0]=v=>r.value.name=v),placeholder:""},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"层级"},{default:g.withCtx(()=>[g.createVNode(p,{modelValue:r.value.zIndex,"onUpdate:modelValue":u[1]||(u[1]=v=>r.value.zIndex=v),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"颜色"},{default:g.withCtx(()=>[g.createVNode(m,{modelValue:r.value.trackColor,"onUpdate:modelValue":u[2]||(u[2]=v=>r.value.trackColor=v),"show-alpha":"",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"粗细"},{default:g.withCtx(()=>[g.createVNode(p,{modelValue:r.value.strokeWidth,"onUpdate:modelValue":u[3]||(u[3]=v=>r.value.strokeWidth=v),min:1,step:1,"controls-position":"right",style:{width:"120px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"透明度"},{default:g.withCtx(()=>[g.createVNode(b,{modelValue:r.value.strokeOpacity,"onUpdate:modelValue":u[4]||(u[4]=v=>r.value.strokeOpacity=v),min:0,max:1,step:.01,style:{width:"180px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"箭头"},{default:g.withCtx(()=>[g.createElementVNode("div",uv,[g.createVNode(C,{modelValue:r.value.sourceMarker,"onUpdate:modelValue":u[5]||(u[5]=v=>r.value.sourceMarker=v),style:{width:"60px","margin-right":"3px"}},{default:g.withCtx(()=>[g.createVNode(y,{label:"无",value:"none"}),g.createVNode(y,{label:"箭头",value:"block"}),g.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),g.createVNode(C,{modelValue:r.value.targetMarker,"onUpdate:modelValue":u[6]||(u[6]=v=>r.value.targetMarker=v),style:{width:"60px","margin-right":"3px"}},{default:g.withCtx(()=>[g.createVNode(y,{label:"无",value:"none"}),g.createVNode(y,{label:"箭头",value:"block"}),g.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),g.createVNode(p,{modelValue:r.value.markerSize,"onUpdate:modelValue":u[7]||(u[7]=v=>r.value.markerSize=v),min:4,max:30,step:1,"controls-position":"right",style:{width:"60px"}},null,8,["modelValue"])])]),_:1}),g.createVNode(f,{label:"动画"},{default:g.withCtx(()=>[g.createVNode(A,{modelValue:r.value.flowEnabled,"onUpdate:modelValue":u[8]||(u[8]=v=>r.value.flowEnabled=v),"active-text":"开启","inactive-text":"关闭",style:{"margin-right":"8px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-007fe38a"]]),gv=kt({__name:"textPanel",setup(s){Dt(),g.inject("cellId");const t=g.inject("getCurCell")(),e=t.getData()||{},n=g.ref({text:e.text||"",justifyContent:e.justifyContent||"center",alignItems:e.alignItems||"center",textAlign:e.textAlign||"center",color:e.color||"#ffffff",fontWeight:e.fontWeight??400,fontSize:e.fontSize??16,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??1.4,fontFamily:e.fontFamily||"",fontStyle:e.fontStyle||"normal",textDecoration:e.textDecoration||"none",whiteSpace:e.whiteSpace||"pre-wrap",wordBreak:e.wordBreak||"break-word",textOverflow:e.textOverflow||"clip",overflow:e.overflow||"hidden",display:e.display||"block"});return g.watch(n,i=>{t.setData({...i})},{deep:!0}),(i,o)=>{const r=g.resolveComponent("el-option"),a=g.resolveComponent("el-select"),l=g.resolveComponent("el-form-item"),c=g.resolveComponent("el-input-number"),h=g.resolveComponent("el-color-picker"),u=g.resolveComponent("el-input"),d=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(d,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:g.withCtx(()=>[o[14]||(o[14]=g.createElementVNode("div",{class:"baseTitle"},"文字",-1)),g.createVNode(l,{label:"文本对齐"},{default:g.withCtx(()=>[g.createVNode(a,{modelValue:n.value.textAlign,"onUpdate:modelValue":o[0]||(o[0]=f=>n.value.textAlign=f),style:{width:"190px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"左对齐",value:"left"}),g.createVNode(r,{label:"居中",value:"center"}),g.createVNode(r,{label:"右对齐",value:"right"})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"字体"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:n.value.fontSize,"onUpdate:modelValue":o[1]||(o[1]=f=>n.value.fontSize=f),"controls-position":"right",min:8,step:1,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...o[11]||(o[11]=[g.createElementVNode("span",null,"大小",-1)])]),_:1},8,["modelValue"]),g.createVNode(a,{modelValue:n.value.fontWeight,"onUpdate:modelValue":o[2]||(o[2]=f=>n.value.fontWeight=f),modelModifiers:{number:!0},style:{width:"90px"}},{default:g.withCtx(()=>[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(7,f=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[f>2?(g.openBlock(),g.createBlock(r,{key:f,label:f*100,value:f*100},null,8,["label","value"])):g.createCommentVNode("",!0)],64))),64))]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"行高/间距"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:n.value.lineHeight,"onUpdate:modelValue":o[3]||(o[3]=f=>n.value.lineHeight=f),"controls-position":"right",min:.5,step:.1,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...o[12]||(o[12]=[g.createElementVNode("span",null,"行高",-1)])]),_:1},8,["modelValue"]),g.createVNode(c,{modelValue:n.value.letterSpacing,"onUpdate:modelValue":o[4]||(o[4]=f=>n.value.letterSpacing=f),"controls-position":"right",min:0,step:1,style:{width:"90px"}},{prefix:g.withCtx(()=>[...o[13]||(o[13]=[g.createElementVNode("span",null,"间距",-1)])]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"样式"},{default:g.withCtx(()=>[g.createVNode(a,{modelValue:n.value.fontStyle,"onUpdate:modelValue":o[5]||(o[5]=f=>n.value.fontStyle=f),style:{width:"90px","margin-right":"10px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"常规",value:"normal"}),g.createVNode(r,{label:"斜体",value:"italic"})]),_:1},8,["modelValue"]),g.createVNode(a,{modelValue:n.value.textDecoration,"onUpdate:modelValue":o[6]||(o[6]=f=>n.value.textDecoration=f),style:{width:"90px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"无",value:"none"}),g.createVNode(r,{label:"下划线",value:"underline"}),g.createVNode(r,{label:"删除线",value:"line-through"})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"换行/溢出",style:{display:"flex"}},{default:g.withCtx(()=>[g.createVNode(a,{modelValue:n.value.whiteSpace,"onUpdate:modelValue":o[7]||(o[7]=f=>n.value.whiteSpace=f),style:{width:"90px","margin-right":"10px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"自动换行",value:"pre-wrap"}),g.createVNode(r,{label:"单行",value:"nowrap"}),g.createVNode(r,{label:"普通",value:"normal"})]),_:1},8,["modelValue"]),g.createVNode(a,{modelValue:n.value.textOverflow,"onUpdate:modelValue":o[8]||(o[8]=f=>n.value.textOverflow=f),style:{width:"90px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"裁剪",value:"clip"}),g.createVNode(r,{label:"省略号",value:"ellipsis"})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"字体颜色"},{default:g.withCtx(()=>[g.createVNode(h,{modelValue:n.value.color,"onUpdate:modelValue":o[9]||(o[9]=f=>n.value.color=f),"show-alpha":"",placeholder:"颜色",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),g.createVNode(l,{label:"文本内容"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:n.value.text,"onUpdate:modelValue":o[10]||(o[10]=f=>n.value.text=f),style:{width:"200px"},rows:3,type:"textarea",placeholder:"请输入文本"},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-8c4d2068"]]),fv={class:"propertyForm"},pv={__name:"base",setup(s){var i;Bn(),Dt();const t=g.inject("getCurCell")(),e=g.ref(t==null?void 0:t.isNode()),n=(i=t==null?void 0:t.getData())==null?void 0:i.type;return(o,r)=>(g.openBlock(),g.createElementBlock("div",fv,[e.value?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createVNode(hv),g.unref(n)==="text"?(g.openBlock(),g.createBlock(gv,{key:0})):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createBlock(dv,{key:1}))]))}},mv={__name:"JsonEditor",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(s,{emit:t}){const e=s,n=t,i=g.ref(null);let o=null;return g.onMounted(()=>{o=xd.editor.create(i.value,{value:JSON.stringify(e.modelValue,null,2),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14}),o.onDidChangeModelContent(()=>{try{const r=o.getValue(),a=JSON.parse(r);n("update:modelValue",a)}catch{}})}),g.watch(()=>e.modelValue,r=>{const a=o.getValue(),l=JSON.stringify(r,null,2);a!==l&&o.setValue(l)},{deep:!0}),g.onBeforeUnmount(()=>{o==null||o.dispose()}),(r,a)=>(g.openBlock(),g.createElementBlock("div",{ref_key:"editorContainer",ref:i,class:"json-editor"},null,512))}},bv={class:"dataBox"},yv=kt({__name:"data",setup(s){const t=g.inject("getCurCell")(),e=g.ref(t.getData());return(n,i)=>(g.openBlock(),g.createElementBlock("div",bv,[g.createVNode(mv,{modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=o=>e.value=o)},null,8,["modelValue"])]))}},[["__scopeId","data-v-d827f9ac"]]),Cv={class:"prop"},wv={class:"tabContainer"},Av=["onClick"],xv={class:"activeLine"},vv={key:0,class:"main"},Ev=kt({__name:"index",setup(s){const t=Dt(),e=Bn(),{targetType:n,tabs:i,activeTab:o,cellId:r}=ge.storeToRefs(e),a=h=>{o.value=h};let l=r.value?t.graph.getCellById(r.value):null;g.provide("getCurCell",()=>l),g.provide("cellId",r);const c=g.ref(!0);return g.watch(r,()=>{console.log("cellId",r.value),l=t.graph.getCellById(r.value),c.value=!1,g.nextTick(()=>{c.value=!0})}),(h,u)=>(g.openBlock(),g.createElementBlock("div",Cv,[g.createElementVNode("div",wv,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(g.unref(i),(d,f)=>(g.openBlock(),g.createElementBlock("div",{key:f,class:g.normalizeClass(["tabItem",{active:g.unref(o)===f}]),onClick:p=>a(f)},[g.createTextVNode(g.toDisplayString(d)+" ",1),g.withDirectives(g.createElementVNode("div",xv,null,512),[[g.vShow,g.unref(o)===f]])],10,Av))),128))]),c.value?(g.openBlock(),g.createElementBlock("div",vv,[g.unref(n)==="blank"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.unref(o)===0?(g.openBlock(),g.createBlock(cv,{key:0})):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.unref(o)===0?(g.openBlock(),g.createBlock(pv,{key:0})):g.unref(o)===1?(g.openBlock(),g.createBlock(yv,{key:1})):g.createCommentVNode("",!0)],64))])):g.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b4a4e65e"]]),Sv={class:"ems-editor"},Mv={class:"ems-editor__workspace"},Tr=Object.assign({name:"EmsEditor"},{__name:"index",props:{services:{type:Object,default:()=>({})},width:{type:Number,default:1920},height:{type:Number,default:1080}},emits:["ready","exit"],setup(s,{emit:t}){const e=kn(),n=Bn(),i=Dt(),o=s,r={setItem(l,c){c!==void 0&&window.localStorage.setItem(l,JSON.stringify(c))},getItem(l){let c=window.localStorage.getItem(l);return JSON.parse(c)},removeItem(l){window.localStorage.removeItem(l)},clear(){window.localStorage.clear()}},a={async getAllMenus(){var c;let l=[];return(c=o.services)!=null&&c.getAllMenus?l=await o.services.getAllMenus()||[]:l=r.getItem("menus")||[{id:"1",parentId:"0",name:"首页",children:[{id:crypto.randomUUID(),parentId:"1",name:"首页概览",style:{},value:{}}]}],r.setItem("menus",l),l},async getMenu(l){var c;if((c=o.services)!=null&&c.getMenu)return await o.services.getMenu(l)||{};{let h=r.getItem("menus")||[];for(let u of h)if(u.children){for(let d of u.children)if(d.id===l)return d}return{}}},async addMenu({parent:l,parentNameNew:c,name:h}){var u;if((u=o.services)!=null&&u.addMenu)return await o.services.addMenu({parent:l,parentNameNew:c,name:h});{let d=r.getItem("menus")||[],f=null,p=crypto.randomUUID(),m="";if(l==="0")m=crypto.randomUUID(),f={name:h,id:p,parentId:m,style:{},value:{}},d.push({name:c,id:m,parentId:"0",children:[f]});else{const b=d.find(y=>y.id===l);b&&(m=b.id,b.children.push({name:h,id:p,parentId:m,style:{},value:{}}),f={name:h,id:p,parentId:m,style:{},value:{}})}return r.setItem(p,f),r.setItem("menus",d),f}},async saveMenus(l){var h;const c=await this.getMenu(l.id);if(c&&(c.name=l.name,c.style=l.style,c.value=l.value),(h=o.services)!=null&&h.saveMenus)await o.services.saveMenus(l);else{let u=r.getItem("menus")||[];for(let d of u){const f=d.children.findIndex(p=>p.id===l.id);f>-1&&(d.children[f]=l)}r.setItem("menus",u),r.setItem(l.id,l)}},async removeMenu(l){var c;if((c=o.services)!=null&&c.removeMenu)await o.services.removeMenu(l);else{let h=r.getItem("menus")||[];if(this.getMenu(l)){const d=h.find(f=>{var p;return(p=f.children)==null?void 0:p.some(m=>m.id===l)});d&&(d.children=d.children.filter(f=>f.id!==l),d.children.length===0&&(h=h.filter(f=>f.id!==d.id))),r.setItem("menus",h)}r.removeItem(l)}},async getDeviceList(){var c;let l=[];return(c=o.services)!=null&&c.getDeviceList?l=await o.services.getDeviceList():(l=[{id:"2010960121314734082",deviceName:"干接点",deviceType:"OTHERS",deviceNo:"DIDO",templateName:"DIDO_test.json",templateId:"2010957702564474882",children:[{id:"2010957702568669185",templateId:"2010957702564474882",tag:"en_sts",name:"使能STS",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0001, uint, AB]",description:"0:失能;1:启动使能;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863489",templateId:"2010957702564474882",tag:"connect_statu",name:"电网闸",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0002, uint, AB]",description:"0:断开;1:闭合;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863490",templateId:"2010957702564474882",tag:"icb_sign",name:"外源断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0003, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863491",templateId:"2010957702564474882",tag:"icb_ctrl",name:"外源断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0004, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863492",templateId:"2010957702564474882",tag:"lcb_sign",name:"负载断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0005, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863493",templateId:"2010957702564474882",tag:"lcb_ctrl",name:"负载断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0006, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863494",templateId:"2010957702564474882",tag:"dg_sign",name:"发动机启停状态",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0007, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863495",templateId:"2010957702564474882",tag:"dg_ctrl",name:"发动机控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0008, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863496",templateId:"2010957702564474882",tag:"ats",name:"ATS反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0009, uint, AB]",description:"0:合闸柴发;1:合闸电网;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null}]}],l.forEach(h=>{h.name=h.deviceName})),l}};return g.provide("topoApi",a),g.onMounted(()=>{}),g.onBeforeUnmount(()=>{e.$reset(),n.$reset(),i.$reset()}),(l,c)=>(g.openBlock(),g.createElementBlock("div",Sv,[g.createElementVNode("div",Mv,[g.createVNode(av),g.createVNode(Ex,{width:o.width,height:o.height},null,8,["width","height"]),g.createVNode(Ev)])]))}}),Cd=kt({__name:"preview",props:{menu:{type:Object,required:!0}},setup(s){const t=s,e=g.ref(null);let n=null;const i=Mr();return g.watch(()=>t.menu,o=>{n&&(n.clearCells(),n.resize(o.style.width,o.style.height),n.fromJSON(o.value),n.drawBackground({color:o.style.backgroundColor,image:o.style.backgroundImage,size:"cover"}))},{deep:!0}),g.onMounted(()=>{const{width:o,height:r}=t.menu.style;n=new S({container:e.value,width:o,height:r,interacting:!1,selecting:!1,keyboard:!1,mousewheel:!1,panning:!1}),kr(),n.fromJSON(t.menu.value),n.drawBackground({color:t.menu.style.backgroundColor,image:t.menu.style.backgroundImage,size:"cover"})}),g.onBeforeUnmount(()=>{n&&n.dispose()}),(o,r)=>(g.openBlock(),g.createElementBlock("div",{class:"previewBox",onClick:r[0]||(r[0]=(...a)=>o.close&&o.close(...a))},[g.createElementVNode("div",{ref_key:"container",ref:e,class:"ems-preview"},null,512),g.createVNode(g.unref(i))]))}},[["__scopeId","data-v-d961a1ef"]]);window._iconfont_svg_string_5087053='<svg><symbol id="icon-jiesuo1" viewBox="0 0 1024 1024"><path d="M768.25422 0q48.810328 0 94.061569 18.303873t80.333664 50.33565 56.436941 74.740814 21.354518 91.519364l0 150.49851-123.042701 0 0-122.025819q0-64.063555-36.099305-99.654419t-97.112214-35.590864q-54.911619 0-88.468719 35.590864t-33.5571 99.654419l0 124.059583-128.12711 0 0-152.532274q0-48.810328 19.320755-91.519364t53.386296-74.740814 80.333664-50.33565 101.179742-18.303873zM766.220457 693.513406l0 87.451837 0 47.793446q0 27.455809-9.660377 51.860973t-26.438928 41.692155-39.658391 27.455809-50.33565 10.168818l-514.542205 0q-27.455809 0-49.82721-9.660377t-38.641509-26.438928-24.913605-39.14995-8.643496-47.793446l0-323.368421q0-28.472691 19.829196-47.793446t46.268123-19.320755l629.449851 0q28.472691 0 47.793446 19.320755t19.320755 47.793446l0 179.988083z" ></path></symbol><symbol id="icon-jianlizuhe1" viewBox="0 0 1024 1024"><path d="M891.8 65h-632c-35.5 0-64.4 28.8-64.4 64.4v125.3h-66.3c-35.5 0-64.4 28.8-64.4 64.4v575.6c0 35.5 28.8 64.4 64.4 64.4h572.6c35.5 0 64.4-28.8 64.4-64.4v-65.3h125.6c35.5 0 64.4-28.8 64.4-64.4V129.4c0.1-35.6-28.7-64.4-64.3-64.4zM702.2 894.6v0.1c0 0.1-0.2 0.2-0.2 0.2H129.1c-0.1 0-0.2-0.2-0.2-0.2V319v-0.1c0-0.1 0.2-0.2 0.2-0.2h0.1l66.3 0.1S194 794.1 194 797.4c0 17.7 14.3 32 32 32h476.2v65.2zM259.5 129.2c0-0.1 0.2-0.2 0.2-0.2h632.2c0.1 0 0.2 0.2 0.2 0.2V765.1c0 0.1-0.2 0.2-0.2 0.2H259.5V129.2z" ></path></symbol><symbol id="icon-suoding1" viewBox="0 0 1024 1024"><path d="M860.069521 429.487623h-73.242947v-170.422692C786.826574 116.337371 670.888872 0.272064 528.240764 0.272064c-142.650515 0-258.720638 116.065307-258.720638 258.792867v170.422692H196.339779c-35.281619 0-63.879618 28.612445-63.879618 63.91814v466.606275c0 35.368294 28.597999 63.983146 63.879618 63.983147h663.79234c35.29125 0 63.821834-28.614852 63.821835-63.983147V493.405763c-0.004815-35.310511-28.590776-63.91814-63.884433-63.91814zM564.114664 738.867504v101.889098c0 4.552855-3.765556 8.388233-8.385825 8.388233h-54.91355c-4.678053 0-8.446016-3.837785-8.446017-8.388233v-101.889098c-25.800316-13.201114-43.672259-39.665939-43.672259-70.68362 0-43.888947 35.613874-79.584681 79.481153-79.584682 43.932285 0 79.548567 35.695734 79.548566 79.584682 0.062599 31.020089-17.811752 57.482507-43.612068 70.68362z m123.476036-309.379881H368.883605v-166.202091c0-87.912723 71.55278-159.501618 159.417351-159.501618s159.287337 71.588895 159.287337 159.501618l0.002407 166.202091z" ></path></symbol><symbol id="icon-xingzhuang-juxing" viewBox="0 0 1024 1024"><path d="M864 896H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h704a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zM192 832h640V192H192v640z" ></path></symbol><symbol id="icon-shuzhi" viewBox="0 0 1024 1024"><path d="M921.6 21.162667H102.4c-37.546667 0-68.266667 30.788267-68.266667 68.4032v819.950933c0 37.546667 30.72 68.334933 68.266667 68.334933h819.2c37.546667 0 68.266667-30.72 68.266667-68.266666V89.4976c0-37.546667-30.72-68.334933-68.266667-68.334933z m0 854.2208c0 20.48-13.653333 34.133333-34.133333 34.133333h-750.933334c-20.48 0-34.133333-13.653333-34.133333-34.133333V123.767467c0-20.548267 13.653333-34.2016 34.133333-34.2016h750.933334c20.48 0 34.133333 13.653333 34.133333 34.133333v751.616z" ></path><path d="M274.568533 365.704533h36.0448V658.090667h-47.9232V423.458133a165.546667 165.546667 0 0 1-66.7648 35.6352v-47.5136c13.1072-3.2768 27.0336-9.0112 41.7792-17.2032 14.7456-9.0112 27.0336-18.432 36.864-28.672z m200.2944-5.7344c28.2624 0 51.6096 8.192 70.0416 24.576 18.0224 16.384 27.0336 37.2736 27.0336 63.488 0 25.3952-9.8304 48.3328-28.672 69.2224-11.4688 12.288-31.9488 27.8528-60.6208 47.104-29.9008 19.6608-47.9232 36.864-54.4768 51.6096h144.1792v42.1888H368.366933c0-29.9008 9.4208-55.7056 29.0816-77.824 10.6496-12.288 33.1776-30.3104 67.1744-53.6576 18.8416-13.1072 31.9488-24.1664 40.1408-32.768 12.6976-14.336 19.2512-29.9008 19.2512-46.2848 0-15.9744-4.5056-27.8528-12.6976-35.6352-8.6016-7.7824-21.2992-11.4688-38.0928-11.4688-18.0224 0-31.5392 6.144-40.5504 18.432-9.0112 11.4688-13.9264 29.0816-14.7456 52.0192H370.005333c0.4096-32.768 9.8304-58.9824 28.672-79.0528 19.2512-21.2992 44.6464-31.9488 76.1856-31.9488z m244.1216 0c29.4912 0 53.6576 6.9632 71.68 21.2992 17.6128 14.336 26.624 33.9968 26.624 59.392 0 31.9488-16.384 53.248-48.7424 63.8976 17.2032 5.3248 30.72 13.1072 39.7312 23.7568a61.986133 61.986133 0 0 1 14.7456 42.5984c0 27.0336-9.4208 49.152-28.2624 66.3552-19.6608 17.6128-45.4656 26.624-77.4144 26.624-30.3104 0-54.8864-7.7824-73.3184-23.3472-20.48-17.2032-31.9488-42.5984-34.4064-75.3664h48.7424c0.8192 18.8416 6.5536 33.5872 18.0224 43.8272 10.24 9.4208 23.7568 14.336 40.5504 14.336 18.432 0 33.1776-5.3248 43.8272-15.5648a47.240533 47.240533 0 0 0 14.336-34.816c0-16.7936-5.3248-29.0816-15.1552-36.864-9.8304-8.192-24.1664-11.8784-43.008-11.8784h-20.48V488.106667h20.48c17.2032 0 30.3104-3.6864 39.3216-11.0592 8.6016-7.3728 13.1072-18.432 13.1072-32.768 0-14.336-4.096-24.9856-11.8784-32.3584-8.6016-7.3728-21.2992-11.0592-38.0928-11.0592-17.2032 0-30.3104 4.096-39.7312 12.6976-9.8304 8.6016-15.5648 21.7088-17.2032 39.3216h-47.104c2.4576-29.4912 13.1072-52.4288 32.768-68.8128 18.432-16.384 42.1888-24.1664 70.8608-24.1664z" ></path></symbol><symbol id="icon-xianduan" viewBox="0 0 1024 1024"><path d="M0.034239 975.503207L976.222236 0l48.400922 48.435162L48.435162 1023.945217z" ></path></symbol><symbol id="icon-yulan" viewBox="0 0 1024 1024"><path d="M512.122 272.146c-247.216 0-412.027 247.216-412.027 247.216s164.811 247.216 412.027 247.216c247.216 0 412.027-247.216 412.027-247.216S759.217 272.146 512.122 272.146z m0 410.207c-90.537 0-163.962-73.424-163.962-163.962s73.424-163.962 163.962-163.962c90.537 0 163.962 73.424 163.962 163.962-0.122 90.658-73.424 163.962-163.962 163.962z m-82.406-163.476c0 21.482 8.86 42.841 24.03 58.012s36.53 24.03 58.012 24.03 42.841-8.86 58.012-24.03c15.17-15.17 24.03-36.53 24.03-58.012s-8.86-42.841-24.03-58.012c-15.17-15.17-36.53-24.03-58.012-24.03s-42.841 8.86-58.012 24.03c-15.17 15.292-24.03 36.53-24.03 58.012z" ></path></symbol><symbol id="icon-tubiao" viewBox="0 0 1024 1024"><path d="M437.996 697.519V586.722H327.195c-61.187 0-110.797 49.61-110.797 110.797 0 61.195 49.61 110.797 110.797 110.797 61.192 0 110.801-49.602 110.801-110.797z m55.399 0c0 91.789-74.411 166.195-166.2 166.195C235.41 863.714 161 789.308 161 697.519c0-91.789 74.41-166.195 166.195-166.195h166.2v166.195z m92.328 0V586.722H696.52c61.195 0 110.796 49.61 110.796 110.797 0 61.195-49.601 110.797-110.796 110.797-61.188 0-110.797-49.602-110.797-110.797z m-55.399 0c0 91.789 74.41 166.195 166.196 166.195 91.789 0 166.199-74.406 166.199-166.195 0-91.789-74.41-166.195-166.199-166.195H530.324v166.195z m-92.328-369.324v110.801H327.195c-61.187 0-110.797-49.61-110.797-110.801 0-61.188 49.61-110.797 110.797-110.797 61.192 0 110.801 49.609 110.801 110.797z m55.399 0c0-91.785-74.411-166.195-166.2-166.195C235.41 162 161 236.41 161 328.195c0 91.789 74.41 166.199 166.195 166.199h166.2V328.195z m92.328 0v110.801H696.52c61.195 0 110.796-49.61 110.796-110.801 0-61.188-49.601-110.797-110.796-110.797-61.188 0-110.797 49.609-110.797 110.797z m-55.399 0C530.324 236.41 604.734 162 696.52 162c91.789 0 166.199 74.41 166.199 166.195 0 91.789-74.41 166.199-166.199 166.199H530.324V328.195z m0 0" ></path></symbol><symbol id="icon-tupian" viewBox="0 0 1024 1024"><path d="M335.36 440.32c38.4 0 71.68-30.72 71.68-71.68 0-38.4-30.72-71.68-71.68-71.68-38.4 0-71.68 30.72-71.68 71.68 2.56 40.96 33.28 71.68 71.68 71.68z m0 0M652.8 396.8L445.44 691.2 337.92 540.16 158.72 793.6h704L652.8 396.8z m0 0" ></path><path d="M934.4 107.52H89.6c-20.48 0-35.84 15.36-35.84 35.84V883.2c0 20.48 15.36 35.84 35.84 35.84h844.8c20.48 0 35.84-15.36 35.84-35.84V143.36c0-20.48-15.36-35.84-35.84-35.84z m-35.84 739.84H125.44V176.64h775.68v670.72h-2.56z m0 0" ></path></symbol><symbol id="icon-wenzi" viewBox="0 0 1024 1024"><path d="M64.1 66v303.7l39.5-1.3c13.6-110.8 102.6-186.4 153.2-199 50.7-12.6 148.3 1.1 148.3 1.1s-1.3 625.2-1.3 669.2c0 44.1-59.3 63-59.3 63l-79 1.3-1.2 55.4h493.1v-54.1h-90.2c-40.8-3.8-65.4-56.7-65.4-56.7l1.1-684.5s61.8-11.3 150.8 5.1c89 16.4 164.3 204.1 164.3 204.1h39.5V66H64.1z" ></path></symbol><symbol id="icon-xinjian" viewBox="0 0 1024 1024"><path d="M618 958.5H202c-44.8 0-81.3-34.1-81.3-76v-740c0-41.9 36.5-76 81.3-76h610.5c44.8 0 81.3 34.1 81.3 76v521.9c0 12.8-10.4 23.1-23.1 23.1s-23.1-10.4-23.1-23.1V142.5c0-16.4-15.7-29.7-35-29.7H202c-19.3 0-35 13.3-35 29.7v740c0 16.4 15.7 29.7 35 29.7h416c12.8 0 23.1 10.4 23.1 23.1 0.1 12.8-10.3 23.2-23.1 23.2z" ></path><path d="M738.4 360.5H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h462.5c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1zM584.3 595.1H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h308.3c12.8 0 23.1 10.4 23.1 23.1 0 12.7-10.3 23.1-23.1 23.1zM878.8 826.3H614.6c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h264.3c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1z" ></path><path d="M746.7 958.5c-12.8 0-23.1-10.4-23.1-23.1V671.1c0-12.8 10.4-23.1 23.1-23.1 12.8 0 23.1 10.4 23.1 23.1v264.3c0 12.7-10.3 23.1-23.1 23.1z" ></path></symbol><symbol id="icon-qingkong" viewBox="0 0 1024 1024"><path d="M274.56 798.997333l19.434667-25.130666-33.792 68.565333a18.133333 18.133333 0 0 0 11.562666 25.536l59.733334 16a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.818667 35.626667-35.989333 45.290666-48.469333l19.456-25.130667-33.813333 68.565333a18.133333 18.133333 0 0 0 11.562667 25.536l84.48 22.634667a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-35.989333 45.269333-48.469333l19.456-25.130667-33.813333 68.565333A18.133333 18.133333 0 0 0 535.530667 938.666667l72.106666 19.328a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-36.010667 45.269334-48.490667l19.456-25.130667-33.813334 68.586667a18.133333 18.133333 0 0 0 11.584 25.514667l86.421334 23.338666 3.84-0.213333c13.269333-0.704 29.056-5.034667 43.84-12.8 29.781333-15.701333 48.170667-43.2 52.181333-78.250667 2.133333-18.517333 4.778667-38.549333 8.405333-63.530666 1.642667-11.221333 2.944-20.010667 6.229334-41.834667 11.050667-73.322667 14.634667-101.034667 17.130666-133.674667l0.938667-12.373333 2.837333-2.922667 12.330667-1.344a41.813333 41.813333 0 0 0 24.810667-11.221333c10.730667-10.24 14.805333-25.386667 11.093333-42.197333l-37.546667-171.584c-3.029333-13.696-11.264-27.946667-23.146666-39.829334-11.648-11.626667-25.92-20.138667-39.893334-23.893333L723.626667 331.306667l-2.261334-3.925334L774.250667 130.133333c8.32-31.061333-11.754667-63.744-44.970667-72.64l-79.509333-21.312c-33.194667-8.896-66.922667 9.365333-75.264 40.426667l-52.842667 197.269333-3.925333 2.261334-118.101334-31.637334c-13.994667-3.754667-30.634667-3.498667-46.506666 0.746667-16.256 4.352-30.506667 12.586667-39.957334 22.933333l-118.314666 129.792c-11.605333 12.714667-15.658667 27.84-11.52 42.090667 4.16 14.229333 15.850667 25.194667 32.896 30.528l13.610666 4.266667 2.133334 3.882666-3.626667 13.802667c-21.12 79.850667-52.885333 136.917333-85.717333 150.890667-47.530667 20.202667-72.938667 49.429333-78.421334 85.034666-5.034667 32.682667 9.28 67.114667 37.589334 91.541334l22.037333 8.341333 74.666667 20.010667a42.666667 42.666667 0 0 0 41.216-11.050667c15.274667-15.274667 26.88-28.032 34.837333-38.293333z m551.381333-396.565333c14.144 3.797333 29.952 19.2 32.768 32l34.56 157.781333a10.666667 10.666667 0 0 1-13.184 12.586667L240.64 433.493333a10.666667 10.666667 0 0 1-5.12-17.493333l108.8-119.36c8.832-9.685333 30.229333-15.146667 44.373333-11.349333l141.333334 37.866666a21.333333 21.333333 0 0 0 26.133333-15.082666l58.304-217.642667a21.333333 21.333333 0 0 1 26.133333-15.082667l77.056 20.650667a21.333333 21.333333 0 0 1 15.082667 26.133333l-58.325333 217.642667a21.333333 21.333333 0 0 0 15.082666 26.112l136.448 36.565333zM315.456 701.568c-33.664 45.141333-64.597333 79.082667-92.8 101.802667l-5.909333 4.778666-2.837334 0.597334-88.106666-24.106667-2.922667-3.2c-13.034667-14.165333-19.370667-31.04-16.981333-46.592 3.285333-21.333333 22.058667-39.338667 53.205333-52.586667 31.722667-13.482667 59.818667-47.104 82.922667-99.904 10.026667-22.954667 18.88-48.725333 26.389333-76.586666l3.882667-14.4 3.904-2.261334 566.165333 151.701334 2.346667 3.306666-0.789334 12.224c-1.984 30.592-30.336 229.397333-32.128 244.906667-2.346667 20.416-11.306667 34.986667-27.605333 44.394667a73.237333 73.237333 0 0 1-21.397333 8.106666l-5.013334 0.725334-60.373333-16.170667 11.242667-20.288c8.277333-14.976 22.656-43.84 43.093333-86.613333a21.12 21.12 0 0 0-9.962667-28.16l-3.136-1.493334a21.333333 21.333333 0 0 0-26.261333 6.485334c-33.642667 45.056-64.533333 78.912-92.672 101.546666l-5.909333 4.757334-2.837334 0.597333-52.544-14.08 11.114667-20.266667c3.562667-6.485333 7.04-13.013333 10.453333-19.626666 7.04-13.504 17.898667-35.797333 32.597334-66.816a21.290667 21.290667 0 0 0-9.984-28.309334l-3.029334-1.450666a21.333333 21.333333 0 0 0-26.368 6.442666c-33.6 45.013333-64.469333 78.826667-92.608 101.482667l-5.909333 4.757333-2.837333 0.597334-52.138667-13.973334 11.114667-20.266666c3.242667-5.888 6.72-12.416 10.453333-19.626667 6.997333-13.461333 17.962667-35.946667 32.896-67.434667a20.970667 20.970667 0 0 0-10.112-28.010666l-3.328-1.536a21.333333 21.333333 0 0 0-26.069333 6.613333c-33.642667 45.056-64.554667 78.976-92.778667 101.696l-5.909333 4.757333-2.837334 0.597334-32.64-8.746667 11.093334-20.245333c3.541333-6.506667 7.04-13.034667 10.453333-19.626667 6.976-13.482667 17.941333-35.968 32.874667-67.456a21.056 21.056 0 0 0-10.069334-28.074667l-3.242666-1.514666a21.333333 21.333333 0 0 0-26.154667 6.549333z" ></path></symbol><symbol id="icon-shanchu" viewBox="0 0 1024 1024"><path d="M202.666667 256h-42.666667a32 32 0 0 1 0-64h704a32 32 0 0 1 0 64H266.666667v565.333333a53.333333 53.333333 0 0 0 53.333333 53.333334h384a53.333333 53.333333 0 0 0 53.333333-53.333334V352a32 32 0 0 1 64 0v469.333333c0 64.8-52.533333 117.333333-117.333333 117.333334H320c-64.8 0-117.333333-52.533333-117.333333-117.333334V256z m224-106.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z m-32 288a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z m170.666666 0a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z" ></path></symbol><symbol id="icon-jia" viewBox="0 0 1024 1024"><path d="M580.722174 437.990403 580.722174 78.171384 436.794158 78.171384 436.794158 437.990403 76.975139 437.990403 76.975139 581.918419 436.794158 581.918419 436.794158 941.737438 580.722174 941.737438 580.722174 581.918419 940.542216 581.918419 940.542216 437.990403Z" ></path></symbol><symbol id="icon-baocun" viewBox="0 0 1024 1024"><path d="M814.805 128a51.179 51.179 0 0 1 51.179 51.179V844.01a51.179 51.179 0 0 1-51.179 51.157H201.173a51.179 51.179 0 0 1-51.178-51.157V179.179A51.179 51.179 0 0 1 201.173 128h613.654zM329.024 434.837a51.093 51.093 0 0 1-51.179-51.093V179.157h-76.672v664.854h613.76V179.179H738.22v204.48a51.179 51.179 0 0 1-51.179 51.178H329.024z m0-51.093h357.995V179.157H329.024v204.587z m357.91 204.501a25.557 25.557 0 1 1 0.085 51.072H329.024a25.536 25.536 0 1 1 0-51.072h357.91z" ></path></symbol><symbol id="icon-daochu" viewBox="0 0 1024 1024"><path d="M293.632 645.248c91.456-86.784 183.552-220.544 346.88-211.584a20.8 20.8 0 0 1 20.224 20.8v59.392a21.376 21.376 0 0 0 34.432 16.64l211.2-171.2a21.376 21.376 0 0 0 0-33.28l-210.24-192a21.952 21.952 0 0 0-35.648 16.64v60.096a20.8 20.8 0 0 1-17.856 20.8c-280.704 61.76-351.36 391.104-348.992 413.696zM192 960a138.176 138.176 0 0 1-129.984-152.512L64 832V192a116.48 116.48 0 0 1 128-128c-108.8 1.024 256 0 256 0a28.224 28.224 0 0 1 29.76 27.84A35.968 35.968 0 0 1 448 128H192a53.12 53.12 0 0 0-64 64c1.536-37.504 0 640 0 640a52.8 52.8 0 0 0 64 64c49.536-0.448 640 0 640 0a52.48 52.48 0 0 0 64-64c-0.64 105.152 0-256 0-256a36.48 36.48 0 0 1 27.264-38.4A33.216 33.216 0 0 1 960 576v256a116.48 116.48 0 0 1-128 128c-50.56-0.448-640 0-640 0z" ></path></symbol><symbol id="icon-daoru" viewBox="0 0 1024 1024"><path d="M512 384a42.666667 42.666667 0 0 1 42.666667 42.666667v341.333333h130.986666a21.333333 21.333333 0 0 1 14.250667 5.504l2.688 2.901333a21.333333 21.333333 0 0 1-4.010667 29.866667l-165.717333 126.464a32 32 0 0 1-38.912-0.042667l-164.48-126.464A21.333333 21.333333 0 0 1 342.442667 768H469.333333v-341.333333a42.666667 42.666667 0 0 1 42.666667-42.666667z m229.674667 298.368A42.666667 42.666667 0 0 1 746.666667 597.333333H853.333333V170.666667H170.666667v426.666666h106.666666a42.666667 42.666667 0 0 1 0 85.333334H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333334-85.333334h682.666666a85.333333 85.333333 0 0 1 85.333334 85.333334v426.666666a85.333333 85.333333 0 0 1-85.333334 85.333334h-106.666666z" ></path></symbol><symbol id="icon-huanyuan" viewBox="0 0 1024 1024"><path d="M909.637 478.524c-15.444-189.946-167.065-345.049-356.655-364.38-99.805-10.176-193.011 16.474-267.901 67.887l18.467-68.842c5.725-21.337-6.933-43.274-28.27-48.998s-43.274 6.934-48.998 28.271l-41.455 154.536c-5.724 21.337 6.933 43.273 28.271 48.998l154.536 41.455c21.337 5.724 43.273-6.934 48.998-28.271 5.724-21.337-6.934-43.274-28.271-48.998l-54.194-14.538c58.917-39.301 131.457-59.686 208.999-52.061 147.885 14.543 268.327 132.461 285.589 280.053 23.02 196.82-133.879 363.973-327.45 358.219-135.107-4.017-252.98-96.111-294.938-224.602-17.513-53.632-18.92-105.027-9.92-152.849 3.188-16.946-4.238-34.086-19.172-42.707l-0.049-0.028c-23.737-13.705-54.358-0.164-59.404 26.777-7.724 41.233-9.128 84.686-2.965 129.403 25.571 185.535 181.03 330.336 367.878 343.176C727.656 927.857 929.6 724.049 909.637 478.524z" ></path></symbol><symbol id="icon-menu-fold" viewBox="0 0 1024 1024"><path d="M85.312 170.688h853.376V256H85.312V170.688z m0 179.328L266.752 512l-181.44 162.048V349.952zM384 469.312h554.688v85.376H384V469.248zM85.312 768h853.376v85.312H85.312V768z" ></path></symbol><symbol id="icon-icon_image" viewBox="0 0 1024 1024"><path d="M85.333333 852.992V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666h768a42.666667 42.666667 0 0 1 42.666667 42.666666v640a42.666667 42.666667 0 0 1-42.666667 42.666667H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-0.341333z m768-157.610667V256H170.666667v493.994667l127.744-127.744a42.666667 42.666667 0 0 1 47.018666-9.045334l126.293334 54.314667 184.789333-146.346667a42.666667 42.666667 0 0 1 59.52 6.485334L853.333333 695.381333zM837.418667 810.666667l-160.853334-196.48-171.818666 136.021333a42.666667 42.666667 0 0 1-43.349334 5.76l-123.093333-52.906667L230.656 810.666667h606.762667zM341.333333 512a85.333333 85.333333 0 1 1 0-170.666667 85.333333 85.333333 0 0 1 0 170.666667z" ></path></symbol><symbol id="icon-icon_chart" viewBox="0 0 1024 1024"><path d="M128 864V128H96v768h896v-32H128z" ></path><path d="M225.6 352h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V385.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M417.6 128h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V161.6A33.6 33.6 0 0 1 417.6 128z" ></path><path d="M609.6 544h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V577.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M801.6 704h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128v-62.4a33.6 33.6 0 0 1 33.6-33.6z" ></path></symbol><symbol id="icon-jichukongjian" viewBox="0 0 1024 1024"><path d="M912 662.016l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 662.016c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.84 271.872 163.072c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.872-163.136 59.712 35.84c19.456 11.712 19.456 30.592 0 42.24z" ></path><path d="M912 501.12l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 501.12c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.904 271.872 163.136c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.936-163.2 59.712 35.904c19.392 11.712 19.392 30.656 0 42.24z" ></path><path d="M912 340.224L559.744 551.68c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 340.224c-19.456-11.584-19.456-30.592 0-42.24l352.32-211.456c9.728-5.76 22.528-8.704 35.2-8.704 12.736 0 25.472 2.88 35.2 8.704l352.32 211.456c19.456 11.648 19.456 30.656 0 42.24z" ></path></symbol><symbol id="icon-icon-relativity" viewBox="0 0 1024 1024"><path d="M352 352v-192a64 64 0 0 1 64-64h448a64 64 0 0 1 64 64v448a64 64 0 0 1-64 64h-192v192a64 64 0 0 1-64 64h-448a64 64 0 0 1-64-64v-448a64 64 0 0 1 64-64h192z m64-192v192h192a64 64 0 0 1 64 64v192h192v-448h-448z m192 512h-192a64 64 0 0 1-64-64v-192h-192v448h448v-192z m0-64v-192h-192v192h192z" ></path></symbol><symbol id="icon-root-list" viewBox="0 0 1024 1024"><path d="M85.333333 85.333333h853.333334v853.333334H85.333333V85.333333z m85.333334 85.333334v682.666666h682.666666V170.666667H170.666667z m85.333333 149.333333h512v85.333333H256v-85.333333z m0 170.666667h341.333333v85.333333H256v-85.333333z" ></path></symbol><symbol id="icon-control-platform" viewBox="0 0 1024 1024"><path d="M512 36.48l426.688 237.056v476.928L512 987.456l-426.688-236.992V273.536L512 36.544zM170.688 379.52v320.704l298.624 165.952V537.6l-298.624-158.08z m384 486.656l298.624-165.952v-320.64L554.688 537.6v328.512zM512 463.744l303.744-160.832L512 134.144 208.256 302.912 512 463.744z" ></path></symbol><symbol id="icon-icon-yonghu" viewBox="0 0 1024 1024"><path d="M511.744 96a253.184 253.184 0 0 1 252.8 252.928c0 91.904-49.216 172.544-122.688 216.832 146.24 50.24 253.632 181.824 253.632 331.584a32 32 0 0 1-64 0c0-156.864-146.432-289.408-319.744-289.408C338.432 607.936 192 740.48 192 897.344a32 32 0 0 1-64 0c0-149.76 107.328-281.28 253.568-331.648a252.992 252.992 0 0 1-122.752-216.768A253.184 253.184 0 0 1 511.744 96z m0 64a189.12 189.12 0 0 0-188.928 188.928 189.12 189.12 0 0 0 188.928 188.928 189.12 189.12 0 0 0 188.8-188.928A189.12 189.12 0 0 0 511.808 160z" ></path></symbol><symbol id="icon-a-shezhi" viewBox="0 0 1024 1024"><path d="M933.868272 511.691752a140.807706 140.807706 0 0 1 90.131728-131.067068 525.562914 525.562914 0 0 0-57.334136-138.64997 139.882962 139.882962 0 0 1-184.948826-184.948826A525.562914 525.562914 0 0 0 643.067068 0a140.376159 140.376159 0 0 1-262.134136 0A525.562914 525.562914 0 0 0 242.282962 57.334136a139.882962 139.882962 0 0 1-184.948826 184.948826A506.698134 506.698134 0 0 0 0 380.932932a140.376159 140.376159 0 0 1 0 262.134136 525.562914 525.562914 0 0 0 57.334136 138.64997 139.882962 139.882962 0 0 1 184.948826 184.948826 525.562914 525.562914 0 0 0 138.64997 57.334136 140.376159 140.376159 0 0 1 262.134136 0 525.562914 525.562914 0 0 0 138.64997-57.334136 139.882962 139.882962 0 0 1 184.948826-184.948826 506.698134 506.698134 0 0 0 57.334136-138.64997A140.807706 140.807706 0 0 1 933.868272 511.691752zM511.691752 652.437809A140.437809 140.437809 0 1 1 652.437809 511.691752 140.499458 140.499458 0 0 1 511.691752 652.437809z" ></path></symbol></svg>',(s=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var n,i,o,r,a,l=function(u,d){d.parentNode.insertBefore(u,d)};if(t&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=s._iconfont_svg_string_5087053,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=n,r=s.document,a=!1,h(),r.onreadystatechange=function(){r.readyState=="complete"&&(r.onreadystatechange=null,c())})}function c(){a||(a=!0,o())}function h(){try{r.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Bv=[Tr],Ds=s=>{!s||Ds.installed||(s.use(Xt),Bv.forEach(t=>{const e=t.name||t.__name;e&&s.component(e,t)}),Ds.installed=!0)},kv={install:Ds,EmsEditor:Tr,EmsPreview:Cd};ot.EmsEditor=Tr,ot.EmsPreview=Cd,ot.default=kv,ot.install=Ds,Object.defineProperties(ot,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
807
|
+
`,xd="has-widget-transform",Bn=["nw","n","ne","e","se","s","sw","w"],qe=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],px={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0};class vd extends Jt{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(t,e,n){super(),this.node=e,this.graph=n,this.options=Object.assign(Object.assign({},px),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const t=document.createElement("div");W(t,"draggable","false");const e=t.cloneNode(!0);L(e,this.rotateClassName);const n=qe.map(s=>{const o=t.cloneNode(!0);return L(o,this.resizeClassName),W(o,"data-position",s),o});this.empty(),Ot(this.container,[...n,e])}render(){return this.renderHandles(),this.view&&this.view.addClass(xd),L(this.container,this.containerClassName),re(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),re(this.container,"no-resize",!this.options.resizable),re(this.container,"no-rotate",!this.options.rotatable),this.options.className&&L(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=Qt(this.node.getAngle()),s=n!==0?`rotate(${n}deg)`:"";return nt(this.container,{transform:s,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(xd),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Qt(this.node.getAngle()),e=Math.floor(t*(Bn.length/360));if(e!==this.prevShift){const n=Bn.slice(e).concat(Bn.slice(0,e)),s=r=>`${this.containerClassName}-cursor-${r}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((r,a)=>{at(r,Bn.map(l=>s(l)).join(" ")),L(r,s(n[a]))}),this.prevShift=e}}getTrueDirection(t){const e=Qt(this.node.getAngle());let n=qe.indexOf(t);return n+=Math.floor(e*(qe.length/360)),n%=qe.length,qe[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=W(t.target,"data-position");this.prepareResizing(t,e),this.startAction(t)}prepareResizing(t,e){const n=this.getTrueDirection(e);let s=0,o=0;e.split("-").forEach(c=>{s={left:-1,right:1}[c]||s,o={top:-1,bottom:1}[c]||o});const r=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[r],l=Qt(this.node.getAngle());this.setEventData(t,{selector:a,direction:r,trueDirection:n,relativeDirection:e,angle:l,resizeX:s,resizeY:o,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.node.getBBox().getCenter(),n=this.normalizeEvent(t),s=this.graph.snapToGrid(n.clientX,n.clientY);this.setEventData(t,{center:e,action:"rotating",angle:Qt(this.node.getAngle()),start:A.create(s).theta(e)}),this.startAction(t)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const s=this.normalizeEvent(t);let o=s.clientX,r=s.clientY;const a=this.graph.getPlugin("scroller"),l=this.options.restrictedResizing;if(l===!0||typeof l=="number"){const f=l===!0?0:l,m=a?Math.max(f,8):f,p=this.graph.container.getBoundingClientRect();o=Je(o,p.left+m,p.right-m),r=Je(r,p.top+m,p.bottom-m)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,r);const c=this.graph.snapToGrid(o,r),h=this.graph.getGridSize(),u=this.node,d=this.options;if(n.action==="resizing"){n=n,n.resized||(e&&(e.addClass("node-resizing"),this.notify("node:resize",t,e)),n.resized=!0);const f=u.getBBox(),m=A.create(c).rotate(n.angle,f.getCenter()).diff(f[n.selector]);let p=n.resizeX?m.x*n.resizeX:f.width,b=n.resizeY?m.y*n.resizeY:f.height;const y=p,C=b;if(p=oe(p,h),b=oe(b,h),p=Math.max(p,d.minWidth||h),b=Math.max(b,d.minHeight||h),p=Math.min(p,d.maxWidth||1/0),b=Math.min(b,d.maxHeight||1/0),d.preserveAspectRatio){const x=f.width*b/f.height,E=f.height*p/f.width;p<x?b=E:p=x}const w=n.relativeDirection;if(d.allowReverse&&(y<=-p||C<=-b)){let x;w==="left"?y<=-p&&(x="right"):w==="right"?y<=-p&&(x="left"):w==="top"?C<=-b&&(x="bottom"):w==="bottom"?C<=-b&&(x="top"):w==="top-left"?y<=-p&&C<=-b?x="bottom-right":y<=-p?x="top-right":C<=-b&&(x="bottom-left"):w==="top-right"?y<=-p&&C<=-b?x="bottom-left":y<=-p?x="top-left":C<=-b&&(x="bottom-right"):w==="bottom-left"?y<=-p&&C<=-b?x="top-right":y<=-p?x="bottom-right":C<=-b&&(x="top-left"):w==="bottom-right"&&(y<=-p&&C<=-b?x="top-left":y<=-p?x="bottom-left":C<=-b&&(x="top-right"));const E=x;this.stopHandle();const S=this.container.querySelector(`.${this.resizeClassName}[data-position="${E}"]`);this.startHandle(S),this.prepareResizing(t,E),this.onMouseMove(t)}if(f.width!==p||f.height!==b){const x={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:d.preserveAspectRatio===!0};u.resize(p,b,x),this.notify("node:resizing",t,e)}}else if(n.action==="rotating"){n=n,n.rotated||(e&&(e.addClass("node-rotating"),this.notify("node:rotate",t,e)),n.rotated=!0);const f=u.getAngle(),m=n.start-A.create(c).theta(n.center);let p=n.angle+m;d.rotateGrid&&(p=oe(p,d.rotateGrid)),p=Qt(p),f!==p&&(u.rotate(p,{absolute:!0}),this.notify("node:rotating",t,e))}}}onMouseUp(t){const e=this.getEventData(t);e.action&&(this.stopAction(t),this.model.stopBatch(e.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(t){if(this.handle=t||null,L(this.container,`${this.containerClassName}-active`),t){L(t,`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const n=Bn[qe.indexOf(e)];L(this.container,`${this.containerClassName}-cursor-${n}`)}}}stopHandle(){if(at(this.container,`${this.containerClassName}-active`),this.handle){at(this.handle,`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=Bn[qe.indexOf(t)];at(this.container,`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(yu,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass(`node-${n.action}`),n.action==="resizing"&&n.resized?this.notify("node:resized",t,e):n.action==="rotating"&&n.rotated&&this.notify("node:rotated",t,e))}notify(t,e,n,s={}){if(n){const o=n.graph,r=o.view.normalizeEvent(e),a=o.snapToGrid(r.clientX,r.clientY);this.trigger(t,Object.assign({e:r,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},s))}}dispose(){this.stopListening(),this.remove(),this.off()}}X([$()],vd.prototype,"dispose",null),B.prototype.createTransformWidget=function(i){const t=this.getPlugin("transform");return t&&t.createWidget(i),this},B.prototype.clearTransformWidgets=function(){const i=this.getPlugin("transform");return i&&i.clearWidgets(),this};class Ed extends zt{constructor(t={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=t,Be(this.name,fx)}init(t){this.graph=t,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(t){this.clearWidgets();const e=this.createTransform(t);e&&(this.widgets.set(t,e),e.on("*",(n,s)=>{this.trigger(n,s),this.graph.trigger(n,s)}))}onNodeClick({node:t}){this.createWidget(t)}onBlankMouseDown(){this.clearWidgets()}createTransform(t){const e=this.getTransformOptions(t);return e.resizable||e.rotatable?new vd(e,t,this.graph):null}parseOptionGroup(t,e,n){const s={};return Object.keys(n||{}).forEach(o=>{const r=n[o];s[o]=typeof r=="function"?r.call(t,e):r}),s}getTransformOptions(t){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const e=this.parseOptionGroup(this.graph,t,this.options.resizing),n=this.parseOptionGroup(this.graph,t,this.options.rotating);return{resizable:!!e.enabled,minWidth:e.minWidth||0,maxWidth:e.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:e.minHeight||0,maxHeight:e.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof e.orthogonal=="boolean"?e.orthogonal:!0,restrictedResizing:!!e.restrict,autoScrollOnResizing:typeof e.autoScroll=="boolean"?e.autoScroll:!0,preserveAspectRatio:!!e.preserveAspectRatio,allowReverse:typeof e.allowReverse=="boolean"?e.allowReverse:!0,rotatable:!!n.enabled,rotateGrid:n.grid||15}}clearWidgets(){this.widgets.forEach((t,e)=>{this.graph.getCellById(e.id)&&t.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),ke(this.name)}}X([$()],Ed.prototype,"dispose",null);function Sd(i){const t=Dt.getForeignObjectMarkup();return i?[{tagName:i,selector:"body"},t]:[t]}B.registerNode("vue-shape",{view:"vue-shape-view",markup:Sd(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(i){if(i.markup==null){const t=i.primer;if(t){i.markup=Sd(t);let e={};switch(t){case"circle":e={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":e={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}i.attrs=pt({},{body:Object.assign({refWidth:null,refHeight:null},e)},i.attrs||{})}}return i}},!0);var mx=function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(e[n[s]]=i[n[s]]);return e};const Md={};function bx(i){const{shape:t,component:e,inherit:n}=i,s=mx(i,["shape","component","inherit"]);if(!t)throw new Error("should specify shape in config");Md[t]={component:e},B.registerNode(t,Object.assign({inherit:n||"vue-shape"},s),!0)}let Ii=!1;const Vs=g.reactive({});function yx(i,t,e,n,s){Ii&&(Vs[i]=g.markRaw(g.defineComponent({render:()=>g.h(g.Teleport,{to:e},[g.h(t,{node:n,graph:s})]),provide:()=>({getNode:()=>n,getGraph:()=>s})})))}function wx(i){Ii&&delete Vs[i]}function Bd(){return Ii}let zs=null;function Rr(){return zs&&Ii?null:(Ii=!0,zs=g.defineComponent({setup(){return g.onBeforeUnmount(()=>{zs=null}),()=>g.h(g.Fragment,{},Object.keys(Vs).map(i=>g.h(Vs[i])))}}),zs)}class Xe extends $t{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,Xe.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,n=this.graph;if(t){const{component:s}=Md[e.shape];s&&(Bd()?yx(this.targetId(),s,t,e,n):(this.vm=g.createApp({render(){return g.h(s,{node:e,graph:n})},provide(){return{getNode:()=>e,getGraph:()=>n}}}),this.vm.mount(t)))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,e,n){const s=t.target;if(s.tagName.toLowerCase()==="input"){const r=s.getAttribute("type");if(r==null||["text","password","number","email","search","tel","url"].includes(r))return}super.onMouseDown(t,e,n)}unmount(){return Bd()&&wx(this.targetId()),this.unmountVueComponent(),super.unmount(),this}}Xe.action="vue",Xe.config({bootstrap:[Xe.action],actions:{component:Xe.action}}),$t.registry.register("vue-shape-view",Xe,!0);const kt=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},Cx=kt({__name:"vueNode",setup(i){g.useCssVars(l=>({d8dfc212:n.value.color,v6be3529f:n.value.opacity,v324d6579:n.value.borderStyle,v6de6f73f:n.value.borderWidth+"px",v3169772b:n.value.borderColor,v28e858fa:n.value.borderRadius+"px",v2fb97d69:n.value.backgroundColor}));let e=g.inject("getNode")();const n=g.ref(e.getData()),s=g.ref(128),o=g.ref(128),r=({current:l})=>{s.value=l.width,o.value=l.height},a=({current:l})=>{n.value={...n.value,...l}};return g.provide("x6NodeData",n),g.provide("width",s),g.provide("height",o),g.onMounted(()=>{s.value=e.size().width,o.value=e.size().height,e.on("change:data",a),e.on("change:size",r)}),g.onBeforeUnmount(()=>{e.off("change:data",a),e.off("change:size",r)}),(l,c)=>(g.openBlock(),g.createElementBlock("div",{style:g.normalizeStyle({width:s.value+"px",height:o.value+"px",backgroundImage:n.value.backgroundImage&&n.value.backgroundImage!=="none"?`url(${n.value.backgroundImage})`:"none"}),class:"vueNode"},[g.renderSlot(l.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-c87e42ba"]]),Ax={class:"svgNode"},xx=["xlink:href"],vx=kt({__name:"svgNode",setup(i){g.inject("getNode");const t=g.inject("width"),e=g.inject("height"),n=g.inject("x6NodeData"),s=g.computed(()=>{var o;return{fontSize:`${Math.min(t.value,e.value)}px`,color:((o=n.value)==null?void 0:o.color)||"#ffffff"}});return g.onMounted(()=>{}),g.onBeforeUnmount(()=>{}),(o,r)=>(g.openBlock(),g.createElementBlock("div",Ax,[(g.openBlock(),g.createElementBlock("svg",{class:"svg-icon","aria-hidden":"true",style:g.normalizeStyle(s.value)},[g.createElementVNode("use",{"xlink:href":"#"+g.unref(n).icon},null,8,xx)],4))]))}},[["__scopeId","data-v-88b0fd56"]]),Ex=["title"],Sx=kt({__name:"textNode",setup(i){const t=g.inject("x6NodeData"),e=g.computed(()=>{const s=t.value||{};return{justifyContent:s.justifyContent||"center",alignItems:s.alignItems||"center",padding:s.padding||"0",overflow:s.overflow||"hidden",backgroundColor:"transparent"}}),n=g.computed(()=>{const s=t.value||{},o=s.textOverflow==="ellipsis",r=s.whiteSpace||(o?"nowrap":"pre-wrap"),a=!s.lineHeight&&s.lineHeight!==0?"1.4":typeof s.lineHeight=="number"?s.lineHeight<=10?`${s.lineHeight}`:`${s.lineHeight}px`:s.lineHeight;return{color:s.color||"#ffffff",fontWeight:s.fontWeight||400,fontSize:`${s.fontSize||16}px`,letterSpacing:`${s.letterSpacing||0}px`,fontFamily:s.fontFamily||"inherit",fontStyle:s.fontStyle||"normal",textDecoration:s.textDecoration||"none",textAlign:s.textAlign||"center",lineHeight:a,whiteSpace:r,wordBreak:s.wordBreak||"break-word",textOverflow:s.textOverflow||"clip",overflow:"hidden",display:s.display||"block"}});return(s,o)=>(g.openBlock(),g.createElementBlock("div",{class:"textNode",style:g.normalizeStyle(e.value),title:g.unref(t).text},[g.createElementVNode("span",{class:"textContent",style:g.normalizeStyle(n.value)},g.toDisplayString(g.unref(t).text),5)],12,Ex))}},[["__scopeId","data-v-98979c16"]]),Mx={name:"",borderStyle:"none",borderRadius:0,borderWidth:0,borderColor:"#5F95FF",opacity:1,backgroundImage:"none",backgroundColor:"transparent",color:"#ffffff",realData:{},dataSource:{name:[],type:"none",path:"",point:{},httpType:"GET",httpUrl:"",params:[],parse:""},status:[]},Dr={"svg-node":vx,"text-node":Sx},Lr=()=>{Object.keys(Dr).forEach(i=>{bx({shape:i,width:50,height:50,data:{...Mx},component:{render(){return g.h(Cx,null,{default:()=>g.h(Dr[i])})}}})})},kd={Blank:"blank"},kn=pe.defineStore("property",{state:()=>({targetType:kd.Blank,cellId:null,tabs:["画布"],activeTab:0}),getters:{},actions:{setTarget(i,t){this.targetType=i,i===kd.Blank?this.tabs=["画布"]:this.tabs=["外观","数据","动画","状态","交互"],this.activeTab=0,this.cellId=t}}}),Qr={backgroundColor:"#6b6b6b26",backgroundImage:null},Ut=pe.defineStore("editor-graph",{state:()=>({el:null,graph:null,dnd:null,style:{...Qr,width:1920,height:1080},name:"",id:"",zoom:100}),getters:{hasGraph:i=>!!i.graph},actions:{init(){if(this.el===null)return;this.graph&&this.graph.dispose(),this.graph=new B({container:this.el,autoResize:!0,mousewheel:{enabled:!0,factor:.1},panning:!1,scaling:{min:.5,max:2},background:{color:"#000000"},grid:{size:5,visible:!0,type:"mesh",args:{color:"rgba(100, 100, 100, 0.6)",thickness:1}},translating:{restrict:!0},connecting:{router:"orth",connector:{name:"normal"},args:{padding:0,direction:"H"},anchor:"center",connectionPoint:"anchor",allowBlank:!0,allowLoop:!1,allowMulti:!1,snap:{radius:20},validateConnection({targetMagnet:t}){return!!t}},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{fill:"#5F95FF",stroke:"#5F95FF"}}}}}),this.graph.use(new Ad({enabled:!0}));const i=new yd({pageWidth:this.style.width,pageHeight:this.style.height,enabled:!0,pannable:!0,autoResize:!1});this.graph.use(i),this.dnd=new Pr({target:this.graph,validateNode(){return!0}}),this.graph.use(new Ed({resizing:!0,rotating:!0})),this.graph.use(new Ou({enabled:!0})),this.graph.use(new cd({enabled:!0,global:!0})).use(new dd({rubberband:!0,showNodeSelectionBox:!0,showEdgeSelectionBox:!1,modifiers:["meta","shift","ctrl"]})).use(new sd),Lr(),this.initEvent()},loadMenu({name:i,id:t,value:e,style:n}){if(!this.graph)return;this.name=i,this.id=t,this.graph.fromJSON(e||{}),n?this.style={...this.style,...Qr,...n}:this.style={...this.style,...Qr};const s=Math.min(1280/this.style.width,840/this.style.height);console.log(s,this.style.width,this.style.height),this.graph.zoomTo(s),setTimeout(()=>{this.graph.center(),console.log(this.graph.getScrollbarPosition()),kn().setTarget("blank",null)},100)},setZoom(i){this.zoom=Number(i),this.graph.zoomTo(i)},updateSize(i,t,e){this.style.width=i,this.style.height=t,this.init(),setTimeout(()=>{e&&e()},100)},syncDataToAttrs(i){if(!i||Object.keys(Dr).includes(i.shape))return;const t=i.getData?i.getData()||{}:{},e={dashed:"6 4",dotted:"2 2",solid:null,none:null},n={};t.backgroundColor!==void 0&&(n.fill=t.backgroundColor),t.borderColor!==void 0&&(n.stroke=t.borderColor),t.borderWidth!==void 0&&(n.strokeWidth=t.borderWidth),t.borderStyle!==void 0&&e.hasOwnProperty(t.borderStyle)&&(t.borderStyle==="none"?(n.strokeDasharray=null,n.strokeWidth=0):n.strokeDasharray=e[t.borderStyle]),t.borderRadius!==void 0&&(n.rx=n.ry=t.borderRadius),t.opacity!==void 0&&(n.opacity=t.opacity);const s={};Object.keys(n).length&&(s.body=n),Object.keys(s).length&&i.setAttrs(s)},groupSelectedNodes(){if(!this.graph)return null;const i=this.graph.getSelectedCells(),t=i.filter(a=>a.isNode()&&!a.id.includes("group"));if(t.length<2)return null;const e=i.filter(a=>a.isNode()&&a.id.includes("group"));e.length>0&&this.graph.removeCells(e);const n=t.reduce((a,l)=>{const c=l.getBBox();return a.minX=Math.min(a.minX,c.x),a.minY=Math.min(a.minY,c.y),a.maxX=Math.max(a.maxX,c.x+c.width),a.maxY=Math.max(a.maxY,c.y+c.height),a},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),s=10,o=this.graph.addNode({id:`group-${Date.now()}`,shape:"rect",x:n.minX-s,y:n.minY-s,width:n.maxX-n.minX+s*2,height:n.maxY-n.minY+s*2,attrs:{body:{fill:"rgba(69, 131, 255, 0.08)",stroke:"#4583ff",strokeWidth:1,strokeDasharray:"6 4"}},data:{type:"group",name:"组合",opacity:1,borderStyle:"dashed",borderRadius:0,borderWidth:1,borderColor:"#4583ff",backgroundColor:"rgba(69, 131, 255, 0.08)"},zIndex:1e3});return t.forEach(a=>{o.addChild(a)}),this.graph.cleanSelection(),this.graph.select(o),kn().setTarget("node",o.id),o},initEvent(){this.graph.on("node:moving",s=>{}),this.graph.on("scale",({sx:s,sy:o})=>{console.log(s,o),this.zoom=Number((s*100).toFixed(0))});const i=kn();this.graph.on("blank:click",({e:s,x:o,y:r})=>{console.log("Blank click at:",o,r,s),i.setTarget("blank",null)}),this.graph.on("edge:click",({e:s,x:o,y:r,edge:a})=>{console.log("edge:click",o,r,a.id),i.setTarget("edge",a.id),this.graph.select([a.getSourceNode(),a.getTargetNode()])}),this.graph.on("node:click",({e:s,x:o,y:r,node:a})=>{var l;if(console.log("node:click",o,r,a.id),(l=a.id)!=null&&l.includes("line")){this.graph.clearTransformWidgets(),s.stopPropagation();return}i.setTarget("node",a.id)}),this.graph.on("node:change:data",({node:s})=>{this.syncDataToAttrs(s)}),this.graph.on("node:added",({node:s})=>{this.syncDataToAttrs(s)}),this.graph.on("edge:mouseenter",({cell:s})=>{s.addTools([{name:"vertices",args:{attrs:{fill:"#666"},modifiers:["meta","shift","ctrl"]}}])}),this.graph.on("edge:mouseleave",({cell:s})=>{s.hasTool("vertices")&&s.removeTool("vertices"),s.hasTool("source-arrowhead")&&s.removeTool("source-arrowhead"),s.hasTool("target-arrowhead")&&s.removeTool("target-arrowhead")}),this.graph.bindKey(["meta+c","ctrl+c"],()=>{const s=this.graph.getSelectedCells();if(!s.length)return!1;const r=s.filter(d=>d.isNode()&&d.id.includes("group")).flatMap(d=>d.getChildren?d.getChildren()||[]:[]),a=s.filter(d=>d.isNode()),l=s.filter(d=>d.isEdge()),c=[...a,...r],h=this.graph.getEdges().filter(d=>{const f=d.getSourceCell&&d.getSourceCell(),m=d.getTargetCell&&d.getTargetCell();return c.includes(f)||c.includes(m)}),u=[...s,...c,...l,...h].reduce((d,f)=>(d.set(f.id,f),d),new Map);return this.graph.copy([...u.values()]),!1}),this.graph.bindKey(["meta+x","ctrl+x"],()=>{const s=this.graph.getSelectedCells();return s.length&&this.graph.cut(s),!1}),this.graph.bindKey(["meta+v","ctrl+v"],()=>{if(!this.graph.isClipboardEmpty()){const s=this.graph.paste({offset:32});this.graph.cleanSelection(),this.graph.select(s)}return!1}),this.graph.bindKey(["meta+z","ctrl+z"],()=>(this.graph.canUndo()&&this.graph.undo(),!1)),this.graph.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(this.graph.canRedo()&&this.graph.redo(),!1)),this.graph.bindKey(["meta+a","ctrl+alt+a"],()=>{const s=this.graph.getNodes();s&&this.graph.select(s)}),this.graph.bindKey("backspace",()=>{const s=this.graph.getSelectedCells();s.length&&(this.graph.removeCells(s),i.setTarget("blank",null))});const t=(s=0,o=0)=>{const r=this.graph.getSelectedCells().filter(a=>a.isNode());if(r.length)return r.forEach(a=>{const{x:l,y:c}=a.getPosition();a.position(l+s,c+o)}),!1},e=5;this.graph.bindKey(["meta+up","ctrl+up"],()=>t(0,-e)),this.graph.bindKey(["meta+down","ctrl+down"],()=>t(0,e)),this.graph.bindKey(["meta+left","ctrl+left"],()=>t(-e,0)),this.graph.bindKey(["meta+right","ctrl+right"],()=>t(e,0));const n=(s,o)=>{for(let r=0,a=s.length;r<a;r+=1)s[r].style.visibility=o?"visible":"hidden"};this.graph.on("node:mouseenter",()=>{const s=this.el.querySelectorAll(".x6-port-body");n(s,!0)}),this.graph.on("node:mouseleave",()=>{const s=this.el.querySelectorAll(".x6-port-body");n(s,!1)})}}}),Tn=pe.defineStore("menus",{state:()=>({menus:[],current:[],services:{}}),getters:{currentMenu:i=>{var t;return(t=i.menus.find(e=>e.id===i.current[0]))==null?void 0:t.children.find(e=>e.id===i.current[1])}},actions:{async setCurrentMenu(i,t=!1){const e=Ut();if(JSON.stringify(i)===JSON.stringify(this.current)&&t===!1)return!1;this.current=i,e.loadMenu(await this.services.getMenu(i[1]))},async loadAllMenus(i=!1){var t;this.menus=await((t=this.services)==null?void 0:t.getAllMenus()),i&&this.menus[0]&&this.menus[0].children[0]&&this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id])},async addMenu(i,t){var n;const e=await((n=this.services)==null?void 0:n.addMenu(i));this.loadAllMenus(),this.setCurrentMenu([e.parentId,e.id]),t&&t()},async saveMenu(i){const t=Ut(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:t.graph.toJSON()};await this.services.saveMenus(e),i&&i()},clearMenu(i){const t=Ut(),e={name:t.name,id:this.current[1],parentId:this.current[0],style:t.style,value:{}};this.services.saveMenus(e),t.graph.clearCells(),i&&i()},async removeMenu(i){if(await this.services.removeMenu(this.current[1]),await this.loadAllMenus(),this.menus[0]&&this.menus[0].children[0])this.setCurrentMenu([this.menus[0].id,this.menus[0].children[0].id]);else{const t=Ut();t.graph.clearCells(),t.name="",t.id=""}i&&i()}}}),Bx={class:"dialog-footer"},kx={__name:"addMenu",emits:["close"],setup(i,{emit:t}){const e=Tn(),{menus:n}=pe.storeToRefs(e),s=t,o=g.ref(!1);function r(){o.value=!1,s("close")}const a=g.ref(null),l=g.ref({parent:null,parentNameNew:"",name:""}),c=g.ref({parent:[{required:!0,message:"请选择上级目录",trigger:"change"}],parentNameNew:{required:!0,message:"请输入一级目录名称",trigger:"blur"},name:[{required:!0,message:"请输入二级目录名称",trigger:"blur"}]}),h=g.ref(!1),u=async()=>{if(a.value){h.value=!0;try{await a.value.validate((d,f)=>{d?(console.log("submit!"),e.addMenu(l.value,()=>{r()})):console.log("error submit!",f)})}catch(d){console.log("表单验证失败:",d)}finally{h.value=!1}}};return g.onMounted(()=>{o.value=!0}),(d,f)=>{const m=g.resolveComponent("el-option"),p=g.resolveComponent("el-select"),b=g.resolveComponent("el-form-item"),y=g.resolveComponent("el-input"),C=g.resolveComponent("el-form"),w=g.resolveComponent("el-button"),x=g.resolveComponent("el-dialog");return g.openBlock(),g.createBlock(x,{modelValue:o.value,"onUpdate:modelValue":f[3]||(f[3]=E=>o.value=E),title:"新增目录",width:"500"},{footer:g.withCtx(()=>[g.createElementVNode("div",Bx,[g.createVNode(w,{onClick:r},{default:g.withCtx(()=>[...f[4]||(f[4]=[g.createTextVNode("取消",-1)])]),_:1}),g.createVNode(w,{type:"primary",onClick:u},{default:g.withCtx(()=>[...f[5]||(f[5]=[g.createTextVNode("确定",-1)])]),_:1})])]),default:g.withCtx(()=>[g.createVNode(C,{ref_key:"formRef",ref:a,model:l.value,"label-width":"auto",style:{padding:"10px 20px"},rules:c.value},{default:g.withCtx(()=>[g.createVNode(b,{label:"上级目录",prop:"parent"},{default:g.withCtx(()=>[g.createVNode(p,{modelValue:l.value.parent,"onUpdate:modelValue":f[0]||(f[0]=E=>l.value.parent=E),placeholder:"请选择上级目录"},{default:g.withCtx(()=>[g.createVNode(m,{value:"0",label:"根目录"}),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(g.unref(n),E=>(g.openBlock(),g.createBlock(m,{key:E.id,label:E.name,value:E.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value.parent=="0"?(g.openBlock(),g.createBlock(b,{key:0,label:"一级目录名称",prop:"parentNameNew"},{default:g.withCtx(()=>[g.createVNode(y,{modelValue:l.value.parentNameNew,"onUpdate:modelValue":f[1]||(f[1]=E=>l.value.parentNameNew=E)},null,8,["modelValue"])]),_:1})):g.createCommentVNode("",!0),g.createVNode(b,{label:"二级目录名称",prop:"name"},{default:g.withCtx(()=>[g.createVNode(y,{modelValue:l.value.name,"onUpdate:modelValue":f[2]||(f[2]=E=>l.value.name=E)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}},Tx=kt({__name:"previewBox",emits:["close"],setup(i,{emit:t}){const e=Ut(),n=g.ref(null),s=Rr(),o=t;function r(){o("close")}let a=null;return g.onMounted(()=>{const{width:l,height:c}=e.style;a=new B({container:n.value,width:l,height:c,interacting:!1,selecting:!1,keyboard:!1,mousewheel:!1,panning:!1}),Lr(),a.fromJSON(e.graph.toJSON()),a.drawBackground({color:e.style.backgroundColor,image:e.style.backgroundImage,size:"cover"})}),g.onBeforeUnmount(()=>{a&&a.dispose()}),(l,c)=>(g.openBlock(),g.createElementBlock("div",{class:"previewBox",onClick:r},[g.createElementVNode("div",{ref_key:"container",ref:n,class:"ems-preview"},null,512),g.createVNode(g.unref(s))]))}},[["__scopeId","data-v-513d27ee"]]),Ix={class:"toolBox"},Px={class:"left"},Ox={style:{"line-height":"40px",width:"100px","text-align":"center"}},Nx={class:"right"},Rx={key:0,class:"iconfont icon-suoding1",style:{color:"#4583ff"}},Dx={key:1,class:"iconfont icon-jiesuo1"},Lx=kt({__name:"index",setup(i){const t=Tn(),e=Ut(),{zoom:n}=pe.storeToRefs(e),s=g.ref(!1),o=()=>{s.value=!0},r=()=>{t.saveMenu(()=>{It.ElMessage.success("保存成功!"),t.loadAllMenus()})};function a(C){const w=/Mac|iPod|iPhone|iPad/.test(navigator.platform);(w&&C.metaKey&&C.key==="s"||!w&&C.ctrlKey&&C.key==="s")&&(C.preventDefault(),r())}const l=()=>{It.ElMessageBox.confirm("确认清空画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.clearMenu(()=>{It.ElMessage.success("清空成功!")})})},c=()=>{if(!e.groupSelectedNodes()){It.ElMessage.warning("请先框选至少两个节点后再组合");return}It.ElMessage.success("组合完成")},h=()=>{It.ElMessageBox.confirm("确认删除画布吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.removeMenu(()=>{It.ElMessage.success("删除成功!")})})},u=g.ref(!1),d=()=>{u.value=!0},f=C=>{e.setZoom(+C*.1)},m=e.graph;m.on("blank:click",({x:C,y:w})=>{}),m.on("mousemove",({x:C,y:w})=>{}),m.on("blank:contextmenu",({e:C})=>{});const p=g.ref(!1),b=()=>{m.isMouseWheelEnabled()?(p.value=!0,m.disablePanning(),m.disableMouseWheel()):(p.value=!1,m.enablePanning(),m.enableMouseWheel())},y=()=>{console.log(m.toJSON())};return g.onMounted(()=>{window.addEventListener("keydown",a)}),g.onBeforeUnmount(()=>{window.removeEventListener("keydown",a)}),(C,w)=>{const x=g.resolveComponent("el-tooltip"),E=g.resolveComponent("el-dropdown-item"),S=g.resolveComponent("el-dropdown-menu"),v=g.resolveComponent("el-dropdown");return g.openBlock(),g.createElementBlock(g.Fragment,null,[g.createElementVNode("div",Ix,[g.createElementVNode("div",Px,[g.createElementVNode("a",{onClick:o},[g.createVNode(x,{effect:"light",content:"新增",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[2]||(w[2]=[g.createElementVNode("i",{class:"iconfont icon-xinjian"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:r},[g.createVNode(x,{effect:"light",content:"保存",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[3]||(w[3]=[g.createElementVNode("i",{class:"iconfont icon-baocun"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:l},[g.createVNode(x,{effect:"light",content:"清空",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[4]||(w[4]=[g.createElementVNode("i",{class:"iconfont icon-qingkong"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:c},[g.createVNode(x,{effect:"light",content:"组合",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[5]||(w[5]=[g.createElementVNode("i",{class:"iconfont icon-jianlizuhe1"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:h},[g.createVNode(x,{effect:"light",content:"删除",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[6]||(w[6]=[g.createElementVNode("i",{class:"iconfont icon-shanchu"},null,-1)])]),_:1})])]),w[10]||(w[10]=g.createElementVNode("div",{style:{flex:"1"}},null,-1)),g.createElementVNode("div",Ox,[g.createVNode(v,{onCommand:f,"split-button":"",type:"primary",plain:"",size:"small",style:{"margin-top":"8px"}},{dropdown:g.withCtx(()=>[g.createVNode(S,null,{default:g.withCtx(()=>[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(20,M=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[M>=5&&M<=20?(g.openBlock(),g.createBlock(E,{key:0,command:M},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(M)+"0%",1)]),_:2},1032,["command"])):g.createCommentVNode("",!0)],64))),64))]),_:1})]),default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(n))+"% ",1)]),_:1})]),w[11]||(w[11]=g.createElementVNode("div",{style:{flex:"1"}},null,-1)),g.createElementVNode("div",Nx,[g.createElementVNode("a",{onClick:b},[g.createVNode(x,{effect:"light",content:"锁定/解锁画布",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[p.value?(g.openBlock(),g.createElementBlock("i",Rx)):(g.openBlock(),g.createElementBlock("i",Dx))]),_:1})]),g.createElementVNode("a",{onClick:d},[g.createVNode(x,{effect:"light",content:"预览",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[7]||(w[7]=[g.createElementVNode("i",{class:"iconfont icon-yulan"},null,-1)])]),_:1})]),g.createElementVNode("a",{onClick:y},[g.createVNode(x,{effect:"light",content:"导出",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[8]||(w[8]=[g.createElementVNode("i",{class:"iconfont icon-daochu"},null,-1)])]),_:1})]),g.createElementVNode("a",null,[g.createVNode(x,{effect:"light",content:"导入",placement:"bottom","popper-class":"tooltipcolor"},{default:g.withCtx(()=>[...w[9]||(w[9]=[g.createElementVNode("i",{class:"iconfont icon-daoru"},null,-1)])]),_:1})])])]),s.value?(g.openBlock(),g.createBlock(kx,{key:0,onClose:w[0]||(w[0]=M=>s.value=!1)})):g.createCommentVNode("",!0),u.value?(g.openBlock(),g.createBlock(Tx,{key:1,onClose:w[1]||(w[1]=M=>u.value=!1)})):g.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7ddbf68a"]]),Qx={class:"editorArea"},Vx={class:"drawBox"},zx={style:{width:"100%",height:"100%"}},Fx=kt({__name:"editorArea",props:["width","height"],setup(i){const t=Tn(),e=Ut(),{style:n}=pe.storeToRefs(e),s=i,o=g.ref(null),r=Rr(),a=g.inject("topoApi");return g.onMounted(()=>{e.el=o.value,e.style.height=s.height||1080,e.style.width=s.width||1920,e.init(),t.services=a,t.loadAllMenus(!0)}),g.onBeforeUnmount(()=>{e.graph&&e.graph.dispose()}),(l,c)=>(g.openBlock(),g.createElementBlock("div",Qx,[g.unref(e).graph?(g.openBlock(),g.createBlock(Lx,{key:0})):g.createCommentVNode("",!0),g.createElementVNode("div",Vx,[g.createElementVNode("div",zx,[g.createElementVNode("div",{ref_key:"container",ref:o,class:"editor-container",style:g.normalizeStyle({backgroundColor:g.unref(n).backgroundColor,backgroundImage:g.unref(n).backgroundImage?`url(${g.unref(n).backgroundImage})`:"none"})},null,4),g.createVNode(g.unref(r))])])]))}},[["__scopeId","data-v-0d80170d"]]),Ux={class:"groups-menus"},Kx=kt({__name:"menus",setup(i){const t=Tn(),{menus:e,current:n}=pe.storeToRefs(t),s=(o,r)=>{t.setCurrentMenu(r)};return g.onMounted(()=>{console.log(e,n)}),(o,r)=>{const a=g.resolveComponent("el-icon"),l=g.resolveComponent("el-menu-item"),c=g.resolveComponent("el-sub-menu"),h=g.resolveComponent("el-menu");return g.openBlock(),g.createElementBlock("div",Ux,[g.createVNode(h,{"default-active":g.unref(n)[1],onSelect:s,"background-color":"transparent"},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(g.unref(e),u=>(g.openBlock(),g.createBlock(c,{key:u.id,index:u.id,"popper-offset":100},{title:g.withCtx(()=>[g.createVNode(a,null,{default:g.withCtx(()=>[g.createVNode(g.unref(Gd))]),_:1}),g.createElementVNode("span",null,g.toDisplayString(u.name),1)]),default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.children,d=>(g.openBlock(),g.createBlock(l,{key:d.id,index:d.id},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(d.name),1)]),default:g.withCtx(()=>[g.createVNode(a,null,{default:g.withCtx(()=>[g.createVNode(g.unref(Kr))]),_:1})]),_:2},1032,["index"]))),128))]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])}}},[["__scopeId","data-v-4ccd6e37"]]),Jx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAADsCAYAAABTw1C4AAAAAXNSR0IArs4c6QAAEo1JREFUeF7t3E3I5mUVBvD/DGPISBnF5Ec5FkxFG1FykYQLK7BFi2rppo1tgkBqVeJKrFURBG1q48ZluHAjVC4MbKEEbsRamFl+NEz0QcOgw0y8Ay7H68Ccns5zP7+29/F+7ud33t6La/HOsdNn7ry8+R8BAgQIELhGgWMC5RoF/ecECBAgcEVAoPhBIECAAIEWAYHSwugSAgQIEBAofgYIECBAoEVAoLQwuoQAAQIEBIqfAQIECBBoERAoLYwuIUCAAAGB4meAAAECBFoEBEoLo0sIECBAoBwot93/8+3kzXcTI0CAAIEDEzj/5vPba09/M37rcqB8+hu/315+/K54oQECBAgQWEug+vtfoKy1d9+GAAEC7QICpZ3UhQQIEDhMAYFymHv3rQkQINAuIFDaSV1IgACBwxQQKIe5d9+aAAEC7QICpZ3UhQQIEDhMgZ0Hir9TyT9ob//z1e2NZ7+3XTj3Uh42QYDANQtc/+HPbLfc+8PtfTfefs13rXxB+juTnQdK9QNXXkr6brd/5YntreceFSgJyjmBJoGjQLnpnke2V596oOnGNa9Jv7/T+bsqbX+HUv3ANddR+1YCpeZkikCXgECpSabf3+lcoNScW6cESiunywhEAYESia4MpMBI5wKl5tw6JVBaOV1GIAoIlEgkUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0lBqRPOmBMq8nXjR2gICpbbf1EDSuYZSc26dEiitnC4jEAUESiTSUGpE86YEyrydeNHaAgKltt/UQNK5hlJzbp0SKK2cLiMQBQRKJNJQakTzpgTKvJ140doCAqW239RA0rmGUnNunRIorZwuIxAFBEok0l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4AAAQIEVhEQlFUYXYQAAQIEBMU3QIAAAQKrCAjKKowuQoAAAQL/BNGmU82l5+MXAAAAAElFTkSuQmCC",Xx=Object.assign({"../../../assets/iconfont/svg/A相手车刀闸合.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M511.9872 921.5232l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 76.8768 76.864 76.864-76.864 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 921.6z m0-102.4l-0.0896 0.0768-31.6736-31.68 0.0768-0.0768-76.864-76.864 31.6736-31.68 54.4896 54.4832V290.6176l-54.4896 54.464-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68-54.4512-54.432v442.7008l54.4512-54.4512 31.6736 31.68-76.864 76.864 0.0768 0.0768L512.064 819.2z m0-653.2864L435.1104 242.6816l-31.6736-31.68 76.864-76.8384-0.0768-0.0704 31.6736-31.68 0.0896 0.0768 0.0768-0.0768 31.6736 31.68-0.0768 0.0704 76.864 76.8384-31.6736 31.68z" fill="#EF5317" /></svg>',"../../../assets/iconfont/svg/三绕组变压器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M544 64v268.256a192.064 192.064 0 0 1 147.84 256.704A192 192 0 1 1 512 904.608a192 192 0 1 1-179.84-315.68A192.064 192.064 0 0 1 480 332.256V64h64z m-197.44 555.072l-5.856 0.832A160.032 160.032 0 0 0 368 937.6a159.68 159.68 0 0 0 124.48-59.456 190.72 190.72 0 0 1-28.48-100.544c0-23.68 4.288-46.4 12.16-67.36a192 192 0 0 1-125.12-83.904l-4.48-7.264z m330.88-0.064l-0.8 1.44a192.192 192.192 0 0 1-128.832 89.824A190.72 190.72 0 0 1 560 777.6a191.104 191.104 0 0 1-28.384 100.544 160 160 0 1 0 145.824-259.104zM509.344 713.6l-2.016 4.8A159.584 159.584 0 0 0 496 777.6c0 25.024 5.76 48.672 16 69.76a158.72 158.72 0 0 0 16-69.76c0-22.784-4.768-44.448-13.344-64.064l-5.312 0.032z m-124.608-95.104l1.28 1.76a159.84 159.84 0 0 0 104.544 59.968l1.824-3.136a159.456 159.456 0 0 0-107.648-58.592z m254.56 0.064l-3.872 0.384a159.808 159.808 0 0 0-103.872 58.144l1.92 3.072a159.488 159.488 0 0 0 100.96-55.52l4.864-6.08zM512 361.6a160 160 0 0 0-146.656 224.064l2.656-0.064c57.344 0 108.8 25.152 144 64.992a191.552 191.552 0 0 1 144-64.992h2.688a160 160 0 0 0-146.688-224z" /></svg>',"../../../assets/iconfont/svg/变压器_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.0944 534.3232c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#E60012" /><path d="M633.6512 459.9808h-200.704l98.7136-158.1056 101.9904 158.1056z m-163.84-20.48h126.1568l-64.1024-99.5328-62.0544 99.5328z" fill="#E60012" /><path d="M533.0944 694.272c-82.1248 0-148.8896-66.7648-148.8896-148.8896s66.7648-148.8896 148.8896-148.8896 148.8896 66.7648 148.8896 148.8896c0 81.92-66.7648 148.8896-148.8896 148.8896z m0-277.504c-70.8608 0-128.4096 57.5488-128.4096 128.4096s57.5488 128.4096 128.4096 128.4096c70.8608 0 128.4096-57.5488 128.4096-128.4096s-57.5488-128.4096-128.4096-128.4096z" fill="#EF7C1B" /><path d="M522.8544 611.9424h20.48v317.0304h-20.48z" fill="#EF7C1B" /><path d="M522.8544 57.9584h20.48v192.512h-20.48z" fill="#E60012" /><path d="M534.7328 632.832l-90.9312-101.9904 15.1552-13.5168 75.3664 84.3776 72.704-84.3776 15.5648 13.5168z" fill="#EF7C1B" /></svg>',"../../../assets/iconfont/svg/变压器_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 170.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333S629.824 170.666667 512 170.666667zM256 384c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M512 426.666667c-117.824 0-213.333333 95.509333-213.333333 213.333333s95.509333 213.333333 213.333333 213.333333 213.333333-95.509333 213.333333-213.333333-95.509333-213.333333-213.333333-213.333333zM256 640c0-141.376 114.624-256 256-256s256 114.624 256 256-114.624 256-256 256-256-114.624-256-256z" fill="#000000" /><path d="M490.666667 981.333333v-106.666666h42.666666v106.666666h-42.666666zM490.666667 149.333333V42.666667h42.666666v106.666666h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/手持开关盒.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M431.431671 299.041479h159.572225v426.308151H431.431671z" fill="#d81e06" /><path d="M609.777099 744.122832H412.658468v-463.854556h197.118631v463.854556z m-159.572225-37.546405h122.025819v-388.761745H450.204874v388.761745z" fill="#d81e06" /><path d="M492.44458 131.568864h37.546406v186.167596h-37.546406zM492.44458 707.280422h37.546406v186.167596h-37.546406z" fill="#d81e06" /><path d="M594.993201 252.656023L511.06134 145.414101 427.129478 252.656023l-29.567794-23.153617L511.06134 84.479413l113.499656 145.022993z" fill="#d81e06" /><path d="M594.993201 168.17661L511.06134 60.934688 427.129478 168.17661l-29.567794-23.153617 113.499656-145.022993L624.560996 145.022993z" fill="#d81e06" /><path d="M511.06134 939.520587L397.561684 794.497594l29.567794-23.075396 83.931862 107.241922L594.993201 771.422198l29.567795 23.075396z" fill="#d81e06" /><path d="M511.06134 1024L397.561684 878.977007l29.567794-23.075395 83.931862 107.241922L594.993201 855.901612l29.567795 23.075395z" fill="#d81e06" /></svg>',"../../../assets/iconfont/svg/手持断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M494.481834 206.967196l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196l71.51746 87.410229-8.668783 7.223986-67.544268-82.714639-67.544268 82.714639zM566.360494 119.195767c0 0.361199 0 0.361199 0 0z" fill="#FF0000" /><path d="M494.481834 148.091711l-8.668783-7.223986 71.51746-87.410229c1.083598-1.444797 2.889594-2.167196 4.695591-2.167196s3.611993 0.722399 4.695591 2.167196L638.600353 140.867725l-8.668783 7.223986-67.544268-82.714639L494.481834 148.091711z m71.87866-87.771429c0 0.361199 0 0.361199 0 0zM562.026102 913.834215c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196z" fill="#FF0000" /><path d="M562.026102 972.7097c-1.805996 0-3.250794-0.722399-4.334391-2.167196l-71.87866-87.771428 8.668783-7.223986 67.544268 82.714638 67.544268-82.714638 8.668783 7.223986-71.878659 87.771428c-1.083598 1.444797-2.528395 2.167196-4.334392 2.167196zM567.805291 849.179541h-11.197178V617.650794l-171.208466-252.839507 9.391182-6.140388 171.930864 254.284304c0.722399 1.083598 1.083598 2.167196 1.083598 3.250793v232.973545zM556.608113 178.071252h11.197178v183.489242h-11.197178z" fill="#FF0000" /><path d="M510.898342 402.654138l94.446392-90.429856 7.740501 8.087252-94.44278 90.429856z" fill="#FF0000" /><path d="M511.158406 320.35849l7.744113-8.087252 94.457227 90.415408-7.744113 8.090864zM556.608113 849.179541h11.197178v58.875485h-11.197178zM556.608113 119.195767h11.197178v58.875485h-11.197178z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/抽屉式断路器断开.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M85.18656007 375.38588444l-13.9264 0 0-387.28817777 13.9264 0z" fill="#EF1616" /><path d="M12.7726934 188.10538666l-9.84746666-9.84746666 72.41500444-72.41500444 9.84746666 9.84746666z" fill="#EF1616" /><path d="M71.25674674 115.69038222l9.84746666-9.84746665 72.41500443 72.41500443-9.84746665 9.84746667zM12.77496896 261.79811556l-9.84746667-9.84746667 72.41500445-72.41500445 9.84746666 9.84746667z" fill="#EF1616" /><path d="M71.25447117 189.38311111l9.84746667-9.84746667 72.41500445 72.41500445-9.84746667 9.84746667zM85.1797334 1037.94346667l-13.9264 0 0-387.28817778 13.9264 0z" fill="#EF1616" /><path d="M85.18769784 910.336l-9.84746665 9.84746667-72.41500445-72.41500445 9.84746666-9.84746666z" fill="#EF1616" /><path d="M143.67175118 837.92099556l9.84746666 9.84746665-72.41500444 72.41500446-9.84746666-9.84746667z" fill="#EF1616" /><path d="M85.18542229 836.64668444l-9.84746667 9.84746667-72.41500444-72.41500444 9.84746666-9.84746667z" fill="#EF1616" /><path d="M143.67402674 764.23168l9.84746666 9.84746667-72.41614222 72.41500444-9.84632889-9.84746667z" fill="#EF1616" /><path d="M19.62666674 375.38702222l118.32888888 0L137.95555561 650.33102222l-118.32888886 0-1e-8-274.944z m104.41386666 13.91502222l-90.48746666 0L33.55306674 636.40462222l90.48746666 0 0-247.10257778z" fill="#EF1616" /></svg>',"../../../assets/iconfont/svg/接地_1.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M531.791456 701.961295a17.407498 17.407498 0 0 1-15.824998-16.616247v-316.499956a15.824998 15.824998 0 0 1 15.824998-15.824998 17.407498 17.407498 0 0 1 15.824998 16.616248v320.456205a15.824998 15.824998 0 0 1-15.824998 11.868748zM533.373956 377.548841a18.989997 18.989997 0 0 1-11.077499 0L172.564006 27.02514a15.033748 15.033748 0 0 1 0-22.154997 15.033748 15.033748 0 0 1 22.154997 0l349.732451 345.776202a15.033748 15.033748 0 0 1 0 22.154996 14.242498 14.242498 0 0 1-11.077498 4.7475zM609.333945 1024H455.040217a15.824998 15.824998 0 0 1 0-31.649996h158.249977a15.824998 15.824998 0 0 1 0 31.649996zM762.836423 870.497522H300.746488a15.824998 15.824998 0 0 1 0-31.649996h462.089935a15.824998 15.824998 0 1 1 0 31.649996zM840.378913 716.203793H223.995249a15.824998 15.824998 0 0 1-15.824998-15.824998 15.824998 15.824998 0 0 1 15.824998-16.616247H840.378913a15.824998 15.824998 0 0 1 15.824997 16.616247 15.824998 15.824998 0 0 1-15.824997 15.824998z" /></svg>',"../../../assets/iconfont/svg/接地_2.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 704H213.333333v-42.666667h597.333334v42.666667zM725.333333 810.666667H298.666667v-42.666667h426.666666v42.666667zM640 917.333333H384v-42.666666h256v42.666666z" fill="#000000" /><path d="M490.666667 704V106.666667h42.666666v597.333333h-42.666666z" fill="#000000" /></svg>',"../../../assets/iconfont/svg/断路器-he.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M640 176H528V0h-32v176H384v672h112v176h32V848h112z" fill="#D81E06" /></svg>',"../../../assets/iconfont/svg/断路器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M700.16 341.333333l55.04-55.04a42.666667 42.666667 0 0 0-60.16-60.16l-12.373333 12.373334V42.666667a42.666667 42.666667 0 0 0-85.333334 0v195.84l-12.373333-12.373334a42.666667 42.666667 0 0 0-60.16 60.16L579.84 341.333333l-55.466667 55.04a42.666667 42.666667 0 1 0 60.16 60.16L640 401.493333l55.04 55.04a42.666667 42.666667 0 1 0 60.16-60.16zM333.226667 230.826667a42.666667 42.666667 0 0 0-69.12 50.346666L597.333333 739.413333V981.333333a42.666667 42.666667 0 0 0 85.333334 0v-256a42.666667 42.666667 0 0 0-8.106667-25.173333z" /></svg>',"../../../assets/iconfont/svg/母线.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="98.08px" viewBox="0 0 2088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2088.44 442.576H5.726v138.848H2088.44V442.576z" fill="#FF0000" /></svg>',"../../../assets/iconfont/svg/电池.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="100.64px" viewBox="0 0 2035 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2538.89999992 217.3c2.9-0.1 5.7-0.1 8.6-0.1" /><path d="M1344.19999992 960.2H703.99999992V130.3h640.1v829.9z m-567.5-70.1h494.8V200.4H776.69999992v689.7z" fill="#03E086" /><path d="M896.09999992 61h254.4v70H896.09999992zM1064.99999992 755.9l-80.7-39.7 63.6-129.1H855.49999992l128.3-255.3 80.4 40.5-62.7 124.8h191z" fill="#03E086" /></svg>',"../../../assets/iconfont/svg/直流逆变器.svg":'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M207.36 359.936l58.624-58.624c9.216-9.216 21.418667-14.250667 34.389333-14.250667s25.173333 5.034667 34.389334 14.250667l41.557333 41.557333c17.749333 17.749333 40.96 26.88 64.341333 26.88 18.773333 0 37.632-5.802667 53.930667-17.749333l45.909333-33.621333c9.472-6.912 11.52-20.224 4.608-29.696a21.265067 21.265067 0 0 0-29.696-4.608l-45.909333 33.621333a48.452267 48.452267 0 0 1-63.146667-4.864l-41.557333-41.557333c-17.237333-17.237333-40.106667-26.709333-64.426667-26.709334-24.32 0-47.274667 9.472-64.426666 26.709334l-58.624 58.624c-8.277333 8.277333-8.277333 21.76 0 30.037333 8.277333 8.277333 21.76 8.277333 30.037333 0zM119.466667 119.466667v785.066666h785.066666V119.466667H119.466667z m706.645333 42.496L161.962667 826.112V161.962667h664.149333z m-640 700.074666l675.925333-675.925333v675.925333H186.112zM490.837333 685.568h339.882667v42.496H490.837333zM736.682667 790.101333h94.122666v42.496H736.682667zM613.717333 790.101333h94.122667v42.496H613.717333zM490.837333 790.101333h94.122667v42.496H490.837333z" /></svg>'});function $x(i){return i?(i=i.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"').replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),i=i.replace(/<([a-z]+)([^>]*?)\/?>/gi,(t,e,n)=>{const s=t.endsWith("/>")?"/>":">";return!/(fill=)/i.test(n)&&/^(path|circle|rect|polygon|polyline)$/i.test(e)?`<${e}${n} fill="currentColor"${s}`:t}),i):""}const Td="__node_panel_svg_sprite__";function Zx(){if(typeof document>"u")return null;let i=document.getElementById(Td);i||(i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.id=Td,document.body.prepend(i));let t=i.querySelector("defs");return t||(t=document.createElementNS("http://www.w3.org/2000/svg","defs"),i.appendChild(t)),t}function tv(i){const t=i.match(/viewBox="([^"]+)"/i),e=i.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i);return{viewBox:t?t[1]:"",content:e?e[1]:i}}function ev(i,t){const e=Zx();if(!e||e.querySelector(`#${i}`))return i;const{viewBox:n,content:s}=tv($x(t)),o=document.createElementNS("http://www.w3.org/2000/svg","symbol");return o.setAttribute("id",i),n&&o.setAttribute("viewBox",n),o.innerHTML=s,e.appendChild(o),i}const nv=Object.entries(Xx).map(([i,t])=>({name:i.split("/").pop().replace(".svg",""),id:ev(`node-icon-${i.split("/").pop().replace(".svg","")}`,t)})),iv={class:"nodes"},sv={class:"groups"},ov=["onClick"],rv={class:"list"},av={style:{width:"100%",display:"flex","justify-content":"space-between","align-items":"center",padding:"20px 10px 10px 10px"}},lv={style:{padding:"10px"}},cv=["onMousedown","title"],hv={key:1,class:"svg-icon"},uv={"aria-hidden":"true"},dv=["xlink:href"],gv=kt({__name:"nodes",setup(i){const t=Ut(),e={IMG:"img",SVG:"svg",OTHER:"other"},n=g.ref(0),s=g.ref([{name:"控件",icon:"iconfont icon-icon-relativity",active:[],children:[{name:"基础",layout:"1fr 1fr 1fr",list:[{name:"线段",renderType:"svg",icon:"icon-xianduan",data:{type:"line"}},{name:"基础文字",renderType:"svg",icon:"icon-wenzi",data:{type:"text",text:"测试"}},{name:"数值",renderType:"svg",icon:"icon-shuzhi",data:{type:"svg"}},{name:"图标",renderType:"svg",icon:"icon-tubiao",data:{type:"svg"}},{name:"图片",renderType:"svg",icon:"icon-tupian",data:{type:"svg"}},{name:"自定义",renderType:"svg",icon:"icon-tupian",data:{type:"icon"}}]},{name:"图形",list:[]},{name:"表格",list:[]},{name:"图表",list:[]},{name:"表单",list:[]}]},{name:"模板",icon:"iconfont icon-root-list",active:[],children:[{name:"布局",layout:"1fr 1fr",list:[{name:"布局1",renderType:"img",icon:Jx,data:{type:"layout"}},{name:"布局2",renderType:"img",icon:jx,data:{type:"layout"}},{name:"布局3",renderType:"img",icon:Gx,data:{type:"layout"}},{name:"布局4",renderType:"img",icon:Yx,data:{type:"layout"}},{name:"布局5",renderType:"img",icon:Hx,data:{type:"layout"}},{name:"布局6",renderType:"img",icon:_x,data:{type:"layout"}},{name:"布局7",renderType:"img",icon:Wx,data:{type:"layout"}},{name:"布局8",renderType:"img",icon:qx,data:{type:"layout"}}]}]},{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"图表",icon:"iconfont icon-icon_chart",children:[],active:[]},{name:"素材",icon:"iconfont icon-icon_image",children:[{name:"电器svg",layout:"1fr 1fr 1fr",list:nv.map(h=>({name:h.name,renderType:"svg",icon:h.id,data:{type:"svg"}}))}],active:[]}]),o=g.ref(""),r=h=>{n.value=h},a=()=>{if(s.value[n.value].active.length>0)s.value[n.value].active=[];else{const h=[];s.value[n.value].children.forEach((u,d)=>{h.push(d)}),s.value[n.value].active=h}},l=(h,u)=>{console.log(u);let d;["line"].includes(u.data.type)?d=t.graph.createNode({shape:"svg-node"}):d=t.graph.createNode({shape:u.data.type+"-node"}),d.setData({icon:u.icon,name:u.name,...u.data}),t.dnd.start(d,h)},c=({node:h})=>{var u;if(((u=h.data)==null?void 0:u.type)==="line"){const d=h.position();console.log(h,h.position()),h.remove();const f=t.graph.addNode({id:"line"+crypto.randomUUID(),x:d.x-50,y:d.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),m=t.graph.addNode({id:"line"+crypto.randomUUID(),x:d.x+50,y:d.y,width:5,height:5,attrs:{body:{fill:"transparent",stroke:"transparent"}},zIndex:1}),p=t.graph.addEdge({source:f,target:m,router:"normal",markup:[{tagName:"path",selector:"line"},{tagName:"path",selector:"line1"}],attrs:{line:{stroke:"#1bc8de80",strokeWidth:2,connection:!0,sourceMarker:"",targetMarker:""},line1:{display:"none",connection:!0,x:0,y:0,strokeWidth:4,stroke:"#91f4ffff",fill:"none",strokeDasharray:"8 8",pointerEvents:"none",style:{animation:"ant-line 30s infinite linear"}}},zIndex:0,data:{name:"line",status:[],bindData:[],realData:[]}});t.graph.select(p)}};return g.onMounted(()=>{t.graph.on("node:added",c)}),g.onBeforeUnmount(()=>{t.graph.off("node:added",c)}),(h,u)=>{const d=g.resolveComponent("el-input"),f=g.resolveComponent("el-tooltip"),m=g.resolveComponent("el-image"),p=g.resolveComponent("el-collapse-item"),b=g.resolveComponent("el-collapse");return g.openBlock(),g.createElementBlock("div",iv,[g.createElementVNode("div",sv,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(s.value,(y,C)=>(g.openBlock(),g.createElementBlock("div",{key:y.index,class:g.normalizeClass(["group",{active:n.value===C}]),onClick:w=>r(C)},[g.createElementVNode("i",{class:g.normalizeClass(y.icon)},null,2),g.createElementVNode("span",null,g.toDisplayString(y.name),1)],10,ov))),128))]),g.createElementVNode("div",rv,[g.createElementVNode("div",av,[g.createVNode(d,{modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=y=>o.value=y),style:{width:"180px"},placeholder:"请输入过滤","prefix-icon":g.unref(Jr),clearable:""},null,8,["modelValue","prefix-icon"]),g.createVNode(f,{effect:"light",content:"展开/折叠",placement:"top"},{default:g.withCtx(()=>[g.createElementVNode("div",{style:{cursor:"pointer","font-size":"20px"},onClick:a},[...u[2]||(u[2]=[g.createElementVNode("i",{class:"iconfont icon-menu-fold"},null,-1)])])]),_:1})]),g.createElementVNode("div",lv,[g.createVNode(b,{modelValue:s.value[n.value].active,"onUpdate:modelValue":u[1]||(u[1]=y=>s.value[n.value].active=y),"expand-icon-position":"left",style:{border:"none","background-color":"transparent"}},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(s.value[n.value].children,(y,C)=>(g.openBlock(),g.createBlock(p,{key:C,title:y.name,name:C},{default:g.withCtx(()=>[g.createElementVNode("div",{class:"expand-content",style:g.normalizeStyle({gridTemplateColumns:y.layout?y.layout:"1fr 1fr 1fr"})},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(y.list.filter(w=>w.name.includes(o.value)),(w,x)=>(g.openBlock(),g.createElementBlock("div",{key:x,class:"graphic",onMousedown:E=>l(E,w),title:w.name},[w.renderType===e.IMG?(g.openBlock(),g.createBlock(m,{key:0,src:w.icon,style:{width:"100px",height:"60px",margin:"auto"}},null,8,["src"])):g.createCommentVNode("",!0),w.renderType===e.SVG?(g.openBlock(),g.createElementBlock("div",hv,[(g.openBlock(),g.createElementBlock("svg",uv,[g.createElementVNode("use",{"xlink:href":"#"+w.icon},null,8,dv)]))])):g.createCommentVNode("",!0),w.renderType===e.OTHER?(g.openBlock(),g.createElementBlock("i",{key:2,class:g.normalizeClass(["iconfont",w.icon]),style:{"font-size":"24px"}},null,2)):g.createCommentVNode("",!0),g.createElementVNode("p",null,g.toDisplayString(w.name),1)],40,cv))),128))],4)]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])])])}}},[["__scopeId","data-v-5f1bd2e4"]]),fv={class:"datas"},pv={class:"groups"},mv=["onClick"],bv={class:"list"},yv={style:{padding:"10px"}},wv=["onMousedown"],Cv=kt({__name:"datas",setup(i){const t=Ut(),e=g.inject("topoApi"),n=g.ref([]);(async()=>{n.value=await e.getDeviceList()})();const o=g.ref([{name:"设备",icon:"iconfont icon-control-platform",children:[],active:[]},{name:"接口",icon:"iconfont icon-icon_chart",children:[],active:[]}]),r=g.ref(0),a=p=>{r.value=p};g.ref({});const l=g.ref(""),c=g.ref(null),h={value:"id",label:"label",data:"data",children:"children"},u=()=>{c.value.filter(l.value)},d=(p,b,y)=>(console.log(p,y.label.includes(p)),y.label.includes(p)),f=(p,b)=>{var E;const y=((E=b.data)==null?void 0:E.data)||{};console.log(y);const w={type:"text",text:"--",realData:null,dataSource:{type:"opcua",path:y.nodeId,parse:y.description?`const description = data.pointTemp.description;
|
|
808
|
+
const value = data.payload.value;
|
|
809
|
+
if(!description) return value
|
|
810
|
+
const a = description.split(";").map(i => {
|
|
811
|
+
return {
|
|
812
|
+
label: i.split(':')[1], value: i.split(':')[0]
|
|
813
|
+
}
|
|
814
|
+
})
|
|
815
|
+
a.length = a.length - 1
|
|
816
|
+
return a.find(i => i.value == value)?.label || '--'`:null,point:{...y},name:"text"},name:b.label};let x=t.graph.createNode({shape:"text-node"});x.setData(w),t.dnd.start(x,p)},m=({node:p})=>{var b,y,C,w,x,E,S,v,M,k,T,P,R,J;if(((b=p.data)==null?void 0:b.type)!=="line"&&(y=p.data)!=null&&y.dataSource&&(w=(C=p.data)==null?void 0:C.dataSource)!=null&&w.type){const D=(E=(x=p.data)==null?void 0:x.dataSource)==null?void 0:E.type,N=(v=(S=p.data)==null?void 0:S.dataSource)==null?void 0:v.path,G=(k=(M=p.data)==null?void 0:M.dataSource)==null?void 0:k.parse,ot=(P=(T=p.data)==null?void 0:T.dataSource)==null?void 0:P.point,yt=(J=(R=p.data)==null?void 0:R.dataSource)==null?void 0:J.name;D==="opcua"&&N&&e.readPoints([N]).then(gt=>{if(gt&>.payload){p.setData({realData:gt});let lt={};if(G)try{const V=new Function("data","$",G);console.log({...gt.payload,...ot}),lt[yt]=V({payload:gt.payload,pointTemp:ot},{})}catch(V){console.log(V)}else lt[yt]=gt.payload.value||"--";p.setData(lt)}})}};return g.onMounted(()=>{var p;(p=t.graph)==null||p.on("node:added",m)}),g.onBeforeUnmount(()=>{var p;(p=t.graph)==null||p.off("node:added",m)}),(p,b)=>{const y=g.resolveComponent("el-button"),C=g.resolveComponent("el-input"),w=g.resolveComponent("el-icon"),x=g.resolveComponent("el-tree-v2");return g.openBlock(),g.createElementBlock("div",fv,[g.createElementVNode("div",pv,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(o.value,(E,S)=>(g.openBlock(),g.createElementBlock("div",{key:E.index,class:g.normalizeClass(["group",{active:r.value===S}]),onClick:v=>a(S)},[g.createElementVNode("i",{class:g.normalizeClass(E.icon)},null,2),g.createElementVNode("span",null,g.toDisplayString(E.name),1)],10,mv))),128))]),g.createElementVNode("div",bv,[g.createElementVNode("div",yv,[g.createVNode(C,{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=E=>l.value=E),style:{height:"30px"},placeholder:"请输入名称过滤",size:"small"},{append:g.withCtx(()=>[g.createVNode(y,{icon:g.unref(Jr),onClick:u},null,8,["icon"])]),_:1},8,["modelValue"])]),r.value===0?(g.openBlock(),g.createBlock(x,{key:0,ref_key:"treeRef",ref:c,style:{width:"100%"},data:n.value,props:h,height:800,"filter-method":d},{default:g.withCtx(({node:E})=>[g.createVNode(w,{class:"el-icon--left"},{default:g.withCtx(()=>[E.isLeaf?(g.openBlock(),g.createBlock(g.unref(Kr),{key:0})):E.expanded?(g.openBlock(),g.createBlock(g.unref(Ud),{key:2})):(g.openBlock(),g.createBlock(g.unref(Jd),{key:1}))]),_:2},1024),g.createElementVNode("div",{onMousedown:S=>f(S,E),style:{flex:"1"}},g.toDisplayString(E.label),41,wv)]),_:1},8,["data"])):g.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-c1a6cd80"]]),Av={class:"graphics"},xv={class:"menus"},vv=kt({__name:"index",setup(i){const t=g.ref(0);return(e,n)=>(g.openBlock(),g.createElementBlock("div",Av,[g.createElementVNode("div",xv,[g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===0}]),onClick:n[0]||(n[0]=s=>t.value=0)},"菜单目录",2),g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===1}]),onClick:n[1]||(n[1]=s=>t.value=1)},"系统资源",2),g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===2}]),onClick:n[2]||(n[2]=s=>t.value=2)},"我的资源",2),g.createElementVNode("div",{class:g.normalizeClass(["menu",{active:t.value===3}]),onClick:n[3]||(n[3]=s=>t.value=3)},"数据来源",2)]),t.value===0?(g.openBlock(),g.createBlock(Kx,{key:0})):g.createCommentVNode("",!0),t.value===1?(g.openBlock(),g.createBlock(gv,{key:1})):g.createCommentVNode("",!0),t.value===3?(g.openBlock(),g.createBlock(Cv,{key:2})):g.createCommentVNode("",!0)]))}},[["__scopeId","data-v-cacbdac3"]]),Ev=["src"],Sv=kt({__name:"graphProperty",setup(i){Tn();const t=Ut(),{style:e,name:n}=pe.storeToRefs(t),s=g.ref(["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]);function o(a){return new Promise((l,c)=>{const h=new FileReader;h.onload=()=>l(h.result),h.onerror=c,h.readAsDataURL(a)})}const r=async a=>{if(!a.type.startsWith("image/"))return It.ElMessage.error("只能上传图片文件"),!1;if(!(a.size/1024/1024<2))return It.ElMessage.error("图片大小不能超过 2MB"),!1;try{const c=await o(a);e.value.backgroundImage=c}catch{return It.ElMessage.error("图片读取失败"),!1}return!1};return g.ref(1920),g.ref(1080),(a,l)=>{const c=g.resolveComponent("el-input"),h=g.resolveComponent("el-form-item");g.resolveComponent("el-input-number"),g.resolveComponent("el-button");const u=g.resolveComponent("el-color-picker"),d=g.resolveComponent("el-icon"),f=g.resolveComponent("el-upload"),m=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(m,{class:"graphProperty",size:"small","label-width":"auto",onSubmit:l[4]||(l[4]=g.withModifiers(()=>{},["prevent"]))},{default:g.withCtx(()=>[g.createVNode(h,{label:"目录名称"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:g.unref(n),"onUpdate:modelValue":l[0]||(l[0]=p=>g.isRef(n)?n.value=p:null)},null,8,["modelValue"])]),_:1}),g.createCommentVNode("",!0),g.createVNode(h,{label:"背景颜色"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:g.unref(e).backgroundColor,"onUpdate:modelValue":l[3]||(l[3]=p=>g.unref(e).backgroundColor=p),"show-alpha":"",predefine:s.value,style:{width:"100%",height:"30px"}},null,8,["modelValue","predefine"])]),_:1}),g.createVNode(h,{label:"背景图片"},{default:g.withCtx(()=>[g.createVNode(f,{accept:"image/*","show-file-list":!1,"before-upload":r},{default:g.withCtx(()=>[g.unref(e).backgroundImage?(g.openBlock(),g.createElementBlock("img",{key:0,src:g.unref(e).backgroundImage,style:{width:"100%",height:"100%"}},null,8,Ev)):(g.openBlock(),g.createBlock(d,{key:1,class:"avatar-uploader-icon"},{default:g.withCtx(()=>[g.createVNode(g.unref(Hd))]),_:1}))]),_:1})]),_:1})]),_:1})}}},[["__scopeId","data-v-3a1238a6"]]),Mv=kt({__name:"nodePanel",setup(i){var r;const t=Ut(),e=g.inject("cellId"),n=g.inject("getCurCell")(),s=n.getData()||{},o=g.ref({name:((r=n.getData())==null?void 0:r.name)||"",x:n.position().x,y:n.position().y,width:n.size().width,height:n.size().height,zIndex:n.prop("zIndex"),opacity:s.opacity||1,borderStyle:s.borderStyle,borderRadius:s.borderRadius,borderWidth:s.borderWidth,borderColor:s.borderColor,backgroundColor:s.backgroundColor});return g.watch(o.value,()=>{n.prop("position",{x:o.value.x,y:o.value.y}),n.prop("size",{width:o.value.width,height:o.value.height}),n.prop("zIndex",o.value.zIndex);const{name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:d,backgroundColor:f,backgroundImage:m,color:p}=o.value;n.setData({name:a,opacity:l,borderStyle:c,borderRadius:h,borderWidth:u,borderColor:d,backgroundColor:f})}),g.onMounted(()=>{t.graph.on("node:resized",({node:a})=>{a.id===e.value&&(o.value.width=a.size().width,o.value.height=a.size().height)}),t.graph.on("node:change:position",({node:a})=>{console.log(a.position()),a.id===e.value&&(o.value.x=+a.position().x.toFixed(0),o.value.y=+a.position().y.toFixed(0))})}),g.onBeforeUnmount(()=>{t.graph.off("node:resized"),t.graph.off("node:change:position")}),(a,l)=>{const c=g.resolveComponent("el-input"),h=g.resolveComponent("el-form-item"),u=g.resolveComponent("el-input-number"),d=g.resolveComponent("el-slider"),f=g.resolveComponent("el-option"),m=g.resolveComponent("el-select"),p=g.resolveComponent("el-color-picker"),b=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(b,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:g.withCtx(()=>[l[17]||(l[17]=g.createElementVNode("div",{class:"baseTitle"},"基础",-1)),g.createVNode(h,{label:"元素名称"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:o.value.name,"onUpdate:modelValue":l[0]||(l[0]=y=>o.value.name=y)},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"位置"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:o.value.x,"onUpdate:modelValue":l[1]||(l[1]=y=>o.value.x=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...l[12]||(l[12]=[g.createElementVNode("span",null,"X",-1)])]),_:1},8,["modelValue"]),g.createVNode(u,{modelValue:o.value.y,"onUpdate:modelValue":l[2]||(l[2]=y=>o.value.y=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:g.withCtx(()=>[...l[13]||(l[13]=[g.createElementVNode("span",null,"Y",-1)])]),_:1},8,["modelValue"])]),_:1}),g.createVNode(h,{label:"宽高"},{default:g.withCtx(()=>[l[16]||(l[16]=g.createElementVNode("span",null,null,-1)),g.createVNode(u,{modelValue:o.value.width,"onUpdate:modelValue":l[3]||(l[3]=y=>o.value.width=y),"controls-position":"right",min:0,step:5,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...l[14]||(l[14]=[g.createElementVNode("span",null,"W",-1)])]),_:1},8,["modelValue"]),g.createVNode(u,{modelValue:o.value.height,"onUpdate:modelValue":l[4]||(l[4]=y=>o.value.height=y),"controls-position":"right",min:0,step:5,style:{width:"90px"}},{prefix:g.withCtx(()=>[...l[15]||(l[15]=[g.createElementVNode("span",null,"H",-1)])]),_:1},8,["modelValue"])]),_:1}),g.createVNode(h,{label:"层级"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:o.value.zIndex,"onUpdate:modelValue":l[5]||(l[5]=y=>o.value.zIndex=y),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"透明度"},{default:g.withCtx(()=>[g.createVNode(d,{modelValue:o.value.opacity,"onUpdate:modelValue":l[6]||(l[6]=y=>o.value.opacity=y),min:0,max:1,step:.01,style:{width:"160px"}},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"边框"},{default:g.withCtx(()=>[g.createVNode(m,{modelValue:o.value.borderStyle,"onUpdate:modelValue":l[7]||(l[7]=y=>o.value.borderStyle=y),style:{width:"60px","margin-right":"10px"},placeholder:"样式"},{default:g.withCtx(()=>[g.createVNode(f,{label:"无",value:"none"}),g.createVNode(f,{label:"实线",value:"solid"}),g.createVNode(f,{label:"虚线",value:"dashed"}),g.createVNode(f,{label:"点线",value:"dotted"})]),_:1},8,["modelValue"]),g.createVNode(u,{modelValue:o.value.borderWidth,"onUpdate:modelValue":l[8]||(l[8]=y=>o.value.borderWidth=y),"controls-position":"right",min:0,step:1,style:{width:"60px","margin-right":"10px"},placeholder:"宽度"},null,8,["modelValue"]),g.createVNode(p,{modelValue:o.value.borderColor,"onUpdate:modelValue":l[9]||(l[9]=y=>o.value.borderColor=y),"show-alpha":"",placeholder:"颜色"},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"圆角"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:o.value.borderRadius,"onUpdate:modelValue":l[10]||(l[10]=y=>o.value.borderRadius=y),min:0,max:100,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),g.createVNode(h,{label:"背景颜色"},{default:g.withCtx(()=>[g.createVNode(p,{modelValue:o.value.backgroundColor,"onUpdate:modelValue":l[11]||(l[11]=y=>o.value.backgroundColor=y),"show-alpha":"",placeholder:"颜色",style:{width:"180px",height:"30px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-71c57f2d"]]),Bv={class:"inline-row"},kv=kt({__name:"linePanel",setup(i){var l,c;const t=g.inject("getCurCell")(),e=((l=t.getAttrs())==null?void 0:l.line)||{},n=((c=t.getAttrs())==null?void 0:c.line1)||{},s=h=>!h||h==="none"?"none":typeof h=="string"?h:h.name||"none",o=(h,u)=>!h||h==="none"?u:typeof h=="object"&&h.size?h.size:u,r=g.ref({name:"line",trackColor:e.stroke||"#754c3c",strokeWidth:e.strokeWidth??2,strokeOpacity:e.strokeOpacity??1,sourceMarker:s(e.sourceMarker)||"none",targetMarker:s(e.targetMarker)||"none",markerSize:o(e.targetMarker||e.sourceMarker,8),flowEnabled:n.display!=="none"}),a=()=>{const h=r.value;t.setData({...t.getData(),name:h.name}),t.prop("zIndex",h.zIndex),t.attr("line/stroke",h.trackColor),t.attr("line/strokeWidth",h.strokeWidth),t.attr("line/strokeOpacity",h.strokeOpacity),t.attr("line/fill","none"),t.attr("line/strokeDasharray",null),t.attr("line/strokeDashoffset",0);const u=d=>!d||d==="none"?"":{name:d,size:h.markerSize};t.attr("line/sourceMarker",u(h.sourceMarker)),t.attr("line/targetMarker",u(h.targetMarker)),h.flowEnabled?(t.attr("line/strokeWidth",8),t.attr("line1/display","inline")):t.attr("line1/display","none")};return g.watch(r,a,{deep:!0,immediate:!0}),(h,u)=>{const d=g.resolveComponent("el-input"),f=g.resolveComponent("el-form-item"),m=g.resolveComponent("el-input-number"),p=g.resolveComponent("el-color-picker"),b=g.resolveComponent("el-slider"),y=g.resolveComponent("el-option"),C=g.resolveComponent("el-select"),w=g.resolveComponent("el-switch"),x=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(x,{size:"small","label-width":"90px","label-position":"left"},{default:g.withCtx(()=>[u[9]||(u[9]=g.createElementVNode("div",{class:"baseTitle"},"连线样式",-1)),g.createVNode(f,{label:"名称"},{default:g.withCtx(()=>[g.createVNode(d,{modelValue:r.value.name,"onUpdate:modelValue":u[0]||(u[0]=E=>r.value.name=E),placeholder:""},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"层级"},{default:g.withCtx(()=>[g.createVNode(m,{modelValue:r.value.zIndex,"onUpdate:modelValue":u[1]||(u[1]=E=>r.value.zIndex=E),min:0,max:1e4,step:1,style:{width:"100px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"颜色"},{default:g.withCtx(()=>[g.createVNode(p,{modelValue:r.value.trackColor,"onUpdate:modelValue":u[2]||(u[2]=E=>r.value.trackColor=E),"show-alpha":"",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"粗细"},{default:g.withCtx(()=>[g.createVNode(m,{modelValue:r.value.strokeWidth,"onUpdate:modelValue":u[3]||(u[3]=E=>r.value.strokeWidth=E),min:1,step:1,"controls-position":"right",style:{width:"120px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"透明度"},{default:g.withCtx(()=>[g.createVNode(b,{modelValue:r.value.strokeOpacity,"onUpdate:modelValue":u[4]||(u[4]=E=>r.value.strokeOpacity=E),min:0,max:1,step:.01,style:{width:"180px"}},null,8,["modelValue"])]),_:1}),g.createVNode(f,{label:"箭头"},{default:g.withCtx(()=>[g.createElementVNode("div",Bv,[g.createVNode(C,{modelValue:r.value.sourceMarker,"onUpdate:modelValue":u[5]||(u[5]=E=>r.value.sourceMarker=E),style:{width:"60px","margin-right":"3px"}},{default:g.withCtx(()=>[g.createVNode(y,{label:"无",value:"none"}),g.createVNode(y,{label:"箭头",value:"block"}),g.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),g.createVNode(C,{modelValue:r.value.targetMarker,"onUpdate:modelValue":u[6]||(u[6]=E=>r.value.targetMarker=E),style:{width:"60px","margin-right":"3px"}},{default:g.withCtx(()=>[g.createVNode(y,{label:"无",value:"none"}),g.createVNode(y,{label:"箭头",value:"block"}),g.createVNode(y,{label:"三角",value:"classic"})]),_:1},8,["modelValue"]),g.createVNode(m,{modelValue:r.value.markerSize,"onUpdate:modelValue":u[7]||(u[7]=E=>r.value.markerSize=E),min:4,max:30,step:1,"controls-position":"right",style:{width:"60px"}},null,8,["modelValue"])])]),_:1}),g.createVNode(f,{label:"动画"},{default:g.withCtx(()=>[g.createVNode(w,{modelValue:r.value.flowEnabled,"onUpdate:modelValue":u[8]||(u[8]=E=>r.value.flowEnabled=E),"active-text":"开启","inactive-text":"关闭",style:{"margin-right":"8px"}},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-007fe38a"]]),Tv=kt({__name:"textPanel",setup(i){Ut(),g.inject("cellId");const t=g.inject("getCurCell")(),e=t.getData()||{},n=g.ref({text:e.text||"",justifyContent:e.justifyContent||"center",alignItems:e.alignItems||"center",textAlign:e.textAlign||"center",color:e.color||"#ffffff",fontWeight:e.fontWeight??400,fontSize:e.fontSize??16,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??1.4,fontFamily:e.fontFamily||"",fontStyle:e.fontStyle||"normal",textDecoration:e.textDecoration||"none",whiteSpace:e.whiteSpace||"pre-wrap",wordBreak:e.wordBreak||"break-word",textOverflow:e.textOverflow||"clip",overflow:e.overflow||"hidden",display:e.display||"block"});return g.watch(n,s=>{t.setData({...s})},{deep:!0}),(s,o)=>{const r=g.resolveComponent("el-option"),a=g.resolveComponent("el-select"),l=g.resolveComponent("el-form-item"),c=g.resolveComponent("el-input-number"),h=g.resolveComponent("el-color-picker"),u=g.resolveComponent("el-input"),d=g.resolveComponent("el-form");return g.openBlock(),g.createBlock(d,{size:"small","label-width":"80px","label-position":"left",class:"nodePanel"},{default:g.withCtx(()=>[o[14]||(o[14]=g.createElementVNode("div",{class:"baseTitle"},"文字",-1)),g.createVNode(l,{label:"文本对齐"},{default:g.withCtx(()=>[g.createVNode(a,{modelValue:n.value.textAlign,"onUpdate:modelValue":o[0]||(o[0]=f=>n.value.textAlign=f),style:{width:"190px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"左对齐",value:"left"}),g.createVNode(r,{label:"居中",value:"center"}),g.createVNode(r,{label:"右对齐",value:"right"})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"字体"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:n.value.fontSize,"onUpdate:modelValue":o[1]||(o[1]=f=>n.value.fontSize=f),"controls-position":"right",min:8,step:1,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...o[11]||(o[11]=[g.createElementVNode("span",null,"大小",-1)])]),_:1},8,["modelValue"]),g.createVNode(a,{modelValue:n.value.fontWeight,"onUpdate:modelValue":o[2]||(o[2]=f=>n.value.fontWeight=f),modelModifiers:{number:!0},style:{width:"90px"}},{default:g.withCtx(()=>[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(7,f=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[f>2?(g.openBlock(),g.createBlock(r,{key:f,label:f*100,value:f*100},null,8,["label","value"])):g.createCommentVNode("",!0)],64))),64))]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"行高/间距"},{default:g.withCtx(()=>[g.createVNode(c,{modelValue:n.value.lineHeight,"onUpdate:modelValue":o[3]||(o[3]=f=>n.value.lineHeight=f),"controls-position":"right",min:.5,step:.1,style:{width:"90px","margin-right":"10px"}},{prefix:g.withCtx(()=>[...o[12]||(o[12]=[g.createElementVNode("span",null,"行高",-1)])]),_:1},8,["modelValue"]),g.createVNode(c,{modelValue:n.value.letterSpacing,"onUpdate:modelValue":o[4]||(o[4]=f=>n.value.letterSpacing=f),"controls-position":"right",min:0,step:1,style:{width:"90px"}},{prefix:g.withCtx(()=>[...o[13]||(o[13]=[g.createElementVNode("span",null,"间距",-1)])]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"样式"},{default:g.withCtx(()=>[g.createVNode(a,{modelValue:n.value.fontStyle,"onUpdate:modelValue":o[5]||(o[5]=f=>n.value.fontStyle=f),style:{width:"90px","margin-right":"10px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"常规",value:"normal"}),g.createVNode(r,{label:"斜体",value:"italic"})]),_:1},8,["modelValue"]),g.createVNode(a,{modelValue:n.value.textDecoration,"onUpdate:modelValue":o[6]||(o[6]=f=>n.value.textDecoration=f),style:{width:"90px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"无",value:"none"}),g.createVNode(r,{label:"下划线",value:"underline"}),g.createVNode(r,{label:"删除线",value:"line-through"})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"换行/溢出",style:{display:"flex"}},{default:g.withCtx(()=>[g.createVNode(a,{modelValue:n.value.whiteSpace,"onUpdate:modelValue":o[7]||(o[7]=f=>n.value.whiteSpace=f),style:{width:"90px","margin-right":"10px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"自动换行",value:"pre-wrap"}),g.createVNode(r,{label:"单行",value:"nowrap"}),g.createVNode(r,{label:"普通",value:"normal"})]),_:1},8,["modelValue"]),g.createVNode(a,{modelValue:n.value.textOverflow,"onUpdate:modelValue":o[8]||(o[8]=f=>n.value.textOverflow=f),style:{width:"90px"}},{default:g.withCtx(()=>[g.createVNode(r,{label:"裁剪",value:"clip"}),g.createVNode(r,{label:"省略号",value:"ellipsis"})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(l,{label:"字体颜色"},{default:g.withCtx(()=>[g.createVNode(h,{modelValue:n.value.color,"onUpdate:modelValue":o[9]||(o[9]=f=>n.value.color=f),"show-alpha":"",placeholder:"颜色",style:{width:"200px",height:"30px"}},null,8,["modelValue"])]),_:1}),g.createVNode(l,{label:"文本内容"},{default:g.withCtx(()=>[g.createVNode(u,{modelValue:n.value.text,"onUpdate:modelValue":o[10]||(o[10]=f=>n.value.text=f),style:{width:"200px"},rows:3,type:"textarea",placeholder:"请输入文本"},null,8,["modelValue"])]),_:1})]),_:1})}}},[["__scopeId","data-v-8c4d2068"]]),Iv={class:"propertyForm"},Pv={__name:"base",setup(i){var s;kn(),Ut();const t=g.inject("getCurCell")(),e=g.ref(t==null?void 0:t.isNode()),n=(s=t==null?void 0:t.getData())==null?void 0:s.type;return(o,r)=>(g.openBlock(),g.createElementBlock("div",Iv,[e.value?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createVNode(Mv),g.unref(n)==="text"?(g.openBlock(),g.createBlock(Tv,{key:0})):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createBlock(kv,{key:1}))]))}},Vr={__name:"JsonEditor",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(i,{emit:t}){const e=i,n=t,s=g.ref(null);let o=null;return g.onMounted(()=>{o=Lt.editor.create(s.value,{value:JSON.stringify(e.modelValue,null,2),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12}),o.onDidChangeModelContent(()=>{try{const r=o.getValue(),a=JSON.parse(r);n("update:modelValue",a)}catch{}})}),g.watch(()=>e.modelValue,r=>{const a=o.getValue(),l=JSON.stringify(r,null,2);a!==l&&o.setValue(l)},{deep:!0}),g.onBeforeUnmount(()=>{o==null||o.dispose()}),(r,a)=>(g.openBlock(),g.createElementBlock("div",{ref_key:"editorContainer",ref:s,class:"json-editor"},null,512))}};function Ov(i,t=!1){const e=i.length;let n=0,s="",o=0,r=16,a=0,l=0,c=0,h=0,u=0;function d(w,x){let E=0,S=0;for(;E<w;){let v=i.charCodeAt(n);if(v>=48&&v<=57)S=S*16+v-48;else if(v>=65&&v<=70)S=S*16+v-65+10;else if(v>=97&&v<=102)S=S*16+v-97+10;else break;n++,E++}return E<w&&(S=-1),S}function f(w){n=w,s="",o=0,r=16,u=0}function m(){let w=n;if(i.charCodeAt(n)===48)n++;else for(n++;n<i.length&&In(i.charCodeAt(n));)n++;if(n<i.length&&i.charCodeAt(n)===46)if(n++,n<i.length&&In(i.charCodeAt(n)))for(n++;n<i.length&&In(i.charCodeAt(n));)n++;else return u=3,i.substring(w,n);let x=n;if(n<i.length&&(i.charCodeAt(n)===69||i.charCodeAt(n)===101))if(n++,(n<i.length&&i.charCodeAt(n)===43||i.charCodeAt(n)===45)&&n++,n<i.length&&In(i.charCodeAt(n))){for(n++;n<i.length&&In(i.charCodeAt(n));)n++;x=n}else u=3;return i.substring(w,x)}function p(){let w="",x=n;for(;;){if(n>=e){w+=i.substring(x,n),u=2;break}const E=i.charCodeAt(n);if(E===34){w+=i.substring(x,n),n++;break}if(E===92){if(w+=i.substring(x,n),n++,n>=e){u=2;break}switch(i.charCodeAt(n++)){case 34:w+='"';break;case 92:w+="\\";break;case 47:w+="/";break;case 98:w+="\b";break;case 102:w+="\f";break;case 110:w+=`
|
|
817
|
+
`;break;case 114:w+="\r";break;case 116:w+=" ";break;case 117:const v=d(4);v>=0?w+=String.fromCharCode(v):u=4;break;default:u=5}x=n;continue}if(E>=0&&E<=31)if(Pi(E)){w+=i.substring(x,n),u=2;break}else u=6;n++}return w}function b(){if(s="",u=0,o=n,l=a,h=c,n>=e)return o=e,r=17;let w=i.charCodeAt(n);if(zr(w)){do n++,s+=String.fromCharCode(w),w=i.charCodeAt(n);while(zr(w));return r=15}if(Pi(w))return n++,s+=String.fromCharCode(w),w===13&&i.charCodeAt(n)===10&&(n++,s+=`
|
|
818
|
+
`),a++,c=n,r=14;switch(w){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,s=p(),r=10;case 47:const x=n-1;if(i.charCodeAt(n+1)===47){for(n+=2;n<e&&!Pi(i.charCodeAt(n));)n++;return s=i.substring(x,n),r=12}if(i.charCodeAt(n+1)===42){n+=2;const E=e-1;let S=!1;for(;n<E;){const v=i.charCodeAt(n);if(v===42&&i.charCodeAt(n+1)===47){n+=2,S=!0;break}n++,Pi(v)&&(v===13&&i.charCodeAt(n)===10&&n++,a++,c=n)}return S||(n++,u=1),s=i.substring(x,n),r=13}return s+=String.fromCharCode(w),n++,r=16;case 45:if(s+=String.fromCharCode(w),n++,n===e||!In(i.charCodeAt(n)))return r=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=m(),r=11;default:for(;n<e&&y(w);)n++,w=i.charCodeAt(n);if(o!==n){switch(s=i.substring(o,n),s){case"true":return r=8;case"false":return r=9;case"null":return r=7}return r=16}return s+=String.fromCharCode(w),n++,r=16}}function y(w){if(zr(w)||Pi(w))return!1;switch(w){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function C(){let w;do w=b();while(w>=12&&w<=15);return w}return{setPosition:f,getPosition:()=>n,scan:t?C:b,getToken:()=>r,getTokenValue:()=>s,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>l,getTokenStartCharacter:()=>o-h,getTokenError:()=>u}}function zr(i){return i===32||i===9}function Pi(i){return i===10||i===13}function In(i){return i>=48&&i<=57}var Id;(function(i){i[i.lineFeed=10]="lineFeed",i[i.carriageReturn=13]="carriageReturn",i[i.space=32]="space",i[i._0=48]="_0",i[i._1=49]="_1",i[i._2=50]="_2",i[i._3=51]="_3",i[i._4=52]="_4",i[i._5=53]="_5",i[i._6=54]="_6",i[i._7=55]="_7",i[i._8=56]="_8",i[i._9=57]="_9",i[i.a=97]="a",i[i.b=98]="b",i[i.c=99]="c",i[i.d=100]="d",i[i.e=101]="e",i[i.f=102]="f",i[i.g=103]="g",i[i.h=104]="h",i[i.i=105]="i",i[i.j=106]="j",i[i.k=107]="k",i[i.l=108]="l",i[i.m=109]="m",i[i.n=110]="n",i[i.o=111]="o",i[i.p=112]="p",i[i.q=113]="q",i[i.r=114]="r",i[i.s=115]="s",i[i.t=116]="t",i[i.u=117]="u",i[i.v=118]="v",i[i.w=119]="w",i[i.x=120]="x",i[i.y=121]="y",i[i.z=122]="z",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.asterisk=42]="asterisk",i[i.backslash=92]="backslash",i[i.closeBrace=125]="closeBrace",i[i.closeBracket=93]="closeBracket",i[i.colon=58]="colon",i[i.comma=44]="comma",i[i.dot=46]="dot",i[i.doubleQuote=34]="doubleQuote",i[i.minus=45]="minus",i[i.openBrace=123]="openBrace",i[i.openBracket=91]="openBracket",i[i.plus=43]="plus",i[i.slash=47]="slash",i[i.formFeed=12]="formFeed",i[i.tab=9]="tab"})(Id||(Id={})),new Array(20).fill(0).map((i,t)=>" ".repeat(t));const Pn=200;new Array(Pn).fill(0).map((i,t)=>`
|
|
819
|
+
`+" ".repeat(t)),new Array(Pn).fill(0).map((i,t)=>"\r"+" ".repeat(t)),new Array(Pn).fill(0).map((i,t)=>`\r
|
|
820
|
+
`+" ".repeat(t)),new Array(Pn).fill(0).map((i,t)=>`
|
|
821
|
+
`+" ".repeat(t)),new Array(Pn).fill(0).map((i,t)=>"\r"+" ".repeat(t)),new Array(Pn).fill(0).map((i,t)=>`\r
|
|
822
|
+
`+" ".repeat(t));var Fr;(function(i){i.DEFAULT={allowTrailingComma:!1}})(Fr||(Fr={}));function Nv(i,t){const e=[],n=new Object;let s;const o={value:{},offset:0,length:0,type:"object",parent:void 0};let r=!1;function a(l,c,h,u){o.value=l,o.offset=c,o.length=h,o.type=u,o.colonOffset=void 0,s=o}try{Rv(i,{onObjectBegin:(l,c)=>{if(t<=l)throw n;s=void 0,r=t>l,e.push("")},onObjectProperty:(l,c,h)=>{if(t<c||(a(l,c,h,"property"),e[e.length-1]=l,t<=c+h))throw n},onObjectEnd:(l,c)=>{if(t<=l)throw n;s=void 0,e.pop()},onArrayBegin:(l,c)=>{if(t<=l)throw n;s=void 0,e.push(0)},onArrayEnd:(l,c)=>{if(t<=l)throw n;s=void 0,e.pop()},onLiteralValue:(l,c,h)=>{if(t<c||(a(l,c,h,Dv(l)),t<=c+h))throw n},onSeparator:(l,c,h)=>{if(t<=c)throw n;if(l===":"&&s&&s.type==="property")s.colonOffset=c,r=!1,s=void 0;else if(l===","){const u=e[e.length-1];typeof u=="number"?e[e.length-1]=u+1:(r=!0,e[e.length-1]=""),s=void 0}}})}catch(l){if(l!==n)throw l}return{path:e,previousNode:s,isAtPropertyKey:r,matches:l=>{let c=0;for(let h=0;c<l.length&&h<e.length;h++)if(l[c]===e[h]||l[c]==="*")c++;else if(l[c]!=="**")return!1;return c===l.length}}}function Rv(i,t,e=Fr.DEFAULT){const n=Ov(i,!1),s=[];let o=0;function r(D){return D?()=>o===0&&D(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(D){return D?N=>o===0&&D(N,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function l(D){return D?N=>o===0&&D(N,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice()):()=>!0}function c(D){return D?()=>{o>0?o++:D(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice())===!1&&(o=1)}:()=>!0}function h(D){return D?()=>{o>0&&o--,o===0&&D(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}const u=c(t.onObjectBegin),d=l(t.onObjectProperty),f=h(t.onObjectEnd),m=c(t.onArrayBegin),p=h(t.onArrayEnd),b=l(t.onLiteralValue),y=a(t.onSeparator),C=r(t.onComment),w=a(t.onError),x=e&&e.disallowComments,E=e&&e.allowTrailingComma;function S(){for(;;){const D=n.scan();switch(n.getTokenError()){case 4:v(14);break;case 5:v(15);break;case 3:v(13);break;case 1:x||v(11);break;case 2:v(12);break;case 6:v(16);break}switch(D){case 12:case 13:x?v(10):C();break;case 16:v(1);break;case 15:case 14:break;default:return D}}}function v(D,N=[],G=[]){if(w(D),N.length+G.length>0){let ot=n.getToken();for(;ot!==17;){if(N.indexOf(ot)!==-1){S();break}else if(G.indexOf(ot)!==-1)break;ot=S()}}}function M(D){const N=n.getTokenValue();return D?b(N):(d(N),s.push(N)),S(),!0}function k(){switch(n.getToken()){case 11:const D=n.getTokenValue();let N=Number(D);isNaN(N)&&(v(2),N=0),b(N);break;case 7:b(null);break;case 8:b(!0);break;case 9:b(!1);break;default:return!1}return S(),!0}function T(){return n.getToken()!==10?(v(3,[],[2,5]),!1):(M(!1),n.getToken()===6?(y(":"),S(),J()||v(4,[],[2,5])):v(5,[],[2,5]),s.pop(),!0)}function P(){u(),S();let D=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(D||v(4,[],[]),y(","),S(),n.getToken()===2&&E)break}else D&&v(6,[],[]);T()||v(4,[],[2,5]),D=!0}return f(),n.getToken()!==2?v(7,[2],[]):S(),!0}function R(){m(),S();let D=!0,N=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(N||v(4,[],[]),y(","),S(),n.getToken()===4&&E)break}else N&&v(6,[],[]);D?(s.push(0),D=!1):s[s.length-1]++,J()||v(4,[],[4,5]),N=!0}return p(),D||s.pop(),n.getToken()!==4?v(8,[4],[]):S(),!0}function J(){switch(n.getToken()){case 3:return R();case 1:return P();case 10:return M(!0);default:return k()}}return S(),n.getToken()===17?e.allowEmptyContent?!0:(v(4,[],[]),!1):J()?(n.getToken()!==17&&v(9,[],[]),!0):(v(4,[],[]),!1)}function Dv(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(i){if(Array.isArray(i))return"array"}else return"null";return"object"}default:return"null"}}var Pd;(function(i){i[i.None=0]="None",i[i.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",i[i.UnexpectedEndOfString=2]="UnexpectedEndOfString",i[i.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",i[i.InvalidUnicode=4]="InvalidUnicode",i[i.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",i[i.InvalidCharacter=6]="InvalidCharacter"})(Pd||(Pd={}));var Od;(function(i){i[i.OpenBraceToken=1]="OpenBraceToken",i[i.CloseBraceToken=2]="CloseBraceToken",i[i.OpenBracketToken=3]="OpenBracketToken",i[i.CloseBracketToken=4]="CloseBracketToken",i[i.CommaToken=5]="CommaToken",i[i.ColonToken=6]="ColonToken",i[i.NullKeyword=7]="NullKeyword",i[i.TrueKeyword=8]="TrueKeyword",i[i.FalseKeyword=9]="FalseKeyword",i[i.StringLiteral=10]="StringLiteral",i[i.NumericLiteral=11]="NumericLiteral",i[i.LineCommentTrivia=12]="LineCommentTrivia",i[i.BlockCommentTrivia=13]="BlockCommentTrivia",i[i.LineBreakTrivia=14]="LineBreakTrivia",i[i.Trivia=15]="Trivia",i[i.Unknown=16]="Unknown",i[i.EOF=17]="EOF"})(Od||(Od={}));const Lv=Nv;var Nd;(function(i){i[i.InvalidSymbol=1]="InvalidSymbol",i[i.InvalidNumberFormat=2]="InvalidNumberFormat",i[i.PropertyNameExpected=3]="PropertyNameExpected",i[i.ValueExpected=4]="ValueExpected",i[i.ColonExpected=5]="ColonExpected",i[i.CommaExpected=6]="CommaExpected",i[i.CloseBraceExpected=7]="CloseBraceExpected",i[i.CloseBracketExpected=8]="CloseBracketExpected",i[i.EndOfFileExpected=9]="EndOfFileExpected",i[i.InvalidCommentToken=10]="InvalidCommentToken",i[i.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",i[i.UnexpectedEndOfString=12]="UnexpectedEndOfString",i[i.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",i[i.InvalidUnicode=14]="InvalidUnicode",i[i.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",i[i.InvalidCharacter=16]="InvalidCharacter"})(Nd||(Nd={}));const Qv={style:{display:"flex","justify-content":"space-between"}},Vv={class:"preview-output"},zv={key:0,class:"muted"},Fv=`// data: 当前 JSON 对象
|
|
823
|
+
// $: 全局变量对象(可选)
|
|
824
|
+
// 返回需要展示的数值
|
|
825
|
+
const { payload } = data
|
|
826
|
+
// 示例:使用 data 或 $ 中的值
|
|
827
|
+
return payload.value`,Uv=kt({__name:"JsonRuleEditor",props:{modelValue:{type:Object,default:()=>({})},rule:{type:String,default:""},globals:{type:Object,default:()=>({})}},emits:["update:rule","close"],setup(i,{emit:t}){const e=i,n=t,s=g.ref(null),o=g.ref(null),r=g.ref(null);let a=null,l=null,c=null,h=null;const u=g.ref({visible:!1,x:0,y:0}),d=g.ref(""),f=g.ref(""),m=g.ref(""),p=g.ref({visible:!1,x:0,y:0,path:"",key:"",value:void 0}),b=()=>{if(!a)return;a.setValue(`const description = data.pointTemp.description;
|
|
828
|
+
const value = data.payload.value;
|
|
829
|
+
if(!description) return value
|
|
830
|
+
const a = description.split(";").map(i => {
|
|
831
|
+
return {
|
|
832
|
+
label: i.split(':')[1], value: i.split(':')[0]
|
|
833
|
+
}
|
|
834
|
+
})
|
|
835
|
+
a.length = a.length - 1
|
|
836
|
+
return a.find(i => i.value == value)?.label || '--'`)},y=g.computed(()=>e.modelValue||{}),C=g.computed(()=>e.globals||{}),w=g.computed(()=>{if(!d.value)return"selected";const O=d.value.split(".").filter(Boolean);return O[O.length-1]||"selected"}),x=(O,Q)=>Q.split(".").filter(Boolean).reduce((U,tt)=>U?U[tt]:void 0,O),E=()=>{if(f.value="",!a)return"";try{return new Function("data","$",a.getValue())(y.value,C.value)}catch(O){return f.value=O.message,""}},S=O=>{try{return JSON.stringify(O??{},null,2)}catch{return""}},v=()=>{p.value.visible=!1},M=()=>{u.value.visible=!1},k=()=>{if(!p.value.path){v();return}d.value=p.value.path,G(w.value,p.value.path),v()},T=(O,Q=!1)=>{var Tt;if(!O&&O!==0)return;const U=String(O),tt=()=>{!P(U)&&Q&&R(U)};(Tt=navigator==null?void 0:navigator.clipboard)!=null&&Tt.writeText?navigator.clipboard.writeText(U).catch(()=>{tt()}).finally(()=>{Q&&R(U)}):(tt(),Q&&R(U))},P=O=>{try{const Q=document.createElement("textarea");Q.value=O,document.body.appendChild(Q),Q.select();const U=document.execCommand("copy");return document.body.removeChild(Q),U}catch{return!1}},R=O=>{if(!a)return;const Q=a.getModel();if(!Q)return;const U=a.getPosition();Q.pushEditOperations([],[{range:new Lt.Range(U.lineNumber,U.column,U.lineNumber,U.column),text:O,forceMoveMarkers:!0}],()=>null),a.focus()},J=()=>{if(!p.value.key)return v();T(p.value.key,!0),v()},D=()=>{if(p.value.value===void 0)return v();const O=typeof p.value.value=="object"?JSON.stringify(p.value.value):p.value.value;T(O,!0),v()},N=()=>{if(!p.value.path)return v();const O=p.value.path.startsWith("data.")?p.value.path:`data.${p.value.path}`;T(O,!0),v()},G=(O,Q)=>{if(!a)return;const U=a.getModel();if(!U)return;const tt=a.getPosition(),Tt=Q.startsWith("data.")?Q:`data.${Q}`,ft=`
|
|
837
|
+
// ${Q}
|
|
838
|
+
const ${O} = ${Tt};
|
|
839
|
+
`;U.pushEditOperations([],[{range:new Lt.Range(tt.lineNumber,tt.column,tt.lineNumber,tt.column),text:ft,forceMoveMarkers:!0}],()=>null),a.focus()},ot=O=>{var Dd,Ld;if(!l)return;const Q=l.getModel();if(!Q)return;const U=((Dd=O.target)==null?void 0:Dd.position)||O.position;if(!U)return;const tt=Q.getOffsetAt(U),Tt=Q.getValue(),ft=Lv(Tt,tt),On=ft.path.join(".");if(!On)return;const Us=x(y.value,On),Ks=ft.path.length?String(ft.path[ft.path.length-1]):"",Js=(Ld=s.value)==null?void 0:Ld.getBoundingClientRect();p.value={visible:!0,x:Js?O.event.browserEvent.clientX-Js.left:0,y:Js?O.event.browserEvent.clientY-Js.top:0,path:On,key:Ks,value:Us}},yt=O=>{var U;O.event.preventDefault(),O.event.stopPropagation();const Q=(U=s.value)==null?void 0:U.getBoundingClientRect();u.value={visible:!0,x:Q?O.event.browserEvent.clientX-Q.left:0,y:Q?O.event.browserEvent.clientY-Q.top:0}},gt=async()=>{if(!a)return M();const O=a.getModel().getValueInRange(a.getSelection());if(!O)return M();try{await navigator.clipboard.writeText(O)}catch{}M()},lt=async()=>{if(!a)return M();const O=a.getSelection(),Q=a.getModel().getValueInRange(O);if(!Q)return M();try{await navigator.clipboard.writeText(Q),a.executeEdits("custom-cut",[{range:O,text:"",forceMoveMarkers:!0}])}catch{}M()},V=async()=>{if(!a)return M();try{const O=await navigator.clipboard.readText();if(!O)return M();a.executeEdits("custom-paste",[{range:a.getSelection(),text:O,forceMoveMarkers:!0}])}catch{}M()},Z=async()=>{if(!a)return M();try{const O=a.getAction("editor.action.formatDocument");O&&await O.run()}catch{}M()},it=()=>{n("close")};g.onMounted(()=>{a=Lt.editor.create(o.value,{value:e.rule||Fv,language:"javascript",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:14}),a.updateOptions({contextmenu:!1}),a.onContextMenu(O=>yt(O)),a.onMouseDown(()=>M()),a.onKeyDown(()=>M()),h=a.addAction({id:"custom-paste",label:"粘贴",contextMenuGroupId:"9_cutcopypaste",run:async O=>{try{const Q=await navigator.clipboard.readText();if(!Q)return;O.executeEdits("custom-paste",[{range:O.getSelection(),text:Q,forceMoveMarkers:!0}])}catch(Q){console.warn("Clipboard read blocked",Q)}}}),c=Lt.languages.registerCompletionItemProvider("javascript",{triggerCharacters:["$","."],provideCompletionItems(O,Q){const tt=O.getValueInRange(new Lt.Range(Q.lineNumber,1,Q.lineNumber,Q.column)).match(/\$\.[\w$]*$/);if(!tt)return{suggestions:[]};const Tt=tt[0].split(".").pop()||"",ft=new Lt.Range(Q.lineNumber,Q.column-Tt.length,Q.lineNumber,Q.column);return{suggestions:Object.keys(C.value||{}).map(Ks=>({label:Ks,kind:Lt.languages.CompletionItemKind.Variable,insertText:Ks,range:ft}))}}}),l=Lt.editor.create(r.value,{value:S(y.value),language:"json",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},fontSize:13,readOnly:!0,contextmenu:!1}),l.onContextMenu(O=>{O.event.preventDefault(),O.event.stopPropagation(),ot(O)}),a.updateOptions({contextmenu:!1}),a.onContextMenu(O=>{yt(O)}),a.addCommand(Lt.KeyMod.CtrlCmd|Lt.KeyCode.KeyC,()=>gt()),a.addCommand(Lt.KeyMod.CtrlCmd|Lt.KeyCode.KeyX,()=>lt()),a.addCommand(Lt.KeyMod.CtrlCmd|Lt.KeyCode.KeyV,()=>V()),a.onDidChangeModelContent(()=>{try{const O=a.getValue();n("update:rule",O)}catch{}}),document.addEventListener("click",v),document.addEventListener("click",M),H()}),g.watch(()=>e.rule,O=>{if(!a)return;const Q=O||"";a.getValue()!==Q&&a.setValue(Q)}),g.watch(y,O=>{l&&l.setValue(S(O)),H()}),g.onBeforeUnmount(()=>{a==null||a.dispose(),l==null||l.dispose(),c==null||c.dispose(),h==null||h.dispose(),u.value.visible=!1,document.removeEventListener("click",v),document.removeEventListener("click",M)});const H=()=>{m.value=E()};return(O,Q)=>(g.openBlock(),g.createElementBlock("div",{class:"json-rule-editor",ref_key:"rootRef",ref:s},[Q[2]||(Q[2]=g.createElementVNode("div",{class:"editor-header"},[g.createElementVNode("span",null,"数据 JSON(右键选取字段为变量)")],-1)),g.createElementVNode("div",{ref_key:"dataEditorContainer",ref:r,class:"monaco-pane slim"},null,512),p.value.visible?(g.openBlock(),g.createElementBlock("div",{key:0,class:"context-menu",style:g.normalizeStyle({left:p.value.x+"px",top:p.value.y+"px"})},[g.createElementVNode("div",{class:"menu-item",onClick:J},"复制属性"),g.createElementVNode("div",{class:"menu-item",onClick:D},"复制值"),g.createElementVNode("div",{class:"menu-item",onClick:N},"复制属性路径"),g.createElementVNode("div",{class:"menu-item",onClick:k},"设置为变量(并插入解析函数)"),Q[0]||(Q[0]=g.createElementVNode("div",{class:"menu-item disabled"},"设置为全局变量(待实现)",-1))],4)):g.createCommentVNode("",!0),g.createElementVNode("div",{class:"editor-header",style:{"margin-top":"8px"}},[Q[1]||(Q[1]=g.createElementVNode("span",null,"解析函数(JS,需 return 数值)",-1)),g.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:b},"填充示例")]),g.createElementVNode("div",{ref_key:"editorContainer",ref:o,class:"monaco-pane"},null,512),u.value.visible?(g.openBlock(),g.createElementBlock("div",{key:1,class:"context-menu",style:g.normalizeStyle({left:u.value.x+"px",top:u.value.y+"px"})},[g.createElementVNode("div",{class:"menu-item",onClick:lt},"剪切"),g.createElementVNode("div",{class:"menu-item",onClick:gt},"复制"),g.createElementVNode("div",{class:"menu-item",onClick:V},"粘贴"),g.createElementVNode("div",{class:"menu-item",onClick:Z},"格式化")],4)):g.createCommentVNode("",!0),g.createElementVNode("div",Qv,[g.createElementVNode("div",null,[g.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:H},"运行测试"),g.createElementVNode("span",Vv,g.toDisplayString(m.value),1),f.value?(g.openBlock(),g.createElementBlock("span",zv,"错误:"+g.toDisplayString(f.value),1)):g.createCommentVNode("",!0)]),g.createElementVNode("button",{class:"ghost-btn",type:"button",onClick:it},"确认生效")]),Q[3]||(Q[3]=g.createElementVNode("div",{class:"helper"},[g.createElementVNode("div",{class:"helper-title"},"使用方式"),g.createElementVNode("p",null,"data 为当前 JSON 数据,$ 为全局变量对象;右键字段插入示例代码(data.xxx 或 $?.xxx)。在下方函数里 return 需要展示的数值。")],-1))],512))}},[["__scopeId","data-v-34d6364d"]]),Kv={class:"dataBox"},Jv={style:{padding:"10px 0","margin-bottom":"10px"}},jv={style:{padding:"10px 0","margin-bottom":"10px"}},Gv={class:"param-table"},Yv={class:"param-table__toolbar"},Hv={style:{padding:"10px 0"}},_v={style:{padding:"10px 0","margin-bottom":"10px"}},Wv=kt({__name:"data",setup(i){const t=g.inject("getCurCell")(),e=g.inject("topoApi"),n=g.ref(t.getData()),s=g.ref(n.value.dataSource.parse||""),o=g.ref(!1),r=g.ref({}),a=g.ref(null),l={test:"aaa"},c=g.ref({}),h=async()=>{var C;if(a.value===null)return It.ElMessage.error("请获取数据!"),!1;d.value.type==="opcua"&&(c.value={payload:(C=a.value)==null?void 0:C.payload,pointTemp:n.value.dataSource.point}),d.value.type==="http"&&(c.value=a.value),o.value=!0},u=()=>{a.value=null},d=g.ref(n.value.dataSource);Array.isArray(d.value.params)||(d.value.params=[]);const f=async()=>{const C=await e.readPoints([n.value.path]);console.log(C),a.value=C||{error:"未找到数据"}},m=()=>{d.value.params.push({label:"",value:""})},p=C=>{d.value.params.splice(C,1)},b=async()=>{if(!d.value.httpUrl)return It.ElMessage.error("请输入请求地址"),!1;let C={};for(let x of d.value.params)if(x.label)C[x.label]=x.value;else return It.ElMessage.error("请完善请求参数"),!1;let w;try{w=await e.httpRequest({...d.value,params:C})}catch{w={error:"数据获取失败"}}a.value=w,console.log(w)},y=()=>{var w,x,E,S;if(((w=d.value.name)==null?void 0:w.length)==0)return It.ElMessage.error("请选择数据关联!"),!1;if(a.value===null)return It.ElMessage.error("请获取数据!"),!1;let C={dataSource:{}};if(s.value)try{const v=new Function("data","$",s.value);if(d.value.type=="opcua"){const M=v({payload:(x=a.value)==null?void 0:x.payload,pointTemp:n.value.dataSource.point},r.value);M&&Array.isArray(M)?M.forEach((k,T)=>{d.value.name[T]&&(C[d.value.name[T]]=k)}):C[d.value.name[0]]=M}C.dataSource.parse=s.value,t.setData(C),o.value=!1}catch(v){It.ElMessage.error("解析失败!"),console.log(v)}else C[d.value.name]=((S=(E=a.value)==null?void 0:E.payload)==null?void 0:S.value)||"--",t.setData(C),o.value=!1};return(C,w)=>{const x=g.resolveComponent("el-option"),E=g.resolveComponent("el-select"),S=g.resolveComponent("el-form-item"),v=g.resolveComponent("el-input"),M=g.resolveComponent("el-button"),k=g.resolveComponent("el-radio"),T=g.resolveComponent("el-radio-group"),P=g.resolveComponent("el-table-column"),R=g.resolveComponent("el-table"),J=g.resolveComponent("el-form"),D=g.resolveComponent("el-dialog");return g.openBlock(),g.createElementBlock("div",Kv,[g.createVNode(J,{class:"panelList",size:"small"},{default:g.withCtx(()=>[g.createVNode(S,{label:"数据类型"},{default:g.withCtx(()=>[g.createVNode(E,{modelValue:d.value.type,"onUpdate:modelValue":w[0]||(w[0]=N=>d.value.type=N),onChange:u},{default:g.withCtx(()=>[g.createVNode(x,{value:"none",label:"无"}),g.createVNode(x,{value:"opcua",label:"OPCUA点位"}),g.createVNode(x,{value:"http",label:"HTTP接口"}),g.createVNode(x,{value:"mock",label:"Mock模拟"})]),_:1},8,["modelValue"])]),_:1}),d.value.type!=="none"?(g.openBlock(),g.createBlock(S,{key:0,label:"数据关联"},{default:g.withCtx(()=>[g.createVNode(E,{modelValue:d.value.name,"onUpdate:modelValue":w[1]||(w[1]=N=>d.value.name=N),multiple:"","collapse-tags":""},{default:g.withCtx(()=>[g.createVNode(x,{value:"text",label:"文本"}),g.createVNode(x,{value:"color",label:"字体颜色"}),g.createVNode(x,{value:"backgroundColor",label:"背景颜色"})]),_:1},8,["modelValue"])]),_:1})):g.createCommentVNode("",!0),d.value.type==="opcua"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(S,{label:"点位地址"},{default:g.withCtx(()=>[g.createVNode(v,{modelValue:d.value.path,"onUpdate:modelValue":w[2]||(w[2]=N=>d.value.path=N)},null,8,["modelValue"])]),_:1}),g.createElementVNode("div",Jv,[g.createVNode(M,{type:"primary",style:{width:"100%"},onClick:f},{default:g.withCtx(()=>[...w[10]||(w[10]=[g.createTextVNode("获取数据",-1)])]),_:1})]),g.createVNode(Vr,{modelValue:a.value,"onUpdate:modelValue":w[3]||(w[3]=N=>a.value=N),style:{height:"400px"}},null,8,["modelValue"]),g.createElementVNode("div",jv,[g.createVNode(M,{type:"primary",style:{width:"100%"},onClick:h},{default:g.withCtx(()=>[...w[11]||(w[11]=[g.createTextVNode("数据解析",-1)])]),_:1})])],64)):g.createCommentVNode("",!0),d.value.type==="http"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:2},[g.createVNode(S,{label:"接口类型"},{default:g.withCtx(()=>[g.createVNode(T,{modelValue:d.value.httpType,"onUpdate:modelValue":w[4]||(w[4]=N=>d.value.httpType=N)},{default:g.withCtx(()=>[g.createVNode(k,{value:"GET"},{default:g.withCtx(()=>[...w[12]||(w[12]=[g.createTextVNode("GET",-1)])]),_:1}),g.createVNode(k,{value:"POST"},{default:g.withCtx(()=>[...w[13]||(w[13]=[g.createTextVNode("POST",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),g.createVNode(S,{label:"接口地址"},{default:g.withCtx(()=>[g.createVNode(v,{modelValue:d.value.httpUrl,"onUpdate:modelValue":w[5]||(w[5]=N=>d.value.httpUrl=N),autosize:{minRows:2,maxRows:4},type:"textarea"},null,8,["modelValue"])]),_:1}),g.createElementVNode("div",Gv,[g.createElementVNode("div",Yv,[w[15]||(w[15]=g.createElementVNode("div",null,"请求参数",-1)),g.createVNode(M,{size:"small",type:"primary",plain:"",onClick:m},{default:g.withCtx(()=>[...w[14]||(w[14]=[g.createTextVNode("新增参数",-1)])]),_:1})]),g.createVNode(R,{data:d.value.params,size:"small",border:"",height:"180"},{default:g.withCtx(()=>[g.createVNode(P,{prop:"label",label:"字段名"},{default:g.withCtx(({row:N})=>[g.createVNode(v,{modelValue:N.label,"onUpdate:modelValue":G=>N.label=G,modelModifiers:{trim:!0},placeholder:"字段名"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),g.createVNode(P,{prop:"value",label:"值"},{default:g.withCtx(({row:N})=>[g.createVNode(v,{modelValue:N.value,"onUpdate:modelValue":G=>N.value=G,placeholder:"值"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),g.createVNode(P,{label:"操作",width:"60"},{default:g.withCtx(({$index:N})=>[g.createVNode(M,{link:"",type:"danger",onClick:G=>p(N)},{default:g.withCtx(()=>[...w[16]||(w[16]=[g.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])]),g.createElementVNode("div",Hv,[g.createVNode(M,{type:"primary",style:{width:"100%"},onClick:b},{default:g.withCtx(()=>[...w[17]||(w[17]=[g.createTextVNode("获取数据",-1)])]),_:1})]),g.createVNode(Vr,{modelValue:a.value,"onUpdate:modelValue":w[6]||(w[6]=N=>a.value=N),style:{height:"300px"}},null,8,["modelValue"]),g.createElementVNode("div",_v,[g.createVNode(M,{type:"primary",style:{width:"100%"},onClick:h},{default:g.withCtx(()=>[...w[18]||(w[18]=[g.createTextVNode("数据解析",-1)])]),_:1})])],64)):g.createCommentVNode("",!0),d.value.type==="mock"?(g.openBlock(),g.createBlock(Vr,{key:3,modelValue:n.value,"onUpdate:modelValue":w[7]||(w[7]=N=>n.value=N),style:{height:"600px"}},null,8,["modelValue"])):g.createCommentVNode("",!0)]),_:1}),g.createVNode(D,{modelValue:o.value,"onUpdate:modelValue":w[9]||(w[9]=N=>o.value=N),title:"实时数据解析",width:"800","align-center":""},{default:g.withCtx(()=>[g.createVNode(Uv,{"model-value":c.value,rule:s.value,"onUpdate:rule":w[8]||(w[8]=N=>s.value=N),globals:l,onClose:y},null,8,["model-value","rule"])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-cb8da12f"]]),qv={class:"prop"},Xv={class:"tabContainer"},$v=["onClick"],Zv={class:"activeLine"},tE={key:0,class:"main"},eE=kt({__name:"index",setup(i){const t=Ut(),e=kn(),{targetType:n,tabs:s,activeTab:o,cellId:r}=pe.storeToRefs(e),a=h=>{o.value=h};let l=r.value?t.graph.getCellById(r.value):null;g.provide("getCurCell",()=>l),g.provide("cellId",r);const c=g.ref(!0);return g.watch(r,()=>{console.log("cellId",r.value),l=t.graph.getCellById(r.value),c.value=!1,g.nextTick(()=>{c.value=!0})}),(h,u)=>(g.openBlock(),g.createElementBlock("div",qv,[g.createElementVNode("div",Xv,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(g.unref(s),(d,f)=>(g.openBlock(),g.createElementBlock("div",{key:f,class:g.normalizeClass(["tabItem",{active:g.unref(o)===f}]),onClick:m=>a(f)},[g.createTextVNode(g.toDisplayString(d)+" ",1),g.withDirectives(g.createElementVNode("div",Zv,null,512),[[g.vShow,g.unref(o)===f]])],10,$v))),128))]),c.value?(g.openBlock(),g.createElementBlock("div",tE,[g.unref(n)==="blank"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.unref(o)===0?(g.openBlock(),g.createBlock(Sv,{key:0})):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.unref(o)===0?(g.openBlock(),g.createBlock(Pv,{key:0})):g.unref(o)===1?(g.openBlock(),g.createBlock(Wv,{key:1})):g.createCommentVNode("",!0)],64))])):g.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b4a4e65e"]]),nE={class:"ems-editor"},iE={class:"ems-editor__workspace"},Ur=Object.assign({name:"EmsEditor"},{__name:"index",props:{services:{type:Object,default:()=>({})},width:{type:Number,default:1920},height:{type:Number,default:1080}},emits:["ready","exit"],setup(i,{emit:t}){const e=Tn(),n=kn(),s=Ut(),o=i,r={setItem(l,c){c!==void 0&&window.localStorage.setItem(l,JSON.stringify(c))},getItem(l){let c=window.localStorage.getItem(l);return JSON.parse(c)},removeItem(l){window.localStorage.removeItem(l)},clear(){window.localStorage.clear()}},a={async getAllMenus(){var c;let l=[];return(c=o.services)!=null&&c.getAllMenus?l=await o.services.getAllMenus()||[]:l=r.getItem("menus")||[{id:"1",parentId:"0",name:"首页",children:[{id:crypto.randomUUID(),parentId:"1",name:"首页概览",style:{},value:{}}]}],r.setItem("menus",l),l},async getMenu(l){var c;if((c=o.services)!=null&&c.getMenu)return await o.services.getMenu(l)||{};{let h=r.getItem("menus")||[];for(let u of h)if(u.children){for(let d of u.children)if(d.id===l)return d}return{}}},async addMenu({parent:l,parentNameNew:c,name:h}){var u;if((u=o.services)!=null&&u.addMenu)return await o.services.addMenu({parent:l,parentNameNew:c,name:h});{let d=r.getItem("menus")||[],f=null,m=crypto.randomUUID(),p="";if(l==="0")p=crypto.randomUUID(),f={name:h,id:m,parentId:p,style:{},value:{}},d.push({name:c,id:p,parentId:"0",children:[f]});else{const b=d.find(y=>y.id===l);b&&(p=b.id,b.children.push({name:h,id:m,parentId:p,style:{},value:{}}),f={name:h,id:m,parentId:p,style:{},value:{}})}return r.setItem(m,f),r.setItem("menus",d),f}},async saveMenus(l){var h;const c=await this.getMenu(l.id);if(c&&(c.name=l.name,c.style=l.style,c.value=l.value),(h=o.services)!=null&&h.saveMenus)await o.services.saveMenus(l);else{let u=r.getItem("menus")||[];for(let d of u){const f=d.children.findIndex(m=>m.id===l.id);f>-1&&(d.children[f]=l)}r.setItem("menus",u),r.setItem(l.id,l)}},async removeMenu(l){var c;if((c=o.services)!=null&&c.removeMenu)await o.services.removeMenu(l);else{let h=r.getItem("menus")||[];if(this.getMenu(l)){const d=h.find(f=>{var m;return(m=f.children)==null?void 0:m.some(p=>p.id===l)});d&&(d.children=d.children.filter(f=>f.id!==l),d.children.length===0&&(h=h.filter(f=>f.id!==d.id))),r.setItem("menus",h)}r.removeItem(l)}},async getDeviceList(){var c;let l=[];if((c=o.services)!=null&&c.getDeviceList)l=await o.services.getDeviceList();else{const h=[{id:"2010960121314734082",deviceName:"干接点",deviceType:"OTHERS",deviceNo:"DIDO",templateName:"DIDO_test.json",templateId:"2010957702564474882",pointList:[{id:"2010957702568669185",templateId:"2010957702564474882",tag:"en_sts",name:"使能STS",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0001, uint, AB]",description:"0:失能;1:启动使能;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863489",templateId:"2010957702564474882",tag:"connect_statu",name:"电网闸",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0002, uint, AB]",description:"0:断开;1:闭合;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863490",templateId:"2010957702564474882",tag:"icb_sign",name:"外源断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0003, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863491",templateId:"2010957702564474882",tag:"icb_ctrl",name:"外源断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0004, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863492",templateId:"2010957702564474882",tag:"lcb_sign",name:"负载断路器反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0005, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863493",templateId:"2010957702564474882",tag:"lcb_ctrl",name:"负载断路器合闸控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0006, uint, AB]",description:"0:断开;1:合闸;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863494",templateId:"2010957702564474882",tag:"dg_sign",name:"发动机启停状态",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0007, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863495",templateId:"2010957702564474882",tag:"dg_ctrl",name:"发动机控制",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0008, uint, AB]",description:"0:停止;1:启动;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null},{id:"2010957702572863496",templateId:"2010957702564474882",tag:"ats",name:"ATS反馈信号",property:"realdata",history:"change",type:"int",offsetValue:null,scale:null,prot:"[3, 0x0009, uint, AB]",description:"0:合闸柴发;1:合闸电网;",uniqueIdentifier:null,accessType:1,isAlarm:0,createTime:null,updateTime:null}]}];for(const u of h){const d=u.pointList;d&&Array.isArray(d)&&d.length>0&&l.push({id:u.id,label:u.deviceName,data:u,children:d.map(f=>({id:f.id,label:f.name,data:{...f,nodeId:`ns=1;s=${u.deviceType}.${f.tag}`}}))})}}return l},async readPoints(l){var c,h;return(c=o.services)!=null&&c.readPoints?await((h=o.services)==null?void 0:h.readPoints(l)):{payload:{nodeId:"ns=1;s=PV.RatReActivePowerPer",value:1,statusCode:"Good",sourceTimestamp:"2026-01-16T02:26:37.533Z",serverTimestamp:"2026-01-16T02:26:37.533Z"}}},async httpRequest(l){var c,h;return(c=o.services)!=null&&c.readPoints?await((h=o.services)==null?void 0:h.httpRequest(l)):{}}};return g.provide("topoApi",a),g.onMounted(()=>{}),g.onBeforeUnmount(()=>{e.$reset(),n.$reset(),s.$reset()}),(l,c)=>(g.openBlock(),g.createElementBlock("div",nE,[g.createElementVNode("div",iE,[g.createVNode(vv),g.createVNode(Fx,{width:o.width,height:o.height},null,8,["width","height"]),g.createVNode(eE)])]))}}),Rd=kt({__name:"preview",props:{menu:{type:Object,required:!0}},setup(i){const t=i,e=g.ref(null);let n=null;const s=Rr();return g.watch(()=>t.menu,o=>{n&&(n.clearCells(),n.resize(o.style.width,o.style.height),n.fromJSON(o.value),n.drawBackground({color:o.style.backgroundColor,image:o.style.backgroundImage,size:"cover"}))},{deep:!0}),g.onMounted(()=>{const{width:o,height:r}=t.menu.style;n=new B({container:e.value,width:o,height:r,interacting:!1,selecting:!1,keyboard:!1,mousewheel:!1,panning:!1}),Lr(),n.fromJSON(t.menu.value),n.drawBackground({color:t.menu.style.backgroundColor,image:t.menu.style.backgroundImage,size:"cover"})}),g.onBeforeUnmount(()=>{n&&n.dispose()}),(o,r)=>(g.openBlock(),g.createElementBlock("div",{class:"previewBox",onClick:r[0]||(r[0]=(...a)=>o.close&&o.close(...a))},[g.createElementVNode("div",{ref_key:"container",ref:e,class:"ems-preview"},null,512),g.createVNode(g.unref(s))]))}},[["__scopeId","data-v-d961a1ef"]]);window._iconfont_svg_string_5087053='<svg><symbol id="icon-jiesuo1" viewBox="0 0 1024 1024"><path d="M768.25422 0q48.810328 0 94.061569 18.303873t80.333664 50.33565 56.436941 74.740814 21.354518 91.519364l0 150.49851-123.042701 0 0-122.025819q0-64.063555-36.099305-99.654419t-97.112214-35.590864q-54.911619 0-88.468719 35.590864t-33.5571 99.654419l0 124.059583-128.12711 0 0-152.532274q0-48.810328 19.320755-91.519364t53.386296-74.740814 80.333664-50.33565 101.179742-18.303873zM766.220457 693.513406l0 87.451837 0 47.793446q0 27.455809-9.660377 51.860973t-26.438928 41.692155-39.658391 27.455809-50.33565 10.168818l-514.542205 0q-27.455809 0-49.82721-9.660377t-38.641509-26.438928-24.913605-39.14995-8.643496-47.793446l0-323.368421q0-28.472691 19.829196-47.793446t46.268123-19.320755l629.449851 0q28.472691 0 47.793446 19.320755t19.320755 47.793446l0 179.988083z" ></path></symbol><symbol id="icon-jianlizuhe1" viewBox="0 0 1024 1024"><path d="M891.8 65h-632c-35.5 0-64.4 28.8-64.4 64.4v125.3h-66.3c-35.5 0-64.4 28.8-64.4 64.4v575.6c0 35.5 28.8 64.4 64.4 64.4h572.6c35.5 0 64.4-28.8 64.4-64.4v-65.3h125.6c35.5 0 64.4-28.8 64.4-64.4V129.4c0.1-35.6-28.7-64.4-64.3-64.4zM702.2 894.6v0.1c0 0.1-0.2 0.2-0.2 0.2H129.1c-0.1 0-0.2-0.2-0.2-0.2V319v-0.1c0-0.1 0.2-0.2 0.2-0.2h0.1l66.3 0.1S194 794.1 194 797.4c0 17.7 14.3 32 32 32h476.2v65.2zM259.5 129.2c0-0.1 0.2-0.2 0.2-0.2h632.2c0.1 0 0.2 0.2 0.2 0.2V765.1c0 0.1-0.2 0.2-0.2 0.2H259.5V129.2z" ></path></symbol><symbol id="icon-suoding1" viewBox="0 0 1024 1024"><path d="M860.069521 429.487623h-73.242947v-170.422692C786.826574 116.337371 670.888872 0.272064 528.240764 0.272064c-142.650515 0-258.720638 116.065307-258.720638 258.792867v170.422692H196.339779c-35.281619 0-63.879618 28.612445-63.879618 63.91814v466.606275c0 35.368294 28.597999 63.983146 63.879618 63.983147h663.79234c35.29125 0 63.821834-28.614852 63.821835-63.983147V493.405763c-0.004815-35.310511-28.590776-63.91814-63.884433-63.91814zM564.114664 738.867504v101.889098c0 4.552855-3.765556 8.388233-8.385825 8.388233h-54.91355c-4.678053 0-8.446016-3.837785-8.446017-8.388233v-101.889098c-25.800316-13.201114-43.672259-39.665939-43.672259-70.68362 0-43.888947 35.613874-79.584681 79.481153-79.584682 43.932285 0 79.548567 35.695734 79.548566 79.584682 0.062599 31.020089-17.811752 57.482507-43.612068 70.68362z m123.476036-309.379881H368.883605v-166.202091c0-87.912723 71.55278-159.501618 159.417351-159.501618s159.287337 71.588895 159.287337 159.501618l0.002407 166.202091z" ></path></symbol><symbol id="icon-xingzhuang-juxing" viewBox="0 0 1024 1024"><path d="M864 896H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h704a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zM192 832h640V192H192v640z" ></path></symbol><symbol id="icon-shuzhi" viewBox="0 0 1024 1024"><path d="M921.6 21.162667H102.4c-37.546667 0-68.266667 30.788267-68.266667 68.4032v819.950933c0 37.546667 30.72 68.334933 68.266667 68.334933h819.2c37.546667 0 68.266667-30.72 68.266667-68.266666V89.4976c0-37.546667-30.72-68.334933-68.266667-68.334933z m0 854.2208c0 20.48-13.653333 34.133333-34.133333 34.133333h-750.933334c-20.48 0-34.133333-13.653333-34.133333-34.133333V123.767467c0-20.548267 13.653333-34.2016 34.133333-34.2016h750.933334c20.48 0 34.133333 13.653333 34.133333 34.133333v751.616z" ></path><path d="M274.568533 365.704533h36.0448V658.090667h-47.9232V423.458133a165.546667 165.546667 0 0 1-66.7648 35.6352v-47.5136c13.1072-3.2768 27.0336-9.0112 41.7792-17.2032 14.7456-9.0112 27.0336-18.432 36.864-28.672z m200.2944-5.7344c28.2624 0 51.6096 8.192 70.0416 24.576 18.0224 16.384 27.0336 37.2736 27.0336 63.488 0 25.3952-9.8304 48.3328-28.672 69.2224-11.4688 12.288-31.9488 27.8528-60.6208 47.104-29.9008 19.6608-47.9232 36.864-54.4768 51.6096h144.1792v42.1888H368.366933c0-29.9008 9.4208-55.7056 29.0816-77.824 10.6496-12.288 33.1776-30.3104 67.1744-53.6576 18.8416-13.1072 31.9488-24.1664 40.1408-32.768 12.6976-14.336 19.2512-29.9008 19.2512-46.2848 0-15.9744-4.5056-27.8528-12.6976-35.6352-8.6016-7.7824-21.2992-11.4688-38.0928-11.4688-18.0224 0-31.5392 6.144-40.5504 18.432-9.0112 11.4688-13.9264 29.0816-14.7456 52.0192H370.005333c0.4096-32.768 9.8304-58.9824 28.672-79.0528 19.2512-21.2992 44.6464-31.9488 76.1856-31.9488z m244.1216 0c29.4912 0 53.6576 6.9632 71.68 21.2992 17.6128 14.336 26.624 33.9968 26.624 59.392 0 31.9488-16.384 53.248-48.7424 63.8976 17.2032 5.3248 30.72 13.1072 39.7312 23.7568a61.986133 61.986133 0 0 1 14.7456 42.5984c0 27.0336-9.4208 49.152-28.2624 66.3552-19.6608 17.6128-45.4656 26.624-77.4144 26.624-30.3104 0-54.8864-7.7824-73.3184-23.3472-20.48-17.2032-31.9488-42.5984-34.4064-75.3664h48.7424c0.8192 18.8416 6.5536 33.5872 18.0224 43.8272 10.24 9.4208 23.7568 14.336 40.5504 14.336 18.432 0 33.1776-5.3248 43.8272-15.5648a47.240533 47.240533 0 0 0 14.336-34.816c0-16.7936-5.3248-29.0816-15.1552-36.864-9.8304-8.192-24.1664-11.8784-43.008-11.8784h-20.48V488.106667h20.48c17.2032 0 30.3104-3.6864 39.3216-11.0592 8.6016-7.3728 13.1072-18.432 13.1072-32.768 0-14.336-4.096-24.9856-11.8784-32.3584-8.6016-7.3728-21.2992-11.0592-38.0928-11.0592-17.2032 0-30.3104 4.096-39.7312 12.6976-9.8304 8.6016-15.5648 21.7088-17.2032 39.3216h-47.104c2.4576-29.4912 13.1072-52.4288 32.768-68.8128 18.432-16.384 42.1888-24.1664 70.8608-24.1664z" ></path></symbol><symbol id="icon-xianduan" viewBox="0 0 1024 1024"><path d="M0.034239 975.503207L976.222236 0l48.400922 48.435162L48.435162 1023.945217z" ></path></symbol><symbol id="icon-yulan" viewBox="0 0 1024 1024"><path d="M512.122 272.146c-247.216 0-412.027 247.216-412.027 247.216s164.811 247.216 412.027 247.216c247.216 0 412.027-247.216 412.027-247.216S759.217 272.146 512.122 272.146z m0 410.207c-90.537 0-163.962-73.424-163.962-163.962s73.424-163.962 163.962-163.962c90.537 0 163.962 73.424 163.962 163.962-0.122 90.658-73.424 163.962-163.962 163.962z m-82.406-163.476c0 21.482 8.86 42.841 24.03 58.012s36.53 24.03 58.012 24.03 42.841-8.86 58.012-24.03c15.17-15.17 24.03-36.53 24.03-58.012s-8.86-42.841-24.03-58.012c-15.17-15.17-36.53-24.03-58.012-24.03s-42.841 8.86-58.012 24.03c-15.17 15.292-24.03 36.53-24.03 58.012z" ></path></symbol><symbol id="icon-tubiao" viewBox="0 0 1024 1024"><path d="M437.996 697.519V586.722H327.195c-61.187 0-110.797 49.61-110.797 110.797 0 61.195 49.61 110.797 110.797 110.797 61.192 0 110.801-49.602 110.801-110.797z m55.399 0c0 91.789-74.411 166.195-166.2 166.195C235.41 863.714 161 789.308 161 697.519c0-91.789 74.41-166.195 166.195-166.195h166.2v166.195z m92.328 0V586.722H696.52c61.195 0 110.796 49.61 110.796 110.797 0 61.195-49.601 110.797-110.796 110.797-61.188 0-110.797-49.602-110.797-110.797z m-55.399 0c0 91.789 74.41 166.195 166.196 166.195 91.789 0 166.199-74.406 166.199-166.195 0-91.789-74.41-166.195-166.199-166.195H530.324v166.195z m-92.328-369.324v110.801H327.195c-61.187 0-110.797-49.61-110.797-110.801 0-61.188 49.61-110.797 110.797-110.797 61.192 0 110.801 49.609 110.801 110.797z m55.399 0c0-91.785-74.411-166.195-166.2-166.195C235.41 162 161 236.41 161 328.195c0 91.789 74.41 166.199 166.195 166.199h166.2V328.195z m92.328 0v110.801H696.52c61.195 0 110.796-49.61 110.796-110.801 0-61.188-49.601-110.797-110.796-110.797-61.188 0-110.797 49.609-110.797 110.797z m-55.399 0C530.324 236.41 604.734 162 696.52 162c91.789 0 166.199 74.41 166.199 166.195 0 91.789-74.41 166.199-166.199 166.199H530.324V328.195z m0 0" ></path></symbol><symbol id="icon-tupian" viewBox="0 0 1024 1024"><path d="M335.36 440.32c38.4 0 71.68-30.72 71.68-71.68 0-38.4-30.72-71.68-71.68-71.68-38.4 0-71.68 30.72-71.68 71.68 2.56 40.96 33.28 71.68 71.68 71.68z m0 0M652.8 396.8L445.44 691.2 337.92 540.16 158.72 793.6h704L652.8 396.8z m0 0" ></path><path d="M934.4 107.52H89.6c-20.48 0-35.84 15.36-35.84 35.84V883.2c0 20.48 15.36 35.84 35.84 35.84h844.8c20.48 0 35.84-15.36 35.84-35.84V143.36c0-20.48-15.36-35.84-35.84-35.84z m-35.84 739.84H125.44V176.64h775.68v670.72h-2.56z m0 0" ></path></symbol><symbol id="icon-wenzi" viewBox="0 0 1024 1024"><path d="M64.1 66v303.7l39.5-1.3c13.6-110.8 102.6-186.4 153.2-199 50.7-12.6 148.3 1.1 148.3 1.1s-1.3 625.2-1.3 669.2c0 44.1-59.3 63-59.3 63l-79 1.3-1.2 55.4h493.1v-54.1h-90.2c-40.8-3.8-65.4-56.7-65.4-56.7l1.1-684.5s61.8-11.3 150.8 5.1c89 16.4 164.3 204.1 164.3 204.1h39.5V66H64.1z" ></path></symbol><symbol id="icon-xinjian" viewBox="0 0 1024 1024"><path d="M618 958.5H202c-44.8 0-81.3-34.1-81.3-76v-740c0-41.9 36.5-76 81.3-76h610.5c44.8 0 81.3 34.1 81.3 76v521.9c0 12.8-10.4 23.1-23.1 23.1s-23.1-10.4-23.1-23.1V142.5c0-16.4-15.7-29.7-35-29.7H202c-19.3 0-35 13.3-35 29.7v740c0 16.4 15.7 29.7 35 29.7h416c12.8 0 23.1 10.4 23.1 23.1 0.1 12.8-10.3 23.2-23.1 23.2z" ></path><path d="M738.4 360.5H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h462.5c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1zM584.3 595.1H276c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h308.3c12.8 0 23.1 10.4 23.1 23.1 0 12.7-10.3 23.1-23.1 23.1zM878.8 826.3H614.6c-12.8 0-23.1-10.4-23.1-23.1 0-12.8 10.4-23.1 23.1-23.1h264.3c12.8 0 23.1 10.4 23.1 23.1 0 12.8-10.4 23.1-23.2 23.1z" ></path><path d="M746.7 958.5c-12.8 0-23.1-10.4-23.1-23.1V671.1c0-12.8 10.4-23.1 23.1-23.1 12.8 0 23.1 10.4 23.1 23.1v264.3c0 12.7-10.3 23.1-23.1 23.1z" ></path></symbol><symbol id="icon-qingkong" viewBox="0 0 1024 1024"><path d="M274.56 798.997333l19.434667-25.130666-33.792 68.565333a18.133333 18.133333 0 0 0 11.562666 25.536l59.733334 16a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.818667 35.626667-35.989333 45.290666-48.469333l19.456-25.130667-33.813333 68.565333a18.133333 18.133333 0 0 0 11.562667 25.536l84.48 22.634667a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-35.989333 45.269333-48.469333l19.456-25.130667-33.813333 68.565333A18.133333 18.133333 0 0 0 535.530667 938.666667l72.106666 19.328a18.133333 18.133333 0 0 0 17.28-4.48c20.522667-19.84 35.626667-36.010667 45.269334-48.490667l19.456-25.130667-33.813334 68.586667a18.133333 18.133333 0 0 0 11.584 25.514667l86.421334 23.338666 3.84-0.213333c13.269333-0.704 29.056-5.034667 43.84-12.8 29.781333-15.701333 48.170667-43.2 52.181333-78.250667 2.133333-18.517333 4.778667-38.549333 8.405333-63.530666 1.642667-11.221333 2.944-20.010667 6.229334-41.834667 11.050667-73.322667 14.634667-101.034667 17.130666-133.674667l0.938667-12.373333 2.837333-2.922667 12.330667-1.344a41.813333 41.813333 0 0 0 24.810667-11.221333c10.730667-10.24 14.805333-25.386667 11.093333-42.197333l-37.546667-171.584c-3.029333-13.696-11.264-27.946667-23.146666-39.829334-11.648-11.626667-25.92-20.138667-39.893334-23.893333L723.626667 331.306667l-2.261334-3.925334L774.250667 130.133333c8.32-31.061333-11.754667-63.744-44.970667-72.64l-79.509333-21.312c-33.194667-8.896-66.922667 9.365333-75.264 40.426667l-52.842667 197.269333-3.925333 2.261334-118.101334-31.637334c-13.994667-3.754667-30.634667-3.498667-46.506666 0.746667-16.256 4.352-30.506667 12.586667-39.957334 22.933333l-118.314666 129.792c-11.605333 12.714667-15.658667 27.84-11.52 42.090667 4.16 14.229333 15.850667 25.194667 32.896 30.528l13.610666 4.266667 2.133334 3.882666-3.626667 13.802667c-21.12 79.850667-52.885333 136.917333-85.717333 150.890667-47.530667 20.202667-72.938667 49.429333-78.421334 85.034666-5.034667 32.682667 9.28 67.114667 37.589334 91.541334l22.037333 8.341333 74.666667 20.010667a42.666667 42.666667 0 0 0 41.216-11.050667c15.274667-15.274667 26.88-28.032 34.837333-38.293333z m551.381333-396.565333c14.144 3.797333 29.952 19.2 32.768 32l34.56 157.781333a10.666667 10.666667 0 0 1-13.184 12.586667L240.64 433.493333a10.666667 10.666667 0 0 1-5.12-17.493333l108.8-119.36c8.832-9.685333 30.229333-15.146667 44.373333-11.349333l141.333334 37.866666a21.333333 21.333333 0 0 0 26.133333-15.082666l58.304-217.642667a21.333333 21.333333 0 0 1 26.133333-15.082667l77.056 20.650667a21.333333 21.333333 0 0 1 15.082667 26.133333l-58.325333 217.642667a21.333333 21.333333 0 0 0 15.082666 26.112l136.448 36.565333zM315.456 701.568c-33.664 45.141333-64.597333 79.082667-92.8 101.802667l-5.909333 4.778666-2.837334 0.597334-88.106666-24.106667-2.922667-3.2c-13.034667-14.165333-19.370667-31.04-16.981333-46.592 3.285333-21.333333 22.058667-39.338667 53.205333-52.586667 31.722667-13.482667 59.818667-47.104 82.922667-99.904 10.026667-22.954667 18.88-48.725333 26.389333-76.586666l3.882667-14.4 3.904-2.261334 566.165333 151.701334 2.346667 3.306666-0.789334 12.224c-1.984 30.592-30.336 229.397333-32.128 244.906667-2.346667 20.416-11.306667 34.986667-27.605333 44.394667a73.237333 73.237333 0 0 1-21.397333 8.106666l-5.013334 0.725334-60.373333-16.170667 11.242667-20.288c8.277333-14.976 22.656-43.84 43.093333-86.613333a21.12 21.12 0 0 0-9.962667-28.16l-3.136-1.493334a21.333333 21.333333 0 0 0-26.261333 6.485334c-33.642667 45.056-64.533333 78.912-92.672 101.546666l-5.909333 4.757334-2.837334 0.597333-52.544-14.08 11.114667-20.266667c3.562667-6.485333 7.04-13.013333 10.453333-19.626666 7.04-13.504 17.898667-35.797333 32.597334-66.816a21.290667 21.290667 0 0 0-9.984-28.309334l-3.029334-1.450666a21.333333 21.333333 0 0 0-26.368 6.442666c-33.6 45.013333-64.469333 78.826667-92.608 101.482667l-5.909333 4.757333-2.837333 0.597334-52.138667-13.973334 11.114667-20.266666c3.242667-5.888 6.72-12.416 10.453333-19.626667 6.997333-13.461333 17.962667-35.946667 32.896-67.434667a20.970667 20.970667 0 0 0-10.112-28.010666l-3.328-1.536a21.333333 21.333333 0 0 0-26.069333 6.613333c-33.642667 45.056-64.554667 78.976-92.778667 101.696l-5.909333 4.757333-2.837334 0.597334-32.64-8.746667 11.093334-20.245333c3.541333-6.506667 7.04-13.034667 10.453333-19.626667 6.976-13.482667 17.941333-35.968 32.874667-67.456a21.056 21.056 0 0 0-10.069334-28.074667l-3.242666-1.514666a21.333333 21.333333 0 0 0-26.154667 6.549333z" ></path></symbol><symbol id="icon-shanchu" viewBox="0 0 1024 1024"><path d="M202.666667 256h-42.666667a32 32 0 0 1 0-64h704a32 32 0 0 1 0 64H266.666667v565.333333a53.333333 53.333333 0 0 0 53.333333 53.333334h384a53.333333 53.333333 0 0 0 53.333333-53.333334V352a32 32 0 0 1 64 0v469.333333c0 64.8-52.533333 117.333333-117.333333 117.333334H320c-64.8 0-117.333333-52.533333-117.333333-117.333334V256z m224-106.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z m-32 288a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z m170.666666 0a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z" ></path></symbol><symbol id="icon-jia" viewBox="0 0 1024 1024"><path d="M580.722174 437.990403 580.722174 78.171384 436.794158 78.171384 436.794158 437.990403 76.975139 437.990403 76.975139 581.918419 436.794158 581.918419 436.794158 941.737438 580.722174 941.737438 580.722174 581.918419 940.542216 581.918419 940.542216 437.990403Z" ></path></symbol><symbol id="icon-baocun" viewBox="0 0 1024 1024"><path d="M814.805 128a51.179 51.179 0 0 1 51.179 51.179V844.01a51.179 51.179 0 0 1-51.179 51.157H201.173a51.179 51.179 0 0 1-51.178-51.157V179.179A51.179 51.179 0 0 1 201.173 128h613.654zM329.024 434.837a51.093 51.093 0 0 1-51.179-51.093V179.157h-76.672v664.854h613.76V179.179H738.22v204.48a51.179 51.179 0 0 1-51.179 51.178H329.024z m0-51.093h357.995V179.157H329.024v204.587z m357.91 204.501a25.557 25.557 0 1 1 0.085 51.072H329.024a25.536 25.536 0 1 1 0-51.072h357.91z" ></path></symbol><symbol id="icon-daochu" viewBox="0 0 1024 1024"><path d="M293.632 645.248c91.456-86.784 183.552-220.544 346.88-211.584a20.8 20.8 0 0 1 20.224 20.8v59.392a21.376 21.376 0 0 0 34.432 16.64l211.2-171.2a21.376 21.376 0 0 0 0-33.28l-210.24-192a21.952 21.952 0 0 0-35.648 16.64v60.096a20.8 20.8 0 0 1-17.856 20.8c-280.704 61.76-351.36 391.104-348.992 413.696zM192 960a138.176 138.176 0 0 1-129.984-152.512L64 832V192a116.48 116.48 0 0 1 128-128c-108.8 1.024 256 0 256 0a28.224 28.224 0 0 1 29.76 27.84A35.968 35.968 0 0 1 448 128H192a53.12 53.12 0 0 0-64 64c1.536-37.504 0 640 0 640a52.8 52.8 0 0 0 64 64c49.536-0.448 640 0 640 0a52.48 52.48 0 0 0 64-64c-0.64 105.152 0-256 0-256a36.48 36.48 0 0 1 27.264-38.4A33.216 33.216 0 0 1 960 576v256a116.48 116.48 0 0 1-128 128c-50.56-0.448-640 0-640 0z" ></path></symbol><symbol id="icon-daoru" viewBox="0 0 1024 1024"><path d="M512 384a42.666667 42.666667 0 0 1 42.666667 42.666667v341.333333h130.986666a21.333333 21.333333 0 0 1 14.250667 5.504l2.688 2.901333a21.333333 21.333333 0 0 1-4.010667 29.866667l-165.717333 126.464a32 32 0 0 1-38.912-0.042667l-164.48-126.464A21.333333 21.333333 0 0 1 342.442667 768H469.333333v-341.333333a42.666667 42.666667 0 0 1 42.666667-42.666667z m229.674667 298.368A42.666667 42.666667 0 0 1 746.666667 597.333333H853.333333V170.666667H170.666667v426.666666h106.666666a42.666667 42.666667 0 0 1 0 85.333334H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333334-85.333334h682.666666a85.333333 85.333333 0 0 1 85.333334 85.333334v426.666666a85.333333 85.333333 0 0 1-85.333334 85.333334h-106.666666z" ></path></symbol><symbol id="icon-huanyuan" viewBox="0 0 1024 1024"><path d="M909.637 478.524c-15.444-189.946-167.065-345.049-356.655-364.38-99.805-10.176-193.011 16.474-267.901 67.887l18.467-68.842c5.725-21.337-6.933-43.274-28.27-48.998s-43.274 6.934-48.998 28.271l-41.455 154.536c-5.724 21.337 6.933 43.273 28.271 48.998l154.536 41.455c21.337 5.724 43.273-6.934 48.998-28.271 5.724-21.337-6.934-43.274-28.271-48.998l-54.194-14.538c58.917-39.301 131.457-59.686 208.999-52.061 147.885 14.543 268.327 132.461 285.589 280.053 23.02 196.82-133.879 363.973-327.45 358.219-135.107-4.017-252.98-96.111-294.938-224.602-17.513-53.632-18.92-105.027-9.92-152.849 3.188-16.946-4.238-34.086-19.172-42.707l-0.049-0.028c-23.737-13.705-54.358-0.164-59.404 26.777-7.724 41.233-9.128 84.686-2.965 129.403 25.571 185.535 181.03 330.336 367.878 343.176C727.656 927.857 929.6 724.049 909.637 478.524z" ></path></symbol><symbol id="icon-menu-fold" viewBox="0 0 1024 1024"><path d="M85.312 170.688h853.376V256H85.312V170.688z m0 179.328L266.752 512l-181.44 162.048V349.952zM384 469.312h554.688v85.376H384V469.248zM85.312 768h853.376v85.312H85.312V768z" ></path></symbol><symbol id="icon-icon_image" viewBox="0 0 1024 1024"><path d="M85.333333 852.992V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666h768a42.666667 42.666667 0 0 1 42.666667 42.666666v640a42.666667 42.666667 0 0 1-42.666667 42.666667H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-0.341333z m768-157.610667V256H170.666667v493.994667l127.744-127.744a42.666667 42.666667 0 0 1 47.018666-9.045334l126.293334 54.314667 184.789333-146.346667a42.666667 42.666667 0 0 1 59.52 6.485334L853.333333 695.381333zM837.418667 810.666667l-160.853334-196.48-171.818666 136.021333a42.666667 42.666667 0 0 1-43.349334 5.76l-123.093333-52.906667L230.656 810.666667h606.762667zM341.333333 512a85.333333 85.333333 0 1 1 0-170.666667 85.333333 85.333333 0 0 1 0 170.666667z" ></path></symbol><symbol id="icon-icon_chart" viewBox="0 0 1024 1024"><path d="M128 864V128H96v768h896v-32H128z" ></path><path d="M225.6 352h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V385.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M417.6 128h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V161.6A33.6 33.6 0 0 1 417.6 128z" ></path><path d="M609.6 544h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128V577.6a33.6 33.6 0 0 1 33.6-33.6z" ></path><path d="M801.6 704h60.8a33.6 33.6 0 0 1 33.6 33.6V800h-128v-62.4a33.6 33.6 0 0 1 33.6-33.6z" ></path></symbol><symbol id="icon-jichukongjian" viewBox="0 0 1024 1024"><path d="M912 662.016l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 662.016c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.84 271.872 163.072c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.872-163.136 59.712 35.84c19.456 11.712 19.456 30.592 0 42.24z" ></path><path d="M912 501.12l-352.256 211.392c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 501.12c-19.456-11.712-19.456-30.656 0-42.24l59.712-35.904 271.872 163.136c15.616 9.344 35.456 14.464 55.936 14.464 20.48 0 40.32-5.12 55.936-14.464l271.936-163.2 59.712 35.904c19.392 11.712 19.392 30.656 0 42.24z" ></path><path d="M912 340.224L559.744 551.68c-10.752 5.952-22.912 8.96-35.2 8.768-12.8 0-25.6-2.944-35.264-8.768L136.96 340.224c-19.456-11.584-19.456-30.592 0-42.24l352.32-211.456c9.728-5.76 22.528-8.704 35.2-8.704 12.736 0 25.472 2.88 35.2 8.704l352.32 211.456c19.456 11.648 19.456 30.656 0 42.24z" ></path></symbol><symbol id="icon-icon-relativity" viewBox="0 0 1024 1024"><path d="M352 352v-192a64 64 0 0 1 64-64h448a64 64 0 0 1 64 64v448a64 64 0 0 1-64 64h-192v192a64 64 0 0 1-64 64h-448a64 64 0 0 1-64-64v-448a64 64 0 0 1 64-64h192z m64-192v192h192a64 64 0 0 1 64 64v192h192v-448h-448z m192 512h-192a64 64 0 0 1-64-64v-192h-192v448h448v-192z m0-64v-192h-192v192h192z" ></path></symbol><symbol id="icon-root-list" viewBox="0 0 1024 1024"><path d="M85.333333 85.333333h853.333334v853.333334H85.333333V85.333333z m85.333334 85.333334v682.666666h682.666666V170.666667H170.666667z m85.333333 149.333333h512v85.333333H256v-85.333333z m0 170.666667h341.333333v85.333333H256v-85.333333z" ></path></symbol><symbol id="icon-control-platform" viewBox="0 0 1024 1024"><path d="M512 36.48l426.688 237.056v476.928L512 987.456l-426.688-236.992V273.536L512 36.544zM170.688 379.52v320.704l298.624 165.952V537.6l-298.624-158.08z m384 486.656l298.624-165.952v-320.64L554.688 537.6v328.512zM512 463.744l303.744-160.832L512 134.144 208.256 302.912 512 463.744z" ></path></symbol><symbol id="icon-icon-yonghu" viewBox="0 0 1024 1024"><path d="M511.744 96a253.184 253.184 0 0 1 252.8 252.928c0 91.904-49.216 172.544-122.688 216.832 146.24 50.24 253.632 181.824 253.632 331.584a32 32 0 0 1-64 0c0-156.864-146.432-289.408-319.744-289.408C338.432 607.936 192 740.48 192 897.344a32 32 0 0 1-64 0c0-149.76 107.328-281.28 253.568-331.648a252.992 252.992 0 0 1-122.752-216.768A253.184 253.184 0 0 1 511.744 96z m0 64a189.12 189.12 0 0 0-188.928 188.928 189.12 189.12 0 0 0 188.928 188.928 189.12 189.12 0 0 0 188.8-188.928A189.12 189.12 0 0 0 511.808 160z" ></path></symbol><symbol id="icon-a-shezhi" viewBox="0 0 1024 1024"><path d="M933.868272 511.691752a140.807706 140.807706 0 0 1 90.131728-131.067068 525.562914 525.562914 0 0 0-57.334136-138.64997 139.882962 139.882962 0 0 1-184.948826-184.948826A525.562914 525.562914 0 0 0 643.067068 0a140.376159 140.376159 0 0 1-262.134136 0A525.562914 525.562914 0 0 0 242.282962 57.334136a139.882962 139.882962 0 0 1-184.948826 184.948826A506.698134 506.698134 0 0 0 0 380.932932a140.376159 140.376159 0 0 1 0 262.134136 525.562914 525.562914 0 0 0 57.334136 138.64997 139.882962 139.882962 0 0 1 184.948826 184.948826 525.562914 525.562914 0 0 0 138.64997 57.334136 140.376159 140.376159 0 0 1 262.134136 0 525.562914 525.562914 0 0 0 138.64997-57.334136 139.882962 139.882962 0 0 1 184.948826-184.948826 506.698134 506.698134 0 0 0 57.334136-138.64997A140.807706 140.807706 0 0 1 933.868272 511.691752zM511.691752 652.437809A140.437809 140.437809 0 1 1 652.437809 511.691752 140.499458 140.499458 0 0 1 511.691752 652.437809z" ></path></symbol></svg>',(i=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var n,s,o,r,a,l=function(u,d){d.parentNode.insertBefore(u,d)};if(t&&!i.__iconfont__svg__cssinject__){i.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=i._iconfont_svg_string_5087053,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(s=function(){document.removeEventListener("DOMContentLoaded",s,!1),n()},document.addEventListener("DOMContentLoaded",s,!1)):document.attachEvent&&(o=n,r=i.document,a=!1,h(),r.onreadystatechange=function(){r.readyState=="complete"&&(r.onreadystatechange=null,c())})}function c(){a||(a=!0,o())}function h(){try{r.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const sE=[Ur],Fs=i=>{!i||Fs.installed||(i.use(It),sE.forEach(t=>{const e=t.name||t.__name;e&&i.component(e,t)}),Fs.installed=!0)},oE={install:Fs,EmsEditor:Ur,EmsPreview:Rd};ct.EmsEditor=Ur,ct.EmsPreview=Rd,ct.default=oE,ct.install=Fs,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|