var p$=Object.defineProperty;var h$=(t,e,n)=>e in t?p$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var hl=(t,e,n)=>h$(t,typeof e!="symbol"?e+"":e,n);import{dr as kg,eP as ed,dn as zo,eQ as IN,db as tm,eR as z_,eS as lp,eT as nm,eU as Qy,eV as Ku,ef as qd,dc as qa,eW as v$,dd as Kd,ea as hj,eX as m$,eY as H_,eZ as Qu,e6 as S1,e8 as N2,dk as rm,au as Zd,e_ as om,e$ as im,eg as Kg,f0 as k2,di as Yo,f1 as A1,dM as M1,ee as sp,dS as Ri,f2 as Pg,dj as Nh,f3 as Zg,f4 as X_,dR as Jd,dh as Es,df as _i,f5 as g$,f6 as vj,eE as ec,ed as Ll,f7 as y$,f8 as _$,f9 as Jg,fa as T1,fb as mj,dL as am,fc as gj,bL as tc,dg as Y_,at as kh,dQ as w_,dO as Hv,e9 as b$,ec as FN,eb as w$,as as yj,fd as _j,fe as E$,dm as C1,de as x$,ei as uw,ff as O$,fg as bj,fh as wj,fi as S$,fj as Ej,fk as A$,dp as M$,fl as T$,fm as C$,fn as N$,fo as cw,fp as k$,el as P$,fq as xj,dN as Oj,eh as P2,fr as Sj,fs as R2,ft as R$,dl as q_,fu as Aj,fv as D$,fw as Mj,fx as Tj,fy as j$,fz as L$,fA as I$,em as E_,eC as F$,fB as B$,fC as $$,aw as U$,fD as V$,fE as W$,fF as D2,fG as G$,fH as Cj,fI as z$,fJ as H$,ai as X$,eF as to,fK as Y$,ax as dw,fL as uA,fM as q$,fN as K$,fO as ws,fP as Z$,fQ as J$,av as Xv,fR as Q$,eG as Yv,fS as e9,eD as Vv,fT as Nj,fU as t9,fV as n9,fW as r9,ay as _r,aB as He,aV as K_,aD as ne,aE as Ne,aW as mn,aX as Ir,aH as k,aI as ee,aY as No,aF as bt,aG as j,b2 as Wn,c$ as cA,bX as mh,dw as BN,aJ as _e,bY as j2,aK as ft,b1 as Bn,aS as gn,cf as Ph,fX as ml,aQ as ja,aA as kj,aO as hr,aP as Pj,b6 as bo,b8 as Ql,bc as Rj,ch as Eh,cq as fw,fY as pw,bW as u0,aT as oi,aN as nc,aZ as Me,b7 as Rg,ce as Gs,cF as Dj,cj as x_,c1 as Xi,aC as Pt,c0 as L2,aM as kr,fZ as O_,ci as bs,d5 as Z_,bB as Dg,aU as Rh,f_ as o9,f$ as i9,g0 as jj,g1 as Lj,g2 as a9,g3 as l9,g4 as s9,g5 as u9,g6 as c9,g7 as Go,du as I2,dv as d9,cu as f9,bD as xh,dJ as p9,b3 as Oh,g8 as yu,cJ as h9,g9 as $N,ga as Lv,gb as v9,gc as F2,gd as B2,ge as m9,gf as g9,b4 as Ij,bZ as dA,az as y9,er as UN,cY as _9,bG as Qf,bH as Vs,bI as Bc,bK as Yl,bJ as sh}from"./admin-DBW881Vd.js";import{t as VN,a as WN,g as b9,i as Qd,n as w9,c as $2,l as c0,d as E9}from"./data-DQPbDZPO.js";import{_ as dp}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-CeMFmgi0.js";import{G as U2,d as x9,e as O9,f as S9,_ as Fj,c as Bj,b as A9,a as M9}from"./ToolDialog.vue_vue_type_style_index_0_lang-BnK4Bpqe.js";import{d as $j,c as lm,v as J_,e as T9,g as Uj,f as C9,a as ri,r as Vj}from"./reduce-DUOz4PWt.js";import{c as N9,a as k9,b as P9,e as Wj,f as Sh,m as R9,d as D9,h as hw}from"./min-C3Ljkllm.js";import{c as V2,b as N1,i as W2,p as Gj,n as G2,a as j9,d as z2,e as L9,f as I9,g as F9,h as B9,u as $9,j as U9,k as V9,l as zj,m as W9,r as G9,o as z9,q as H9,s as X9,t as Xo}from"./uniqBy-DYd3ZOQf.js";import{d as Hj,e as Y9,g as q9,h as K9,i as Z9,z as J9,s as Q9,m as e7,a as t7,b as n7,f as r7,c as o7,r as i7,u as a7}from"./zipObject-Qzmklie6.js";import{l as Xj,_ as Yj}from"./vue-draggable-plus-C7R4ksW6.js";import{_ as l7}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-DifCv9YD.js";import{_ as Fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const qj=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Kme}},Symbol.toStringTag,{value:"Module"}));var s7=NaN;function GN(t){return typeof t=="number"?t:kg(t)?s7:+t}function k1(t,e){return function(n,o){var r;if(n===void 0&&o===void 0)return e;if(n!==void 0&&(r=n),o!==void 0){if(r===void 0)return o;typeof n=="string"||typeof o=="string"?(n=ed(n),o=ed(o)):(n=GN(n),o=GN(o)),r=t(n,o)}return r}}var u7=k1(function(t,e){return t+e},0),c7="Expected a function";function d7(t,e){if(typeof e!="function")throw new TypeError(c7);return t=zo(t),function(){if(--t<1)return e.apply(this,arguments)}}var vw=IN&&new IN,Kj=vw?function(t,e){return vw.set(t,e),t}:tm;function S_(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=z_(t.prototype),o=t.apply(n,e);return lp(o)?o:n}}var f7=1;function p7(t,e,n){var o=e&f7,r=S_(t);function i(){var a=this&&this!==nm&&this instanceof i?r:t;return a.apply(o?n:this,arguments)}return i}var h7=Math.max;function Zj(t,e,n,o){for(var r=-1,i=t.length,a=n.length,s=-1,l=e.length,f=h7(i-a,0),h=Array(l+f),v=!o;++s1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(S7,`{ /* [wrapped with `+e+`] */ `)}var M7=1,T7=2,C7=8,N7=16,k7=32,P7=64,R7=128,D7=256,j7=512,L7=[["ary",R7],["bind",M7],["bindKey",T7],["curry",C7],["curryRight",N7],["flip",j7],["partial",k7],["partialRight",P7],["rearg",D7]];function I7(t,e){return Kd(L7,function(n){var o="_."+n[0];e&n[1]&&!hj(t,o)&&t.push(o)}),t.sort()}function tL(t,e,n){var o=e+"";return m$(t,A7(o,I7(O7(o),n)))}var F7=4,B7=8,zN=32,HN=64;function nL(t,e,n,o,r,i,a,s,l,f){var h=e&B7,v=h?a:void 0,b=h?void 0:a,E=h?i:void 0,O=h?void 0:i;e|=h?zN:HN,e&=~(h?HN:zN),e&F7||(e&=-4);var w=[t,e,r,E,v,O,b,s,l,f],S=n.apply(void 0,w);return fA(t)&&eL(S,w),S.placeholder=o,tL(S,t,e)}function Qg(t){var e=t;return e.placeholder}var $7=Math.min;function U7(t,e){for(var n=t.length,o=$7(e.length,n),r=Ku(t);o--;){var i=e[o];t[o]=H_(i,n)?r[i]:void 0}return t}var XN="__lodash_placeholder__";function Ah(t,e){for(var n=-1,o=t.length,r=0,i=[];++n1&&T.reverse(),h&&l0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var dU=1,fU=32,D1=Yo(function(t,e,n){var o=dU;if(n.length){var r=Ah(n,Qg(D1));o|=fU}return fp(t,o,e,n,r)});D1.placeholder={};var pU=im(function(t,e){return Kd(e,function(n){n=A1(n),M1(t,n,D1(t[n],t))}),t}),hU=1,vU=2,mU=32,q2=Yo(function(t,e,n){var o=hU|vU;if(n.length){var r=Ah(n,Qg(q2));o|=mU}return fp(e,o,t,n,r)});q2.placeholder={};function Dh(t,e,n){var o=t.length;return n=n===void 0?o:n,!e&&n>=o?t:sp(t,e,n)}var gU="\\ud800-\\udfff",yU="\\u0300-\\u036f",_U="\\ufe20-\\ufe2f",bU="\\u20d0-\\u20ff",wU=yU+_U+bU,EU="\\ufe0e\\ufe0f",xU="\\u200d",OU=RegExp("["+xU+gU+wU+EU+"]");function ey(t){return OU.test(t)}function SU(t){return t.split("")}var aL="\\ud800-\\udfff",AU="\\u0300-\\u036f",MU="\\ufe20-\\ufe2f",TU="\\u20d0-\\u20ff",CU=AU+MU+TU,NU="\\ufe0e\\ufe0f",kU="["+aL+"]",hA="["+CU+"]",vA="\\ud83c[\\udffb-\\udfff]",PU="(?:"+hA+"|"+vA+")",lL="[^"+aL+"]",sL="(?:\\ud83c[\\udde6-\\uddff]){2}",uL="[\\ud800-\\udbff][\\udc00-\\udfff]",RU="\\u200d",cL=PU+"?",dL="["+NU+"]?",DU="(?:"+RU+"(?:"+[lL,sL,uL].join("|")+")"+dL+cL+")*",jU=dL+cL+DU,LU="(?:"+[lL+hA+"?",hA,sL,uL,kU].join("|")+")",IU=RegExp(vA+"(?="+vA+")|"+LU+jU,"g");function FU(t){return t.match(IU)||[]}function td(t){return ey(t)?FU(t):SU(t)}function fL(t){return function(e){e=Ri(e);var n=ey(e)?td(e):void 0,o=n?n[0]:e.charAt(0),r=n?Dh(n,1).join(""):e.slice(1);return o[t]()+r}}var K2=fL("toUpperCase");function pL(t){return K2(Ri(t).toLowerCase())}function Z2(t){return function(e){return t==null?void 0:t[e]}}var BU={À:"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"},$U=Z2(BU),UU=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,VU="\\u0300-\\u036f",WU="\\ufe20-\\ufe2f",GU="\\u20d0-\\u20ff",zU=VU+WU+GU,HU="["+zU+"]",XU=RegExp(HU,"g");function hL(t){return t=Ri(t),t&&t.replace(UU,$U).replace(XU,"")}var YU=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qU(t){return t.match(YU)||[]}var KU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZU(t){return KU.test(t)}var vL="\\ud800-\\udfff",JU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",eV="\\u20d0-\\u20ff",tV=JU+QU+eV,mL="\\u2700-\\u27bf",gL="a-z\\xdf-\\xf6\\xf8-\\xff",nV="\\xac\\xb1\\xd7\\xf7",rV="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oV="\\u2000-\\u206f",iV=" \\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",yL="A-Z\\xc0-\\xd6\\xd8-\\xde",aV="\\ufe0e\\ufe0f",_L=nV+rV+oV+iV,bL="['’]",nk="["+_L+"]",lV="["+tV+"]",wL="\\d+",sV="["+mL+"]",EL="["+gL+"]",xL="[^"+vL+_L+wL+mL+gL+yL+"]",uV="\\ud83c[\\udffb-\\udfff]",cV="(?:"+lV+"|"+uV+")",dV="[^"+vL+"]",OL="(?:\\ud83c[\\udde6-\\uddff]){2}",SL="[\\ud800-\\udbff][\\udc00-\\udfff]",fg="["+yL+"]",fV="\\u200d",rk="(?:"+EL+"|"+xL+")",pV="(?:"+fg+"|"+xL+")",ok="(?:"+bL+"(?:d|ll|m|re|s|t|ve))?",ik="(?:"+bL+"(?:D|LL|M|RE|S|T|VE))?",AL=cV+"?",ML="["+aV+"]?",hV="(?:"+fV+"(?:"+[dV,OL,SL].join("|")+")"+ML+AL+")*",vV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gV=ML+AL+hV,yV="(?:"+[sV,OL,SL].join("|")+")"+gV,_V=RegExp([fg+"?"+EL+"+"+ok+"(?="+[nk,fg,"$"].join("|")+")",pV+"+"+ik+"(?="+[nk,fg+rk,"$"].join("|")+")",fg+"?"+rk+"+"+ok,fg+"+"+ik,mV,vV,wL,yV].join("|"),"g");function bV(t){return t.match(_V)||[]}function TL(t,e,n){return t=Ri(t),e=n?void 0:e,e===void 0?ZU(t)?bV(t):qU(t):t.match(e)||[]}var wV="['’]",EV=RegExp(wV,"g");function ty(t){return function(e){return $j(TL(hL(e).replace(EV,"")),t,"")}}var xV=ty(function(t,e,n){return e=e.toLowerCase(),t+(n?pL(e):e)}),OV=nm.isFinite,SV=Math.min;function J2(t){var e=Math[t];return function(n,o){if(n=Pg(n),o=o==null?0:SV(zo(o),292),o&&OV(n)){var r=(Ri(n)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+o));return r=(Ri(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-o))}return e(n)}}var AV=J2("ceil");function CL(t){var e=ge(t);return e.__chain__=!0,e}var MV=Math.ceil,TV=Math.max;function CV(t,e,n){(n?Nh(t,e,n):e===void 0)?e=1:e=TV(zo(e),0);var o=t==null?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,a=Array(MV(o/e));r=0&&t.slice(n,r)==e}function sW(t,e){return Es(e,function(n){return[n,t[n]]})}function uW(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=[o,o]}),n}var cW="[object Map]",dW="[object Set]";function LL(t){return function(e){var n=T1(e);return n==cW?mj(e):n==dW?uW(e):sW(e,t(e))}}var pp=LL(Zd),fW=LL(rm),pW={"&":"&","<":"<",">":">",'"':""","'":"'"},hW=Z2(pW),IL=/[&<>"']/g,vW=RegExp(IL.source);function FL(t){return t=Ri(t),t&&vW.test(t)?t.replace(IL,hW):t}var BL=/[\\^$.*+?()[\]{}|]/g,mW=RegExp(BL.source);function gW(t){return t=Ri(t),t&&mW.test(t)?t.replace(BL,"\\$&"):t}var yW=4294967295;function $L(t){return t?Jg(zo(t),0,yW):0}function _W(t,e,n,o){var r=t.length;for(n=zo(n),n<0&&(n=-n>r?0:r+n),o=o===void 0||o>r?r:zo(o),o<0&&(o+=r),o=n>o?0:$L(o);n=e}),GW=Math.max,zW=Math.min;function HW(t,e,n){return t>=zW(e,n)&&t=120&&h.length>=120)?new b$(a&&h):void 0}h=t[0];var v=-1,b=s[0];e:for(;++v=-sk&&t<=sk}var MG="[object WeakMap]";function TG(t){return qd(t)&&T1(t)==MG}var CG="[object WeakSet]";function NG(t){return qd(t)&&Kg(t)==CG}var kG=1;function PG(t){return _i(typeof t=="function"?t:Zg(t,kG))}var RG=Array.prototype,DG=RG.join;function jG(t,e){return t==null?"":DG.call(t,e)}var LG=ty(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),IG=V2(function(t,e,n){M1(t,n,e)});function FG(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}var BG=Math.max,$G=Math.min;function UG(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=o;return n!==void 0&&(r=zo(n),r=r<0?BG(o+r,0):$G(r,o-1)),e===e?FG(t,e,r):M$(t,T$,r,!0)}var VG=ty(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),WG=fL("toLowerCase"),GG=I1(k9),zG=I1(function(t,e){return t<=e});function XL(t,e){var n={};return e=_i(e),am(t,function(o,r,i){M1(n,e(o,r,i),o)}),n}var HG=1;function XG(t){return C$(Zg(t,HG))}var YG=1;function qG(t,e){return N$(t,Zg(e,YG))}function KG(t,e){return t&&t.length?P9(t,_i(e),Hj):void 0}function oM(t,e){for(var n,o=-1,r=t.length;++o=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function KL(t,e){var n=t.length;if(n)return e+=e<0?n:0,H_(e,n)?t[e]:void 0}function sz(t,e){return t&&t.length?KL(t,zo(e)):void 0}function uz(t){return t=zo(t),Yo(function(e){return KL(e,t)})}function cz(t,e){return Gj(t,G2(_i(e)))}function dz(t){return iL(2,t)}function fz(t,e,n,o){return t==null?[]:(qa(e)||(e=e==null?[]:[e]),n=o?void 0:n,qa(n)||(n=n==null?[]:[n]),Y9(t,e,n))}function iM(t){return im(function(e){return e=Es(e,Hv(_i)),Yo(function(n){var o=this;return t(e,function(r){return Qu(r,o,n)})})})}var pz=iM(Es),hz=Yo,vz=Math.min,mz=hz(function(t,e){e=e.length==1&&qa(e[0])?Es(e[0],Hv(_i)):Es(Jd(e,1),Hv(_i));var n=e.length;return Yo(function(o){for(var r=-1,i=vz(o.length,n);++r_z)return n;do e%2&&(n+=t),e=bz(e/2),e&&(t+=t);while(e);return n}var wz=xj("length"),ZL="\\ud800-\\udfff",Ez="\\u0300-\\u036f",xz="\\ufe20-\\ufe2f",Oz="\\u20d0-\\u20ff",Sz=Ez+xz+Oz,Az="\\ufe0e\\ufe0f",Mz="["+ZL+"]",gA="["+Sz+"]",yA="\\ud83c[\\udffb-\\udfff]",Tz="(?:"+gA+"|"+yA+")",JL="[^"+ZL+"]",QL="(?:\\ud83c[\\udde6-\\uddff]){2}",e3="[\\ud800-\\udbff][\\udc00-\\udfff]",Cz="\\u200d",t3=Tz+"?",n3="["+Az+"]?",Nz="(?:"+Cz+"(?:"+[JL,QL,e3].join("|")+")"+n3+t3+")*",kz=n3+t3+Nz,Pz="(?:"+[JL+gA+"?",gA,QL,e3,Mz].join("|")+")",uk=RegExp(yA+"(?="+yA+")|"+Pz+kz,"g");function Rz(t){for(var e=uk.lastIndex=0;uk.test(t);)++e;return e}function ny(t){return ey(t)?Rz(t):wz(t)}var Dz=Math.ceil;function gw(t,e){e=e===void 0?" ":ed(e);var n=e.length;if(n<2)return n?mA(e,t):e;var o=mA(e,Dz(t/ny(e)));return ey(e)?Dh(td(o),0,t).join(""):o.slice(0,t)}var jz=Math.ceil,Lz=Math.floor;function Iz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;if(!e||o>=e)return t;var r=(e-o)/2;return gw(Lz(r),n)+t+gw(jz(r),n)}function Fz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;return e&&o-1;)s!==t&&ck.call(s,l,1),ck.call(t,l,1);return t}function r3(t,e){return t&&t.length&&e&&e.length?lM(t,e):t}var Kz=Yo(r3);function Zz(t,e,n){return t&&t.length&&e&&e.length?lM(t,e,_i(n)):t}function Jz(t,e,n){return t&&t.length&&e&&e.length?lM(t,e,void 0,n):t}var Qz=Array.prototype,eH=Qz.splice;function o3(t,e){for(var n=t?e.length:0,o=n-1;n--;){var r=e[n];if(n==o||r!==i){var i=r;H_(r)?eH.call(t,r,1):Sj(t,r)}}return t}var tH=im(function(t,e){var n=t==null?0:t.length,o=X2(t,e);return o3(t,Es(e,function(r){return H_(r,n)?+r:r}).sort(q9)),o}),nH=Math.floor,rH=Math.random;function sM(t,e){return t+nH(rH()*(e-t+1))}var oH=parseFloat,iH=Math.min,aH=Math.random;function lH(t,e,n){if(n&&typeof n!="boolean"&&Nh(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=w_(t),e===void 0?(e=t,t=0):e=w_(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var r=aH();return iH(t+r*(e-t+oH("1e-"+((r+"").length-1))),e)}return sM(t,e)}var sH=K9(!0),uH=256,cH=im(function(t,e){return fp(t,uH,void 0,void 0,void 0,e)});function dH(t,e,n,o){var r=t==null?0:t.length;for(o&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function fH(t,e,n){var o=qa(t)?dH:T9,r=arguments.length<3;return o(t,_i(e),n,r,jL)}function pH(t,e){var n=[];if(!(t&&t.length))return n;var o=-1,r=[],i=t.length;for(e=_i(e);++o>>1;function $1(t,e,n){var o=0,r=t==null?o:t.length;if(typeof e=="number"&&e===e&&r<=UH){for(;o>>1,a=t[i];a!==null&&!kg(a)&&(n?a<=e:a>>0,n?(t=Ri(t),t&&(typeof e=="string"||e!=null&&!z2(e))&&(e=ed(e),!e&&ey(t))?Dh(td(t),0,n):t.split(e,n)):[]}var JH="Expected a function",QH=Math.max;function eX(t,e){if(typeof t!="function")throw new TypeError(JH);return e=e==null?0:QH(zo(e),0),Yo(function(n){var o=n[e],r=Dh(n,0,e);return o&&X_(r,o),Qu(t,this,r)})}var tX=ty(function(t,e,n){return t+(n?" ":"")+K2(e)});function nX(t,e,n){return t=Ri(t),n=n==null?0:Jg(zo(n),0,t.length),e=ed(e),t.slice(n,n+e.length)==e}function rX(){return{}}function oX(){return""}function iX(){return!0}var aX=k1(function(t,e){return t-e},0);function lX(t){return t&&t.length?oM(t,tm):0}function sX(t,e){return t&&t.length?oM(t,_i(e)):0}function uX(t){var e=t==null?0:t.length;return e?sp(t,1,e):[]}function cX(t,e,n){return t&&t.length?(e=n||e===void 0?1:zo(e),sp(t,0,e<0?0:e)):[]}function dX(t,e,n){var o=t==null?0:t.length;return o?(e=n||e===void 0?1:zo(e),e=o-e,sp(t,e<0?0:e,o)):[]}function fX(t,e){return t&&t.length?j1(t,_i(e),!1,!0):[]}function pX(t,e){return t&&t.length?j1(t,_i(e)):[]}function hX(t,e){return e(t),t}var l3=Object.prototype,vX=l3.hasOwnProperty;function dk(t,e,n,o){return t===void 0||q_(t,l3[n])&&!vX.call(o,n)?e:t}var mX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gX(t){return"\\"+mX[t]}var s3=/<%=([\s\S]+?)%>/g,yX=/<%-([\s\S]+?)%>/g,_X=/<%([\s\S]+?)%>/g,bA={escape:yX,evaluate:_X,interpolate:s3,variable:"",imports:{_:{escape:FL}}},bX="Invalid `variable` option passed into `_.template`",wX=/\b__p \+= '';/g,EX=/\b(__p \+=) '' \+/g,xX=/(__e\(.*?\)|\b__t\)) \+\n'';/g,OX=/[()=,{}\[\]\/\s]/,SX=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,d0=/($^)/,AX=/['\n\r\u2028\u2029\\]/g,MX=Object.prototype,fk=MX.hasOwnProperty;function TX(t,e,n){var o=bA.imports._.templateSettings||bA;n&&Nh(t,e,n)&&(e=void 0),t=Ri(t),e=pA({},e,o,dk);var r=pA({},e.imports,o.imports,dk),i=Zd(r),a=Uj(r,i),s,l,f=0,h=e.interpolate||d0,v="__p += '",b=RegExp((e.escape||d0).source+"|"+h.source+"|"+(h===s3?SX:d0).source+"|"+(e.evaluate||d0).source+"|$","g"),E=fk.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+` `:"";t.replace(b,function(S,M,T,$,D,P){return T||(T=$),v+=t.slice(f,P).replace(AX,gX),M&&(s=!0,v+=`' + __e(`+M+`) + '`),D&&(l=!0,v+=`'; `+D+`; __p += '`),T&&(v+=`' + ((__t = (`+T+`)) == null ? '' : __t) + '`),f=P+S.length,S}),v+=`'; `;var O=fk.call(e,"variable")&&e.variable;if(!O)v=`with (obj) { `+v+` } `;else if(OX.test(O))throw new Error(bX);v=(l?v.replace(wX,""):v).replace(EX,"$1").replace(xX,"$1;"),v="function("+(O||"obj")+`) { `+(O?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+v+`return __p }`;var w=oL(function(){return Function(i,E+"return "+v).apply(void 0,a)});if(w.source=v,Y2(w))throw w;return w}function U1(t,e){return e(t)}var CX=9007199254740991,KO=4294967295,NX=Math.min;function kX(t,e){if(t=zo(t),t<1||t>CX)return[];var n=KO,o=NX(t,KO);e=lm(e),t-=KO;for(var r=Aj(o,e);++n-1;);return n}function d3(t,e){for(var n=-1,o=t.length;++n-1;);return n}function BX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return L$(t);if(!t||!(e=ed(e)))return t;var o=td(t),r=td(e),i=d3(o,r),a=c3(o,r)+1;return Dh(o,i,a).join("")}function $X(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.slice(0,I$(t)+1);if(!t||!(e=ed(e)))return t;var o=td(t),r=c3(o,td(e))+1;return Dh(o,0,r).join("")}var UX=/^\s+/;function VX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.replace(UX,"");if(!t||!(e=ed(e)))return t;var o=td(t),r=d3(o,td(e));return Dh(o,r).join("")}var WX=30,GX="...",zX=/\w*$/;function HX(t,e){var n=WX,o=GX;if(lp(e)){var r="separator"in e?e.separator:r;n="length"in e?zo(e.length):n,o="omission"in e?ed(e.omission):o}t=Ri(t);var i=t.length;if(ey(t)){var a=td(t);i=a.length}if(n>=i)return t;var s=n-ny(o);if(s<1)return o;var l=a?Dh(a,0,s).join(""):t.slice(0,s);if(r===void 0)return l+o;if(a&&(s+=l.length-s),z2(r)){if(t.slice(s).search(r)){var f,h=l;for(r.global||(r=RegExp(r.source,Ri(zX.exec(r))+"g")),r.lastIndex=0;f=r.exec(h);)var v=f.index;l=l.slice(0,v===void 0?s:v)}}else if(t.indexOf(ed(r),s)!=s){var b=l.lastIndexOf(r);b>-1&&(l=l.slice(0,b))}return l+o}function XX(t){return rL(t,1)}var YX={"&":"&","<":"<",">":">",""":'"',"'":"'"},qX=Z2(YX),f3=/&(?:amp|lt|gt|quot|#39);/g,KX=RegExp(f3.source);function ZX(t){return t=Ri(t),t&&KX.test(t)?t.replace(f3,qX):t}var JX=Yo(function(t){var e=ec(t);return Ll(e)&&(e=void 0),E_(Jd(t,1,Ll,!0),_i(e))}),QX=Yo(function(t){var e=ec(t);return e=typeof e=="function"?e:void 0,E_(Jd(t,1,Ll,!0),void 0,e)});function eY(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?E_(t,void 0,e):[]}function tY(t,e){return t==null?!0:Sj(t,e)}var nY=Math.max;function cM(t){if(!(t&&t.length))return[];var e=0;return t=Y_(t,function(n){if(Ll(n))return e=nY(n.length,e),!0}),Aj(e,function(n){return Es(t,xj(n))})}function p3(t,e){if(!(t&&t.length))return[];var n=cM(t);return e==null?n:Es(n,function(o){return Qu(e,void 0,o)})}function h3(t,e,n,o){return R2(t,e,n(Oj(t,e)),o)}function rY(t,e,n){return t==null?t:h3(t,e,lm(n))}function oY(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:h3(t,e,lm(n),o)}var iY=ty(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function aY(t){return t==null?[]:Uj(t,rm(t))}var lY=Yo(function(t,e){return Ll(t)?N1(t,e):[]});function sY(t,e){return F1(lm(e),t)}var uY=im(function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(i){return X2(i,t)};return e>1||this.__actions__.length||!(o instanceof $o)||!H_(n)?this.thru(r):(o=o.slice(n,+n+(e?1:0)),o.__actions__.push({func:U1,args:[r],thisArg:void 0}),new rc(o,this.__chain__).thru(function(i){return e&&!i.length&&i.push(void 0),i}))});function cY(){return CL(this)}function dY(){var t=this.__wrapped__;if(t instanceof $o){var e=t;return this.__actions__.length&&(e=new $o(this)),e=e.reverse(),e.__actions__.push({func:U1,args:[_A],thisArg:void 0}),new rc(e,this.__chain__)}return this.thru(_A)}function dM(t,e,n){var o=t.length;if(o<2)return o?E_(t[0]):[];for(var r=-1,i=Array(o);++r1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,p3(t,n)});const mr={chunk:CV,compact:L9,concat:LV,difference:I9,differenceBy:eW,differenceWith:tW,drop:F9,dropRight:B9,dropRightWhile:rW,dropWhile:oW,fill:bW,findIndex:Wj,findLastIndex:gj,flatten:F$,flattenDeep:B$,flattenDepth:MW,fromPairs:$$,head:V9,indexOf:zj,initial:YW,intersection:KW,intersectionBy:ZW,intersectionWith:JW,join:jG,lastIndexOf:UG,nth:sz,pull:Kz,pullAll:r3,pullAllBy:Zz,pullAllWith:Jz,pullAt:tH,remove:pH,reverse:_A,slice:DH,sortedIndex:VH,sortedIndexBy:WH,sortedIndexOf:GH,sortedLastIndex:zH,sortedLastIndexBy:HH,sortedLastIndexOf:XH,sortedUniq:YH,sortedUniqBy:qH,tail:uX,take:cX,takeRight:dX,takeRightWhile:fX,takeWhile:pX,union:U$,unionBy:JX,unionWith:QX,uniq:$9,uniqBy:U9,uniqWith:eY,unzip:cM,unzipWith:p3,without:lY,xor:fY,xorBy:pY,xorWith:hY,zip:vY,zipObject:J9,zipObjectDeep:mY,zipWith:gY},Di={countBy:zV,every:z9,filter:C9,find:Sh,findLast:EW,flatMap:V$,flatMapDeep:SW,flatMapDepth:AW,forEach:ri,forEachRight:aW,groupBy:W9,includes:H9,invokeMap:lG,keyBy:IG,map:tc,orderBy:fz,partition:zz,reduce:Vj,reduceRight:fH,reject:G9,sample:xH,sampleSize:AH,shuffle:NH,size:RH,some:X9,sortBy:Q9},yY={now:W$},Ta={after:d7,ary:rL,before:iL,bind:D1,bindKey:q2,curry:Q2,curryRight:eM,debounce:D2,defer:JV,delay:QV,flip:CW,memoize:G$,once:dz,overArgs:mz,partial:F1,partialRight:aM,rearg:cH,rest:gH,spread:eX,throttle:Cj,unary:XX,wrap:sY},Vr={castArray:z$,clone:X$,cloneDeep:to,cloneDeepWith:PV,cloneWith:DV,conformsTo:VV,eq:q_,gt:VW,gte:WW,isArguments:Y$,isArrayBuffer:cG,isArrayLike:C1,isArrayLikeObject:Ll,isBoolean:mw,isBuffer:Mj,isDate:hG,isElement:vG,isEmpty:dw,isEqual:uA,isEqualWith:mG,isError:Y2,isFinite:yG,isFunction:kh,isInteger:zL,isLength:q$,isMap:K$,isMatch:_G,isMatchWith:bG,isNaN:EG,isNative:SG,isNil:ws,isNull:Z$,isNumber:HL,isObjectLike:qd,isPlainObject:k2,isRegExp:z2,isSafeInteger:AG,isSet:J$,isString:W2,isSymbol:kg,isTypedArray:Tj,isUndefined:Xv,isWeakMap:TG,isWeakSet:NG,lt:GG,lte:zG,toArray:qL,toFinite:w_,toLength:$L,toNumber:Pg,toPlainObject:H$,toSafeInteger:LX,toString:Ri},Ss={add:u7,ceil:AV,divide:nW,floor:NW,max:e7,maxBy:KG,mean:JG,meanBy:QG,min:R9,minBy:t7,multiply:rz,round:wH,subtract:aX,sum:lX,sumBy:sX},fM={clamp:Q$,inRange:XW,random:lH},io={assign:Xo,assignIn:iU,assignInWith:pA,assignWith:aU,at:lU,create:HV,defaults:D9,defaultsDeep:KV,findKey:wW,findLastKey:xW,forIn:r7,forInRight:FW,forOwn:o7,forOwnRight:BW,functions:$W,functionsIn:UW,get:om,has:hw,hasIn:t9,invert:nG,invertBy:iG,invoke:aG,keysIn:rm,mapKeys:XL,mapValues:n7,merge:Yv,mergeWith:PL,omit:e9,omitBy:cz,pick:Vv,pickBy:Gj,result:yH,set:Nj,setWith:MH,toPairs:pp,toPairsIn:fW,transform:FX,unset:tY,update:rY,updateWith:oY,values:J_,valuesIn:aY},ef={at:uY,chain:CL,commit:jV,next:lz,plant:Hz,reverse:dY,tap:hX,toIterator:PX,value:RX,wrapperChain:cY},pi={camelCase:xV,capitalize:pL,deburr:hL,endsWith:lW,escape:FL,escapeRegExp:gW,kebabCase:LG,lowerCase:VG,lowerFirst:WG,pad:Iz,padEnd:Fz,padStart:Bz,parseInt:Vz,repeat:hH,replace:vH,snakeCase:jH,split:ZH,startCase:tX,startsWith:nX,template:TX,templateSettings:bA,toLower:DX,toUpper:IX,trim:BX,trimEnd:$X,trimStart:VX,truncate:HX,unescape:ZX,upperCase:iY,upperFirst:K2,words:TL},bi={attempt:oL,bindAll:pU,cond:FV,conforms:UV,constant:yj,defaultTo:qV,flow:LW,flowRight:IW,iteratee:PG,matches:XG,matchesProperty:qG,method:ez,methodOf:tz,noop:Qy,nthArg:uz,over:pz,overEvery:gz,overSome:yz,property:n9,propertyOf:Xz,range:i7,rangeRight:sH,stubArray:r9,stubFalse:Ej,stubObject:rX,stubString:oX,stubTrue:iX,times:kX,toPath:jX,uniqueId:a7};function _Y(){var t=new $o(this.__wrapped__);return t.__actions__=Ku(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ku(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ku(this.__views__),t}function bY(){if(this.__filtered__){var t=new $o(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var wY=Math.max,EY=Math.min;function xY(t,e,n){for(var o=-1,r=n.length;++o * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var TY="4.17.23",CY=2,NY=1,kY=3,v3=4294967295,PY=Array.prototype,RY=Object.prototype,m3=RY.hasOwnProperty,hk=cw?cw.iterator:void 0,DY=Math.max,vk=Math.min,pM=(function(t){return function(e,n,o){if(o==null){var r=lp(n),i=r&&Zd(n),a=i&&i.length&&L1(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}})(nz);ge.after=Ta.after;ge.ary=Ta.ary;ge.assign=io.assign;ge.assignIn=io.assignIn;ge.assignInWith=io.assignInWith;ge.assignWith=io.assignWith;ge.at=io.at;ge.before=Ta.before;ge.bind=Ta.bind;ge.bindAll=bi.bindAll;ge.bindKey=Ta.bindKey;ge.castArray=Vr.castArray;ge.chain=ef.chain;ge.chunk=mr.chunk;ge.compact=mr.compact;ge.concat=mr.concat;ge.cond=bi.cond;ge.conforms=bi.conforms;ge.constant=bi.constant;ge.countBy=Di.countBy;ge.create=io.create;ge.curry=Ta.curry;ge.curryRight=Ta.curryRight;ge.debounce=Ta.debounce;ge.defaults=io.defaults;ge.defaultsDeep=io.defaultsDeep;ge.defer=Ta.defer;ge.delay=Ta.delay;ge.difference=mr.difference;ge.differenceBy=mr.differenceBy;ge.differenceWith=mr.differenceWith;ge.drop=mr.drop;ge.dropRight=mr.dropRight;ge.dropRightWhile=mr.dropRightWhile;ge.dropWhile=mr.dropWhile;ge.fill=mr.fill;ge.filter=Di.filter;ge.flatMap=Di.flatMap;ge.flatMapDeep=Di.flatMapDeep;ge.flatMapDepth=Di.flatMapDepth;ge.flatten=mr.flatten;ge.flattenDeep=mr.flattenDeep;ge.flattenDepth=mr.flattenDepth;ge.flip=Ta.flip;ge.flow=bi.flow;ge.flowRight=bi.flowRight;ge.fromPairs=mr.fromPairs;ge.functions=io.functions;ge.functionsIn=io.functionsIn;ge.groupBy=Di.groupBy;ge.initial=mr.initial;ge.intersection=mr.intersection;ge.intersectionBy=mr.intersectionBy;ge.intersectionWith=mr.intersectionWith;ge.invert=io.invert;ge.invertBy=io.invertBy;ge.invokeMap=Di.invokeMap;ge.iteratee=bi.iteratee;ge.keyBy=Di.keyBy;ge.keys=Zd;ge.keysIn=io.keysIn;ge.map=Di.map;ge.mapKeys=io.mapKeys;ge.mapValues=io.mapValues;ge.matches=bi.matches;ge.matchesProperty=bi.matchesProperty;ge.memoize=Ta.memoize;ge.merge=io.merge;ge.mergeWith=io.mergeWith;ge.method=bi.method;ge.methodOf=bi.methodOf;ge.mixin=pM;ge.negate=G2;ge.nthArg=bi.nthArg;ge.omit=io.omit;ge.omitBy=io.omitBy;ge.once=Ta.once;ge.orderBy=Di.orderBy;ge.over=bi.over;ge.overArgs=Ta.overArgs;ge.overEvery=bi.overEvery;ge.overSome=bi.overSome;ge.partial=Ta.partial;ge.partialRight=Ta.partialRight;ge.partition=Di.partition;ge.pick=io.pick;ge.pickBy=io.pickBy;ge.property=bi.property;ge.propertyOf=bi.propertyOf;ge.pull=mr.pull;ge.pullAll=mr.pullAll;ge.pullAllBy=mr.pullAllBy;ge.pullAllWith=mr.pullAllWith;ge.pullAt=mr.pullAt;ge.range=bi.range;ge.rangeRight=bi.rangeRight;ge.rearg=Ta.rearg;ge.reject=Di.reject;ge.remove=mr.remove;ge.rest=Ta.rest;ge.reverse=mr.reverse;ge.sampleSize=Di.sampleSize;ge.set=io.set;ge.setWith=io.setWith;ge.shuffle=Di.shuffle;ge.slice=mr.slice;ge.sortBy=Di.sortBy;ge.sortedUniq=mr.sortedUniq;ge.sortedUniqBy=mr.sortedUniqBy;ge.split=pi.split;ge.spread=Ta.spread;ge.tail=mr.tail;ge.take=mr.take;ge.takeRight=mr.takeRight;ge.takeRightWhile=mr.takeRightWhile;ge.takeWhile=mr.takeWhile;ge.tap=ef.tap;ge.throttle=Ta.throttle;ge.thru=U1;ge.toArray=Vr.toArray;ge.toPairs=io.toPairs;ge.toPairsIn=io.toPairsIn;ge.toPath=bi.toPath;ge.toPlainObject=Vr.toPlainObject;ge.transform=io.transform;ge.unary=Ta.unary;ge.union=mr.union;ge.unionBy=mr.unionBy;ge.unionWith=mr.unionWith;ge.uniq=mr.uniq;ge.uniqBy=mr.uniqBy;ge.uniqWith=mr.uniqWith;ge.unset=io.unset;ge.unzip=mr.unzip;ge.unzipWith=mr.unzipWith;ge.update=io.update;ge.updateWith=io.updateWith;ge.values=io.values;ge.valuesIn=io.valuesIn;ge.without=mr.without;ge.words=pi.words;ge.wrap=Ta.wrap;ge.xor=mr.xor;ge.xorBy=mr.xorBy;ge.xorWith=mr.xorWith;ge.zip=mr.zip;ge.zipObject=mr.zipObject;ge.zipObjectDeep=mr.zipObjectDeep;ge.zipWith=mr.zipWith;ge.entries=io.toPairs;ge.entriesIn=io.toPairsIn;ge.extend=io.assignIn;ge.extendWith=io.assignInWith;pM(ge,ge);ge.add=Ss.add;ge.attempt=bi.attempt;ge.camelCase=pi.camelCase;ge.capitalize=pi.capitalize;ge.ceil=Ss.ceil;ge.clamp=fM.clamp;ge.clone=Vr.clone;ge.cloneDeep=Vr.cloneDeep;ge.cloneDeepWith=Vr.cloneDeepWith;ge.cloneWith=Vr.cloneWith;ge.conformsTo=Vr.conformsTo;ge.deburr=pi.deburr;ge.defaultTo=bi.defaultTo;ge.divide=Ss.divide;ge.endsWith=pi.endsWith;ge.eq=Vr.eq;ge.escape=pi.escape;ge.escapeRegExp=pi.escapeRegExp;ge.every=Di.every;ge.find=Di.find;ge.findIndex=mr.findIndex;ge.findKey=io.findKey;ge.findLast=Di.findLast;ge.findLastIndex=mr.findLastIndex;ge.findLastKey=io.findLastKey;ge.floor=Ss.floor;ge.forEach=Di.forEach;ge.forEachRight=Di.forEachRight;ge.forIn=io.forIn;ge.forInRight=io.forInRight;ge.forOwn=io.forOwn;ge.forOwnRight=io.forOwnRight;ge.get=io.get;ge.gt=Vr.gt;ge.gte=Vr.gte;ge.has=io.has;ge.hasIn=io.hasIn;ge.head=mr.head;ge.identity=tm;ge.includes=Di.includes;ge.indexOf=mr.indexOf;ge.inRange=fM.inRange;ge.invoke=io.invoke;ge.isArguments=Vr.isArguments;ge.isArray=qa;ge.isArrayBuffer=Vr.isArrayBuffer;ge.isArrayLike=Vr.isArrayLike;ge.isArrayLikeObject=Vr.isArrayLikeObject;ge.isBoolean=Vr.isBoolean;ge.isBuffer=Vr.isBuffer;ge.isDate=Vr.isDate;ge.isElement=Vr.isElement;ge.isEmpty=Vr.isEmpty;ge.isEqual=Vr.isEqual;ge.isEqualWith=Vr.isEqualWith;ge.isError=Vr.isError;ge.isFinite=Vr.isFinite;ge.isFunction=Vr.isFunction;ge.isInteger=Vr.isInteger;ge.isLength=Vr.isLength;ge.isMap=Vr.isMap;ge.isMatch=Vr.isMatch;ge.isMatchWith=Vr.isMatchWith;ge.isNaN=Vr.isNaN;ge.isNative=Vr.isNative;ge.isNil=Vr.isNil;ge.isNull=Vr.isNull;ge.isNumber=Vr.isNumber;ge.isObject=lp;ge.isObjectLike=Vr.isObjectLike;ge.isPlainObject=Vr.isPlainObject;ge.isRegExp=Vr.isRegExp;ge.isSafeInteger=Vr.isSafeInteger;ge.isSet=Vr.isSet;ge.isString=Vr.isString;ge.isSymbol=Vr.isSymbol;ge.isTypedArray=Vr.isTypedArray;ge.isUndefined=Vr.isUndefined;ge.isWeakMap=Vr.isWeakMap;ge.isWeakSet=Vr.isWeakSet;ge.join=mr.join;ge.kebabCase=pi.kebabCase;ge.last=ec;ge.lastIndexOf=mr.lastIndexOf;ge.lowerCase=pi.lowerCase;ge.lowerFirst=pi.lowerFirst;ge.lt=Vr.lt;ge.lte=Vr.lte;ge.max=Ss.max;ge.maxBy=Ss.maxBy;ge.mean=Ss.mean;ge.meanBy=Ss.meanBy;ge.min=Ss.min;ge.minBy=Ss.minBy;ge.stubArray=bi.stubArray;ge.stubFalse=bi.stubFalse;ge.stubObject=bi.stubObject;ge.stubString=bi.stubString;ge.stubTrue=bi.stubTrue;ge.multiply=Ss.multiply;ge.nth=mr.nth;ge.noop=bi.noop;ge.now=yY.now;ge.pad=pi.pad;ge.padEnd=pi.padEnd;ge.padStart=pi.padStart;ge.parseInt=pi.parseInt;ge.random=fM.random;ge.reduce=Di.reduce;ge.reduceRight=Di.reduceRight;ge.repeat=pi.repeat;ge.replace=pi.replace;ge.result=io.result;ge.round=Ss.round;ge.sample=Di.sample;ge.size=Di.size;ge.snakeCase=pi.snakeCase;ge.some=Di.some;ge.sortedIndex=mr.sortedIndex;ge.sortedIndexBy=mr.sortedIndexBy;ge.sortedIndexOf=mr.sortedIndexOf;ge.sortedLastIndex=mr.sortedLastIndex;ge.sortedLastIndexBy=mr.sortedLastIndexBy;ge.sortedLastIndexOf=mr.sortedLastIndexOf;ge.startCase=pi.startCase;ge.startsWith=pi.startsWith;ge.subtract=Ss.subtract;ge.sum=Ss.sum;ge.sumBy=Ss.sumBy;ge.template=pi.template;ge.times=bi.times;ge.toFinite=Vr.toFinite;ge.toInteger=zo;ge.toLength=Vr.toLength;ge.toLower=pi.toLower;ge.toNumber=Vr.toNumber;ge.toSafeInteger=Vr.toSafeInteger;ge.toString=Vr.toString;ge.toUpper=pi.toUpper;ge.trim=pi.trim;ge.trimEnd=pi.trimEnd;ge.trimStart=pi.trimStart;ge.truncate=pi.truncate;ge.unescape=pi.unescape;ge.uniqueId=bi.uniqueId;ge.upperCase=pi.upperCase;ge.upperFirst=pi.upperFirst;ge.each=Di.forEach;ge.eachRight=Di.forEachRight;ge.first=mr.head;pM(ge,(function(){var t={};return am(ge,function(e,n){m3.call(ge.prototype,n)||(t[n]=e)}),t})(),{chain:!1});ge.VERSION=TY;(ge.templateSettings=pi.templateSettings).imports._=ge;Kd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){ge[t].placeholder=ge});Kd(["drop","take"],function(t,e){$o.prototype[t]=function(n){n=n===void 0?1:DY(zo(n),0);var o=this.__filtered__&&!e?new $o(this):this.clone();return o.__filtered__?o.__takeCount__=vk(n,o.__takeCount__):o.__views__.push({size:vk(n,v3),type:t+(o.__dir__<0?"Right":"")}),o},$o.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}});Kd(["filter","map","takeWhile"],function(t,e){var n=e+1,o=n==NY||n==kY;$o.prototype[t]=function(r){var i=this.clone();return i.__iteratees__.push({iteratee:_i(r),type:n}),i.__filtered__=i.__filtered__||o,i}});Kd(["head","last"],function(t,e){var n="take"+(e?"Right":"");$o.prototype[t]=function(){return this[n](1).value()[0]}});Kd(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");$o.prototype[t]=function(){return this.__filtered__?new $o(this):this[n](1)}});$o.prototype.compact=function(){return this.filter(tm)};$o.prototype.find=function(t){return this.filter(t).head()};$o.prototype.findLast=function(t){return this.reverse().find(t)};$o.prototype.invokeMap=Yo(function(t,e){return typeof t=="function"?new $o(this):this.map(function(n){return Q_(n,t,e)})});$o.prototype.reject=function(t){return this.filter(G2(_i(t)))};$o.prototype.slice=function(t,e){t=zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new $o(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=zo(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)};$o.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};$o.prototype.toArray=function(){return this.take(v3)};am($o.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=ge[o?"take"+(e=="last"?"Right":""):e],i=o||/^find/.test(e);r&&(ge.prototype[e]=function(){var a=this.__wrapped__,s=o?[1]:arguments,l=a instanceof $o,f=s[0],h=l||qa(a),v=function(M){var T=r.apply(ge,X_([M],s));return o&&b?T[0]:T};h&&n&&typeof f=="function"&&f.length!=1&&(l=h=!1);var b=this.__chain__,E=!!this.__actions__.length,O=i&&!b,w=l&&!E;if(!i&&h){a=w?a:new $o(this);var S=t.apply(a,s);return S.__actions__.push({func:U1,args:[v],thisArg:void 0}),new rc(S,b)}return O&&w?t.apply(this,s):(S=this.thru(v),O?o?S.value()[0]:S.value():S)})});Kd(["pop","push","shift","sort","splice","unshift"],function(t){var e=PY[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);ge.prototype[t]=function(){var r=arguments;if(o&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],r)}return this[n](function(a){return e.apply(qa(a)?a:[],r)})}});am($o.prototype,function(t,e){var n=ge[e];if(n){var o=n.name+"";m3.call(Og,o)||(Og[o]=[]),Og[o].push({name:e,func:n})}});Og[R1(void 0,CY).name]=[{name:"wrapper",func:void 0}];$o.prototype.clone=_Y;$o.prototype.reverse=bY;$o.prototype.value=MY;ge.prototype.at=ef.at;ge.prototype.chain=ef.wrapperChain;ge.prototype.commit=ef.commit;ge.prototype.next=ef.next;ge.prototype.plant=ef.plant;ge.prototype.reverse=ef.reverse;ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=ef.value;ge.prototype.first=ge.prototype.head;hk&&(ge.prototype[hk]=ef.toIterator);const jY="data:image/svg+xml,%3csvg%20width='27'%20height='20'%20viewBox='0%200%2027%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.6667%203.33329H3.66667V16.6666H23.6667V3.33329ZM3.66667%201.66663C2.74619%201.66663%202%202.41282%202%203.33329V16.6666C2%2017.5871%202.74619%2018.3333%203.66667%2018.3333H23.6667C24.5871%2018.3333%2025.3333%2017.5871%2025.3333%2016.6666V3.33329C25.3333%202.41282%2024.5871%201.66663%2023.6667%201.66663H3.66667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2196%206.91331H18.2767L19.4%209.89549L20.4758%206.91331L22.5375%206.83044L19.4%2014.8138L17.3565%2014.8966L18.437%2012.3756L16.2196%206.91331Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.1034%207.06327C13.1302%207.04839%2013.1574%207.03404%2013.1848%207.02023C13.5166%206.84295%2013.8759%206.77344%2014.2468%206.77344C14.9611%206.77344%2015.5729%206.97047%2015.9992%207.43635C16.419%207.89521%2016.5934%208.54454%2016.5934%209.3101V12.9168H14.7001V9.4001C14.7001%209.01738%2014.6103%208.80651%2014.5052%208.69229C14.4059%208.58445%2014.2319%208.49677%2013.9067%208.49677C13.7078%208.49677%2013.5468%208.55932%2013.4114%208.69473C13.2534%208.85274%2013.1382%209.08146%2013.1034%209.41091V12.9168H11.2101V6.91344H13.1034V7.06327Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.01665%2012.6833V12.9168H10.83V9.2001C10.83%208.50266%2010.6523%207.90623%2010.247%207.47482L10.2458%207.47354C9.77726%206.97898%209.08554%206.77344%208.26332%206.77344C7.58671%206.77344%206.97894%206.88784%206.50606%207.18452C5.95355%207.51308%205.61381%208.04132%205.48446%208.69979L5.39493%209.15558L6.60828%209.25958C6.45695%209.32645%206.3157%209.40545%206.18578%209.49774C5.6067%209.89006%205.31665%2010.4724%205.31665%2011.1801C5.31665%2011.727%205.52656%2012.1949%205.95194%2012.5464C6.34831%2012.8992%206.87585%2013.0568%207.48332%2013.0568C7.99851%2013.0568%208.45994%2012.9557%208.86073%2012.7671L8.86966%2012.7628C8.91982%2012.7377%208.96882%2012.7112%209.01665%2012.6833ZM7.33362%209.04021C7.60234%208.98907%207.88998%208.96154%208.19236%208.95358L8.93243%208.93444C8.90662%208.77431%208.84911%208.68249%208.7882%208.62627C8.69958%208.54447%208.527%208.46677%208.19332%208.46677C7.90772%208.46677%207.72064%208.51963%207.60769%208.58739L7.60328%208.59004C7.46993%208.66783%207.38847%208.77506%207.35134%208.95452L7.33362%209.04021ZM8.93782%2010.5386L8.28478%2010.5566L8.28191%2010.5567C7.83203%2010.566%207.5658%2010.6502%207.4222%2010.7499C7.3054%2010.831%207.23998%2010.9409%207.23998%2011.1401C7.23998%2011.2037%207.25413%2011.2438%207.32642%2011.2991L7.3313%2011.3029L7.33606%2011.3067C7.40443%2011.3623%207.52395%2011.4134%207.72332%2011.4134C8.07815%2011.4134%208.36218%2011.3062%208.60462%2011.1017C8.80129%2010.9357%208.90794%2010.7499%208.93782%2010.5386Z'%20fill='%23646A73'/%3e%3c/svg%3e",LY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.6667%203.33329H3.33335V16.6666H16.6667V3.33329ZM3.33335%201.66663C2.41288%201.66663%201.66669%202.41282%201.66669%203.33329V16.6666C1.66669%2017.5871%202.41288%2018.3333%203.33335%2018.3333H16.6667C17.5872%2018.3333%2018.3334%2017.5871%2018.3334%2016.6666V3.33329C18.3334%202.41282%2017.5872%201.66663%2016.6667%201.66663H3.33335Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.33%205.83667H15.2233V13.95H13.33V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.83%205.83667H12.7233V13.95H10.83V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.51665%2013.7165V13.95H10.33V10.2333C10.33%209.53587%2010.1523%208.93943%209.747%208.50803L9.7458%208.50675C9.27726%208.01218%208.58554%207.80664%207.76332%207.80664C7.08671%207.80664%206.47894%207.92104%206.00606%208.21772C5.45355%208.54628%205.11381%209.07452%204.98446%209.733L4.89493%2010.1888L6.10828%2010.2928C5.95695%2010.3597%205.8157%2010.4386%205.68578%2010.5309C5.1067%2010.9233%204.81665%2011.5057%204.81665%2012.2133C4.81665%2012.7602%205.02656%2013.2281%205.45194%2013.5796C5.84831%2013.9324%206.37585%2014.09%206.98332%2014.09C7.49851%2014.09%207.95994%2013.9889%208.36073%2013.8003L8.36966%2013.796C8.41982%2013.7709%208.46882%2013.7444%208.51665%2013.7165ZM6.83361%2010.0734C7.10234%2010.0223%207.38998%209.99474%207.69236%209.98678L8.43243%209.96764C8.40662%209.80751%208.3491%209.71569%208.2882%209.65948C8.19958%209.57767%208.027%209.49997%207.69332%209.49997C7.40772%209.49997%207.22064%209.55283%207.10769%209.6206L7.10328%209.62324C6.96993%209.70103%206.88847%209.80826%206.85134%209.98773L6.83361%2010.0734ZM8.43782%2011.5718L7.78478%2011.5898L7.78191%2011.5899C7.33203%2011.5992%207.0658%2011.6834%206.9222%2011.7831C6.8054%2011.8642%206.73998%2011.9741%206.73998%2012.1733C6.73998%2012.2369%206.75413%2012.277%206.82642%2012.3323L6.8313%2012.3361L6.83606%2012.3399C6.90443%2012.3955%207.02395%2012.4466%207.22332%2012.4466C7.57815%2012.4466%207.86218%2012.3394%208.10462%2012.1349C8.30129%2011.9689%208.40794%2011.7831%208.43782%2011.5718Z'%20fill='%23646A73'/%3e%3c/svg%3e",IY={class:"list flex-wrap"},FY=["onClick","onMousedown"],BY=["src"],$Y=["title"],UY={class:"flex-between"},VY={class:"flex align-center"},WY=["src"],GY=["title"],zY={key:0,class:"status-tag",style:{"margin-left":"auto"}},HY=_r({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=t,o=e,r=He(""),i=He([]);function a(s,l){return l.length?s.filter(f=>f.name.toLowerCase().includes(l.toLowerCase())):s}return K_([()=>r.value,()=>n.list],()=>{i.value=a(n.list,r.value)}),(s,l)=>{const f=ne("el-input"),h=ne("el-avatar"),v=ne("el-tag"),b=ne("el-text"),E=ne("el-popover"),O=ne("el-empty");return Ne(),mn(Ir,null,[k(f,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=w=>r.value=w),modelModifiers:{trim:!0},placeholder:s.$t("common.search"),"prefix-icon":"Search",clearable:"",style:{padding:"12px 12px 0 12px"}},null,8,["modelValue","placeholder"]),ee("div",IY,[i.value.length?(Ne(!0),mn(Ir,{key:0},No(i.value,w=>(Ne(),bt(E,{key:w.id,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:gn(S=>o("clickNodes",w),["stop"]),onMousedown:gn(S=>o("onmousedown",w),["stop"])},[Wn(cA)(w==null?void 0:w.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(w==null?void 0:w.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,BY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...l[1]||(l[1]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"ml-8 ellipsis",title:w.name},_e(w.name),9,$Y)],40,FY)]),default:j(()=>[ee("div",UY,[ee("div",VY,[Wn(cA)(w==null?void 0:w.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(w==null?void 0:w.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,WY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...l[2]||(l[2]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"font-medium ml-8 break-all",title:w.name},_e(w.name),9,GY)]),w.type?(Ne(),mn("div",zY,[Wn(j2)(w.type)?(Ne(),bt(v,{key:0,class:"warning-tag"},{default:j(()=>[ft(_e(s.$t("views.application.workflow")),1)]),_:1})):(Ne(),bt(v,{key:1,class:"blue-tag"},{default:j(()=>[ft(_e(s.$t("views.application.simple")),1)]),_:1}))])):Bn("",!0)]),k(b,{type:"info",size:"small",class:"mt-4"},{default:j(()=>[ft(_e(w.desc),1)]),_:2},1024)]),_:2},1024))),128)):(Ne(),bt(O,{key:1,description:s.$t("common.noData")},null,8,["description"]))])],64)}}}),mk=Ph(HY,[["__scopeId","data-v-deb1c287"]]),XY={style:{display:"flex",width:"100%","justify-content":"center"},class:"mb-12 mt-12"},YY={key:0},qY={class:"flex-wrap",style:{gap:"12px",padding:"12px"}},KY=["onClick","onMousedown"],ZY={class:"lighter"},JY={class:"flex align-center mb-8"},QY={class:"lighter color-text-primary"},eq={key:1,class:"ml-16 mt-8"},tq=_r({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=ml("workflowMode"),o=ja(),{user:r,folder:i}=kj(),a=b9(n||nc.Application),s=He(""),l=t,f=e,h=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),v=hr(()=>Pj.tool[h.value]),b=He(!1),E=He("base"),O=hr(()=>{if(!s.value)return a||[];const X=s.value.toLowerCase();return(a||[]).reduce((Y,W)=>{const Q=W.list.filter(J=>J.label.toLowerCase().includes(X));return Q.length&&Y.push({...W,list:Q}),Y},[])});function w(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=l.workflowRef)==null||Q.addNode(X),f("clickNodes",X)}function S(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(j2(Y.type)?(Y.work_flow.nodes[0].properties.node_data.file_upload_setting,X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id}):X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=l.workflowRef)==null||Q.onmousedown(X),f("onmousedown",X)}const M=He([]),T=He([]);async function $(){var Y;const X=await i.asyncGetFolder(u0.TOOL,{},b);M.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})}async function D(){var Y,W,Q,J;const X=await oi({type:"tool",isShared:((Y=i.currentFolder)==null?void 0:Y.id)==="share",systemType:"workspace"}).getToolList({folder_id:((W=i.currentFolder)==null?void 0:W.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});T.value=((Q=X.data)==null?void 0:Q.tools)||X.data||[],T.value=(J=T.value)==null?void 0:J.filter(ie=>ie.is_active)}const P=He([]),B=He([]);function F(){i.asyncGetFolder(u0.APPLICATION,{},b).then(X=>{var Y;P.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})})}async function I(){var Y;const X=await oi({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((Y=i.currentFolder)==null?void 0:Y.id)||r.getWorkspaceId()});B.value=X.data.filter(W=>W.resource_type==="application"&&W.id!==l.id&&W.is_publish)}function V(X){i.setCurrentFolder(X),E.value==="tool"?D():I()}async function z(X){console.log(X),X==="tool"?(await $(),D()):X==="application"&&(F(),I())}return bo(()=>{}),(X,Y)=>{const W=ne("search"),Q=ne("el-icon"),J=ne("el-input"),ie=ne("el-text"),Se=ne("el-popover"),Ae=ne("el-scrollbar"),Pe=ne("el-tab-pane"),De=ne("folder-tree"),ze=ne("LayoutContainer"),Ye=ne("el-tabs");return Ql((Ne(),mn("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:Rj({width:E.value==="base"?"400px":"640px"})},[k(Ye,{modelValue:E.value,"onUpdate:modelValue":Y[5]||(Y[5]=Be=>E.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:j(()=>[Ql(ee("div",XY,[k(J,{modelValue:s.value,"onUpdate:modelValue":Y[0]||(Y[0]=Be=>s.value=Be),class:"mr-12 ml-12",placeholder:X.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:j(()=>[k(Q,{class:"el-input__icon"},{default:j(()=>[k(W)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Eh,E.value==="base"]]),k(Pe,{label:X.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:j(()=>[k(Ae,{height:"400"},{default:j(()=>[O.value.length>0?(Ne(),mn("div",YY,[(Ne(!0),mn(Ir,null,No(O.value,(Be,Je)=>(Ne(),mn(Ir,{key:Je},[k(ie,{type:"info",size:"small",class:"color-secondary ml-12"},{default:j(()=>[ft(_e(Be.label),1)]),_:2},1024),ee("div",qY,[(Ne(!0),mn(Ir,null,No(Be.list,(gt,le)=>(Ne(),bt(Se,{key:le,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:gn(Ze=>w(gt),["stop"]),onMousedown:gn(Ze=>S(gt),["stop"])},[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:20})),ee("div",ZY,_e(gt.label),1)],40,KY)]),default:j(()=>[ee("div",JY,[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:32})),ee("div",QY,_e(gt.label),1)]),k(ie,{type:"info",size:"small",class:"color-secondary lighter"},{default:j(()=>[ft(_e(gt.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(Ne(),mn("div",eq,[k(ie,{type:"info"},{default:j(()=>[ft(_e(X.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),k(Pe,{label:X.$t("views.tool.title"),name:"tool"},{default:j(()=>[k(ze,null,{left:j(()=>{var Be;return[k(De,{source:Wn(u0).TOOL,data:M.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,shareTitle:X.$t("views.shared.shared_tool"),showShared:v.value.is_share(),canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey","shareTitle","showShared"])]}),default:j(()=>[k(Ae,{height:"450"},{default:j(()=>[k(mk,{list:T.value,onClickNodes:Y[1]||(Y[1]=Be=>w(Wn(VN),Be,"tool")),onOnmousedown:Y[2]||(Y[2]=Be=>S(Wn(VN),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),k(Pe,{label:X.$t("views.application.title"),name:"application"},{default:j(()=>[k(ze,null,{left:j(()=>{var Be;return[k(De,{source:Wn(u0).APPLICATION,data:P.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:j(()=>[k(Ae,{height:"450"},{default:j(()=>[k(mk,{list:B.value,onClickNodes:Y[3]||(Y[3]=Be=>w(Wn(WN),Be,"application")),onOnmousedown:Y[4]||(Y[4]=Be=>S(Wn(WN),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Eh,t.show]])}}}),g3=Ph(tq,[["__scopeId","data-v-a8dfaa84"]]),nq={class:"flex-between"},rq={class:"ellipsis-1 break-all"},oq={key:0,src:jY,alt:""},iq={key:1,src:LY,alt:""},aq={style:{width:"280px"},class:"p-12-16"},lq={class:"mt-8 lighter"},sq={class:"title-decoration-1 mb-8 mt-8"},uq=["onMouseenter"],cq={class:"break-all"},dq={class:"dialog-footer"},fq=_r({__name:"NodeContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",nc.Application);const e=ja(),{params:{id:n}}=e,o=He({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=He(!1),i=He(),a=He(),s=He(!1),l=He({title:""}),f=hr({set:z=>{Me.set(P.nodeModel.properties,"condition",z)},get:()=>P.nodeModel.properties.condition?P.nodeModel.properties.condition:(Me.set(P.nodeModel.properties,"condition","AND"),!0)}),h=hr({set:z=>{Me.set(P.nodeModel.properties,"showNode",z)},get:()=>P.nodeModel.properties.showNode!==void 0?P.nodeModel.properties.showNode:(Me.set(P.nodeModel.properties,"showNode",!0),!0)}),v=z=>{z.ctrlKey||z.metaKey||z.stopPropagation()},b=hr(()=>P.nodeModel.properties.status?P.nodeModel.properties.status:200);function E(){l.value.title=P.nodeModel.properties.stepName,s.value=!0}const O=async z=>{z&&await z.validate(X=>{var Y;X&&((Y=P.nodeModel.graphModel.nodes.filter(W=>W.id!==P.nodeModel.id))!=null&&Y.some(W=>W.properties.stepName===l.value.title)?Xi(Pt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(P.nodeModel.properties,"stepName",l.value.title),s.value=!1,z.resetFields()))})},w=z=>{z!=null&&z.shiftKey||P.nodeModel.graphModel.clearSelectElements(),Me.set(P.nodeModel,"isSelected",!P.nodeModel.isSelected),Me.set(P.nodeModel,"isHovered",!P.nodeModel.isSelected),P.nodeModel.graphModel.toFront(P.nodeModel.id)},S=He(null),M=()=>{P.nodeModel.graphModel.clearSelectElements();const z=P.nodeModel.graphModel.cloneNode(P.nodeModel.id);Me.set(z,"isSelected",!0),Me.set(z,"isHovered",!0),P.nodeModel.graphModel.toFront(z.id)},T=()=>{L2(Pt("common.tip"),Pt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:Pt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{P.nodeModel.type===kr.LoopNode&&P.nodeModel.graphModel.getNodeOutgoingNode(P.nodeModel.id).forEach(X=>{X.type==="loop-body-node"&&P.nodeModel.graphModel.deleteNode(X.id)}),P.nodeModel.graphModel.deleteNode(P.nodeModel.id)}),P.nodeModel.graphModel.eventCenter.emit("delete_node")},$=z=>{z.height&&(P.nodeModel.virtual||(o.value.stepContainerHeight=z.height,P.nodeModel.setHeight(o.value.stepContainerHeight)))};function D(z){var W,Q,J;const X=z.properties.width?z.properties.width:214,Y=P.nodeModel.graphModel.addNode({type:z.type,properties:z.properties,x:((W=i.value)==null?void 0:W.x)+X/2+200,y:((Q=i.value)==null?void 0:Q.y)-z.height});P.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:P.nodeModel.id,sourceAnchorId:(J=i.value)==null?void 0:J.id,targetNodeId:Y.id,targetAnchorId:Y.id+"_left"}),V()}const P=t,B=hr(()=>{var z;return P.nodeModel.properties.config.fields?(z=P.nodeModel.properties.config.fields)==null?void 0:z.map(Y=>({label:Y.label,value:Y.value,globeLabel:`{{${P.nodeModel.properties.stepName}.${Y.value}}}`,globeValue:`{{context['${P.nodeModel.id}'].${Y.value}}}`})):[]});function F(z){return![kr.Start,kr.Base,kr.LoopStartNode.toString()].includes(z)}const I=z=>{r.value=!0,i.value=z},V=()=>{r.value=!1,i.value=void 0};return bo(()=>{Me.set(P.nodeModel,"openNodeMenu",z=>{r.value?V():I(z)})}),(z,X)=>{var se;const Y=ne("ArrowDownBold"),W=ne("el-icon"),Q=ne("el-button"),J=ne("el-option"),ie=ne("el-select"),Se=ne("el-dropdown"),Ae=ne("AppIcon"),Pe=ne("el-dropdown-item"),De=ne("el-dropdown-menu"),ze=ne("el-alert"),Ye=ne("el-tooltip"),Be=ne("el-collapse-transition"),Je=ne("el-input"),gt=ne("el-form-item"),le=ne("el-form"),Ze=ne("el-dialog"),pe=Rg("resize");return Ne(),mn("div",{onMousedown:w,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gs(["step-container app-card p-16",{isSelected:P.nodeModel.isSelected,error:b.value!==200}]),style:{overflow:"visible"}},[Ql((Ne(),mn("div",null,[ee("div",nq,[ee("div",{class:"flex align-center",onDragstart:X[0]||(X[0]=gn(()=>{},["prevent"])),onDrag:X[1]||(X[1]=gn(()=>{},["prevent"])),onDragover:X[2]||(X[2]=gn(()=>{},["prevent"])),onDragend:X[3]||(X[3]=gn(()=>{},["prevent"])),style:{width:"69%"}},[(Ne(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(se=t.nodeModel)==null?void 0:se.properties.node_data},null,8,["item"])),ee("h4",rq,_e(t.nodeModel.properties.stepName),1)],32),ee("div",{onMousemove:X[6]||(X[6]=gn(()=>{},["stop"])),onMousedown:X[7]||(X[7]=gn(()=>{},["stop"])),onKeydown:X[8]||(X[8]=gn(()=>{},["stop"])),onClick:X[9]||(X[9]=gn(()=>{},["stop"]))},[k(Q,{text:"",onClick:X[4]||(X[4]=we=>h.value=!h.value)},{default:j(()=>[k(W,{class:Gs(["arrow-icon color-secondary",h.value?"rotate-180":""])},{default:j(()=>[k(Y)]),_:1},8,["class"])]),_:1}),F(t.nodeModel.type)?(Ne(),bt(Se,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:j(()=>[ee("div",aq,[ee("h5",null,_e(z.$t("views.applicationWorkflow.condition.title")),1),ee("p",lq,[ee("span",null,_e(z.$t("views.applicationWorkflow.condition.front")),1),k(ie,{modelValue:f.value,"onUpdate:modelValue":X[5]||(X[5]=we=>f.value=we),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(J,{label:z.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(J,{label:z.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(z.$t("views.applicationWorkflow.condition.text")),1)])])]),default:j(()=>[k(Q,{text:""},{default:j(()=>[f.value==="OR"?(Ne(),mn("img",oq)):Bn("",!0),f.value==="AND"?(Ne(),mn("img",iq)):Bn("",!0)]),_:1})]),_:1})):Bn("",!0),F(t.nodeModel.type)?(Ne(),bt(Se,{key:1,teleported:!1,trigger:"click"},{dropdown:j(()=>[k(De,{style:{"min-width":"80px"}},{default:j(()=>[k(Pe,{onClick:E,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.rename")),1)]),_:1}),k(Pe,{onClick:M,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.copy")),1)]),_:1}),k(Pe,{onClick:T,class:"border-t p-8"},{default:j(()=>[ft(_e(z.$t("common.delete")),1)]),_:1})]),_:1})]),default:j(()=>[k(Q,{text:""},{default:j(()=>[k(Ae,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):Bn("",!0)],32)]),k(Be,null,{default:j(()=>[Ql(ee("div",{onMousedown:X[11]||(X[11]=gn(()=>{},["stop"])),onKeydown:X[12]||(X[12]=gn(()=>{},["stop"])),onClick:X[13]||(X[13]=gn(()=>{},["stop"])),class:"mt-16"},[b.value!=200?(Ne(),bt(ze,{key:0,class:"mb-16",title:P.nodeModel.type==="application-node"?z.$t("views.applicationWorkflow.tip.applicationNodeError"):z.$t("views.applicationWorkflow.tip.toolNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):Bn("",!0),Dj(z.$slots,"default",{},void 0,!0),B.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",sq,_e(z.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(B.value,(we,$e)=>(Ne(),mn("div",{key:$e,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:rt=>S.value=$e,onMouseleave:X[10]||(X[10]=rt=>S.value=null)},[ee("span",cq,_e(we.label)+" "+_e("{"+we.value+"}"),1),S.value===$e?(Ne(),bt(Ye,{key:0,effect:"dark",content:z.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(Q,{link:"",onClick:rt=>Wn(x_)(we.globeLabel),style:{padding:"0"}},{default:j(()=>[k(Ae,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,uq))),128))],64)):Bn("",!0)],544),[[Eh,h.value]])]),_:3})])),[[pe,$]])],2),k(Be,null,{default:j(()=>[r.value?(Ne(),bt(g3,{key:0,onMousemove:X[14]||(X[14]=gn(()=>{},["stop"])),onMousedown:X[15]||(X[15]=gn(()=>{},["stop"])),onClick:X[16]||(X[16]=gn(()=>{},["stop"])),onWheel:v,show:r.value,id:Wn(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:D},null,8,["show","id"])):Bn("",!0)]),_:1}),k(Ze,{title:z.$t("views.applicationWorkflow.nodeName"),modelValue:s.value,"onUpdate:modelValue":X[21]||(X[21]=we=>s.value=we),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:X[22]||(X[22]=gn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",dq,[k(Q,{onClick:X[19]||(X[19]=gn(we=>s.value=!1,["prevent"]))},{default:j(()=>[ft(_e(z.$t("common.cancel")),1)]),_:1}),k(Q,{type:"primary",onClick:X[20]||(X[20]=we=>O(a.value))},{default:j(()=>[ft(_e(z.$t("common.save")),1)]),_:1})])]),default:j(()=>[k(le,{"label-position":"top",ref_key:"titleFormRef",ref:a,model:l.value},{default:j(()=>[k(gt,{prop:"title",rules:[{required:!0,message:z.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[k(Je,{modelValue:l.value.title,"onUpdate:modelValue":X[17]||(X[17]=we=>l.value.title=we),onBlur:X[18]||(X[18]=we=>l.value.title=l.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),hi=Ph(fq,[["__scopeId","data-v-4532ca06"]]),pq={class:"title-decoration-1 mb-8"},hq={class:"flex-between w-full"},vq={class:"flex-between"},mq={class:"flex align-center"},gq={class:"flex align-center"},yq={class:"mr-4"},_q={class:"flex-between"},bq={class:"flex-between mb-16"},wq={key:0,class:"w-full mb-16"},Eq={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},xq={class:"flex align-center",style:{"line-height":"20px"}},Oq=["src"],Sq=["title"],Aq={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},Mq={class:"flex align-center",style:{"line-height":"20px"}},Tq={class:"ellipsis"},Cq={class:"flex-between mb-16"},Nq={class:"lighter"},kq={key:2,class:"w-full mb-16"},Pq={class:"flex align-center",style:{"line-height":"20px"}},Rq=["src"],Dq=["title"],jq={class:"flex-between"},Lq={class:"mr-4"},Iq={class:"flex"},Fq={class:"flex-between w-full"},Bq={class:"flex align-center"},$q={class:"mr-4"},Uq=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Be=>Be.ctrlKey===!0?(Be.preventDefault(),!0):(Be.stopPropagation(),!0);function a(Be){Me.set(b.nodeModel.properties.node_data,"system",Be)}function s(Be){Me.set(b.nodeModel.properties.node_data,"prompt",Be)}const l=Be=>{var Je;Be?(Je=w.value)==null||Je.reset_default(Be,o):V({})},h={model_id:"",system:"",prompt:`${Pt("views.applicationWorkflow.nodes.aiChatNode.defaultPrompt")}: {{${Pt("views.applicationWorkflow.nodes.searchKnowledgeNode.label")}.data}} ${Pt("views.problem.title")}: {{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:1,is_result:!0,temperature:null,max_tokens:null,dialogue_type:"WORKFLOW",model_setting:{reasoning_content_start:"",reasoning_content_end:"",reasoning_content_enable:!1}},v=hr({get:()=>b.nodeModel.properties.node_data?(b.nodeModel.properties.node_data.model_setting||Me.set(b.nodeModel.properties.node_data,"model_setting",{reasoning_content_start:"",reasoning_content_end:"",reasoning_content_enable:!1}),b.nodeModel.properties.node_data):(Me.set(b.nodeModel.properties,"node_data",h),b.nodeModel.properties.node_data),set:Be=>{Me.set(b.nodeModel.properties,"node_data",Be)}}),b=t,E=He(),O=He(null),w=He(),S=He(),M=()=>{var Be;return(Be=E.value)==null?void 0:Be.validate().catch(Je=>Promise.reject({node:b.nodeModel,errMessage:Je}))},T=e();function $(){var Je;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(Be).then(gt=>{O.value=Me.groupBy(gt==null?void 0:gt.data,"provider")})}const D=Be=>{var Je;Be&&((Je=w.value)==null||Je.open(Be,o,v.value.model_params_setting))},P=He(),B=Be=>{var Je;Be&&((Je=P.value)==null||Je.open(Be,o))},F=Be=>{Me.set(b.nodeModel.properties.node_data,"system",Be)},I=()=>{var Be;(Be=S.value)==null||Be.open(v.value.model_setting)};function V(Be){Me.set(b.nodeModel.properties.node_data,"model_params_setting",Be)}function z(Be){let Je=Me.cloneDeep(b.nodeModel.properties.node_data.model_setting);Je={...Je,...Be},Me.set(b.nodeModel.properties.node_data,"model_setting",Je)}const X=He();function Y(){const Be={mcp_servers:v.value.mcp_servers,mcp_tool_ids:v.value.mcp_tool_ids,mcp_source:v.value.mcp_source};X.value.open(Be,ze.value)}function W(Be){Me.set(b.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),Me.set(b.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const Q=He();function J(){Q.value.open(v.value.tool_ids)}function ie(Be){Me.set(b.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function Se(Be){const Je=b.nodeModel.properties.node_data.tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"tool_ids",Je)}function Ae(Be){const Je=b.nodeModel.properties.node_data.mcp_tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Je)}const Pe=He([]);function De(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{Pe.value=[...gt.data.shared_tools,...gt.data.tools].filter(le=>le.is_active)})}const ze=He([]);function Ye(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{ze.value=[...gt.data.shared_tools,...gt.data.tools].filter(le=>le.is_active)})}return bo(()=>{var Be,Je,gt,le;$(),typeof((Be=b.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&Qd(b.nodeModel)&&Me.set(b.nodeModel.properties.node_data,"is_result",!0),Me.set(b.nodeModel,"validate",M),v.value.dialogue_type||(v.value.dialogue_type="WORKFLOW"),(Je=b.nodeModel.properties.node_data)!=null&&Je.mcp_tool_id&&(Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",[(gt=b.nodeModel.properties.node_data)==null?void 0:gt.mcp_tool_id]),Me.set(b.nodeModel.properties.node_data,"mcp_tool_id",void 0)),((le=b.nodeModel.properties.node_data)==null?void 0:le.mcp_output_enable)===void 0&&Me.set(b.nodeModel.properties.node_data,"mcp_output_enable",!0),De(),Ye()}),(Be,Je)=>{const gt=ne("AppIcon"),le=ne("el-button"),Ze=ne("ModelSelect"),pe=ne("el-form-item"),se=ne("el-tooltip"),we=ne("MdEditorMagnify"),$e=ne("el-option"),rt=ne("el-select"),pt=ne("el-input-number"),Lt=ne("el-switch"),Jt=ne("el-avatar"),en=ne("ToolIcon"),zt=ne("Close"),it=ne("el-icon"),ae=ne("el-form"),re=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",pq,_e(Be.$t("views.applicationWorkflow.nodeSetting")),1),k(re,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(ae,{onSubmit:Je[16]||(Je[16]=gn(()=>{},["prevent"])),model:v.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:E,"hide-required-asterisk":""},{default:j(()=>{var je,vt;return[k(pe,{label:Be.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:Be.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hq,[ee("div",null,[ee("span",null,[ft(_e(Be.$t("views.application.form.aiModel.label")),1),Je[17]||(Je[17]=ee("span",{class:"color-danger"},"*",-1))])]),k(le,{disabled:!v.value.model_id,type:"primary",link:"",onClick:Je[0]||(Je[0]=q=>D(v.value.model_id)),onRefreshForm:V},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Ze,{onChange:l,onWheel:i,teleported:!1,modelValue:v.value.model_id,"onUpdate:modelValue":Je[1]||(Je[1]=q=>v.value.model_id=q),placeholder:Be.$t("views.application.form.aiModel.placeholder"),options:O.value,onSubmitModel:$,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(pe,null,{label:j(()=>[ee("div",vq,[ee("div",mq,[ee("span",null,_e(Be.$t("views.application.form.roleSettings.label")),1),k(se,{effect:"dark",content:Be.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(gt,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(le,{type:"primary",link:"",onClick:Je[2]||(Je[2]=q=>B(v.value.model_id)),disabled:!v.value.model_id},{default:j(()=>[k(gt,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(we,{title:Be.$t("views.application.form.roleSettings.label"),modelValue:v.value.system,"onUpdate:modelValue":Je[3]||(Je[3]=q=>v.value.system=q),style:{height:"100px"},onSubmitDialog:a,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(pe,{label:Be.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:Be.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",gq,[ee("div",yq,[ee("span",null,[ft(_e(Be.$t("views.application.form.prompt.label")),1),Je[18]||(Je[18]=ee("span",{class:"color-danger"},"*",-1))])]),k(se,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(we,{onWheel:i,title:Be.$t("views.application.form.prompt.label"),modelValue:v.value.prompt,"onUpdate:modelValue":Je[4]||(Je[4]=q=>v.value.prompt=q),style:{height:"150px"},onSubmitDialog:s,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(pe,{label:Be.$t("views.application.form.historyRecord.label")},{label:j(()=>[ee("div",_q,[ee("div",null,_e(Be.$t("views.application.form.historyRecord.label")),1),k(rt,{modelValue:v.value.dialogue_type,"onUpdate:modelValue":Je[5]||(Je[5]=q=>v.value.dialogue_type=q),type:"small",style:{width:"100px"}},{default:j(()=>[k($e,{label:Be.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k($e,{label:Be.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(pt,{modelValue:v.value.dialogue_number,"onUpdate:modelValue":Je[6]||(Je[6]=q=>v.value.dialogue_number=q),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),ee("div",bq,[Je[19]||(Je[19]=ee("div",{class:"lighter"},"MCP",-1)),ee("div",null,[v.value.mcp_enable?(Ne(),bt(le,{key:0,type:"primary",class:"mr-4",link:"",onClick:Y,onRefreshForm:V},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),k(Lt,{size:"small",modelValue:v.value.mcp_enable,"onUpdate:modelValue":Je[7]||(Je[7]=q=>v.value.mcp_enable=q)},null,8,["modelValue"])])]),((je=v.value.mcp_tool_ids)==null?void 0:je.length)>0?(Ne(),mn("div",wq,[(Ne(!0),mn(Ir,null,No(v.value.mcp_tool_ids,(q,kt)=>{var Rt,Gt,Pn;return Ne(),mn(Ir,{key:kt},[Wn(bs)(ze.value,q,"id")?(Ne(),mn("div",Eq,[ee("div",xq,[(Rt=Wn(bs)(ze.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bs)(ze.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Oq)]}),_:2},1024)):(Ne(),bt(en,{key:1,type:"MCP",class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bs)(ze.value,q,"id"))==null?void 0:Gt.name},_e(((Pn=Wn(bs)(ze.value,q,"id"))==null?void 0:Pn.name)||Be.$t("common.custom")+" MCP"),9,Sq)]),k(le,{text:"",onClick:qt=>Ae(q)},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1},8,["onClick"])])):Bn("",!0)],64)}),128))])):Bn("",!0),v.value.mcp_servers&&v.value.mcp_servers.length>0?(Ne(),mn("div",Aq,[ee("div",Mq,[k(en,{type:"MCP",class:"mr-8",size:20}),ee("div",Tq,_e(Be.$t("common.custom")+" MCP"),1)]),k(le,{text:"",onClick:Je[8]||(Je[8]=q=>v.value.mcp_servers="")},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):Bn("",!0),ee("div",Cq,[ee("div",Nq,_e(Be.$t("views.tool.title")),1),ee("div",null,[v.value.tool_enable?(Ne(),bt(le,{key:0,type:"primary",class:"mr-4",link:"",onClick:J,onRefreshForm:V},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),k(Lt,{size:"small",modelValue:v.value.tool_enable,"onUpdate:modelValue":Je[9]||(Je[9]=q=>v.value.tool_enable=q)},null,8,["modelValue"])])]),((vt=v.value.tool_ids)==null?void 0:vt.length)>0?(Ne(),mn("div",kq,[(Ne(!0),mn(Ir,null,No(v.value.tool_ids,(q,kt)=>{var Rt,Gt,Pn;return Ne(),mn("div",{key:kt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Pq,[(Rt=Wn(bs)(Pe.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bs)(Pe.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Rq)]}),_:2},1024)):(Ne(),bt(en,{key:1,class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bs)(Pe.value,q,"id"))==null?void 0:Gt.name},_e((Pn=Wn(bs)(Pe.value,q,"id"))==null?void 0:Pn.name),9,Dq)]),k(le,{text:"",onClick:qt=>Se(q)},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1},8,["onClick"])])}),128))])):Bn("",!0),v.value.mcp_enable||v.value.tool_enable?(Ne(),bt(pe,{key:3,onClick:Je[11]||(Je[11]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",jq,[ee("span",Lq,_e(Be.$t("views.application.form.mcp_output_enable")),1),ee("div",Iq,[k(Lt,{class:"ml-8",size:"small",modelValue:v.value.mcp_output_enable,"onUpdate:modelValue":Je[10]||(Je[10]=q=>v.value.mcp_output_enable=q)},null,8,["modelValue"])])])]),_:1})):Bn("",!0),k(pe,{onClick:Je[13]||(Je[13]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Fq,[ee("div",null,[ee("span",null,_e(Be.$t("views.application.form.reasoningContent.label")),1)]),ee("div",null,[v.value.model_setting.reasoning_content_enable?(Ne(),bt(le,{key:0,type:"primary",link:"",onClick:I,onRefreshForm:V,class:"mr-4"},{default:j(()=>[k(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),k(Lt,{size:"small",modelValue:v.value.model_setting.reasoning_content_enable,"onUpdate:modelValue":Je[12]||(Je[12]=q=>v.value.model_setting.reasoning_content_enable=q)},null,8,["modelValue"])])])]),_:1}),k(pe,{onClick:Je[15]||(Je[15]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Bq,[ee("div",$q,[ee("span",null,_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(se,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Lt,{size:"small",modelValue:v.value.is_result,"onUpdate:modelValue":Je[14]||(Je[14]=q=>v.value.is_result=q)},null,8,["modelValue"])]),_:1})]}),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:w,onRefresh:V},null,512),k(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:P},null,512),k(x9,{ref_key:"ReasoningParamSettingDialogRef",ref:S,onRefresh:z},null,512),k(O9,{ref_key:"mcpServersDialogRef",ref:X,onRefresh:W},null,512),k(S9,{ref_key:"toolDialogRef",ref:Q,onRefresh:ie},null,512)]),_:1},8,["nodeModel"])}}});var gk={width:40,height:40},yk={width:40,height:40},_k={width:40,height:40},bk={width:100,height:80},wk={width:100,height:80},V1,xo,y3,Iv,Ek,_3,b3,w3,hM,wA,EA,yw={},_w=[],Vq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eb=Array.isArray;function op(t,e){for(var n in e)t[n]=e[n];return t}function vM(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lr(t,e,n){var o,r,i,a={};for(i in e)i=="key"?o=e[i]:i=="ref"?r=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?V1.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)a[i]===void 0&&(a[i]=t.defaultProps[i]);return X0(t,a,o,r,null)}function X0(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++y3,__i:-1,__u:0};return r==null&&xo.vnode!=null&&xo.vnode(i),i}function W1(){return{current:null}}function jg(t){return t.children}function ko(t,e){this.props=t,this.context=e}function Lg(t,e){if(e==null)return t.__?Lg(t.__,t.__i+1):null;for(var n;ee&&Iv.sort(b3),t=Iv.shift(),e=Iv.length,Wq(t);bw.__r=0}function x3(t,e,n,o,r,i,a,s,l,f,h){var v,b,E,O,w,S,M,T=o&&o.__k||_w,$=e.length;for(l=Gq(n,e,T,l,$),v=0;v<$;v++)(E=n.__k[v])!=null&&(b=E.__i!=-1&&T[E.__i]||yw,E.__i=v,S=mM(t,E,b,r,i,a,s,l,f,h),O=E.__e,E.ref&&b.ref!=E.ref&&(b.ref&&gM(b.ref,null,E),h.push(E.ref,E.__c||O,E)),w==null&&O!=null&&(w=O),(M=!!(4&E.__u))||b.__k===E.__k?l=O3(E,l,t,M):typeof E.type=="function"&&S!==void 0?l=S:O&&(l=O.nextSibling),E.__u&=-7);return n.__e=w,l}function Gq(t,e,n,o,r){var i,a,s,l,f,h=n.length,v=h,b=0;for(t.__k=new Array(r),i=0;i0?a=t.__k[i]=X0(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[i]=a,l=i+b,a.__=t,a.__b=t.__b+1,s=null,(f=a.__i=zq(a,n,l,v))!=-1&&(v--,(s=n[f])&&(s.__u|=2)),s==null||s.__v==null?(f==-1&&(r>h?b--:rl?b--:b++,a.__u|=4))):t.__k[i]=null;if(v)for(i=0;i(h?1:0)){for(r=n-1,i=n+1;r>=0||i=0?r--:i++])!=null&&(2&f.__u)==0&&s==f.key&&l==f.type)return a}return-1}function Ok(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Vq.test(e)?n:n+"px"}function f0(t,e,n,o,r){var i,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||Ok(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||Ok(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(w3,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=hM,t.addEventListener(e,i?EA:wA,i)):t.removeEventListener(e,i?EA:wA,i);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Sk(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=hM++;else if(e.t0?t:eb(t)?t.map(A3):op({},t)}function Hq(t,e,n,o,r,i,a,s,l){var f,h,v,b,E,O,w,S=n.props||yw,M=e.props,T=e.type;if(T=="svg"?r="http://www.w3.org/2000/svg":T=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function _g(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function EM(){for(var t=[],e=0;e2&&Ly("box");var n=pg(e);return new zv(t,h0(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ly("array");var n=pg(e);return KK(t,h0(n),n.name)},map:function(t,e){arguments.length>2&&Ly("map");var n=pg(e);return new AM(t,h0(n),n.name)},set:function(t,e){arguments.length>2&&Ly("set");var n=pg(e);return new tI(t,h0(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ly("object");var o=pg(n);if(o.proxy===!1)return NA({},t,e,o);var r=q3(o),i=NA({},void 0,void 0,o),a=XK(i);return K3(a,t,e,r),a},ref:R3,shallow:cK,deep:xM,struct:dK},Ut=fK;Object.keys(Ak).forEach(function(t){return Ut[t]=Ak[t]});function Ly(t){Qo("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var Sw=k3(!1,function(t,e,n,o,r){var i=n.get,a=n.set,s=r[0]||{};MM(t).addComputedProp(t,e,xw({get:i,set:a,context:t},s))}),pK=Sw({equals:Ig.structural}),Ai=function(e,n,o){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Sw.apply(null,arguments);var r=typeof n=="object"?n:{};return r.get=e,r.set=typeof n=="function"?n:r.set,r.name=r.name||e.name||"",new Bg(r)};Ai.struct=pK;var ii;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(ii||(ii={}));var Wd;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Wd||(Wd={}));var Aw=(function(){function t(e){this.cause=e}return t})();function zy(t){return t instanceof Aw}function SA(t){switch(t.dependenciesState){case ii.UP_TO_DATE:return!1;case ii.NOT_TRACKING:case ii.STALE:return!0;case ii.POSSIBLY_STALE:{for(var e=OM(!0),n=ly(),o=t.observing,r=o.length,i=0;i0;yr.computationDepth>0&&e&&Qo(!1),!yr.allowStateChanges&&(e||yr.enforceActions==="strict")&&Qo(!1)}function D3(t,e,n){var o=OM(!0);L3(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++yr.runId;var r=yr.trackingDerivation;yr.trackingDerivation=t;var i;if(yr.disableErrorBoundaries===!0)i=e.call(n);else try{i=e.call(n)}catch(a){i=new Aw(a)}return yr.trackingDerivation=r,hK(t),e_(o),i}function hK(t){for(var e=t.observing,n=t.observing=t.newObserving,o=ii.UP_TO_DATE,r=0,i=t.unboundDepsCount,a=0;ao&&(o=s.dependenciesState)}for(n.length=r,t.newObserving=null,i=e.length;i--;){var s=e[i];s.diffValue===0&&B3(s,t),s.diffValue=0}for(;r--;){var s=n[r];s.diffValue===1&&(s.diffValue=0,wK(s,t))}o!==ii.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}function AA(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)B3(e[n],t);t.dependenciesState=ii.NOT_TRACKING}function j3(t){var e=ly();try{return t()}finally{bh(e)}}function ly(){var t=yr.trackingDerivation;return yr.trackingDerivation=null,t}function bh(t){yr.trackingDerivation=t}function OM(t){var e=yr.allowStateReads;return yr.allowStateReads=t,e}function e_(t){yr.allowStateReads=t}function L3(t){if(t.dependenciesState!==ii.UP_TO_DATE){t.dependenciesState=ii.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=ii.UP_TO_DATE}}var Mw=0,vK=1,Mk=Object.getOwnPropertyDescriptor(function(){},"name");Mk&&Mk.configurable;function Gv(t,e,n){var o=function(){return I3(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function I3(t,e,n,o){var r=mK();try{return e.apply(n,o)}catch(i){throw r.error=i,i}finally{gK(r)}}function mK(t,e,n){var o=Zu(),r=0,i=ly();Kc();var a=H1(!0),s=OM(!0),l={prevDerivation:i,prevAllowStateChanges:a,prevAllowStateReads:s,notifySpy:o,startTime:r,actionId:vK++,parentActionId:Mw};return Mw=l.actionId,l}function gK(t){Mw!==t.actionId&&Qo("invalid action stack. did you forget to finish an action?"),Mw=t.parentActionId,t.error!==void 0&&(yr.suppressReactionErrors=!0),X1(t.prevAllowStateChanges),e_(t.prevAllowStateReads),Zc(),bh(t.prevDerivation),yr.suppressReactionErrors=!1}function H1(t){var e=yr.allowStateChanges;return yr.allowStateChanges=t,e}function X1(t){yr.allowStateChanges=t}var zv=(function(t){rK(e,t);function e(n,o,r,i,a){r===void 0&&(r="ObservableValue@"+Hs()),a===void 0&&(a=Ig.default);var s=t.call(this,r)||this;return s.enhancer=o,s.name=r,s.equals=a,s.hasUnreportedChange=!1,s.value=o(n,void 0,r),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){this.value,n=this.prepareNewValue(n),n!==yr.UNCHANGED&&this.setNewValue(n)},e.prototype.prepareNewValue=function(n){if(Fg(this),Gd(this)){var o=zd(this,{object:this,type:"update",newValue:n});if(!o)return yr.UNCHANGED;n=o.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?yr.UNCHANGED:n},e.prototype.setNewValue=function(n){var o=this.value;this.value=n,this.reportChanged(),Jc(this)&&Qc(this,{type:"update",object:this,newValue:n,oldValue:o})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return rb(this,n)},e.prototype.observe=function(n,o){return o&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),ob(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return N3(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(ay),yK=jh("ObservableValue",zv),Bg=(function(){function t(e){this.dependenciesState=ii.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ii.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Hs(),this.value=new Aw(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Wd.NONE,Wv(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+Hs(),e.set&&(this.setter=Gv(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Ig.structural:Ig.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){OK(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&Qo("Cycle detected in computation "+this.name+": "+this.derivation),yr.inBatch===0&&this.observers.size===0&&!this.keepAlive?SA(this)&&(this.warnAboutUntrackedRead(),Kc(),this.value=this.computeValue(!1),Zc()):(U3(this),SA(this)&&this.trackAndCompute()&&xK(this));var e=this.value;if(zy(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(zy(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Wv(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Wv(!1,!1)},t.prototype.trackAndCompute=function(){var e=this.value,n=this.dependenciesState===ii.NOT_TRACKING,o=this.computeValue(!0),r=n||zy(e)||zy(o)||!this.equals(e,o);return r&&(this.value=o),r},t.prototype.computeValue=function(e){this.isComputing=!0,yr.computationDepth++;var n;if(e)n=D3(this,this.derivation,this.scope);else if(yr.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(o){n=new Aw(o)}return yr.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(AA(this),this.value=void 0)},t.prototype.observe=function(e,n){var o=this,r=!0,i=void 0;return PK(function(){var a=o.get();if(!r||n){var s=ly();e({type:"update",object:o,newValue:a,oldValue:i}),bh(s)}r=!1,i=a})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return N3(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(),$g=jh("ComputedValue",Bg),Y0=(function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t})(),_K={};function MA(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_K}var q0=!0,F3=!1,yr=(function(){var t=MA();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(q0=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Y0().version&&(q0=!1),q0?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Y0):(setTimeout(function(){F3||Qo("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Y0)})();function bK(){(yr.pendingReactions.length||yr.inBatch||yr.isRunningReactions)&&Qo("isolateGlobalState should be called before MobX is running any reactions"),F3=!0,q0&&(--MA().__mobxInstanceCount===0&&(MA().__mobxGlobals=void 0),yr=new Y0)}function TA(){return yr}function wK(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function B3(t,e){t.observers.delete(e),t.observers.size===0&&$3(t)}function $3(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,yr.pendingUnobservations.push(t))}function Kc(){yr.inBatch++}function Zc(){if(--yr.inBatch===0){G3();for(var t=yr.pendingUnobservations,e=0;e0&&$3(t),!1)}function EK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.isTracing!==Wd.NONE&&V3(e,t),e.onBecomeStale()),e.dependenciesState=ii.STALE}))}function xK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.POSSIBLY_STALE?e.dependenciesState=ii.STALE:e.dependenciesState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.UP_TO_DATE)}))}function OK(t){t.lowestObserverState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.dependenciesState=ii.POSSIBLY_STALE,e.isTracing!==Wd.NONE&&V3(e,t),e.onBecomeStale())}))}function V3(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Wd.BREAK){var n=[];W3(IK(t),n,1),new Function(`debugger; /* Tracing '`+t.name+`' You are entering this break point because derivation '`+t.name+"' is being traced and '"+e.name+`' is now forcing it to update. Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update The stackframe you are looking for is at least ~6-8 stack-frames up. `+(t instanceof Bg?t.derivation.toString().replace(/[*]\//g,"/"):"")+` The dependencies for this derivation are: `+n.join(` `)+` */ `)()}}function W3(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(o){return W3(o,e,n+1)})}var A_=(function(){function t(e,n,o,r){e===void 0&&(e="Reaction@"+Hs()),r===void 0&&(r=!1),this.name=e,this.onInvalidate=n,this.errorHandler=o,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=ii.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Hs(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Wd.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,yr.pendingReactions.push(this),G3())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Kc(),this._isScheduled=!1,SA(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Zu()}catch(e){this.reportExceptionInDerivation(e)}}Zc()}},t.prototype.track=function(e){if(!this.isDisposed){Kc(),this._isRunning=!0;var n=D3(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&AA(this),zy(n)&&this.reportExceptionInDerivation(n.cause),Zc()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(yr.disableErrorBoundaries)throw e;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";yr.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(o,e),yr.globalReactionErrorHandlers.forEach(function(r){return r(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Kc(),AA(this),Zc()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[eo]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),GK(this,e)},t})(),Tk=100,CA=function(t){return t()};function G3(){yr.inBatch>0||yr.isRunningReactions||CA(SK)}function SK(){yr.isRunningReactions=!0;for(var t=yr.pendingReactions,e=0;t.length>0;){++e===Tk&&(console.error("Reaction doesn't converge to a stable state after "+Tk+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),o=0,r=n.length;o",e);if(arguments.length===2&&typeof n=="function")return Gv(e,n);if(arguments.length===1&&typeof e=="string")return Ck(e);if(r===!0)oy(e,n,Gv(e.name||n,o.value,this));else return Ck(n).apply(null,arguments)};Bt.bound=NK;function kK(t,e){var n=typeof t=="string"?t:t.name||"",o=typeof t=="function"?t:e;return I3(n,o,this,void 0)}function ZO(t,e,n){oy(t,e,Gv(e,n.bind(t)))}function PK(t,e){e===void 0&&(e=yM);var n=e&&e.name||t.name||"Autorun@"+Hs(),o=!e.scheduler&&!e.delay,r;if(o)r=new A_(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var i=z3(e),a=!1;r=new A_(n,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(s)}))},e.onError,e.requiresObservable)}function s(){t(r)}return r.schedule(),r.getDisposer()}var RK=function(t){return t()};function z3(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:RK}function H3(t,e,n){n===void 0&&(n=yM);var o=n.name||"Reaction@"+Hs(),r=Bt(o,n.onError?DK(n.onError,e):e),i=!n.scheduler&&!n.delay,a=z3(n),s=!0,l=!1,f,h=n.compareStructural?Ig.structural:n.equals||Ig.default,v=new A_(o,function(){s||i?b():l||(l=!0,a(b))},n.onError,n.requiresObservable);function b(){if(l=!1,!v.isDisposed){var E=!1;v.track(function(){var O=t(v);E=s||!h(f,O),f=O}),s&&n.fireImmediately&&r(f,v),!s&&E===!0&&r(f,v),s&&(s=!1)}}return v.schedule(),v.getDisposer()}function DK(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function jK(t,e,n){return Y3("onBecomeObserved",t,e)}function X3(t,e,n){return Y3("onBecomeUnobserved",t,e)}function Y3(t,e,n,o){var r=Mh(e),i=n,a=t+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var s=r[t];return typeof s!="function"?Qo(!1):function(){var l=r[a];l&&(l.delete(i),l.size===0&&delete r[a])}}function LK(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,r=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(bK(),e!==void 0){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:Qo("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}yr.enforceActions=l,yr.allowStateChanges=!(l===!0||l==="strict")}n!==void 0&&(yr.computedRequiresReaction=!!n),a!==void 0&&(yr.reactionRequiresObservable=!!a),s!==void 0&&(yr.observableRequiresReaction=!!s,yr.allowStateReads=!yr.observableRequiresReaction),o!==void 0&&(yr.computedConfigurable=!!o),r!==void 0&&(r===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),yr.disableErrorBoundaries=!!r),i&&AK(i)}function NA(t,e,n,o){o=pg(o);var r=q3(o);return qv(t),MM(t,o.name,r.enhancer),e&&K3(t,e,n,r),t}function q3(t){return t.defaultDecorator||(t.deep===!1?R3:xM)}function K3(t,e,n,o){var r,i,a,s,l;Kc();try{var a=eK(e);try{for(var f=Vd(a),h=f.next();!h.done;h=f.next()){var l=h.value,v=Object.getOwnPropertyDescriptor(e,l),b=n&&l in n?n[l]:v.get?Sw:o,E=b(t,l,v,!0);E&&Object.defineProperty(t,l,E)}}catch(w){r={error:w}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}finally{Zc()}}function IK(t,e){return Z3(Mh(t,e))}function Z3(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=Kq(t.observing).map(Z3)),e}function J3(t,e){if(t==null)return!1;if(e!==void 0){if(rd(t)===!1||!t[eo].values.has(e))return!1;var n=Mh(t,e);return $g(n)}return $g(t)}function FK(t){return arguments.length>1?Qo(!1):J3(t)}function Nk(t,e){return typeof e!="string"?Qo(!1):J3(t,e)}function BK(t,e){return t==null?!1:rd(t)||!!t[eo]||bM(t)||Tw(t)||$g(t)}function Ug(t){return arguments.length!==1&&Qo(!1),BK(t)}function Vg(t){return rd(t)?t[eo].getKeys():Ys(t)||oc(t)?Array.from(t.keys()):tf(t)?t.map(function(e,n){return n}):Qo(!1)}function $K(t){return rd(t)?Vg(t).map(function(e){return t[e]}):Ys(t)?Vg(t).map(function(e){return t.get(e)}):oc(t)?Array.from(t.values()):tf(t)?t.slice():Qo(!1)}function UK(t){return rd(t)?Vg(t).map(function(e){return[e,t[e]]}):Ys(t)?Vg(t).map(function(e){return[e,t.get(e)]}):oc(t)?Array.from(t.entries()):tf(t)?t.map(function(e,n){return[n,e]}):Qo(!1)}function SM(t,e,n){if(arguments.length===2&&!oc(t)){Kc();var o=e;try{for(var r in o)SM(t,r,o[r])}finally{Zc()}return}if(rd(t)){var i=t[eo],a=i.values.get(e);a?i.write(e,n):i.addObservableProp(e,n,i.defaultEnhancer)}else if(Ys(t))t.set(e,n);else if(oc(t))t.add(e);else if(tf(t))typeof e!="number"&&(e=parseInt(e,10)),Wv(e>=0,"Not a valid index: '"+e+"'"),Kc(),e>=t.length&&(t.length=e+1),t[e]=n,Zc();else return Qo(!1)}function Q3(t,e,n,o){return VK(t,e,n)}function VK(t,e,n){return Y1(t).observe(e,n)}var WK={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function tg(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function ch(t,e,n){if(!e.recurseEverything&&!Ug(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yK(t))return ch(t.get(),e,n);Ug(t)&&Vg(t);var o=e.detectCycles===!0;if(o&&t!==null&&n.has(t))return n.get(t);if(tf(t)||Array.isArray(t)){var r=tg(n,t,[],e),i=t.map(function(E){return ch(E,e,n)});r.length=i.length;for(var a=0,s=i.length;a0}function rb(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),T3(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function zd(t,e){var n=ly();try{for(var o=EM(t.interceptors||[]),r=0,i=o.length;r0}function ob(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),T3(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function Qc(t,e){var n=ly(),o=t.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ob(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var o=new Array(e-n),r=0;ri?e=i:e<0&&(e=Math.max(0,i+e)),arguments.length===1?n=i-e:n==null?n=0:n=Math.max(0,Math.min(n,i-e)),o===void 0&&(o=Ew),Gd(this)){var a=zd(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:o});if(!a)return Ew;n=a.removedCount,o=a.added}o=o.length===0?o:o.map(function(l){return r.enhancer(l,void 0)});var s=this.spliceItemsIntoValues(e,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice(e,o,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(e,n,o){var r;if(o.length-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[eo];if(e){if(t=0&&n++;break}t=Ik(t),e=Ik(e);var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,f=e.constructor;if(l!==f&&!(typeof l=="function"&&l instanceof l&&typeof f=="function"&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),o=o||[],r=r||[];for(var h=o.length;h--;)if(o[h]===t)return r[h]===e;if(o.push(t),r.push(e),s){if(h=t.length,h!==e.length)return!1;for(;h--;)if(!kA(t[h],e[h],n-1,o,r))return!1}else{var v=Object.keys(t),b=void 0;if(h=v.length,Object.keys(e).length!==h)return!1;for(;h--;)if(b=v[h],!(oZ(e,b)&&kA(t[b],e[b],n-1,o,r)))return!1}return o.pop(),r.pop(),!0}function Ik(t){return tf(t)?t.slice():iy(t)||Ys(t)||tb(t)||oc(t)?Array.from(t.entries()):t}function oZ(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Cw(t){return t[Symbol.iterator]=iZ,t}function iZ(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:MK,extras:{getDebugName:rZ},$mobx:eo});function aZ(t){return!(t.prototype&&t.prototype.render)&&!ko.isPrototypeOf(t)}function oI(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,o=n===void 0?"":n,r=e.suffix,i=r===void 0?"":r,a=t.displayName||t.name||t.constructor&&t.constructor.name||"";return o+a+i}var Fk=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},iI=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},aI=(function(){function t(e,n){for(var o=0;o2&&arguments[2]!==void 0?arguments[2]:!1,o=t[e],r=uI[e],i=o?n===!0?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;t[e]=i}function Uk(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":Fk(t))!=="object"||(typeof e>"u"?"undefined":Fk(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(e[o]!==t[o])return!0;return!1}var uI={componentWillMount:function(){var e=this,n=oI(this),o=!1,r=!1;function i(v){var b=this[v],E=wM("reactive "+v);Object.defineProperty(this,v,{configurable:!0,enumerable:!0,get:function(){return E.reportObserved(),b},set:function(w){!r&&Uk(b,w)?(b=w,o=!0,E.reportChanged(),o=!1):b=w}})}i.call(this,"props"),i.call(this,"state");var a=this.render.bind(this),s=null,l=!1,f=function(){return s=new A_(n+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var b=!0;try{r=!0,o||ko.prototype.forceUpdate.call(e),b=!1}finally{r=!1,b&&s.dispose()}}}),s.reactComponent=e,h.$mobx=s,e.render=h,h(e.props,e.state,e.context)},h=function(b,E,O){l=!1;var w=void 0,S=void 0;if(s.track(function(){try{S=uZ(!1,a,b,E,O)}catch(M){w=M}}),w)throw w;return S};this.render=f},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:Uk(this.props,e)}};function TM(t){if(arguments.length>1&&Bk.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&Bk.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aZ(t)){var e,n;return TM((n=e=(function(r){lI(i,r);function i(){return iI(this,i),sI(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return aI(i,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),i})(ko),e.displayName=oI(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var o=t.prototype||t;return cZ(o),t.isMobXReactObserver=!0,t}function cZ(t){$k(t,"componentWillMount",!0),$k(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=uI.shouldComponentUpdate)}var dZ=TM(function(t){var e=t.children;return e[0]()});dZ.displayName="Observer";var fZ=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pZ(t,e){return e={exports:{}},t(e,e.exports),e.exports}pZ(function(t,e){(function(n,o){t.exports=o()})(fZ,(function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,f=l&&l(Object);return function h(v,b,E){if(typeof b!="string"){if(f){var O=l(b);O&&O!==f&&h(v,O,E)}var w=i(b);a&&(w=w.concat(a(b)));for(var S=0;S1?Lr("div",null," ",r," "):r[0]}},{key:"getChildContext",value:function(){var o={},r=this.context.mobxStores;if(r)for(var i in r)o[i]=r[i];for(var a in this.props)!Vk[a]&&a!=="suppressChangedStoreWarning"&&(o[a]=this.props[a]);return{mobxStores:o}}},{key:"componentWillReceiveProps",value:function(o){if(Object.keys(o).length!==Object.keys(this.props).length&&Wk.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!o.suppressChangedStoreWarning)for(var r in o)!Vk[r]&&this.props[r]!==o[r]&&Wk.warn("MobX Provider: Provided store '"+r+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e})(ko);if(!ko)throw new Error("mobx-preact requires Preact to be available");var $d,JO,Gk,cI=[],jl=xo,zk=jl.__b,Hk=jl.__r,Xk=jl.diffed,Yk=jl.__c,qk=jl.unmount,Kk=jl.__;function hZ(){for(var t;t=cI.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(K0),e.__h.some(PA),e.__h=[]}catch(n){e.__h=[],jl.__e(n,t.__v)}}}jl.__b=function(t){$d=null,zk&&zk(t)},jl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Kk&&Kk(t,e)},jl.__r=function(t){Hk&&Hk(t);var e=($d=t.__c).__H;e&&(JO===$d?(e.__h=[],$d.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(K0),e.__h.some(PA),e.__h=[])),JO=$d},jl.diffed=function(t){Xk&&Xk(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(cI.push(e)!==1&&Gk===jl.requestAnimationFrame||((Gk=jl.requestAnimationFrame)||vZ)(hZ)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),JO=$d=null},jl.__c=function(t,e){e.some(function(n){try{n.__h.some(K0),n.__h=n.__h.filter(function(o){return!o.__||PA(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],jl.__e(o,n.__v)}}),Yk&&Yk(t,e)},jl.unmount=function(t){qk&&qk(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(o){try{K0(o)}catch(r){e=r}}),n.__H=void 0,e&&jl.__e(e,n.__v))};var Zk=typeof requestAnimationFrame=="function";function vZ(t){var e,n=function(){clearTimeout(o),Zk&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);Zk&&(e=requestAnimationFrame(n))}function K0(t){var e=$d,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),$d=e}function PA(t){var e=$d;t.__c=t.__(),$d=e}function mZ(t,e){for(var n in e)t[n]=e[n];return t}function Jk(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return!0;return!1}function Qk(t,e){this.props=t,this.context=e}(Qk.prototype=new ko).isPureReactComponent=!0,Qk.prototype.shouldComponentUpdate=function(t,e){return Jk(this.props,t)||Jk(this.state,e)};var eP=xo.__b;xo.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),eP&&eP(t)};var gZ=xo.__e;xo.__e=function(t,e,n,o){if(t.then){for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}gZ(t,e,n,o)};var tP=xo.unmount;function dI(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=mZ({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return dI(o,e,n)})),t}function fI(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return fI(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function QO(){this.__u=0,this.o=null,this.__b=null}function pI(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function g0(){this.i=null,this.l=null}xo.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),tP&&tP(t)},(QO.prototype=new ko).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=pI(o.__v),i=!1,a=function(){i||o.__z||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(!--o.__u){if(o.state.__a){var f=o.state.__a;o.__v.__k[0]=fI(f,f.__c.__P,f.__c.__O)}var h;for(o.setState({__a:o.__b=null});h=o.o.pop();)h.__P=s,h.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},QO.prototype.componentWillUnmount=function(){this.o=[]},QO.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=dI(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&Lr(jg,null,t.fallback);return r&&(r.__u&=-33),[Lr(jg,null,e.__a?null:t.children),r]};var nP=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]M.step||Math.abs(M.sumDeltaY)>M.step)){var P=M.sumDeltaX%M.step,B=M.sumDeltaY%M.step,F=M.sumDeltaX-P,I=M.sumDeltaY-B;M.sumDeltaX=P,M.sumDeltaY=B;var V=($=M.model)===null||$===void 0?void 0:$.getData();M.isDragging||((D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_DRAGSTART")],{e:T,data:M.data||V}),M.onDragStart({event:T})),M.isDragging=!0,Promise.resolve().then(function(){var z,X;M.onDragging({deltaX:F,deltaY:I,event:T}),(z=M.eventCenter)===null||z===void 0||z.emit(pr["".concat(M.eventType,"_MOUSEMOVE")],{deltaX:F,deltaY:I,e:T,data:M.data||V}),(X=M.eventCenter)===null||X===void 0||X.emit(pr["".concat(M.eventType,"_DRAG")],{e:T,data:M.data||V})})}},this.handleMouseUp=function(T){var $=window.document;M.isStartDragging=!1,M.isStopPropagation&&T.stopPropagation(),Promise.resolve().then(function(){var D,P,B;$.removeEventListener("mousemove",M.handleMouseMove,!1),$.removeEventListener("mouseup",M.handleMouseUp,!1);var F=(D=M.model)===null||D===void 0?void 0:D.getData();(P=M.eventCenter)===null||P===void 0||P.emit(pr["".concat(M.eventType,"_MOUSEUP")],{e:T,data:M.data||F}),M.isDragging&&(M.isDragging=!1,M.onDragEnd({event:T}),(B=M.eventCenter)===null||B===void 0||B.emit(pr["".concat(M.eventType,"_DROP")],{e:T,data:M.data||F}))})},this.cancelDrag=function(){var T=window==null?void 0:window.document;T.removeEventListener("mousemove",M.handleMouseMove,!1),T.removeEventListener("mouseup",M.handleMouseUp,!1),M.onDragEnd({event:void 0}),M.isDragging=!1},this.destroy=function(){M.isStartDragging&&M.cancelDrag()},this.onDragStart=o,this.onDragging=i,this.onDragEnd=s,this.step=b,this.isStopPropagation=O,this.eventType=f,this.eventCenter=h,this.model=w,this.data=S}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t})(),LZ=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{x:e-o/2,y:n-r/2,x1:e+o/2,y1:n+r/2}},IZ=function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}},FZ=function(t){var e=t.points,n=Kv(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},BZ=function(t){var e=t.path,n=CM(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},$Z=function(t){if(t.modelType===_o.LINE_EDGE)return IZ(t);if(t.modelType===_o.POLYLINE_EDGE)return FZ(t);if(t.modelType===_o.BEZIER_EDGE)return BZ(t)},UZ=function(t,e,n,o){var r=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(r===0)return!1;var i=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/r,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/r;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0?{x:i,y:a}:!1},T_=function(t,e,n){var o=t.x,r=t.y,i=e.x,a=e.y,s=n.x,l=n.y,f=(l-a)/(s-i),h=a-f*i;return(o>=i&&o<=s||o<=i&&o>=s)&&(r>=a&&r<=l||r<=a&&r>=l)&&Math.abs(r-f*o-h)=e.x?(a.leftX=e.x+f*Math.sin(s+l),a.leftY=e.y-f*Math.cos(s+l),a.rightX=e.x-f*Math.sin(s-l),a.rightY=e.y+f*Math.cos(s-l)):(a.leftX=e.x-f*Math.sin(s+l),a.leftY=e.y+f*Math.cos(s+l),a.rightX=e.x+f*Math.sin(s-l),a.rightY=e.y-f*Math.cos(s-l)):i==="end"&&(n.x>=e.x?(a.leftX=n.x+f*Math.sin(s-l),a.leftY=n.y-f*Math.cos(s-l),a.rightX=n.x-f*Math.sin(s+l),a.rightY=n.y+f*Math.cos(s+l)):(a.leftX=n.x-f*Math.sin(s-l),a.leftY=n.y+f*Math.cos(s-l),a.rightX=n.x+f*Math.sin(s+l),a.rightY=n.y-f*Math.cos(s+l))),a},bg=function(){return bg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yh=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;oo/e.height?ni.HORIZONTAL:ni.VERTICAL},kw=function(t,e,n){var o=WZ(n,e);return o===ni.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},uP=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),r=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+r)/2,y:(o+i)/2,centerX:(n+r)/2,centerY:(o+i)/2,minX:n,minY:o,maxX:r,maxY:i,height:i-o,width:r-n}},N_=function(t,e){t===void 0&&(t=[]);var n=[],o=[];t.forEach(function(h){n.push(h.x),o.push(h.y)});var r=Math.min.apply(Math,yh([],Yu(n),!1)),i=Math.max.apply(Math,yh([],Yu(n),!1)),a=Math.min.apply(Math,yh([],Yu(o),!1)),s=Math.max.apply(Math,yh([],Yu(o),!1)),l=i-r,f=s-a;return e&&(l+=e,f+=e),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:f,width:l}},Pw=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:r},{x:e,y:r}]},_0=function(t,e){var n=t.x,o=t.y;return ne.maxX||oe.maxY},GZ=function(t,e){return et.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},zZ=function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},HZ=function(t,e){return yh(yh([],Yu(GZ(t,e.x)),!1),Yu(zZ(t,e.y)),!1)},DA=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},XZ=function(t,e){var n=-2,o=0;return e.forEach(function(r){r&&(t.x===r.x&&(o+=n),t.y===r.y&&(o+=n))}),o},cP=function(t,e,n,o,r){return DA(t,e)+DA(t,n)+XZ(t,[e,n,o,r])},hI=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&hI(t,e,n,n[o],r+1)},YZ=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Hy=function(t,e,n,o){var r=e.x-t.x,i=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*s),f=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+r*s);return l>=0&&l<=1&&f>=0&&f<=1},dP=function(t,e,n){if(n.width===0&&n.height===0)return!1;var o=Yu(Pw(n),4),r=o[0],i=o[1],a=o[2],s=o[3];return Hy(t,e,r,i)||Hy(t,e,r,s)||Hy(t,e,i,a)||Hy(t,e,a,s)},qZ=function(t,e,n,o){var r=[];return t.forEach(function(i){i!==e&&(i.x===e.x||i.y===e.y)&&!dP(i,e,n)&&!dP(i,e,o)&&r.push(i)}),RA(r)},KZ=function(t,e,n,o,r,i,a){var s=[],l=[e],f={},h={},v={};e.id&&(h[e.id]=0,v[e.id]=cP(e,n,e));var b={};t.forEach(function(w){w.id&&(b[w.id]=w)});for(var E=function(){var w,S=1/0;if(l.forEach(function(T){T.id&&v[T.id]=h[T.id])return;f[T.id]=w.id,h[T.id]=D,v[T.id]=h[T.id]+cP(T,n,e,i,a)}})};l.length;){var O=E();if(typeof O=="object")return O.value}return[e,n]},fP=function(t){return gu(t)},vI=function(t){for(var e=1;e2&&(M=vI(M)),RA(M)},ZZ=function(t){if(t.length===1){var e=Yu(t,1),n=e[0];return[n,n]}else{for(var o=t[0],r=t[1],i=qc(o.x,o.y,r.x,r.y),a=1;ai&&(i=f,o=s,r=l)}return[o,r]}},hP=function(t,e,n){var o=ip(t,n),r=ip(e,n);return o&&r},vP=function(t,e,n){var o=ip(t,n),r=ip(e,n),i=o&&r,a=o||r;return!i&&a},mP=function(t,e,n){for(var o=void 0,r=gu(n),i=Pw(r),a=0;a=1&&o<=126||o>=65376&&o<=65439?e+=1:e+=2}return e},QZ=function(t){var e=t.start,n=t.end,o;if(e.x===n.x&&e.y===n.y)o="";else{var r={start:e,end:n,offset:10,verticalLength:5},i=C_(bg(bg({},r),{type:"start"})),a=C_(bg(bg({},r),{type:"end"}));o="M".concat(i.leftX," ").concat(i.leftY,` L`).concat(i.rightX," ").concat(i.rightY,` L`).concat(a.rightX," ").concat(a.rightY,` L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},yP=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=gu(o),s=gu(r),l=Nw(a,i),f=Nw(s,i),h=kw(l,a,e),v=kw(f,s,n);return{sNext:h,ePre:v}},CM=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=b0(e[0]),o=b0(e[1]),r=b0(e[2]),i=b0(e[3]);return[n,o,r,i]},b0=function(t){var e=Yu(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],o=e[1];return{x:+n,y:+o}},_P=function(t,e){var n=Yu(t,4),o=n[0],r=n[1],i=n[2],a=n[3],s=WJ(o,r,i,a,e);return[s,t[3]]},gI=function(t,e){for(var n=t.x,o=t.y,r=Kv(e),i=Number.MAX_SAFE_INTEGER,a,s=[],l=0;lr?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},ng=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},w0=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tS=function(t,e,n){var o=eS(t,2),r=o[0],i=o[1],a=eS(e,2),s=a[0],l=a[1],f=eS(n,2),h=f[0],v=f[1];return r>s&&rl&&i=0?r:-r},e})(_I),jA=(function(t){NM(e,t);function e(n,o){var r=t.call(this,n,o,1)||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.toString=function(){return"Point"},e})(_I),q1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),rg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},nS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LA=function(t){var e=t.anchors;return e},Lw=function(t,e){for(var n=e.nodes,o,r=n.length-1;r>=0;r--){var i=n[r],a=uJ(t,i);if(a){var s=i.getTargetAnchor(t);if(s){var l={node:i,anchorIndex:s.index,anchor:s.anchor};(!o||lJ(i,o.node,e))&&(o=l)}}}return o},lJ=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},sJ=function(t,e){for(var n=LA(e),o,r=Number.MAX_SAFE_INTEGER,i=0;i=r.minX-n&&l.x<=r.maxX+n&&l.y>=r.minY-n&&l.y<=r.maxY+n&&(o=!0),o},uJ=function(t,e){return ip(t,e,5)},gu=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}},cJ=function(t){var e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.radius;return[{x:n-r/2+a,y:o-i/2+a,r:a},{x:n+r/2-a,y:o-i/2+a,r:a},{x:n-r/2+a,y:o+i/2-a,r:a},{x:n+r/2-a,y:o+i/2-a,r:a}]},EP=function(t,e,n){var o=cJ(n),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var s=qc(t.x,t.y,a.x,a.y);sf.minX&&t.xf.minY&&t.yh.x&&(v=h,b=f);var E={x:t.x,y:t.y};if(v.x===b.x&&e===ni.HORIZONTAL&&(E={x:v.x,y:t.y}),v.y===b.y&&e===ni.VERTICAL&&(E={x:t.x,y:v.y}),v.x!==b.x&&v.y!==b.y){var O=(b.y-v.y)/(b.x-v.x),w=(v.x*b.y-b.x*v.y)/(v.x-b.x);e===ni.HORIZONTAL?E={x:(t.y-w)/O,y:t.y}:e===ni.VERTICAL&&(E={x:t.x,y:O*t.x+w})}var S=T_(E,f,h);if(S){var M=qc(E.x,E.y,t.x,t.y);Mt.x?r=t.x+n/2:e.xt.y?i=t.y+o/2:e.y1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,i.appendChild(l)}):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},AP=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach(function(i){var a=mI(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},Iw=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let x0;const fJ=new Uint8Array(16);function pJ(){if(!x0&&(x0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!x0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return x0(fJ)}const Rl=[];for(let t=0;t<256;++t)Rl.push((t+256).toString(16).slice(1));function hJ(t,e=0){return Rl[t[e+0]]+Rl[t[e+1]]+Rl[t[e+2]]+Rl[t[e+3]]+"-"+Rl[t[e+4]]+Rl[t[e+5]]+"-"+Rl[t[e+6]]+Rl[t[e+7]]+"-"+Rl[t[e+8]]+Rl[t[e+9]]+"-"+Rl[t[e+10]]+Rl[t[e+11]]+Rl[t[e+12]]+Rl[t[e+13]]+Rl[t[e+14]]+Rl[t[e+15]]}const vJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MP={randomUUID:vJ};function mJ(t,e,n){if(MP.randomUUID&&!t)return MP.randomUUID();t=t||{};const o=t.random||(t.rng||pJ)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,hJ(o)}var wh=function(){return mJ()},t_=new Map,wI=function(t){var e=wh();function n(){t();var r=t_.get(e);if(r){var i=window.requestAnimationFrame(n);t_.set(e,i)}}var o=window.requestAnimationFrame(n);return t_.set(e,o),e},Fw=function(t){var e=t_.get(t);e&&(window.cancelAnimationFrame(e),t_.delete(t))},k_=function(){return k_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function EI(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.value,a=t.fontSize,s=a===void 0?12:a,l=t.fill,f=l===void 0?"currentColor":l,h=t.overflowMode,v=h===void 0?"default":h,b=t.textWidth,E=b===void 0?void 0:b,O=t.model,w={x:n,y:r,fill:f,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(ri(pp(t),function(P){var B=gJ(P,2),F=B[0],I=B[1];typeof I!="object"&&(w[F]=I)}),i){var S=String(i).split(/[\r\n]/g),M=S.length;if(v!=="default"){var T=O.BaseType,$=O.modelType;if(T===da.NODE&&$!==_o.TEXT_NODE||T===da.EDGE&&E)return yJ(t)}if(M>1){var D=S.map(function(P,B){var F=s+2,I=(B-(M-1)/2)*F;return $t("tspan",{className:"lf-text-tspan",x:n,y:r+I,children:P})});return $t("text",k_({},w,{children:D}))}return $t("text",k_({},w,{children:i}))}return null}function yJ(t){var e=t.x,n=t.y,o=t.value,r=t.model,i=t.textWidth,a=t.fontSize,s=a===void 0?12:a,l=t.lineHeight,f=t.fontFamily,h=f===void 0?"":f,v=t.wrapPadding,b=v===void 0?"0, 0":v,E=t.overflowMode,O=r.width,w=r.height,S=r.textHeight,M=i||O,T=String(o).split(/[\r\n]/g),$=T.length,D=bI({rows:T,style:{fontSize:"".concat(s,"px"),width:"".concat(M,"px"),fontFamily:h,lineHeight:l,padding:b},rowsLength:$,className:"lf-get-text-height"}),P=w>D?w:D;S&&(P=S);var B=E==="ellipsis";return B&&(P=s+2),$t("g",{children:$t("foreignObject",{width:M,height:P,x:e-M/2,y:n-P/2,style:{overflow:"visible",textAlign:"left"},children:$t("div",{className:"lf-node-text-auto-wrap",style:{minHeight:P,width:M,padding:b},children:$t("div",{className:B?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:B?T.join(""):"",style:k_({},t),children:T.map(function(F){return $t("div",{className:"lf-node-text--auto-wrap-inner",children:F})})})})})})}var FA=function(){return FA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Gg(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return ri(pp(t),function(n){var o=_J(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("line",FA({},e))}var BA=function(){return BA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function qu(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,s=t.radius,l=s===void 0?0:s,f=e-o/2,h=n-r/2,v={};return v["stroke-width"]=a,ri(pp(t),function(b){var E=bJ(b,2),O=E[0],w=E[1];typeof w!="object"&&(v[O]=w)}),i?v.className="lf-basic-shape ".concat(i):v.className="lf-basic-shape",l&&(v.rx=l,v.ry=l),v.x=f,v.y=h,$t("rect",BA({},v))}var $A=function(){return $A=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function P_(t){var e={d:""};return ri(pp(t),function(n){var o=wJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("path",$A({},e))}var UA=function(){return UA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function zg(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.r,a=i===void 0?4:i,s=t.className,l={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(f){var h=EJ(f,2),v=h[0],b=h[1];typeof b!="object"&&(l[v]=b)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",$t("circle",UA({},l))}var VA=function(){return VA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function OJ(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.rx,a=i===void 0?4:i,s=t.ry,l=s===void 0?4:s,f=t.className,h={cx:n,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(v){var b=xJ(v,2),E=b[0],O=b[1];typeof O!="object"&&(h[E]=O)}),f?h.className="lf-basic-shape ".concat(f):h.className="lf-basic-shape",$t("ellipse",VA({},h))}var Bw=function(){return Bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function AJ(t,e){var n=t.map(function(T){return{x:T[0],y:T[1]}}),o=n.length;if(o<3)return"";for(var r=Math.abs(e),i="",a=0;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function TJ(t){var e=t.className,n={points:"",fill:"none"};return ri(pp(t),function(o){var r=MJ(o,2),i=r[0],a=r[1];(i==="style"||typeof a!="object")&&(n[i]=a)}),e&&(n.className="".concat(e)),$t("polyline",WA({},n))}var xI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),R_=function(){return R_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ho;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(Ho||(Ho={}));var kJ=(function(t){xI(e,t);function e(n){var o=t.call(this)||this;o.isShiftPressed=!1,o.bindKeyboardEvents=function(){document.addEventListener("keydown",o.handleKeyDown),document.addEventListener("keyup",o.handleKeyUp)},o.handleKeyDown=function(s){s.key==="Shift"&&(o.isShiftPressed=!0)},o.handleKeyUp=function(s){s.key==="Shift"&&(o.isShiftPressed=!1)},o.updateEdgePointByAnchors=function(){var s=o.nodeModel,l=s.id,f=s.anchors,h=o.graphModel.getNodeEdges(l);ri(h,function(v){if(v.sourceNodeId===l){var b=Sh(f,function(E){return E.id===v.sourceAnchorId});b&&v.updateStartPoint({x:b.x,y:b.y})}else if(v.targetNodeId===l){var b=Sh(f,function(O){return O.id===v.targetAnchorId});b&&v.updateEndPoint({x:b.x,y:b.y})}})},o.triggerResizeEvent=function(s,l,f,h,v,b){o.graphModel.eventCenter.emit(pr.NODE_RESIZE,{preData:s,data:l,deltaX:f,deltaY:h,index:v,model:b})},o.recalcResizeInfo=function(s,l,f,h,v){f===void 0&&(f=1),h===void 0&&(h=!1),v===void 0&&(v=!1);var b=to(l),E=b.deltaX,O=b.deltaY,w=b.width,S=b.height,M=b.PCTResizeInfo;if(M){var T=4,$=0,D=0;switch(s){case Ho.LEFT_TOP:D=(E*-1-O)/T;break;case Ho.RIGHT_TOP:D=(E-O)/T;break;case Ho.RIGHT_BOTTOM:D=(E+O)/T;break;case Ho.LEFT_BOTTOM:D=(E*-1+O)/T;break}D!==0&&($=Math.round(D/M.ResizeBasis.basisHeight*1e5)/1e3),M.ResizePCT.widthPCT=Math.max(Math.min(M.ResizePCT.widthPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit),M.ResizePCT.heightPCT=Math.max(Math.min(M.ResizePCT.heightPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit);var P=Math.round(M.ResizePCT.widthPCT*M.ResizeBasis.basisWidth/100),B=Math.round(M.ResizePCT.heightPCT*M.ResizeBasis.basisHeight/100);switch(s){case Ho.LEFT_TOP:E=w-P,O=S-B;break;case Ho.RIGHT_TOP:E=P-w,O=S-B;break;case Ho.RIGHT_BOTTOM:E=P-w,O=B-S;break;case Ho.LEFT_BOTTOM:E=w-P,O=B-S;break}return b}switch(s){case Ho.LEFT_TOP:b.width=h?w:w-E*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_TOP:b.width=h?w:w+E*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_BOTTOM:b.width=h?w:w+E*f,b.height=v?S:S+O*f;break;case Ho.LEFT_BOTTOM:b.width=h?w:w-E*f,b.height=v?S:S+O*f;break}return b},o.resizeNode=function(s){var l=s.deltaX,f=s.deltaY,h=o.index,v=o.props,b=v.model,E=v.graphModel,O=v.x,w=v.y;OI({x:O,y:w,deltaX:l,deltaY:f,index:h,nodeModel:b,graphModel:E,forceProportional:o.isShiftPressed,cancelCallback:function(){o.dragHandler.cancelDrag()}})},o.onDragStart=function(){o.graphModel.selectNodeById(o.nodeModel.id)},o.onDragging=function(s){var l=s.deltaX,f=s.deltaY,h=o.graphModel.transformModel,v=NJ(h.fixDeltaXY(l,f),2),b=v[0],E=v[1];o.resizeNode({deltaX:b,deltaY:E})},o.onDragEnd=function(){var s=o.nodeModel.x,l=o.nodeModel.y;o.nodeModel.moveTo(s,l),o.updateEdgePointByAnchors()};var r=n.index,i=n.model,a=n.graphModel;return o.index=r,o.nodeModel=i,o.graphModel=a,o.dragHandler=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:a.gridSize}),o.bindKeyboardEvents(),o}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.direction,a=n.model,s=a.getResizeControlStyle(),l=s.width,f=s.height,h=CJ(s,["width","height"]);return $t("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[$t(qu,R_({className:"lf-resize-control-content",x:o,y:r,width:l??7,height:f??7},h)),$t(qu,{className:"lf-resize-control-content",x:o,y:r,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e})(ko),PJ=(function(t){xI(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=gu(o),a=i.minX,s=i.minY,l=i.maxX,f=i.maxY,h=[{index:Ho.LEFT_TOP,direction:"nw",x:a,y:s},{index:Ho.RIGHT_TOP,direction:"ne",x:l,y:s},{index:Ho.RIGHT_BOTTOM,direction:"se",x:l,y:f},{index:Ho.LEFT_BOTTOM,direction:"sw",x:a,y:f}];return tc(h,function(v){return $t(kJ,R_({},v,{model:o,graphModel:r}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getResizeOutlineStyle();return $t(qu,R_({},s,{x:o,y:r,width:i,height:a}))},e.prototype.render=function(){return $t("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e})(ko);function RJ(t,e){var n=t.x,o=t.y,r=e.x,i=e.y,a={x:n+(r-n)/2,y:o+(i-o)/2};return a}function Xy(t,e,n){var o=DJ(n),r=t.x-e.x,i=t.y-e.y,a=r*Math.cos(o)-i*Math.sin(o)+e.x,s=r*Math.sin(o)+i*Math.cos(o)+e.y;return{x:a,y:s}}function DJ(t){return t*Math.PI/180}function jJ(t){return t/Math.PI*180}function LJ(t,e,n,o,r,i,a,s){r===void 0&&(r=!1),i===void 0&&(i=!1);var l={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},f=RJ(l,e),h=Xy(e,f,-o),v=Xy(l,f,-o);if(r){var b=Math.abs(h.x-v.x),E=b-a;f.x>h.x?f.x=f.x+E/2:f.x=f.x-E/2}if(i){var O=Math.abs(h.y-v.y),w=O-s;f.y>h.y?f.y=f.y+w/2:f.y=f.y-w/2}if(r||i){var S=Xy(v,f,o),M=S.x-l.x,T=S.y-l.y;f.x=f.x-M,f.y=f.y-T,v=Xy(l,f,-o),h={x:f.x-(v.x-f.x),y:f.y-(v.y-f.y)}}var $=Math.abs(h.x-v.x),D=Math.abs(h.y-v.y);return r&&($=a),i&&(D=s),{width:$,height:D,center:f}}function IJ(t,e,n,o,r,i,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var f=e.deltaX,h=e.deltaY,v=e.width,b=e.height,E=jJ(n),O={x:o,y:r},w={x:i,y:a},S=Xy(O,w,E),M={x:S.x+f,y:S.y+h},T=LJ(S,M,w,E,s,l,v,b),$=T.width,D=T.height,P=T.center;return e.width=$*t,e.height=D*t,e.deltaX=(P.x-w.x)*2,e.deltaY=(P.y-w.y)*2,e}var FJ=function(t,e,n,o,r,i,a,s,l,f,h){n===void 0&&(n=1),o===void 0&&(o=!1),r===void 0&&(r=!1),i===void 0&&(i=0),h===void 0&&(h=!1);var v=to(e),b=v.deltaX,E=v.deltaY,O=v.width,w=v.height,S=v.PCTResizeInfo;if(S){var M=4,T=0,$=0;switch(t){case Ho.LEFT_TOP:$=(b*-1-E)/M;break;case Ho.RIGHT_TOP:$=(b-E)/M;break;case Ho.RIGHT_BOTTOM:$=(b+E)/M;break;case Ho.LEFT_BOTTOM:$=(b*-1+E)/M;break}$!==0&&(T=Math.round($/S.ResizeBasis.basisHeight*1e5)/1e3),S.ResizePCT.widthPCT=Math.max(Math.min(S.ResizePCT.widthPCT+T,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit),S.ResizePCT.heightPCT=Math.max(Math.min(S.ResizePCT.heightPCT+T,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit);var D=Math.round(S.ResizePCT.widthPCT*S.ResizeBasis.basisWidth/100),P=Math.round(S.ResizePCT.heightPCT*S.ResizeBasis.basisHeight/100);switch(t){case Ho.LEFT_TOP:b=O-D,E=w-P;break;case Ho.RIGHT_TOP:b=D-O,E=w-P;break;case Ho.RIGHT_BOTTOM:b=D-O,E=P-w;break;case Ho.LEFT_BOTTOM:b=O-D,E=P-w;break}return v}if(i%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return IJ(n,v,i,a,s,l,f,o,r);if(h){var B=O/w,F=0,I=O,V=w;switch(t){case Ho.LEFT_TOP:F=Math.abs(b)>Math.abs(E)?-b:-E,B>=1?(I=O+F,V=I/B):(V=w+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=w-V;break;case Ho.RIGHT_TOP:F=Math.abs(b)>Math.abs(E)?b:-E,B>=1?(I=O+F,V=I/B):(V=w-F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=w-V;break;case Ho.RIGHT_BOTTOM:F=Math.abs(b)>Math.abs(E)?b:E,B>=1?(I=O+F,V=I/B):(V=w+F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=V-w;break;case Ho.LEFT_BOTTOM:F=Math.abs(b)>Math.abs(E)?-b:E,B>=1?(I=O-F,V=I/B):(V=w+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=V-w;break}return v}switch(t){case Ho.LEFT_TOP:v.width=o?O:O-b*n,v.height=r?w:w-E*n;break;case Ho.RIGHT_TOP:v.width=o?O:O+b*n,v.height=r?w:w-E*n;break;case Ho.RIGHT_BOTTOM:v.width=o?O:O+b*n,v.height=r?w:w+E*n;break;case Ho.LEFT_BOTTOM:v.width=o?O:O-b*n,v.height=r?w:w+E*n;break}return v},BJ=function(t,e){var n=t.id,o=t.anchors,r=e.getNodeEdges(n);ri(r,function(i){if(i.sourceNodeId===n){var a=Sh(o,function(s){return s.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===n){var a=Sh(o,function(l){return l.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},$J=function(t,e,n,o,r,i,a){a.eventCenter.emit(pr.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:r,model:i})},OI=function(t){var e=t.x,n=t.y,o=t.deltaX,r=t.deltaY,i=t.index,a=t.nodeModel,s=t.graphModel,l=t.cancelCallback,f=t.forceProportional,h=f===void 0?!1:f,v=a.r,b=a.rx,E=a.ry,O=a.width,w=a.height,S=a.PCTResizeInfo,M=a.minWidth,T=a.minHeight,$=a.maxWidth,D=a.maxHeight,P=a.rotate,B=a.x,F=a.y,I=M===$,V=T===D,z={width:v||b||O,height:v||E||w,deltaX:o,deltaY:r,PCTResizeInfo:S},X=v||b&&E?1/2:1,Y=e,W=n,Q=FJ(i,z,X,I,V,P,Y,W,B,F,h);if(Q.width$||Q.heightD){l==null||l();return}(P%(2*Math.PI)==0||S||Y===void 0||W===void 0)&&(Q.deltaX=I?0:Q.deltaX,Q.deltaY=V?0:Q.deltaY);var J=a.getData(),ie=a.resize(Q);J.x===ie.x&&J.y===ie.y||(BJ(a,s),$J(J,ie,o,r,i,a,s))},UJ=100,VJ={x:1,y:0};function WJ(t,e,n,o,r){for(var i=function(E){if(E<0||E>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-E,3)+3*e.x*E*Math.pow(1-E,2)+3*n.x*Math.pow(E,2)*(1-E)+o.x*Math.pow(E,3),y:t.y*Math.pow(1-E,3)+3*e.y*E*Math.pow(1-E,2)+3*n.y*Math.pow(E,2)*(1-E)+o.y*Math.pow(E,3)}},a=0,s=2,l=o.x,f=o.y,h=o;a=0?o:-o}function TP(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function XJ(t){return HJ(VJ,t)}function YJ(t){return t*(180/Math.PI)}var SI={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qJ={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},KJ={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},ZJ={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},D_={colorful:ZJ,dark:KJ,radius:qJ,default:SI},JJ={background:"#23272e"},QJ={background:"#fefeff"},GA={background:"#ffffff"},j_={colorful:QJ,dark:JJ,radius:GA,default:GA},eQ={color:"#66676a",thickness:1},tQ={color:"#dadada",thickness:1},zA={color:"#acacac",thickness:1},L_={colorful:tQ,dark:eQ,radius:zA,default:zA},AI=function(t,e){var n=to(SI);return e&&(n=Yv(n,D_[e])),t&&(n=Yv(n,t)),n},nQ=function(t,e){if(D_[t]){console.warn("theme mode ".concat(t," already exists"));return}D_[t]=e,j_[t]=e.background||GA,L_[t]=e.grid||zA},rQ=function(t){delete D_[t],delete j_[t],delete L_[t]},oQ=function(){var t={colorful:{},dark:{},radius:{},default:{}};Xo(D_,t),Xo(j_,t),Xo(L_,t)},iQ=AI,aQ=1e3,lQ=999,I_=function(){return++aQ},sQ=function(){return--lQ},Da=function(){return Da=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},K1=(function(){function t(e,n){var o;this.BaseType=da.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Ju.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=Wo.DEFAULT,this.modelType=_o.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||wh()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Xo(this,eJ(e));var s=this.graphModel,l=s.overlapMode,f=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||I_()),this.setAnchors(),this.initPoints(),this.formatText(e),f.on("overlap:change",function(h){var v=h.overlapMode;n.updateZIndexByOverlap(v,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return Da(Da({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return Da({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return to(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return to(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),o=this.graphModel.theme.arrow,r=this.isAnimation?n.stroke:e.stroke;return Da(Da(Da({},e),{fill:r,stroke:r}),o)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return to(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,o){var r,i,a=LA(e);if(o){if(r=Sh(a,function(s){return s.id===o}),r)return r;console.warn("未在节点上找到指定的起点锚点".concat(o,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=bP(s,n);(i===void 0||l=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},rS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},CP=(function(t){uQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.BEZIER_EDGE,r.path="",r.initEdgeData(n),r.setAttributes(),r}return e.prototype.initEdgeData=function(n){this.offset=om(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Fv(Fv(Fv({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,o=0;return this.pointsList.forEach(function(r){var i=r.x,a=r.y;n+=i,o+=a}),{x:n/this.pointsList.length,y:o/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Fv(Fv({},n),{pointsList:o})},e.prototype.getControls=function(){var n=this.startPoint,o=this.endPoint,r=yP({start:n,end:o,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return r},e.prototype.getPath=function(n){var o=rS(n,4),r=o[0],i=o[1],a=o[2],s=o[3];return"M ".concat(r.x," ").concat(r.y,` C `).concat(i.x," ").concat(i.y,`, `).concat(a.x," ").concat(a.y,`, `).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),o=n.sNext,r=n.ePre;this.updatePath(o,r)},e.prototype.updatePath=function(n,o){n=to(n),o=to(o);var r={x:this.startPoint.x,y:this.startPoint.y},i={x:this.endPoint.x,y:this.endPoint.y};if(!n||!o){var a=this.getControls();n=a.sNext,o=a.ePre}this.pointsList=[r,n,o,i],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];i.x+=n,i.y+=o,this.updatePath(i,a)},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];a.x+=n,a.y+=o,this.updatePath(i,a)},e.prototype.updateAdjustAnchor=function(n,o){var r;o==="sNext"?this.pointsList[1]=n:o==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode,s=yP({start:o,end:r,sourceNode:i,targetNode:a,offset:this.offset}),l=s.sNext,f=s.ePre;this.pointsList=[o,l,f,r],this.initPoints()},Uu([Ut],e.prototype,"offset",void 0),Uu([Ut],e.prototype,"path",void 0),Uu([Bt],e.prototype,"initPoints",null),Uu([Bt],e.prototype,"updatePoints",null),Uu([Bt],e.prototype,"updateStartPoint",null),Uu([Bt],e.prototype,"updateEndPoint",null),Uu([Bt],e.prototype,"moveStartPoint",null),Uu([Bt],e.prototype,"moveEndPoint",null),Uu([Bt],e.prototype,"updateAdjustAnchor",null),Uu([Bt],e.prototype,"getAdjustStart",null),Uu([Bt],e.prototype,"getAdjustEnd",null),Uu([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(K1),cQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),n_=function(){return n_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},dQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},PP=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=2&&(S[0]={x:n[0].x,y:n[0].y},S[S.length-1]={x:n[n.length-1].x,y:n[n.length-1].y});var $=S.length<2||S.every(function(D,P,B){return P===0?!0:r(B[P-1],B[P])});return $?S:[{x:n[0].x,y:n[0].y},{x:n[n.length-1].x,y:n[n.length-1].y}]},e.prototype.getDefaultOffset=function(){var n=this.getArrowStyle(),o=typeof n.offset=="number"?n.offset:0;return o+5},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return r_(r_(r_({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){var n,o=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!o){var r=this.dbClickPosition,i=r.x,a=r.y;return{x:i,y:a}}var s=Kv(this.points),l=PP(ZZ(s),2),f=l[0],h=l[1];return{x:(f.x+h.x)/2,y:(f.y+h.y)/2}},e.prototype.getAfterAnchor=function(n,o,r){var i,a;return r.forEach(function(s){var l;n===ni.HORIZONTAL?l=Math.abs(o.y-s.y):n===ni.VERTICAL&&(l=Math.abs(o.x-s.x)),(!a||a>l)&&(a=l,i=s)}),i},e.prototype.getCrossPoint=function(n,o,r){var i;return n===ni.HORIZONTAL?i={x:r.x,y:o.y}:n===ni.VERTICAL&&(i={x:o.x,y:r.y}),i},e.prototype.removeCrossPoints=function(n,o,r){var i=r.map(function(M){return M});if(n===1){var a=i[n],s=i[o],l=i[n-1],f=hP(l,a,this.sourceNode);if(f){var h=vP(a,s,this.sourceNode);if(h){var v=mP(a,s,this.sourceNode);v&&(i[n]=v,i.splice(n-1,1),n--,o--)}}else{var b=this.sourceNode.anchors;b.forEach(function(M){if(M.x===l.x&&M.x===a.x||M.y===l.y&&M.y===a.y){var T=qc(M.x,M.y,a.x,a.y),$=qc(l.x,l.y,a.x,a.y);T<$&&(i[n-1]=M)}})}}if(o===r.length-2){var E=i[n],O=i[o],w=i[o+1],S=hP(O,w,this.targetNode);if(S){var h=vP(E,O,this.targetNode);if(h){var v=mP(E,O,this.targetNode);v&&(i[o]=v,i.splice(o+1,1))}}else{var b=this.targetNode.anchors;b.forEach(function(T){if(T.x===w.x&&T.x===O.x||T.y===w.y&&T.y===O.y){var $=qc(T.x,T.y,O.x,O.y),D=qc(w.x,w.y,O.x,O.y);$0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=pP({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=this.orthogonalizePath(n),this.points=this.pointsList.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o,this.updatePoints()},e.prototype.updatePointsList=function(n,o){this.pointsList.forEach(function(a){a.x+=n,a.y+=o});var r=this.pointsList[0];this.startPoint=Object.assign({},r);var i=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},i),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,s=n.startIndex,l=n.endIndex,f=n.direction,h=this.pointsList,v=h;return f===ni.HORIZONTAL?(h[s]={x:i.x,y:i.y+o.y},h[l]={x:a.x,y:a.y+o.y},v=this.pointsList.map(function(b){return b})):f===ni.VERTICAL&&(h[s]={x:i.x+o.x,y:i.y},h[l]={x:a.x+o.x,y:a.y},v=this.pointsList.map(function(b){return b})),this.updatePointsAfterDrag(v),this.draggingPointList=v,!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[s]),end:Xo({},h[l]),startIndex:s,endIndex:l,direction:f}},e.prototype.dragAppend=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,s=n.startIndex,l=n.endIndex,f=n.direction,h=this.pointsList;if(f===ni.HORIZONTAL){h[s]={x:i.x,y:i.y+o.y},h[l]={x:a.x,y:a.y+o.y};var v=this.pointsList.map(function(S){return S});if(s!==0&&l!==this.pointsList.length-1&&(v=this.removeCrossPoints(s,l,v)),s===0){var b={x:i.x,y:i.y+o.y},E=ip(b,this.sourceNode);if(!E){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(l===this.pointsList.length-1){var w={x:a.x,y:a.y+o.y},E=ip(w,this.targetNode);if(!E){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",w,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}else if(f===ni.VERTICAL){h[s]={x:i.x+o.x,y:i.y},h[l]={x:a.x+o.x,y:a.y};var v=this.pointsList.map(function(M){return M});if(s!==0&&l!==this.pointsList.length-1&&(v=this.removeCrossPoints(s,l,v)),s===0){var b={x:i.x+o.x,y:i.y},E=ip(b,this.sourceNode);if(!E){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(l===this.pointsList.length-1){var w={x:a.x+o.x,y:a.y},E=ip(w,this.targetNode);if(!E){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",w,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}return!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[s]),end:Xo({},h[l]),startIndex:s,endIndex:l,direction:f}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=vI(Kv(this.points));this.pointsList=n.map(function(i){return i}),this.draggingPointList=[];var o=n[0];this.startPoint=Xo({},o);var r=n[n.length-1];this.endPoint=Xo({},r)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var o=this.updateCrossPoints(n);this.points=o.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode;this.pointsList=this.orthogonalizePath(pP({x:o.x,y:o.y},{x:r.x,y:r.y},i,a,this.offset||0)),this.initPoints()},kl([Ut],e.prototype,"offset",void 0),kl([Ut],e.prototype,"dbClickPosition",void 0),kl([Bt],e.prototype,"initPoints",null),kl([Bt],e.prototype,"updatePoints",null),kl([Bt],e.prototype,"updateStartPoint",null),kl([Bt],e.prototype,"moveStartPoint",null),kl([Bt],e.prototype,"updateEndPoint",null),kl([Bt],e.prototype,"moveEndPoint",null),kl([Bt],e.prototype,"updatePointsList",null),kl([Bt],e.prototype,"dragAppendStart",null),kl([Bt],e.prototype,"dragAppendSimple",null),kl([Bt],e.prototype,"dragAppend",null),kl([Bt],e.prototype,"dragAppendEnd",null),kl([Bt],e.prototype,"updatePointsAfterDrag",null),kl([Bt],e.prototype,"getAdjustStart",null),kl([Bt],e.prototype,"getAdjustEnd",null),kl([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(K1),il=function(){return il=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},RP=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lh=(function(){function t(e,n){var o;this.BaseType=da.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Ju.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=Wo.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=_o.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,o=n.x,r=o===void 0?0:o,i=n.y,a=i===void 0?0:i;this.transform=new Dw(-r,-a).rotate(e).translate(r,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||wh()}this.formatText(e),Xo(this,dJ(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||I_()),l.on("overlap:change",function(f){var h=f.overlapMode;n.updateZIndexByOverlap(h,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,o,r,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,s=i.nodeTextEdit,l=e.x,f=e.y,h=e.text,v={value:"",x:l,y:f,draggable:a,editable:s};h&&(typeof h=="string"?v.value=h:(v=il(il({},v),{x:(n=h.x)!==null&&n!==void 0?n:l,y:(o=h.y)!==null&&o!==void 0?o:f,value:(r=h.value)!==null&&r!==void 0?r:""}),Xv(h.draggable)||(v.draggable=h.draggable),Xv(h.editable)||(v.editable=h.editable))),e.text=v},t.prototype.resize=function(e){var n=e.width,o=e.height,r=e.deltaX,i=e.deltaY,a=this.isAllowResizeNode(r,i,n,o);return a?(this.move(r/2,i/2),this.width=n,this.height=o,this.setProperties({width:n,height:o}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,o=e.y,r=e.value,i=this.properties;Ug(i)&&(i=Hc(i)),ws(i.width)&&(i.width=this.width),ws(i.height)&&(i.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),[vl.INCREASE,vl.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),r&&(a.text={x:n,y:o,value:r}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return Hc(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return il(il({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,o=n===void 0?{}:n;return il(il({},to(e)),to(o))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return to(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return to(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return to(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return to(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return to(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return to(e)},t.prototype.isAllowConnectedAsSource=function(e,n,o,r){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l0?n.map(function(a,s){return a.length?(a=a,{id:"".concat(o,"_").concat(s),x:r+a[0],y:i+a[1]}):(a=a,il(il({},a),{x:r+a.x,y:i+a.y,id:a.id||"".concat(o,"_").concat(s)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return sJ(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,o=n.x,r=n.y,i=n.rotate;return e.forEach(function(a){var s=a.x,l=a.y,f=hQ(new ib([s,l,1]).translate(-o,-r).rotate(i).translate(o,r)[0],2),h=f[0],v=f[1];a.x=h,a.y=v}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!ws(e))for(var n=0;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},$w=(function(t){vQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.CIRCLE_NODE,r.r=50,r.initNodeData(n),r.setAttributes(),r}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.circle,r=this.properties.style,i=r===void 0?{}:r;return o_(o_(o_({},n),to(o)),to(i))},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.r;return[{x:o,y:r-i,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+i,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.deltaX,i=n.deltaY;return this.move(r/2,i/2),this.r=o,this.setProperties({r:o}),this.getData()},oS([Ut],e.prototype,"r",void 0),oS([Ai],e.prototype,"width",null),oS([Ai],e.prototype,"height",null),e})(Lh),mQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i_=function(){return i_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},O0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},HA=(function(t){mQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.DIAMOND_NODE,r.rx=30,r.ry=50,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.diamond,r=this.properties.style,i=r===void 0?{}:r;return i_(i_(i_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[[o,r-a],[o+i,r],[o,r+a],[o-i,r]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return tc(this.points,function(n){var o=O0(n,2),r=o[0],i=o[1];return{x:r,y:i}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,1),a=i[0];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,2),a=i[1];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return tc(this.points,function(o,r){var i=O0(o,2),a=i[0],s=i[1];return{x:a,y:s,id:"".concat(n.id,"_").concat(r)}})},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},og([Ut],e.prototype,"rx",void 0),og([Ut],e.prototype,"ry",void 0),og([Ai],e.prototype,"points",null),og([Ai],e.prototype,"pointsPosition",null),og([Ai],e.prototype,"width",null),og([Ai],e.prototype,"height",null),e})(Lh),gQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),a_=function(){return a_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},XA=(function(t){gQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.ELLIPSE_NODE,r.rx=30,r.ry=45,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.ellipse,r=this.properties.style,i=r===void 0?{}:r;return a_(a_(a_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[{x:o,y:r-a,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},S0([Ut],e.prototype,"rx",void 0),S0([Ut],e.prototype,"ry",void 0),S0([Ai],e.prototype,"width",null),S0([Ai],e.prototype,"height",null),e})(Lh),yQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l_=function(){return l_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},M0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Uw=(function(t){yQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.POLYGON_NODE,r.points=[[50,0],[100,50],[50,100],[0,50]],r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.points,r=n.width,i=n.height,a=o||this.points;this.points=rJ(a,r,i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.polygon,r=this.properties.style,i=r===void 0?{}:r;return l_(l_(l_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return this.points.map(function(s){return{x:s[0]+o-i/2,y:s[1]+r-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,1),a=i[0];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,2),a=i[1];ao&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=this,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points;return l.map(function(f,h){var v=M0(f,2),b=v[0],E=v[1];return{x:r+b-a/2,y:i+E-s/2,id:"".concat(n.id,"_").concat(h)}})},e.prototype.resize=function(n){var o=this,r=n.width,i=n.height,a=n.deltaX,s=n.deltaY;this.move(a/2,s/2);var l=tc(this.points,function(f){var h=M0(f,2),v=h[0],b=h[1];return[v*r/o.width,b*i/o.height]});return this.points=l,this.properties.points=l,this.getData()},A0([Ut],e.prototype,"points",void 0),A0([Ai],e.prototype,"pointsPosition",null),A0([Ai],e.prototype,"width",null),A0([Ai],e.prototype,"height",null),e})(Lh),_Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s_=function(){return s_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Hg=(function(t){_Q(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.RECT_NODE,r.radius=0,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height,i=n.radius,a=this.getNodeStyle().radius;ws(o)||(this.width=o),ws(r)||(this.height=r),ws(i)||(this.radius=i),ws(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.rect,r=this.properties.style,i=r===void 0?{}:r;return s_(s_(s_({},n),to(o)),to(i))},bQ([Ut],e.prototype,"radius",void 0),e})(Lh),wQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u_=function(){return u_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},EQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},xQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},SQ={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},T0=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],AQ=(function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=Ju.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Ju.TEXT,this.edgeTextMode=Ju.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Xo(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);Xo(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,o=e.textDraggable,r=e.textMode,i=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(n===!1&&Xo(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=Vv(SQ,T0);this.stagedConfig=Vv(this,T0),Xo(s,l)}Xv(i)||Xo(s,{nodeTextEdit:i,edgeTextEdit:i}),Xv(o)||Xo(s,{nodeTextDraggable:o,edgeTextDraggable:o}),r&&Xo(s,{nodeTextMode:r,edgeTextMode:r}),mw(a)&&Xo(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var f=Vv(e,T0);return Xo(s,f)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return Vv(this,T0)},Jo([Ut],t.prototype,"isSilentMode",void 0),Jo([Ut],t.prototype,"stopZoomGraph",void 0),Jo([Ut],t.prototype,"stopMoveGraph",void 0),Jo([Ut],t.prototype,"stopScrollGraph",void 0),Jo([Ut],t.prototype,"snapGrid",void 0),Jo([Ut],t.prototype,"textMode",void 0),Jo([Ut],t.prototype,"textEdit",void 0),Jo([Ut],t.prototype,"textDraggable",void 0),Jo([Ut],t.prototype,"nodeTextEdit",void 0),Jo([Ut],t.prototype,"nodeTextDraggable",void 0),Jo([Ut],t.prototype,"nodeTextMultiple",void 0),Jo([Ut],t.prototype,"nodeTextVertical",void 0),Jo([Ut],t.prototype,"nodeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextEdit",void 0),Jo([Ut],t.prototype,"edgeTextDraggable",void 0),Jo([Ut],t.prototype,"edgeTextMultiple",void 0),Jo([Ut],t.prototype,"edgeTextVertical",void 0),Jo([Ut],t.prototype,"hideAnchors",void 0),Jo([Ut],t.prototype,"allowRotate",void 0),Jo([Ut],t.prototype,"allowResize",void 0),Jo([Ut],t.prototype,"hoverOutline",void 0),Jo([Ut],t.prototype,"nodeSelectedOutline",void 0),Jo([Ut],t.prototype,"adjustNodePosition",void 0),Jo([Ut],t.prototype,"autoExpand",void 0),Jo([Ut],t.prototype,"adjustEdge",void 0),Jo([Ut],t.prototype,"adjustEdgeMiddle",void 0),Jo([Ut],t.prototype,"adjustEdgeStartAndEnd",void 0),Jo([Ut],t.prototype,"adjustEdgeStart",void 0),Jo([Ut],t.prototype,"adjustEdgeEnd",void 0),Jo([Ut],t.prototype,"edgeSelectedOutline",void 0),Jo([Bt],t.prototype,"updateEditConfig",null),Jo([Bt],t.prototype,"updateTextMode",null),t})(),MQ="*",TQ=(function(){function t(){this._events={}}return t.prototype.on=function(e,n,o){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r._events[i]||(r._events[i]=[]),r._events[i].push({callback:n,once:!!o})})},t.prototype.once=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){r=r.trim(),o.on(r,n,!0)})},t.prototype.emit=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){var i=o._events[r]||[],a=o._events[MQ]||[],s=function(l){for(var f=l.length,h=0;h=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},kQ=(function(t){CQ(e,t);function e(n){var o=t.call(this)||this;o.stepScrollX=0,o.stepScrollY=0,o.onDragging=function(s){var l=s.deltaX,f=s.deltaY;o.setState({isDragging:!0});var h=o.props.graphModel,v=h.transformModel,b=h.editConfigModel;b.stopMoveGraph!==!0&&v.translate(l,f)},o.onDragEnd=function(){o.setState({isDragging:!1})},o.zoomHandler=function(s){var l=o.props,f=l.graphModel,h=f.editConfigModel,v=f.transformModel,b=f.gridSize,E=l.graphModel,O=s.deltaX,w=s.deltaY,S=h.stopScrollGraph,M=h.stopZoomGraph;if(!S&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),o.stepScrollX+=O,o.stepScrollY+=w,Math.abs(o.stepScrollX)>=b){var T=o.stepScrollX%b,$=o.stepScrollX-T;v.translate(-$*v.SCALE_X,0),o.stepScrollX=T}if(Math.abs(o.stepScrollY)>=b){var D=o.stepScrollY%b,P=o.stepScrollY-D;v.translate(0,-P*v.SCALE_Y),o.stepScrollY=D}return}if(!M){s.preventDefault();var B=E.getPointByClient({x:s.clientX,y:s.clientY}),F=B.canvasOverlayPosition,I=F.x,V=F.y;v.zoom(s.deltaY<0,[I,V])}},o.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var f=o.props.graphModel,h=f.selectElements;if(h.size>0&&f.clearSelectElements(),o.state.isDragging)return;f.eventCenter.emit(pr.BLANK_CLICK,{e:s})}},o.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var f=o.props.graphModel,h=f.getPointByClient({x:s.clientX,y:s.clientY});f.eventCenter.emit(pr.BLANK_CONTEXTMENU,{e:s,position:h})}},o.mouseDownHandler=function(s){var l=o.props.graphModel,f=l.eventCenter,h=l.editConfigModel,v=l.transformModel.SCALE_X,b=l.gridSize,E=h.adjustEdge,O=h.adjustNodePosition,w=h.stopMoveGraph,S=s.target,M=!E&&!O;(S.getAttribute("name")==="canvas-overlay"||M)&&(w!==!0?(o.stepDrag.setStep(b*v),o.stepDrag.handleMouseDown(s)):f.emit(pr.BLANK_MOUSEDOWN,{e:s}),o.clickHandler(s))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ac({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),o.state={isDragging:!1},o}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props,i=r.children,a=r.dnd,s=this.state.isDragging;return $t("svg",qA({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:$t("g",{transform:o,children:i})}))},e=NQ([xs],e),e})(ko),MI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),B_=function(){return B_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},RQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LP=(function(t){MI(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,s=i.bezierModel,l=i.type,f=a.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,h=f.x,v=f.y;s.updateAdjustAnchor({x:h,y:v},l),a.eventCenter.emit(pr.EDGE_ADJUST,{data:s.getData()})},n.onDragEnd=function(){var o=n.props.bezierModel;o.isDragging=!1},n.dragHandler=new ac({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,o=this.props.position,r=o.x,i=o.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return $t(zg,B_({className:"lf-bezier-adjust-anchor",x:r,y:i},s,{onMouseDown:function(l){n.dragHandler.handleMouseDown(l)}}))},e})(ko),DQ=(function(t){MI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,o){var r=n.path,i=n.id,a=CM(r),s=RQ(a,4),l=s[0],f=s[1],h=s[2],v=s[3],b=n.getEdgeStyle().adjustLine,E=[];return E.push($t(Gg,B_({x1:l.x,y1:l.y,x2:f.x,y2:f.y},b))),E.push($t(LP,{position:f,bezierModel:n,graphModel:o,type:"sNext"},"".concat(i,"_ePre"))),E.push($t(Gg,B_({x1:v.x,y1:v.y,x2:h.x,y2:h.y},b))),E.push($t(LP,{position:h,bezierModel:n,graphModel:o,type:"ePre"},"".concat(i,"_sNext"))),E},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,o=n.edges,r=[],i=0;i=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},IQ=(function(t){jQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return $t("div",{className:"lf-background",children:$t("div",{style:lp(n)?n:{},className:"lf-background-area"})})},e=LQ([xs],e),e})(ko),FQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),BQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Sg=(function(t){FQ(e,t);function e(n){var o=t.call(this,n)||this;return o.id=wh(),o.gridOptions=o.props.graphModel.grid,o}return e.prototype.renderDot=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,s=o??{},l=s.color,f=s.thickness,h=f===void 0?2:f,v=Math.min(Math.max(2,h),i/4),b=a?1:0;return $t("g",{fill:l,opacity:b,children:[$t("circle",{cx:0,cy:0,r:v/2}),$t("circle",{cx:0,cy:i,r:v/2}),$t("circle",{cx:i,cy:0,r:v/2}),$t("circle",{cx:i,cy:i,r:v/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,s=o??{},l=s.color,f=s.thickness,h=f===void 0?1:f,v=Math.min(Math.max(1,h),i/2),b="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),E=a?1:0;return $t("path",{d:b,stroke:l,strokeWidth:v/2,opacity:E,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,o=n.transformModel,r=n.grid;this.gridOptions=r;var i=this.gridOptions,a=i.type,s=i.size,l=s===void 0?1:s,f=o.SCALE_X,h=o.SKEW_Y,v=o.SKEW_X,b=o.SCALE_Y,E=o.TRANSLATE_X,O=o.TRANSLATE_Y,w=[f,h,v,b,E,O].join(","),S="matrix(".concat(w,")");return $t("div",{className:"lf-grid",children:$t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[$t("defs",{children:$t("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:S,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),$t("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=BQ([xs],e),e})(ko);(function(t){t.defaultProps={size:DZ,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var o=to(t.defaultProps);return typeof n=="number"?Xo(o,{size:n}):typeof n=="boolean"?Xo(o,{visible:n}):Xo(o,n)}t.getGridOptions=e})(Sg||(Sg={}));var $Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),UQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},VQ=(function(t){$Q(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props.children;return $t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:$t("g",{transform:o,children:r})})},e=UQ([xs],e),e})(ko),WQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),dh=function(){return dh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},zQ=(function(t){WQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,o=n.nodes,r=n.editConfigModel,i=r.hoverOutline,a=r.nodeSelectedOutline,s=[];return o.forEach(function(l){if(l.isHovered||l.isSelected){var f=l.isHovered,h=l.isSelected,v=l.x,b=l.y,E=l.width,O=l.height;if(a&&h||i&&f){var w=l.getOutlineStyle()||{},S={};if(Object.keys(w).forEach(function(T){T!=="hover"&&(S[T]=w[T])}),f){var M=w.hover;S=dh(dh({},S),M)}s.push($t(qu,dh({transform:l.transform,className:"lf-outline-node",x:v,y:b,width:E+10,height:O+10},S)))}}}),s},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,o=n.edges,r=n.editConfigModel,i=r.edgeSelectedOutline,a=r.hoverOutline,s=[],l=0;l=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},YQ=(function(t){HQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,o=n??{},r=o.position,i=o.isShowHorizontal,a=o.isShowVertical,s=n==null?void 0:n.getStyle(),l=r??{},f=l.x,h=f===void 0?0:f,v=l.y,b=v===void 0?0:v,E=fh(fh({x1:-1e5,y1:b,x2:1e5,y2:b},s),{stroke:i?s==null?void 0:s.stroke:"none"}),O=fh(fh({x1:h,y1:-1e5,x2:h,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return $t("g",{className:"lf-snapline",children:[$t(Gg,fh({},E)),$t(Gg,fh({},O))]})},e=XQ([xs],e),e})(ko),qQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ZQ=(function(t){qQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,o=n.tool,r=n.graphModel,i=r.textEditElement,a=o.getTools(),s=a.map(function(l){return Lr(l,{textEditElement:i,graphModel:r,lf:o.instance})});return o.components=s,s},e.prototype.triggerToolRender=function(){var n=this.props,o=n.tool,r=n.graphModel,i=document.querySelector("#ToolOverlay_".concat(r.flowId)),a=o.getInstance();a.components.forEach(function(s){return s(a,i)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return $t("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=KQ([xs],e),e})(ko),$c=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ig=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},JQ={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},QQ=(function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var o=n.stopMoveGraph,r=o===void 0?!1:o;this.updateTranslateLimits(r)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=ig(e,2),o=n[0],r=n[1];return[(o-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=ig(e,2),o=n[0],r=n[1];return[o*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,o){var r=ig(e,2),i=r[0],a=r[1];return[i+n/this.SCALE_X,a+o/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var o=this.SCALE_X,r=this.SCALE_Y;return typeof e=="number"?(o=e,r=e):e?(o+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(o-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),othis.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(o-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*n[1]),this.SCALE_X=o,this.SCALE_Y=r,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(pr.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,o,r){var i=ig(this.CanvasPointToHtmlPoint([e,n]),2),a=i[0],s=i[1],l=ig([o/2-a,r/2-s],2),f=l[0],h=l[1];this.TRANSLATE_X+=f,this.TRANSLATE_Y+=h,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=ig(Array.isArray(e)&&e.length===4?e:JQ[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},$c([Ut],t.prototype,"SCALE_X",void 0),$c([Ut],t.prototype,"SKEW_Y",void 0),$c([Ut],t.prototype,"SKEW_X",void 0),$c([Ut],t.prototype,"SCALE_Y",void 0),$c([Ut],t.prototype,"TRANSLATE_X",void 0),$c([Ut],t.prototype,"TRANSLATE_Y",void 0),$c([Ut],t.prototype,"ZOOM_SIZE",void 0),$c([Bt],t.prototype,"zoom",null),$c([Bt],t.prototype,"resetZoom",null),$c([Bt],t.prototype,"translate",null),$c([Bt],t.prototype,"focusOn",null),t})(),eee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),iS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tee=(function(t){eee(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.parentTransform=o.parentTransform,r}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,o=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale();n*=r.scaleX,o*=r.scaleY}else n*=this.parentTransform.SCALE_X,o*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:o}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,o=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale(),i=r.scaleX,a=r.scaleY;n=i*n,o=a*o}return{translateX:n,translateY:o}},e.prototype.HtmlPointToCanvasPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[(r-h)/s,(i-v)/l]},e.prototype.CanvasPointToHtmlPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[r*s+h,i*l+v]},e.prototype.moveCanvasPointByHtml=function(n,o,r){var i=iS(n,2),a=i[0],s=i[1],l=this.getCumulativeScale(),f=l.scaleX,h=l.scaleY;return[a+o/f,s+r/h]},e.prototype.fixDeltaXY=function(n,o){var r=this.getCumulativeScale(),i=r.scaleX,a=r.scaleY;return[n/i,o/a]},e})(QQ),Kl=function(){return Kl=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},nee=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ol=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},hu=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},oee=(function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Bv({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var o=e.x,r=e.y,i=!1,a=!1,s=0;s=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},see=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fee=(function(t){cee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(o){var r=o.event,i=n.props,a=i.anchorData,s=i.nodeModel,l=i.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(pr.ANCHOR_DRAGSTART,{data:a,e:r,nodeModel:s}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,f=a.transformModel,h=a.eventCenter,v=a.width,b=a.height,E=a.editConfigModel,O=E.autoExpand,w=E.stopMoveGraph;if(r){var S=r.clientX,M=r.clientY,T=a.getPointByClient({x:S,y:M}),$=T.domOverlayPosition,D=$.x,P=$.y,B=T.canvasOverlayPosition,F=B.x,I=B.y;n.t&&Fw(n.t);var V=[],z=10;D<10?V=[z,0]:D+10>v?V=[-z,0]:P<10?V=[0,z]:P+10>b&&(V=[0,-z]),n.setState({endX:F,endY:I,dragging:!0}),n.moveAnchorEnd(F,I),V.length>0&&!w&&O&&(n.t=wI(function(){var X=dee(V,2),Y=X[0],W=X[1];f.translate(Y,W);var Q=n.state,J=Q.endX,ie=Q.endY;n.setState({endX:J-Y,endY:ie-W}),n.moveAnchorEnd(J-Y,ie-W)})),h.emit(pr.ANCHOR_DRAG,{data:l,e:r,nodeModel:s})}},n.onDragEnd=function(o){var r=o.event;n.t&&Fw(n.t);var i=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,s=a.graphModel,l=a.nodeModel,f=a.anchorData;s.eventCenter.emit(pr.ANCHOR_DRAGEND,{data:f,e:r,nodeModel:l,edgeModel:i??void 0})},n.checkEnd=function(o){var r,i=n.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,f=l.x,h=l.y,v=l.id,b=n.state,E=b.endX,O=b.endY,w=b.dragging,S=Lw({x:E,y:O},a);if(n.preTargetNode&&n.preTargetNode.state!==Wo.DEFAULT&&n.preTargetNode.setElementState(Wo.DEFAULT),!!w&&S&&S.node){var M=S.node,T=S.anchor.id,$="".concat(s.id,"_").concat(M.id,"_").concat(T,"_").concat(v),D=n.sourceRuleResults.get($)||{},P=D.isAllPass,B=D.msg,F=n.targetRuleResults.get($)||{},I=F.isAllPass,V=F.msg;if(P&&I){M.setElementState(Wo.DEFAULT);var z=a.getNodeModelById(S.node.id),X=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,s.getData(),z==null?void 0:z.getData()),Y=a.addEdge(Bd(Bd({},X),{sourceNodeId:s.id,sourceAnchorId:v,startPoint:{x:f,y:h},targetNodeId:S.node.id,targetAnchorId:S.anchor.id,endPoint:{x:S.anchor.x,y:S.anchor.y}})),W=n.props.anchorData;return a.eventCenter.emit(pr.ANCHOR_DROP,{data:W,e:o,nodeModel:s,edgeModel:Y}),Y}var Q=M.getData();return a.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Q,msg:V||B||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new ac({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,o=n.anchorData,r=n.style,i=n.node,a=i.getAnchorShape(o);if(a)return a;var s=o.x,l=o.y,f=Bd(Bd({},r),r==null?void 0:r.hover);return $t("g",{children:[$t(zg,Bd({className:"lf-node-anchor-hover"},f,{x:s,y:l})),$t(zg,Bd({className:"lf-node-anchor"},r,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,o=n.graphModel,r=o.getAnchorIncomingEdge,i=o.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:r(a),outgoingEdgeList:i(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,o){var r,i,a=this.props,s=a.graphModel,l=a.nodeModel,f=a.anchorData,h=Lw({x:n,y:o},s);if(h){var v=h.node,b=h.anchor.id;if(this.preTargetNode&&this.preTargetNode!==h.node&&this.preTargetNode.setElementState(Wo.DEFAULT),f.id===b)return;this.preTargetNode=v;var E="".concat(l.id,"_").concat(v.id,"_").concat(b,"_").concat(f.id);if(!this.targetRuleResults.has(E)){var O=h.anchor,w=l.isAllowConnectedAsSource(v,f,O),S=v.isAllowConnectedAsTarget(l,f,O);this.sourceRuleResults.set(E,Iw(w)),this.targetRuleResults.set(E,Iw(S))}var M=((r=this.sourceRuleResults.get(E))!==null&&r!==void 0?r:{}).isAllPass,T=((i=this.targetRuleResults.get(E))!==null&&i!==void 0?i:{}).isAllPass;M&&T?v.setElementState(Wo.ALLOW_CONNECT):v.setElementState(Wo.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Wo.DEFAULT&&this.preTargetNode.setElementState(Wo.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,o=n.startX,r=n.startY,i=n.endX,a=n.endY,s=qc(o,r,i,a);return s>10},e.prototype.render=function(){var n=this,o=this.state,r=o.startX,i=o.startY,a=o.endX,s=o.endY,l=this.props,f=l.anchorData,h=l.edgeStyle,v=l.nodeModel,b=l.graphModel,E=f.edgeAddable;return $t("g",{className:"lf-anchor",children:[$t("g",{onClick:function(O){O.stopPropagation(),b.eventCenter.emit(pr.ANCHOR_CLICK,{data:f,e:O,nodeModel:v})},onMouseDown:function(O){b.eventCenter.emit(pr.ANCHOR_MOUSEDOWN,{data:f,e:O,nodeModel:v}),E!==!1&&n.dragHandler.handleMouseDown(O)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Bd({sourcePoint:{x:r,y:i},targetPoint:{x:a,y:s}},h)):$t(Gg,Bd({x1:r,y1:i,x2:a,y2:s},h,{"pointer-events":"none"})))]})},e})(ko),pee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KA=function(){return KA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TI=(function(t){gee(e,t);function e(n){var o=t.call(this)||this;o.mouseDownHandler=function(i){var a=o.props,s=a.draggable,l=a.model,f=a.graphModel,h=f.editConfigModel.nodeTextDraggable;(s??h)&&(i.stopPropagation(),o.stepperDrag.model=l,o.stepperDrag.handleMouseDown(i))},o.onDragging=function(i){var a=i.deltaX,s=i.deltaY,l=o.props,f=l.model,h=l.graphModel.transformModel;if(a||s){var v=yee(h.fixDeltaXY(a,s),2),b=v[0],E=v[1];f.moveText(b,E)}},o.dbClickHandler=function(){var i=o.props,a=i.editable,s=i.graphModel.eventCenter,l=i.model;a&&l.setElementState(Wo.TEXT_EDIT),s.emit(pr.TEXT_DBCLICK,{data:l.text,model:l})};var r=n.draggable;return o.stepperDrag=new ac({onDragging:o.onDragging,step:1,eventType:"TEXT",isStopPropagation:r}),o}return e.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=o.text,s=a.value,l=a.x,f=a.y,h=a.editable,v=a.draggable,b={x:l,y:f,className:"",value:s},E=o.getTextStyle(),O=i.nodeTextDraggable||v;return $t(EI,JA({},b,E,{className:ZA({"lf-element-text":h,"lf-text-draggable":!h&&O,"lf-text-disabled":!h&&!O}),model:o}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return $t("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e})(ko),_ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Wc=function(){return Wc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},bee=(function(t){_ee(e,t);function e(n){var o=t.call(this,n)||this;return o.setHoverOn=function(){o.setState({isHovered:!0})},o.setHoverOff=function(){o.setState({isHovered:!1})},o.state={isHovered:!1},o}return e.prototype.getBackground=function(){var n=this.state.isHovered,o=this.props.model,r=o.text,i=o.getTextStyle(),a=i.background||{};if(n&&i.hover&&i.hover.background&&(a=Wc(Wc({},a),i.hover.background)),r!=null&&r.value&&(a==null?void 0:a.fill)!=="transparent"){var s=i.fontSize,l=i.textWidth,f=i.lineHeight,h=i.overflowMode,v=a.wrapPadding,b=r==null?void 0:r.value.split(/[\r\n]/g),E=b.length,O=r.x,w=r.y,S={};if(h==="autoWrap"&&l){var M=bI({rows:b,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:f,padding:v},rowsLength:E,className:"lf-get-text-height"});S=Wc(Wc({},a),{x:O,y:w,width:l,height:M})}else{var T=nJ({rows:b,rowsLength:E,fontSize:s}),$=T.width,D=T.height;if(h==="ellipsis"&&($=l,D=s+2),typeof a.wrapPadding=="string"){var P=a.wrapPadding.split(",").filter(function(Pe){return Pe.trim()}).map(function(Pe){return parseFloat(Pe.trim())});if(P.length>0&&P.length<=4){if(P.length===1){var B=C0(P,1),F=B[0];P=[F,F,F,F]}else if(P.length===2){var I=C0(P,2),V=I[0],z=I[1];P=[V,z,V,z]}else if(P.length===3){var X=C0(P,3),Y=X[0],z=X[1],W=X[2];P=[Y,z,W,z]}var Q=C0(P,4),J=Q[0],ie=Q[1],Se=Q[2],Ae=Q[3];$+=ie+Ae,D+=J+Se,O=O+(ie-Ae)/2,w=w+(Se-J)/2}}S=Wc(Wc({},a),{x:O-1,y:w-1,width:$,height:D})}return $t(qu,Wc({},S))}return null},e.prototype.getShape=function(){var n=this.props.model,o=n.text,r=o.x,i=o.y,a=o.value;if(!a)return null;var s=n.getTextStyle(),l=Wc({x:r,y:i,value:a,model:n,className:"lf-element-text"},s);return $t("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),$t(EI,Wc({},l))]})},e})(TI),wee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Vw=function(){return Vw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ih=(function(t){wee(e,t);function e(n){var o=t.call(this)||this;o.onDragStart=function(l){var f=l.event,h=o.props,v=h.model,b=h.graphModel;if(f){var E=b.getPointByClient({x:f.clientX,y:f.clientY}).canvasOverlayPosition,O=E.x,w=E.y;o.moveOffset={dx:v.x-O,dy:v.y-w}}},o.onDragging=function(l){var f,h,v,b,E=l.event,O=o.props,w=O.model,S=O.graphModel,M=S.editConfigModel,T=M.stopMoveGraph,$=M.autoExpand,D=M.snapGrid,P=S.transformModel,B=S.selectNodes,F=S.width,I=S.height,V=S.gridSize;w.isDragging=!0;var z=E,X=z.clientX,Y=z.clientY,W=o.mouseDownPosition,Q=W.x,J=W.y;(X-Q>V||Y-J>V)&&(w.isDragging=!0);var ie=S.getPointByClient({x:X,y:Y}).canvasOverlayPosition,Se=ie.x,Ae=ie.y,Pe=N0(P.CanvasPointToHtmlPoint([Se,Ae]),2),De=Pe[0],ze=Pe[1];if(Se=Se+((h=(f=o.moveOffset)===null||f===void 0?void 0:f.dx)!==null&&h!==void 0?h:0),Ae=Ae+((b=(v=o.moveOffset)===null||v===void 0?void 0:v.dy)!==null&&b!==void 0?b:0),Se=Wg(Se,V,D),Ae=Wg(Ae,V,D),!F||!I){S.moveNode2Coordinate(w.id,Se,Ae);return}var Ye=De<0||ze<0||De>F||ze>I;if(!($&&!T&&Ye)){var Be=N0(P.CanvasPointToHtmlPoint([Se-w.width/2,Ae-w.height/2]),2),Je=Be[0],gt=Be[1],le=N0(P.CanvasPointToHtmlPoint([Se+w.width/2,Ae+w.height/2]),2),Ze=le[0],pe=le[1],se=Math.max(V,20),we=[];Je<0?we=[se,0]:Ze>S.width?we=[-se,0]:gt<0?we=[0,se]:pe>S.height&&(we=[0,-se]),o.t&&Fw(o.t);var $e=B.map(function(rt){return rt.id});$e.indexOf(w.id)===-1&&($e=[w.id]),we.length>0&&!T&&$?o.t=wI(function(){var rt=N0(we,2),pt=rt[0],Lt=rt[1];P.translate(pt??0,Lt??0);var Jt=-(pt??0)/P.SCALE_X,en=-(Lt??0)/P.SCALE_X;S.moveNodes($e,Jt,en)}):S.moveNodes($e,Se-w.x,Ae-w.y)}},o.onDragEnd=function(){o.t&&Fw(o.t);var l=o.props.model;l.isDragging=!1},o.onMouseOut=function(l){PZ()&&o.setHoverOff(l)},o.handleMouseUp=function(){var l=o.props.model;o.mouseUpDrag=l.isDragging},o.handleClick=function(l){var f=o.mouseUpDrag===!1,h=new Date().getTime();if(o.startTime){var v=h-o.startTime,b=o.props,E=b.model,O=b.graphModel;if(!(!f&&v>300)){f||(o.onDragEnd(),o.handleMouseUp());var w=E.getData(),S=O.getPointByClient({x:l.clientX,y:l.clientY}),M={data:w,e:l,position:S,isSelected:!1,isMultiple:!1},T=l.button===2,$=l.detail===2;if(!T){var D=O.editConfigModel,P=yI(l,D);if(M.isMultiple=P,E.isSelected&&!$&&P?(M.isSelected=!1,E.setSelected(!1)):(O.selectNodeById(E.id,P),M.isSelected=!0,D.isSilentMode||o.toFront()),$)D.nodeTextEdit&&E.text.editable&&D.textMode===Ju.TEXT&&(E.setSelected(!1),O.setElementStateById(E.id,Wo.TEXT_EDIT)),O.eventCenter.emit(pr.NODE_DBCLICK,M);else{O.eventCenter.emit(pr.ELEMENT_CLICK,M),O.eventCenter.emit(pr.NODE_CLICK,M);var B=l.currentTarget,F=!ws(window)&&kh(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(I){return setTimeout(I,0)};F(function(){B.focus()})}}}}},o.handleContextMenu=function(l){l.preventDefault();var f=o.props,h=f.model,v=f.graphModel,b=v.editConfigModel,E=h.getData(),O=v.getPointByClient({x:l.clientX,y:l.clientY});v.setElementStateById(h.id,Wo.SHOW_MENU,O.domOverlayPosition),h.isSelected||v.selectNodeById(h.id),v.eventCenter.emit(pr.NODE_CONTEXTMENU,{data:E,e:l,position:O}),b.isSilentMode||o.toFront()},o.handleMouseDown=function(l){var f=o.props,h=f.model,v=f.graphModel;o.mouseDownPosition={x:l.clientX,y:l.clientY},o.startTime=new Date().getTime();var b=v.editConfigModel;b.adjustNodePosition&&h.draggable&&o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.handleFocus=function(){var l=o.props,f=l.model,h=l.graphModel;h.eventCenter.emit(pr.NODE_FOCUS,{data:f.getData()})},o.handleBlur=function(){if(o.props){var l=o.props,f=l.model,h=l.graphModel;h.eventCenter.emit(pr.NODE_BLUR,{data:f.getData()})}},o.setHoverOn=function(l){var f=o.props,h=f.model,v=f.graphModel;if(!h.isHovered){var b=h.getData();h.setHovered(!0),v.eventCenter.emit(pr.NODE_MOUSEENTER,{data:b,e:l})}},o.setHoverOff=function(l){var f=o.props,h=f.model,v=f.graphModel,b=h.getData();h.isHovered&&(h.setHovered(!1),v.eventCenter.emit(pr.NODE_MOUSELEAVE,{data:b,e:l}))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter,s=n.model;return o.stepDrag=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),o.modelDisposer=H3(function(){return o.props},function(l){l&&l.model&&o.stepDrag.setModel(l.model)}),o}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.isSelected,s=r.isHitable,l=r.isDragging,f=r.isShowAnchor;return s&&(a||f)&&!l?tc(r.anchors,function(h,v){var b=r.getAnchorLineStyle(h),E=r.getAnchorStyle(h);return $t(fee,{anchorData:h,node:n,style:E,edgeStyle:b,anchorIndex:v,nodeModel:r,graphModel:i,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowRotate,l=o.isSelected,f=o.isHitable,h=o.rotatable,v=o.isHovered,b=s&&h,E=o.getRotateControlStyle();if(!a&&f&&(l||v)&&b)return $t(hee,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:E})},e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowResize,l=o.isSelected,f=o.isHitable,h=o.resizable,v=o.isHovered,b=s&&h,E=o.getResizeControlStyle();return!a&&f&&(l||v)&&b?$t(PJ,{style:E,model:o,graphModel:r}):null},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==Ju.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var s=!1;return a.nodeTextDraggable&&r.text.draggable&&(s=!0),$t(TI,{editable:a.nodeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,o=n.state,r=n.isDragging,i=n.isSelected,a="lf-node";switch(o){case Wo.ALLOW_CONNECT:a+=" lf-node-allow";break;case Wo.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return r&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,o=n.model,r=n.graphModel;o.autoToFront&&r.toFront(o.id)},e.prototype.render=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.hideAnchors,s=i.adjustNodePosition,l=i.allowRotate,f=i.allowResize,h=r.gridSize,v=r.transformModel.SCALE_X,b=o.isHitable,E=o.draggable,O=o.transform,w=o.getOuterGAttributes(),S=w.className,M=S===void 0?"":S,T=Eee(w,["className"]),$=$t("g",{className:"lf-node-content",children:[$t("g",{transform:O,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),f&&this.getResizeControl()]}),!a&&this.getAnchors()]}),D;return b?(s&&E&&this.stepDrag.setStep(h*v),D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},T,{children:$}))):D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M)},T,{children:$})),D},e.isObserved=!1,e})(ko),xee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),QA=function(){return QA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},kee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ud;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ud||(Ud={}));var BP=(function(t){Pee(e,t);function e(n){var o=t.call(this)||this;o.handleMouseDown=function(l){o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.onDragStart=function(){var l=o.props,f=l.x,h=l.y,v=l.edgeModel,b=v.startPoint,E=v.endPoint,O=v.pointsList;o.oldEdge={startPoint:b,endPoint:E,pointsList:O},o.setState({endX:f,endY:h,dragging:!0})},o.onDragging=function(l){var f=l.deltaX,h=l.deltaY,v=o.state,b=v.endX,E=v.endY,O=o.props,w=O.graphModel,S=O.type,M=w.transformModel,T=w.editConfigModel,$=Dee(M.moveCanvasPointByHtml([b,E],f,h),2),D=$[0],P=$[1];o.setState({endX:D,endY:P,dragging:!0});var B=o.props.edgeModel,F=Lw({x:b,y:E},w);if(F&&F.node&&o.isAllowAdjust(F).pass){var I=B.startPoint,V=B.endPoint,z=B.sourceNode,X=B.targetNode,Y=S===Ud.SOURCE?{startPoint:{x:F.anchor.x,y:F.anchor.y},endPoint:{x:V.x,y:V.y},sourceNode:F.node,targetNode:X}:{startPoint:{x:I.x,y:I.y},endPoint:{x:F.anchor.x,y:F.anchor.y},sourceNode:z,targetNode:F.node};B.updateAfterAdjustStartAndEnd(Y)}else S===Ud.SOURCE?B.updateStartPoint({x:D,y:P}):B.updateEndPoint({x:D,y:P});B.text.value&&T.adjustEdge&&B.setText(Object.assign({},B.text,B.textPosition))},o.onDragEnd=function(l){var f,h,v,b=l.event;try{o.setState({dragging:!1});var E=o.props,O=E.graphModel,w=E.edgeModel,S=E.type,M=o.state,T=M.endX,$=M.endY,D=M.dragging,P=Lw({x:T,y:$},O);if(!D)return;var B=!1,F=void 0;if(P&&P.node){var I=o.isAllowAdjust(P),V=I.pass,z=I.msg,X=I.newTargetNode;if(V){var Y=w.getData(),W=Y.text,Q=Y.sourceAnchorId,J=Q===void 0?"":Q,ie=Y.targetAnchorId,Se=ie===void 0?"":ie,Ae=Ree(Y,["text","sourceAnchorId","targetAnchorId"]);if(F=Gc(Gc({sourceAnchorId:J,targetAnchorId:Se},Ae),{text:(W==null?void 0:W.value)||""}),S===Ud.SOURCE){var Pe=O.getNodeModelById(P.node.id),De=O.getNodeModelById(w.targetNodeId),ze=(f=O.edgeGenerator)===null||f===void 0?void 0:f.call(O,Pe==null?void 0:Pe.getData(),De==null?void 0:De.getData(),F);F=Gc(Gc({},ze),{sourceNodeId:P.node.id,sourceAnchorId:P.anchor.id,startPoint:{x:P.anchor.x,y:P.anchor.y},targetNodeId:w.targetNodeId,endPoint:Gc({},w.endPoint)}),w.sourceNodeId===P.node.id&&w.sourceAnchorId===P.anchor.id&&(B=!0)}else if(S===Ud.TARGET){var Pe=O.getNodeModelById(w.sourceNodeId),De=O.getNodeModelById(P.node.id),ze=(h=O.edgeGenerator)===null||h===void 0?void 0:h.call(O,Pe==null?void 0:Pe.getData(),De==null?void 0:De.getData(),F);F=Gc(Gc({},ze),{sourceNodeId:w.sourceNodeId,startPoint:Gc({},w.startPoint),targetNodeId:P.node.id,targetAnchorId:P.anchor.id,endPoint:{x:P.anchor.x,y:P.anchor.y}}),w.targetNodeId===P.node.id&&w.targetAnchorId===P.anchor.id&&(B=!0)}}else{B=!0;var Ye=X.getData();O.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Ye,msg:z})}}else B=!0;if(B)o.recoveryEdge();else{var Be=w.getData();O.deleteEdgeById(w.id);var Je=O.addEdge(Gc({},F));O.eventCenter.emit(pr.EDGE_EXCHANGE_NODE,{data:{newEdge:Je.getData(),oldEdge:Be}})}(v=o.preTargetNode)===null||v===void 0||v.setElementState(Wo.DEFAULT)}finally{var O=o.props.graphModel;O.eventCenter.emit(pr.ADJUST_POINT_DRAGEND,{e:b,data:o.stepDragData})}},o.recoveryEdge=function(){var l=o.props.edgeModel,f=o.oldEdge,h=f.startPoint,v=f.endPoint,b=f.pointsList;l.updateStartPoint(h),l.updateEndPoint(v),l.modelType!==_o.LINE_EDGE&&(l.pointsList=b??[],l.initPoints())},o.getAdjustPointStyle=function(){var l=o.props.graphModel.theme,f=l.edgeAdjust;return f},o.state={dragging:!1,endX:0,endY:0},o.targetRuleResults=new Map,o.sourceRuleResults=new Map;var r=n.type,i=n.edgeModel,a=n.graphModel,s=a.eventCenter;return o.stepDragData={type:r,edgeData:i.getData()},o.stepDrag=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:o.stepDragData}),o}return e.prototype.isAllowAdjust=function(n){var o=this.props,r=o.edgeModel,i=r.id,a=r.sourceNode,s=r.targetNode,l=r.sourceAnchorId,f=r.targetAnchorId,h=o.type,v,b,E,O;if(h===Ud.SOURCE?(v=n.node,b=s,E=n.anchor,O=s.getAnchorInfo(f)):(v=a,b=n.node,O=n.anchor,E=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(Wo.DEFAULT),this.preTargetNode=n.node,O.id===E.id)return{pass:!1,msg:"",newTargetNode:b};var w="".concat(v.id,"_").concat(b.id,"_").concat(E.id,"_").concat(O.id);if(!this.targetRuleResults.has(w)){var S=v.isAllowConnectedAsSource(b,E,O,i),M=b.isAllowConnectedAsTarget(v,E,O,i);this.sourceRuleResults.set(w,Iw(S)),this.targetRuleResults.set(w,Iw(M))}var T=this.sourceRuleResults.get(w),$=T.isAllPass,D=T.msg,P=this.targetRuleResults.get(w),B=P.isAllPass,F=P.msg,I=$&&B?Wo.ALLOW_CONNECT:Wo.NOT_ALLOW_CONNECT;return h===Ud.SOURCE?v.setElementState(I):b.setElementState(I),{pass:$&&B,msg:F||D,newTargetNode:b}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.getAdjustPointShape,a=n.edgeModel,s=this.state.dragging;return $t("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":i(o,r,a)})},e})(ko),jee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l2=function(){return l2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Z1=(function(t){Lee(e,t);function e(){var n=t.call(this)||this;return n.textRef=W1(),n.handleHover=function(o,r){var i=n.props,a=i.model,s=i.graphModel.eventCenter;a.setHovered(o);var l=o?pr.EDGE_MOUSEENTER:pr.EDGE_MOUSELEAVE,f=a.getData();s.emit(l,{data:f,e:r})},n.setHoverOn=function(o){var r=n.props.model.isHovered;r||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,o))},n.setHoverOff=function(o){var r=n.props.model.isHovered;r&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,o))},n.handleContextMenu=function(o){o.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,i=r.model,a=r.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:o.clientX,y:o.clientY});a.setElementStateById(i.id,Wo.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||n.toFront(),i.isSelected||a.selectEdgeById(i.id);var f=i==null?void 0:i.getData();a.eventCenter.emit(pr.EDGE_CONTEXTMENU,{data:f,e:o,position:l})},n.handleMouseDown=function(o){o.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var o=n.props.model;n.mouseUpDrag=o.isDragging},n.handleClick=function(o){if(n.startTime&&!n.mouseUpDrag){var r=o.button===2;if(!r){var i=o.detail===2,a=n.props,s=a.model,l=a.graphModel,f=s==null?void 0:s.getData(),h=l.getPointByClient({x:o.clientX,y:o.clientY});if(i){var v=l.editConfigModel,b=l.textEditElement,E=s.id,O=s.text,w=s.modelType;if(b&&b.id===E&&l.setElementStateById(E,Wo.DEFAULT),v.edgeTextEdit&&O.editable&&(s.setSelected(!1),l.setElementStateById(E,Wo.TEXT_EDIT)),w===_o.POLYLINE_EDGE){var S=s,M=l.getPointByClient({x:o.x,y:o.y}).canvasOverlayPosition,T=M.x,$=M.y;S.dbClickPosition=gI({x:T,y:$},S.points)}l.eventCenter.emit(pr.EDGE_DBCLICK,{data:f,e:o,position:h})}else{l.eventCenter.emit(pr.ELEMENT_CLICK,{data:f,e:o,position:h}),l.eventCenter.emit(pr.EDGE_CLICK,{data:f,e:o,position:h});var D=o.currentTarget,P=!ws(window)&&kh(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(F){return setTimeout(F,0)};P(function(){D.focus()})}var B=l.editConfigModel;l.selectEdgeById(s.id,yI(o,B)),B.isSilentMode||n.toFront()}}},n.handleFocus=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_FOCUS,{data:r.getData()})},n.handleBlur=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_BLUR,{data:r.getData()})},n}return e.prototype.getShape=function(){return $t("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==Ju.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var s=!1;return a.edgeTextDraggable&&r.text.draggable&&(s=!0),$t(bee,{ref:this.textRef,editable:a.edgeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isSelected,a=this.state.hover;return{start:o,end:r,hover:a,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint;return[o,r]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,o=n.id,r=n.getArrowStyle(),i=r.refY,a=i===void 0?0:i,s=r.refX,l=s===void 0?2:s,f=Iee(this.getLastTwoPoints(),2),h=f[0],v=f[1],b="auto";if(h&&v){var E=v.x-h.x,O=v.y-h.y;if(E!==0||O!==0){var w=YJ(XJ({x:E,y:O}));Number.isFinite(w)&&!Number.isNaN(w)&&(b=w)}}return $t("g",{children:$t("defs",{children:[$t("marker",{id:"marker-start-".concat(o),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),$t("marker",{id:"marker-end-".concat(o),refX:l,refY:a,overflow:"visible",orient:b,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,o){var r=o.stroke,i=o.fill,a=i===void 0?r:i,s=o.strokeWidth,l=o.offset,f=l===void 0?10:l,h=o.verticalLength,v=o.strokeLinecap,b=o.strokeLinejoin,E=o.transform,O="";switch(n){case"solid":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(3*f/4,",-").concat(h," Z");break;case"hollow":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(-f/4,",0 L").concat(3*f/4,",-").concat(h," L").concat(-f/4,",0 Z");break;case"diamond":O="M".concat(-f/2,",0 L0,").concat(h," L").concat(f/2,",0 L0,-").concat(h," L").concat(-f/2,",0 Z");break;case"circle":O="M".concat(-f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(-f/2,",0 Z");break;default:O="";break}return $t("path",{d:O,stroke:r,fill:a,strokeWidth:s,strokeLinecap:v,strokeLinejoin:b,transform:E})},e.prototype.getStartArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.startArrowType,f=l===void 0?"none":l,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:h,strokeLinejoin:v})},e.prototype.getEndArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.endArrowType,f=l===void 0?"solid":l,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:h,strokeLinejoin:v,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,o,r){var i=r.getAdjustPointStyle();return $t(zg,d_({className:"lf-edge-adjust-point"},i,{x:n,y:o}))},e.prototype.getAdjustPoints=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.adjustEdgeStartAndEnd,s=i.adjustEdgeStart,l=i.adjustEdgeEnd,f=o.getAdjustStart(),h=o.getAdjustEnd();return $t("g",{children:[a&&s&&$t(BP,d_({type:Ud.SOURCE},f,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r})),a&&l&&$t(BP,d_({type:Ud.TARGET},h,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return $t("g",{})},e.prototype.getAppend=function(){return $t("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,o=n.graphModel,r=n.model;o.toFront(r.id)},e.prototype.render=function(){var n=this.props.model,o=n.isSelected,r=n.isHitable,i=n.isShowAdjustPoint;return $t("g",{children:[$t("g",{className:["lf-edge",!r&&"pointer-none",o&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),i&&o?this.getAdjustPoints():""]})},e.isObserved=!1,e})(ko),Fee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s2=function(){return s2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$P=(function(t){Fee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.getEdgeStyle(),r=n,i=r.path,a=r.isAnimation,s=r.arrowConfig,l=n.getEdgeAnimationStyle(),f=l.strokeDasharray,h=l.stroke,v=l.strokeDashoffset,b=l.animationName,E=l.animationDuration,O=l.animationIterationCount,w=l.animationTimingFunction,S=l.animationDirection;return $t(P_,s2({d:i},o,s,a?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:E,animationIterationCount:O,animationTimingFunction:w,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return $t(P_,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,o=this.state.hover,r=n.isSelected,i=n.getArrowStyle().offset,a=n.pointsList.map(function(v){return{x:v.x,y:v.y}}),s=Bee(_P(a,i),2),l=s[0],f=s[1],h={start:l,end:f,hover:o,isSelected:r};return h},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.getArrowStyle().offset,r=n.pointsList.map(function(i){return{x:i.x,y:i.y}});return _P(r,o)},e})(Z1),$ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u2=function(){return u2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$_=(function(t){Uee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var o=n.props.model;o.dragAppendStart(),n.isShowAdjustPointTemp=o.isShowAdjustPoint,o.isShowAdjustPoint=!1},n.onDragging=function(o){var r=o.deltaX,i=o.deltaY,a=n.props,s=a.model,l=a.graphModel;n.isDragging=!0;var f=l.transformModel,h=l.editConfigModel,v=Vee(f.fixDeltaXY(r,i),2),b=v[0],E=v[1],O=s,w=h.adjustEdgeMiddle;w?n.appendInfo=O.dragAppendSimple(n.appendInfo,{x:b,y:E}):n.appendInfo=O.dragAppend(n.appendInfo,{x:b,y:E})},n.onDragEnd=function(){var o,r=n.props,i=r.model,a=r.graphModel.eventCenter,s=i;s.dragAppendEnd(),n.isDragging=!1,s.isShowAdjustPoint=(o=n.isShowAdjustPointTemp)!==null&&o!==void 0?o:!1,n.appendInfo=void 0,a.emit(pr.EDGE_ADJUST,{data:s.getData()})},n.beforeDragStart=function(o,r){r.draggable&&n.drag.handleMouseDown(o),n.appendInfo=r},n.drag=new ac({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),l=s.strokeDasharray,f=s.stroke,h=s.strokeDashoffset,v=s.animationName,b=s.animationDuration,E=s.animationIterationCount,O=s.animationTimingFunction,w=s.animationDirection;return $t(TJ,$v({points:o},a,i,r?{strokeDasharray:l,stroke:f,style:{strokeDashoffset:h,animationName:v,animationDuration:b,animationIterationCount:E,animationTimingFunction:O,animationDirection:w}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.points,r=n.isSelected,i=this.state.hover,a=Kv(o),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:i,isSelected:r}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.points,r=Kv(o),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),[i,a]},e.prototype.getAppendAttributes=function(n){var o=n.start,r=n.end,i;if(o.x===r.x&&o.y===r.y)i="";else{var a={start:o,end:r,offset:10,verticalLength:5},s=C_($v($v({},a),{type:"start"})),l=C_($v($v({},a),{type:"end"}));i="M".concat(s.leftX," ").concat(s.leftY,` L`).concat(s.rightX," ").concat(s.rightY,` L`).concat(l.rightX," ").concat(l.rightY,` L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:i,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var o=this.getAppendAttributes(n),r=o.d,i=o.strokeWidth,a=o.fill,s=o.strokeDasharray,l=o.stroke;return $t(P_,{d:r,fill:a,strokeWidth:i,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.pointsList,s=r.draggable,l=[],f=a.length,h=function(E){var O="lf-polyline-append",w={start:{x:a[E].x,y:a[E].y},end:{x:a[E+1].x,y:a[E+1].y},startIndex:E,endIndex:E+1,direction:ni.HORIZONTAL,draggable:!0},S=$t("g",{className:O,children:v.getAppendShape(w)}),M=i.editConfigModel,T=M.adjustEdge,$=M.adjustEdgeMiddle;if(T&&s){var D=w.startIndex,P=w.endIndex,B=$&&(D===0||P===f-1);w.draggable=!B,w.start.x===w.end.x?(w.draggable&&(O+="-ew-resize"),w.direction=ni.VERTICAL):w.start.y===w.end.y&&(w.draggable&&(O+="-ns-resize"),w.direction=ni.HORIZONTAL),S=$t("g",{className:v.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(F){return n.beforeDragStart(F,w)},children:$t("g",{className:O,children:v.getAppendShape(w)})})}l.push(S)},v=this,b=0;b=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Xee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Yee=(function(t){zee(e,t);function e(n){var o=t.call(this,n)||this;return o.ref=W1(),o.__prevText={type:"",text:"",id:""},o.keyupHandler=function(r){var i=o.props.graphModel.textEditElement;r.key==="Enter"&&r.altKey&&(i==null||i.setElementState(Wo.DEFAULT))},o.inputHandler=function(r){var i=r.target.innerText,a=o.props.graphModel.textEditElement;a&&(o.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},o.keydownHandler=function(r){r.stopPropagation()},o.state={style:{left:0,top:0}},o}return e.getDerivedStateFromProps=function(n){var o,r=n.textEditElement,i=n.graphModel,a=i.transformModel,s=i.theme,l=s.inputText,f;if(r){if(!(!((o=r.text)===null||o===void 0)&&o.value)&&r.BaseType===da.EDGE){var h=r.text,v=r.textPosition,b=v.x,E=v.y;h.x=b,h.y=E,r.setText(h)}var O={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===da.EDGE){var w=s.edgeText,S=w.overflowMode,M=w.lineHeight,T=w.wrapPadding,$=w.textWidth;$&&S==="autoWrap"&&(f=np(np({},O),{width:$,minWidth:$,lineHeight:M,padding:T}))}else if(r.BaseType===da.NODE){var D=s.nodeText,S=D.overflowMode,M=D.lineHeight,T=D.wrapPadding,$=D.textWidth,P=r.width,B=r.modelType,F=r.textWidth,I=F||$||P;(B!==_o.TEXT_NODE&&S==="autoWrap"||B===_o.TEXT_NODE&&$)&&(f=np(np({},O),{width:I,minWidth:I,lineHeight:M,padding:T}))}var V=r.text,z=V.x,X=V.y,Y=Xee(a.CanvasPointToHtmlPoint([z,X]),2),W=Y[0],Q=Y[1];return{style:np(np({left:W,top:Q},f),l)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var o=this.__prevText,r=o.text,i=o.id;n.updateText(i,r),n.eventCenter.emit(pr.TEXT_UPDATE,{data:np({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var o=document.createRange();o.selectNodeContents(n),o.collapse(!1);var r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(o)}},e.prototype.render=function(){var n,o=this.props.graphModel.textEditElement,r=this.state.style;return o?$t("div",{contentEditable:!0,className:"lf-text-input",style:r,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=o.text)===null||n===void 0?void 0:n.value},o.id):null},e.toolName="text-edit-tool",e=Hee([xs],e),e})(ko),qee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Zee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Qee=[Yee,Jee],ete=(function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,ri(Qee,function(i){n.isDisabled(i.toolName)||n.registerTool(i.toolName,i)});var o=e.graphModel,r=o.eventCenter;r.on("".concat(pr.GRAPH_TRANSFORM,",").concat(pr.NODE_CLICK,",").concat(pr.BLANK_CLICK," "),function(){var i,a=o.textEditElement,s=o.editConfigModel,l=s.edgeTextEdit,f=s.nodeTextEdit;(l||f)&&a&&((i=o.textEditElement)===null||i===void 0||i.setElementState(Wo.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},sS([Ut],t.prototype,"toolMap",void 0),sS([Bt],t.prototype,"disableTool",null),sS([Bt],t.prototype,"enableTool",null),t})();function tte(t){throw new Error("[mobx-utils] "+t)}function Hw(t,e){e===void 0&&(e="Illegal state"),t||tte(e)}var CI=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(CI(Object.getPrototypeOf(t))||[])},nte=function(t){var e=CI(t),n=e.filter(function(o,r){return e.indexOf(o)===r});return n},rte=function(t){return nte(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},NI="pending",Xw="fulfilled",PM="rejected";function ote(t){switch(this.state){case NI:return t.pending&&t.pending(this.value);case PM:return t.rejected&&t.rejected(this.value);case Xw:return t.fulfilled?t.fulfilled(this.value):this.value}}function VP(t,e){if(Hw(arguments.length<=2,"fromPromise expects up to two arguments"),Hw(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(Bt("observableFromPromise-resolve",function(r){n.value=r,n.state=Xw}),Bt("observableFromPromise-reject",function(r){n.value=r,n.state=PM})),n.isPromiseBasedObservable=!0,n.case=ote;var o=e&&e.state===Xw?e.value:void 0;return NA(n,{value:o,state:NI},{},{deep:!1}),n}(function(t){t.reject=Bt("fromPromise.reject",function(n){var o=t(Promise.reject(n));return o.state=PM,o.value=n,o});function e(n){n===void 0&&(n=void 0);var o=t(Promise.resolve(n));return o.state=Xw,o.value=n,o}t.resolve=Bt("fromPromise.resolve",e)})(VP||(VP={}));var k0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i};(function(){function t(e,n){var o=this;kK(function(){o.current=n,o.subscription=e.subscribe(o)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},k0([Ut.ref],t.prototype,"current",void 0),k0([Bt.bound],t.prototype,"next",null),k0([Bt.bound],t.prototype,"complete",null),k0([Bt.bound],t.prototype,"error",null),t})();var Yw=function(){return Yw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ite=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=Ut.map({}),this.localComputedValues=Ut.map({}),this.isPropertyDirty=function(o){return n.localValues.has(o)},Hw(rd(e),"createViewModel expects an observable object"),rte(e).forEach(function(o){if(!(o===eo||o==="__mobxDidRunLazyInitializers")){if(Hw(ite.indexOf(o)===-1,"The propertyname "+o+" is reserved and cannot be used with viewModels"),Nk(e,o)){var r=Y1(e,o).derivation;n.localComputedValues.set(o,Ai(r.bind(n)))}var i=Object.getOwnPropertyDescriptor(e,o),a=i?{enumerable:i.enumerable}:{};Object.defineProperty(n,o,Yw(Yw({},a),{configurable:!0,get:function(){return Nk(e,o)?n.localComputedValues.get(o).get():n.isPropertyDirty(o)?n.localValues.get(o):n.model[o]},set:Bt(function(s){s!==n.model[o]?n.localValues.set(o,s):n.localValues.delete(o)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Vg(this.localValues).forEach(function(n){var o=e.localValues.get(n),r=e.model[n];tf(r)?r.replace(o):Ys(r)?(r.clear(),r.merge(o)):FK(o)||(e.model[n]=o)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},Fy([Ai],t.prototype,"isDirty",null),Fy([Ai],t.prototype,"changedValues",null),Fy([Bt.bound],t.prototype,"submit",null),Fy([Bt.bound],t.prototype,"reset",null),Fy([Bt.bound],t.prototype,"resetProperty",null),t})();function uS(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function cS(t){return rd(t)||tf(t)||Ys(t)}function ate(t,e){var n=new WeakMap;function o(s){var l=n.get(s.object);r(s,l),e(s,uS(l),t)}function r(s,l){switch(s.type){case"add":i(s.newValue,l,s.name);break;case"update":a(s.oldValue),i(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(v,b){return i(v,l,""+(s.index+b))});for(var f=s.index+s.addedCount;fthis.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=to(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=to(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=ate(e,D2(function(){var o=e.modelToHistoryData();o&&n.add(c2({},o))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t})(),dS={exports:{}},WP;function ute(){return WP||(WP=1,(function(t){(function(e,n,o){if(!e)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,f=1;f<20;++f)r[111+f]="f"+f;for(f=0;f<=9;++f)r[f+96]=f.toString();function h(F,I,V){if(F.addEventListener){F.addEventListener(I,V,!1);return}F.attachEvent("on"+I,V)}function v(F){if(F.type=="keypress"){var I=String.fromCharCode(F.which);return F.shiftKey||(I=I.toLowerCase()),I}return r[F.which]?r[F.which]:i[F.which]?i[F.which]:String.fromCharCode(F.which).toLowerCase()}function b(F,I){return F.sort().join(",")===I.sort().join(",")}function E(F){var I=[];return F.shiftKey&&I.push("shift"),F.altKey&&I.push("alt"),F.ctrlKey&&I.push("ctrl"),F.metaKey&&I.push("meta"),I}function O(F){if(F.preventDefault){F.preventDefault();return}F.returnValue=!1}function w(F){if(F.stopPropagation){F.stopPropagation();return}F.cancelBubble=!0}function S(F){return F=="shift"||F=="ctrl"||F=="alt"||F=="meta"}function M(){if(!l){l={};for(var F in r)F>95&&F<112||r.hasOwnProperty(F)&&(l[r[F]]=F)}return l}function T(F,I,V){return V||(V=M()[F]?"keydown":"keypress"),V=="keypress"&&I.length&&(V="keydown"),V}function $(F){return F==="+"?["+"]:(F=F.replace(/\+{2}/g,"+plus"),F.split("+"))}function D(F,I){var V,z,X,Y=[];for(V=$(F),X=0;X1){Pe(ze,le,Ye,Be);return}Ze=D(ze,Be),I._callbacks[Ze.key]=I._callbacks[Ze.key]||[],J(Ze.key,Ze.modifiers,{type:Ze.action},Je,ze,gt),I._callbacks[Ze.key][Je?"unshift":"push"]({callback:Ye,modifiers:Ze.modifiers,action:Ze.action,seq:Je,level:gt,combo:ze})}I._bindMultiple=function(ze,Ye,Be){for(var Je=0;Je-1||P(I,V.target))return!1;if("composedPath"in F&&typeof F.composedPath=="function"){var z=F.composedPath()[0];z!==F.target&&(I=z)}return I.tagName=="INPUT"||I.tagName=="SELECT"||I.tagName=="TEXTAREA"||I.isContentEditable},B.prototype.handleKey=function(){var F=this;return F._handleKey.apply(F,arguments)},B.addKeycodes=function(F){for(var I in F)F.hasOwnProperty(I)&&(r[I]=F[I]);l=null},B.init=function(){var F=B(n);for(var I in F)I.charAt(0)!=="_"&&(B[I]=(function(V){return function(){return F[V].apply(F,arguments)}})(I))},B.init(),e.Mousetrap=B,t.exports&&(t.exports=B)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(dS)),dS.exports}var cte=ute();const dte=Z_(cte);var Rd=null;function GP(t,e){var n,o;return t.x+=e,t.y+=e,dw(t.text)||(t.text.x+=e,t.text.y+=e),dw((n=t.properties)===null||n===void 0?void 0:n._label)||(o=t.properties)===null||o===void 0||o._label.forEach(function(r){r.x+=e,r.y+=e}),t}function zP(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),dw(t.text)||(t.text.x+=e,t.text.y+=e),t}var ag=40,P0=40;function fte(t,e){var n=t.keyboard,o=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(P0=ag,!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=t.options.guards,i=e.getSelectElements(!1),a=r&&r.beforeClone?r.beforeClone(i):!0;return!a||i.nodes.length===0&&i.edges.length===0?(Rd=null,!0):(Rd=i,Rd.nodes.forEach(function(s){return GP(s,ag)}),Rd.edges.forEach(function(s){return zP(s,ag)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(Rd&&(Rd.nodes||Rd.edges)){t.clearSelectElements();var r=t.addElements(Rd,P0);if(!r)return!0;r.nodes.forEach(function(i){return t.selectElementById(i.id,!0)}),r.edges.forEach(function(i){return t.selectElementById(i.id,!0)}),Rd.nodes.forEach(function(i){return GP(i,ag)}),Rd.edges.forEach(function(i){return zP(i,ag)}),P0=P0+ag}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=e.getSelectElements(!0);return t.clearSelectElements(),r.edges.forEach(function(i){return i.id&&t.deleteEdge(i.id)}),r.nodes.forEach(function(i){return i.id&&t.deleteNode(i.id)}),!1})}var pte=(function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new dte(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,o=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(o)if(qa(o))o.forEach(function(s){var l=s.keys,f=s.callback,h=s.action;return e.on(l,f,h)});else{var r=o.keys,i=o.callback,a=o.action;this.on(r,i,a)}},t.prototype.on=function(e,n,o){this.mousetrap.bind(this.getKeys(e),n,o)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(o){return n.formatKey(o)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t})(),ph=function(){return ph=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o/g,">").replace(/"/g,""").replace(/'/g,"'")}function _te(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Zw(t)).replace(/"/g,"'")}return Jw(String(e))}var Tv=` `;function Z0(t,e,n){var o=yte(n);if(t!==0&&t!==!1&&!t)return Tv+o+"<".concat(e," />");var r="";if(e==="#text")return Tv+o+Jw(String(t));if(e==="#cdata-section")return Tv+o+"";if(e==="#comment")return Tv+o+"";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+_te(t)+'"';if(Array.isArray(t))t.forEach(function(l){r+=Z0(l,e,n+1)});else if(II(t)==="[object Object]"){var i=Object.keys(t),a="",s="";r+=(n===0?"":Tv+o)+"<"+e,i.forEach(function(l){l.charAt(0)==="-"?a+=Z0(t[l],l,n+1):s+=Z0(t[l],l,n+1)}),r+=a+(s!==""?">".concat(s).concat(Tv+o,""):" />")}else r+=Tv+o+"<".concat(e,">").concat(Jw(String(t)),"");return r}function bte(t){var e="";for(var n in t)e+=Z0(t[n],n,0);return e}var As=function(){};As.ObjTree=function(){return this};As.ObjTree.VERSION="0.23";As.ObjTree.prototype.xmlDecl=` `;As.ObjTree.prototype.attr_prefix="-";As.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)};As.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,s=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),s&&s(h)}}else o.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(l=f.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)};As.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};As.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=o):n==1?t[e]=o:n==2?t[e]=[t[e],o]:t[e][t[e].length]=o};As.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};As.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];r.charAt(0)!=this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<"+r+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<"+t+a+`> `+s+" `:s="<"+t+a+">"+s+" `:s="<"+t+a+` /> `),s};As.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o"u"||r==null?n[n.length]="<"+t+" />":typeof r=="object"&&r.constructor==Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};As.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+" `};As.ObjTree.prototype.xml_escape=Jw;var wte=function(t){return new As.ObjTree().parseXML(t)},Ete=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f2=function(){return f2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xd;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Xd||(Xd={}));var FI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],YP=["properties","startPoint","endPoint","pointsList"],BI=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function qP(t){var e=t?YP.concat(t):YP;return function(n){function o(r){var i={};return typeof r=="string"?r:Array.isArray(r)?r.map(function(a){return o(a)}):(Object.entries(r).forEach(function(a){var s=J1(a,2),l=s[0],f=s[1];typeof f!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?i[l]=f:i["-".concat(l)]=f:e.includes(l)?i["-".concat(l)]=o(f):i[l]=o(f)}),i)}return o(n)}}function Qw(t){var e={};return Object.entries(t).forEach(function(n){var o=J1(n,2),r=o[0],i=o[1];r.indexOf("-")===0?e[r.substring(1)]=Zw(i):typeof i=="string"?e[r]=i:Object.prototype.toString.call(i)==="[object Object]"?e[r]=Qw(i):Array.isArray(i)?e[r]=i.map(function(a){return Qw(a)}):e[r]=i}),e}function xte(t,e,n){var o=new Map;e.nodes.forEach(function(i){var a,s={"-id":i.id};if(!((a=i.text)===null||a===void 0)&&a.value&&(s["-name"]=i.text.value),i.properties){var l=qP(n)(i.properties);Object.assign(s,l)}o.set(i.id,s),t[i.type]?Array.isArray(t[i.type])?t[i.type].push(s):t[i.type]=[t[i.type],s]:t[i.type]=s});var r=e.edges.map(function(i){var a,s,l=o.get(i.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(i.id):l["bpmn:incoming"]=[l["bpmn:incoming"],i.id]:l["bpmn:incoming"]=i.id;var f={"-id":i.id,"-sourceRef":i.sourceNodeId,"-targetRef":i.targetNodeId};if(!((a=i.text)===null||a===void 0)&&a.value&&(f["-name"]=(s=i.text)===null||s===void 0?void 0:s.value),i.properties){var h=qP(n)(i.properties);Object.assign(f,h)}return f});e.edges.forEach(function(i){var a=o.get(i.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(i.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],i.id]:a["bpmn:outgoing"]=i.id}),t[Xd.FLOW]=r}function Ote(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var o,r=n.id,i=n.pointsList.map(function(s){var l=s.x,f=s.y;return{"-x":l,"-y":f}}),a={"-id":"".concat(r,"_di"),"-bpmnElement":r,"di:waypoint":i};return!((o=n.text)===null||o===void 0)&&o.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var o,r=n.id,i=100,a=80,s=n.x,l=n.y,f=Fh.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),s-=i/2,l-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":s,"-y":l,"-width":i,"-height":a}};return!((o=n.text)===null||o===void 0)&&o.value&&(h["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),h})}function Ste(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var r=o["bpmn:process"],i=o["bpmndi:BPMNDiagram"],a=i==null?void 0:i["bpmndi:BPMNPlane"];if(!r||!a)return{nodes:e,edges:n};Object.keys(r).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=r[s];if(s===Xd.FLOW){var f=a["bpmndi:BPMNEdge"],h=(Array.isArray(f),f);n=Mte(l,h)}else{var v=a["bpmndi:BPMNShape"],b=(Array.isArray(v),v);e=e.concat(Ate(l,b,s))}}})}return{nodes:e,edges:n}}function Ate(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=e;var l=KP(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=KP(r,n,t);o.push(i)}return o}function KP(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=BI(n["-name"]),a=Fh.shapeConfigMap.get(e);a&&(o+=a.width/2,r+=a.height/2);var s;Object.entries(n).forEach(function(v){var b=J1(v,2),E=b[0],O=b[1];FI.indexOf(E)===-1&&(s||(s={}),s[E]=O)}),s&&(s=Qw(s));var l;if(i&&(l={x:o,y:r,value:i},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var f=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(f["-x"])+Number(f["-width"])/2,l.y=Number(f["-y"])+Number(f["-height"])/2}var h={id:t["-bpmnElement"],type:e,x:o,y:r,properties:s};return l&&(h.text=l),h}function Mte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(ZP(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(ZP(o,t))}return n}function ZP(t,e){var n,o=e["-name"]?BI("".concat(e["-name"])):"";if(o){var r=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(r=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var i=0;if(o.split(` `).forEach(function(E){i/g,">");return'name="'.concat(i,'"')})},e.pluginName="bpmnXmlAdapter",e})(Fh);var Tte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var o=Math.random()*16|0,r=n==="x"?o:o&3|8;return r.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),Cte=(globalThis==null?void 0:globalThis._ids)||new Tte;function Nte(){return Cte.next()}Lr("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Lr("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});Lr("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"});Lr("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var kte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Uv=function(){return Uv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Rte=ac,Dte=(function(t){kte(e,t);function e(n){var o=t.call(this)||this;return o.updatePosition=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.x,f=s.y;o.nodeModel.x=l+i/2,o.nodeModel.y=f+a/2,o.nodeModel.moveText(i/2,a/2)},o.getResize=function(r){var i=r.index,a=r.deltaX,s=r.deltaY,l=r.width,f=r.height,h=r.PCTResizeInfo,v=r.pct,b=v===void 0?1:v,E=r.freezeWidth,O=E===void 0?!1:E,w=r.freezeHeight,S=w===void 0?!1:w,M={width:l,height:f,deltaX:a,deltaY:s};if(h){var T=4,$=0,D=0;switch(i){case 0:D=(a*-1-s)/T;break;case 1:D=(a-s)/T;break;case 2:D=(a+s)/T;break;case 3:D=(a*-1+s)/T;break}D!==0&&($=Math.round(D/h.ResizeBasis.basisHeight*1e5)/1e3),h.ResizePCT.widthPCT=Math.max(Math.min(h.ResizePCT.widthPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit),h.ResizePCT.heightPCT=Math.max(Math.min(h.ResizePCT.heightPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit);var P=Math.round(h.ResizePCT.widthPCT*h.ResizeBasis.basisWidth/100),B=Math.round(h.ResizePCT.heightPCT*h.ResizeBasis.basisHeight/100);switch(i){case 0:a=l-P,s=f-B;break;case 1:a=P-l,s=f-B;break;case 2:a=P-l,s=B-f;break;case 3:a=l-P,s=B-f;break}return M.width=P,M.height=B,M.deltaX=a/b,M.deltaY=s/b,M}switch(i){case 0:M.width=O?l:l-a*b,M.height=S?f:f-s*b;break;case 1:M.width=O?l:l+a*b,M.height=S?f:f-s*b;break;case 2:M.width=O?l:l+a*b,M.height=S?f:f+s*b;break;case 3:M.width=O?l:l-a*b,M.height=S?f:f+s*b;break}return M},o.updateEdgePointByAnchors=function(){var r=o.nodeModel,i=r.id,a=r.anchors,s=o.getNodeEdges(i);s.sourceEdges.forEach(function(l){var f=a.find(function(h){return h.id===l.sourceAnchorId});f&&l.updateStartPoint({x:f.x,y:f.y})}),s.targetEdges.forEach(function(l){var f=a.find(function(h){return h.id===l.targetAnchorId});f&&l.updateEndPoint({x:f.x,y:f.y})})},o.updateRect=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.x,f=s.y,h=s.width,v=s.height,b=s.radius,E=s.PCTResizeInfo,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,$=o.index,D=w===M,P=S===T,B=o.getResize({index:$,deltaX:i,deltaY:a,width:h,height:v,PCTResizeInfo:E,pct:1,freezeWidth:D,freezeHeight:P});if(B.widthM||B.heightT){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:D?0:B.deltaX,deltaY:P?0:B.deltaY}),o.nodeModel.width=B.width,o.nodeModel.height=B.height,o.nodeModel.setProperties({nodeSize:{width:B.width,height:B.height}});var F={x:l,y:f,width:h,height:v,radius:b},I={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:b};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:F,afterNode:I})},o.updateEllipse=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.rx,f=s.ry,h=s.x,v=s.y,b=s.PCTResizeInfo,E=o.index,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,$=w===M,D=S===T,P=l,B=f,F=o.getResize({index:E,deltaX:i,deltaY:a,width:P,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.widthM/2||F.heightT/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:Uv(Uv({},I),{rx:l,ry:f}),afterNode:V})},o.updateDiamond=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.rx,f=s.ry,h=s.x,v=s.y,b=s.PCTResizeInfo,E=o.index,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,$=w===M,D=S===T,P=l,B=f,F=o.getResize({index:E,deltaX:i,deltaY:a,width:P,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.widthM/2||F.heightT/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v,rx:l,ry:f},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:I,afterNode:V})},o.eventEmit=function(r){var i=r.deltaX,a=r.deltaY,s=r.beforeNode,l=r.afterNode,f=o.nodeModel,h=f.id,v=f.modelType,b=f.type,E=Uv({id:h,modelType:v,type:b},s),O=Uv({id:h,modelType:v,type:b},l);o.graphModel.eventCenter.emit("node:resize",{preData:E,data:O,deltaX:i,deltaY:a,index:o.index,model:o.nodeModel})},o.onDragging=function(r){var i,a=r.deltaX,s=r.deltaY,l=o.graphModel.transformModel,f=o.nodeModel.modelType;i=Pte(l.fixDeltaXY(a,s),2),a=i[0],s=i[1],f===_o.RECT_NODE||f===_o.HTML_NODE?o.updateRect({deltaX:a,deltaY:s}):f===_o.ELLIPSE_NODE?o.updateEllipse({deltaX:a,deltaY:s}):f===_o.DIAMOND_NODE&&o.updateDiamond({deltaX:a,deltaY:s})},o.onDragEnd=function(){var r=o.graphModel.gridSize,i=r===void 0?1:r,a=i*Math.round(o.nodeModel.x/i),s=i*Math.round(o.nodeModel.y/i);o.nodeModel.moveTo(a,s),o.updateEdgePointByAnchors()},o.index=n.index,o.nodeModel=n.model,o.graphModel=n.graphModel,o.dragHandler=new Rte({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return e.prototype.getNodeEdges=function(n){for(var o=this.graphModel,r=o.edges,i=[],a=[],s=0;s0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nv=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=this.x-this.width/2&&i<=this.x+this.width/2&&r>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return{x:o>=this.x-this.width/2&&i<=this.x+this.width/2,y:r>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,o=t.prototype.getData.call(this);o.children=[],this.children.forEach(function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&o.children.push(i)});var r=o.properties;return r==null||delete r.groupAddable,r==null||delete r.isFolded,o},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=Nv([],Cv(this.children),!1),n.isGroup=!0;var o=n.properties;return o==null||delete o.groupAddable,o!=null&&o.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(Fte);(function(t){zI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,o=n.resizable,r=n.properties;return o&&!r.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,s=n.radius,l=n.properties,f=n.getAddableOutlineStyle;if(!l.groupAddable)return null;var h=this.props.model.getNodeStyle().strokeWidth,v=h===void 0?0:h,b=f(),E=o+v+8,O=r+v+8;return Lr("rect",t1(t1({},b),{width:E,height:O,x:i-E/2,y:a-O/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var n=this.props.model,o=n.x-n.width/2+5,r=n.y-n.height/2+5;if(!n.foldable)return null;var i=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," M").concat(o+7,",").concat(r+2," ").concat(o+7,",").concat(r+10):"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," ")});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),i])},e.prototype.getResizeShape=function(){return Lr("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(Bte);var eR=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p_=function(){return p_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vte(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(r1(t)).replace(/"/g,"'")}return o1(String(e))}var dR=` `;function J0(t,e,n){var o=cR(n),r="",i=dR+o;if(e==="-json")return"";if(e==="#text")return i+o1(String(t));if(e==="#cdata-section")return"".concat(i,"");if(e==="#comment")return"".concat(i,"");if(t!==0&&t!==!1&&!t)return"".concat(i,"<").concat(e," />");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(Vte(t),'"');if(Array.isArray(t))r+=t.map(function(f){return J0(f,e,n+1)}).join("");else if(HI(t)==="[object Object]"){var a=Object.keys(t),s="",l=t["-json"]?dR+cR(n+1)+t["-json"]:"";r+="".concat(n===0?"":i,"<").concat(e),a.forEach(function(f){f.charAt(0)==="-"?s+=J0(t[f],f,n+1):l+=J0(t[f],f,n+1)}),r+=s+(l!==""?">".concat(l).concat(i,""):" />")}else r+="".concat(i,"<").concat(e,">").concat(o1(String(t)),"");return r}function Wte(t){var e="";for(var n in t)e+=J0(t[n],n,0);return e}var Ms=function(){};Ms.ObjTree=function(){return this};Ms.ObjTree.VERSION="0.23";Ms.ObjTree.prototype.xmlDecl=` `;Ms.ObjTree.prototype.attr_prefix="-";Ms.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var r=this.parseDOM(e);return r}};Ms.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,s=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),s&&s(h)}}else o.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(l=f.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)};Ms.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};Ms.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=o):n===1?t[e]=o:n===2?t[e]=[t[e],o]:t[e][t[e].length]=o};Ms.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Ms.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(hw(e,r)){var i=e[r];r.charAt(0)!==this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<".concat(r," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" ".concat(r.substring(1),'="').concat(this.xml_escape(i),'"')}var a=o.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<".concat(t).concat(a,`> `).concat(s," `):s="<".concat(t).concat(a,">").concat(s," `):s="<".concat(t).concat(a,` /> `)),s};Ms.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o"u"||r==null?n[n.length]="<".concat(t," />"):typeof r=="object"&&r.constructor===Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};Ms.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e)," `)};Ms.ObjTree.prototype.xml_escape=o1;var Gte=function(t){return new Ms.ObjTree().parseXML(t)},zte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h2=function(){return h2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zl=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xc=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o")}:{json:''.concat(o,"")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,r=e.definitionId,i=function(){return"').concat(o,"")};return{json:'".concat(i(),""):"/>")}},in:function(t,e){var n,o,r,i,a=t,s=e["-id"],l="",f="";try{for(var h=RM(Object.keys(e)),v=h.next();!v.done;v=h.next()){var b=v.value;b.includes("bpmn:")&&(r=Zl(b.split(":"),2),l=r[1],f=(i=e[b])===null||i===void 0?void 0:i["#text"])}}catch(E){n={error:E}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":f}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",r="";return e["#cdata-section"]?(r="cdata",o=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(r="normal",o=e["#text"]),{"-condition":o,"-expressionType":r}}}};function Xte(t){var e=t??{},n=e.retainedAttrsFields,o=e.excludeFields,r=e.transformer,i=new Set(Xc(Xc([],Zl(Hte),!1),Zl(n||[]),!1)),a={in:new Set(Xc(Xc([],Zl(i1.in),!1),Zl((o==null?void 0:o.in)||[]),!1)),out:new Set(Xc(Xc([],Zl(i1.out),!1),Zl((o==null?void 0:o.out)||[]),!1))};return Xu=YI(Xu,r),function(s){var l=s.nodes,f=s.edges;function h(v,b){var E,O;if((v==null?void 0:v.flag)!==1){var w;if((w=Xu[v.type])&&w.out){var S=w.out(v),M=Object.keys(S);M.length>0&&M.forEach(function(V){v[V]=S[V]})}v!=null&&v.children&&(v.children=v.children.map(function(V){var z=l.find(function(X){return X.id===V})||f.find(function(X){return X.id===V});return z||{}}));var T={};if(typeof v=="string")return v;if(Array.isArray(v))return v.map(function(V){return h(V,"")}).filter(function(V){return V!=null});try{for(var $=RM(Object.entries(v)),D=$.next();!D.done;D=$.next()){var P=Zl(D.value,2),B=P[0],F=P[1];if((F==null?void 0:F.flag)===1)return;var I=[b,B].filter(function(V){return V}).join(".");a.out.has(I)||(typeof F!="object"?B.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(B)?T[B]=F:T["-".concat(B)]=F:i.has(I)?T["-".concat(B)]=h(F,I):T[B]=h(F,I))}}catch(V){E={error:V}}finally{try{D&&!D.done&&(O=$.return)&&O.call($)}finally{if(E)throw E.error}}return T}}return h(s,"")}}function a1(t){var e,n,o={};try{for(var r=RM(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=Zl(i.value,2),s=a[0],l=a[1];s.indexOf("-")===0?o[s.substring(1)]=r1(l):typeof l=="string"?o[s]=l:Object.prototype.toString.call(l)==="[object Object]"?o[s]=a1(l):Array.isArray(l)?o[s]=l.map(function(f){return a1(f)}):o[s]=l}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}function Yte(t,e,n){var o,r=new Map,i=Xte(n)(e);i.nodes.forEach(function(s){var l=s["-id"],f=s["-type"],h=s.text,v=s.children,b=fR(s,["-id","-type","text","children"]),E={"-id":l};h!=null&&h["-value"]&&(E["-name"]=h["-value"]),b["-json"]&&(E["-json"]=b["-json"]),b["-properties"]&&Object.assign(E,b["-properties"]),v&&(E.children=v),t[f]||(t[f]=[]),t[f].push(E),r.set(l,E)});var a=i.edges.map(function(s){var l=s["-id"],f=s["-sourceNodeId"],h=s["-targetNodeId"],v=s.text,b=fR(s,["-id","-sourceNodeId","-targetNodeId","text"]),E=r.get(h);E["bpmn:incoming"]||(E["bpmn:incoming"]=[]),E["bpmn:incoming"].push(l);var O={"-id":l,"-sourceRef":f,"-targetRef":h};return v!=null&&v["-value"]&&(O["-name"]=v["-value"]),b["-json"]&&(O["-json"]=b["-json"]),b["-properties"]&&Object.assign(O,b["-properties"]),O});return e.edges.forEach(function(s){var l=s.sourceNodeId,f=s.id,h=r.get(l);h["bpmn:outgoing"]||(h["bpmn:outgoing"]=[]),h["bpmn:outgoing"].push(f)}),(o=t["bpmn:subProcess"])===null||o===void 0||o.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},f=[];s.children.forEach(function(w){var S,M=r.get(w["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function($){M[$]&&M[$].forEach(function(D){l[$].add(D)})});var T=(S=t[w["-type"]])===null||S===void 0?void 0:S.findIndex(function($){return $["-id"]===w["-id"]});T>=0&&t[w["-type"]].splice(T,1),r.delete(w["-id"]),s[w["-type"]]||(s[w["-type"]]=[]),s[w["-type"]].push(M)});var h=l["bpmn:incoming"],v=l["bpmn:outgoing"];v.forEach(function(w){h.has(w)&&f.push(w)});for(var b=function(w){var S=a.findIndex(function(M){return M["-id"]===f[w]});S>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[S]),a.splice(S,1)):w++,E=w},E,O=0;O0&&D.forEach(function(P){Reflect.set(w,P,$[P])})}})};function O(w){r.set(w["-id"],w),Array.isArray(w)?w.forEach(function(S){O(S)}):typeof w=="object"&&E(w)}O(h[b])},function(b){if(b.indexOf("bpmn:")===0){var E=h[b];if(b==="bpmn:sequenceFlow"){var O=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=Qte(E,O)}else{var w=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(b==="bpmn:boundaryEvent"){var S=h[b],M=function(T){var $=T["-attachedToRef"],D=r.get($);D["-boundaryEvents"]||(D["-boundaryEvents"]=[]),D["-boundaryEvents"].push(T["-id"])};Array.isArray(S)?S.forEach(function(T){M(T)}):M(S)}n=n.concat(Jte(E,w,b))}}}])}var v=function(b,E,O){Object.keys(b).forEach(function(w){var S=O?"".concat(O,".").concat(w):w;E.has(S)?delete b[w]:typeof b[w]=="object"&&v(b[w],E,S)})};return n.forEach(function(b){var E,O;if(!((E=e==null?void 0:e.mapping)===null||E===void 0)&&E.in){var w=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;w[S]&&(b.type=w[S])}v(b,l.in,"")}),o.forEach(function(b){var E,O;if(!((E=e==null?void 0:e.mapping)===null||E===void 0)&&E.in){var w=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;w[S]&&(b.type=w[S])}v(b,l.in,"")}),{nodes:n,edges:o}}function Jte(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=e;var l=pR(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=pR(r,n,t);o.push(i)}return o}function pR(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=qs.shapeConfigMap.get(e);s&&(o+=s.width/2,r+=s.height/2);var l={};Object.entries(n).forEach(function(b){var E=Zl(b,2),O=E[0],w=E[1];XI.includes(O)||(l[O]=w)}),l=a1(l);var f;if(a&&(f={x:o,y:r,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var h=t["bpmndi:BPMNLabel"]["dc:Bounds"];f.x=Number(h["-x"])+Number(h["-width"])/2,f.y=Number(h["-y"])+Number(h["-height"])/2}var v={id:t["-bpmnElement"],type:e,x:o,y:r,properties:l};return i&&(v.children=i),f&&(v.text=f),v}function Qte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(hR(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(hR(o,t))}return n}function hR(t,e){var n,o=e["-name"]?"".concat(e["-name"]):"";if(o){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split(` `).forEach(function(f){i0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},rne=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},By=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},fne=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pne=(function(t){cne(e,t);function e(n){var o=t.call(this,n)||this;o.textRef=W1(),o.setHoverOn=function(){var l=o.props.element;l.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),l.setHovered(!0))},o.setHoverOff=function(){var l=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),l.setHovered(!1))},o.handleMouseDown=function(l){var f,h=o.props,v=h.label,b=h.graphModel,E=b.editConfigModel.nodeTextDraggable;((f=v.draggable)!==null&&f!==void 0?f:E)&&!o.state.isDragging&&!o.state.isEditing&&o.stepDrag.handleMouseDown(l)},o.handleMouseUp=function(l){o.state.isDragging&&o.stepDrag.handleMouseUp(l)},o.handleDragging=function(l){var f=l.deltaX,h=l.deltaY;o.state.isDragging||o.setState({isDragging:!0});var v=o.props,b=v.label,E=v.graphModel,O=E.transformModel,w=fne(O.fixDeltaXY(f,h),2),S=w[0],M=w[1];o.setElementModelLabelInfo({x:b.x+S,y:b.y+M}),E.eventCenter.emit("label:drag",{data:b.getData(),model:b})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleClick=function(l){var f=o.props,h=f.label,v=f.element,b=f.graphModel;v.setSelected(!o.state.isSelected),o.setState({isSelected:!o.state.isSelected}),o.setElementModelLabelInfo({isSelected:!0}),b.eventCenter.emit("label:click",{data:h.getData(),e:l,model:v})},o.handleDbClick=function(l){var f=o.props,h=f.label,v=f.element,b=f.graphModel;if(b.eventCenter.emit("label:dblclick",{data:h.getData(),e:l,model:v}),!h.editable){v.setSelected(!0);return}if(v.setSelected(),v.setElementState(Wo.TEXT_EDIT),o.setState({isEditing:!0}),o.textRef.current){o.textRef.current.contentEditable="true",o.textRef.current.focus();var E=document.createRange(),O=window.getSelection();E.selectNodeContents(o.textRef.current),E.collapse(!1),O==null||O.removeAllRanges(),O==null||O.addRange(E)}},o.handleBlur=function(l){var f=o.props,h=f.label,v=f.element,b=f.graphModel.eventCenter;b.emit("label:blur",{e:l,model:v,data:h.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1,isSelected:!1})},o.handleInput=function(l){var f=o.props,h=f.label,v=f.graphModel;v.eventCenter.emit("label:input",{e:l,data:h.getData()})},o.reCalcLabelSize=function(){};var r=n.label,i=n.graphModel,a=i.gridSize,s=i.eventCenter;return o.stepDrag=new ac({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:r,eventCenter:s}),o.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},o}return e.prototype.setElementModelLabelInfo=function(n){var o=this.props,r=o.label,i=o.element,a=o.graphModel,s=i.properties._label,l=s,f=Wj(l,function(b){return b.id===r.id}),h=l[f];l[f]=h_(h_({},h),n);var v=a.getElement(i.id);v==null||v.setProperty("_label",l)},e.prototype.componentDidMount=function(){var n=this,o=this.props,r=o.label,i=o.element,a=o.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,f,h,v,b=s.data;if(((b==null?void 0:b.type)!=="label"||b.type==="label"&&b.id!==r.id||n.state.isSelected)&&n.setState({isSelected:!1}),((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.state.isEditing){n.setState({isEditing:!1});var E=(f=(l=n.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&f!==void 0?f:"",O=(v=(h=n.textRef.current)===null||h===void 0?void 0:h.innerHTML)!==null&&v!==void 0?v:"";n.setElementModelLabelInfo({value:E,content:O,isSelected:!1}),i.setElementState(Wo.DEFAULT)}((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,o=this.props,r=o.label,i=o.element,a=o.graphModel,s=this.state,l=s.isDragging,f=s.isHovered,h=s.isSelected,v=s.isEditing,b=a.transformModel,E=b.getTransformStyle().transform,O=r.id,w=r.x,S=r.y,M=r.zIndex,T=r.vertical,$=r.style,D=r.rotate,P=r.content,B=r.labelWidth,F=r.textOverflowMode,I=B??(i.BaseType==="node"?i.width-20:80),V={left:"".concat(w-I/2,"px"),top:"".concat(S-10,"px"),width:"".concat(I,"px"),height:"20px",zIndex:M??1,transform:D?"".concat(E," rotate(").concat(D,"deg)"):"".concat(E," rotate(").concat(T?-.25:0,"turn)")};return $t("div",{id:"element-container-".concat(O),className:ZA("lf-label-editor-container"),style:V,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:$t("div",{ref:this.textRef,id:"editor-container-".concat(O),className:ZA("lf-label-editor",(n={"lf-label-editor-dragging":l,"lf-label-editor-editing":v,"lf-label-editor-hover":!v&&(f||h)},n["lf-label-editor-".concat(F)]=!v,n)),onInput:this.handleInput,style:h_({maxWidth:"".concat(I,"px"),boxSizing:"border-box",display:"inline-block",background:v||i.BaseType==="edge"?"#fff":"transparent"},$),dangerouslySetInnerHTML:{__html:P}})})},e=dne([xs],e),e})(ko),Vu=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},hne=wh,vne=(function(){function t(e,n,o){var r;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=o,this.id=(r=e.id)!==null&&r!==void 0?r:hne(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){Xo(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:Hc(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},Vu([Ut],t.prototype,"x",void 0),Vu([Ut],t.prototype,"y",void 0),Vu([Ut],t.prototype,"content",void 0),Vu([Ut],t.prototype,"value",void 0),Vu([Ut],t.prototype,"rotate",void 0),Vu([Ut],t.prototype,"style",void 0),Vu([Ut],t.prototype,"zIndex",void 0),Vu([Ut],t.prototype,"vertical",void 0),Vu([Ut],t.prototype,"editable",void 0),Vu([Ut],t.prototype,"draggable",void 0),Vu([Ut],t.prototype,"labelWidth",void 0),Vu([Ut],t.prototype,"textOverflowMode",void 0),t})(),Q0={exports:{}},vS=Q0.exports,mR;function mne(){return mR||(mR=1,(function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(e){if("Element"in e){var n="classList",o="prototype",r=e.Element[o],i=Object,a=String[o].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[o].indexOf||function(O){for(var w=0,S=this.length;w1?I:this.data.length),V,this.encoding)},f.toString=function(){return"[object Blob]"},f.close=function(){this.size=0,delete this.data},a})(e);e.Blob=function(r,i){var a=i&&i.type||"",s=new n;if(r)for(var l=0,f=r.length;l-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,f){var h=s.getKeyCode(l);return Array.isArray(f)===!1?h===f:f.indexOf(h)!==-1},getKeyCode:function(l){var f=l.which;return f===null&&(f=l.charCode!==null?l.charCode:l.keyCode),f},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var f=[!0].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},defaults:function(){var f=[!1].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},createLink:function(l,f,h,v){var b=l.createElement("a");return s.moveTextRangeIntoElement(f[0],f[f.length-1],b),b.setAttribute("href",h),v&&(v==="_blank"&&b.setAttribute("rel","noopener noreferrer"),b.setAttribute("target",v)),b},findOrCreateMatchingTextNodes:function(l,f,h){for(var v=l.createTreeWalker(f,NodeFilter.SHOW_ALL,null,!1),b=[],E=0,O=!1,w=null,S=null;(w=v.nextNode())!==null;)if(!(w.nodeType>3))if(w.nodeType===3){if(!O&&h.starth.end+1)throw new Error("PerformLinking overshot the target!");O&&b.push(S||w),E+=w.nodeValue.length,S!==null&&(E+=S.nodeValue.length,v.nextNode()),S=null}else w.tagName.toLowerCase()==="img"&&(!O&&h.start<=E&&(O=!0),O&&b.push(w));return b},splitStartNodeIfNeeded:function(l,f,h){return f!==h?l.splitText(f-h):null},splitEndNodeIfNeeded:function(l,f,h,v){var b,E;b=v+l.nodeValue.length+(f?f.nodeValue.length:0)-1,E=h-v-(f?l.nodeValue.length:0),b>=h&&v!==b&&E!==0&&(f||l).splitText(E)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var f=[],h=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(h).length===0)return[l];for(var v=0;v0)break;E=O.nextNode()}return E},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var f=l.previousSibling;!f&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,f=l.previousSibling;return f},isDescendant:function(f,h,v){if(!f||!h)return!1;if(f===h)return!!v;if(f.nodeType!==1)return!1;if(r||h.nodeType!==3)return f.contains(h);for(var b=h.parentNode;b!==null;){if(b===f)return!0;b=b.parentNode}return!1},isElement:function(f){return!!(f&&f.nodeType===1)},throttle:function(l,f){var h=50,v,b,E,O=null,w=0,S=function(){w=Date.now(),O=null,E=l.apply(v,b),O||(v=b=null)};return!f&&f!==0&&(f=h),function(){var M=Date.now(),T=f-(M-w);return v=this,b=arguments,T<=0||T>f?(O&&(clearTimeout(O),O=null),w=M,E=l.apply(v,b),O||(v=b=null)):O||(O=setTimeout(S,T)),E}},traverseUp:function(l,f){if(!l)return!1;do{if(l.nodeType===1){if(f(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},insertHTMLCommand:function(l,f){var h,v,b,E,O,w,S,M=!1,T=["insertHTML",!1,f];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,T)}catch{}if(h=l.getSelection(),h.rangeCount){if(v=h.getRangeAt(0),S=v.commonAncestorContainer,s.isMediumEditorElement(S)&&!S.firstChild)v.selectNode(S.appendChild(l.createTextNode("")));else if(S.nodeType===3&&v.startOffset===0&&v.endOffset===S.nodeValue.length||S.nodeType!==3&&S.innerHTML===v.toString()){for(;!s.isMediumEditorElement(S)&&S.parentNode&&S.parentNode.childNodes.length===1&&!s.isMediumEditorElement(S.parentNode);)S=S.parentNode;v.selectNode(S)}for(v.deleteContents(),b=l.createElement("div"),b.innerHTML=f,E=l.createDocumentFragment();b.firstChild;)O=b.firstChild,w=E.appendChild(O);v.insertNode(E),w&&(v=v.cloneRange(),v.setStartAfter(w),v.collapse(!0),e.selection.selectRange(l,v)),M=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(T,M),M},execFormatBlock:function(l,f){var h=s.getTopBlockContainer(e.selection.getSelectionStart(l)),v;if(f==="blockquote"){if(h&&(v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return s.isBlockContainer(b)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,f)}if(h&&f===h.nodeName.toLowerCase()&&(f="p"),s.isIE&&(f="<"+f+">"),h&&h.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&f==="

")return l.execCommand("outdent",!1,f);if((s.isFF||s.isEdge)&&f==="p")return v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return!s.isBlockContainer(b)})&&l.execCommand("formatBlock",!1,f),l.execCommand("outdent",!1,f)}return l.execCommand("formatBlock",!1,f)},setTargetBlank:function(l,f){var h,v=f||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),h=0;hv?(b=b.parentNode,h-=1):(E=E.parentNode,v-=1);for(;b!==E;)b=b.parentNode,E=E.parentNode;return b},isElementAtBeginningOfBlock:function(l){for(var f,h;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(h=l;h=h.previousSibling;)if(f=h.nodeType===3?h.nodeValue:h.textContent,f.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(f){return s.isMediumEditorElement(f)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(f){return s.isBlockContainer(f)||s.isMediumEditorElement(f)})},getTopBlockContainer:function(l){var f=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(h){return s.isBlockContainer(h)&&(f=h),!f&&s.isMediumEditorElement(h)?(f=h,!0):!1}),f},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(h){return s.emptyElementNames.indexOf(h.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var f=l.querySelector("th, td");f&&(l=f)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var f=0;f0){var l=s.getRangeAt(0),f=l.cloneRange(),h;f.selectNodeContents(r),f.setEnd(l.startContainer,l.startOffset),h=f.toString().length,a={start:h,end:h+l.toString().length},this.doesRangeStartWithImages(l,i)&&(a.startsWithImage=!0);var v=this.getTrailingImageCount(r,a,l.endContainer,l.endOffset);if(v&&(a.trailingImageCount=v),h!==0){var b=this.getIndexRelativeToAdjacentEmptyBlocks(i,r,l.startContainer,l.startOffset);b!==-1&&(a.emptyBlocksIndex=b)}}return a},importSelection:function(r,i,a,s){if(!(!r||!i)){var l=a.createRange();l.setStart(i,0),l.collapse(!0);var f=i,h=[],v=0,b=!1,E=!1,O=0,w=!1,S,M=!1,T=null;for((s||r.startsWithImage||typeof r.emptyBlocksIndex<"u")&&(M=!0);!w&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!E)S=v+f.length,!b&&r.start>=v&&r.start<=S&&(M||r.start=v&&r.end<=S&&(r.trailingImageCount?E=!0:(l.setEnd(f,r.end-v),w=!0)),v=S;else{if(r.trailingImageCount&&E&&(f.nodeName.toLowerCase()==="img"&&O++,O===r.trailingImageCount)){for(var $=0;f.parentNode.childNodes[$]!==f;)$++;l.setEnd(f.parentNode,$+1),w=!0}if(!w&&f.nodeType===1)for(var D=f.childNodes.length-1;D>=0;)h.push(f.childNodes[D]),D-=1}w||(f=h.pop())}!b&&T&&(l.setStart(T,T.length),l.setEnd(T,T.length)),typeof r.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,i,r.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(r,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(r,i){var a=function(v){return v.nodeName.toLowerCase()==="a"};if(r.start===r.end&&i.startContainer.nodeType===3&&i.startOffset===i.startContainer.nodeValue.length&&e.util.traverseUp(i.startContainer,a)){for(var s=i.startContainer,l=i.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var f=null,h=0;f===null&&h0)break;return v||(v=h),s.setStart(e.util.getFirstSelectableLeafNode(v),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(r,i,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var f=e.util.findPreviousSibling(l);if(f){if(f.nodeValue)return-1}else return-1}for(var h=e.util.getClosestBlockContainer(a),v=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),b=0;v.nextNode();){var E=v.currentNode.textContent==="";if((E||b>0)&&(b+=1),v.currentNode===h)return b;E||(b=0)}return b},doesRangeStartWithImages:function(r,i){if(r.startOffset!==0||r.startContainer.nodeType!==1)return!1;if(r.startContainer.nodeName.toLowerCase()==="img")return!0;var a=r.startContainer.querySelector("img");if(!a)return!1;for(var s=i.createTreeWalker(r.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(r,i,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var f=r,h=[],v=0,b=!1,E=!1,O=!1,w,S=0;!O&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!E)S=0,w=v+f.length,!b&&i.start>=v&&i.start<=w&&(b=!0),b&&i.end>=v&&i.end<=w&&(E=!0),v=w;else if(f.nodeName.toLowerCase()==="img"&&S++,f===l)O=!0;else if(f.nodeType===1)for(var M=f.childNodes.length-1;M>=0;)h.push(f.childNodes[M]),M-=1;O||(f=h.pop())}return S},selectionContainsContent:function(r){var i=r.getSelection();if(!i||i.isCollapsed||!i.rangeCount)return!1;if(i.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(i.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(r){var i,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(i=!0),s.nodeName!=="#text"&&l==="false"},r);return!i&&a},getSelectionHtml:function(i){var a,s="",l=i.getSelection(),f,h;if(l.rangeCount){for(h=i.createElement("div"),a=0,f=l.rangeCount;a-1?[r]:r,Array.prototype.forEach.call(r,(function(h){h.addEventListener(i,a,s),this.events.push([h,i,a,s])}).bind(this))},detachDOMEvent:function(r,i,a,s){var l,f,h=this.base.options.contentWindow,v=this.base.options.ownerDocument;r&&(r=e.util.isElement(r)||[h,v].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(b){l=this.indexOfListener(b,i,a,s),l!==-1&&(f=this.events.splice(l,1)[0],f[0].removeEventListener(f[1],f[2],f[3]))}).bind(this)))},indexOfListener:function(r,i,a,s){var l,f,h;for(l=0,f=this.events.length;l0&&(r=i.indexOf(o.nodeName.toLowerCase())!==-1),!r&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(o,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(r=s.indexOf(l)!==-1,(r||this.style.prop!=="text-decoration")&&(this.knownState=r))},this)),r)}});n.isBuiltInButton=function(o){return typeof o=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(o)},e.extensions.button=n})(),(function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"B",contentFA:''},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"I",contentFA:''},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"U",contentFA:''},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"A",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"html",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}})(),(function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.hideToolbarDefaultActions()},setToolbarPosition:function(){var o=this.base.getExtensionByName("toolbar");o&&o.setToolbarPosition()}});e.extensions.form=n})(),(function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"#",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=e.selection.getSelectionRange(this.document);return r.startContainer.nodeName.toLowerCase()==="a"||r.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(r),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(o){e.util.isKey(o,e.util.keyCode.K)&&e.util.isMetaCtrlKey(o)&&!o.shiftKey&&this.handleClick(o)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var o=[''];return o.push('',this.getEditorOption("buttonLabels")==="fontawesome"?'':this.formSaveLabel,""),o.push('',this.getEditorOption("buttonLabels")==="fontawesome"?'':this.formCloseLabel,""),this.targetCheckbox&&o.push('

','','","
"),this.customClassOption&&o.push('
','',"","
"),o.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(o){var r=this.getInput(),i=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(o=o||{value:""},typeof o=="string"&&(o={value:o}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),r.value=o.value,r.focus(),i&&(i.checked=o.target==="_blank"),a){var s=o.buttonClass?o.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var o=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox(),i={value:this.getInput().value.trim()};return this.linkValidation&&(i.value=this.checkLinkFormat(i.value)),i.target="_self",o&&o.checked&&(i.target="_blank"),r&&r.checked&&(i.buttonClass=this.customClassOption),i},doFormSave:function(){var o=this.getFormOpts();this.completeFormSave(o)},completeFormSave:function(o){this.base.restoreSelection(),this.execAction(this.action,o),this.base.checkSelection()},ensureEncodedUri:function(o){return o===decodeURI(o)?encodeURI(o):o},ensureEncodedUriComponent:function(o){return o===decodeURIComponent(o)?encodeURIComponent(o):o},ensureEncodedParam:function(o){var r=o.split("="),i=r[0],a=r[1];return i+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(o){return o.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(o){var r=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,i=r.test(o),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=o.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),f=l[1],h=l[2],v=l[3];if(s.test(o))return"tel:"+o;if(!i){var b=f.split("/")[0];(b.match(/.+(\.|:).+/)||b==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(f)+(h===void 0?"":"?"+this.ensureEncodedQuery(h))+(v===void 0?"":"#"+v)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(o){var r=o.querySelector(".medium-editor-toolbar-close"),i=o.querySelector(".medium-editor-toolbar-save"),a=o.querySelector(".medium-editor-toolbar-input");this.on(o,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(r,"click",this.handleCloseClick.bind(this)),this.on(i,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var o=this.document,r=o.createElement("div");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),r.innerHTML=this.getTemplate(),this.attachFormEvents(r),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(o){if(o.keyCode===e.util.keyCode.ENTER){o.preventDefault(),this.doFormSave();return}o.keyCode===e.util.keyCode.ESCAPE&&(o.preventDefault(),this.doFormCancel())},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n})(),(function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var o=this.document.createElement("div");return o.id="medium-editor-anchor-preview-"+this.getEditorId(),o.className="medium-editor-anchor-preview",o.innerHTML=this.getTemplate(),this.on(o,"click",this.handleClick.bind(this)),o},getTemplate:function(){return'
'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(o){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||o.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=o.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=o.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=o,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(o){o=o||this.activeAnchor;var r=this.window.innerWidth,i=this.anchorPreview.offsetHeight,a=o.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,f=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,v={},b,E,O,w,S;b=this.anchorPreview.offsetWidth/2;var M=this.base.getExtensionByName("toolbar");M&&(s=M.diffLeft,l=M.diffTop),E=s-b,h?(w=f.getBoundingClientRect(),["top","left"].forEach(function(T){v[T]=a[T]-w[T]}),v.width=a.width,v.height=a.height,a=v,r=w.width,S=f.scrollTop):S=this.window.pageYOffset,O=a.left+a.width/2,S+=i+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(S)+"px",this.anchorPreview.style.right="initial",Othis.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n})(),(function(){var n,o,r,i,a;n=[" "," ",` `,"\r"," "," "," "," "," ","\u2028","\u2029"],o="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",r="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+o+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+o+"))",i=new RegExp("^("+o+")$","i"),a=new RegExp(r,"gi");function s(f){return!e.util.getClosestTag(f,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var f=0,h=0;h0&&w!==null;)E=v.currentNode,O=E.nodeValue,O.length>h?(w=E.splitText(O.length-h),h=0):(w=v.previousNode(),h-=O.length);return w},performLinkingWithinElement:function(f){for(var h=this.findLinkableText(f),v=!1,b=0;b1;)b.appendChild(v.childNodes[1])}});e.extensions.autoLink=l})(),(function(){var n="medium-editor-dragover";function o(i){var a=e.util.getContainerEditorElement(i),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var r=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(i){i.preventDefault(),i.dataTransfer.dropEffect="copy";var a=i.target.classList?i.target:i.target.parentElement;o(a),i.type==="dragover"&&a.classList.add(n)},handleDrop:function(i){i.preventDefault(),i.stopPropagation(),this.base.selectElement(i.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),i.dataTransfer.files&&Array.prototype.slice.call(i.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),o(i.target)},isAllowedFile:function(i){return this.allowedTypes.some(function(a){return!!i.type.match(a)})},insertImageFile:function(i){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(i),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=r})(),(function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(o){var r=o.key.charCodeAt(0);this.keys[r]||(this.keys[r]=[]),this.keys[r].push(o)},this)},handleKeydown:function(o){var r=e.util.getKeyCode(o);if(this.keys[r]){var i=e.util.isMetaCtrlKey(o),a=!!o.shiftKey,s=!!o.altKey;this.keys[r].forEach(function(l){l.meta===i&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(o.preventDefault(),o.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontName")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(o){var r=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("select"),a=o.createElement("a"),s=o.createElement("a"),l;r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this));for(var f=0;f
':"✓",r.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("face")&&o.removeAttribute("face")})},handleFontChange:function(){var o=this.getSelect().value;o===""?this.clearFontName():this.execAction("fontName",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n})(),(function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontSize")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(o){var r=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("input"),a=o.createElement("a"),s=o.createElement("a");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this)),i.setAttribute("type","range"),i.setAttribute("min","1"),i.setAttribute("max","7"),i.className="medium-editor-toolbar-input",r.appendChild(i),this.on(i,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"✓",r.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("size")&&o.removeAttribute("size")})},handleSliderChange:function(){var o=this.getInput().value;o==="4"?this.clearFontSize():this.execAction("fontSize",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",o=null,r=null,i=function(f){f.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/|/g),""],[new RegExp(/
$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(]*>)?$/gi),""],[new RegExp(/\s+<\/span>/g)," "],[new RegExp(/
/g),"
"],[new RegExp(/]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),''],[new RegExp(/]*font-style:italic[^>]*>/gi),''],[new RegExp(/]*font-weight:(bold|700)[^>]*>/gi),''],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),''],[new RegExp(/<\/p>\n+/gi),"

"],[new RegExp(/\n+

/gi),""],[new RegExp(/(((?!/gi),"$1"]]}function s(f,h,v){var b=f.clipboardData||h.clipboardData||v.dataTransfer,E={};if(!b)return E;if(b.getData){var O=b.getData("Text");O&&O.length>0&&(E["text/plain"]=O)}if(b.types)for(var w=0;w1)for(O=0;O"+e.util.htmlEntities(b[O])+"

");else E=e.util.htmlEntities(b[0]);e.util.insertHTMLCommand(this.document,E)}},handlePasteBinPaste:function(f){if(f.defaultPrevented){this.removePasteBin();return}var h=s(f,this.window,this.document),v=h["text/html"],b=h["text/plain"],E=r;if(!this.cleanPastedHTML||v){f.preventDefault(),this.removePasteBin(),this.doPaste(v,b,E),this.trigger("editablePaste",{currentTarget:E,target:E},E);return}setTimeout((function(){this.cleanPastedHTML&&(v=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(v,b,E),this.trigger("editablePaste",{currentTarget:E,target:E},E)}).bind(this),0)},handleKeydown:function(f,h){e.util.isKey(f,e.util.keyCode.V)&&e.util.isMetaCtrlKey(f)&&(f.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(h))},createPasteBin:function(f){var h,v=e.selection.getSelectionRange(this.document),b=this.window.pageYOffset;r=f,v&&(h=v.getClientRects(),h.length?b+=h[0].top:v.startContainer.getBoundingClientRect!==void 0?b+=v.startContainer.getBoundingClientRect().top:b+=v.getBoundingClientRect().top),o=v;var E=this.document.createElement("div");E.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),E.setAttribute("style","border: 1px red solid; position: absolute; top: "+b+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),E.setAttribute("contentEditable",!0),E.innerHTML=n,this.document.body.appendChild(E),this.on(E,"focus",i),this.on(E,"focusin",i),this.on(E,"focusout",i),E.focus(),e.selection.selectNode(E,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(E,"paste",this.boundHandlePaste)},removePasteBin:function(){o!==null&&(e.selection.selectRange(this.document,o),o=null),r!==null&&(r=null);var f=this.getPasteBin();f&&f&&(this.off(f,"focus",i),this.off(f,"focusin",i),this.off(f,"focusout",i),this.off(f,"paste",this.boundHandlePaste),f.parentElement.removeChild(f))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var f=this.getPasteBin();if(!f||f.firstChild&&f.firstChild.id==="mcepastebin")return!1;var h=f.innerHTML;return!h||h===n?!1:h},cleanPaste:function(f){var h,v,b,E,O=/"+f.split("

").join("

")+"

",v=b.querySelectorAll("a,p,div,br"),h=0;h"+v.innerHTML+"
":b.innerHTML=v.innerHTML,v.parentNode.replaceChild(b,v);for(E=f.querySelectorAll("span"),h=0;h0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),o},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(o){if(o&&o.target&&e.util.isDescendant(this.getToolbarElement(),o.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(o){o.hasForm&&o.isDisplayed()&&o.hideForm()})},multipleBlockElementsSelected:function(){var o=/<[^\/>][^>]*><\/[^>]+>/gim,r=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),i=e.selection.getSelectionHtml(this.document).replace(o,""),a=i.match(r);return!!a&&a.length>1},modifySelection:function(){var o=this.window.getSelection(),r=o.getRangeAt(0);if(this.standardizeSelectionStart&&r.startContainer.nodeValue&&r.startOffset===r.startContainer.nodeValue.length){var i=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),r.startContainer,this.document);if(i){for(var a=0;i.nodeValue.substr(a,1).trim().length===0;)a=a+1;r=e.selection.select(this.document,i,a,r.endContainer,r.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var o=e.selection.getSelectionElement(this.window);if(!o||this.getEditorElements().indexOf(o)===-1||o.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(o){typeof o.isActive=="function"&&typeof o.setInactive=="function"&&o.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var o=[],r=null,i=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(i&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(r=l.queryCommandState(),r!==null)){r&&typeof l.setActive=="function"&&l.setActive();return}o.push(l)}),a=e.selection.getSelectedParentElement(i),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(o.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var o=this.base.getFocusedElement(),r=this.window.getSelection();if(!o)return this;(this.static||!r.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(o):this.positionToolbar(r)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(o){this.getToolbarElement().style.left="0";var r=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,i=this.window.innerWidth,a=this.getToolbarElement(),s=o.getBoundingClientRect(),l=s.top+r,f=s.left+s.width/2,h=a.offsetHeight,v=a.offsetWidth,b=v/2,E;switch(this.sticky?r>l+o.offsetHeight-h-this.stickyTopOffset?(a.style.top=l+o.offsetHeight-h+"px",a.classList.remove("medium-editor-sticky-toolbar")):r>l-h-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-h+"px"):a.style.top=l-h+"px",this.align){case"left":E=s.left;break;case"right":E=s.right-v;break;case"center":E=f-b;break}E<0?E=0:E+v>i&&(E=i-Math.ceil(v)-1),a.style.left=E+"px"},positionToolbar:function(o){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var r=o.getRangeAt(0),i=r.getBoundingClientRect();(!i||i.height===0&&i.width===0&&r.startContainer===r.endContainer)&&(r.startContainer.nodeType===1&&r.startContainer.querySelector("img")?i=r.startContainer.querySelector("img").getBoundingClientRect():i=r.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,f=s.offsetWidth,h=f/2,v=50,b=this.diffLeft-h,E=this.getEditorOption("elementsContainer"),O=["absolute","fixed"].indexOf(window.getComputedStyle(E).getPropertyValue("position"))>-1,w={},S={},M,T;O?(T=E.getBoundingClientRect(),["top","left"].forEach(function($){S[$]=i[$]-T[$]}),S.width=i.width,S.height=i.height,i=S,a=T.width,w.top=E.scrollTop):w.top=this.window.pageYOffset,M=i.left+i.width/2,w.top+=i.top-l,i.top'),s.onload=(function(){var f=this.document.getElementById(l);f&&(f.removeAttribute("id"),f.removeAttribute("class"),f.src=s.result)}).bind(this)}}).bind(this))),o.target.classList.remove(r)}});e.extensions.imageDragging=n})(),(function(){function n(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q.textContent,ie=e.selection.getCaretOffsets(Q);(J[ie.left-1]===void 0||J[ie.left-1].trim()===""||J[ie.left]!==void 0&&J[ie.left].trim()==="")&&W.preventDefault()}function o(W,Q){if(this.options.disableReturn||Q.getAttribute("data-disable-return"))W.preventDefault();else if(this.options.disableDoubleReturn||Q.getAttribute("data-disable-double-return")){var J=e.selection.getSelectionStart(this.options.ownerDocument);(J&&J.textContent.trim()===""&&J.nodeName.toLowerCase()!=="li"||J.previousElementSibling&&J.previousElementSibling.nodeName.toLowerCase()!=="br"&&J.previousElementSibling.textContent.trim()==="")&&W.preventDefault()}}function r(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q&&Q.nodeName.toLowerCase();J==="pre"&&(W.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(Q)&&(W.preventDefault(),W.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(W){var Q,J=e.selection.getSelectionStart(this.options.ownerDocument),ie=J.nodeName.toLowerCase(),Se=/^(\s+|)?$/i,Ae=/h\d/i;e.util.isKey(W,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&J.previousElementSibling&&Ae.test(ie)&&e.selection.getCaretOffsets(J).left===0?e.util.isKey(W,e.util.keyCode.BACKSPACE)&&Se.test(J.previousElementSibling.innerHTML)?(J.previousElementSibling.parentNode.removeChild(J.previousElementSibling),W.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(W,e.util.keyCode.ENTER)&&(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="
",J.previousElementSibling.parentNode.insertBefore(Q,J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.DELETE)&&J.nextElementSibling&&J.previousElementSibling&&!Ae.test(ie)&&Se.test(J.innerHTML)&&Ae.test(J.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,J.nextElementSibling),J.previousElementSibling.parentNode.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&ie==="li"&&Se.test(J.innerHTML)&&!J.previousElementSibling&&!J.parentElement.previousElementSibling&&J.nextElementSibling&&J.nextElementSibling.nodeName.toLowerCase()==="li"?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="
",J.parentElement.parentElement.insertBefore(Q,J.parentElement),e.selection.moveCursor(this.options.ownerDocument,Q),J.parentElement.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).left===0?(W.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(W,e.util.keyCode.ENTER)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).right===0?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="
",J.parentElement.insertBefore(Q,J.nextSibling),e.selection.moveCursor(this.options.ownerDocument,Q),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(J.parentElement)&&!J.previousElementSibling&&J.nextElementSibling&&Se.test(J.innerHTML)&&(W.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,J.nextSibling),J.parentElement.removeChild(J))}function a(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J;Q&&(e.util.isMediumEditorElement(Q)&&Q.children.length===0&&!e.util.isBlockContainer(Q)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(W,e.util.keyCode.ENTER)&&!e.util.isListItem(Q)&&!e.util.isBlockContainer(Q)&&(J=Q.nodeName.toLowerCase(),J==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!W.shiftKey&&!W.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(W,Q){var J=Q.parentNode.querySelector('textarea[medium-editor-textarea-id="'+Q.getAttribute("medium-editor-textarea-id")+'"]');J&&(J.value=Q.innerHTML.trim())}function l(W){W._mediumEditors||(W._mediumEditors=[null]),this.id||(this.id=W._mediumEditors.length),W._mediumEditors[this.id]=this}function f(W){!W._mediumEditors||!W._mediumEditors[this.id]||(W._mediumEditors[this.id]=null)}function h(W,Q,J){var ie=[];if(W||(W=[]),typeof W=="string"&&(W=Q.querySelectorAll(W)),e.util.isElement(W)&&(W=[W]),J)for(var Se=0;Se=0&&(J=e.selection.exportSelection(W,this.options.ownerDocument)),J!==null&&Q!==0&&(J.editableElementIndex=Q),J},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(W,Q){if(W){var J=this.elements[W.editableElementIndex||0];e.selection.importSelection(W,J,this.options.ownerDocument,Q)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(W){var Q=e.selection.getSelectionElement(this.options.contentWindow),J={},ie;if(this.elements.indexOf(Q)!==-1){try{if(this.events.disableCustomEvent("editableInput"),W.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),ie=W.url||W.value,ie&&ie.trim().length>0){var Se=this.options.contentWindow.getSelection();if(Se){var Ae=Se.getRangeAt(0),Pe=Ae.commonAncestorContainer,De,ze,Ye,Be;if(Ae.endContainer.nodeType===3&&Ae.startContainer.nodeType!==3&&Ae.startOffset===0&&Ae.startContainer.firstChild===Ae.endContainer&&(Pe=Ae.endContainer),ze=e.util.getClosestBlockContainer(Ae.startContainer),Ye=e.util.getClosestBlockContainer(Ae.endContainer),Pe.nodeType!==3&&Pe.textContent.length!==0&&ze===Ye){var Je=ze||Q,gt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),De=this.exportSelection(),gt.appendChild(Je.cloneNode(!0)),Q===Je?e.selection.select(this.options.ownerDocument,Je.firstChild,0,Je.lastChild,Je.lastChild.nodeType===3?Je.lastChild.nodeValue.length:Je.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,Je,0,Je,Je.childNodes.length);var le=this.exportSelection();Be=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,gt,{start:De.start-le.start,end:De.end-le.start,editableElementIndex:De.editableElementIndex}),Be.length===0&&(gt=this.options.ownerDocument.createDocumentFragment(),gt.appendChild(Pe.cloneNode(!0)),Be=[gt.firstChild.firstChild,gt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Be,ie.trim());var Ze=(gt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,gt.firstChild.innerHTML.replace(/^\s+/,"")),De.start-=Ze,De.end-=Ze,this.importSelection(De)}else this.options.ownerDocument.execCommand("createLink",!1,ie);this.options.targetBlank||W.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie),W.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),W.buttonClass)}}if(this.options.targetBlank||W.target==="_blank"||W.buttonClass){J=this.options.ownerDocument.createEvent("HTMLEvents"),J.initEvent("input",!0,!0,this.options.contentWindow);for(var pe=0,se=this.elements.length;pe1?o[1]:"";return{major:parseInt(r[0],10),minor:parseInt(r[1],10),revision:parseInt(r[2],10),preRelease:i,toString:function(){return[r[0],r[1],r[2]].join(".")+(i?"-"+i:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Q0)),Q0.exports}var gne=mne();const D0=Z_(gne);/*! * vanilla-picker v2.12.3 * https://vanilla-picker.js.org * * Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) * Released under the ISC license. */var DM=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},jM=(function(){function t(e,n){for(var o=0;o1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var _ne=(function(){function t(e,n,o,r){DM(this,t);var i=this;function a(l){if(l.startsWith("hsl")){var f=l.match(/([\-\d\.e]+)/g).map(Number),h=j0(f,4),v=h[0],b=h[1],E=h[2],O=h[3];O===void 0&&(O=1),v/=360,b/=100,E/=100,i.hsla=[v,b,E,O]}else if(l.startsWith("rgb")){var w=l.match(/([\-\d\.e]+)/g).map(Number),S=j0(w,4),M=S[0],T=S[1],$=S[2],D=S[3];D===void 0&&(D=1),i.rgba=[M,T,$,D]}else l.startsWith("#")?i.rgba=t.hexToRgb(l):i.rgba=t.nameToRgb(l)||t.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(o===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,n,o,r===void 0?1:r]}return jM(t,[{key:"printRGB",value:function(n){var o=n?this.rgba:this.rgba.slice(0,3),r=o.map(function(i,a){return gR(i,a===3?3:0)});return n?"rgba("+r+")":"rgb("+r+")"}},{key:"printHSL",value:function(n){var o=[360,100,100,1],r=["","%","%",""],i=n?this.hsla:this.hsla.slice(0,3),a=i.map(function(s,l){return gR(s*o[l],l===3?3:1)+r[l]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var o=this.hex;return n?o:o.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,o=n.map(function(r,i){return i<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+o.map(function(r){return r.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var o=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!o.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var r=o.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(i){return parseInt(i,16)});return r[3]=r[3]/255,r}},{key:"nameToRgb",value:function(n){var o=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=yne[o];return r===void 0?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],s=o[3];r/=255,i/=255,a/=255;var l=Math.max(r,i,a),f=Math.min(r,i,a),h=void 0,v=void 0,b=(l+f)/2;if(l===f)h=v=0;else{var E=l-f;switch(v=b>.5?E/(2-l-f):E/(l+f),l){case r:h=(i-a)/E+(i1&&(T-=1),T<.16666666666666666?S+(M-S)*6*T:T<.5?M:T<.6666666666666666?S+(M-S)*(.6666666666666666-T)*6:S},b=a<.5?a*(1+i):a+i-a*i,E=2*a-b;l=v(E,b,r+1/3),f=v(E,b,r),h=v(E,b,r-1/3)}var O=[l*255,f*255,h*255].map(Math.round);return O[3]=s,O}}]),t})(),bne=(function(){function t(){DM(this,t),this._events=[]}return jM(t,[{key:"add",value:function(n,o,r){n.addEventListener(o,r,!1),this._events.push({target:n,type:o,handler:r})}},{key:"remove",value:function(n,o,r){this._events=this._events.filter(function(i){var a=!0;return n&&n!==i.target&&(a=!1),o&&o!==i.type&&(a=!1),r&&r!==i.handler&&(a=!1),a&&t._doRemove(i.target,i.type,i.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,o,r){n.removeEventListener(o,r,!1)}}]),t})();function wne(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function mS(t,e,n){var o=!1;function r(l,f,h){return Math.max(f,Math.min(l,h))}function i(l,f,h){if(h&&(o=!0),!!o){l.preventDefault();var v=e.getBoundingClientRect(),b=v.width,E=v.height,O=f.clientX,w=f.clientY,S=r(O-v.left,0,b),M=r(w-v.top,0,E);n(S/b,M/E)}}function a(l,f){var h=l.buttons===void 0?l.which:l.buttons;h===1?i(l,l,f):o=!1}function s(l,f){l.touches.length===1?i(l,l.touches[0],f):o=!1}t.add(e,"mousedown",function(l){a(l,!0)}),t.add(e,"touchstart",function(l){s(l,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",function(l){o=!1}),t.add(e,"touchend",function(l){o=!1}),t.add(e,"touchcancel",function(l){o=!1})}var Ene=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em, linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,xne=360,qI="keydown",L0="mousedown",gS="focusin";function Dd(t,e){return(e||document).querySelector(t)}function One(t){t.preventDefault(),t.stopPropagation()}function yS(t,e,n,o,r){t.add(e,qI,function(i){n.indexOf(i.key)>=0&&o(i)})}var KI=(function(){function t(e){DM(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new bne,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return jM(t,[{key:"setOptions",value:function(n){var o=this;if(!n)return;var r=this.settings;function i(f,h,v){for(var b in f)h[b]=f[b]}if(n instanceof HTMLElement)r.parent=n;else{r.parent&&n.parent&&r.parent!==n.parent&&(this._events.remove(r.parent),this._popupInited=!1),i(n,r),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var s=r.parent;if(s&&r.popup&&!this._popupInited){var l=function(h){return o.openHandler(h)};this._events.add(s,"click",l),yS(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else n.parent&&!r.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var o=n&&n.type===qI?this._domEdit:this.domElement;setTimeout(function(){return o.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var o=n&&n.type,r=!1;if(!n)r=!0;else if(o===L0||o===gS){var i=(this.__containedEvent||0)+100;n.timeStamp>i&&(r=!0)}else One(n),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",o!==L0&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,o){this.closeHandler(),this.setOptions(n),o&&this.openHandler()}},{key:"setColor",value:function(n,o){this._setColor(n,{silent:o})}},{key:"_setColor",value:function(n,o){if(typeof n=="string"&&(n=n.trim()),!!n){o=o||{};var r=void 0;try{r=new _ne(n)}catch(a){if(o.failSilently)return;throw a}if(!this.settings.alpha){var i=r.hsla;i[3]=1,r.hsla=i}this.colour=this.color=r,this._setHSLA(null,null,null,null,o)}}},{key:"setColour",value:function(n,o){this.setColor(n,o)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var o=this._toggleDOM(!0);return this._setPosition(),o}var r=this.settings.template||'
',i=wne(r);return this.domElement=i,this._domH=Dd(".picker_hue",i),this._domSL=Dd(".picker_sl",i),this._domA=Dd(".picker_alpha",i),this._domEdit=Dd(".picker_editor input",i),this._domSample=Dd(".picker_sample",i),this._domOkay=Dd(".picker_done button",i),this._domCancel=Dd(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup(function(){return i.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,o=this,r=this.domElement,i=this._events;function a(f,h,v){i.add(f,h,v)}a(r,"click",function(f){return f.preventDefault()}),mS(i,this._domH,function(f,h){return o._setHSLA(f)}),mS(i,this._domSL,function(f,h){return o._setHSLA(null,f,1-h)}),this.settings.alpha&&mS(i,this._domA,function(f,h){return o._setHSLA(null,null,null,1-h)});var s=this._domEdit;a(s,"input",function(f){o._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(f){var h=this;h.selectionStart===h.selectionEnd&&h.select()}),this._ifPopup(function(){var f=function(b){return n.closeHandler(b)};a(window,L0,f),a(window,gS,f),yS(i,r,["Esc","Escape"],f);var h=function(b){n.__containedEvent=b.timeStamp};a(r,L0,h),a(r,gS,h),a(n._domCancel,"click",f)});var l=function(h){n._ifPopup(function(){return n.closeHandler(h)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",l),yS(i,r,["Enter"],l)}},{key:"_setPosition",value:function(){var n=this.settings.parent,o=this.domElement;n!==o.parentNode&&n.appendChild(o),this._ifPopup(function(r){getComputedStyle(n).position==="static"&&(n.style.position="relative");var i=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===i?o.classList.add(a):o.classList.remove(a)}),o.classList.add(i)})}},{key:"_setHSLA",value:function(n,o,r,i,a){a=a||{};var s=this.colour,l=s.hsla;[n,o,r,i].forEach(function(f,h){(f||f===0)&&(l[h]=f)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var o=this.colour,r=o.hsla,i="hsl("+r[0]*xne+", 100%, 50%)",a=o.hslString,s=o.hslaString,l=this._domH,f=this._domSL,h=this._domA,v=Dd(".picker_selector",l),b=Dd(".picker_selector",f),E=Dd(".picker_selector",h);function O(B,F,I){F.style.left=I*100+"%"}function w(B,F,I){F.style.top=I*100+"%"}O(l,v,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,O(f,b,r[1]),w(f,b,1-r[2]),f.style.color=a,w(h,E,1-r[3]);var S=a,M=S.replace("hsl","hsla").replace(")",", 0)"),T="linear-gradient("+[S,M]+")";if(this._domA.style.background=T+", "+Ene,!n.fromEditor){var $=this.settings.editorFormat,D=this.settings.alpha,P=void 0;switch($){case"rgb":P=o.printRGB(D);break;case"hsl":P=o.printHSL(D);break;default:P=o.printHex(D)}this._domEdit.value=P}this._domSample.style.color=s}},{key:"_ifPopup",value:function(n,o){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):o&&o()}},{key:"_toggleDOM",value:function(n){var o=this.domElement;if(!o)return!1;var r=n?"":"none",i=o.style.display!==r;return i&&(o.style.display=r),i}}]),t})();{var _S=document.createElement("style");_S.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(_S),KI.StyleElement=_S}var bS={exports:{}},yR;function ZI(){return yR||(yR=1,(function(t,e){(function(n,o){t.exports=n()})(function(){var n="object",o="function",r="undefined",i=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function f(le,Ze){var pe=typeof le[Ze];return pe==o||!!(pe==n&&le[Ze])||pe=="unknown"}function h(le,Ze){return!!(typeof le[Ze]==n&&le[Ze])}function v(le,Ze){return typeof le[Ze]!=r}function b(le){return function(Ze,pe){for(var se=pe.length;se--;)if(!le(Ze,pe[se]))return!1;return!0}}var E=b(f),O=b(h),w=b(v);function S(le){return le&&E(le,l)&&w(le,s)}function M(le){return h(le,"body")?le.body:le.getElementsByTagName("body")[0]}var T=[].forEach?function(le,Ze){le.forEach(Ze)}:function(le,Ze){for(var pe=0,se=le.length;pevn?(oo.node=sr,oo.offset-=vn):oo.node==ut.parentNode&&oo.offset>en(ut)&&++oo.offset;return sr}function Gt(ut){if(ut.nodeType==9)return ut;if(typeof ut.ownerDocument!=pe)return ut.ownerDocument;if(typeof ut.document!=pe)return ut.document;if(ut.parentNode)return Gt(ut.parentNode);throw Ze.createError("getDocument: no document found for node")}function Pn(ut){var vn=Gt(ut);if(typeof vn.defaultView!=pe)return vn.defaultView;if(typeof vn.parentWindow!=pe)return vn.parentWindow;throw Ze.createError("Cannot get a window object for node")}function qt(ut){if(typeof ut.contentDocument!=pe)return ut.contentDocument;if(typeof ut.contentWindow!=pe)return ut.contentWindow.document;throw Ze.createError("getIframeDocument: No Document object found for iframe element")}function On(ut){if(typeof ut.contentWindow!=pe)return ut.contentWindow;if(typeof ut.contentDocument!=pe)return ut.contentDocument.defaultView;throw Ze.createError("getIframeWindow: No Window object found for iframe element")}function ke(ut){return ut&&se.isHostMethod(ut,"setTimeout")&&se.isHostObject(ut,"document")}function Ke(ut,vn,In){var sr;if(ut?se.isHostProperty(ut,"nodeType")?sr=ut.nodeType==1&&ut.tagName.toLowerCase()=="iframe"?qt(ut):Gt(ut):ke(ut)&&(sr=ut.document):sr=document,!sr)throw vn.createError(In+"(): Parameter must be a Window object or DOM node");return sr}function Le(ut){for(var vn;vn=ut.parentNode;)ut=vn;return ut}function dt(ut,vn,In,sr){var wo,oo,ta,Ca,Yi;if(ut==In)return vn===sr?0:vn",At=Tt(vn),le.features.crashyTextNodes=At})();function En(ut){if(!ut)return"[No node]";if(At&&Tt(ut))return"[Broken node]";if(vt(ut))return'"'+ut.data+'"';if(ut.nodeType==1){var vn=ut.id?' id="'+ut.id+'"':"";return"<"+ut.nodeName+vn+">[index:"+en(ut)+",length:"+ut.childNodes.length+"]["+(ut.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return ut.nodeName}function Zn(ut){for(var vn=Gt(ut).createDocumentFragment(),In;In=ut.firstChild;)vn.appendChild(In);return vn}var ao;typeof window.getComputedStyle!=pe?ao=function(ut,vn){return Pn(ut).getComputedStyle(ut,null)[vn]}:typeof document.documentElement.currentStyle!=pe?ao=function(ut,vn){return ut.currentStyle?ut.currentStyle[vn]:""}:Ze.fail("No means of obtaining computed style properties found");function Lo(ut,vn,In){var sr=we(ut),wo=ut.createElement("div");wo.contentEditable=""+!!In,vn&&(wo.innerHTML=vn);var oo=sr.firstChild;return oo?sr.insertBefore(wo,oo):sr.appendChild(wo),wo}function yo(ut){return ut.parentNode.removeChild(ut)}function ho(ut){this.root=ut,this._next=ut}ho.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var ut=this._current=this._next,vn,In;if(this._current)if(vn=ut.firstChild,vn)this._next=vn;else{for(In=null;ut!==this.root&&!(In=ut.nextSibling);)ut=ut.parentNode;this._next=In}return this._current},detach:function(){this._current=this._next=this.root=null}};function Nn(ut){return new ho(ut)}function qn(ut,vn){this.node=ut,this.offset=vn}qn.prototype={equals:function(ut){return!!ut&&this.node===ut.node&&this.offset==ut.offset},inspect:function(){return"[DomPosition("+En(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function rr(ut){this.code=this[ut],this.codeName=ut,this.message="DOMException: "+this.codeName}rr.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},rr.prototype.toString=function(){return this.message},le.dom={arrayContains:pt,isHtmlNamespace:Lt,parentElement:Jt,getNodeIndex:en,getNodeLength:zt,getCommonAncestor:it,isAncestorOf:ae,isOrIsAncestorOf:re,getClosestAncestorIn:je,isCharacterDataNode:vt,isTextOrCommentNode:q,insertAfter:kt,splitDataNode:Rt,getDocument:Gt,getWindow:Pn,getIframeWindow:On,getIframeDocument:qt,getBody:we,isWindow:ke,getContentDocument:Ke,getRootContainer:Le,comparePoints:dt,isBrokenNode:Tt,inspectNode:En,getComputedStyleProperty:ao,createTestElement:Lo,removeNode:yo,fragmentFromNodeChildren:Zn,createIterator:Nn,DomPosition:qn},le.DOMException=rr}),B.createCoreModule("DomRange",["DomUtil"],function(le,Ze){var pe=le.dom,se=le.util,we=pe.DomPosition,$e=le.DOMException,rt=pe.isCharacterDataNode,pt=pe.getNodeIndex,Lt=pe.isOrIsAncestorOf,Jt=pe.getDocument,en=pe.comparePoints,zt=pe.splitDataNode,it=pe.getClosestAncestorIn,ae=pe.getNodeLength,re=pe.arrayContains,je=pe.getRootContainer,vt=le.features.crashyTextNodes,q=pe.removeNode;function kt(ye,ht){return ye.nodeType!=3&&(Lt(ye,ht.startContainer)||Lt(ye,ht.endContainer))}function Rt(ye){return ye.document||Jt(ye.startContainer)}function Gt(ye){return je(ye.startContainer)}function Pn(ye){return new we(ye.parentNode,pt(ye))}function qt(ye){return new we(ye.parentNode,pt(ye)+1)}function On(ye,ht,fn){var Rn=ye.nodeType==11?ye.firstChild:ye;return rt(ht)?fn==ht.length?pe.insertAfter(ye,ht):ht.parentNode.insertBefore(ye,fn==0?ht:zt(ht,fn)):fn>=ht.childNodes.length?ht.appendChild(ye):ht.insertBefore(ye,ht.childNodes[fn]),Rn}function ke(ye,ht,fn){if(Sn(ye),Sn(ht),Rt(ht)!=Rt(ye))throw new $e("WRONG_DOCUMENT_ERR");var Rn=en(ye.startContainer,ye.startOffset,ht.endContainer,ht.endOffset),Cn=en(ye.endContainer,ye.endOffset,ht.startContainer,ht.startOffset);return fn?Rn<=0&&Cn>=0:Rn<0&&Cn>0}function Ke(ye){for(var ht,fn,Rn=Rt(ye.range).createDocumentFragment(),Cn;fn=ye.next();){if(ht=ye.isPartiallySelectedSubtree(),fn=fn.cloneNode(!ht),ht&&(Cn=ye.getSubtreeIterator(),fn.appendChild(Ke(Cn)),Cn.detach()),fn.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");Rn.appendChild(fn)}return Rn}function Le(ye,ht,fn){var Rn,Cn;fn=fn||{stop:!1};for(var nr,Mn;nr=ye.next();)if(ye.isPartiallySelectedSubtree()){if(ht(nr)===!1){fn.stop=!0;return}else if(Mn=ye.getSubtreeIterator(),Le(Mn,ht,fn),Mn.detach(),fn.stop)return}else for(Rn=pe.createIterator(nr);Cn=Rn.next();)if(ht(Cn)===!1){fn.stop=!0;return}}function dt(ye){for(var ht;ye.next();)ye.isPartiallySelectedSubtree()?(ht=ye.getSubtreeIterator(),dt(ht),ht.detach()):ye.remove()}function At(ye){for(var ht,fn=Rt(ye.range).createDocumentFragment(),Rn;ht=ye.next();){if(ye.isPartiallySelectedSubtree()?(ht=ht.cloneNode(!1),Rn=ye.getSubtreeIterator(),ht.appendChild(At(Rn)),Rn.detach()):ye.remove(),ht.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");fn.appendChild(ht)}return fn}function Tt(ye,ht,fn){var Rn=!!(ht&&ht.length),Cn,nr=!!fn;Rn&&(Cn=new RegExp("^("+ht.join("|")+")$"));var Mn=[];return Le(new Zn(ye,!1),function(or){if(!(Rn&&!Cn.test(or.nodeType))&&!(nr&&!fn(or))){var lr=ye.startContainer;if(!(or==lr&&rt(lr)&&ye.startOffset==lr.length)){var qr=ye.endContainer;or==qr&&rt(qr)&&ye.endOffset==0||Mn.push(or)}}}),Mn}function En(ye){var ht=typeof ye.getName>"u"?"Range":ye.getName();return"["+ht+"("+pe.inspectNode(ye.startContainer)+":"+ye.startOffset+", "+pe.inspectNode(ye.endContainer)+":"+ye.endOffset+")]"}function Zn(ye,ht){if(this.range=ye,this.clonePartiallySelectedTextNodes=ht,!ye.collapsed){this.sc=ye.startContainer,this.so=ye.startOffset,this.ec=ye.endContainer,this.eo=ye.endOffset;var fn=ye.commonAncestorContainer;this.sc===this.ec&&rt(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===fn&&!rt(this.sc)?this.sc.childNodes[this.so]:it(this.sc,fn,!0),this._last=this.ec===fn&&!rt(this.ec)?this.ec.childNodes[this.eo-1]:it(this.ec,fn,!0))}}Zn.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var ye=this._current=this._next;return ye&&(this._next=ye!==this._last?ye.nextSibling:null,rt(ye)&&this.clonePartiallySelectedTextNodes&&(ye===this.ec&&(ye=ye.cloneNode(!0)).deleteData(this.eo,ye.length-this.eo),this._current===this.sc&&(ye=ye.cloneNode(!0)).deleteData(0,this.so))),ye},remove:function(){var ye=this._current,ht,fn;rt(ye)&&(ye===this.sc||ye===this.ec)?(ht=ye===this.sc?this.so:0,fn=ye===this.ec?this.eo:ye.length,ht!=fn&&ye.deleteData(ht,fn-ht)):ye.parentNode&&q(ye)},isPartiallySelectedSubtree:function(){var ye=this._current;return kt(ye,this.range)},getSubtreeIterator:function(){var ye;if(this.isSingleCharacterDataNode)ye=this.range.cloneRange(),ye.collapse(!1);else{ye=new si(Rt(this.range));var ht=this._current,fn=ht,Rn=0,Cn=ht,nr=ae(ht);Lt(ht,this.sc)&&(fn=this.sc,Rn=this.so),Lt(ht,this.ec)&&(Cn=this.ec,nr=this.eo),so(ye,fn,Rn,Cn,nr)}return new Zn(ye,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var ao=[1,3,4,5,7,8,10],Lo=[2,9,11],yo=[5,6,10,12],ho=[1,3,4,5,7,8,10,11],Nn=[1,3,4,5,7,8];function qn(ye){return function(ht,fn){for(var Rn,Cn=fn?ht:ht.parentNode;Cn;){if(Rn=Cn.nodeType,re(ye,Rn))return Cn;Cn=Cn.parentNode}return null}}var rr=qn([9,11]),ut=qn(yo),vn=qn([6,10,12]),In=qn([1]);function sr(ye,ht){if(vn(ye,ht))throw new $e("INVALID_NODE_TYPE_ERR")}function wo(ye,ht){if(!re(ht,ye.nodeType))throw new $e("INVALID_NODE_TYPE_ERR")}function oo(ye,ht){if(ht<0||ht>(rt(ye)?ye.length:ye.childNodes.length))throw new $e("INDEX_SIZE_ERR")}function ta(ye,ht){if(rr(ye,!0)!==rr(ht,!0))throw new $e("WRONG_DOCUMENT_ERR")}function Ca(ye){if(ut(ye,!0))throw new $e("NO_MODIFICATION_ALLOWED_ERR")}function Yi(ye,ht){if(!ye)throw new $e(ht)}function fa(ye,ht){return ht<=(rt(ye)?ye.length:ye.childNodes.length)}function Ka(ye){return!!ye.startContainer&&!!ye.endContainer&&!(vt&&(pe.isBrokenNode(ye.startContainer)||pe.isBrokenNode(ye.endContainer)))&&je(ye.startContainer)==je(ye.endContainer)&&fa(ye.startContainer,ye.startOffset)&&fa(ye.endContainer,ye.endOffset)}function Sn(ye){if(!Ka(ye))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+ye.inspect()+")")}var Ts=document.createElement("style"),Oo=!1;try{Ts.innerHTML="x",Oo=Ts.firstChild.nodeType==3}catch{}le.features.htmlParsingConforms=Oo;var es=Oo?function(ye){var ht=this.startContainer,fn=Jt(ht);if(!ht)throw new $e("INVALID_STATE_ERR");var Rn=null;return ht.nodeType==1?Rn=ht:rt(ht)&&(Rn=pe.parentElement(ht)),Rn===null||Rn.nodeName=="HTML"&&pe.isHtmlNamespace(Jt(Rn).documentElement)&&pe.isHtmlNamespace(Rn)?Rn=fn.createElement("body"):Rn=Rn.cloneNode(!1),Rn.innerHTML=ye,pe.fragmentFromNodeChildren(Rn)}:function(ye){var ht=Rt(this),fn=ht.createElement("body");return fn.innerHTML=ye,pe.fragmentFromNodeChildren(fn)};function Ui(ye,ht){Sn(ye);var fn=ye.startContainer,Rn=ye.startOffset,Cn=ye.endContainer,nr=ye.endOffset,Mn=fn===Cn;rt(Cn)&&nr>0&&nr0&&Rn=pt(fn)&&nr++,Rn=0),ye.setStartAndEnd(fn,Rn,Cn,nr)}function gr(ye){Sn(ye);var ht=ye.commonAncestorContainer.parentNode.cloneNode(!1);return ht.appendChild(ye.cloneContents()),ht.innerHTML}var gl=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],pa=0,qi=1,Na=2,al=3,yl=0,Cs=1,_l=2,ts=3;se.extend(le.rangePrototype,{compareBoundaryPoints:function(ye,ht){Sn(this),ta(this.startContainer,ht.startContainer);var fn,Rn,Cn,nr,Mn=ye==al||ye==pa?"start":"end",or=ye==qi||ye==pa?"start":"end";return fn=this[Mn+"Container"],Rn=this[Mn+"Offset"],Cn=ht[or+"Container"],nr=ht[or+"Offset"],en(fn,Rn,Cn,nr)},insertNode:function(ye){if(Sn(this),wo(ye,ho),Ca(this.startContainer),Lt(ye,this.startContainer))throw new $e("HIERARCHY_REQUEST_ERR");var ht=On(ye,this.startContainer,this.startOffset);this.setStartBefore(ht)},cloneContents:function(){Sn(this);var ye,ht;if(this.collapsed)return Rt(this).createDocumentFragment();if(this.startContainer===this.endContainer&&rt(this.startContainer))return ye=this.startContainer.cloneNode(!0),ye.data=ye.data.slice(this.startOffset,this.endOffset),ht=Rt(this).createDocumentFragment(),ht.appendChild(ye),ht;var fn=new Zn(this,!0);return ye=Ke(fn),fn.detach(),ye},canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var ye=new Zn(this,!0),ht=ye._first&&kt(ye._first,this)||ye._last&&kt(ye._last,this);return ye.detach(),!ht},surroundContents:function(ye){if(wo(ye,Nn),!this.canSurroundContents())throw new $e("INVALID_STATE_ERR");var ht=this.extractContents();if(ye.hasChildNodes())for(;ye.lastChild;)ye.removeChild(ye.lastChild);On(ye,this.startContainer,this.startOffset),ye.appendChild(ht),this.selectNode(ye)},cloneRange:function(){Sn(this);for(var ye=new si(Rt(this)),ht=gl.length,fn;ht--;)fn=gl[ht],ye[fn]=this[fn];return ye},toString:function(){Sn(this);var ye=this.startContainer;if(ye===this.endContainer&&rt(ye))return ye.nodeType==3||ye.nodeType==4?ye.data.slice(this.startOffset,this.endOffset):"";var ht=[],fn=new Zn(this,!0);return Le(fn,function(Rn){(Rn.nodeType==3||Rn.nodeType==4)&&ht.push(Rn.data)}),fn.detach(),ht.join("")},compareNode:function(ye){Sn(this);var ht=ye.parentNode,fn=pt(ye);if(!ht)throw new $e("NOT_FOUND_ERR");var Rn=this.comparePoint(ht,fn),Cn=this.comparePoint(ht,fn+1);return Rn<0?Cn>0?_l:yl:Cn>0?Cs:ts},comparePoint:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)<0?-1:en(ye,ht,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:es,toHtml:function(){return gr(this)},intersectsNode:function(ye,ht){if(Sn(this),je(ye)!=Gt(this))return!1;var fn=ye.parentNode,Rn=pt(ye);if(!fn)return!0;var Cn=en(fn,Rn,this.endContainer,this.endOffset),nr=en(fn,Rn+1,this.startContainer,this.startOffset);return ht?Cn<=0&&nr>=0:Cn<0&&nr>0},isPointInRange:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)>=0&&en(ye,ht,this.endContainer,this.endOffset)<=0},intersectsRange:function(ye){return ke(this,ye,!1)},intersectsOrTouchesRange:function(ye){return ke(this,ye,!0)},intersection:function(ye){if(this.intersectsRange(ye)){var ht=en(this.startContainer,this.startOffset,ye.startContainer,ye.startOffset),fn=en(this.endContainer,this.endOffset,ye.endContainer,ye.endOffset),Rn=this.cloneRange();return ht==-1&&Rn.setStart(ye.startContainer,ye.startOffset),fn==1&&Rn.setEnd(ye.endContainer,ye.endOffset),Rn}return null},union:function(ye){if(this.intersectsOrTouchesRange(ye)){var ht=this.cloneRange();return en(ye.startContainer,ye.startOffset,this.startContainer,this.startOffset)==-1&&ht.setStart(ye.startContainer,ye.startOffset),en(ye.endContainer,ye.endOffset,this.endContainer,this.endOffset)==1&&ht.setEnd(ye.endContainer,ye.endOffset),ht}else throw new $e("Ranges do not intersect")},containsNode:function(ye,ht){return ht?this.intersectsNode(ye,!1):this.compareNode(ye)==ts},containsNodeContents:function(ye){return this.comparePoint(ye,0)>=0&&this.comparePoint(ye,ae(ye))<=0},containsRange:function(ye){var ht=this.intersection(ye);return ht!==null&&ye.equals(ht)},containsNodeText:function(ye){var ht=this.cloneRange();ht.selectNode(ye);var fn=ht.getNodes([3]);if(fn.length>0){ht.setStart(fn[0],0);var Rn=fn.pop();return ht.setEnd(Rn,Rn.length),this.containsRange(ht)}else return this.containsNodeContents(ye)},getNodes:function(ye,ht){return Sn(this),Tt(this,ye,ht)},getDocument:function(){return Rt(this)},collapseBefore:function(ye){this.setEndBefore(ye),this.collapse(!1)},collapseAfter:function(ye){this.setStartAfter(ye),this.collapse(!0)},getBookmark:function(ye){var ht=Rt(this),fn=le.createRange(ht);ye=ye||pe.getBody(ht),fn.selectNodeContents(ye);var Rn=this.intersection(fn),Cn=0,nr=0;return Rn&&(fn.setEnd(Rn.startContainer,Rn.startOffset),Cn=fn.toString().length,nr=Cn+Rn.toString().length),{start:Cn,end:nr,containerNode:ye}},moveToBookmark:function(ye){var ht=ye.containerNode,fn=0;this.setStart(ht,0),this.collapse(!0);for(var Rn=[ht],Cn,nr=!1,Mn=!1,or,lr,qr;!Mn&&(Cn=Rn.pop());)if(Cn.nodeType==3)or=fn+Cn.length,!nr&&ye.start>=fn&&ye.start<=or&&(this.setStart(Cn,ye.start-fn),nr=!0),nr&&ye.end>=fn&&ye.end<=or&&(this.setEnd(Cn,ye.end-fn),Mn=!0),fn=or;else for(qr=Cn.childNodes,lr=qr.length;lr--;)Rn.push(qr[lr])},getName:function(){return"DomRange"},equals:function(ye){return si.rangesEqual(this,ye)},isValid:function(){return Ka(this)},inspect:function(){return En(this)},detach:function(){}});function ve(ye){ye.START_TO_START=pa,ye.START_TO_END=qi,ye.END_TO_END=Na,ye.END_TO_START=al,ye.NODE_BEFORE=yl,ye.NODE_AFTER=Cs,ye.NODE_BEFORE_AND_AFTER=_l,ye.NODE_INSIDE=ts}function mt(ye){ve(ye),ve(ye.prototype)}function cn(ye,ht){return function(){Sn(this);var fn=this.startContainer,Rn=this.startOffset,Cn=this.commonAncestorContainer,nr=new Zn(this,!0),Mn,or;fn!==Cn&&(Mn=it(fn,Cn,!0),or=qt(Mn),fn=or.node,Rn=or.offset),Le(nr,Ca),nr.reset();var lr=ye(nr);return nr.detach(),ht(this,fn,Rn,fn,Rn),lr}}function Kn(ye,ht){function fn(Mn,or){return function(lr){wo(lr,ao),wo(je(lr),Lo);var qr=(Mn?Pn:qt)(lr);(or?Rn:Cn)(this,qr.node,qr.offset)}}function Rn(Mn,or,lr){var qr=Mn.endContainer,na=Mn.endOffset;(or!==Mn.startContainer||lr!==Mn.startOffset)&&((je(or)!=je(qr)||en(or,lr,qr,na)==1)&&(qr=or,na=lr),ht(Mn,or,lr,qr,na))}function Cn(Mn,or,lr){var qr=Mn.startContainer,na=Mn.startOffset;(or!==Mn.endContainer||lr!==Mn.endOffset)&&((je(or)!=je(qr)||en(or,lr,qr,na)==-1)&&(qr=or,na=lr),ht(Mn,qr,na,or,lr))}var nr=function(){};nr.prototype=le.rangePrototype,ye.prototype=new nr,se.extend(ye.prototype,{setStart:function(Mn,or){sr(Mn,!0),oo(Mn,or),Rn(this,Mn,or)},setEnd:function(Mn,or){sr(Mn,!0),oo(Mn,or),Cn(this,Mn,or)},setStartAndEnd:function(){var Mn=arguments,or=Mn[0],lr=Mn[1],qr=or,na=lr;switch(Mn.length){case 3:na=Mn[2];break;case 4:qr=Mn[2],na=Mn[3];break}sr(or,!0),oo(or,lr),sr(qr,!0),oo(qr,na),ht(this,or,lr,qr,na)},setBoundary:function(Mn,or,lr){this["set"+(lr?"Start":"End")](Mn,or)},setStartBefore:fn(!0,!0),setStartAfter:fn(!1,!0),setEndBefore:fn(!0,!1),setEndAfter:fn(!1,!1),collapse:function(Mn){Sn(this),Mn?ht(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):ht(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(Mn){sr(Mn,!0),ht(this,Mn,0,Mn,ae(Mn))},selectNode:function(Mn){sr(Mn,!1),wo(Mn,ao);var or=Pn(Mn),lr=qt(Mn);ht(this,or.node,or.offset,lr.node,lr.offset)},extractContents:cn(At,ht),deleteContents:cn(dt,ht),canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var Mn=new Zn(this,!0),or=Mn._first&&kt(Mn._first,this)||Mn._last&&kt(Mn._last,this);return Mn.detach(),!or},splitBoundaries:function(){Ui(this)},splitBoundariesPreservingPositions:function(Mn){Ui(this,Mn)},normalizeBoundaries:function(){Sn(this);var Mn=this.startContainer,or=this.startOffset,lr=this.endContainer,qr=this.endOffset,na=function(Ro){var La=Ro.nextSibling;La&&La.nodeType==Ro.nodeType&&(lr=Ro,qr=Ro.length,Ro.appendData(La.data),q(La))},vi=function(Ro){var La=Ro.previousSibling;if(La&&La.nodeType==Ro.nodeType){Mn=Ro;var id=Ro.length;if(or=La.length,Ro.insertData(0,La.data),q(La),Mn==lr)qr+=or,lr=Mn;else if(lr==Ro.parentNode){var _u=pt(Ro);qr==_u?(lr=Ro,qr=id):qr>_u&&qr--}}},bl=!0,Vi;if(rt(lr))qr==lr.length?na(lr):qr==0&&(Vi=lr.previousSibling,Vi&&Vi.nodeType==lr.nodeType&&(qr=Vi.length,Mn==lr&&(bl=!1),Vi.appendData(lr.data),q(lr),lr=Vi));else{if(qr>0){var Ns=lr.childNodes[qr-1];Ns&&rt(Ns)&&na(Ns)}bl=!this.collapsed}if(bl){if(rt(Mn))or==0?vi(Mn):or==Mn.length&&(Vi=Mn.nextSibling,Vi&&Vi.nodeType==Mn.nodeType&&(lr==Vi&&(lr=Mn,qr+=Mn.length),Mn.appendData(Vi.data),q(Vi)));else if(or"u"&&(vt.Range=se),le.createNativeRange=function(q){return q=Jt(q,Ze,"createNativeRange"),Lt(q).createTextRange()},le.WrappedRange=se}}le.createRange=function(q){return q=Jt(q,Ze,"createRange"),new le.WrappedRange(le.createNativeRange(q))},le.createRangyRange=function(q){return q=Jt(q,Ze,"createRangyRange"),new pt(q)},$e.createAliasForDeprecatedMethod(le,"createIframeRange","createRange"),$e.createAliasForDeprecatedMethod(le,"createIframeRangyRange","createRangyRange"),le.addShimListener(function(q){var kt=q.document;typeof kt.createRange>"u"&&(kt.createRange=function(){return le.createRange(kt)}),kt=q=null})}),B.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(le,Ze){le.config.checkSelectionRanges=!0;var pe="boolean",se="number",we=le.dom,$e=le.util,rt=$e.isHostMethod,pt=le.DomRange,Lt=le.WrappedRange,Jt=le.DOMException,en=we.DomPosition,zt,it,ae=le.features,re="Control",je=we.getDocument,vt=we.getBody,q=pt.rangesEqual;function kt(ve){return typeof ve=="string"?/^backward(s)?$/i.test(ve):!!ve}function Rt(ve,mt){if(ve){if(we.isWindow(ve))return ve;if(ve instanceof Sn)return ve.win;var cn=we.getContentDocument(ve,Ze,mt);return we.getWindow(cn)}else return window}function Gt(ve){return Rt(ve,"getWinSelection").getSelection()}function Pn(ve){return Rt(ve,"getDocSelection").document.selection}function qt(ve){var mt=!1;return ve.anchorNode&&(mt=we.comparePoints(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset)==1),mt}var On=rt(window,"getSelection"),ke=$e.isHostObject(document,"selection");ae.implementsWinGetSelection=On,ae.implementsDocSelection=ke;var Ke=ke&&(!On||le.config.preferTextRange);if(Ke)zt=Pn,le.isSelectionValid=function(ve){var mt=Rt(ve,"isSelectionValid").document,cn=mt.selection;return cn.type!="None"||je(cn.createRange().parentElement())==mt};else if(On)zt=Gt,le.isSelectionValid=function(){return!0};else return Ze.fail("Neither document.selection or window.getSelection() detected."),!1;le.getNativeSelection=zt;var Le=zt();if(!Le)return Ze.fail("Native selection was null (possibly issue 138?)"),!1;var dt=le.createNativeRange(document),At=vt(document),Tt=$e.areHostProperties(Le,["anchorNode","focusNode","anchorOffset","focusOffset"]);ae.selectionHasAnchorAndFocus=Tt;var En=rt(Le,"extend");ae.selectionHasExtend=En;var Zn=rt(Le,"setBaseAndExtent");ae.selectionHasSetBaseAndExtent=Zn;var ao=typeof Le.rangeCount==se;ae.selectionHasRangeCount=ao;var Lo=!1,yo=!0,ho=En?function(ve,mt){var cn=pt.getRangeDocument(mt),Kn=le.createRange(cn);Kn.collapseToPoint(mt.endContainer,mt.endOffset),ve.addRange(sr(Kn)),ve.extend(mt.startContainer,mt.startOffset)}:null;$e.areHostMethods(Le,["addRange","getRangeAt","removeAllRanges"])&&typeof Le.rangeCount==se&&ae.implementsDomRange&&(function(){var ve=window.getSelection();if(ve){for(var mt=ve.rangeCount,cn=mt>1,Kn=[],br=qt(ve),so=0;so=36)Lo=!1;else{var Rn=ht.cloneRange();ht.setStart(ye,0),Rn.setEnd(ye,3),Rn.setStart(ye,2),ve.addRange(ht),ve.addRange(Rn),Lo=ve.rangeCount==2}}for(we.removeNode(si),ve.removeAllRanges(),so=0;so1)gl(this,ve);else{this.removeAllRanges();for(var mt=0,cn=ve.length;mt1?gl(this,ve):mt&&this.addRange(ve[0])};else return Ze.fail("No means of selecting a Range or TextRange was found"),!1;gr.getRangeAt=function(ve){if(ve<0||ve>=this.rangeCount)throw new Jt("INDEX_SIZE_ERR");return this._ranges[ve].cloneRange()};var qi;if(Ke)qi=function(ve){var mt;le.isSelectionValid(ve.win)?mt=ve.docSelection.createRange():(mt=vt(ve.win.document).createTextRange(),mt.collapse(!0)),ve.docSelection.type==re?Yi(ve):ta(mt)?Ca(ve,mt):vn(ve)};else if(rt(Le,"getRangeAt")&&typeof Le.rangeCount==se)qi=function(ve){if(Nn&&ke&&ve.docSelection.type==re)Yi(ve);else if(ve._ranges.length=ve.rangeCount=ve.nativeSelection.rangeCount,ve.rangeCount){for(var mt=0,cn=ve.rangeCount;mt(we.isCharacterDataNode(ve)?ve.length:ve.childNodes.length))throw new Jt("INDEX_SIZE_ERR")}gr.collapse=function(ve,mt){yl(this,ve);var cn=le.createRange(ve);cn.collapseToPoint(ve,mt),this.setSingleRange(cn),this.isCollapsed=!0},gr.collapseToStart=function(){if(this.rangeCount){var ve=this._ranges[0];this.collapse(ve.startContainer,ve.startOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.collapseToEnd=function(){if(this.rangeCount){var ve=this._ranges[this.rangeCount-1];this.collapse(ve.endContainer,ve.endOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.selectAllChildren=function(ve){yl(this,ve);var mt=le.createRange(ve);mt.selectNodeContents(ve),this.setSingleRange(mt)},Zn?gr.setBaseAndExtent=function(ve,mt,cn,Kn){this.nativeSelection.setBaseAndExtent(ve,mt,cn,Kn),this.refresh()}:En&&(gr.setBaseAndExtent=function(ve,mt,cn,Kn){Cs(ve,mt),Cs(cn,Kn),yl(this,ve),yl(this,cn);var br=le.createRange(node),so=we.comparePoints(ve,mt,cn,Kn)==-1;so?br.setStartAndEnd(cn,Kn,ve,mt):br.setStartAndEnd(ve,mt,cn,Kn),this.setSingleRange(br,so)}),gr.deleteFromDocument=function(){if(Nn&&ke&&this.docSelection.type==re){for(var ve=this.docSelection.createRange(),mt;ve.length;)mt=ve.item(0),ve.remove(mt),we.removeNode(mt);this.refresh()}else if(this.rangeCount){var cn=this.getAllRanges();if(cn.length){this.removeAllRanges();for(var Kn=0,br=cn.length;Kn0)return le.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw Ze.createError("getNativeTextRange: selection contains no range")}});function ts(ve){var mt=[],cn=new en(ve.anchorNode,ve.anchorOffset),Kn=new en(ve.focusNode,ve.focusOffset),br=typeof ve.getName=="function"?ve.getName():"Selection";if(typeof ve.rangeCount<"u")for(var so=0,si=ve.rangeCount;so"u"&&(ve.getSelection=function(){return Ui(ve)}),ve=null})});var Je=!1,gt=function(le){Je||(Je=!0,!B.initialized&&B.config.autoInitialize&&J())};return D&&(document.readyState=="complete"?gt():(f(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",gt,!1),Y(window,"load",gt))),B})})(bS)),bS.exports}var Sne=ZI();const _R=Z_(Sne);var wS={exports:{}},bR;function Ane(){return bR||(bR=1,(function(t,e){(function(n,o){t.exports=n(ZI())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(o,r){var i=o.dom,a=i.DomPosition,s=i.arrayContains,l=o.util,f=l.forEach,h="span",v=l.isHostMethod(document,"createElementNS");function b(ae,re){for(var je in ae)if(ae.hasOwnProperty(je)&&re(je,ae[je])===!1)return!1;return!0}function E(ae){return ae.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function O(ae,re){return!!ae&&new RegExp("(?:^|\\s)"+re+"(?:\\s|$)").test(ae)}function w(ae,re){if(typeof ae.classList=="object")return ae.classList.contains(re);var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");return O(vt,re)}function S(ae,re){if(typeof ae.classList=="object")ae.classList.add(re);else{var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");vt?O(vt,re)||(vt+=" "+re):vt=re,je?ae.className=vt:ae.setAttribute("class",vt)}}var M=(function(){function ae(re,je,vt){return je&&vt?" ":""}return function(re,je){if(typeof re.classList=="object")re.classList.remove(je);else{var vt=typeof re.className=="string",q=vt?re.className:re.getAttribute("class");q=q.replace(new RegExp("(^|\\s)"+je+"(\\s|$)"),ae),vt?re.className=q:re.setAttribute("class",q)}}})();function T(ae){var re=typeof ae.className=="string";return re?ae.className:ae.getAttribute("class")}function $(ae){return ae&&ae.split(/\s+/).sort().join(" ")}function D(ae){return $(T(ae))}function P(ae,re){return D(ae)==D(re)}function B(ae,re){for(var je=re.split(/\s+/),vt=0,q=je.length;vtq&&++Pn,kt==re&&(Rt==je||Rt==je+1)&&(Gt=vt,Pn+=q-je),kt==re&&Rt>je+1&&--Pn,ae.node=Gt,ae.offset=Pn}function V(ae,re,je){ae.node==re&&ae.offset>je&&--ae.offset}function z(ae,re,je,vt){je==-1&&(je=re.childNodes.length);var q=ae.parentNode,kt=i.getNodeIndex(ae);f(vt,function(Rt){I(Rt,q,kt,re,je)}),re.childNodes.length==je?re.appendChild(ae):re.insertBefore(ae,re.childNodes[je])}function X(ae,re){var je=ae.parentNode,vt=i.getNodeIndex(ae);f(re,function(q){V(q,je,vt)}),i.removeNode(ae)}function Y(ae,re,je,vt,q){for(var kt,Rt=[];kt=ae.firstChild;)z(kt,re,je++,q),Rt.push(kt);return X(ae,q),Rt}function W(ae,re){return Y(ae,ae.parentNode,i.getNodeIndex(ae),!0,re)}function Q(ae,re){var je=ae.cloneRange();je.selectNodeContents(re);var vt=je.intersection(ae),q=vt?vt.toString():"";return q!=""}function J(ae){for(var re=ae.getNodes([3]),je=0,vt;(vt=re[je])&&!Q(ae,vt);)++je;for(var q=re.length-1;(vt=re[q])&&!Q(ae,vt);)--q;return re.slice(je,q+1)}function ie(ae,re){if(ae.attributes.length!=re.attributes.length)return!1;for(var je=0,vt=ae.attributes.length,q,kt,Rt;je0&&re1){var vt=i.getNodeIndex(je),q=[],kt=0,Rt;f(re,function(Gt,Pn){Rt=Gt.parentNode,Pn>0&&(Rt.removeChild(Gt),Rt.hasChildNodes()||i.removeNode(Rt),ae&&f(ae,function(qt){qt.node==Gt&&(qt.node=je,qt.offset+=kt),qt.node==Rt&&qt.offset>vt&&(--qt.offset,qt.offset==vt+1&&Pn"u"?!0:vt,Gt.attrExceptions=[];var On=document.createElement(Gt.elementTagName);Gt.elementProperties=Gt.copyPropertiesToElement(Pn,On,!0),b(qt,function(Ke,Le){Gt.attrExceptions.push(Ke),qt[Ke]=""+Le}),Gt.elementAttributes=qt,Gt.elementSortedClassName=Gt.elementProperties.hasOwnProperty("className")?$(Gt.elementProperties.className+" "+ae):ae,Gt.applyToAnyTagName=!1;var ke=typeof je;if(ke=="string")je=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames=E(je.toLowerCase()).split(/\s*,\s*/);else if(ke=="object"&&typeof je.length=="number")for(Gt.tagNames=[],q=0,kt=je.length;qColor",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{_R.init()}catch{console.error("rangy.init failed")}try{(l=(s=o==null?void 0:o.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new KI({parent:this.button||void 0,color:"#000",onDone:function(f){var h,v,b,E,O;try{a.coloredText&&(!((v=(h=a.coloredText).isAppliedToSelection)===null||v===void 0)&&v.call(h))&&a.coloredText.undoToSelection(),a.coloredText=_R.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:f.hex}},normalize:!0}),a.coloredText.toggleSelection(),(E=(b=a.base)===null||b===void 0?void 0:b.checkContentChanged)===null||E===void 0||E.call(b),(O=a.setInactive)===null||O===void 0||O.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),(function(){function a(){}return a})())}var Mne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Tne=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},xR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},OR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new D0(".lf-label-editor",Yv(wR,{autoLink:!0,extensions:{colorPicker:new(ER(D0))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,o=this.props,r=o.lf.extension,i=o.graphModel,a=OR(OR([],xR(i.nodes),!1),xR(i.edges),!1),s=r.label;if(s){var l=[];return ri(a,function(f){var h,v,b=f.getData(),E=(v=(h=b.properties)===null||h===void 0?void 0:h._label)!==null&&v!==void 0?v:[];ri(E,function(O){var w=n.labelMap,S=new vne(O,f,i);w.set(S.id,S),l.push($t(pne,{label:S,element:f,graphModel:i},S.id))})}),l}return null},e.prototype.render=function(){return $t("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=Tne([xs],e),e})(ko);var SR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},AR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0&&r.lf.emit("selection:drop",{e:a}),r.lf.emit("selection:selected",{elements:B,leftTopPoint:S,rightBottomPoint:M})}r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0)},this.lf=n,this.exclusiveMode=(i=o==null?void 0:o.exclusiveMode)!==null&&i!==void 0?i:!1,n.openSelectionSelect=function(){r.openSelectionSelect()},n.closeSelectionSelect=function(){r.closeSelectionSelect()},n.setSelectionSelectMode=function(a){r.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var o=e.button===2;if(!o){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var r=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,i=r.x,a=r.y;this.startPoint={x:i,y:a},this.endPoint={x:i,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(f){f.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(s),this.wrapper=s,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=to(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t})();var JI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Eg=function(){return Eg=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nne={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function kne(t){for(var e=t,n=1;ni?T<0?"l":"r":D<=i&&P>i?$<0?"t":"b":D<=i&&P<=i?"":D0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o1&&setTimeout(function(){var r;n.updatePointsByNodes(((r=n.properties)===null||r===void 0?void 0:r.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var o=n.x,r=n.y;this.x=o,this.y=r},e.prototype.updatePointsByNodes=function(n){var o=this,r=[],i=1/0,a=1/0,s=-1/0,l=-1/0;n.forEach(function(f){var h=o.graphModel.getNodeModelById(f);if(h){var v=h.width,b=h.height,E=h.x,O=h.y;i=Math.min(i,E-v/2-o.d),a=Math.min(a,O-b/2-o.d),s=Math.max(s,E+v/2+o.d),l=Math.max(l,O+b/2+o.d)}}),r.push([i,a],[s,a],[s,l],[i,l]),![i,a,s,l].some(function(f){return Math.abs(f)===1/0})&&(this.updatePoints(r),this.updateCoordinate({x:(s+i)/2,y:(l+a)/2}))},e.prototype.resize=function(n){var o;this.isResize=!0;for(var r=n.width,i=n.height,a={x:r/this.width,y:i/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],f=new Set;s.length;){var h=s.shift(),v=(o=this.graphModel.nodesMap[h])===null||o===void 0?void 0:o.model;if(v){if(!ew(v)){l.push(v);continue}f.has(v.id)||(f.add(v.id),s.push.apply(s,TR([],MR(v.properties.node_selection_ids||[]),!1)))}}var b={x:this.x-this.width/2,y:this.y-this.height/2},E=t.prototype.resize.call(this,n),O={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(w){w.width=w.width*a.x,w.height=w.height*a.y;var S=(w.x-b.x)*a.x+O.x-w.x,M=(w.y-b.y)*a.y+O.y-w.y;w.move(S,M,!0)}),this.isResize=!1,E},e})(Uw),v2="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:v2,view:jne,model:Lne})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,o=this.lf.getGraphRawData(),r=n.filter(function(i){return i!==e.currentClickNode.id});return o.nodes.find(function(i){if(i.type==="node-selection"){var a=om(i,"properties.node_selection_ids",[]);return r.every(function(s){return a.includes(s)})}return!1})},t.prototype.onNodeChange=function(e,n){var o=e.graphModel.nodes.filter(function(r){if(!ew(r))return!1;var i=r.properties.node_selection_ids||[];return i.includes(n.id)});Promise.resolve().then(function(){o.forEach(function(r){r.updatePointsByNodes(r.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(o){var r;if(!(!o.e.shiftKey||o.data.type===v2)){n.currentClickNode=o.data;var i=!1;n.selectNodesIds.includes(o.data.id)&&((r=n.lf.getNodeModelById(o.data.id))===null||r===void 0||r.setSelected(!1),i=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?i?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(o,r,i){if(n.onNodeChange(e,o),ew(o)&&!o.isResize){var a=o.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,r,i,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(o){return ew(o)||n.onNodeChange(e,o),!0})},t.pluginName="node-selection",t})();var ew=function(t){return!!(t&&t.type===v2)},Ine=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c1=function(){return c1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),typeof pe=="function"&&pe.defaultProps!=null)for(pt in pe.defaultProps)Lt[pt]===void 0&&(Lt[pt]=pe.defaultProps[pt]);return T(pe,Lt,$e,rt,null)}function T(pe,se,we,$e,rt){var pt={type:pe,props:se,key:we,ref:$e,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:rt??++s};return rt==null&&a.vnode!=null&&a.vnode(pt),pt}function $(){return{current:null}}function D(pe){return pe.children}function P(pe,se){this.props=pe,this.context=se}function B(pe,se){if(se==null)return pe.__?B(pe.__,pe.__.__k.indexOf(pe)+1):null;for(var we;se0?T(je.type,je.props,je.key,null,je.__v):je)!=null){if(je.__=we,je.__b=we.__b+1,(re=Rt[it])===null||re&&je.key==re.key&&je.type===re.type)Rt[it]=void 0;else for(ae=0;ae2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),T(pe.type,Lt,$e||pe.key,rt||pe.ref,null)}function Ze(pe,se){var we={__c:se="__cC"+v++,__:pe,Consumer:function($e,rt){return $e.children(rt)},Provider:function($e){var rt,pt;return this.getChildContext||(rt=[],(pt={})[se]=this,this.getChildContext=function(){return pt},this.shouldComponentUpdate=function(Lt){this.props.value!==Lt.value&&rt.some(I)},this.sub=function(Lt){rt.push(Lt);var Jt=Lt.componentWillUnmount;Lt.componentWillUnmount=function(){rt.splice(rt.indexOf(Lt),1),Jt&&Jt.call(Lt)}}),$e.children}};return we.Provider.__=we.Consumer.contextType=we}i=E.slice,a={__e:function(pe,se){for(var we,$e,rt;se=se.__;)if((we=se.__c)&&!we.__)try{if(($e=we.constructor)&&$e.getDerivedStateFromError!=null&&(we.setState($e.getDerivedStateFromError(pe)),rt=we.__d),we.componentDidCatch!=null&&(we.componentDidCatch(pe),rt=we.__d),rt)return we.__E=we}catch(pt){pe=pt}throw pe}},s=0,P.prototype.setState=function(pe,se){var we;we=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof pe=="function"&&(pe=pe(w({},we),this.props)),pe&&w(we,pe),pe!=null&&this.__v&&(se&&this.__h.push(se),I(this))},P.prototype.forceUpdate=function(pe){this.__v&&(this.__e=!0,pe&&this.__h.push(pe),I(this))},P.prototype.render=D,l=[],f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,V.__r=0,v=0},function(n,o,r){(function(i,a){r.d(o,"a",(function(){return I})),r.d(o,"b",(function(){return lf})),r.d(o,"c",(function(){return Na})),r.d(o,"d",(function(){return rr})),r.d(o,"e",(function(){return Tt})),r.d(o,"f",(function(){return At})),r.d(o,"g",(function(){return qn})),r.d(o,"h",(function(){return ka})),r.d(o,"i",(function(){return Pn})),r.d(o,"j",(function(){return Nn})),r.d(o,"k",(function(){return br})),r.d(o,"l",(function(){return ht})),r.d(o,"m",(function(){return q})),r.d(o,"n",(function(){return or})),r.d(o,"o",(function(){return X})),r.d(o,"p",(function(){return Uh})),r.d(o,"q",(function(){return lr})),r.d(o,"r",(function(){return Fl})),r.d(o,"s",(function(){return sl})),r.d(o,"t",(function(){return vi})),r.d(o,"u",(function(){return si})),r.d(o,"v",(function(){return id})),r.d(o,"w",(function(){return _u})),r.d(o,"x",(function(){return ra})),r.d(o,"y",(function(){return xl})),r.d(o,"z",(function(){return Wi})),r.d(o,"A",(function(){return ia})),r.d(o,"B",(function(){return wl})),r.d(o,"C",(function(){return zt})),r.d(o,"D",(function(){return gp})),r.d(o,"E",(function(){return nr})),r.d(o,"F",(function(){return Cn})),r.d(o,"G",(function(){return so})),r.d(o,"H",(function(){return ve})),r.d(o,"I",(function(){return rf})),r.d(o,"J",(function(){return oa})),r.d(o,"K",(function(){return Ke})),r.d(o,"L",(function(){return qo})),r.d(o,"M",(function(){return ad}));var s=[];Object.freeze(s);var l={};function f(){return++Sn.mobxGuid}function h(R){throw v(!1,R),"X"}function v(R,L){if(!R)throw new Error("[mobx] "+(L||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(l);function b(R){var L=!1;return function(){if(!L)return L=!0,R.apply(this,arguments)}}var E=function(){};function O(R){return R!==null&&typeof R=="object"}function w(R){if(R===null||typeof R!="object")return!1;var L=Object.getPrototypeOf(R);return L===Object.prototype||L===null}function S(R,L,Z){Object.defineProperty(R,L,{enumerable:!1,writable:!0,configurable:!0,value:Z})}function M(R,L){var Z="isMobX"+R;return L.prototype[Z]=!0,function(fe){return O(fe)&&fe[Z]===!0}}function T(R){return R instanceof Map}function $(R){return R instanceof Set}function D(R){var L=new Set;for(var Z in R)L.add(Z);return Object.getOwnPropertySymbols(R).forEach((function(fe){Object.getOwnPropertyDescriptor(R,fe).enumerable&&L.add(fe)})),Array.from(L)}function P(R){return R&&R.toString?R.toString():new String(R).toString()}function B(R){return R===null?null:typeof R=="object"?""+R:R}var F=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:Object.getOwnPropertyNames,I=Symbol("mobx administration"),V=(function(){function R(L){L===void 0&&(L="Atom@"+f()),this.name=L,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ae.NOT_TRACKING}return R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.reportObserved=function(){return gl(this)},R.prototype.reportChanged=function(){Ui(),(function(L){L.lowestObserverState!==ae.STALE&&(L.lowestObserverState=ae.STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale()),Z.dependenciesState=ae.STALE})))})(this),gr()},R.prototype.toString=function(){return this.name},R})(),z=M("Atom",V);function X(R,L,Z){L===void 0&&(L=E),Z===void 0&&(Z=E);var fe,Re=new V(R);return L!==E&&Mn("onBecomeObserved",Re,L,fe),Z!==E&&nr(Re,Z),Re}var Y={structural:function(R,L){return un(R,L)},default:function(R,L){return Object.is(R,L)}},W=function(R,L){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,fe){Z.__proto__=fe}||function(Z,fe){for(var Re in fe)fe.hasOwnProperty(Re)&&(Z[Re]=fe[Re])},W(R,L)};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var Q=function(){return Q=Object.assign||function(R){for(var L,Z=1,fe=arguments.length;Z=R.length&&(R=void 0),{value:R&&R[Z++],done:!R}}}}function ie(R,L){var Z=typeof Symbol=="function"&&R[Symbol.iterator];if(!Z)return R;var fe,Re,lt=Z.call(R),It=[];try{for(;(L===void 0||L-- >0)&&!(fe=lt.next()).done;)It.push(fe.value)}catch(bn){Re={error:bn}}finally{try{fe&&!fe.done&&(Z=lt.return)&&Z.call(lt)}finally{if(Re)throw Re.error}}return It}function Se(){for(var R=[],L=0;L2&&it("box");var Z=we(L);return new In(R,Jt(Z),Z.name,!0,Z.equals)},array:function(R,L){arguments.length>2&&it("array");var Z=we(L);return Ks(R,Jt(Z),Z.name)},map:function(R,L){arguments.length>2&&it("map");var Z=we(L);return new lf(R,Jt(Z),Z.name)},set:function(R,L){arguments.length>2&&it("set");var Z=we(L);return new os(R,Jt(Z),Z.name)},object:function(R,L,Z){typeof arguments[1]=="string"&&it("object");var fe=we(Z);if(fe.proxy===!1)return lr({},R,L,fe);var Re=qr(fe),lt=lr({},void 0,void 0,fe),It=bu(lt);return na(It,R,L,Re),It},ref:pt,shallow:rt,deep:$e,struct:Lt},zt=function(R,L,Z){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return $e.apply(null,arguments);if(ra(R))return R;var fe=w(R)?zt.object(R,L,Z):Array.isArray(R)?zt.array(R,L):T(R)?zt.map(R,L):$(R)?zt.set(R,L):R;if(fe!==R)return fe;h(!1)};function it(R){h("Expected one or two arguments to observable."+R+". Did you accidentally try to use observable."+R+" as decorator?")}Object.keys(en).forEach((function(R){return zt[R]=en[R]}));var ae,re,je=Je(!1,(function(R,L,Z,fe,Re){var lt=Z.get,It=Z.set,bn=Re[0]||{};ll(R).addComputedProp(R,L,Q({get:lt,set:It,context:R},bn))})),vt=je({equals:Y.structural}),q=function(R,L,Z){if(typeof L=="string"||R!==null&&typeof R=="object"&&arguments.length===1)return je.apply(null,arguments);var fe=typeof L=="object"?L:{};return fe.get=R,fe.set=typeof L=="function"?L:fe.set,fe.name=fe.name||R.name||"",new wo(fe)};q.struct=vt,(function(R){R[R.NOT_TRACKING=-1]="NOT_TRACKING",R[R.UP_TO_DATE=0]="UP_TO_DATE",R[R.POSSIBLY_STALE=1]="POSSIBLY_STALE",R[R.STALE=2]="STALE"})(ae||(ae={})),(function(R){R[R.NONE=0]="NONE",R[R.LOG=1]="LOG",R[R.BREAK=2]="BREAK"})(re||(re={}));var kt=function(R){this.cause=R};function Rt(R){return R instanceof kt}function Gt(R){switch(R.dependenciesState){case ae.UP_TO_DATE:return!1;case ae.NOT_TRACKING:case ae.STALE:return!0;case ae.POSSIBLY_STALE:for(var L=At(!0),Z=Le(),fe=R.observing,Re=fe.length,lt=0;lt0;Sn.computationDepth>0&&L&&h(!1),Sn.allowStateChanges||!L&&Sn.enforceActions!=="strict"||h(!1)}function On(R,L,Z){var fe=At(!0);En(R),R.newObserving=new Array(R.observing.length+100),R.unboundDepsCount=0,R.runId=++Sn.runId;var Re,lt=Sn.trackingDerivation;if(Sn.trackingDerivation=R,Sn.disableErrorBoundaries===!0)Re=L.call(Z);else try{Re=L.call(Z)}catch(It){Re=new kt(It)}return Sn.trackingDerivation=lt,(function(It){for(var bn=It.observing,Jn=It.observing=It.newObserving,no=ae.UP_TO_DATE,$n=0,Do=It.unboundDepsCount,Kr=0;Krno&&(no=So.dependenciesState);for(Jn.length=$n,It.newObserving=null,Do=bn.length;Do--;)(So=bn[Do]).diffValue===0&&Oo(So,It),So.diffValue=0;for(;$n--;){var So;(So=Jn[$n]).diffValue===1&&(So.diffValue=0,Ts(So,It))}no!==ae.UP_TO_DATE&&(It.dependenciesState=no,It.onBecomeStale())})(R),Tt(fe),Re}function ke(R){var L=R.observing;R.observing=[];for(var Z=L.length;Z--;)Oo(L[Z],R);R.dependenciesState=ae.NOT_TRACKING}function Ke(R){var L=Le();try{return R()}finally{dt(L)}}function Le(){var R=Sn.trackingDerivation;return Sn.trackingDerivation=null,R}function dt(R){Sn.trackingDerivation=R}function At(R){var L=Sn.allowStateReads;return Sn.allowStateReads=R,L}function Tt(R){Sn.allowStateReads=R}function En(R){if(R.dependenciesState!==ae.UP_TO_DATE){R.dependenciesState=ae.UP_TO_DATE;for(var L=R.observing,Z=L.length;Z--;)L[Z].lowestObserverState=ae.UP_TO_DATE}}var Zn=0,ao=1,Lo=Object.getOwnPropertyDescriptor((function(){}),"name");Lo&&Lo.configurable;function yo(R,L,Z){var fe=function(){return ho(R,L,Z||this,arguments)};return fe.isMobxAction=!0,fe}function ho(R,L,Z,fe){var Re=Nn();try{return L.apply(Z,fe)}catch(lt){throw Re.error=lt,lt}finally{qn(Re)}}function Nn(R,L,Z){var fe=0,Re=Le();Ui();var lt={prevDerivation:Re,prevAllowStateChanges:ut(!0),prevAllowStateReads:At(!0),notifySpy:!1,startTime:fe,actionId:ao++,parentActionId:Zn};return Zn=lt.actionId,lt}function qn(R){Zn!==R.actionId&&h("invalid action stack. did you forget to finish an action?"),Zn=R.parentActionId,R.error!==void 0&&(Sn.suppressReactionErrors=!0),vn(R.prevAllowStateChanges),Tt(R.prevAllowStateReads),gr(),dt(R.prevDerivation),R.notifySpy,Sn.suppressReactionErrors=!1}function rr(R,L){var Z,fe=ut(R);try{Z=L()}finally{vn(fe)}return Z}function ut(R){var L=Sn.allowStateChanges;return Sn.allowStateChanges=R,L}function vn(R){Sn.allowStateChanges=R}var In=(function(R){function L(Z,fe,Re,lt,It){Re===void 0&&(Re="ObservableValue@"+f()),It===void 0&&(It=Y.default);var bn=R.call(this,Re)||this;return bn.enhancer=fe,bn.name=Re,bn.equals=It,bn.hasUnreportedChange=!1,bn.value=fe(Z,void 0,Re),bn}return(function(Z,fe){function Re(){this.constructor=Z}W(Z,fe),Z.prototype=fe===null?Object.create(fe):(Re.prototype=fe.prototype,new Re)})(L,R),L.prototype.dehanceValue=function(Z){return this.dehancer!==void 0?this.dehancer(Z):Z},L.prototype.set=function(Z){this.value,(Z=this.prepareNewValue(Z))!==Sn.UNCHANGED&&this.setNewValue(Z)},L.prototype.prepareNewValue=function(Z){if(qt(this),Ja(this)){var fe=vo(this,{object:this,type:"update",newValue:Z});if(!fe)return Sn.UNCHANGED;Z=fe.newValue}return Z=this.enhancer(Z,this.value,this.name),this.equals(this.value,Z)?Sn.UNCHANGED:Z},L.prototype.setNewValue=function(Z){var fe=this.value;this.value=Z,this.reportChanged(),Ua(this)&&ha(this,{type:"update",object:this,newValue:Z,oldValue:fe})},L.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},L.prototype.intercept=function(Z){return El(this,Z)},L.prototype.observe=function(Z,fe){return fe&&Z({object:this,type:"update",newValue:this.value,oldValue:void 0}),Bl(this,Z)},L.prototype.toJSON=function(){return this.get()},L.prototype.toString=function(){return this.name+"["+this.value+"]"},L.prototype.valueOf=function(){return B(this.get())},L.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},L})(V),sr=M("ObservableValue",In),wo=(function(){function R(L){this.dependenciesState=ae.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ae.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new kt(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=re.NONE,v(L.get,"missing option for computed: get"),this.derivation=L.get,this.name=L.name||"ComputedValue@"+f(),L.set&&(this.setter=yo(this.name+"-setter",L.set)),this.equals=L.equals||(L.compareStructural||L.struct?Y.structural:Y.default),this.scope=L.context,this.requiresReaction=!!L.requiresReaction,this.keepAlive=!!L.keepAlive}return R.prototype.onBecomeStale=function(){(function(L){L.lowestObserverState===ae.UP_TO_DATE&&(L.lowestObserverState=ae.POSSIBLY_STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.dependenciesState=ae.POSSIBLY_STALE,Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale())})))})(this)},R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.get=function(){this.isComputing&&h("Cycle detected in computation "+this.name+": "+this.derivation),Sn.inBatch!==0||this.observers.size!==0||this.keepAlive?(gl(this),Gt(this)&&this.trackAndCompute()&&(function(Z){Z.lowestObserverState!==ae.STALE&&(Z.lowestObserverState=ae.STALE,Z.observers.forEach((function(fe){fe.dependenciesState===ae.POSSIBLY_STALE?fe.dependenciesState=ae.STALE:fe.dependenciesState===ae.UP_TO_DATE&&(Z.lowestObserverState=ae.UP_TO_DATE)})))})(this)):Gt(this)&&(this.warnAboutUntrackedRead(),Ui(),this.value=this.computeValue(!1),gr());var L=this.value;if(Rt(L))throw L.cause;return L},R.prototype.peek=function(){var L=this.computeValue(!1);if(Rt(L))throw L.cause;return L},R.prototype.set=function(L){if(this.setter){v(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,L)}finally{this.isRunningSetter=!1}}else v(!1,!1)},R.prototype.trackAndCompute=function(){var L=this.value,Z=this.dependenciesState===ae.NOT_TRACKING,fe=this.computeValue(!0),Re=Z||Rt(L)||Rt(fe)||!this.equals(L,fe);return Re&&(this.value=fe),Re},R.prototype.computeValue=function(L){var Z;if(this.isComputing=!0,Sn.computationDepth++,L)Z=On(this,this.derivation,this.scope);else if(Sn.disableErrorBoundaries===!0)Z=this.derivation.call(this.scope);else try{Z=this.derivation.call(this.scope)}catch(fe){Z=new kt(fe)}return Sn.computationDepth--,this.isComputing=!1,Z},R.prototype.suspend=function(){this.keepAlive||(ke(this),this.value=void 0)},R.prototype.observe=function(L,Z){var fe=this,Re=!0,lt=void 0;return ht((function(){var It=fe.get();if(!Re||Z){var bn=Le();L({type:"update",object:fe,newValue:It,oldValue:lt}),dt(bn)}Re=!1,lt=It}))},R.prototype.warnAboutUntrackedRead=function(){},R.prototype.toJSON=function(){return this.get()},R.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},R.prototype.valueOf=function(){return B(this.get())},R.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},R})(),oo=M("ComputedValue",wo),ta=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Ca={};function Yi(){return typeof window<"u"?window:a!==void 0?a:typeof self<"u"?self:Ca}var fa=!0,Ka=!1,Sn=(function(){var R=Yi();return R.__mobxInstanceCount>0&&!R.__mobxGlobals&&(fa=!1),R.__mobxGlobals&&R.__mobxGlobals.version!==new ta().version&&(fa=!1),fa?R.__mobxGlobals?(R.__mobxInstanceCount+=1,R.__mobxGlobals.UNCHANGED||(R.__mobxGlobals.UNCHANGED={}),R.__mobxGlobals):(R.__mobxInstanceCount=1,R.__mobxGlobals=new ta):(setTimeout((function(){Ka||h("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new ta)})();function Ts(R,L){R.observers.add(L),R.lowestObserverState>L.dependenciesState&&(R.lowestObserverState=L.dependenciesState)}function Oo(R,L){R.observers.delete(L),R.observers.size===0&&es(R)}function es(R){R.isPendingUnobservation===!1&&(R.isPendingUnobservation=!0,Sn.pendingUnobservations.push(R))}function Ui(){Sn.inBatch++}function gr(){if(--Sn.inBatch==0){yl();for(var R=Sn.pendingUnobservations,L=0;L0&&es(R),!1)}function pa(R,L){if(R.isTracing===re.BREAK){var Z=[];qi(vi(R),Z,1),new Function(`debugger; /* Tracing '`+R.name+`' You are entering this break point because derivation '`+R.name+"' is being traced and '"+L.name+`' is now forcing it to update. Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update The stackframe you are looking for is at least ~6-8 stack-frames up. `+(R instanceof wo?R.derivation.toString().replace(/[*]\//g,"/"):"")+` The dependencies for this derivation are: `+Z.join(` `)+` */ `)()}}function qi(R,L,Z){L.length>=1e3?L.push("(and many more)"):(L.push(""+new Array(Z).join(" ")+R.name),R.dependencies&&R.dependencies.forEach((function(fe){return qi(fe,L,Z+1)})))}var Na=(function(){function R(L,Z,fe,Re){L===void 0&&(L="Reaction@"+f()),Re===void 0&&(Re=!1),this.name=L,this.onInvalidate=Z,this.errorHandler=fe,this.requiresObservable=Re,this.observing=[],this.newObserving=[],this.dependenciesState=ae.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=re.NONE}return R.prototype.onBecomeStale=function(){this.schedule()},R.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Sn.pendingReactions.push(this),yl())},R.prototype.isScheduled=function(){return this._isScheduled},R.prototype.runReaction=function(){if(!this.isDisposed){if(Ui(),this._isScheduled=!1,Gt(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(L){this.reportExceptionInDerivation(L)}}gr()}},R.prototype.track=function(L){if(!this.isDisposed){Ui(),this._isRunning=!0;var Z=On(this,L,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ke(this),Rt(Z)&&this.reportExceptionInDerivation(Z.cause),gr()}},R.prototype.reportExceptionInDerivation=function(L){var Z=this;if(this.errorHandler)this.errorHandler(L,this);else{if(Sn.disableErrorBoundaries)throw L;Sn.suppressReactionErrors,Sn.globalReactionErrorHandlers.forEach((function(fe){return fe(L,Z)}))}},R.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ui(),ke(this),gr()))},R.prototype.getDisposer=function(){var L=this.dispose.bind(this);return L[I]=this,L},R.prototype.toString=function(){return"Reaction["+this.name+"]"},R.prototype.trace=function(L){L===void 0&&(L=!1),(function(){for(var Z=[],fe=0;fe0||Sn.isRunningReactions||al(Cs)}function Cs(){Sn.isRunningReactions=!0;for(var R=Sn.pendingReactions,L=0;R.length>0;){++L==100&&R.splice(0);for(var Z=R.splice(0),fe=0,Re=Z.length;fe",R):arguments.length===2&&typeof L=="function"?yo(R,L):arguments.length===1&&typeof R=="string"?cn(R):fe!==!0?cn(L).apply(null,arguments):void S(R,L,yo(R.name||L,Z.value,this))};function so(R,L){return ho(typeof R=="string"?R:R.name||"",typeof R=="function"?R:L,this,void 0)}function si(R){return typeof R=="function"&&R.isMobxAction===!0}function ye(R,L,Z){S(R,L,yo(L,Z.bind(R)))}function ht(R,L){L===void 0&&(L=l);var Z,fe=L&&L.name||R.name||"Autorun@"+f();if(!L.scheduler&&!L.delay)Z=new Na(fe,(function(){this.track(It)}),L.onError,L.requiresObservable);else{var Re=Rn(L),lt=!1;Z=new Na(fe,(function(){lt||(lt=!0,Re((function(){lt=!1,Z.isDisposed||Z.track(It)})))}),L.onError,L.requiresObservable)}function It(){R(Z)}return Z.schedule(),Z.getDisposer()}br.bound=function(R,L,Z,fe){return fe===!0?(ye(R,L,Z.value),null):Z?{configurable:!0,enumerable:!1,get:function(){return ye(this,L,Z.value||Z.initializer.call(this)),this[L]},set:mt}:{enumerable:!1,configurable:!0,set:function(Re){ye(this,L,Re)},get:function(){}}};var fn=function(R){return R()};function Rn(R){return R.scheduler?R.scheduler:R.delay?function(L){return setTimeout(L,R.delay)}:fn}function Cn(R,L,Z){Z===void 0&&(Z=l);var fe,Re,lt,It=Z.name||"Reaction@"+f(),bn=br(It,Z.onError?(fe=Z.onError,Re=L,function(){try{return Re.apply(this,arguments)}catch(wi){fe.call(this,wi)}}):L),Jn=!Z.scheduler&&!Z.delay,no=Rn(Z),$n=!0,Do=!1,Kr=Z.compareStructural?Y.structural:Z.equals||Y.default,So=new Na(It,(function(){$n||Jn?ul():Do||(Do=!0,no(ul))}),Z.onError,Z.requiresObservable);function ul(){if(Do=!1,!So.isDisposed){var wi=!1;So.track((function(){var el=R(So);wi=$n||!Kr(lt,el),lt=el})),$n&&Z.fireImmediately&&bn(lt,So),$n||wi!==!0||bn(lt,So),$n&&($n=!1)}}return So.schedule(),So.getDisposer()}function nr(R,L,Z){return Mn("onBecomeUnobserved",R,L,Z)}function Mn(R,L,Z,fe){var Re=typeof fe=="function"?sl(L,Z):sl(L),lt=typeof fe=="function"?fe:Z,It=R+"Listeners";return Re[It]?Re[It].add(lt):Re[It]=new Set([lt]),typeof Re[R]!="function"?h(!1):function(){var bn=Re[It];bn&&(bn.delete(lt),bn.size===0&&delete Re[It])}}function or(R){var L=R.enforceActions,Z=R.computedRequiresReaction,fe=R.computedConfigurable,Re=R.disableErrorBoundaries,lt=R.reactionScheduler,It=R.reactionRequiresObservable,bn=R.observableRequiresReaction;if(R.isolateGlobalState===!0&&((Sn.pendingReactions.length||Sn.inBatch||Sn.isRunningReactions)&&h("isolateGlobalState should be called before MobX is running any reactions"),Ka=!0,fa&&(--Yi().__mobxInstanceCount==0&&(Yi().__mobxGlobals=void 0),Sn=new ta)),L!==void 0){var Jn=void 0;switch(L){case!0:case"observed":Jn=!0;break;case!1:case"never":Jn=!1;break;case"strict":case"always":Jn="strict";break;default:h("Invalid value for 'enforceActions': '"+L+"', expected 'never', 'always' or 'observed'")}Sn.enforceActions=Jn,Sn.allowStateChanges=Jn!==!0&&Jn!=="strict"}Z!==void 0&&(Sn.computedRequiresReaction=!!Z),It!==void 0&&(Sn.reactionRequiresObservable=!!It),bn!==void 0&&(Sn.observableRequiresReaction=!!bn,Sn.allowStateReads=!Sn.observableRequiresReaction),fe!==void 0&&(Sn.computedConfigurable=!!fe),Re!==void 0&&(Sn.disableErrorBoundaries=!!Re),lt&&ts(lt)}function lr(R,L,Z,fe){var Re=qr(fe=we(fe));return Be(R),ll(R,fe.name,Re.enhancer),L&&na(R,L,Z,Re),R}function qr(R){return R.defaultDecorator||(R.deep===!1?pt:$e)}function na(R,L,Z,fe){var Re,lt;Ui();try{var It=F(L);try{for(var bn=J(It),Jn=bn.next();!Jn.done;Jn=bn.next()){var no=Jn.value,$n=Object.getOwnPropertyDescriptor(L,no),Do=(Z&&no in Z?Z[no]:$n.get?je:fe)(R,no,$n,!0);Do&&Object.defineProperty(R,no,Do)}}catch(Kr){Re={error:Kr}}finally{try{Jn&&!Jn.done&&(lt=bn.return)&<.call(bn)}finally{if(Re)throw Re.error}}}finally{gr()}}function vi(R,L){return bl(sl(R,L))}function bl(R){var L,Z,fe={name:R.name};return R.observing&&R.observing.length>0&&(fe.dependencies=(L=R.observing,Z=[],L.forEach((function(Re){Z.indexOf(Re)===-1&&Z.push(Re)})),Z).map(bl)),fe}var Vi=0;function Ns(){this.message="FLOW_CANCELLED"}function Fl(R){arguments.length!==1&&h("Flow expects 1 argument and cannot be used as decorator");var L=R.name||"";return function(){var Z,fe=this,Re=arguments,lt=++Vi,It=br(L+" - runid: "+lt+" - init",R).apply(fe,Re),bn=void 0,Jn=new Promise((function(no,$n){var Do=0;function Kr(wi){var el;bn=void 0;try{el=br(L+" - runid: "+lt+" - yield "+Do++,It.next).call(It,wi)}catch(ks){return $n(ks)}ul(el)}function So(wi){var el;bn=void 0;try{el=br(L+" - runid: "+lt+" - yield "+Do++,It.throw).call(It,wi)}catch(ks){return $n(ks)}ul(el)}function ul(wi){if(!wi||typeof wi.then!="function")return wi.done?no(wi.value):(bn=Promise.resolve(wi.value)).then(Kr,So);wi.then(ul,$n)}Z=$n,Kr(void 0)}));return Jn.cancel=br(L+" - runid: "+lt+" - cancel",(function(){try{bn&&Ro(bn);var no=It.return(void 0),$n=Promise.resolve(no.value);$n.then(E,E),Ro($n),Z(new Ns)}catch(Do){Z(Do)}})),Jn}}function Ro(R){typeof R.cancel=="function"&&R.cancel()}function La(R,L){if(R==null)return!1;if(L!==void 0){if(ia(R)===!1||!R[I].values.has(L))return!1;var Z=sl(R,L);return oo(Z)}return oo(R)}function id(R){return arguments.length>1?h(!1):La(R)}function _u(R,L){return typeof L!="string"?h(!1):La(R,L)}function Ia(R,L){return R!=null&&(L!==void 0?!!ia(R)&&R[I].values.has(L):ia(R)||!!R[I]||z(R)||_l(R)||oo(R))}function ra(R){return arguments.length!==1&&h(!1),Ia(R)}function wl(R){return ia(R)?R[I].getKeys():Wi(R)||Ki(R)?Array.from(R.keys()):xl(R)?R.map((function(L,Z){return Z})):h(!1)}function qo(R){return ia(R)?wl(R).map((function(L){return R[L]})):Wi(R)?wl(R).map((function(L){return R.get(L)})):Ki(R)?Array.from(R.values()):xl(R)?R.slice():h(!1)}function Uh(R){return ia(R)?wl(R).map((function(L){return[L,R[L]]})):Wi(R)?wl(R).map((function(L){return[L,R.get(L)]})):Ki(R)?Array.from(R.entries()):xl(R)?R.map((function(L,Z){return[Z,L]})):h(!1)}function Fa(R,L,Z){if(arguments.length!==2||Ki(R))if(ia(R)){var fe=R[I],Re=fe.values.get(L);Re?fe.write(L,Z):fe.addObservableProp(L,Z,fe.defaultEnhancer)}else if(Wi(R))R.set(L,Z);else if(Ki(R))R.add(L);else{if(!xl(R))return h(!1);typeof L!="number"&&(L=parseInt(L,10)),v(L>=0,"Not a valid index: '"+L+"'"),Ui(),L>=R.length&&(R.length=L+1),R[L]=Z,gr()}else{Ui();var lt=L;try{for(var It in lt)Fa(R,It,lt[It])}finally{gr()}}}function gp(R,L,Z,fe){return typeof Z=="function"?(function(Re,lt,It,bn){return ka(Re,lt).observe(It,bn)})(R,L,Z,fe):(function(Re,lt,It){return ka(Re).observe(lt,It)})(R,L,Z)}Ns.prototype=Object.create(Error.prototype);var yp={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ba(R,L,Z,fe){return fe.detectCycles&&R.set(L,Z),Z}function Za(R,L,Z){if(!L.recurseEverything&&!ra(R)||typeof R!="object")return R;if(R===null)return null;if(R instanceof Date)return R;if(sr(R))return Za(R.get(),L,Z);if(ra(R)&&wl(R),L.detectCycles===!0&&R!==null&&Z.has(R))return Z.get(R);if(xl(R)||Array.isArray(R)){var fe=Ba(Z,R,[],L),Re=R.map((function(Kr){return Za(Kr,L,Z)}));fe.length=Re.length;for(var lt=0,It=Re.length;lt0}function El(R,L){var Z=R.interceptors||(R.interceptors=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function vo(R,L){var Z=Le();try{for(var fe=Se(R.interceptors||[]),Re=0,lt=fe.length;Re0}function Bl(R,L){var Z=R.changeListeners||(R.changeListeners=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function ha(R,L){var Z=Le(),fe=R.changeListeners;if(fe){for(var Re=0,lt=(fe=fe.slice()).length;Re0?L.map(this.dehancer):L},R.prototype.intercept=function(L){return El(this,L)},R.prototype.observe=function(L,Z){return Z===void 0&&(Z=!1),Z&&L({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Bl(this,L)},R.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},R.prototype.setArrayLength=function(L){if(typeof L!="number"||L<0)throw new Error("[mobx.array] Out of range: "+L);var Z=this.values.length;if(L!==Z)if(L>Z){for(var fe=new Array(L-Z),Re=0;Relt?L=lt:L<0&&(L=Math.max(0,lt+L)),Z=arguments.length===1?lt-L:Z==null?0:Math.max(0,Math.min(Z,lt-L)),fe===void 0&&(fe=s),Ja(this)){var It=vo(this,{object:this.proxy,type:"splice",index:L,removedCount:Z,added:fe});if(!It)return s;Z=It.removedCount,fe=It.added}fe=fe.length===0?fe:fe.map((function(Jn){return Re.enhancer(Jn,void 0)}));var bn=this.spliceItemsIntoValues(L,Z,fe);return Z===0&&fe.length===0||this.notifyArraySplice(L,fe,bn),this.dehanceValues(bn)},R.prototype.spliceItemsIntoValues=function(L,Z,fe){var Re;if(fe.length<1e4)return(Re=this.values).splice.apply(Re,Se([L,Z],fe));var lt=this.values.slice(L,L+Z);return this.values=this.values.slice(0,L).concat(fe,this.values.slice(L+Z)),lt},R.prototype.notifyArrayChildUpdate=function(L,Z,fe){var Re=!this.owned&&!1,lt=Ua(this),It=lt||Re?{object:this.proxy,type:"update",index:L,newValue:Z,oldValue:fe}:null;this.atom.reportChanged(),lt&&ha(this,It)},R.prototype.notifyArraySplice=function(L,Z,fe){var Re=!this.owned&&!1,lt=Ua(this),It=lt||Re?{object:this.proxy,type:"splice",index:L,removed:fe,added:Z,removedCount:fe.length,addedCount:Z.length}:null;this.atom.reportChanged(),lt&&ha(this,It)},R})(),ui={intercept:function(R){return this[I].intercept(R)},observe:function(R,L){return L===void 0&&(L=!1),this[I].observe(R,L)},clear:function(){return this.splice(0)},replace:function(R){var L=this[I];return L.spliceWithArray(0,L.values.length,R)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(R,L){for(var Z=[],fe=2;fe-1&&(this.splice(Z,1),!0)},get:function(R){var L=this[I];if(L&&R=0&&Z++}R=Gn(R),L=Gn(L);var bn=It==="[object Array]";if(!bn){if(typeof R!="object"||typeof L!="object")return!1;var Jn=R.constructor,no=L.constructor;if(Jn!==no&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof no=="function"&&no instanceof no)&&"constructor"in R&&"constructor"in L)return!1}if(Z===0)return!1;Z<0&&(Z=-1),Re=Re||[];for(var $n=(fe=fe||[]).length;$n--;)if(fe[$n]===R)return Re[$n]===L;if(fe.push(R),Re.push(L),bn){if(($n=R.length)!==L.length)return!1;for(;$n--;)if(!dn(R[$n],L[$n],Z-1,fe,Re))return!1}else{var Do=Object.keys(R),Kr=void 0;if($n=Do.length,Object.keys(L).length!==$n)return!1;for(;$n--;)if(!Wr(L,Kr=Do[$n])||!dn(R[Kr],L[Kr],Z-1,fe,Re))return!1}return fe.pop(),Re.pop(),!0}function Gn(R){return xl(R)?R.slice():T(R)||Wi(R)||$(R)||Ki(R)?Array.from(R.entries()):R}function Wr(R,L){return Object.prototype.hasOwnProperty.call(R,L)}function mo(R){return R[Symbol.iterator]=ci,R}function ci(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ve,extras:{getDebugName:function(R,L){return(L!==void 0?sl(R,L):ia(R)||Wi(R)||Ki(R)?ka(R):sl(R)).name}},$mobx:I})}).call(this,r(163),r(68))},function(n,o,r){var i=r(113),a=r(42),s=r(179);i||a(Object.prototype,"toString",s,{unsafe:!0})},function(n,o,r){var i=r(41),a=r(100),s=r(80),l=r(58),f=r(116),h="Array Iterator",v=l.set,b=l.getterFor(h);n.exports=f(Array,"Array",(function(E,O){v(this,{type:h,target:i(E),index:0,kind:O})}),(function(){var E=b(this),O=E.target,w=E.kind,S=E.index++;return!O||S>=O.length?(E.target=void 0,{value:void 0,done:!0}):w=="keys"?{value:S,done:!1}:w=="values"?{value:O[S],done:!1}:{value:[S,O[S]],done:!1}}),"values"),s.Arguments=s.Array,a("keys"),a("values"),a("entries")},function(n,o,r){var i=r(16),a=r(7),s=r(46),l=r(76),f=r(34),h=r(15),v=r(71),b=r(36),E=r(108),O=r(18),w=r(35),S=r(96),M=r(30),T=r(33),$=r(54),D=r(87),P=r(32),B=r(40),F=r(41),I=r(86),V=r(39),z=r(69),X=r(60),Y=r(77),W=r(74),Q=r(139),J=r(112),ie=r(50),Se=r(38),Ae=r(84),Pe=r(98),De=r(42),ze=r(89),Ye=r(93),Be=r(72),Je=r(90),gt=r(28),le=r(140),Ze=r(141),pe=r(78),se=r(58),we=r(79).forEach,$e=Ye("hidden"),rt="Symbol",pt=gt("toPrimitive"),Lt=se.set,Jt=se.getterFor(rt),en=Object.prototype,zt=a.Symbol,it=zt&&zt.prototype,ae=a.TypeError,re=a.QObject,je=s("JSON","stringify"),vt=ie.f,q=Se.f,kt=Q.f,Rt=Ae.f,Gt=h([].push),Pn=ze("symbols"),qt=ze("op-symbols"),On=ze("string-to-symbol-registry"),ke=ze("symbol-to-string-registry"),Ke=ze("wks"),Le=!re||!re.prototype||!re.prototype.findChild,dt=b&&O((function(){return X(q({},"a",{get:function(){return q(this,"a",{value:7}).a}})).a!=7}))?function(Nn,qn,rr){var ut=vt(en,qn);ut&&delete en[qn],q(Nn,qn,rr),ut&&Nn!==en&&q(en,qn,ut)}:q,At=function(Nn,qn){var rr=Pn[Nn]=X(it);return Lt(rr,{type:rt,tag:Nn,description:qn}),b||(rr.description=qn),rr},Tt=function(Nn,qn,rr){Nn===en&&Tt(qt,qn,rr),P(Nn);var ut=I(qn);return P(rr),w(Pn,ut)?(rr.enumerable?(w(Nn,$e)&&Nn[$e][ut]&&(Nn[$e][ut]=!1),rr=X(rr,{enumerable:z(0,!1)})):(w(Nn,$e)||q(Nn,$e,z(1,{})),Nn[$e][ut]=!0),dt(Nn,ut,rr)):q(Nn,ut,rr)},En=function(Nn,qn){P(Nn);var rr=F(qn),ut=Y(rr).concat(yo(rr));return we(ut,(function(vn){b&&!f(Zn,rr,vn)||Tt(Nn,vn,rr[vn])})),Nn},Zn=function(Nn){var qn=I(Nn),rr=f(Rt,this,qn);return!(this===en&&w(Pn,qn)&&!w(qt,qn))&&(!(rr||!w(this,qn)||!w(Pn,qn)||w(this,$e)&&this[$e][qn])||rr)},ao=function(Nn,qn){var rr=F(Nn),ut=I(qn);if(rr!==en||!w(Pn,ut)||w(qt,ut)){var vn=vt(rr,ut);return!vn||!w(Pn,ut)||w(rr,$e)&&rr[$e][ut]||(vn.enumerable=!0),vn}},Lo=function(Nn){var qn=kt(F(Nn)),rr=[];return we(qn,(function(ut){w(Pn,ut)||w(Be,ut)||Gt(rr,ut)})),rr},yo=function(Nn){var qn=Nn===en,rr=kt(qn?qt:F(Nn)),ut=[];return we(rr,(function(vn){!w(Pn,vn)||qn&&!w(en,vn)||Gt(ut,Pn[vn])})),ut};if(E||(zt=function(){if($(it,this))throw ae("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?V(arguments[0]):void 0,qn=Je(Nn),rr=function(ut){this===en&&f(rr,qt,ut),w(this,$e)&&w(this[$e],qn)&&(this[$e][qn]=!1),dt(this,qn,z(1,ut))};return b&&Le&&dt(en,qn,{configurable:!0,set:rr}),At(qn,Nn)},De(it=zt.prototype,"toString",(function(){return Jt(this).tag})),De(zt,"withoutSetter",(function(Nn){return At(Je(Nn),Nn)})),Ae.f=Zn,Se.f=Tt,ie.f=ao,W.f=Q.f=Lo,J.f=yo,le.f=function(Nn){return At(gt(Nn),Nn)},b&&(q(it,"description",{configurable:!0,get:function(){return Jt(this).description}}),v||De(en,"propertyIsEnumerable",Zn,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!E,sham:!E},{Symbol:zt}),we(Y(Ke),(function(Nn){Ze(Nn)})),i({target:rt,stat:!0,forced:!E},{for:function(Nn){var qn=V(Nn);if(w(On,qn))return On[qn];var rr=zt(qn);return On[qn]=rr,ke[rr]=qn,rr},keyFor:function(Nn){if(!D(Nn))throw ae(Nn+" is not a symbol");if(w(ke,Nn))return ke[Nn]},useSetter:function(){Le=!0},useSimple:function(){Le=!1}}),i({target:"Object",stat:!0,forced:!E,sham:!b},{create:function(Nn,qn){return qn===void 0?X(Nn):En(X(Nn),qn)},defineProperty:Tt,defineProperties:En,getOwnPropertyDescriptor:ao}),i({target:"Object",stat:!0,forced:!E},{getOwnPropertyNames:Lo,getOwnPropertySymbols:yo}),i({target:"Object",stat:!0,forced:O((function(){J.f(1)}))},{getOwnPropertySymbols:function(Nn){return J.f(B(Nn))}}),je&&i({target:"JSON",stat:!0,forced:!E||O((function(){var Nn=zt();return je([Nn])!="[null]"||je({a:Nn})!="{}"||je(Object(Nn))!="{}"}))},{stringify:function(Nn,qn,rr){var ut=Pe(arguments),vn=qn;if((T(qn)||Nn!==void 0)&&!D(Nn))return S(qn)||(qn=function(In,sr){if(M(vn)&&(sr=f(vn,this,In,sr)),!D(sr))return sr}),ut[1]=qn,l(je,null,ut)}}),!it[pt]){var ho=it.valueOf;De(it,pt,(function(Nn){return f(ho,this)}))}pe(zt,rt),Be[$e]=!0},function(n,o,r){var i=r(7),a=r(152),s=r(153),l=r(3),f=r(57),h=r(28),v=h("iterator"),b=h("toStringTag"),E=l.values,O=function(S,M){if(S){if(S[v]!==E)try{f(S,v,E)}catch{S[v]=E}if(S[b]||f(S,b,M),a[M]){for(var T in l)if(S[T]!==l[T])try{f(S,T,l[T])}catch{S[T]=l[T]}}}};for(var w in a)O(i[w]&&i[w].prototype,w);O(s,"DOMTokenList")},function(n,o,r){var i=r(151).charAt,a=r(39),s=r(58),l=r(116),f="String Iterator",h=s.set,v=s.getterFor(f);l(String,"String",(function(b){h(this,{type:f,string:a(b),index:0})}),(function(){var b,E=v(this),O=E.string,w=E.index;return w>=O.length?{value:void 0,done:!0}:(b=i(O,w),E.index+=b.length,{value:b,done:!1})}))},function(n,o,r){(function(i){var a=function(s){return s&&s.Math==Math&&s};n.exports=a(typeof globalThis=="object"&&globalThis)||a(typeof window=="object"&&window)||a(typeof self=="object"&&self)||a(typeof i=="object"&&i)||(function(){return this})()||Function("return this")()}).call(this,r(68))},function(n,o,r){var i=r(16),a=r(36),s=r(7),l=r(15),f=r(35),h=r(30),v=r(54),b=r(39),E=r(38).f,O=r(134),w=s.Symbol,S=w&&w.prototype;if(a&&h(w)&&(!("description"in S)||w().description!==void 0)){var M={},T=function(){var V=arguments.length<1||arguments[0]===void 0?void 0:b(arguments[0]),z=v(S,this)?new w(V):V===void 0?w():w(V);return V===""&&(M[z]=!0),z};O(T,w),T.prototype=S,S.constructor=T;var $=String(w("test"))=="Symbol(test)",D=l(S.toString),P=l(S.valueOf),B=/^Symbol\((.*)\)[^)]+$/,F=l("".replace),I=l("".slice);E(S,"description",{configurable:!0,get:function(){var V=P(this),z=D(V);if(f(M,V))return"";var X=$?I(z,7,-1):F(z,B,"$1");return X===""?void 0:X}}),i({global:!0,forced:!0},{Symbol:T})}},function(n,o,r){r(141)("iterator")},function(n,o,r){r.d(o,"a",(function(){return l.a})),r.d(o,"c",(function(){return l.e})),r.d(o,"h",(function(){return B})),r.d(o,"i",(function(){return $})),r.d(o,"j",(function(){return M})),r.d(o,"b",(function(){return ie})),r.d(o,"e",(function(){return De})),r.d(o,"f",(function(){return Se})),r.d(o,"g",(function(){return Pn}));var i,a,s,l=r(0),f=0,h=[],v=l.i.__b,b=l.i.__r,E=l.i.diffed,O=l.i.__c,w=l.i.unmount;function S(ke,Ke){l.i.__h&&l.i.__h(a,ke,f||Ke),f=0;var Le=a.__H||(a.__H={__:[],__h:[]});return ke>=Le.__.length&&Le.__.push({}),Le.__[ke]}function M(ke){return f=1,T(W,ke)}function T(ke,Ke,Le){var dt=S(i++,2);return dt.t=ke,dt.__c||(dt.__=[Le?Le(Ke):W(void 0,Ke),function(At){var Tt=dt.t(dt.__[0],At);dt.__[0]!==Tt&&(dt.__=[Tt,dt.__[1]],dt.__c.setState({}))}],dt.__c=a),dt.__}function $(ke,Ke){var Le=S(i++,3);!l.i.__s&&Y(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__H.__h.push(Le))}function D(ke,Ke){var Le=S(i++,4);!l.i.__s&&Y(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__h.push(Le))}function P(ke,Ke){var Le=S(i++,7);return Y(Le.__H,Ke)&&(Le.__=ke(),Le.__H=Ke,Le.__h=ke),Le.__}function B(ke,Ke){return f=8,P((function(){return ke}),Ke)}function F(){var ke;for(h.sort((function(Ke,Le){return Ke.__v.__b-Le.__v.__b}));ke=h.pop();)if(ke.__P)try{ke.__H.__h.forEach(z),ke.__H.__h.forEach(X),ke.__H.__h=[]}catch(Ke){ke.__H.__h=[],l.i.__e(Ke,ke.__v)}}l.i.__b=function(ke){a=null,v&&v(ke)},l.i.__r=function(ke){b&&b(ke),i=0;var Ke=(a=ke.__c).__H;Ke&&(Ke.__h.forEach(z),Ke.__h.forEach(X),Ke.__h=[])},l.i.diffed=function(ke){E&&E(ke);var Ke=ke.__c;Ke&&Ke.__H&&Ke.__H.__h.length&&(h.push(Ke)!==1&&s===l.i.requestAnimationFrame||((s=l.i.requestAnimationFrame)||V)(F)),a=null},l.i.__c=function(ke,Ke){Ke.some((function(Le){try{Le.__h.forEach(z),Le.__h=Le.__h.filter((function(dt){return!dt.__||X(dt)}))}catch(dt){Ke.some((function(At){At.__h&&(At.__h=[])})),Ke=[],l.i.__e(dt,Le.__v)}})),O&&O(ke,Ke)},l.i.unmount=function(ke){w&&w(ke);var Ke,Le=ke.__c;Le&&Le.__H&&(Le.__H.__.forEach((function(dt){try{z(dt)}catch(At){Ke=At}})),Ke&&l.i.__e(Ke,Le.__v))};var I=typeof requestAnimationFrame=="function";function V(ke){var Ke,Le=function(){clearTimeout(dt),I&&cancelAnimationFrame(Ke),setTimeout(ke)},dt=setTimeout(Le,100);I&&(Ke=requestAnimationFrame(Le))}function z(ke){var Ke=a,Le=ke.__c;typeof Le=="function"&&(ke.__c=void 0,Le()),a=Ke}function X(ke){var Ke=a;ke.__c=ke.__(),a=Ke}function Y(ke,Ke){return!ke||ke.length!==Ke.length||Ke.some((function(Le,dt){return Le!==ke[dt]}))}function W(ke,Ke){return typeof Ke=="function"?Ke(ke):Ke}function Q(ke,Ke){for(var Le in Ke)ke[Le]=Ke[Le];return ke}function J(ke,Ke){for(var Le in ke)if(Le!=="__source"&&!(Le in Ke))return!0;for(var dt in Ke)if(dt!=="__source"&&ke[dt]!==Ke[dt])return!0;return!1}function ie(ke){this.props=ke}function Se(ke,Ke){function Le(At){var Tt=this.props.ref,En=Tt==At.ref;return!En&&Tt&&(Tt.call?Tt(null):Tt.current=null),Ke?!Ke(this.props,At)||!En:J(this.props,At)}function dt(At){return this.shouldComponentUpdate=Le,Object(l.e)(ke,At)}return dt.displayName="Memo("+(ke.displayName||ke.name)+")",dt.prototype.isReactComponent=!0,dt.__f=!0,dt}(ie.prototype=new l.a).isPureReactComponent=!0,ie.prototype.shouldComponentUpdate=function(ke,Ke){return J(this.props,ke)||J(this.state,Ke)};var Ae=l.i.__b;l.i.__b=function(ke){ke.type&&ke.type.__f&&ke.ref&&(ke.props.ref=ke.ref,ke.ref=null),Ae&&Ae(ke)};var Pe=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function De(ke){function Ke(Le,dt){var At=Q({},Le);return delete At.ref,ke(At,!(dt=Le.ref||dt)||typeof dt=="object"&&!("current"in dt)?null:dt)}return Ke.$$typeof=Pe,Ke.render=Ke,Ke.prototype.isReactComponent=Ke.__f=!0,Ke.displayName="ForwardRef("+(ke.displayName||ke.name)+")",Ke}var ze=function(ke,Ke){return ke==null?null:Object(l.k)(Object(l.k)(ke).map(Ke))},Ye={map:ze,forEach:ze,count:function(ke){return ke?Object(l.k)(ke).length:0},only:function(ke){var Ke=Object(l.k)(ke);if(Ke.length!==1)throw"Children.only";return Ke[0]},toArray:l.k},Be=l.i.__e;l.i.__e=function(ke,Ke,Le){if(ke.then){for(var dt,At=Ke;At=At.__;)if((dt=At.__c)&&dt.__c)return Ke.__e==null&&(Ke.__e=Le.__e,Ke.__k=Le.__k),dt.__c(ke,Ke)}Be(ke,Ke,Le)};var Je=l.i.unmount;function gt(ke,Ke,Le){return ke&&(ke.__c&&ke.__c.__H&&(ke.__c.__H.__.forEach((function(dt){typeof dt.__c=="function"&&dt.__c()})),ke.__c.__H=null),(ke=Q({},ke)).__c!=null&&(ke.__c.__P===Le&&(ke.__c.__P=Ke),ke.__c=null),ke.__k=ke.__k&&ke.__k.map((function(dt){return gt(dt,Ke,Le)}))),ke}function le(ke,Ke,Le){return ke&&(ke.__v=null,ke.__k=ke.__k&&ke.__k.map((function(dt){return le(dt,Ke,Le)})),ke.__c&&ke.__c.__P===Ke&&(ke.__e&&Le.insertBefore(ke.__e,ke.__d),ke.__c.__e=!0,ke.__c.__P=Le)),ke}function Ze(){this.__u=0,this.t=null,this.__b=null}function pe(ke){var Ke=ke.__.__c;return Ke&&Ke.__e&&Ke.__e(ke)}function se(){this.u=null,this.o=null}l.i.unmount=function(ke){var Ke=ke.__c;Ke&&Ke.__R&&Ke.__R(),Ke&&ke.__h===!0&&(ke.type=null),Je&&Je(ke)},(Ze.prototype=new l.a).__c=function(ke,Ke){var Le=Ke.__c,dt=this;dt.t==null&&(dt.t=[]),dt.t.push(Le);var At=pe(dt.__v),Tt=!1,En=function(){Tt||(Tt=!0,Le.__R=null,At?At(Zn):Zn())};Le.__R=En;var Zn=function(){if(!--dt.__u){if(dt.state.__e){var Lo=dt.state.__e;dt.__v.__k[0]=le(Lo,Lo.__c.__P,Lo.__c.__O)}var yo;for(dt.setState({__e:dt.__b=null});yo=dt.t.pop();)yo.forceUpdate()}},ao=Ke.__h===!0;dt.__u++||ao||dt.setState({__e:dt.__b=dt.__v.__k[0]}),ke.then(En,En)},Ze.prototype.componentWillUnmount=function(){this.t=[]},Ze.prototype.render=function(ke,Ke){if(this.__b){if(this.__v.__k){var Le=document.createElement("div"),dt=this.__v.__k[0].__c;this.__v.__k[0]=gt(this.__b,Le,dt.__O=dt.__P)}this.__b=null}var At=Ke.__e&&Object(l.e)(l.b,null,ke.fallback);return At&&(At.__h=null),[Object(l.e)(l.b,null,Ke.__e?null:ke.children),At]};var we=function(ke,Ke,Le){if(++Le[1]===Le[0]&&ke.o.delete(Ke),ke.props.revealOrder&&(ke.props.revealOrder[0]!=="t"||!ke.o.size))for(Le=ke.u;Le;){for(;Le.length>3;)Le.pop()();if(Le[1]>>1,1),Ke.i.removeChild(dt)}}),Object(l.j)(Object(l.e)($e,{context:Ke.context},ke.__v),Ke.l)):Ke.l&&Ke.componentWillUnmount()}(se.prototype=new l.a).__e=function(ke){var Ke=this,Le=pe(Ke.__v),dt=Ke.o.get(ke);return dt[0]++,function(At){var Tt=function(){Ke.props.revealOrder?(dt.push(At),we(Ke,ke,dt)):At()};Le?Le(Tt):Tt()}},se.prototype.render=function(ke){this.u=null,this.o=new Map;var Ke=Object(l.k)(ke.children);ke.revealOrder&&ke.revealOrder[0]==="b"&&Ke.reverse();for(var Le=Ke.length;Le--;)this.o.set(Ke[Le],this.u=[1,0,this.u]);return ke.children},se.prototype.componentDidUpdate=se.prototype.componentDidMount=function(){var ke=this;this.o.forEach((function(Ke,Le){we(ke,Le,Ke)}))};var pt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Lt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Jt=typeof document<"u",en=function(ke){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(ke)};l.a.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(ke){Object.defineProperty(l.a.prototype,ke,{configurable:!0,get:function(){return this["UNSAFE_"+ke]},set:function(Ke){Object.defineProperty(this,ke,{configurable:!0,writable:!0,value:Ke})}})}));var zt=l.i.event;function it(){}function ae(){return this.cancelBubble}function re(){return this.defaultPrevented}l.i.event=function(ke){return zt&&(ke=zt(ke)),ke.persist=it,ke.isPropagationStopped=ae,ke.isDefaultPrevented=re,ke.nativeEvent=ke};var je,vt={configurable:!0,get:function(){return this.class}},q=l.i.vnode;l.i.vnode=function(ke){var Ke=ke.type,Le=ke.props,dt=Le;if(typeof Ke=="string"){var At=Ke.indexOf("-")===-1;for(var Tt in dt={},Le){var En=Le[Tt];Jt&&Tt==="children"&&Ke==="noscript"||Tt==="value"&&"defaultValue"in Le&&En==null||(Tt==="defaultValue"&&"value"in Le&&Le.value==null?Tt="value":Tt==="download"&&En===!0?En="":/ondoubleclick/i.test(Tt)?Tt="ondblclick":/^onchange(textarea|input)/i.test(Tt+Ke)&&!en(Le.type)?Tt="oninput":/^onfocus$/i.test(Tt)?Tt="onfocusin":/^onblur$/i.test(Tt)?Tt="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(Tt)?Tt=Tt.toLowerCase():At&&Lt.test(Tt)?Tt=Tt.replace(/[A-Z0-9]/,"-$&").toLowerCase():En===null&&(En=void 0),dt[Tt]=En)}Ke=="select"&&dt.multiple&&Array.isArray(dt.value)&&(dt.value=Object(l.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.value.indexOf(Zn.props.value)!=-1}))),Ke=="select"&&dt.defaultValue!=null&&(dt.value=Object(l.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.multiple?dt.defaultValue.indexOf(Zn.props.value)!=-1:dt.defaultValue==Zn.props.value}))),ke.props=dt,Le.class!=Le.className&&(vt.enumerable="className"in Le,Le.className!=null&&(dt.class=Le.className),Object.defineProperty(dt,"className",vt))}ke.$$typeof=pt,q&&q(ke)};var kt=l.i.__r;l.i.__r=function(ke){kt&&kt(ke),je=ke.__c};var Rt={ReactCurrentDispatcher:{current:{readContext:function(ke){return je.__n[ke.__c].props.value}}}};function Gt(ke){return!!ke&&ke.$$typeof===pt}var Pn=function(ke,Ke){return ke(Ke)},qt=l.b,On={useState:M,useReducer:T,useEffect:$,useLayoutEffect:D,useRef:function(ke){return f=5,P((function(){return{current:ke}}),[])},useImperativeHandle:function(ke,Ke,Le){f=6,D((function(){typeof ke=="function"?ke(Ke()):ke&&(ke.current=Ke())}),Le==null?Le:Le.concat(ke))},useMemo:P,useCallback:B,useContext:function(ke){var Ke=a.context[ke.__c],Le=S(i++,9);return Le.c=ke,Ke?(Le.__==null&&(Le.__=!0,Ke.sub(a)),Ke.props.value):ke.__},useDebugValue:function(ke,Ke){l.i.useDebugValue&&l.i.useDebugValue(Ke?Ke(ke):ke)},version:"17.0.2",Children:Ye,render:function(ke,Ke,Le){return Ke.__k==null&&(Ke.textContent=""),Object(l.j)(ke,Ke),typeof Le=="function"&&Le(),ke?ke.__c:null},hydrate:function(ke,Ke,Le){return Object(l.h)(ke,Ke),typeof Le=="function"&&Le(),ke?ke.__c:null},unmountComponentAtNode:function(ke){return!!ke.__k&&(Object(l.j)(null,ke),!0)},createPortal:function(ke,Ke){return Object(l.e)(rt,{__v:ke,i:Ke})},createElement:l.e,createContext:l.d,createFactory:function(ke){return l.e.bind(null,ke)},cloneElement:function(ke){return Gt(ke)?l.c.apply(null,arguments):ke},createRef:l.f,Fragment:l.b,isValidElement:Gt,findDOMNode:function(ke){return ke&&(ke.base||ke.nodeType===1&&ke)||null},Component:l.a,PureComponent:ie,memo:Se,forwardRef:De,flushSync:function(ke,Ke){return ke(Ke)},unstable_batchedUpdates:Pn,StrictMode:qt,Suspense:Ze,SuspenseList:se,lazy:function(ke){var Ke,Le,dt;function At(Tt){if(Ke||(Ke=ke()).then((function(En){Le=En.default||En}),(function(En){dt=En})),dt)throw dt;if(!Le)throw Ke;return Object(l.e)(Le,Tt)}return At.displayName="Lazy",At.__f=!0,At},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Rt};o.d=On},function(n,o,r){var i=r(7),a=r(152),s=r(153),l=r(187),f=r(57),h=function(b){if(b&&b.forEach!==l)try{f(b,"forEach",l)}catch{b.forEach=l}};for(var v in a)a[v]&&h(i[v]&&i[v].prototype);h(s)},function(n,o,r){r(16)({target:"Object",stat:!0},{setPrototypeOf:r(102)})},function(n,o,r){var i=r(16),a=r(18),s=r(40),l=r(101),f=r(143);i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!f},{getPrototypeOf:function(h){return l(s(h))}})},function(n,o,r){var i=r(16),a=r(46),s=r(76),l=r(203),f=r(165),h=r(32),v=r(33),b=r(60),E=r(18),O=a("Reflect","construct"),w=Object.prototype,S=[].push,M=E((function(){function D(){}return!(O((function(){}),[],D)instanceof D)})),T=!E((function(){O((function(){}))})),$=M||T;i({target:"Reflect",stat:!0,forced:$,sham:$},{construct:function(D,P){f(D),h(P);var B=arguments.length<3?D:f(arguments[2]);if(T&&!M)return O(D,P,B);if(D==B){switch(P.length){case 0:return new D;case 1:return new D(P[0]);case 2:return new D(P[0],P[1]);case 3:return new D(P[0],P[1],P[2]);case 4:return new D(P[0],P[1],P[2],P[3])}var F=[null];return s(S,F,P),new(s(l,D,F))}var I=B.prototype,V=b(v(I)?I:w),z=s(D,V,P);return v(z)?z:V}})},function(n,o){var r=Function.prototype,i=r.bind,a=r.call,s=i&&i.bind(a);n.exports=i?function(l){return l&&s(a,l)}:function(l){return l&&function(){return a.apply(l,arguments)}}},function(n,o,r){var i=r(7),a=r(50).f,s=r(57),l=r(42),f=r(110),h=r(134),v=r(95);n.exports=function(b,E){var O,w,S,M,T,$=b.target,D=b.global,P=b.stat;if(O=D?i:P?i[$]||f($,{}):(i[$]||{}).prototype)for(w in E){if(M=E[w],S=b.noTargetGet?(T=a(O,w))&&T.value:O[w],!v(D?w:$+(P?".":"#")+w,b.forced)&&S!==void 0){if(typeof M==typeof S)continue;h(M,S)}(b.sham||S&&S.sham)&&s(M,"sham",!0),l(O,w,M,b)}}},function(n,o,r){var i=r(16),a=r(7),s=r(96),l=r(99),f=r(33),h=r(75),v=r(45),b=r(41),E=r(63),O=r(28),w=r(81),S=r(98),M=w("slice"),T=O("species"),$=a.Array,D=Math.max;i({target:"Array",proto:!0,forced:!M},{slice:function(P,B){var F,I,V,z=b(this),X=v(z),Y=h(P,X),W=h(B===void 0?X:B,X);if(s(z)&&(F=z.constructor,(l(F)&&(F===$||s(F.prototype))||f(F)&&(F=F[T])===null)&&(F=void 0),F===$||F===void 0))return S(z,Y,W);for(I=new(F===void 0?$:F)(D(W-Y,0)),V=0;Y1?arguments[1]:void 0)}})},function(n,o,r){var i=r(16),a=r(36),s=r(135),l=r(41),f=r(50),h=r(63);i({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(v){for(var b,E,O=l(v),w=f.f,S=s(O),M={},T=0;S.length>T;)(E=w(O,b=S[T++]))!==void 0&&h(M,b,E);return M}})},,function(n,o,r){var i=r(16),a=r(7),s=r(18),l=r(96),f=r(33),h=r(40),v=r(45),b=r(63),E=r(115),O=r(81),w=r(28),S=r(70),M=w("isConcatSpreadable"),T=9007199254740991,$="Maximum allowed index exceeded",D=a.TypeError,P=S>=51||!s((function(){var I=[];return I[M]=!1,I.concat()[0]!==I})),B=O("concat"),F=function(I){if(!f(I))return!1;var V=I[M];return V!==void 0?!!V:l(I)};i({target:"Array",proto:!0,forced:!P||!B},{concat:function(I){var V,z,X,Y,W,Q=h(this),J=E(Q,0),ie=0;for(V=-1,X=arguments.length;VT)throw D($);for(z=0;z=T)throw D($);b(J,ie++,W)}return J.length=ie,J}})},function(n,o,r){var i=r(7),a=r(89),s=r(35),l=r(90),f=r(108),h=r(132),v=a("wks"),b=i.Symbol,E=b&&b.for,O=h?b:b&&b.withoutSetter||l;n.exports=function(w){if(!s(v,w)||!f&&typeof v[w]!="string"){var S="Symbol."+w;f&&s(b,w)?v[w]=b[w]:v[w]=h&&E?E(S):O(S)}return v[w]}},function(n,o,r){var i=r(16),a=r(202);i({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},function(n,o){n.exports=function(r){return typeof r=="function"}},function(n,o,r){var i=r(106),a=typeof self=="object"&&self&&self.Object===Object&&self,s=i.a||a||Function("return this")();o.a=s},function(n,o,r){var i=r(7),a=r(33),s=i.String,l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not an object")}},function(n,o,r){var i=r(30);n.exports=function(a){return typeof a=="object"?a!==null:i(a)}},function(n,o){var r=Function.prototype.call;n.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(n,o,r){var i=r(15),a=r(40),s=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,f){return s(a(l),f)}},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}))},function(n,o,r){var i=r(16),a=r(79).map;i({target:"Array",proto:!0,forced:!r(81)("map")},{map:function(s){return a(this,s,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(7),a=r(36),s=r(133),l=r(32),f=r(86),h=i.TypeError,v=Object.defineProperty;o.f=a?v:function(b,E,O){if(l(b),E=f(E),l(O),s)try{return v(b,E,O)}catch{}if("get"in O||"set"in O)throw h("Accessors not supported");return"value"in O&&(b[E]=O.value),b}},function(n,o,r){var i=r(7),a=r(97),s=i.String;n.exports=function(l){if(a(l)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return s(l)}},function(n,o,r){var i=r(7),a=r(44),s=i.Object;n.exports=function(l){return s(a(l))}},function(n,o,r){var i=r(85),a=r(44);n.exports=function(s){return i(a(s))}},function(n,o,r){var i=r(7),a=r(30),s=r(35),l=r(57),f=r(110),h=r(92),v=r(58),b=r(73).CONFIGURABLE,E=v.get,O=v.enforce,w=String(String).split("String");(n.exports=function(S,M,T,$){var D,P=!!$&&!!$.unsafe,B=!!$&&!!$.enumerable,F=!!$&&!!$.noTargetGet,I=$&&$.name!==void 0?$.name:M;a(T)&&(String(I).slice(0,7)==="Symbol("&&(I="["+String(I).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!s(T,"name")||b&&T.name!==I)&&l(T,"name",I),(D=O(T)).source||(D.source=w.join(typeof I=="string"?I:""))),S!==i?(P?!F&&S[M]&&(B=!0):delete S[M],B?S[M]=T:l(S,M,T)):B?S[M]=T:f(M,T)})(Function.prototype,"toString",(function(){return a(this)&&E(this).source||h(this)}))},function(n,o,r){(function(i){r.d(o,"d",(function(){return l})),r.d(o,"c",(function(){return f})),r.d(o,"b",(function(){return h})),r.d(o,"a",(function(){return b}));var a=r(10),s=function(E,O){var w=typeof Symbol=="function"&&E[Symbol.iterator];if(!w)return E;var S,M,T=w.call(E),$=[];try{for(;(O===void 0||O-- >0)&&!(S=T.next()).done;)$.push(S.value)}catch(D){M={error:D}}finally{try{S&&!S.done&&(w=T.return)&&w.call(T)}finally{if(M)throw M.error}}return $};function l(){var E=s(Object(a.j)(0),2)[1];return Object(a.h)((function(){E((function(O){return O+1}))}),[])}function f(E){if(!E||typeof E!="object")return!1;var O=Object.getPrototypeOf(E);return!O||O===Object.prototype}function h(E){return typeof Symbol=="function"?Symbol.for(E):"__$mobx-react "+E+"__"}var v={};function b(){return typeof window<"u"?window:i!==void 0?i:typeof self<"u"?self:v}}).call(this,r(68))},function(n,o,r){var i=r(7).TypeError;n.exports=function(a){if(a==null)throw i("Can't call method on "+a);return a}},function(n,o,r){var i=r(94);n.exports=function(a){return i(a.length)}},function(n,o,r){var i=r(7),a=r(30),s=function(l){return a(l)?l:void 0};n.exports=function(l,f){return arguments.length<2?s(i[l]):i[l]&&i[l][f]}},function(n,o,r){var i=r(16),a=r(34),s=r(33),l=r(32),f=r(204),h=r(50),v=r(101);i({target:"Reflect",stat:!0},{get:function b(E,O){var w,S,M=arguments.length<3?E:arguments[2];return l(E)===M?E[O]:(w=h.f(E,O))?f(w)?w.value:w.get===void 0?void 0:a(w.get,M):s(S=v(E))?b(S,O,M):void 0}})},function(n,o,r){(function(i){var a=r(31),s=r(171),l=e&&!e.nodeType&&e,f=l&&typeof i=="object"&&i&&!i.nodeType&&i,h=f&&f.exports===l?a.a.Buffer:void 0,v=(h?h.isBuffer:void 0)||s.a;o.a=v}).call(this,r(122)(n))},function(n,o,r){(function(i){var a=r(106),s=e&&!e.nodeType&&e,l=s&&typeof i=="object"&&i&&!i.nodeType&&i,f=l&&l.exports===s&&a.a.process,h=(function(){try{var v=l&&l.require&&l.require("util").types;return v||f&&f.binding&&f.binding("util")}catch{}})();o.a=h}).call(this,r(122)(n))},function(n,o,r){var i=r(36),a=r(34),s=r(84),l=r(69),f=r(41),h=r(86),v=r(35),b=r(133),E=Object.getOwnPropertyDescriptor;o.f=i?E:function(O,w){if(O=f(O),w=h(w),b)try{return E(O,w)}catch{}if(v(O,w))return l(!a(s.f,O,w),O[w])}},function(n,o,r){var i=r(15),a=i({}.toString),s=i("".slice);n.exports=function(l){return s(a(l),8,-1)}},function(n,o,r){r(182)("Map",(function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}}),r(186))},function(n,o,r){var i=r(16),a=r(220).entries;i({target:"Object",stat:!0},{entries:function(s){return a(s)}})},function(n,o,r){var i=r(15);n.exports=i({}.isPrototypeOf)},function(n,o,r){var i=r(46);n.exports=i("navigator","userAgent")||""},function(n,o,r){var i=r(7),a=r(30),s=r(88),l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not a function")}},function(n,o,r){var i=r(36),a=r(38),s=r(69);n.exports=i?function(l,f,h){return a.f(l,f,s(1,h))}:function(l,f,h){return l[f]=h,l}},function(n,o,r){var i,a,s,l=r(175),f=r(7),h=r(15),v=r(33),b=r(57),E=r(35),O=r(109),w=r(93),S=r(72),M="Object already initialized",T=f.TypeError,$=f.WeakMap;if(l||O.state){var D=O.state||(O.state=new $),P=h(D.get),B=h(D.has),F=h(D.set);i=function(V,z){if(B(D,V))throw new T(M);return z.facade=V,F(D,V,z),z},a=function(V){return P(D,V)||{}},s=function(V){return B(D,V)}}else{var I=w("state");S[I]=!0,i=function(V,z){if(E(V,I))throw new T(M);return z.facade=V,b(V,I,z),z},a=function(V){return E(V,I)?V[I]:{}},s=function(V){return E(V,I)}}n.exports={set:i,get:a,has:s,enforce:function(V){return s(V)?a(V):i(V,{})},getterFor:function(V){return function(z){var X;if(!v(z)||(X=a(z)).type!==V)throw T("Incompatible receiver, "+V+" required");return X}}}},function(n,o){var r=Math.ceil,i=Math.floor;n.exports=function(a){var s=+a;return s!=s||s===0?0:(s>0?i:r)(s)}},function(n,o,r){var i,a=r(32),s=r(176),l=r(111),f=r(72),h=r(138),v=r(91),b=r(93),E=b("IE_PROTO"),O=function(){},w=function(T){return"