251 lines
1.9 MiB
251 lines
1.9 MiB
var p$=Object.defineProperty;var h$=(e,t,n)=>t in e?p$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var hl=(e,t,n)=>h$(e,typeof t!="symbol"?t+"":t,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 G$,fF as D2,fG as W$,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 Gn,c$ as cA,bX as mh,dw as BN,aJ as _e,bY as j2,aK as ft,b1 as Bn,aS as An,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 Ws,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 Wo,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-B3e42gr5.js";import{t as VN,a as GN,g as b9,i as Qd,n as w9,c as $2,l as c0,d as E9}from"./data-DcLt6YRU.js";import{_ as dp}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-V7F9E2WL.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-BSwxWd7W.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-B-Q9BQIC.js";import{c as N9,a as k9,b as P9,e as Gj,f as Sh,m as R9,d as D9,h as hw}from"./min-7TM9-lpu.js";import{c as V2,b as N1,i as G2,p as Wj,n as W2,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 G9,r as W9,o as z9,q as H9,s as X9,t as Xo}from"./uniqBy-CIxIzFYp.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-DWi7gHzD.js";import{l as Xj,_ as Yj}from"./vue-draggable-plus-CU3zOw-Z.js";import{_ as l7}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-xqv90rLm.js";import{_ as Fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const qj=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Jme}},Symbol.toStringTag,{value:"Module"}));var s7=NaN;function WN(e){return typeof e=="number"?e:kg(e)?s7:+e}function k1(e,t){return function(n,o){var r;if(n===void 0&&o===void 0)return t;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=WN(n),o=WN(o)),r=e(n,o)}return r}}var u7=k1(function(e,t){return e+t},0),c7="Expected a function";function d7(e,t){if(typeof t!="function")throw new TypeError(c7);return e=zo(e),function(){if(--e<1)return t.apply(this,arguments)}}var vw=IN&&new IN,Kj=vw?function(e,t){return vw.set(e,t),e}:tm;function S_(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=z_(e.prototype),o=e.apply(n,t);return lp(o)?o:n}}var f7=1;function p7(e,t,n){var o=t&f7,r=S_(e);function i(){var a=this&&this!==nm&&this instanceof i?r:e;return a.apply(o?n:this,arguments)}return i}var h7=Math.max;function Zj(e,t,n,o){for(var r=-1,i=e.length,a=n.length,s=-1,l=t.length,f=h7(i-a,0),h=Array(l+f),v=!o;++s<l;)h[s]=t[s];for(;++r<a;)(v||r<i)&&(h[n[r]]=e[r]);for(;f--;)h[s++]=e[r++];return h}var v7=Math.max;function Jj(e,t,n,o){for(var r=-1,i=e.length,a=-1,s=n.length,l=-1,f=t.length,h=v7(i-s,0),v=Array(h+f),b=!o;++r<h;)v[r]=e[r];for(var E=r;++l<f;)v[E+l]=t[l];for(;++a<s;)(b||r<i)&&(v[E+n[a]]=e[r++]);return v}function m7(e,t){for(var n=e.length,o=0;n--;)e[n]===t&&++o;return o}function P1(){}var g7=4294967295;function $o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g7,this.__views__=[]}$o.prototype=z_(P1.prototype);$o.prototype.constructor=$o;var H2=vw?function(e){return vw.get(e)}:Qy,Og={},y7=Object.prototype,_7=y7.hasOwnProperty;function H0(e){for(var t=e.name+"",n=Og[t],o=_7.call(Og,t)?n.length:0;o--;){var r=n[o],i=r.func;if(i==null||i==e)return r.name}return t}function rc(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}rc.prototype=z_(P1.prototype);rc.prototype.constructor=rc;function Qj(e){if(e instanceof $o)return e.clone();var t=new rc(e.__wrapped__,e.__chain__);return t.__actions__=Ku(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var b7=Object.prototype,w7=b7.hasOwnProperty;function ge(e){if(qd(e)&&!qa(e)&&!(e instanceof $o)){if(e instanceof rc)return e;if(w7.call(e,"__wrapped__"))return Qj(e)}return new rc(e)}ge.prototype=P1.prototype;ge.prototype.constructor=ge;function fA(e){var t=H0(e),n=ge[t];if(typeof n!="function"||!(t in $o.prototype))return!1;if(e===n)return!0;var o=H2(n);return!!o&&e===o[0]}var eL=v$(Kj),E7=/\{\n\/\* \[wrapped with (.+)\] \*/,x7=/,? & /;function O7(e){var t=e.match(E7);return t?t[1].split(x7):[]}var S7=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function A7(e,t){var n=t.length;if(!n)return e;var o=n-1;return t[o]=(n>1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace(S7,`{
|
||
/* [wrapped with `+t+`] */
|
||
`)}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(e,t){return Kd(L7,function(n){var o="_."+n[0];t&n[1]&&!hj(e,o)&&e.push(o)}),e.sort()}function tL(e,t,n){var o=t+"";return m$(e,A7(o,I7(O7(o),n)))}var F7=4,B7=8,zN=32,HN=64;function nL(e,t,n,o,r,i,a,s,l,f){var h=t&B7,v=h?a:void 0,b=h?void 0:a,E=h?i:void 0,O=h?void 0:i;t|=h?zN:HN,t&=~(h?HN:zN),t&F7||(t&=-4);var w=[e,t,r,E,v,O,b,s,l,f],S=n.apply(void 0,w);return fA(e)&&eL(S,w),S.placeholder=o,tL(S,e,t)}function Qg(e){var t=e;return t.placeholder}var $7=Math.min;function U7(e,t){for(var n=e.length,o=$7(t.length,n),r=Ku(e);o--;){var i=t[o];e[o]=H_(i,n)?r[i]:void 0}return e}var XN="__lodash_placeholder__";function Ah(e,t){for(var n=-1,o=e.length,r=0,i=[];++n<o;){var a=e[n];(a===t||a===XN)&&(e[n]=XN,i[r++]=n)}return i}var V7=1,G7=2,W7=8,z7=16,H7=128,X7=512;function R1(e,t,n,o,r,i,a,s,l,f){var h=t&H7,v=t&V7,b=t&G7,E=t&(W7|z7),O=t&X7,w=b?void 0:S_(e);function S(){for(var M=arguments.length,T=Array(M),$=M;$--;)T[$]=arguments[$];if(E)var D=Qg(S),P=m7(T,D);if(o&&(T=Zj(T,o,r,E)),i&&(T=Jj(T,i,a,E)),M-=P,E&&M<f){var B=Ah(T,D);return nL(e,t,R1,S.placeholder,n,T,B,s,l,f-M)}var F=v?n:this,I=b?F[e]:e;return M=T.length,s?T=U7(T,s):O&&M>1&&T.reverse(),h&&l<M&&(T.length=l),this&&this!==nm&&this instanceof S&&(I=w||S_(I)),I.apply(F,T)}return S}function Y7(e,t,n){var o=S_(e);function r(){for(var i=arguments.length,a=Array(i),s=i,l=Qg(r);s--;)a[s]=arguments[s];var f=i<3&&a[0]!==l&&a[i-1]!==l?[]:Ah(a,l);if(i-=f.length,i<n)return nL(e,t,R1,r.placeholder,void 0,a,f,void 0,void 0,n-i);var h=this&&this!==nm&&this instanceof r?o:e;return Qu(h,this,a)}return r}var q7=1;function K7(e,t,n,o){var r=t&q7,i=S_(e);function a(){for(var s=-1,l=arguments.length,f=-1,h=o.length,v=Array(h+l),b=this&&this!==nm&&this instanceof a?i:e;++f<h;)v[f]=o[f];for(;l--;)v[f++]=arguments[++s];return Qu(b,r?n:this,v)}return a}var YN="__lodash_placeholder__",YO=1,Z7=2,J7=4,qN=8,jy=128,KN=256,Q7=Math.min;function eU(e,t){var n=e[1],o=t[1],r=n|o,i=r<(YO|Z7|jy),a=o==jy&&n==qN||o==jy&&n==KN&&e[7].length<=t[8]||o==(jy|KN)&&t[7].length<=t[8]&&n==qN;if(!(i||a))return e;o&YO&&(e[2]=t[2],r|=n&YO?0:J7);var s=t[3];if(s){var l=e[3];e[3]=l?Zj(l,s,t[4]):s,e[4]=l?Ah(e[3],YN):t[4]}return s=t[5],s&&(l=e[5],e[5]=l?Jj(l,s,t[6]):s,e[6]=l?Ah(e[5],YN):t[6]),s=t[7],s&&(e[7]=s),o&jy&&(e[8]=e[8]==null?t[8]:Q7(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=r,e}var tU="Expected a function",ZN=1,nU=2,JN=8,QN=16,ek=32,rU=64,tk=Math.max;function fp(e,t,n,o,r,i,a,s){var l=t&nU;if(!l&&typeof e!="function")throw new TypeError(tU);var f=o?o.length:0;if(f||(t&=-97,o=r=void 0),a=a===void 0?a:tk(zo(a),0),s=s===void 0?s:zo(s),f-=r?r.length:0,t&rU){var h=o,v=r;o=r=void 0}var b=l?void 0:H2(e),E=[e,t,n,o,r,h,v,i,a,s];if(b&&eU(E,b),e=E[0],t=E[1],n=E[2],o=E[3],r=E[4],s=E[9]=E[9]===void 0?l?0:e.length:tk(E[9]-f,0),!s&&t&(JN|QN)&&(t&=-25),!t||t==ZN)var O=p7(e,t,n);else t==JN||t==QN?O=Y7(e,t,s):(t==ek||t==(ZN|ek))&&!r.length?O=K7(e,t,n,o):O=R1.apply(void 0,E);var w=b?Kj:eL;return tL(w(O,E),e,t)}var oU=128;function rL(e,t,n){return t=n?void 0:t,t=e&&t==null?e.length:t,fp(e,oU,void 0,void 0,void 0,void 0,t)}var iU=S1(function(e,t){N2(t,rm(t),e)}),pA=S1(function(e,t,n,o){N2(t,rm(t),e,o)}),aU=S1(function(e,t,n,o){N2(t,Zd(t),e,o)});function X2(e,t){for(var n=-1,o=t.length,r=Array(o),i=e==null;++n<o;)r[n]=i?void 0:om(e,t[n]);return r}var lU=im(X2),sU="[object DOMException]",uU="[object Error]";function Y2(e){if(!qd(e))return!1;var t=Kg(e);return t==uU||t==sU||typeof e.message=="string"&&typeof e.name=="string"&&!k2(e)}var oL=Yo(function(e,t){try{return Qu(e,void 0,t)}catch(n){return Y2(n)?n:new Error(n)}}),cU="Expected a function";function iL(e,t){var n;if(typeof t!="function")throw new TypeError(cU);return e=zo(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var dU=1,fU=32,D1=Yo(function(e,t,n){var o=dU;if(n.length){var r=Ah(n,Qg(D1));o|=fU}return fp(e,o,t,n,r)});D1.placeholder={};var pU=im(function(e,t){return Kd(t,function(n){n=A1(n),M1(e,n,D1(e[n],e))}),e}),hU=1,vU=2,mU=32,q2=Yo(function(e,t,n){var o=hU|vU;if(n.length){var r=Ah(n,Qg(q2));o|=mU}return fp(t,o,e,n,r)});q2.placeholder={};function Dh(e,t,n){var o=e.length;return n=n===void 0?o:n,!t&&n>=o?e:sp(e,t,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(e){return OU.test(e)}function SU(e){return e.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(e){return e.match(IU)||[]}function td(e){return ey(e)?FU(e):SU(e)}function fL(e){return function(t){t=Ri(t);var n=ey(t)?td(t):void 0,o=n?n[0]:t.charAt(0),r=n?Dh(n,1).join(""):t.slice(1);return o[e]()+r}}var K2=fL("toUpperCase");function pL(e){return K2(Ri(e).toLowerCase())}function Z2(e){return function(t){return e==null?void 0:e[t]}}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",GU="\\ufe20-\\ufe2f",WU="\\u20d0-\\u20ff",zU=VU+GU+WU,HU="["+zU+"]",XU=RegExp(HU,"g");function hL(e){return e=Ri(e),e&&e.replace(UU,$U).replace(XU,"")}var YU=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qU(e){return e.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(e){return KU.test(e)}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(e){return e.match(_V)||[]}function TL(e,t,n){return e=Ri(e),t=n?void 0:t,t===void 0?ZU(e)?bV(e):qU(e):e.match(t)||[]}var wV="['’]",EV=RegExp(wV,"g");function ty(e){return function(t){return $j(TL(hL(t).replace(EV,"")),e,"")}}var xV=ty(function(e,t,n){return t=t.toLowerCase(),e+(n?pL(t):t)}),OV=nm.isFinite,SV=Math.min;function J2(e){var t=Math[e];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=t(r[0]+"e"+(+r[1]+o));return r=(Ri(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-o))}return t(n)}}var AV=J2("ceil");function CL(e){var t=ge(e);return t.__chain__=!0,t}var MV=Math.ceil,TV=Math.max;function CV(e,t,n){(n?Nh(e,t,n):t===void 0)?t=1:t=TV(zo(t),0);var o=e==null?0:e.length;if(!o||t<1)return[];for(var r=0,i=0,a=Array(MV(o/t));r<o;)a[i++]=sp(e,r,r+=t);return a}var NV=1,kV=4;function PV(e,t){return t=typeof t=="function"?t:void 0,Zg(e,NV|kV,t)}var RV=4;function DV(e,t){return t=typeof t=="function"?t:void 0,Zg(e,RV,t)}function jV(){return new rc(this.value(),this.__chain__)}function LV(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return X_(qa(n)?Ku(n):[n],Jd(t,1))}var IV="Expected a function";function FV(e){var t=e==null?0:e.length,n=_i;return e=t?Es(e,function(o){if(typeof o[1]!="function")throw new TypeError(IV);return[n(o[0]),o[1]]}):[],Yo(function(o){for(var r=-1;++r<t;){var i=e[r];if(Qu(i[0],this,o))return Qu(i[1],this,o)}})}function NL(e,t,n){var o=n.length;if(e==null)return!o;for(e=Object(e);o--;){var r=n[o],i=t[r],a=e[r];if(a===void 0&&!(r in e)||!i(a))return!1}return!0}function BV(e){var t=Zd(e);return function(n){return NL(n,e,t)}}var $V=1;function UV(e){return BV(Zg(e,$V))}function VV(e,t){return t==null||NL(e,t,Zd(t))}var GV=Object.prototype,WV=GV.hasOwnProperty,zV=V2(function(e,t,n){WV.call(e,n)?++e[n]:M1(e,n,1)});function HV(e,t){var n=z_(e);return t==null?n:g$(n,t)}var XV=8;function Q2(e,t,n){t=n?void 0:t;var o=fp(e,XV,void 0,void 0,void 0,void 0,void 0,t);return o.placeholder=Q2.placeholder,o}Q2.placeholder={};var YV=16;function eM(e,t,n){t=n?void 0:t;var o=fp(e,YV,void 0,void 0,void 0,void 0,void 0,t);return o.placeholder=eM.placeholder,o}eM.placeholder={};function qV(e,t){return e==null||e!==e?t:e}function kL(e,t,n,o,r,i){return lp(e)&&lp(t)&&(i.set(t,e),vj(e,t,void 0,kL,i),i.delete(t)),e}var PL=S1(function(e,t,n,o){vj(e,t,n,o)}),KV=Yo(function(e){return e.push(void 0,kL),Qu(PL,void 0,e)}),ZV="Expected a function";function RL(e,t,n){if(typeof e!="function")throw new TypeError(ZV);return setTimeout(function(){e.apply(void 0,n)},t)}var JV=Yo(function(e,t){return RL(e,1,t)}),QV=Yo(function(e,t,n){return RL(e,Pg(t)||0,n)}),eG=Yo(function(e,t){var n=ec(t);return Ll(n)&&(n=void 0),Ll(e)?N1(e,Jd(t,1,Ll,!0),_i(n)):[]}),tG=Yo(function(e,t){var n=ec(t);return Ll(n)&&(n=void 0),Ll(e)?N1(e,Jd(t,1,Ll,!0),void 0,n):[]}),nG=k1(function(e,t){return e/t},1);function j1(e,t,n,o){for(var r=e.length,i=o?r:-1;(o?i--:++i<r)&&t(e[i],i,e););return n?sp(e,o?0:i,o?i+1:r):sp(e,o?i+1:0,o?r:i)}function rG(e,t){return e&&e.length?j1(e,_i(t),!0,!0):[]}function oG(e,t){return e&&e.length?j1(e,_i(t),!0):[]}function iG(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}var DL=y$(!0);function tM(e,t){return e&&DL(e,t,Zd)}var jL=_$(tM,!0);function aG(e,t){var n=qa(e)?iG:jL;return n(e,lm(t))}function lG(e,t,n){e=Ri(e),t=ed(t);var o=e.length;n=n===void 0?o:Jg(zo(n),0,o);var r=n;return n-=t.length,n>=0&&e.slice(n,r)==t}function sG(e,t){return Es(t,function(n){return[n,e[n]]})}function uG(e){var t=-1,n=Array(e.size);return e.forEach(function(o){n[++t]=[o,o]}),n}var cG="[object Map]",dG="[object Set]";function LL(e){return function(t){var n=T1(t);return n==cG?mj(t):n==dG?uG(t):sG(t,e(t))}}var pp=LL(Zd),fG=LL(rm),pG={"&":"&","<":"<",">":">",'"':""","'":"'"},hG=Z2(pG),IL=/[&<>"']/g,vG=RegExp(IL.source);function FL(e){return e=Ri(e),e&&vG.test(e)?e.replace(IL,hG):e}var BL=/[\\^$.*+?()[\]{}|]/g,mG=RegExp(BL.source);function gG(e){return e=Ri(e),e&&mG.test(e)?e.replace(BL,"\\$&"):e}var yG=4294967295;function $L(e){return e?Jg(zo(e),0,yG):0}function _G(e,t,n,o){var r=e.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<o;)e[n++]=t;return e}function bG(e,t,n,o){var r=e==null?0:e.length;return r?(n&&typeof n!="number"&&Nh(e,t,n)&&(n=0,o=r),_G(e,t,n,o)):[]}function UL(e,t,n){var o;return n(e,function(r,i,a){if(t(r,i,a))return o=i,!1}),o}function wG(e,t){return UL(e,_i(t),am)}var EG=N9(gj);function xG(e,t){return UL(e,_i(t),tM)}var OG=1/0;function SG(e,t){return Jd(tc(e,t),OG)}function AG(e,t,n){return n=n===void 0?1:zo(n),Jd(tc(e,t),n)}function MG(e,t){var n=e==null?0:e.length;return n?(t=t===void 0?1:zo(t),Jd(e,t)):[]}var TG=512;function CG(e){return fp(e,TG)}var NG=J2("floor"),kG="Expected a function",PG=8,RG=32,DG=128,jG=256;function VL(e){return im(function(t){var n=t.length,o=n,r=rc.prototype.thru;for(e&&t.reverse();o--;){var i=t[o];if(typeof i!="function")throw new TypeError(kG);if(r&&!a&&H0(i)=="wrapper")var a=new rc([],!0)}for(o=a?o:n;++o<n;){i=t[o];var s=H0(i),l=s=="wrapper"?H2(i):void 0;l&&fA(l[0])&&l[1]==(DG|PG|RG|jG)&&!l[4].length&&l[9]==1?a=a[H0(l[0])].apply(a,l[3]):a=i.length==1&&fA(i)?a[s]():a.thru(i)}return function(){var f=arguments,h=f[0];if(a&&f.length==1&&qa(h))return a.plant(h).value();for(var v=0,b=n?t[v].apply(this,f):h;++v<n;)b=t[v].call(this,b);return b}})}var LG=VL(),IG=VL(!0);function FG(e,t){return e==null?e:DL(e,lm(t),rm)}function BG(e,t){return e&&tM(e,lm(t))}function L1(e,t){return Y_(t,function(n){return kh(e[n])})}function $G(e){return e==null?[]:L1(e,Zd(e))}function UG(e){return e==null?[]:L1(e,rm(e))}function I1(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Pg(t),n=Pg(n)),e(t,n)}}var VG=I1(Hj),GG=I1(function(e,t){return e>=t}),WG=Math.max,zG=Math.min;function HG(e,t,n){return e>=zG(t,n)&&e<WG(t,n)}function XG(e,t,n){return t=w_(t),n===void 0?(n=t,t=0):n=w_(n),e=Pg(e),HG(e,t,n)}function YG(e){var t=e==null?0:e.length;return t?sp(e,0,-1):[]}var qG=Math.min;function nM(e,t,n){for(var o=n?w$:hj,r=e[0].length,i=e.length,a=i,s=Array(i),l=1/0,f=[];a--;){var h=e[a];a&&t&&(h=Es(h,Hv(t))),l=qG(h.length,l),s[a]=!n&&(t||r>=120&&h.length>=120)?new b$(a&&h):void 0}h=e[0];var v=-1,b=s[0];e:for(;++v<r&&f.length<l;){var E=h[v],O=t?t(E):E;if(E=n||E!==0?E:0,!(b?FN(b,O):o(f,O,n))){for(a=i;--a;){var w=s[a];if(!(w?FN(w,O):o(e[a],O,n)))continue e}b&&b.push(O),f.push(E)}}return f}function rM(e){return Ll(e)?e:[]}var KG=Yo(function(e){var t=Es(e,rM);return t.length&&t[0]===e[0]?nM(t):[]}),ZG=Yo(function(e){var t=ec(e),n=Es(e,rM);return t===ec(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?nM(n,_i(t)):[]}),JG=Yo(function(e){var t=ec(e),n=Es(e,rM);return t=typeof t=="function"?t:void 0,t&&n.pop(),n.length&&n[0]===e[0]?nM(n,void 0,t):[]});function QG(e,t,n,o){return am(e,function(r,i,a){t(o,n(r),i,a)}),o}function GL(e,t){return function(n,o){return QG(n,e,t(o),{})}}var eW=Object.prototype,tW=eW.toString,nW=GL(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=tW.call(t)),e[t]=n},yj(tm)),WL=Object.prototype,rW=WL.hasOwnProperty,oW=WL.toString,iW=GL(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=oW.call(t)),rW.call(e,t)?e[t].push(n):e[t]=[n]},_i);function Q_(e,t,n){t=_j(t,e),e=E$(e,t);var o=e==null?e:e[A1(ec(t))];return o==null?void 0:Qu(o,e,n)}var aW=Yo(Q_),lW=Yo(function(e,t,n){var o=-1,r=typeof t=="function",i=C1(e)?Array(e.length):[];return x$(e,function(a){i[++o]=r?Qu(t,a,n):Q_(a,t,n)}),i}),sW="[object ArrayBuffer]";function uW(e){return qd(e)&&Kg(e)==sW}var ak=uw&&uw.isArrayBuffer,cW=ak?Hv(ak):uW,dW="[object Boolean]";function mw(e){return e===!0||e===!1||qd(e)&&Kg(e)==dW}var fW="[object Date]";function pW(e){return qd(e)&&Kg(e)==fW}var lk=uw&&uw.isDate,hW=lk?Hv(lk):pW;function vW(e){return qd(e)&&e.nodeType===1&&!k2(e)}function mW(e,t,n){n=typeof n=="function"?n:void 0;var o=n?n(e,t):void 0;return o===void 0?O$(e,t,void 0,n):!!o}var gW=nm.isFinite;function yW(e){return typeof e=="number"&&gW(e)}function zL(e){return typeof e=="number"&&e==zo(e)}function _W(e,t){return e===t||bj(e,t,wj(t))}function bW(e,t,n){return n=typeof n=="function"?n:void 0,bj(e,t,wj(t),n)}var wW="[object Number]";function HL(e){return typeof e=="number"||qd(e)&&Kg(e)==wW}function EW(e){return HL(e)&&e!=+e}var xW=S$?kh:Ej,OW="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function SW(e){if(xW(e))throw new Error(OW);return A$(e)}var sk=9007199254740991;function AW(e){return zL(e)&&e>=-sk&&e<=sk}var MW="[object WeakMap]";function TW(e){return qd(e)&&T1(e)==MW}var CW="[object WeakSet]";function NW(e){return qd(e)&&Kg(e)==CW}var kW=1;function PW(e){return _i(typeof e=="function"?e:Zg(e,kW))}var RW=Array.prototype,DW=RW.join;function jW(e,t){return e==null?"":DW.call(e,t)}var LW=ty(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),IW=V2(function(e,t,n){M1(e,n,t)});function FW(e,t,n){for(var o=n+1;o--;)if(e[o]===t)return o;return o}var BW=Math.max,$W=Math.min;function UW(e,t,n){var o=e==null?0:e.length;if(!o)return-1;var r=o;return n!==void 0&&(r=zo(n),r=r<0?BW(o+r,0):$W(r,o-1)),t===t?FW(e,t,r):M$(e,T$,r,!0)}var VW=ty(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),GW=fL("toLowerCase"),WW=I1(k9),zW=I1(function(e,t){return e<=t});function XL(e,t){var n={};return t=_i(t),am(e,function(o,r,i){M1(n,t(o,r,i),o)}),n}var HW=1;function XW(e){return C$(Zg(e,HW))}var YW=1;function qW(e,t){return N$(e,Zg(t,YW))}function KW(e,t){return e&&e.length?P9(e,_i(t),Hj):void 0}function oM(e,t){for(var n,o=-1,r=e.length;++o<r;){var i=t(e[o]);i!==void 0&&(n=n===void 0?i:n+i)}return n}var ZW=NaN;function YL(e,t){var n=e==null?0:e.length;return n?oM(e,t)/n:ZW}function JW(e){return YL(e,tm)}function QW(e,t){return YL(e,_i(t))}var ez=Yo(function(e,t){return function(n){return Q_(n,e,t)}}),tz=Yo(function(e,t){return function(n){return Q_(e,n,t)}});function nz(e,t,n){var o=Zd(t),r=L1(t,o),i=!(lp(n)&&"chain"in n)||!!n.chain,a=kh(e);return Kd(r,function(s){var l=t[s];e[s]=l,a&&(e.prototype[s]=function(){var f=this.__chain__;if(i||f){var h=e(this.__wrapped__),v=h.__actions__=Ku(this.__actions__);return v.push({func:l,args:arguments,thisArg:e}),h.__chain__=f,h}return l.apply(e,X_([this.value()],arguments))})}),e}var rz=k1(function(e,t){return e*t},1);function oz(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}var iz="[object Map]",az="[object Set]",qO=cw?cw.iterator:void 0;function qL(e){if(!e)return[];if(C1(e))return G2(e)?td(e):Ku(e);if(qO&&e[qO])return oz(e[qO]());var t=T1(e),n=t==iz?mj:t==az?k$:J_;return n(e)}function lz(){this.__values__===void 0&&(this.__values__=qL(this.value()));var e=this.__index__>=this.__values__.length,t=e?void 0:this.__values__[this.__index__++];return{done:e,value:t}}function KL(e,t){var n=e.length;if(n)return t+=t<0?n:0,H_(t,n)?e[t]:void 0}function sz(e,t){return e&&e.length?KL(e,zo(t)):void 0}function uz(e){return e=zo(e),Yo(function(t){return KL(t,e)})}function cz(e,t){return Wj(e,W2(_i(t)))}function dz(e){return iL(2,e)}function fz(e,t,n,o){return e==null?[]:(qa(t)||(t=t==null?[]:[t]),n=o?void 0:n,qa(n)||(n=n==null?[]:[n]),Y9(e,t,n))}function iM(e){return im(function(t){return t=Es(t,Hv(_i)),Yo(function(n){var o=this;return e(t,function(r){return Qu(r,o,n)})})})}var pz=iM(Es),hz=Yo,vz=Math.min,mz=hz(function(e,t){t=t.length==1&&qa(t[0])?Es(t[0],Hv(_i)):Es(Jd(t,1),Hv(_i));var n=t.length;return Yo(function(o){for(var r=-1,i=vz(o.length,n);++r<i;)o[r]=t[r].call(this,o[r]);return Qu(e,this,o)})}),gz=iM(j9),yz=iM(P$),_z=9007199254740991,bz=Math.floor;function mA(e,t){var n="";if(!e||t<1||t>_z)return n;do t%2&&(n+=e),t=bz(t/2),t&&(e+=e);while(t);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(e){for(var t=uk.lastIndex=0;uk.test(e);)++t;return t}function ny(e){return ey(e)?Rz(e):wz(e)}var Dz=Math.ceil;function gw(e,t){t=t===void 0?" ":ed(t);var n=t.length;if(n<2)return n?mA(t,e):t;var o=mA(t,Dz(e/ny(t)));return ey(t)?Dh(td(o),0,e).join(""):o.slice(0,e)}var jz=Math.ceil,Lz=Math.floor;function Iz(e,t,n){e=Ri(e),t=zo(t);var o=t?ny(e):0;if(!t||o>=t)return e;var r=(t-o)/2;return gw(Lz(r),n)+e+gw(jz(r),n)}function Fz(e,t,n){e=Ri(e),t=zo(t);var o=t?ny(e):0;return t&&o<t?e+gw(t-o,n):e}function Bz(e,t,n){e=Ri(e),t=zo(t);var o=t?ny(e):0;return t&&o<t?gw(t-o,n)+e:e}var $z=/^\s+/,Uz=nm.parseInt;function Vz(e,t,n){return n||t==null?t=0:t&&(t=+t),Uz(Ri(e).replace($z,""),t||0)}var Gz=32,F1=Yo(function(e,t){var n=Ah(t,Qg(F1));return fp(e,Gz,void 0,t,n)});F1.placeholder={};var Wz=64,aM=Yo(function(e,t){var n=Ah(t,Qg(aM));return fp(e,Wz,void 0,t,n)});aM.placeholder={};var zz=V2(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function Hz(e){for(var t,n=this;n instanceof P1;){var o=Qj(n);o.__index__=0,o.__values__=void 0,t?r.__wrapped__=o:t=o;var r=o;n=n.__wrapped__}return r.__wrapped__=e,t}function Xz(e){return function(t){return e==null?void 0:Oj(e,t)}}function Yz(e,t,n,o){for(var r=n-1,i=e.length;++r<i;)if(o(e[r],t))return r;return-1}var qz=Array.prototype,ck=qz.splice;function lM(e,t,n,o){var r=o?Yz:P2,i=-1,a=t.length,s=e;for(e===t&&(t=Ku(t)),n&&(s=Es(e,Hv(n)));++i<a;)for(var l=0,f=t[i],h=n?n(f):f;(l=r(s,h,l,o))>-1;)s!==e&&ck.call(s,l,1),ck.call(e,l,1);return e}function r3(e,t){return e&&e.length&&t&&t.length?lM(e,t):e}var Kz=Yo(r3);function Zz(e,t,n){return e&&e.length&&t&&t.length?lM(e,t,_i(n)):e}function Jz(e,t,n){return e&&e.length&&t&&t.length?lM(e,t,void 0,n):e}var Qz=Array.prototype,eH=Qz.splice;function o3(e,t){for(var n=e?t.length:0,o=n-1;n--;){var r=t[n];if(n==o||r!==i){var i=r;H_(r)?eH.call(e,r,1):Sj(e,r)}}return e}var tH=im(function(e,t){var n=e==null?0:e.length,o=X2(e,t);return o3(e,Es(t,function(r){return H_(r,n)?+r:r}).sort(q9)),o}),nH=Math.floor,rH=Math.random;function sM(e,t){return e+nH(rH()*(t-e+1))}var oH=parseFloat,iH=Math.min,aH=Math.random;function lH(e,t,n){if(n&&typeof n!="boolean"&&Nh(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=w_(e),t===void 0?(t=e,e=0):t=w_(t)),e>t){var o=e;e=t,t=o}if(n||e%1||t%1){var r=aH();return iH(e+r*(t-e+oH("1e-"+((r+"").length-1))),t)}return sM(e,t)}var sH=K9(!0),uH=256,cH=im(function(e,t){return fp(e,uH,void 0,void 0,void 0,t)});function dH(e,t,n,o){var r=e==null?0:e.length;for(o&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function fH(e,t,n){var o=qa(e)?dH:T9,r=arguments.length<3;return o(e,_i(t),n,r,jL)}function pH(e,t){var n=[];if(!(e&&e.length))return n;var o=-1,r=[],i=e.length;for(t=_i(t);++o<i;){var a=e[o];t(a,o,e)&&(n.push(a),r.push(o))}return o3(e,r),n}function hH(e,t,n){return(n?Nh(e,t,n):t===void 0)?t=1:t=zo(t),mA(Ri(e),t)}function vH(){var e=arguments,t=Ri(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var mH="Expected a function";function gH(e,t){if(typeof e!="function")throw new TypeError(mH);return t=t===void 0?t:zo(t),Yo(e,t)}function yH(e,t,n){t=_j(t,e);var o=-1,r=t.length;for(r||(r=1,e=void 0);++o<r;){var i=e==null?void 0:e[A1(t[o])];i===void 0&&(o=r,i=n),e=kh(i)?i.call(e):i}return e}var _H=Array.prototype,bH=_H.reverse;function _A(e){return e==null?e:bH.call(e)}var wH=J2("round");function i3(e){var t=e.length;return t?e[sM(0,t-1)]:void 0}function EH(e){return i3(J_(e))}function xH(e){var t=qa(e)?i3:EH;return t(e)}function B1(e,t){var n=-1,o=e.length,r=o-1;for(t=t===void 0?o:t;++n<t;){var i=sM(n,r),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}function OH(e,t){return B1(Ku(e),Jg(t,0,e.length))}function SH(e,t){var n=J_(e);return B1(n,Jg(t,0,n.length))}function AH(e,t,n){(n?Nh(e,t,n):t===void 0)?t=1:t=zo(t);var o=qa(e)?OH:SH;return o(e,t)}function MH(e,t,n,o){return o=typeof o=="function"?o:void 0,e==null?e:R2(e,t,n,o)}function TH(e){return B1(Ku(e))}function CH(e){return B1(J_(e))}function NH(e){var t=qa(e)?TH:CH;return t(e)}var kH="[object Map]",PH="[object Set]";function RH(e){if(e==null)return 0;if(C1(e))return G2(e)?ny(e):e.length;var t=T1(e);return t==kH||t==PH?e.size:R$(e).length}function DH(e,t,n){var o=e==null?0:e.length;return o?(n&&typeof n!="number"&&Nh(e,t,n)?(t=0,n=o):(t=t==null?0:zo(t),n=n===void 0?o:zo(n)),sp(e,t,n)):[]}var jH=ty(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),LH=4294967295,IH=LH-1,FH=Math.floor,BH=Math.min;function uM(e,t,n,o){var r=0,i=e==null?0:e.length;if(i===0)return 0;t=n(t);for(var a=t!==t,s=t===null,l=kg(t),f=t===void 0;r<i;){var h=FH((r+i)/2),v=n(e[h]),b=v!==void 0,E=v===null,O=v===v,w=kg(v);if(a)var S=o||O;else f?S=O&&(o||b):s?S=O&&b&&(o||!E):l?S=O&&b&&!E&&(o||!w):E||w?S=!1:S=o?v<=t:v<t;S?r=h+1:i=h}return BH(i,IH)}var $H=4294967295,UH=$H>>>1;function $1(e,t,n){var o=0,r=e==null?o:e.length;if(typeof t=="number"&&t===t&&r<=UH){for(;o<r;){var i=o+r>>>1,a=e[i];a!==null&&!kg(a)&&(n?a<=t:a<t)?o=i+1:r=i}return r}return uM(e,t,tm,n)}function VH(e,t){return $1(e,t)}function GH(e,t,n){return uM(e,t,_i(n))}function WH(e,t){var n=e==null?0:e.length;if(n){var o=$1(e,t);if(o<n&&q_(e[o],t))return o}return-1}function zH(e,t){return $1(e,t,!0)}function HH(e,t,n){return uM(e,t,_i(n),!0)}function XH(e,t){var n=e==null?0:e.length;if(n){var o=$1(e,t,!0)-1;if(q_(e[o],t))return o}return-1}function a3(e,t){for(var n=-1,o=e.length,r=0,i=[];++n<o;){var a=e[n],s=t?t(a):a;if(!n||!q_(s,l)){var l=s;i[r++]=a===0?0:a}}return i}function YH(e){return e&&e.length?a3(e):[]}function qH(e,t){return e&&e.length?a3(e,_i(t)):[]}var KH=4294967295;function ZH(e,t,n){return n&&typeof n!="number"&&Nh(e,t,n)&&(t=n=void 0),n=n===void 0?KH:n>>>0,n?(e=Ri(e),e&&(typeof t=="string"||t!=null&&!z2(t))&&(t=ed(t),!t&&ey(e))?Dh(td(e),0,n):e.split(t,n)):[]}var JH="Expected a function",QH=Math.max;function eX(e,t){if(typeof e!="function")throw new TypeError(JH);return t=t==null?0:QH(zo(t),0),Yo(function(n){var o=n[t],r=Dh(n,0,t);return o&&X_(r,o),Qu(e,this,r)})}var tX=ty(function(e,t,n){return e+(n?" ":"")+K2(t)});function nX(e,t,n){return e=Ri(e),n=n==null?0:Jg(zo(n),0,e.length),t=ed(t),e.slice(n,n+t.length)==t}function rX(){return{}}function oX(){return""}function iX(){return!0}var aX=k1(function(e,t){return e-t},0);function lX(e){return e&&e.length?oM(e,tm):0}function sX(e,t){return e&&e.length?oM(e,_i(t)):0}function uX(e){var t=e==null?0:e.length;return t?sp(e,1,t):[]}function cX(e,t,n){return e&&e.length?(t=n||t===void 0?1:zo(t),sp(e,0,t<0?0:t)):[]}function dX(e,t,n){var o=e==null?0:e.length;return o?(t=n||t===void 0?1:zo(t),t=o-t,sp(e,t<0?0:t,o)):[]}function fX(e,t){return e&&e.length?j1(e,_i(t),!1,!0):[]}function pX(e,t){return e&&e.length?j1(e,_i(t)):[]}function hX(e,t){return t(e),e}var l3=Object.prototype,vX=l3.hasOwnProperty;function dk(e,t,n,o){return e===void 0||q_(e,l3[n])&&!vX.call(o,n)?t:e}var mX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gX(e){return"\\"+mX[e]}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(e,t,n){var o=bA.imports._.templateSettings||bA;n&&Nh(e,t,n)&&(t=void 0),e=Ri(e),t=pA({},t,o,dk);var r=pA({},t.imports,o.imports,dk),i=Zd(r),a=Uj(r,i),s,l,f=0,h=t.interpolate||d0,v="__p += '",b=RegExp((t.escape||d0).source+"|"+h.source+"|"+(h===s3?SX:d0).source+"|"+(t.evaluate||d0).source+"|$","g"),E=fk.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+`
|
||
`:"";e.replace(b,function(S,M,T,$,D,P){return T||(T=$),v+=e.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(t,"variable")&&t.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(e,t){return t(e)}var CX=9007199254740991,KO=4294967295,NX=Math.min;function kX(e,t){if(e=zo(e),e<1||e>CX)return[];var n=KO,o=NX(e,KO);t=lm(t),e-=KO;for(var r=Aj(o,t);++n<e;)t(n);return r}function PX(){return this}function u3(e,t){var n=e;return n instanceof $o&&(n=n.value()),$j(t,function(o,r){return r.func.apply(r.thisArg,X_([o],r.args))},n)}function RX(){return u3(this.__wrapped__,this.__actions__)}function DX(e){return Ri(e).toLowerCase()}function jX(e){return qa(e)?Es(e,A1):kg(e)?[e]:Ku(D$(Ri(e)))}var pk=9007199254740991;function LX(e){return e?Jg(zo(e),-pk,pk):e===0?e:0}function IX(e){return Ri(e).toUpperCase()}function FX(e,t,n){var o=qa(e),r=o||Mj(e)||Tj(e);if(t=_i(t),n==null){var i=e&&e.constructor;r?n=o?new i:[]:lp(e)?n=kh(i)?z_(j$(e)):{}:n={}}return(r?Kd:am)(e,function(a,s,l){return t(n,a,s,l)}),n}function c3(e,t){for(var n=e.length;n--&&P2(t,e[n],0)>-1;);return n}function d3(e,t){for(var n=-1,o=e.length;++n<o&&P2(t,e[n],0)>-1;);return n}function BX(e,t,n){if(e=Ri(e),e&&(n||t===void 0))return L$(e);if(!e||!(t=ed(t)))return e;var o=td(e),r=td(t),i=d3(o,r),a=c3(o,r)+1;return Dh(o,i,a).join("")}function $X(e,t,n){if(e=Ri(e),e&&(n||t===void 0))return e.slice(0,I$(e)+1);if(!e||!(t=ed(t)))return e;var o=td(e),r=c3(o,td(t))+1;return Dh(o,0,r).join("")}var UX=/^\s+/;function VX(e,t,n){if(e=Ri(e),e&&(n||t===void 0))return e.replace(UX,"");if(!e||!(t=ed(t)))return e;var o=td(e),r=d3(o,td(t));return Dh(o,r).join("")}var GX=30,WX="...",zX=/\w*$/;function HX(e,t){var n=GX,o=WX;if(lp(t)){var r="separator"in t?t.separator:r;n="length"in t?zo(t.length):n,o="omission"in t?ed(t.omission):o}e=Ri(e);var i=e.length;if(ey(e)){var a=td(e);i=a.length}if(n>=i)return e;var s=n-ny(o);if(s<1)return o;var l=a?Dh(a,0,s).join(""):e.slice(0,s);if(r===void 0)return l+o;if(a&&(s+=l.length-s),z2(r)){if(e.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(e.indexOf(ed(r),s)!=s){var b=l.lastIndexOf(r);b>-1&&(l=l.slice(0,b))}return l+o}function XX(e){return rL(e,1)}var YX={"&":"&","<":"<",">":">",""":'"',"'":"'"},qX=Z2(YX),f3=/&(?:amp|lt|gt|quot|#39);/g,KX=RegExp(f3.source);function ZX(e){return e=Ri(e),e&&KX.test(e)?e.replace(f3,qX):e}var JX=Yo(function(e){var t=ec(e);return Ll(t)&&(t=void 0),E_(Jd(e,1,Ll,!0),_i(t))}),QX=Yo(function(e){var t=ec(e);return t=typeof t=="function"?t:void 0,E_(Jd(e,1,Ll,!0),void 0,t)});function eY(e,t){return t=typeof t=="function"?t:void 0,e&&e.length?E_(e,void 0,t):[]}function tY(e,t){return e==null?!0:Sj(e,t)}var nY=Math.max;function cM(e){if(!(e&&e.length))return[];var t=0;return e=Y_(e,function(n){if(Ll(n))return t=nY(n.length,t),!0}),Aj(t,function(n){return Es(e,xj(n))})}function p3(e,t){if(!(e&&e.length))return[];var n=cM(e);return t==null?n:Es(n,function(o){return Qu(t,void 0,o)})}function h3(e,t,n,o){return R2(e,t,n(Oj(e,t)),o)}function rY(e,t,n){return e==null?e:h3(e,t,lm(n))}function oY(e,t,n,o){return o=typeof o=="function"?o:void 0,e==null?e:h3(e,t,lm(n),o)}var iY=ty(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()});function aY(e){return e==null?[]:Uj(e,rm(e))}var lY=Yo(function(e,t){return Ll(e)?N1(e,t):[]});function sY(e,t){return F1(lm(t),e)}var uY=im(function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(i){return X2(i,e)};return t>1||this.__actions__.length||!(o instanceof $o)||!H_(n)?this.thru(r):(o=o.slice(n,+n+(t?1:0)),o.__actions__.push({func:U1,args:[r],thisArg:void 0}),new rc(o,this.__chain__).thru(function(i){return t&&!i.length&&i.push(void 0),i}))});function cY(){return CL(this)}function dY(){var e=this.__wrapped__;if(e instanceof $o){var t=e;return this.__actions__.length&&(t=new $o(this)),t=t.reverse(),t.__actions__.push({func:U1,args:[_A],thisArg:void 0}),new rc(t,this.__chain__)}return this.thru(_A)}function dM(e,t,n){var o=e.length;if(o<2)return o?E_(e[0]):[];for(var r=-1,i=Array(o);++r<o;)for(var a=e[r],s=-1;++s<o;)s!=r&&(i[r]=N1(i[r]||a,e[s],t,n));return E_(Jd(i,1),t,n)}var fY=Yo(function(e){return dM(Y_(e,Ll))}),pY=Yo(function(e){var t=ec(e);return Ll(t)&&(t=void 0),dM(Y_(e,Ll),_i(t))}),hY=Yo(function(e){var t=ec(e);return t=typeof t=="function"?t:void 0,dM(Y_(e,Ll),void 0,t)}),vY=Yo(cM);function mY(e,t){return Z9(e||[],t||[],R2)}var gY=Yo(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n=typeof n=="function"?(e.pop(),n):void 0,p3(e,n)});const mr={chunk:CV,compact:L9,concat:LV,difference:I9,differenceBy:eG,differenceWith:tG,drop:F9,dropRight:B9,dropRightWhile:rG,dropWhile:oG,fill:bG,findIndex:Gj,findLastIndex:gj,flatten:F$,flattenDeep:B$,flattenDepth:MG,fromPairs:$$,head:V9,indexOf:zj,initial:YG,intersection:KG,intersectionBy:ZG,intersectionWith:JG,join:jW,lastIndexOf:UW,nth:sz,pull:Kz,pullAll:r3,pullAllBy:Zz,pullAllWith:Jz,pullAt:tH,remove:pH,reverse:_A,slice:DH,sortedIndex:VH,sortedIndexBy:GH,sortedIndexOf:WH,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:EG,flatMap:V$,flatMapDeep:SG,flatMapDepth:AG,forEach:ri,forEachRight:aG,groupBy:G9,includes:H9,invokeMap:lW,keyBy:IW,map:tc,orderBy:fz,partition:zz,reduce:Vj,reduceRight:fH,reject:W9,sample:xH,sampleSize:AH,shuffle:NH,size:RH,some:X9,sortBy:Q9},yY={now:G$},Ta={after:d7,ary:rL,before:iL,bind:D1,bindKey:q2,curry:Q2,curryRight:eM,debounce:D2,defer:JV,delay:QV,flip:CG,memoize:W$,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:VG,gte:GG,isArguments:Y$,isArrayBuffer:cW,isArrayLike:C1,isArrayLikeObject:Ll,isBoolean:mw,isBuffer:Mj,isDate:hW,isElement:vW,isEmpty:dw,isEqual:uA,isEqualWith:mW,isError:Y2,isFinite:yW,isFunction:kh,isInteger:zL,isLength:q$,isMap:K$,isMatch:_W,isMatchWith:bW,isNaN:EW,isNative:SW,isNil:ws,isNull:Z$,isNumber:HL,isObjectLike:qd,isPlainObject:k2,isRegExp:z2,isSafeInteger:AW,isSet:J$,isString:G2,isSymbol:kg,isTypedArray:Tj,isUndefined:Xv,isWeakMap:TW,isWeakSet:NW,lt:WW,lte:zW,toArray:qL,toFinite:w_,toLength:$L,toNumber:Pg,toPlainObject:H$,toSafeInteger:LX,toString:Ri},Ss={add:u7,ceil:AV,divide:nG,floor:NG,max:e7,maxBy:KW,mean:JW,meanBy:QW,min:R9,minBy:t7,multiply:rz,round:wH,subtract:aX,sum:lX,sumBy:sX},fM={clamp:Q$,inRange:XG,random:lH},io={assign:Xo,assignIn:iU,assignInWith:pA,assignWith:aU,at:lU,create:HV,defaults:D9,defaultsDeep:KV,findKey:wG,findLastKey:xG,forIn:r7,forInRight:FG,forOwn:o7,forOwnRight:BG,functions:$G,functionsIn:UG,get:om,has:hw,hasIn:t9,invert:nW,invertBy:iW,invoke:aW,keysIn:rm,mapKeys:XL,mapValues:n7,merge:Yv,mergeWith:PL,omit:e9,omitBy:cz,pick:Vv,pickBy:Wj,result:yH,set:Nj,setWith:MH,toPairs:pp,toPairsIn:fG,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:lG,escape:FL,escapeRegExp:gG,kebabCase:LW,lowerCase:VW,lowerFirst:GW,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:LG,flowRight:IG,iteratee:PW,matches:XW,matchesProperty:qW,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 e=new $o(this.__wrapped__);return e.__actions__=Ku(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ku(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ku(this.__views__),e}function bY(){if(this.__filtered__){var e=new $o(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}var wY=Math.max,EY=Math.min;function xY(e,t,n){for(var o=-1,r=n.length;++o<r;){var i=n[o],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=EY(t,e+a);break;case"takeRight":e=wY(e,t-a);break}}return{start:e,end:t}}var OY=1,SY=2,AY=Math.min;function MY(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),o=t<0,r=n?e.length:0,i=xY(0,r,this.__views__),a=i.start,s=i.end,l=s-a,f=o?s:a-1,h=this.__iteratees__,v=h.length,b=0,E=AY(l,this.__takeCount__);if(!n||!o&&r==l&&E==l)return u3(e,this.__actions__);var O=[];e:for(;l--&&b<E;){f+=t;for(var w=-1,S=e[f];++w<v;){var M=h[w],T=M.iteratee,$=M.type,D=T(S);if($==SY)S=D;else if(!D){if($==OY)continue e;break e}}O[b++]=S}return O}/**
|
||
* @license
|
||
* Lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* 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(e){return function(t,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=t,t=this)}return e(t,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=W2;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 e={};return am(ge,function(t,n){m3.call(ge.prototype,n)||(e[n]=t)}),e})(),{chain:!1});ge.VERSION=TY;(ge.templateSettings=pi.templateSettings).imports._=ge;Kd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){ge[e].placeholder=ge});Kd(["drop","take"],function(e,t){$o.prototype[e]=function(n){n=n===void 0?1:DY(zo(n),0);var o=this.__filtered__&&!t?new $o(this):this.clone();return o.__filtered__?o.__takeCount__=vk(n,o.__takeCount__):o.__views__.push({size:vk(n,v3),type:e+(o.__dir__<0?"Right":"")}),o},$o.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}});Kd(["filter","map","takeWhile"],function(e,t){var n=t+1,o=n==NY||n==kY;$o.prototype[e]=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(e,t){var n="take"+(t?"Right":"");$o.prototype[e]=function(){return this[n](1).value()[0]}});Kd(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");$o.prototype[e]=function(){return this.__filtered__?new $o(this):this[n](1)}});$o.prototype.compact=function(){return this.filter(tm)};$o.prototype.find=function(e){return this.filter(e).head()};$o.prototype.findLast=function(e){return this.reverse().find(e)};$o.prototype.invokeMap=Yo(function(e,t){return typeof e=="function"?new $o(this):this.map(function(n){return Q_(n,e,t)})});$o.prototype.reject=function(e){return this.filter(W2(_i(e)))};$o.prototype.slice=function(e,t){e=zo(e);var n=this;return n.__filtered__&&(e>0||t<0)?new $o(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==void 0&&(t=zo(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)};$o.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};$o.prototype.toArray=function(){return this.take(v3)};am($o.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=ge[o?"take"+(t=="last"?"Right":""):t],i=o||/^find/.test(t);r&&(ge.prototype[t]=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=e.apply(a,s);return S.__actions__.push({func:U1,args:[v],thisArg:void 0}),new rc(S,b)}return O&&w?e.apply(this,s):(S=this.thru(v),O?o?S.value()[0]:S.value():S)})});Kd(["pop","push","shift","sort","splice","unshift"],function(e){var t=PY[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);ge.prototype[e]=function(){var r=arguments;if(o&&!this.__chain__){var i=this.value();return t.apply(qa(i)?i:[],r)}return this[n](function(a){return t.apply(qa(a)?a:[],r)})}});am($o.prototype,function(e,t){var n=ge[t];if(n){var o=n.name+"";m3.call(Og,o)||(Og[o]=[]),Og[o].push({name:t,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"},GY=["src"],WY=["title"],zY={key:0,class:"status-tag",style:{"margin-left":"auto"}},HY=_r({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(e,{emit:t}){const n=e,o=t,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:An(S=>o("clickNodes",w),["stop"]),onMousedown:An(S=>o("onmousedown",w),["stop"])},[Gn(cA)(w==null?void 0:w.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Gn(mh)(w==null?void 0:w.icon,Gn(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,[Gn(cA)(w==null?void 0:w.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Gn(mh)(w==null?void 0:w.icon,Gn(mh)("./favicon.ico")),alt:""},null,8,GY)]),_: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,WY)]),w.type?(Ne(),mn("div",zY,[Gn(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(e,{emit:t}){const n=ml("workflowMode"),o=ja(),{user:r,folder:i}=kj(),a=b9(n||nc.Application),s=He(""),l=e,f=t,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 q=s.value.toLowerCase();return(a||[]).reduce((X,G)=>{const Q=G.list.filter(J=>J.label.toLowerCase().includes(q));return Q.length&&X.push({...G,list:Q}),X},[])});function w(q,X,G){var Q;X&&(q.properties.stepName=X.name,G=="tool"&&(q.properties.node_data={...X,tool_lib_id:X.id,input_field_list:X.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),G=="application"&&(q.properties.node_data={name:X.name,icon:X.icon,application_id:X.id})),(Q=l.workflowRef)==null||Q.addNode(q),f("clickNodes",q)}function S(q,X,G){var Q;X&&(q.properties.stepName=X.name,G=="tool"&&(q.properties.node_data={...X,tool_lib_id:X.id,input_field_list:X.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),G=="application"&&(j2(X.type)?(X.work_flow.nodes[0].properties.node_data.file_upload_setting,q.properties.node_data={name:X.name,icon:X.icon,application_id:X.id}):q.properties.node_data={name:X.name,icon:X.icon,application_id:X.id})),(Q=l.workflowRef)==null||Q.onmousedown(q),f("onmousedown",q)}const M=He([]),T=He([]);async function $(){var X;const q=await i.asyncGetFolder(u0.TOOL,{},b);M.value=q.data,i.setCurrentFolder(((X=q.data)==null?void 0:X[0])||{})}async function D(){var X,G,Q,J;const q=await oi({type:"tool",isShared:((X=i.currentFolder)==null?void 0:X.id)==="share",systemType:"workspace"}).getToolList({folder_id:((G=i.currentFolder)==null?void 0:G.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});T.value=((Q=q.data)==null?void 0:Q.tools)||q.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(q=>{var X;P.value=q.data,i.setCurrentFolder(((X=q.data)==null?void 0:X[0])||{})})}async function I(){var X;const q=await oi({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((X=i.currentFolder)==null?void 0:X.id)||r.getWorkspaceId()});B.value=q.data.filter(G=>G.resource_type==="application"&&G.id!==l.id&&G.is_publish)}function V(q){i.setCurrentFolder(q),E.value==="tool"?D():I()}async function z(q){console.log(q),q==="tool"?(await $(),D()):q==="application"&&(F(),I())}return bo(()=>{}),(q,X)=>{const G=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":X[5]||(X[5]=Be=>E.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:j(()=>[Ql(ee("div",XY,[k(J,{modelValue:s.value,"onUpdate:modelValue":X[0]||(X[0]=Be=>s.value=Be),class:"mr-12 ml-12",placeholder:q.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:j(()=>[k(Q,{class:"el-input__icon"},{default:j(()=>[k(G)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Eh,E.value==="base"]]),k(Pe,{label:q.$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:An(Ze=>w(gt),["stop"]),onMousedown:An(Ze=>S(gt),["stop"])},[(Ne(),bt(fw(Gn(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(Gn(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(q.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),k(Pe,{label:q.$t("views.tool.title"),name:"tool"},{default:j(()=>[k(ze,null,{left:j(()=>{var Be;return[k(De,{source:Gn(u0).TOOL,data:M.value,currentNodeKey:(Be=Gn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,shareTitle:q.$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:X[1]||(X[1]=Be=>w(Gn(VN),Be,"tool")),onOnmousedown:X[2]||(X[2]=Be=>S(Gn(VN),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),k(Pe,{label:q.$t("views.application.title"),name:"application"},{default:j(()=>[k(ze,null,{left:j(()=>{var Be;return[k(De,{source:Gn(u0).APPLICATION,data:P.value,currentNodeKey:(Be=Gn(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:X[3]||(X[3]=Be=>w(Gn(GN),Be,"application")),onOnmousedown:X[4]||(X[4]=Be=>S(Gn(GN),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Eh,e.show]])}}}),g3=Ph(tq,[["__scopeId","data-v-a8dfaa84"]]),nq={class:"flex-between"},rq={class:"flex align-center",style:{width:"69%"}},oq={class:"ellipsis-1 break-all"},iq={key:0,src:jY,alt:""},aq={key:1,src:LY,alt:""},lq={style:{width:"280px"},class:"p-12-16"},sq={class:"mt-8 lighter"},uq={class:"mt-16"},cq={class:"title-decoration-1 mb-8 mt-8"},dq=["onMouseenter"],fq={class:"break-all"},pq={class:"dialog-footer"},hq=_r({__name:"NodeContainer",props:{nodeModel:{}},setup(e){O_("workflowMode",nc.Application);const t=ja(),{params:{id:n}}=t,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(q=>{var X;q&&((X=P.nodeModel.graphModel.nodes.filter(G=>G.id!==P.nodeModel.id))!=null&&X.some(G=>G.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(q=>{q.type==="loop-body-node"&&P.nodeModel.graphModel.deleteNode(q.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 G,Q,J;const q=z.properties.width?z.properties.width:214,X=P.nodeModel.graphModel.addNode({type:z.type,properties:z.properties,x:((G=i.value)==null?void 0:G.x)+q/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:X.id,targetAnchorId:X.id+"_left"}),V()}const P=e,B=hr(()=>{var z;return P.nodeModel.properties.config.fields?(z=P.nodeModel.properties.config.fields)==null?void 0:z.map(X=>({label:X.label,value:X.value,globeLabel:`{{${P.nodeModel.properties.stepName}.${X.value}}}`,globeValue:`{{context['${P.nodeModel.id}'].${X.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,q)=>{var se;const X=ne("ArrowDownBold"),G=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:Ws(["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",rq,[(Ne(),bt(fw(Gn(pw)(`${e.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(se=e.nodeModel)==null?void 0:se.properties.node_data},null,8,["item"])),ee("h4",oq,_e(e.nodeModel.properties.stepName),1)]),ee("div",null,[k(Q,{text:"",onClick:q[0]||(q[0]=we=>h.value=!h.value)},{default:j(()=>[k(G,{class:Ws(["arrow-icon color-secondary",h.value?"rotate-180":""])},{default:j(()=>[k(X)]),_:1},8,["class"])]),_:1}),F(e.nodeModel.type)?(Ne(),bt(Se,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:j(()=>[ee("div",lq,[ee("h5",null,_e(z.$t("views.applicationWorkflow.condition.title")),1),ee("p",sq,[ee("span",null,_e(z.$t("views.applicationWorkflow.condition.front")),1),k(ie,{modelValue:f.value,"onUpdate:modelValue":q[1]||(q[1]=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",iq)):Bn("",!0),f.value==="AND"?(Ne(),mn("img",aq)):Bn("",!0)]),_:1})]),_:1})):Bn("",!0),F(e.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)])]),k(Be,null,{default:j(()=>[Ql(ee("div",uq,[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",cq,_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:q[2]||(q[2]=rt=>S.value=null)},[ee("span",fq,_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=>Gn(x_)(we.globeLabel),style:{padding:"0"}},{default:j(()=>[k(Ae,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,dq))),128))],64)):Bn("",!0)],512),[[Eh,h.value]])]),_:3})])),[[pe,$]])],2),k(Be,null,{default:j(()=>[r.value?(Ne(),bt(g3,{key:0,onWheel:v,show:r.value,id:Gn(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":q[7]||(q[7]=we=>s.value=we),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:q[8]||(q[8]=An(()=>{},["prevent"]))},{footer:j(()=>[ee("span",pq,[k(Q,{onClick:q[5]||(q[5]=An(we=>s.value=!1,["prevent"]))},{default:j(()=>[ft(_e(z.$t("common.cancel")),1)]),_:1}),k(Q,{type:"primary",onClick:q[6]||(q[6]=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":q[3]||(q[3]=we=>l.value.title=we),onBlur:q[4]||(q[4]=we=>l.value.title=l.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),hi=Ph(hq,[["__scopeId","data-v-cde8ed5f"]]),vq={class:"title-decoration-1 mb-8"},mq={class:"flex-between w-full"},gq={class:"flex-between"},yq={class:"flex align-center"},_q={class:"flex align-center"},bq={class:"mr-4"},wq={class:"flex-between"},Eq={class:"flex-between mb-16"},xq={key:0,class:"w-full mb-16"},Oq={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},Sq={class:"flex align-center",style:{"line-height":"20px"}},Aq=["src"],Mq=["title"],Tq={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},Cq={class:"flex align-center",style:{"line-height":"20px"}},Nq={class:"ellipsis"},kq={class:"flex-between mb-16"},Pq={class:"lighter"},Rq={key:2,class:"w-full mb-16"},Dq={class:"flex align-center",style:{"line-height":"20px"}},jq=["src"],Lq=["title"],Iq={class:"flex-between"},Fq={class:"mr-4"},Bq={class:"flex"},$q={class:"flex-between w-full"},Uq={class:"flex align-center"},Vq={class:"mr-4"},Gq=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=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:"<think>",reasoning_content_end:"</think>",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:"<think>",reasoning_content_end:"</think>",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=e,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=t();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 q=He();function X(){const Be={mcp_servers:v.value.mcp_servers,mcp_tool_ids:v.value.mcp_tool_ids,mcp_source:v.value.mcp_source};q.value.open(Be,ze.value)}function G(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:e.nodeModel},{default:j(()=>[ee("h5",vq,_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]=An(()=>{},["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",mq,[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]=Y=>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]=Y=>v.value.model_id=Y),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",gq,[ee("div",yq,[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]=Y=>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]=Y=>v.value.system=Y),style:{height:"100px"},onSubmitDialog:a,placeholder:`${Gn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Gn(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",_q,[ee("div",bq,[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]=Y=>v.value.prompt=Y),style:{height:"150px"},onSubmitDialog:s,placeholder:`${Gn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Gn(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",wq,[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]=Y=>v.value.dialogue_type=Y),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]=Y=>v.value.dialogue_number=Y),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",Eq,[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:X,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]=Y=>v.value.mcp_enable=Y)},null,8,["modelValue"])])]),((je=v.value.mcp_tool_ids)==null?void 0:je.length)>0?(Ne(),mn("div",xq,[(Ne(!0),mn(Ir,null,No(v.value.mcp_tool_ids,(Y,kt)=>{var Rt,Wt,Pn;return Ne(),mn(Ir,{key:kt},[Gn(bs)(ze.value,Y,"id")?(Ne(),mn("div",Oq,[ee("div",Sq,[(Rt=Gn(bs)(ze.value,Y,"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:Gn(mh)((qt=Gn(bs)(ze.value,Y,"id"))==null?void 0:qt.icon),alt:""},null,8,Aq)]}),_:2},1024)):(Ne(),bt(en,{key:1,type:"MCP",class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Wt=Gn(bs)(ze.value,Y,"id"))==null?void 0:Wt.name},_e(((Pn=Gn(bs)(ze.value,Y,"id"))==null?void 0:Pn.name)||Be.$t("common.custom")+" MCP"),9,Mq)]),k(le,{text:"",onClick:qt=>Ae(Y)},{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",Tq,[ee("div",Cq,[k(en,{type:"MCP",class:"mr-8",size:20}),ee("div",Nq,_e(Be.$t("common.custom")+" MCP"),1)]),k(le,{text:"",onClick:Je[8]||(Je[8]=Y=>v.value.mcp_servers="")},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):Bn("",!0),ee("div",kq,[ee("div",Pq,_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]=Y=>v.value.tool_enable=Y)},null,8,["modelValue"])])]),((vt=v.value.tool_ids)==null?void 0:vt.length)>0?(Ne(),mn("div",Rq,[(Ne(!0),mn(Ir,null,No(v.value.tool_ids,(Y,kt)=>{var Rt,Wt,Pn;return Ne(),mn("div",{key:kt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Dq,[(Rt=Gn(bs)(Pe.value,Y,"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:Gn(mh)((qt=Gn(bs)(Pe.value,Y,"id"))==null?void 0:qt.icon),alt:""},null,8,jq)]}),_:2},1024)):(Ne(),bt(en,{key:1,class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Wt=Gn(bs)(Pe.value,Y,"id"))==null?void 0:Wt.name},_e((Pn=Gn(bs)(Pe.value,Y,"id"))==null?void 0:Pn.name),9,Lq)]),k(le,{text:"",onClick:qt=>Se(Y)},{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]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Iq,[ee("span",Fq,_e(Be.$t("views.application.form.mcp_output_enable")),1),ee("div",Bq,[k(Lt,{class:"ml-8",size:"small",modelValue:v.value.mcp_output_enable,"onUpdate:modelValue":Je[10]||(Je[10]=Y=>v.value.mcp_output_enable=Y)},null,8,["modelValue"])])])]),_:1})):Bn("",!0),k(pe,{onClick:Je[13]||(Je[13]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",$q,[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]=Y=>v.value.model_setting.reasoning_content_enable=Y)},null,8,["modelValue"])])])]),_:1}),k(pe,{onClick:Je[15]||(Je[15]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Uq,[ee("div",Vq,[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]=Y=>v.value.is_result=Y)},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:q,onRefresh:G},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=[],Wq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eb=Array.isArray;function op(e,t){for(var n in t)e[n]=t[n];return e}function vM(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Lr(e,t,n){var o,r,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?V1.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return X0(e,a,o,r,null)}function X0(e,t,n,o,r){var i={type:e,props:t,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 G1(){return{current:null}}function jg(e){return e.children}function ko(e,t){this.props=e,this.context=t}function Lg(e,t){if(t==null)return e.__?Lg(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Lg(e):null}function zq(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=op({},t);i.__v=t.__v+1,xo.vnode&&xo.vnode(i),mM(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Lg(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,S3(o,i,r),t.__e=t.__=null,i.__e!=n&&E3(i)}}function E3(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),E3(e)}function xk(e){(!e.__d&&(e.__d=!0)&&Iv.push(e)&&!bw.__r++||Ek!=xo.debounceRendering)&&((Ek=xo.debounceRendering)||_3)(bw)}function bw(){for(var e,t=1;Iv.length;)Iv.length>t&&Iv.sort(b3),e=Iv.shift(),t=Iv.length,zq(e);bw.__r=0}function x3(e,t,n,o,r,i,a,s,l,f,h){var v,b,E,O,w,S,M,T=o&&o.__k||_w,$=t.length;for(l=Hq(n,t,T,l,$),v=0;v<$;v++)(E=n.__k[v])!=null&&(b=E.__i!=-1&&T[E.__i]||yw,E.__i=v,S=mM(e,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,e,M):typeof E.type=="function"&&S!==void 0?l=S:O&&(l=O.nextSibling),E.__u&=-7);return n.__e=w,l}function Hq(e,t,n,o,r){var i,a,s,l,f,h=n.length,v=h,b=0;for(e.__k=new Array(r),i=0;i<r;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=X0(null,a,null,null,null):eb(a)?a=e.__k[i]=X0(jg,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=X0(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+b,a.__=e,a.__b=e.__b+1,s=null,(f=a.__i=Xq(a,n,l,v))!=-1&&(v--,(s=n[f])&&(s.__u|=2)),s==null||s.__v==null?(f==-1&&(r>h?b--:r<h&&b++),typeof a.type!="function"&&(a.__u|=4)):f!=l&&(f==l-1?b--:f==l+1?b++:(f>l?b--:b++,a.__u|=4))):e.__k[i]=null;if(v)for(i=0;i<h;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Lg(s)),M3(s,s));return o}function O3(e,t,n,o){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=O3(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Lg(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ww(e,t){return t=t||[],e==null||typeof e=="boolean"||(eb(e)?e.some(function(n){ww(n,t)}):t.push(e)),t}function Xq(e,t,n,o){var r,i,a,s=e.key,l=e.type,f=t[n],h=f!=null&&(2&f.__u)==0;if(f===null&&s==null||h&&s==f.key&&l==f.type)return n;if(o>(h?1:0)){for(r=n-1,i=n+1;r>=0||i<t.length;)if((f=t[a=r>=0?r--:i++])!=null&&(2&f.__u)==0&&s==f.key&&l==f.type)return a}return-1}function Ok(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Wq.test(t)?n:n+"px"}function f0(e,t,n,o,r){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ok(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ok(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(w3,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=hM,e.addEventListener(t,i?EA:wA,i)):e.removeEventListener(t,i?EA:wA,i);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Sk(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=hM++;else if(t.t<n.u)return;return n(xo.event?xo.event(t):t)}}}function mM(e,t,n,o,r,i,a,s,l,f){var h,v,b,E,O,w,S,M,T,$,D,P,B,F,I,V=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(h=xo.__b)&&h(t);e:if(typeof V=="function")try{if(M=t.props,T="prototype"in V&&V.prototype.render,$=(h=V.contextType)&&o[h.__c],D=h?$?$.props.value:h.__:o,n.__c?S=(v=t.__c=n.__c).__=v.__E:(T?t.__c=v=new V(M,D):(t.__c=v=new ko(M,D),v.constructor=V,v.render=qq),$&&$.sub(v),v.state||(v.state={}),v.__n=o,b=v.__d=!0,v.__h=[],v._sb=[]),T&&v.__s==null&&(v.__s=v.state),T&&V.getDerivedStateFromProps!=null&&(v.__s==v.state&&(v.__s=op({},v.__s)),op(v.__s,V.getDerivedStateFromProps(M,v.__s))),E=v.props,O=v.state,v.__v=t,b)T&&V.getDerivedStateFromProps==null&&v.componentWillMount!=null&&v.componentWillMount(),T&&v.componentDidMount!=null&&v.__h.push(v.componentDidMount);else{if(T&&V.getDerivedStateFromProps==null&&M!==E&&v.componentWillReceiveProps!=null&&v.componentWillReceiveProps(M,D),t.__v==n.__v||!v.__e&&v.shouldComponentUpdate!=null&&v.shouldComponentUpdate(M,v.__s,D)===!1){t.__v!=n.__v&&(v.props=M,v.state=v.__s,v.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),_w.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break e}v.componentWillUpdate!=null&&v.componentWillUpdate(M,v.__s,D),T&&v.componentDidUpdate!=null&&v.__h.push(function(){v.componentDidUpdate(E,O,w)})}if(v.context=D,v.props=M,v.__P=e,v.__e=!1,P=xo.__r,B=0,T)v.state=v.__s,v.__d=!1,P&&P(t),h=v.render(v.props,v.state,v.context),_w.push.apply(v.__h,v._sb),v._sb=[];else do v.__d=!1,P&&P(t),h=v.render(v.props,v.state,v.context),v.state=v.__s;while(v.__d&&++B<25);v.state=v.__s,v.getChildContext!=null&&(o=op(op({},o),v.getChildContext())),T&&!b&&v.getSnapshotBeforeUpdate!=null&&(w=v.getSnapshotBeforeUpdate(E,O)),F=h!=null&&h.type===jg&&h.key==null?A3(h.props.children):h,s=x3(e,eb(F)?F:[F],t,n,o,r,i,a,s,l,f),v.base=t.__e,t.__u&=-161,v.__h.length&&a.push(v),S&&(v.__E=v.__=null)}catch(z){if(t.__v=null,l||i!=null)if(z.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(I=i.length;I--;)vM(i[I]);xA(t)}else t.__e=n.__e,t.__k=n.__k,z.then||xA(t);xo.__e(z,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Yq(n.__e,t,n,o,r,i,a,l,f);return(h=xo.diffed)&&h(t),128&t.__u?void 0:s}function xA(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(xA))}function S3(e,t,n){for(var o=0;o<n.length;o++)gM(n[o],n[++o],n[++o]);xo.__c&&xo.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){xo.__e(i,r.__v)}})}function A3(e){return typeof e!="object"||e==null||e.__b>0?e:eb(e)?e.map(A3):op({},e)}function Yq(e,t,n,o,r,i,a,s,l){var f,h,v,b,E,O,w,S=n.props||yw,M=t.props,T=t.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<i.length;f++)if((E=i[f])&&"setAttribute"in E==!!T&&(T?E.localName==T:E.nodeType==3)){e=E,i[f]=null;break}}if(e==null){if(T==null)return document.createTextNode(M);e=document.createElementNS(r,T,M.is&&M),s&&(xo.__m&&xo.__m(t,i),s=!1),i=null}if(T==null)S===M||s&&e.data==M||(e.data=M);else{if(i=i&&V1.call(e.childNodes),!s&&i!=null)for(S={},f=0;f<e.attributes.length;f++)S[(E=e.attributes[f]).name]=E.value;for(f in S)E=S[f],f=="dangerouslySetInnerHTML"?v=E:f=="children"||f in M||f=="value"&&"defaultValue"in M||f=="checked"&&"defaultChecked"in M||f0(e,f,null,E,r);for(f in M)E=M[f],f=="children"?b=E:f=="dangerouslySetInnerHTML"?h=E:f=="value"?O=E:f=="checked"?w=E:s&&typeof E!="function"||S[f]===E||f0(e,f,E,S[f],r);if(h)s||v&&(h.__html==v.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(v&&(e.innerHTML=""),x3(t.type=="template"?e.content:e,eb(b)?b:[b],t,n,o,T=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&Lg(n,0),s,l),i!=null)for(f=i.length;f--;)vM(i[f]);s||(f="value",T=="progress"&&O==null?e.removeAttribute("value"):O!=null&&(O!==e[f]||T=="progress"&&!O||T=="option"&&O!=S[f])&&f0(e,f,O,S[f],r),f="checked",w!=null&&w!=e[f]&&f0(e,f,w,S[f],r))}return e}function gM(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){xo.__e(r,n)}}function M3(e,t,n){var o,r;if(xo.unmount&&xo.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||gM(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){xo.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&M3(o[r],t,n||typeof e.type!="function");n||vM(e.__e),e.__c=e.__=e.__e=void 0}function qq(e,t,n){return this.constructor(e,n)}function Kq(e,t,n){var o,r,i,a;t==document&&(t=document.documentElement),xo.__&&xo.__(e,t),r=(o=!1)?null:t.__k,i=[],a=[],mM(t,e=t.__k=Lr(jg,null,[e]),r||yw,yw,t.namespaceURI,r?null:t.firstChild?V1.call(t.childNodes):null,i,r?r.__e:t.firstChild,o,a),S3(i,e,a)}V1=_w.slice,xo={__e:function(e,t,n,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},y3=0,ko.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=op({},this.state),typeof e=="function"&&(e=e(op({},n),this.props)),e&&op(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),xk(this))},ko.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),xk(this))},ko.prototype.render=jg,Iv=[],_3=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b3=function(e,t){return e.__v.__b-t.__v.__b},bw.__r=0,w3=/(PointerCapture)$|Capture$/i,hM=0,wA=Sk(!1),EA=Sk(!0);var Zq="An invariant failed, however the error is obfuscated because this is a production build.",Ew=[];Object.freeze(Ew);var yM={};Object.freeze(yM);function Hs(){return++yr.mobxGuid}function Qo(e){throw Gv(!1,e),"X"}function Gv(e,t){if(!e)throw new Error("[mobx] "+(t||Zq))}function T3(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var p0=function(){};function Jq(e){var t=[];return e.forEach(function(n){t.indexOf(n)===-1&&t.push(n)}),t}function _M(e){return e!==null&&typeof e=="object"}function ry(e){if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Qq(e){if(iy(e)||Ys(e))return e;if(Array.isArray(e))return new Map(e);if(ry(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return Qo("Cannot convert to map from '"+e+"'")}function oy(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function eK(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function tK(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||n.configurable!==!1&&n.writable!==!1}function jh(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(o){return _M(o)&&o[n]===!0}}function iy(e){return e instanceof Map}function tb(e){return e instanceof Set}function C3(e){var t=new Set;for(var n in e)t.add(n);return Object.getOwnPropertySymbols(e).forEach(function(o){Object.getOwnPropertyDescriptor(e,o).enumerable&&t.add(o)}),Array.from(t)}function gh(e){return e&&e.toString?e.toString():new String(e).toString()}function N3(e){return e===null?null:typeof e=="object"?""+e:e}var nK=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,eo=Symbol("mobx administration"),ay=(function(){function e(t){t===void 0&&(t="Atom@"+Hs()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ii.NOT_TRACKING}return e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(t){return t()})},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(t){return t()})},e.prototype.reportObserved=function(){return U3(this)},e.prototype.reportChanged=function(){Kc(),OK(this),Zc()},e.prototype.toString=function(){return this.name},e})(),bM=jh("Atom",ay);function wM(e,t,n){t===void 0&&(t=p0),n===void 0&&(n=p0);var o=new ay(e);return t!==p0&&IK(o,t),n!==p0&&X3(o,n),o}function rK(e,t){return rI(e,t)}function oK(e,t){return Object.is(e,t)}var Ig={structural:rK,default:oK};/*! *****************************************************************************
|
||
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 OA=function(e,t){return OA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)o.hasOwnProperty(r)&&(n[r]=o[r])},OA(e,t)};function iK(e,t){OA(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var xw=function(){return xw=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},xw.apply(this,arguments)};function Vd(e){var t=typeof Symbol=="function"&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function _g(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function EM(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_g(arguments[t]));return e}var Ow=Symbol("mobx did run lazy initializers"),Wy=Symbol("mobx pending decorators"),aK={},lK={};function sK(e,t){var n=t?aK:lK;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return qv(this),this[e]},set:function(o){qv(this),this[e]=o}})}function qv(e){var t,n;if(e[Ow]!==!0){var o=e[Wy];if(o){oy(e,Ow,!0);var r=EM(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=Vd(r),a=i.next();!a.done;a=i.next()){var s=a.value,l=o[s];l.propertyCreator(e,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(f){t={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}}}function k3(e,t){return function(){var o,r=function(a,s,l,f){if(f===!0)return t(a,s,l,a,o),null;if(!Object.prototype.hasOwnProperty.call(a,Wy)){var h=a[Wy];oy(a,Wy,xw({},h))}return a[Wy][s]={prop:s,propertyCreator:t,descriptor:l,decoratorTarget:a,decoratorArguments:o},sK(s,e)};return uK(arguments)?(o=Ew,r.apply(null,arguments)):(o=Array.prototype.slice.call(arguments),r)}}function uK(e){return(e.length===2||e.length===3)&&(typeof e[1]=="string"||typeof e[1]=="symbol")||e.length===4&&e[3]===!0}function nb(e,t,n){return Ug(e)?e:Array.isArray(e)?Ut.array(e,{name:n}):ry(e)?Ut.object(e,void 0,{name:n}):iy(e)?Ut.map(e,{name:n}):tb(e)?Ut.set(e,{name:n}):e}function cK(e,t,n){return e==null||rd(e)||tf(e)||Ys(e)||oc(e)?e:Array.isArray(e)?Ut.array(e,{name:n,deep:!1}):ry(e)?Ut.object(e,void 0,{name:n,deep:!1}):iy(e)?Ut.map(e,{name:n,deep:!1}):tb(e)?Ut.set(e,{name:n,deep:!1}):Qo(!1)}function W1(e){return e}function dK(e,t,n){return rI(e,t)?t:e}function z1(e){Gv(e);var t=k3(!0,function(o,r,i,a,s){var l=i?i.initializer?i.initializer.call(o):i.value:void 0;MM(o).addObservableProp(r,l,e)}),n=t;return n.enhancer=e,n}var P3={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(P3);function pg(e){return e==null?P3:typeof e=="string"?{name:e,deep:!0,proxy:!0}:e}var xM=z1(nb),fK=z1(cK),R3=z1(W1),pK=z1(dK);function h0(e){return e.defaultDecorator?e.defaultDecorator.enhancer:e.deep===!1?W1:nb}function hK(e,t,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return xM.apply(null,arguments);if(Ug(e))return e;var o=ry(e)?Ut.object(e,t,n):Array.isArray(e)?Ut.array(e,t):iy(e)?Ut.map(e,t):tb(e)?Ut.set(e,t):e;if(o!==e)return o;Qo(!1)}var Ak={box:function(e,t){arguments.length>2&&Ly("box");var n=pg(t);return new zv(e,h0(n),n.name,!0,n.equals)},array:function(e,t){arguments.length>2&&Ly("array");var n=pg(t);return JK(e,h0(n),n.name)},map:function(e,t){arguments.length>2&&Ly("map");var n=pg(t);return new AM(e,h0(n),n.name)},set:function(e,t){arguments.length>2&&Ly("set");var n=pg(t);return new tI(e,h0(n),n.name)},object:function(e,t,n){typeof arguments[1]=="string"&&Ly("object");var o=pg(n);if(o.proxy===!1)return NA({},e,t,o);var r=q3(o),i=NA({},void 0,void 0,o),a=qK(i);return K3(a,e,t,r),a},ref:R3,shallow:fK,deep:xM,struct:pK},Ut=hK;Object.keys(Ak).forEach(function(e){return Ut[e]=Ak[e]});function Ly(e){Qo("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}var Sw=k3(!1,function(e,t,n,o,r){var i=n.get,a=n.set,s=r[0]||{};MM(e).addComputedProp(e,t,xw({get:i,set:a,context:e},s))}),vK=Sw({equals:Ig.structural}),Ai=function(t,n,o){if(typeof n=="string"||t!==null&&typeof t=="object"&&arguments.length===1)return Sw.apply(null,arguments);var r=typeof n=="object"?n:{};return r.get=t,r.set=typeof n=="function"?n:r.set,r.name=r.name||t.name||"",new Bg(r)};Ai.struct=vK;var ii;(function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"})(ii||(ii={}));var Gd;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Gd||(Gd={}));var Aw=(function(){function e(t){this.cause=t}return e})();function zy(e){return e instanceof Aw}function SA(e){switch(e.dependenciesState){case ii.UP_TO_DATE:return!1;case ii.NOT_TRACKING:case ii.STALE:return!0;case ii.POSSIBLY_STALE:{for(var t=OM(!0),n=ly(),o=e.observing,r=o.length,i=0;i<r;i++){var a=o[i];if($g(a)){if(yr.disableErrorBoundaries)a.get();else try{a.get()}catch{return bh(n),e_(t),!0}if(e.dependenciesState===ii.STALE)return bh(n),e_(t),!0}}return L3(e),bh(n),e_(t),!1}}}function Fg(e){var t=e.observers.size>0;yr.computationDepth>0&&t&&Qo(!1),!yr.allowStateChanges&&(t||yr.enforceActions==="strict")&&Qo(!1)}function D3(e,t,n){var o=OM(!0);L3(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++yr.runId;var r=yr.trackingDerivation;yr.trackingDerivation=e;var i;if(yr.disableErrorBoundaries===!0)i=t.call(n);else try{i=t.call(n)}catch(a){i=new Aw(a)}return yr.trackingDerivation=r,mK(e),e_(o),i}function mK(e){for(var t=e.observing,n=e.observing=e.newObserving,o=ii.UP_TO_DATE,r=0,i=e.unboundDepsCount,a=0;a<i;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,r!==a&&(n[r]=s),r++),s.dependenciesState>o&&(o=s.dependenciesState)}for(n.length=r,e.newObserving=null,i=t.length;i--;){var s=t[i];s.diffValue===0&&B3(s,e),s.diffValue=0}for(;r--;){var s=n[r];s.diffValue===1&&(s.diffValue=0,xK(s,e))}o!==ii.UP_TO_DATE&&(e.dependenciesState=o,e.onBecomeStale())}function AA(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)B3(t[n],e);e.dependenciesState=ii.NOT_TRACKING}function j3(e){var t=ly();try{return e()}finally{bh(t)}}function ly(){var e=yr.trackingDerivation;return yr.trackingDerivation=null,e}function bh(e){yr.trackingDerivation=e}function OM(e){var t=yr.allowStateReads;return yr.allowStateReads=e,t}function e_(e){yr.allowStateReads=e}function L3(e){if(e.dependenciesState!==ii.UP_TO_DATE){e.dependenciesState=ii.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=ii.UP_TO_DATE}}var Mw=0,gK=1,Mk=Object.getOwnPropertyDescriptor(function(){},"name");Mk&&Mk.configurable;function Wv(e,t,n){var o=function(){return I3(e,t,n||this,arguments)};return o.isMobxAction=!0,o}function I3(e,t,n,o){var r=yK();try{return t.apply(n,o)}catch(i){throw r.error=i,i}finally{_K(r)}}function yK(e,t,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:gK++,parentActionId:Mw};return Mw=l.actionId,l}function _K(e){Mw!==e.actionId&&Qo("invalid action stack. did you forget to finish an action?"),Mw=e.parentActionId,e.error!==void 0&&(yr.suppressReactionErrors=!0),X1(e.prevAllowStateChanges),e_(e.prevAllowStateReads),Zc(),bh(e.prevDerivation),yr.suppressReactionErrors=!1}function H1(e){var t=yr.allowStateChanges;return yr.allowStateChanges=e,t}function X1(e){yr.allowStateChanges=e}var zv=(function(e){iK(t,e);function t(n,o,r,i,a){r===void 0&&(r="ObservableValue@"+Hs()),a===void 0&&(a=Ig.default);var s=e.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 t.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.prototype.set=function(n){this.value,n=this.prepareNewValue(n),n!==yr.UNCHANGED&&this.setNewValue(n)},t.prototype.prepareNewValue=function(n){if(Fg(this),Wd(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},t.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})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(n){return rb(this,n)},t.prototype.observe=function(n,o){return o&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),ob(this,n)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return N3(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(ay),bK=jh("ObservableValue",zv),Bg=(function(){function e(t){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=Gd.NONE,Gv(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+Hs(),t.set&&(this.setter=Wv(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?Ig.structural:Ig.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return e.prototype.onBecomeStale=function(){AK(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(t){return t()})},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(t){return t()})},e.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()&&SK(this));var t=this.value;if(zy(t))throw t.cause;return t},e.prototype.peek=function(){var t=this.computeValue(!1);if(zy(t))throw t.cause;return t},e.prototype.set=function(t){if(this.setter){Gv(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else Gv(!1,!1)},e.prototype.trackAndCompute=function(){var t=this.value,n=this.dependenciesState===ii.NOT_TRACKING,o=this.computeValue(!0),r=n||zy(t)||zy(o)||!this.equals(t,o);return r&&(this.value=o),r},e.prototype.computeValue=function(t){this.isComputing=!0,yr.computationDepth++;var n;if(t)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},e.prototype.suspend=function(){this.keepAlive||(AA(this),this.value=void 0)},e.prototype.observe=function(t,n){var o=this,r=!0,i=void 0;return DK(function(){var a=o.get();if(!r||n){var s=ly();t({type:"update",object:o,newValue:a,oldValue:i}),bh(s)}r=!1,i=a})},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return N3(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(),$g=jh("ComputedValue",Bg),Y0=(function(){function e(){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 e})(),wK={};function MA(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:wK}var q0=!0,F3=!1,yr=(function(){var e=MA();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(q0=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Y0().version&&(q0=!1),q0?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__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 EK(){(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 xK(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function B3(e,t){e.observers.delete(t),e.observers.size===0&&$3(e)}function $3(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,yr.pendingUnobservations.push(e))}function Kc(){yr.inBatch++}function Zc(){if(--yr.inBatch===0){W3();for(var e=yr.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Bg&&n.suspend())}yr.pendingUnobservations=[]}}function U3(e){var t=yr.trackingDerivation;return t!==null?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(e.observers.size===0&&yr.inBatch>0&&$3(e),!1)}function OK(e){e.lowestObserverState!==ii.STALE&&(e.lowestObserverState=ii.STALE,e.observers.forEach(function(t){t.dependenciesState===ii.UP_TO_DATE&&(t.isTracing!==Gd.NONE&&V3(t,e),t.onBecomeStale()),t.dependenciesState=ii.STALE}))}function SK(e){e.lowestObserverState!==ii.STALE&&(e.lowestObserverState=ii.STALE,e.observers.forEach(function(t){t.dependenciesState===ii.POSSIBLY_STALE?t.dependenciesState=ii.STALE:t.dependenciesState===ii.UP_TO_DATE&&(e.lowestObserverState=ii.UP_TO_DATE)}))}function AK(e){e.lowestObserverState===ii.UP_TO_DATE&&(e.lowestObserverState=ii.POSSIBLY_STALE,e.observers.forEach(function(t){t.dependenciesState===ii.UP_TO_DATE&&(t.dependenciesState=ii.POSSIBLY_STALE,t.isTracing!==Gd.NONE&&V3(t,e),t.onBecomeStale())}))}function V3(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===Gd.BREAK){var n=[];G3(BK(e),n,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+e.name+`'
|
||
|
||
You are entering this break point because derivation '`+e.name+"' is being traced and '"+t.name+`' is now forcing it to update.
|
||
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
||
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
||
|
||
`+(e instanceof Bg?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+n.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function G3(e,t,n){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+new Array(n).join(" ")+e.name),e.dependencies&&e.dependencies.forEach(function(o){return G3(o,t,n+1)})}var A_=(function(){function e(t,n,o,r){t===void 0&&(t="Reaction@"+Hs()),r===void 0&&(r=!1),this.name=t,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=Gd.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,yr.pendingReactions.push(this),W3())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Kc(),this._isScheduled=!1,SA(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Zu()}catch(t){this.reportExceptionInDerivation(t)}}Zc()}},e.prototype.track=function(t){if(!this.isDisposed){Kc(),this._isRunning=!0;var n=D3(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&AA(this),zy(n)&&this.reportExceptionInDerivation(n.cause),Zc()}},e.prototype.reportExceptionInDerivation=function(t){var n=this;if(this.errorHandler){this.errorHandler(t,this);return}if(yr.disableErrorBoundaries)throw t;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,t),yr.globalReactionErrorHandlers.forEach(function(r){return r(t,n)})},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Kc(),AA(this),Zc()))},e.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[eo]=this,t},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(t){t===void 0&&(t=!1),HK(this,t)},e})(),Tk=100,CA=function(e){return e()};function W3(){yr.inBatch>0||yr.isRunningReactions||CA(MK)}function MK(){yr.isRunningReactions=!0;for(var e=yr.pendingReactions,t=0;e.length>0;){++t===Tk&&(console.error("Reaction doesn't converge to a stable state after "+Tk+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var n=e.splice(0),o=0,r=n.length;o<r;o++)n[o].runReaction()}yr.isRunningReactions=!1}var Tw=jh("Reaction",A_);function TK(e){var t=CA;CA=function(n){return e(function(){return t(n)})}}function Zu(){return!1}function CK(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function NK(){Qo(!1)}function Ck(e){return function(t,n,o){if(o){if(o.value)return{value:Wv(e,o.value),enumerable:!1,configurable:!0,writable:!0};var r=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Wv(e,r.call(this))}}}return kK(e).apply(this,arguments)}}function kK(e){return function(t,n,o){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(r){oy(this,n,Bt(e,r))}})}}function PK(e,t,n,o){return o===!0?(ZO(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ZO(this,t,n.value||n.initializer.call(this)),this[t]},set:NK}:{enumerable:!1,configurable:!0,set:function(r){ZO(this,t,r)},get:function(){}}}var Bt=function(t,n,o,r){if(arguments.length===1&&typeof t=="function")return Wv(t.name||"<unnamed action>",t);if(arguments.length===2&&typeof n=="function")return Wv(t,n);if(arguments.length===1&&typeof t=="string")return Ck(t);if(r===!0)oy(t,n,Wv(t.name||n,o.value,this));else return Ck(n).apply(null,arguments)};Bt.bound=PK;function RK(e,t){var n=typeof e=="string"?e:e.name||"<unnamed action>",o=typeof e=="function"?e:t;return I3(n,o,this,void 0)}function ZO(e,t,n){oy(e,t,Wv(t,n.bind(e)))}function DK(e,t){t===void 0&&(t=yM);var n=t&&t.name||e.name||"Autorun@"+Hs(),o=!t.scheduler&&!t.delay,r;if(o)r=new A_(n,function(){this.track(s)},t.onError,t.requiresObservable);else{var i=z3(t),a=!1;r=new A_(n,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(s)}))},t.onError,t.requiresObservable)}function s(){e(r)}return r.schedule(),r.getDisposer()}var jK=function(e){return e()};function z3(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:jK}function H3(e,t,n){n===void 0&&(n=yM);var o=n.name||"Reaction@"+Hs(),r=Bt(o,n.onError?LK(n.onError,t):t),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=e(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 LK(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}function IK(e,t,n){return Y3("onBecomeObserved",e,t)}function X3(e,t,n){return Y3("onBecomeUnobserved",e,t)}function Y3(e,t,n,o){var r=Mh(t),i=n,a=e+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var s=r[e];return typeof s!="function"?Qo(!1):function(){var l=r[a];l&&(l.delete(i),l.size===0&&delete r[a])}}function FK(e){var t=e.enforceActions,n=e.computedRequiresReaction,o=e.computedConfigurable,r=e.disableErrorBoundaries,i=e.reactionScheduler,a=e.reactionRequiresObservable,s=e.observableRequiresReaction;if(EK(),t!==void 0){var l=void 0;switch(t){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:Qo("Invalid value for 'enforceActions': '"+t+"', 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&&TK(i)}function NA(e,t,n,o){o=pg(o);var r=q3(o);return qv(e),MM(e,o.name,r.enhancer),t&&K3(e,t,n,r),e}function q3(e){return e.defaultDecorator||(e.deep===!1?R3:xM)}function K3(e,t,n,o){var r,i,a,s,l;Kc();try{var a=nK(t);try{for(var f=Vd(a),h=f.next();!h.done;h=f.next()){var l=h.value,v=Object.getOwnPropertyDescriptor(t,l),b=n&&l in n?n[l]:v.get?Sw:o,E=b(e,l,v,!0);E&&Object.defineProperty(e,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 BK(e,t){return Z3(Mh(e,t))}function Z3(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=Jq(e.observing).map(Z3)),t}function J3(e,t){if(e==null)return!1;if(t!==void 0){if(rd(e)===!1||!e[eo].values.has(t))return!1;var n=Mh(e,t);return $g(n)}return $g(e)}function $K(e){return arguments.length>1?Qo(!1):J3(e)}function Nk(e,t){return typeof t!="string"?Qo(!1):J3(e,t)}function UK(e,t){return e==null?!1:rd(e)||!!e[eo]||bM(e)||Tw(e)||$g(e)}function Ug(e){return arguments.length!==1&&Qo(!1),UK(e)}function Vg(e){return rd(e)?e[eo].getKeys():Ys(e)||oc(e)?Array.from(e.keys()):tf(e)?e.map(function(t,n){return n}):Qo(!1)}function VK(e){return rd(e)?Vg(e).map(function(t){return e[t]}):Ys(e)?Vg(e).map(function(t){return e.get(t)}):oc(e)?Array.from(e.values()):tf(e)?e.slice():Qo(!1)}function GK(e){return rd(e)?Vg(e).map(function(t){return[t,e[t]]}):Ys(e)?Vg(e).map(function(t){return[t,e.get(t)]}):oc(e)?Array.from(e.entries()):tf(e)?e.map(function(t,n){return[n,t]}):Qo(!1)}function SM(e,t,n){if(arguments.length===2&&!oc(e)){Kc();var o=t;try{for(var r in o)SM(e,r,o[r])}finally{Zc()}return}if(rd(e)){var i=e[eo],a=i.values.get(t);a?i.write(t,n):i.addObservableProp(t,n,i.defaultEnhancer)}else if(Ys(e))e.set(t,n);else if(oc(e))e.add(t);else if(tf(e))typeof t!="number"&&(t=parseInt(t,10)),Gv(t>=0,"Not a valid index: '"+t+"'"),Kc(),t>=e.length&&(e.length=t+1),e[t]=n,Zc();else return Qo(!1)}function Q3(e,t,n,o){return WK(e,t,n)}function WK(e,t,n){return Y1(e).observe(t,n)}var zK={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function tg(e,t,n,o){return o.detectCycles&&e.set(t,n),n}function ch(e,t,n){if(!t.recurseEverything&&!Ug(e)||typeof e!="object")return e;if(e===null)return null;if(e instanceof Date)return e;if(bK(e))return ch(e.get(),t,n);Ug(e)&&Vg(e);var o=t.detectCycles===!0;if(o&&e!==null&&n.has(e))return n.get(e);if(tf(e)||Array.isArray(e)){var r=tg(n,e,[],t),i=e.map(function(E){return ch(E,t,n)});r.length=i.length;for(var a=0,s=i.length;a<s;a++)r[a]=i[a];return r}if(oc(e)||Object.getPrototypeOf(e)===Set.prototype)if(t.exportMapsAsObjects===!1){var l=tg(n,e,new Set,t);return e.forEach(function(E){l.add(ch(E,t,n))}),l}else{var f=tg(n,e,[],t);return e.forEach(function(E){f.push(ch(E,t,n))}),f}if(Ys(e)||Object.getPrototypeOf(e)===Map.prototype)if(t.exportMapsAsObjects===!1){var h=tg(n,e,new Map,t);return e.forEach(function(E,O){h.set(O,ch(E,t,n))}),h}else{var v=tg(n,e,{},t);return e.forEach(function(E,O){v[O]=ch(E,t,n)}),v}var b=tg(n,e,{},t);return C3(e).forEach(function(E){b[E]=ch(e[E],t,n)}),b}function Hc(e,t){typeof t=="boolean"&&(t={detectCycles:t}),t||(t=zK),t.detectCycles=t.detectCycles===void 0?t.recurseEverything===!0:t.detectCycles===!0;var n;return t.detectCycles&&(n=new Map),ch(e,t,n)}function HK(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;typeof e[e.length-1]=="boolean"&&(n=e.pop());var o=XK(e);if(!o)return Qo(!1);o.isTracing===Gd.NONE&&console.log("[mobx.trace] '"+o.name+"' tracing enabled"),o.isTracing=n?Gd.BREAK:Gd.LOG}function XK(e){switch(e.length){case 0:return yr.trackingDerivation;case 1:return Mh(e[0]);case 2:return Mh(e[0],e[1])}}function Yc(e,t){t===void 0&&(t=void 0),Kc();try{return e.apply(t)}finally{Zc()}}function v0(e){return e[eo]}function m0(e){return typeof e=="string"||typeof e=="number"||typeof e=="symbol"}var YK={has:function(e,t){if(t===eo||t==="constructor"||t===Ow)return!0;var n=v0(e);return m0(t)?n.has(t):t in e},get:function(e,t){if(t===eo||t==="constructor"||t===Ow)return e[t];var n=v0(e),o=n.values.get(t);if(o instanceof ay){var r=o.get();return r===void 0&&n.has(t),r}return m0(t)&&n.has(t),e[t]},set:function(e,t,n){return m0(t)?(SM(e,t,n),!0):!1},deleteProperty:function(e,t){if(!m0(t))return!1;var n=v0(e);return n.remove(t),!0},ownKeys:function(e){var t=v0(e);return t.keysAtom.reportObserved(),Reflect.ownKeys(e)},preventExtensions:function(e){return Qo("Dynamic observable objects cannot be frozen"),!1}};function qK(e){var t=new Proxy(e,YK);return e[eo].proxy=t,t}function Wd(e){return e.interceptors!==void 0&&e.interceptors.length>0}function rb(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),T3(function(){var o=n.indexOf(t);o!==-1&&n.splice(o,1)})}function zd(e,t){var n=ly();try{for(var o=EM(e.interceptors||[]),r=0,i=o.length;r<i&&(t=o[r](t),Gv(!t||t.type,"Intercept handlers should return nothing or a change object"),!!t);r++);return t}finally{bh(n)}}function Jc(e){return e.changeListeners!==void 0&&e.changeListeners.length>0}function ob(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),T3(function(){var o=n.indexOf(t);o!==-1&&n.splice(o,1)})}function Qc(e,t){var n=ly(),o=e.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r<i;r++)o[r](t);bh(n)}}var KK=1e4,ZK={get:function(e,t){return t===eo?e[eo]:t==="length"?e[eo].getArrayLength():typeof t=="number"?rp.get.call(e,t):typeof t=="string"&&!isNaN(t)?rp.get.call(e,parseInt(t)):rp.hasOwnProperty(t)?rp[t]:e[t]},set:function(e,t,n){return t==="length"&&e[eo].setArrayLength(n),typeof t=="number"&&rp.set.call(e,t,n),typeof t=="symbol"||isNaN(t)?e[t]=n:rp.set.call(e,parseInt(t),n),!0},preventExtensions:function(e){return Qo("Observable arrays cannot be frozen"),!1}};function JK(e,t,n,o){n===void 0&&(n="ObservableArray@"+Hs()),o===void 0&&(o=!1);var r=new eI(n,t,o);eK(r.values,eo,r);var i=new Proxy(r.values,ZK);if(r.proxy=i,e&&e.length){var a=H1(!0);r.spliceWithArray(0,0,e),X1(a)}return i}var eI=(function(){function e(t,n,o){this.owned=o,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new ay(t||"ObservableArray@"+Hs()),this.enhancer=function(r,i){return n(r,i,t+"[..]")}}return e.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.prototype.dehanceValues=function(t){return this.dehancer!==void 0&&t.length>0?t.map(this.dehancer):t},e.prototype.intercept=function(t){return rb(this,t)},e.prototype.observe=function(t,n){return n===void 0&&(n=!1),n&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ob(this,t)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(t){if(typeof t!="number"||t<0)throw new Error("[mobx.array] Out of range: "+t);var n=this.values.length;if(t!==n)if(t>n){for(var o=new Array(t-n),r=0;r<t-n;r++)o[r]=void 0;this.spliceWithArray(n,0,o)}else this.spliceWithArray(t,n-t)},e.prototype.updateArrayLength=function(t,n){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=n},e.prototype.spliceWithArray=function(t,n,o){var r=this;Fg(this.atom);var i=this.values.length;if(t===void 0?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),arguments.length===1?n=i-t:n==null?n=0:n=Math.max(0,Math.min(n,i-t)),o===void 0&&(o=Ew),Wd(this)){var a=zd(this,{object:this.proxy,type:"splice",index:t,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(t,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice(t,o,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(t,n,o){var r;if(o.length<KK)return(r=this.values).splice.apply(r,EM([t,n],o));var i=this.values.slice(t,t+n);return this.values=this.values.slice(0,t).concat(o,this.values.slice(t+n)),i},e.prototype.notifyArrayChildUpdate=function(t,n,o){var r=!this.owned&&Zu(),i=Jc(this),a=i||r?{object:this.proxy,type:"update",index:t,newValue:n,oldValue:o}:null;this.atom.reportChanged(),i&&Qc(this,a)},e.prototype.notifyArraySplice=function(t,n,o){var r=!this.owned&&Zu(),i=Jc(this),a=i||r?{object:this.proxy,type:"splice",index:t,removed:o,added:n,removedCount:o.length,addedCount:n.length}:null;this.atom.reportChanged(),i&&Qc(this,a)},e})(),rp={intercept:function(e){return this[eo].intercept(e)},observe:function(e,t){t===void 0&&(t=!1);var n=this[eo];return n.observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[eo];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=this[eo];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray(e);case 2:return r.spliceWithArray(e,t)}return r.spliceWithArray(e,t,n)},spliceWithArray:function(e,t,n){var o=this[eo];return o.spliceWithArray(e,t,n)},push:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this[eo];return n.spliceWithArray(n.values.length,0,e),n.values.length},pop:function(){return this.splice(Math.max(this[eo].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this[eo];return n.spliceWithArray(0,0,e),n.values.length},reverse:function(){var e=this.slice();return e.reverse.apply(e,arguments)},sort:function(e){var t=this.slice();return t.sort.apply(t,arguments)},remove:function(e){var t=this[eo],n=t.dehanceValues(t.values).indexOf(e);return n>-1?(this.splice(n,1),!0):!1},get:function(e){var t=this[eo];if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(e,t){var n=this[eo],o=n.values;if(e<o.length){Fg(n.atom);var r=o[e];if(Wd(n)){var i=zd(n,{type:"update",object:n.proxy,index:e,newValue:t});if(!i)return;t=i.newValue}t=n.enhancer(t,r);var a=t!==r;a&&(o[e]=t,n.notifyArrayChildUpdate(e,t,r))}else if(e===o.length)n.spliceWithArray(e,0,[t]);else throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+o.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(e){typeof Array.prototype[e]=="function"&&(rp[e]=function(){var t=this[eo];t.atom.reportObserved();var n=t.dehanceValues(t.values);return n[e].apply(n,arguments)})});["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(e){typeof Array.prototype[e]=="function"&&(rp[e]=function(t,n){var o=this,r=this[eo];r.atom.reportObserved();var i=r.dehanceValues(r.values);return i[e](function(a,s){return t.call(n,a,s,o)},n)})});["reduce","reduceRight"].forEach(function(e){rp[e]=function(){var t=this,n=this[eo];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(r,i,a){return i=n.dehanceValue(i),o(r,i,a,t)},n.values[e].apply(n.values,arguments)}});var QK=jh("ObservableArrayAdministration",eI);function tf(e){return _M(e)&&QK(e[eo])}var kk,eZ={},AM=(function(){function e(t,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableMap@"+Hs()),this.enhancer=n,this.name=o,this[kk]=eZ,this._keysAtom=wM(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return e.prototype._has=function(t){return this._data.has(t)},e.prototype.has=function(t){var n=this;if(!yr.trackingDerivation)return this._has(t);var o=this._hasMap.get(t);if(!o){var r=o=new zv(this._has(t),W1,this.name+"."+gh(t)+"?",!1);this._hasMap.set(t,r),X3(r,function(){return n._hasMap.delete(t)})}return o.get()},e.prototype.set=function(t,n){var o=this._has(t);if(Wd(this)){var r=zd(this,{type:o?"update":"add",object:this,newValue:n,name:t});if(!r)return this;n=r.newValue}return o?this._updateValue(t,n):this._addValue(t,n),this},e.prototype.delete=function(t){var n=this;if(Fg(this._keysAtom),Wd(this)){var o=zd(this,{type:"delete",object:this,name:t});if(!o)return!1}if(this._has(t)){var r=Zu(),i=Jc(this),o=i||r?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return Yc(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(t,!1);var s=n._data.get(t);s.setNewValue(void 0),n._data.delete(t)}),i&&Qc(this,o),!0}return!1},e.prototype._updateHasMapEntry=function(t,n){var o=this._hasMap.get(t);o&&o.setNewValue(n)},e.prototype._updateValue=function(t,n){var o=this._data.get(t);if(n=o.prepareNewValue(n),n!==yr.UNCHANGED){var r=Zu(),i=Jc(this),a=i||r?{type:"update",object:this,oldValue:o.value,name:t,newValue:n}:null;o.setNewValue(n),i&&Qc(this,a)}},e.prototype._addValue=function(t,n){var o=this;Fg(this._keysAtom),Yc(function(){var s=new zv(n,o.enhancer,o.name+"."+gh(t),!1);o._data.set(t,s),n=s.value,o._updateHasMapEntry(t,!0),o._keysAtom.reportChanged()});var r=Zu(),i=Jc(this),a=i||r?{type:"add",object:this,name:t,newValue:n}:null;i&&Qc(this,a)},e.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},e.prototype.values=function(){var t=this,n=this.keys();return Cw({next:function(){var o=n.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:t.get(i)}}})},e.prototype.entries=function(){var t=this,n=this.keys();return Cw({next:function(){var o=n.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:[i,t.get(i)]}}})},e.prototype[kk=eo,Symbol.iterator]=function(){return this.entries()},e.prototype.forEach=function(t,n){var o,r;try{for(var i=Vd(this),a=i.next();!a.done;a=i.next()){var s=_g(a.value,2),l=s[0],f=s[1];t.call(n,f,l,this)}}catch(h){o={error:h}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},e.prototype.merge=function(t){var n=this;return Ys(t)&&(t=t.toJS()),Yc(function(){var o=H1(!0);try{ry(t)?C3(t).forEach(function(r){return n.set(r,t[r])}):Array.isArray(t)?t.forEach(function(r){var i=_g(r,2),a=i[0],s=i[1];return n.set(a,s)}):iy(t)?(t.constructor!==Map&&Qo("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach(function(r,i){return n.set(i,r)})):t!=null&&Qo("Cannot initialize map from "+t)}finally{X1(o)}}),this},e.prototype.clear=function(){var t=this;Yc(function(){j3(function(){var n,o;try{for(var r=Vd(t.keys()),i=r.next();!i.done;i=r.next()){var a=i.value;t.delete(a)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}})})},e.prototype.replace=function(t){var n=this;return Yc(function(){var o,r,i,a,s=Qq(t),l=new Map,f=!1;try{for(var h=Vd(n._data.keys()),v=h.next();!v.done;v=h.next()){var b=v.value;if(!s.has(b)){var E=n.delete(b);if(E)f=!0;else{var O=n._data.get(b);l.set(b,O)}}}}catch(I){o={error:I}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}try{for(var w=Vd(s.entries()),S=w.next();!S.done;S=w.next()){var M=_g(S.value,2),b=M[0],O=M[1],T=n._data.has(b);if(n.set(b,O),n._data.has(b)){var $=n._data.get(b);l.set(b,$),T||(f=!0)}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}if(!f)if(n._data.size!==l.size)n._keysAtom.reportChanged();else for(var D=n._data.keys(),P=l.keys(),B=D.next(),F=P.next();!B.done;){if(B.value!==F.value){n._keysAtom.reportChanged();break}B=D.next(),F=P.next()}n._data=l}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var t,n,o={};try{for(var r=Vd(this),i=r.next();!i.done;i=r.next()){var a=_g(i.value,2),s=a[0],l=a[1];o[typeof s=="symbol"?s:gh(s)]=l}}catch(f){t={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.toJS=function(){return new Map(this)},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map(function(n){return gh(n)+": "+(""+t.get(n))}).join(", ")+" }]"},e.prototype.observe=function(t,n){return ob(this,t)},e.prototype.intercept=function(t){return rb(this,t)},e})(),Ys=jh("ObservableMap",AM),Pk,tZ={},tI=(function(){function e(t,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableSet@"+Hs()),this.name=o,this[Pk]=tZ,this._data=new Set,this._atom=wM(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(r,i){return n(r,i,o)},t&&this.replace(t)}return e.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.prototype.clear=function(){var t=this;Yc(function(){j3(function(){var n,o;try{for(var r=Vd(t._data.values()),i=r.next();!i.done;i=r.next()){var a=i.value;t.delete(a)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}})})},e.prototype.forEach=function(t,n){var o,r;try{for(var i=Vd(this),a=i.next();!a.done;a=i.next()){var s=a.value;t.call(n,s,s,this)}}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(t){var n=this;if(Fg(this._atom),Wd(this)){var o=zd(this,{type:"add",object:this,newValue:t});if(!o)return this}if(!this.has(t)){Yc(function(){n._data.add(n.enhancer(t,void 0)),n._atom.reportChanged()});var r=Zu(),i=Jc(this),o=i||r?{type:"add",object:this,newValue:t}:null;i&&Qc(this,o)}return this},e.prototype.delete=function(t){var n=this;if(Wd(this)){var o=zd(this,{type:"delete",object:this,oldValue:t});if(!o)return!1}if(this.has(t)){var r=Zu(),i=Jc(this),o=i||r?{type:"delete",object:this,oldValue:t}:null;return Yc(function(){n._atom.reportChanged(),n._data.delete(t)}),i&&Qc(this,o),!0}return!1},e.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},e.prototype.entries=function(){var t=0,n=Array.from(this.keys()),o=Array.from(this.values());return Cw({next:function(){var r=t;return t+=1,r<o.length?{value:[n[r],o[r]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var t=this,n=0,o=Array.from(this._data.values());return Cw({next:function(){return n<o.length?{value:t.dehanceValue(o[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(t){var n=this;return oc(t)&&(t=t.toJS()),Yc(function(){var o=H1(!0);try{Array.isArray(t)?(n.clear(),t.forEach(function(r){return n.add(r)})):tb(t)?(n.clear(),t.forEach(function(r){return n.add(r)})):t!=null&&Qo("Cannot initialize set from "+t)}finally{X1(o)}}),this},e.prototype.observe=function(t,n){return ob(this,t)},e.prototype.intercept=function(t){return rb(this,t)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},e.prototype[Pk=eo,Symbol.iterator]=function(){return this.values()},e})(),oc=jh("ObservableSet",tI),nI=(function(){function e(t,n,o,r){n===void 0&&(n=new Map),this.target=t,this.values=n,this.name=o,this.defaultEnhancer=r,this.keysAtom=new ay(o+".keys")}return e.prototype.read=function(t){return this.values.get(t).get()},e.prototype.write=function(t,n){var o=this.target,r=this.values.get(t);if(r instanceof Bg){r.set(n);return}if(Wd(this)){var i=zd(this,{type:"update",object:this.proxy||o,name:t,newValue:n});if(!i)return;n=i.newValue}if(n=r.prepareNewValue(n),n!==yr.UNCHANGED){var a=Jc(this),s=Zu(),i=a||s?{type:"update",object:this.proxy||o,oldValue:r.value,name:t,newValue:n}:null;r.setNewValue(n),a&&Qc(this,i)}},e.prototype.has=function(t){var n=this.pendingKeys||(this.pendingKeys=new Map),o=n.get(t);if(o)return o.get();var r=!!this.values.get(t);return o=new zv(r,W1,this.name+"."+gh(t)+"?",!1),n.set(t,o),o.get()},e.prototype.addObservableProp=function(t,n,o){o===void 0&&(o=this.defaultEnhancer);var r=this.target;if(Wd(this)){var i=zd(this,{object:this.proxy||r,name:t,type:"add",newValue:n});if(!i)return;n=i.newValue}var a=new zv(n,o,this.name+"."+gh(t),!1);this.values.set(t,a),n=a.value,Object.defineProperty(r,t,nZ(t)),this.notifyPropertyAddition(t,n)},e.prototype.addComputedProp=function(t,n,o){var r=this.target;o.name=o.name||this.name+"."+gh(n),this.values.set(n,new Bg(o)),(t===r||tK(t,n))&&Object.defineProperty(t,n,rZ(n))},e.prototype.remove=function(t){if(this.values.has(t)){var n=this.target;if(Wd(this)){var o=zd(this,{object:this.proxy||n,name:t,type:"remove"});if(!o)return}try{Kc();var r=Jc(this),i=Zu(),a=this.values.get(t),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var l=this.pendingKeys.get(t);l&&l.set(!1)}delete this.target[t];var o=r||i?{type:"remove",object:this.proxy||n,oldValue:s,name:t}:null;r&&Qc(this,o)}finally{Zc()}}},e.prototype.illegalAccess=function(t,n){console.warn("Property '"+n+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(t,n){return ob(this,t)},e.prototype.intercept=function(t){return rb(this,t)},e.prototype.notifyPropertyAddition=function(t,n){var o=Jc(this),r=Zu(),i=o||r?{type:"add",object:this.proxy||this.target,name:t,newValue:n}:null;if(o&&Qc(this,i),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!0)}this.keysAtom.reportChanged()},e.prototype.getKeys=function(){var t,n;this.keysAtom.reportObserved();var o=[];try{for(var r=Vd(this.values),i=r.next();!i.done;i=r.next()){var a=_g(i.value,2),s=a[0],l=a[1];l instanceof zv&&o.push(s)}}catch(f){t={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o},e})();function MM(e,t,n){if(t===void 0&&(t=""),n===void 0&&(n=nb),Object.prototype.hasOwnProperty.call(e,eo))return e[eo];ry(e)||(t=(e.constructor.name||"ObservableObject")+"@"+Hs()),t||(t="ObservableObject@"+Hs());var o=new nI(e,new Map,gh(t),n);return oy(e,eo,o),o}var Rk=Object.create(null),Dk=Object.create(null);function nZ(e){return Rk[e]||(Rk[e]={configurable:!0,enumerable:!0,get:function(){return this[eo].read(e)},set:function(t){this[eo].write(e,t)}})}function jk(e){var t=e[eo];return t||(qv(e),e[eo])}function rZ(e){return Dk[e]||(Dk[e]={configurable:yr.computedConfigurable,enumerable:!1,get:function(){return jk(this).read(e)},set:function(t){jk(this).write(e,t)}})}var oZ=jh("ObservableObjectAdministration",nI);function rd(e){return _M(e)?(qv(e),oZ(e[eo])):!1}function Mh(e,t){if(typeof e=="object"&&e!==null){if(tf(e))return t!==void 0&&Qo(!1),e[eo].atom;if(oc(e))return e[eo];if(Ys(e)){var n=e;if(t===void 0)return n._keysAtom;var o=n._data.get(t)||n._hasMap.get(t);return o||Qo(!1),o}if(qv(e),t&&!e[eo]&&e[t],rd(e)){if(!t)return Qo(!1);var o=e[eo].values.get(t);return o||Qo(!1),o}if(bM(e)||$g(e)||Tw(e))return e}else if(typeof e=="function"&&Tw(e[eo]))return e[eo];return Qo(!1)}function Y1(e,t){if(e||Qo("Expecting some object"),t!==void 0)return Y1(Mh(e,t));if(bM(e)||$g(e)||Tw(e)||Ys(e)||oc(e))return e;if(qv(e),e[eo])return e[eo];Qo(!1)}function iZ(e,t){var n;return t!==void 0?n=Mh(e,t):rd(e)||Ys(e)||oc(e)?n=Y1(e):n=Mh(e),n.name}var Lk=Object.prototype.toString;function rI(e,t,n){return n===void 0&&(n=-1),kA(e,t,n)}function kA(e,t,n,o,r){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var i=typeof e;if(i!=="function"&&i!=="object"&&typeof t!="object")return!1;var a=Lk.call(e);if(a!==Lk.call(t))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=Ik(e),t=Ik(t);var s=a==="[object Array]";if(!s){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,f=t.constructor;if(l!==f&&!(typeof l=="function"&&l instanceof l&&typeof f=="function"&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),o=o||[],r=r||[];for(var h=o.length;h--;)if(o[h]===e)return r[h]===t;if(o.push(e),r.push(t),s){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!kA(e[h],t[h],n-1,o,r))return!1}else{var v=Object.keys(e),b=void 0;if(h=v.length,Object.keys(t).length!==h)return!1;for(;h--;)if(b=v[h],!(aZ(t,b)&&kA(e[b],t[b],n-1,o,r)))return!1}return o.pop(),r.pop(),!0}function Ik(e){return tf(e)?e.slice():iy(e)||Ys(e)||tb(e)||oc(e)?Array.from(e.entries()):e}function aZ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Cw(e){return e[Symbol.iterator]=lZ,e}function lZ(){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:CK,extras:{getDebugName:iZ},$mobx:eo});function sZ(e){return!(e.prototype&&e.prototype.render)&&!ko.isPrototypeOf(e)}function oI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.prefix,o=n===void 0?"":n,r=t.suffix,i=r===void 0?"":r,a=e.displayName||e.name||e.constructor&&e.constructor.name||"<component>";return o+a+i}var Fk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iI=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},aI=(function(){function e(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}})(),lI=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},sI=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Bk=console;function uZ(e){var t=TA().allowStateChanges;return TA().allowStateChanges=e,t}function cZ(e){TA().allowStateChanges=e}function dZ(e,t,n,o,r){var i=uZ(e),a=void 0;try{a=t(n,o,r)}finally{cZ(i)}return a}function $k(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=e[t],r=uI[t],i=o?n===!0?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;e[t]=i}function Uk(e,t){if(e==null||t==null||(typeof e>"u"?"undefined":Fk(e))!=="object"||(typeof t>"u"?"undefined":Fk(t))!=="object")return e!==t;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(t[o]!==e[o])return!0;return!1}var uI={componentWillMount:function(){var t=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 t.componentWillReact=="function"&&t.componentWillReact(),t.__$mobxIsUnmounted!==!0)){var b=!0;try{r=!0,o||ko.prototype.forceUpdate.call(t),b=!1}finally{r=!1,b&&s.dispose()}}}),s.reactComponent=t,h.$mobx=s,t.render=h,h(t.props,t.state,t.context)},h=function(b,E,O){l=!1;var w=void 0,S=void 0;if(s.track(function(){try{S=dZ(!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(t,n){return this.state!==n?!0:Uk(this.props,t)}};function TM(e){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))``'),e.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'"),sZ(e)){var t,n;return TM((n=t=(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 e.call(this,this.props,this.context)}}]),i})(ko),t.displayName=oI(e),n))}if(!e)throw new Error("Please pass a valid component to 'observer'");var o=e.prototype||e;return fZ(o),e.isMobXReactObserver=!0,e}function fZ(e){$k(e,"componentWillMount",!0),$k(e,"componentDidMount"),e.shouldComponentUpdate||(e.shouldComponentUpdate=uI.shouldComponentUpdate)}var pZ=TM(function(e){var t=e.children;return t[0]()});pZ.displayName="Observer";var hZ=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vZ(e,t){return t={exports:{}},e(t,t.exports),t.exports}vZ(function(e,t){(function(n,o){e.exports=o()})(hZ,(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;S<w.length;++S){var M=w[S];if(!n[M]&&!o[M]&&(!E||!E[M])){var T=s(b,M);try{r(v,M,T)}catch{}}}return v}return v}}))});var Vk={children:!0,key:!0,ref:!0},Gk=console;(function(e){lI(t,e);function t(){return iI(this,t),sI(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return aI(t,[{key:"render",value:function(o){var r=o.children;return r.length>1?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&&Gk.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]&&Gk.warn("MobX Provider: Provided store '"+r+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),t})(ko);if(!ko)throw new Error("mobx-preact requires Preact to be available");var $d,JO,Wk,cI=[],jl=xo,zk=jl.__b,Hk=jl.__r,Xk=jl.diffed,Yk=jl.__c,qk=jl.unmount,Kk=jl.__;function mZ(){for(var e;e=cI.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(K0),t.__h.some(PA),t.__h=[]}catch(n){t.__h=[],jl.__e(n,e.__v)}}}jl.__b=function(e){$d=null,zk&&zk(e)},jl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Kk&&Kk(e,t)},jl.__r=function(e){Hk&&Hk(e);var t=($d=e.__c).__H;t&&(JO===$d?(t.__h=[],$d.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(K0),t.__h.some(PA),t.__h=[])),JO=$d},jl.diffed=function(e){Xk&&Xk(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cI.push(t)!==1&&Wk===jl.requestAnimationFrame||((Wk=jl.requestAnimationFrame)||gZ)(mZ)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),JO=$d=null},jl.__c=function(e,t){t.some(function(n){try{n.__h.some(K0),n.__h=n.__h.filter(function(o){return!o.__||PA(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],jl.__e(o,n.__v)}}),Yk&&Yk(e,t)},jl.unmount=function(e){qk&&qk(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{K0(o)}catch(r){t=r}}),n.__H=void 0,t&&jl.__e(t,n.__v))};var Zk=typeof requestAnimationFrame=="function";function gZ(e){var t,n=function(){clearTimeout(o),Zk&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Zk&&(t=requestAnimationFrame(n))}function K0(e){var t=$d,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$d=t}function PA(e){var t=$d;e.__c=e.__(),$d=t}function yZ(e,t){for(var n in t)e[n]=t[n];return e}function Jk(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function Qk(e,t){this.props=e,this.context=t}(Qk.prototype=new ko).isPureReactComponent=!0,Qk.prototype.shouldComponentUpdate=function(e,t){return Jk(this.props,e)||Jk(this.state,t)};var eP=xo.__b;xo.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),eP&&eP(e)};var _Z=xo.__e;xo.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}_Z(e,t,n,o)};var tP=xo.unmount;function dI(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=yZ({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return dI(o,t,n)})),e}function fI(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return fI(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function QO(){this.__u=0,this.o=null,this.__b=null}function pI(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function g0(){this.i=null,this.l=null}xo.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),tP&&tP(e)},(QO.prototype=new ko).__c=function(e,t){var n=t.__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&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},QO.prototype.componentWillUnmount=function(){this.o=[]},QO.prototype.render=function(e,t){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=t.__a&&Lr(jg,null,e.fallback);return r&&(r.__u&=-33),[Lr(jg,null,t.__a?null:e.children),r]};var nP=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(g0.prototype=new ko).__a=function(e){var t=this,n=pI(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),nP(t,e,o)):r()};n?n(i):i()}},g0.prototype.render=function(e){this.i=null,this.l=new Map;var t=ww(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},g0.prototype.componentDidUpdate=g0.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){nP(e,n,t)})};var bZ=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,wZ=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,EZ=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xZ=/[A-Z0-9]/g,OZ=typeof document<"u",SZ=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function rP(e,t,n){return t.__k==null&&(t.textContent=""),Kq(e,t),typeof n=="function"&&n(),e?e.__c:null}ko.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ko.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var oP=xo.event;function AZ(){}function MZ(){return this.cancelBubble}function TZ(){return this.defaultPrevented}xo.event=function(e){return oP&&(e=oP(e)),e.persist=AZ,e.isPropagationStopped=MZ,e.isDefaultPrevented=TZ,e.nativeEvent=e};var CZ={enumerable:!1,configurable:!0,get:function(){return this.class}},iP=xo.vnode;xo.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||OZ&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||SZ(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":EZ.test(a)&&(a=l):l=a="oninput":i&&wZ.test(a)?a=a.replace(xZ,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&r[a=l]&&(a="oninputCapture"),r[a]=s}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ww(n.children).forEach(function(f){f.props.selected=r.value.indexOf(f.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=ww(n.children).forEach(function(f){f.props.selected=r.multiple?r.defaultValue.indexOf(f.props.value)!=-1:r.defaultValue==f.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",CZ)):n.className&&(r.class=r.className=n.className),t.props=r})(e),e.$$typeof=bZ,iP&&iP(e)};var aP=xo.__r;xo.__r=function(e){aP&&aP(e),e.__c};var lP=xo.diffed;xo.diffed=function(e){lP&&lP(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};var NZ=0;function $t(e,t,n,o,r,i){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var f={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--NZ,__i:-1,__u:0,__source:r,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return xo.vnode&&xo.vnode(f),f}var kZ=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},M_;(function(e){function t(n){var o=kZ(n,[]),r=n.container;if(!r)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Xo({},e.defaults,o)}e.get=t})(M_||(M_={}));(function(e){e.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}})(M_||(M_={}));var sP={node:!1,edge:!1},PZ={node:!0,edge:!0},RZ=function(e){return!e||typeof e=="boolean"?e===!0?to(PZ):to(sP):Yv(to(sP),e)},DZ=function(){return om(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function Jl(e){try{return JSON.parse(JSON.stringify(e))}catch{return e}}var y0=200,jZ=9999,LZ=10,Go;(function(e){e[e.DEFAULT=1]="DEFAULT",e[e.TEXT_EDIT=2]="TEXT_EDIT",e[e.SHOW_MENU=3]="SHOW_MENU",e[e.ALLOW_CONNECT=4]="ALLOW_CONNECT",e[e.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Go||(Go={}));var da;(function(e){e.NODE="node",e.EDGE="edge",e.GRAPH="graph"})(da||(da={}));var _o;(function(e){e.NODE="node",e.CIRCLE_NODE="circle-node",e.POLYGON_NODE="polygon-node",e.RECT_NODE="rect-node",e.TEXT_NODE="text-node",e.ELLIPSE_NODE="ellipse-node",e.DIAMOND_NODE="diamond-node",e.HTML_NODE="html-node",e.CUSTOM_HTML_NODE="custom-html-node",e.EDGE="edge",e.LINE_EDGE="line-edge",e.POLYLINE_EDGE="polyline-edge",e.BEZIER_EDGE="bezier-edge",e.GRAPH="graph"})(_o||(_o={}));var pr;(function(e){e.ELEMENT_CLICK="element:click",e.NODE_ADD="node:add",e.NODE_DELETE="node:delete",e.NODE_CLICK="node:click",e.NODE_DBCLICK="node:dbclick",e.NODE_GROUP_COPY="node:group-copy-add",e.NODE_DND_ADD="node:dnd-add",e.NODE_DND_DRAG="node:dnd-drag",e.NODE_MOUSEDOWN="node:mousedown",e.NODE_DRAGSTART="node:dragstart",e.NODE_DRAG="node:drag",e.NODE_DROP="node:drop",e.NODE_MOUSEUP="node:mouseup",e.NODE_MOUSEMOVE="node:mousemove",e.NODE_MOUSEENTER="node:mouseenter",e.NODE_MOUSELEAVE="node:mouseleave",e.NODE_CONTEXTMENU="node:contextmenu",e.NODE_ROTATE="node:rotate",e.NODE_RESIZE="node:resize",e.NODE_FOCUS="node:focus",e.NODE_BLUR="node:blur",e.NODE_PROPERTIES_CHANGE="node:properties-change",e.NODE_PROPERTIES_DELETE="node:properties-delete",e.EDGE_ADD="edge:add",e.EDGE_DELETE="edge:delete",e.EDGE_CLICK="edge:click",e.EDGE_DBCLICK="edge:dbclick",e.EDGE_FOCUS="edge:focus",e.EDGE_BLUR="edge:blur",e.EDGE_MOUSEENTER="edge:mouseenter",e.EDGE_MOUSELEAVE="edge:mouseleave",e.EDGE_CONTEXTMENU="edge:contextmenu",e.EDGE_ADJUST="edge:adjust",e.EDGE_EXCHANGE_NODE="edge:exchange-node",e.ANCHOR_CLICK="anchor:click",e.ANCHOR_MOUSEDOWN="anchor:mousedown",e.ANCHOR_DRAGSTART="anchor:dragstart",e.ANCHOR_DRAG="anchor:drag",e.ANCHOR_DROP="anchor:drop",e.ANCHOR_DRAGEND="anchor:dragend",e.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",e.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",e.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",e.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",e.ADJUST_POINT_DRAG="adjustPoint:drag",e.ADJUST_POINT_DROP="adjustPoint:drop",e.ADJUST_POINT_DRAGEND="adjustPoint:dragend",e.BLANK_MOUSEDOWN="blank:mousedown",e.BLANK_DRAGSTART="blank:dragstart",e.BLANK_DRAG="blank:drag",e.BLANK_DROP="blank:drop",e.BLANK_MOUSEMOVE="blank:mousemove",e.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",e.BLANK_MOUSEUP="blank:mouseup",e.BLANK_CLICK="blank:click",e.BLANK_CONTEXTMENU="blank:contextmenu",e.SELECTION_MOUSEDOWN="selection:mousedown",e.SELECTION_DRAGSTART="selection:dragstart",e.SELECTION_DRAG="selection:drag",e.SELECTION_DROP="selection:drop",e.SELECTION_MOUSEMOVE="selection:mousemove",e.SELECTION_MOUSEUP="selection:mouseup",e.SELECTION_CONTEXTMENU="selection:contextmenu",e.CONNECTION_NOT_ALLOWED="connection:not-allowed",e.TEXT_MOUSEDOWN="text:mousedown",e.TEXT_DRAGSTART="text:dragstart",e.TEXT_DRAG="text:drag",e.TEXT_DROP="text:drop",e.TEXT_CLICK="text:click",e.TEXT_DBCLICK="text:dbclick",e.TEXT_BLUR="text:blur",e.TEXT_MOUSEMOVE="text:mousemove",e.TEXT_MOUSEUP="text:mouseup",e.TEXT_FOCUS="text:focus",e.TEXT_ADD="text:add",e.TEXT_UPDATE="text:update",e.TEXT_CLEAR="text:clear",e.LABEL_MOUSEDOWN="label:mousedown",e.LABEL_DRAGSTART="label:dragstart",e.LABEL_DRAG="label:drag",e.LABEL_DROP="label:drop",e.LABEL_CLICK="label:click",e.LABEL_DBCLICK="label:dbclick",e.LABEL_BLUR="label:blur",e.LABEL_MOUSEMOVE="label:mousemove",e.LABEL_MOUSEUP="label:mouseup",e.LABEL_FOCUS="label:focus",e.LABEL_ADD="label:add",e.LABEL_UPDATE="label:update",e.LABEL_CLEAR="label:clear",e.LABEL_DELETE="label:delete",e.LABEL_SHOULD_ADD="label:should-add",e.LABEL_BATCH_ADD="label:batch-add",e.LABEL_SHOULD_UPDATE="label:should-update",e.LABEL_SHOULD_DELETE="label:should-delete",e.LABEL_BATCH_DELETE="label:batch-delete",e.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",e.HISTORY_CHANGE="history:change",e.GRAPH_TRANSFORM="graph:transform",e.GRAPH_RENDERED="graph:rendered",e.GRAPH_UPDATED="graph:updated",e.EDIT_CONFIG_CHANGED="editConfig:changed"})(pr||(pr={}));var vl;(function(e){e[e.STATIC=-1]="STATIC",e[e.DEFAULT=0]="DEFAULT",e[e.INCREASE=1]="INCREASE",e[e.EDGE_TOP=2]="EDGE_TOP"})(vl||(vl={}));var ni;(function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"})(ni||(ni={}));var Ju;(function(e){e.TEXT="text",e.LABEL="label"})(Ju||(Ju={}));var IZ=0,ac=(function(){function e(t){var n=t.onDragStart,o=n===void 0?Qy:n,r=t.onDragging,i=r===void 0?Qy:r,a=t.onDragEnd,s=a===void 0?Qy:a,l=t.eventType,f=l===void 0?"":l,h=t.eventCenter,v=t.step,b=v===void 0?1:v,E=t.isStopPropagation,O=E===void 0?!0:E,w=t.model,S=t.data,M=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(T){var $,D,P=window==null?void 0:window.document;if(T.button===IZ){M.isStopPropagation&&T.stopPropagation(),M.isStartDragging=!0,M.startX=T.clientX,M.startY=T.clientY,P.addEventListener("mousemove",M.handleMouseMove,!1),P.addEventListener("mouseup",M.handleMouseUp,!1);var B=($=M.model)===null||$===void 0?void 0:$.getData();(D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_MOUSEDOWN")],{e:T,data:M.data||B}),M.startTime=new Date().getTime()}},this.handleMouseMove=function(T){var $,D;if(M.isStopPropagation&&T.stopPropagation(),!!M.isStartDragging&&(M.sumDeltaX+=T.clientX-M.startX,M.sumDeltaY+=T.clientY-M.startY,M.startX=T.clientX,M.startY=T.clientY,M.step<=1||Math.abs(M.sumDeltaX)>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,q;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}),(q=M.eventCenter)===null||q===void 0||q.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 e.prototype.setStep=function(t){this.step=t},e.prototype.setModel=function(t){this.model=t},e})(),FZ=function(e){var t=e.x,n=e.y,o=e.width,r=e.height;return{x:t-o/2,y:n-r/2,x1:t+o/2,y1:n+r/2}},BZ=function(e){var t=e.startPoint,n=e.endPoint,o=(t.x+n.x)/2,r=(t.y+n.y)/2,i=Math.abs(t.x-n.x)+10,a=Math.abs(t.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}},$Z=function(e){var t=e.points,n=Kv(t),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}},UZ=function(e){var t=e.path,n=CM(t),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}},VZ=function(e){if(e.modelType===_o.LINE_EDGE)return BZ(e);if(e.modelType===_o.POLYLINE_EDGE)return $Z(e);if(e.modelType===_o.BEZIER_EDGE)return UZ(e)},GZ=function(e,t,n,o){var r=(t.y-e.y)*(o.x-n.x)-(e.x-t.x)*(n.y-o.y);if(r===0)return!1;var i=((t.x-e.x)*(o.x-n.x)*(n.y-e.y)+(t.y-e.y)*(o.x-n.x)*e.x-(o.y-n.y)*(t.x-e.x)*n.x)/r,a=-((t.y-e.y)*(o.y-n.y)*(n.x-e.x)+(t.x-e.x)*(o.y-n.y)*e.y-(o.x-n.x)*(t.y-e.y)*n.y)/r;return(i-e.x)*(i-t.x)<=0&&(a-e.y)*(a-t.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0?{x:i,y:a}:!1},T_=function(e,t,n){var o=e.x,r=e.y,i=t.x,a=t.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)<Number.EPSILON},C_=function(e){var t=e.start,n=e.end,o=e.offset,r=e.verticalLength,i=e.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-t.y)/(n.x-t.x)),l=Math.atan(o/r),f=Math.sqrt(r*r+o*o);return i==="start"?n.x>=t.x?(a.leftX=t.x+f*Math.sin(s+l),a.leftY=t.y-f*Math.cos(s+l),a.rightX=t.x-f*Math.sin(s-l),a.rightY=t.y+f*Math.cos(s-l)):(a.leftX=t.x-f*Math.sin(s+l),a.leftY=t.y+f*Math.cos(s+l),a.rightX=t.x+f*Math.sin(s-l),a.rightY=t.y-f*Math.cos(s-l)):i==="end"&&(n.x>=t.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(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},bg.apply(this,arguments)},Yu=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yh=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},WZ=function(e,t){return Math.abs(e.centerX-t.centerX)*2<e.width+t.width&&Math.abs(e.centerY-t.centerY)*2<e.height+t.height},RA=function(e){var t=[],n={};return e.forEach(function(o){var r="".concat(o.x,"-").concat(o.y);o.id=r,n[r]=o}),Object.keys(n).forEach(function(o){t.push(n[o])}),t},Nw=function(e,t){return e.width===0&&e.height===0?e:{x:e.x,y:e.y,centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}},zZ=function(e,t){var n=Math.abs(e.x-t.centerX),o=Math.abs(e.y-t.centerY);return n/t.width>o/t.height?ni.HORIZONTAL:ni.VERTICAL},kw=function(e,t,n){var o=zZ(n,t);return o===ni.HORIZONTAL?{x:n.x>e.centerX?e.maxX:e.minX,y:n.y}:{x:n.x,y:n.y>e.centerY?e.maxY:e.minY}},uP=function(e,t){var n=Math.min(e.minX,t.minX),o=Math.min(e.minY,t.minY),r=Math.max(e.maxX,t.maxX),i=Math.max(e.maxY,t.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(e,t){e===void 0&&(e=[]);var n=[],o=[];e.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 t&&(l+=t,f+=t),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:f,width:l}},Pw=function(e){var t=e.minX,n=e.minY,o=e.maxX,r=e.maxY;return[{x:t,y:n},{x:o,y:n},{x:o,y:r},{x:t,y:r}]},_0=function(e,t){var n=e.x,o=e.y;return n<t.minX||n>t.maxX||o<t.minY||o>t.maxY},HZ=function(e,t){return t<e.minX||t>e.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},XZ=function(e,t){return t<e.minY||t>e.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},YZ=function(e,t){return yh(yh([],Yu(HZ(e,t.x)),!1),Yu(XZ(e,t.y)),!1)},DA=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},qZ=function(e,t){var n=-2,o=0;return t.forEach(function(r){r&&(e.x===r.x&&(o+=n),e.y===r.y&&(o+=n))}),o},cP=function(e,t,n,o,r){return DA(e,t)+DA(e,n)+qZ(e,[t,n,o,r])},hI=function(e,t,n,o,r){r||(r=0),e.unshift(t[o]),n[o]&&n[o]!==o&&r<=100&&hI(e,t,n,n[o],r+1)},KZ=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},Hy=function(e,t,n,o){var r=t.x-e.x,i=t.y-e.y,a=o.x-n.x,s=o.y-n.y,l=(-i*(e.x-n.x)+r*(e.y-n.y))/(-a*i+r*s),f=(a*(e.y-n.y)-s*(e.x-n.x))/(-a*i+r*s);return l>=0&&l<=1&&f>=0&&f<=1},dP=function(e,t,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(e,t,r,i)||Hy(e,t,r,s)||Hy(e,t,i,a)||Hy(e,t,a,s)},ZZ=function(e,t,n,o){var r=[];return e.forEach(function(i){i!==t&&(i.x===t.x||i.y===t.y)&&!dP(i,t,n)&&!dP(i,t,o)&&r.push(i)}),RA(r)},JZ=function(e,t,n,o,r,i,a){var s=[],l=[t],f={},h={},v={};t.id&&(h[t.id]=0,v[t.id]=cP(t,n,t));var b={};e.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]<S&&(S=v[T.id],w=T)}),w===n&&n.id){var M=[];return hI(M,b,f,n.id),{value:M}}if(!w)return{value:[t,n]};KZ(l,w),s.push(w),ZZ(e,w,o,r).forEach(function(T){var $;if(s.indexOf(T)===-1&&(l.indexOf(T)===-1&&l.push(T),w!=null&&w.id&&(T!=null&&T.id))){var D=(($=h[w.id])!==null&&$!==void 0?$:0)+DA(w,T);if(h[T.id]&&D>=h[T.id])return;f[T.id]=w.id,h[T.id]=D,v[T.id]=h[T.id]+cP(T,n,t,i,a)}})};l.length;){var O=E();if(typeof O=="object")return O.value}return[t,n]},fP=function(e){return gu(e)},vI=function(e){for(var t=1;t<e.length-1;){var n=e[t-1],o=e[t],r=e[t+1];n.x===o.x&&o.x===r.x||n.y===o.y&&o.y===r.y?e.splice(t,1):t++}return e},pP=function(e,t,n,o,r){var i=fP(n),a=fP(o),s=Nw(i,r),l=Nw(a,r),f=kw(s,i,e),h=kw(l,a,t);if(WZ(s,l)){var v=eJ(e,t,f,h);return yh(yh([e,f],Yu(v),!1),[h,t],!1)}var b=N_([f,h]),E=uP(s,b),O=uP(l,b),w=[];w=w.concat(Pw(E)),w=w.concat(Pw(O));var S={x:(e.x+t.x)/2,y:(e.y+t.y)/2};[b,E,O].forEach(function(T){w=w.concat(YZ(T,S).filter(function($){return _0($,s)&&_0($,l)}))}),[{x:f.x,y:h.y},{x:h.x,y:f.y}].forEach(function(T){_0(T,s)&&_0(T,l)&&w.push(T)}),w.unshift(f),w.push(h),w=RA(w);var M=JZ(w,f,h,i,a,e,t);return M.unshift(e),M.push(t),M.length>2&&(M=vI(M)),RA(M)},QZ=function(e){if(e.length===1){var t=Yu(e,1),n=t[0];return[n,n]}else{for(var o=e[0],r=e[1],i=qc(o.x,o.y,r.x,r.y),a=1;a<e.length-1;a++){var s=e[a],l=e[a+1],f=qc(s.x,s.y,l.x,l.y);f>i&&(i=f,o=s,r=l)}return[o,r]}},hP=function(e,t,n){var o=ip(e,n),r=ip(t,n);return o&&r},vP=function(e,t,n){var o=ip(e,n),r=ip(t,n),i=o&&r,a=o||r;return!i&&a},mP=function(e,t,n){for(var o=void 0,r=gu(n),i=Pw(r),a=0;a<i.length;a++){var s=Hy(e,t,i[a],i[(a+1)%i.length]);s&&(o=[i[a],i[(a+1)%i.length]])}if(o)return GZ(e,t,o[0],o[1])},Rw=function(e,t){var n=void 0;return e.x===t.x?n=ni.VERTICAL:e.y===t.y&&(n=ni.HORIZONTAL),n},Kv=function(e){var t=e.split(" "),n=[];return t&&t.forEach(function(o){var r=Yu(o.split(","),2),i=r[0],a=r[1];n.push({x:Number(i),y:Number(a)})}),n},eJ=function(e,t,n,o){var r=[],i=Rw(e,n),a=Rw(t,o);if(i===a)e.y===n.y?(r.push({x:n.x,y:(n.y+o.y)/2}),r.push({x:o.x,y:(n.y+o.y)/2})):(r.push({x:(n.x+o.x)/2,y:n.y}),r.push({x:(n.x+o.x)/2,y:o.y}));else{var s={x:n.x,y:o.y},l=T_(s,e,n),f=T_(s,t,o);if(l||f)s={x:o.x,y:n.y};else{var h=gP(s,e,n),v=gP(s,t,o);h&&v&&(s={x:o.x,y:n.y})}r.push(s)}return r},gP=function(e,t,n){return e.x===t.x&&e.x===n.x||e.y===t.y&&e.y===n.y},mI=function(e){if(!e)return 0;for(var t=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);e.match(/[A-Z]/)?t+=1.5:o>=1&&o<=126||o>=65376&&o<=65439?t+=1:t+=2}return t},tJ=function(e){var t=e.start,n=e.end,o;if(t.x===n.x&&t.y===n.y)o="";else{var r={start:t,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(e){var t=e.start,n=e.end,o=e.sourceNode,r=e.targetNode,i=e.offset,a=gu(o),s=gu(r),l=Nw(a,i),f=Nw(s,i),h=kw(l,a,t),v=kw(f,s,n);return{sNext:h,ePre:v}},CM=function(e){var t=e.replace(/M/g,"").replace(/C/g,",").split(","),n=b0(t[0]),o=b0(t[1]),r=b0(t[2]),i=b0(t[3]);return[n,o,r,i]},b0=function(e){var t=Yu(e.replace(/(^\s*)/g,"").split(" "),2),n=t[0],o=t[1];return{x:+n,y:+o}},_P=function(e,t){var n=Yu(e,4),o=n[0],r=n[1],i=n[2],a=n[3],s=zJ(o,r,i,a,t);return[s,e[3]]},gI=function(e,t){for(var n=e.x,o=e.y,r=Kv(t),i=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<r.length;l++)s.push({start:r[l],end:r[(l+1)%r.length]});if(s.forEach(function(b){var E=b.start,O=b.end;if(E.x===O.x){var w={x:E.x,y:o},S=T_(w,E,O);if(S){var M=Math.abs(E.x-n);M<i&&(i=M,a=w)}}else if(E.y===O.y){var w={x:n,y:E.y},S=T_(w,E,O);if(S){var M=Math.abs(E.y-o);M<i&&(i=M,a=w)}}}),!a){var f=s[0],h=f.start,v=f.end;a={x:h.x+(v.x-h.x)/2,y:h.y+(v.y-h.y)/2}}return a},nJ=function(e){return Vv(e,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},bP=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))};function rJ(e,t){return typeof t!="function"?function(n,o,r){return Object.assign({type:e.edgeType},r)}:function(n,o,r){var i=t(n,o,r);return i?typeof i=="string"?Object.assign({},r,{type:i}):Object.assign({type:i},r):{type:e.edgeType}}}var oJ=function(e){var t=e.rows,n=e.rowsLength,o=e.fontSize,r=0;return ri(t,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}},ng=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},w0=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))};function Gg(e,t,n){return n&&t*Math.round(e/t)||e}function iJ(e,t,n){if(!e)return[];var o=Math.min.apply(Math,w0([],ng(e.map(function(w){return w[0]})),!1)),r=Math.max.apply(Math,w0([],ng(e.map(function(w){return w[0]})),!1)),i=Math.min.apply(Math,w0([],ng(e.map(function(w){return w[1]})),!1)),a=Math.max.apply(Math,w0([],ng(e.map(function(w){return w[1]})),!1)),s=-o,l=-i,f=e.map(function(w){var S=ng(w,2),M=S[0],T=S[1];return[M+s,T+l]}),h=r-o,v=a-i,b=t?t/h:1,E=n?n/v:1,O=Math.min(b,E);return f.map(function(w){var S=ng(w,2),M=S[0],T=S[1];return[M*O,T*O]})}var eS=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tS=function(e,t,n){var o=eS(e,2),r=o[0],i=o[1],a=eS(t,2),s=a[0],l=a[1],f=eS(n,2),h=f[0],v=f[1];return r>s&&r<h&&i>l&&i<v},yI=function(e,t){var n=t.multipleSelectKey,o=!1;switch(n){case"meta":o=e.metaKey;break;case"alt":o=e.altKey;break;case"shift":o=e.shiftKey;break;case"ctrl":o=e.ctrlKey;break;default:o=!1;break}return o},NM=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();function wP(e,t){return e instanceof Il&&t instanceof Il}var _I=(function(e){NM(t,e);function t(n,o,r){var i=e.call(this,3)||this;return i[0]=n,i[1]=o,i[2]=r,i.x=n,i.y=o,i.z=r,Object.setPrototypeOf(i,t.prototype),i}return t.prototype.add=function(n){if(wP(this,n))return new Il(this.x+n.x,this.y+n.y);var o=this.z+n.z;return new jA((this.x+n.x)/o,(this.y+n.y)/o)},t.prototype.subtract=function(n){if(wP(this,n))return new Il(this.x-n.x,this.y-n.y);var o=this.z-n.z;return o===0?new Il(this.x-n.x,this.y-n.y):new jA((this.x-n.x)/o,(this.y-n.y)/o)},t})(Array),Il=(function(e){NM(t,e);function t(n,o,r){var i=e.call(this,n,o,r??0)||this;return Object.setPrototypeOf(i,t.prototype),i}return t.prototype.toString=function(){return"Vector"},t.prototype.dot=function(n){var o=this;return n.reduce(function(r,i,a){return r+i*o[a]})},t.prototype.cross=function(n){return new t(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)},t.prototype.getLength=function(){return Math.hypot(this.x,this.y)},t.prototype.normalize=function(){var n=this.getLength();return new t(this.x/n,this.y/n)},t.prototype.crossZ=function(n){return this.x*n.y-this.y*n.x},t.prototype.angle=function(n){var o=this.crossZ(n),r=Math.acos(this.normalize().dot(n.normalize()));return o>=0?r:-r},t})(_I),jA=(function(e){NM(t,e);function t(n,o){var r=e.call(this,n,o,1)||this;return Object.setPrototypeOf(r,t.prototype),r}return t.prototype.toString=function(){return"Point"},t})(_I),q1=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),rg=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},nS=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},ib=(function(e){q1(t,e);function t(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=e.call(this,n.length)||this;return r.fill(new Array(3)),n.forEach(function(i,a){r[a]=i}),r.columns=n[0].length,r.rows=n.length,Object.setPrototypeOf(r,t.prototype),r}return t.prototype.getRow=function(n){return this[n]},t.prototype.getColumn=function(n){return nS([],rg(this.map(function(o){return o[n]})),!1)},t.prototype.transpose=function(){for(var n=[],o=0;o<this.columns;o++)n.push(this.getColumn(o));return new(t.bind.apply(t,nS([void 0],rg(n),!1)))},t.prototype.cross=function(n){var o=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===n.rows)for(var r=0;r<this.rows;r++)for(var i=this.getRow(r),a=function(l){var f=n.getColumn(l);o[r][l]=i.reduce(function(h,v,b){return h+v*f[b]},0)},s=0;s<n.columns;s++)a(s);return new(t.bind.apply(t,nS([void 0],rg(o),!1)))},t.prototype.to2D=function(){return this.map(function(n){return[n[0],n[1]]})},t.prototype.toPoints=function(){return this.map(function(n){return new jA(n[0],n[1])})},t.prototype.toString=function(){var n=rg(this[0],2),o=n[0],r=n[1],i=rg(this[1],2),a=i[0],s=i[1],l=rg(this[2],2),f=l[0],h=l[1];return"matrix(".concat(o," ").concat(r," ").concat(a," ").concat(s," ").concat(f," ").concat(h,")")},t.prototype.translate=function(n,o){return this.cross(new Dw(n,o))},t.prototype.rotate=function(n){return this.cross(new aJ(n))},t.prototype.scale=function(n,o){return this.cross(new lJ(n,o))},t})(Array),aJ=(function(e){q1(t,e);function t(n){var o=e.call(this,new Il(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Il(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Il(0,0,1))||this;return Object.setPrototypeOf(o,t.prototype),o}return t.prototype.inverse=function(){return this.transpose()},t})(ib),lJ=(function(e){q1(t,e);function t(n,o){var r=e.call(this,new Il(n,0,0),new Il(0,o,0),new Il(0,0,1))||this;return r.sx=n,r.sy=o,Object.setPrototypeOf(r,t.prototype),r}return t.prototype.inverse=function(){return new t(1/this.sx,1/this.sy)},t})(ib),Dw=(function(e){q1(t,e);function t(n,o){var r=e.call(this,new Il(1,0,0),new Il(0,1,0),new Il(n,o,1))||this;return r.tx=n,r.ty=o,Object.setPrototypeOf(r,t.prototype),r}return t.prototype.inverse=function(){return new t(-this.tx,-this.ty)},t})(ib);FK({});var jw=function(){return jw=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},jw.apply(this,arguments)},sJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LA=function(e){var t=e.anchors;return t},Lw=function(e,t){for(var n=t.nodes,o,r=n.length-1;r>=0;r--){var i=n[r],a=dJ(e,i);if(a){var s=i.getTargetAnchor(e);if(s){var l={node:i,anchorIndex:s.index,anchor:s.anchor};(!o||uJ(i,o.node,t))&&(o=l)}}}return o},uJ=function(e,t,n){return e.zIndex>t.zIndex?!0:n.nodesMap[e.id].index>n.nodesMap[t.id].index},cJ=function(e,t){for(var n=LA(t),o,r=Number.MAX_SAFE_INTEGER,i=0;i<n.length;i++){var a=qc(e.x,e.y,n[i].x,n[i].y);a<r&&(r=a,o={index:i,anchor:jw(jw({},n[i]),{x:n[i].x,y:n[i].y,id:n[i].id})})}return o},qc=function(e,t,n,o){return Math.hypot(e-n,t-o)},ip=function(e,t,n){n===void 0&&(n=0);var o=!1,r=gu(t),i=sJ(new ib([e.x,e.y,1]).translate(-t.x,-t.y).rotate(-t.rotate).translate(t.x,t.y)[0],2),a=i[0],s=i[1],l={x:a,y:s};return l.x>=r.minX-n&&l.x<=r.maxX+n&&l.y>=r.minY-n&&l.y<=r.maxY+n&&(o=!0),o},dJ=function(e,t){return ip(e,t,5)},gu=function(e){var t=e.x,n=e.y,o=e.width,r=e.height;return{minX:t-o/2,minY:n-r/2,maxX:t+o/2,maxY:n+r/2,x:t,y:n,width:o,height:r,centerX:t,centerY:n}},fJ=function(e){var t=e,n=t.x,o=t.y,r=t.width,i=t.height,a=t.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(e,t,n){var o=fJ(n),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var s=qc(e.x,e.y,a.x,a.y);s<i&&(i=s,r=a)}),IA(e,t,r)},IA=function(e,t,n){var o,r=n.x,i=n.y,a=n.r;if(t===ni.HORIZONTAL){var s=r-Math.sqrt(a*a-(e.y-i)*(e.y-i)),l=r+Math.sqrt(a*a-(e.y-i)*(e.y-i)),f=Math.abs(s-e.x)<Math.abs(l-e.x)?s:l;o={x:f,y:e.y}}else if(t===ni.VERTICAL){var h=i-Math.sqrt(a*a-(e.x-r)*(e.x-r)),v=i+Math.sqrt(a*a-(e.x-r)*(e.x-r)),b=Math.abs(h-e.y)<Math.abs(v-e.y)?h:v;o={x:e.x,y:b}}return o},xP=function(e,t){var n=t,o=!1,r=n.x,i=n.y,a=n.width,s=n.height,l=n.radius,f={minX:r-a/2+l,maxX:r+a/2-l,minY:i-s/2+l,maxY:i+s/2-l};return e.y===i+s/2||e.y===i-s/2?o=e.x>f.minX&&e.x<f.maxX:(e.x===r+a/2||e.x===r-a/2)&&(o=e.y>f.minY&&e.y<f.maxY),o},OP=function(e,t,n){var o,r=n,i=r.x,a=r.y,s=r.rx,l=r.ry;if(t===ni.HORIZONTAL){var f=i-Math.sqrt(s*s-(e.y-a)*(e.y-a)*s*s/(l*l)),h=i+Math.sqrt(s*s-(e.y-a)*(e.y-a)*s*s/(l*l)),v=Math.abs(f-e.x)<Math.abs(h-e.x)?f:h;o={x:v,y:e.y}}else if(t===ni.VERTICAL){var b=a-Math.sqrt(l*l-(e.x-i)*(e.x-i)*l*l/(s*s)),E=a+Math.sqrt(l*l-(e.x-i)*(e.x-i)*l*l/(s*s)),O=Math.abs(b-e.y)<Math.abs(E-e.y)?b:E;o={x:e.x,y:O}}return o},E0=function(e,t,n){for(var o=n.pointsPosition,r=Number.MAX_SAFE_INTEGER,i,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach(function(l){var f=l.start,h=l.end,v=f,b=h;f.x>h.x&&(v=h,b=f);var E={x:e.x,y:e.y};if(v.x===b.x&&t===ni.HORIZONTAL&&(E={x:v.x,y:e.y}),v.y===b.y&&t===ni.VERTICAL&&(E={x:e.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);t===ni.HORIZONTAL?E={x:(e.y-w)/O,y:e.y}:t===ni.VERTICAL&&(E={x:e.x,y:O*e.x+w})}var S=T_(E,f,h);if(S){var M=qc(E.x,E.y,e.x,e.y);M<r&&(r=M,i=E)}}),i},pJ=function(e){var t=Vv(e,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return t},SP=function(e,t,n,o){var r=e.x,i=e.y;return t.x>e.x?r=e.x+n/2:t.x<e.x&&(r=e.x-n/2),t.y>e.y?i=e.y+o/2:t.y<e.y&&(i=e.y-o/2),{x:r,y:i}},bI=function(e){var t=e.rows,n=e.style,o=e.rowsLength,r=e.className,i=document.createElement("div");i.className=r,i.style.fontSize="".concat(n.fontSize),i.style.width="".concat(n.width),i.style.lineHeight="".concat(n.lineHeight),i.style.padding="".concat(n.padding),n.fontFamily&&(i.style.fontFamily="".concat(n.fontFamily)),o>1?t.forEach(function(s){var l=document.createElement("div");l.textContent=s,i.appendChild(l)}):i.textContent=t[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},AP=function(e){var t=e.rows,n=e.rowsLength,o=e.fontSize,r=0;return t&&t.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(e){return typeof e!="object"?{isAllPass:!!e,msg:e?"":"不允许连接"}:e};let x0;const hJ=new Uint8Array(16);function vJ(){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(hJ)}const Rl=[];for(let e=0;e<256;++e)Rl.push((e+256).toString(16).slice(1));function mJ(e,t=0){return Rl[e[t+0]]+Rl[e[t+1]]+Rl[e[t+2]]+Rl[e[t+3]]+"-"+Rl[e[t+4]]+Rl[e[t+5]]+"-"+Rl[e[t+6]]+Rl[e[t+7]]+"-"+Rl[e[t+8]]+Rl[e[t+9]]+"-"+Rl[e[t+10]]+Rl[e[t+11]]+Rl[e[t+12]]+Rl[e[t+13]]+Rl[e[t+14]]+Rl[e[t+15]]}const gJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MP={randomUUID:gJ};function yJ(e,t,n){if(MP.randomUUID&&!e)return MP.randomUUID();e=e||{};const o=e.random||(e.rng||vJ)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,mJ(o)}var wh=function(){return yJ()},t_=new Map,wI=function(e){var t=wh();function n(){e();var r=t_.get(t);if(r){var i=window.requestAnimationFrame(n);t_.set(t,i)}}var o=window.requestAnimationFrame(n);return t_.set(t,o),t},Fw=function(e){var t=t_.get(e);t&&(window.cancelAnimationFrame(t),t_.delete(e))},k_=function(){return k_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},k_.apply(this,arguments)},_J=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function EI(e){var t=e.x,n=t===void 0?0:t,o=e.y,r=o===void 0?0:o,i=e.value,a=e.fontSize,s=a===void 0?12:a,l=e.fill,f=l===void 0?"currentColor":l,h=e.overflowMode,v=h===void 0?"default":h,b=e.textWidth,E=b===void 0?void 0:b,O=e.model,w={x:n,y:r,fill:f,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(ri(pp(e),function(P){var B=_J(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 bJ(e)}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 bJ(e){var t=e.x,n=e.y,o=e.value,r=e.model,i=e.textWidth,a=e.fontSize,s=a===void 0?12:a,l=e.lineHeight,f=e.fontFamily,h=f===void 0?"":f,v=e.wrapPadding,b=v===void 0?"0, 0":v,E=e.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:t-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_({},e),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(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},FA.apply(this,arguments)},wJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Wg(e){var t={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return ri(pp(e),function(n){var o=wJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(t[r]=i)}),$t("line",FA({},t))}var BA=function(){return BA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},BA.apply(this,arguments)},EJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function qu(e){var t=e.x,n=e.y,o=e.width,r=e.height,i=e.className,a=e.strokeWidth,s=e.radius,l=s===void 0?0:s,f=t-o/2,h=n-r/2,v={};return v["stroke-width"]=a,ri(pp(e),function(b){var E=EJ(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(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$A.apply(this,arguments)},xJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function P_(e){var t={d:""};return ri(pp(e),function(n){var o=xJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(t[r]=i)}),$t("path",$A({},t))}var UA=function(){return UA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},UA.apply(this,arguments)},OJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function zg(e){var t=e.x,n=t===void 0?0:t,o=e.y,r=o===void 0?0:o,i=e.r,a=i===void 0?4:i,s=e.className,l={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(e),function(f){var h=OJ(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(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},VA.apply(this,arguments)},SJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function AJ(e){var t=e.x,n=t===void 0?0:t,o=e.y,r=o===void 0?0:o,i=e.rx,a=i===void 0?4:i,s=e.ry,l=s===void 0?4:s,f=e.className,h={cx:n,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(e),function(v){var b=SJ(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(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Bw.apply(this,arguments)},MJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function TJ(e,t){var n=e.map(function(T){return{x:T[0],y:T[1]}}),o=n.length;if(o<3)return"";for(var r=Math.abs(t),i="",a=0;a<o;a++){var s=n[(a-1+o)%o],l=n[a],f=n[(a+1)%o],h={x:l.x-s.x,y:l.y-s.y},v={x:f.x-l.x,y:f.y-l.y},b=Math.hypot(h.x,h.y),E=Math.hypot(v.x,v.y),O={x:h.x/b,y:h.y/b},w={x:v.x/E,y:v.y/E},S={x:l.x-O.x*r,y:l.y-O.y*r},M={x:l.x+w.x*r,y:l.y+w.y*r};a===0?i+="M ".concat(S.x," ").concat(S.y," "):i+="L ".concat(S.x," ").concat(S.y," "),i+="Q ".concat(l.x," ").concat(l.y," ").concat(M.x," ").concat(M.y," ")}return i+="Z",i}function kM(e){var t=e.points,n=t===void 0?[]:t,o=e.className,r=e.radius,i={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(ri(pp(e),function(s){var l=MJ(s,2),f=l[0],h=l[1];typeof h!="object"&&(i[f]=h)}),o?i.classNmae="lf-basic-shape ".concat(o):i.className="lf-basic-shape",r){var a=TJ(n,r);return i.d=a,$t("path",Bw({},i))}else return i.points=n.map(function(s){return s.join(",")}).join(" "),$t("polygon",Bw({},i))}var GA=function(){return GA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},GA.apply(this,arguments)},CJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function NJ(e){var t=e.className,n={points:"",fill:"none"};return ri(pp(e),function(o){var r=CJ(o,2),i=r[0],a=r[1];(i==="style"||typeof a!="object")&&(n[i]=a)}),t&&(n.className="".concat(t)),$t("polyline",GA({},n))}var xI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),R_=function(){return R_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},R_.apply(this,arguments)},kJ=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},PJ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ho;(function(e){e[e.LEFT_TOP=0]="LEFT_TOP",e[e.RIGHT_TOP=1]="RIGHT_TOP",e[e.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",e[e.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(Ho||(Ho={}));var RJ=(function(e){xI(t,e);function t(n){var o=e.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=PJ(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 t.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},t.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=kJ(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})]})},t})(ko),DJ=(function(e){xI(t,e);function t(){return e.call(this)||this}return t.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(RJ,R_({},v,{model:o,graphModel:r}))})},t.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}))},t.prototype.render=function(){return $t("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},t})(ko);function jJ(e,t){var n=e.x,o=e.y,r=t.x,i=t.y,a={x:n+(r-n)/2,y:o+(i-o)/2};return a}function Xy(e,t,n){var o=LJ(n),r=e.x-t.x,i=e.y-t.y,a=r*Math.cos(o)-i*Math.sin(o)+t.x,s=r*Math.sin(o)+i*Math.cos(o)+t.y;return{x:a,y:s}}function LJ(e){return e*Math.PI/180}function IJ(e){return e/Math.PI*180}function FJ(e,t,n,o,r,i,a,s){r===void 0&&(r=!1),i===void 0&&(i=!1);var l={x:n.x-(e.x-n.x),y:n.y-(e.y-n.y)},f=jJ(l,t),h=Xy(t,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 BJ(e,t,n,o,r,i,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var f=t.deltaX,h=t.deltaY,v=t.width,b=t.height,E=IJ(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=FJ(S,M,w,E,s,l,v,b),$=T.width,D=T.height,P=T.center;return t.width=$*e,t.height=D*e,t.deltaX=(P.x-w.x)*2,t.deltaY=(P.y-w.y)*2,t}var $J=function(e,t,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(t),b=v.deltaX,E=v.deltaY,O=v.width,w=v.height,S=v.PCTResizeInfo;if(S){var M=4,T=0,$=0;switch(e){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(e){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 BJ(n,v,i,a,s,l,f,o,r);if(h){var B=O/w,F=0,I=O,V=w;switch(e){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(e){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},UJ=function(e,t){var n=e.id,o=e.anchors,r=t.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})}})},VJ=function(e,t,n,o,r,i,a){a.eventCenter.emit(pr.NODE_RESIZE,{preData:e,data:t,deltaX:n,deltaY:o,index:r,model:i})},OI=function(e){var t=e.x,n=e.y,o=e.deltaX,r=e.deltaY,i=e.index,a=e.nodeModel,s=e.graphModel,l=e.cancelCallback,f=e.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},q=v||b&&E?1/2:1,X=t,G=n,Q=$J(i,z,q,I,V,P,X,G,B,F,h);if(Q.width<M||Q.width>$||Q.height<T||Q.height>D){l==null||l();return}(P%(2*Math.PI)==0||S||X===void 0||G===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||(UJ(a,s),VJ(J,ie,o,r,i,a,s))},GJ=100,WJ={x:1,y:0};function zJ(e,t,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:e.x*Math.pow(1-E,3)+3*t.x*E*Math.pow(1-E,2)+3*n.x*Math.pow(E,2)*(1-E)+o.x*Math.pow(E,3),y:e.y*Math.pow(1-E,3)+3*t.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<r&&s<50;){h=i(1-s/GJ);var v=h.x,b=h.y;a=qc(l,f,v,b),s++}return h}function HJ(e,t){return e.x*t.y-e.y*t.x}function XJ(e,t){var n=[e.x,e.y,e.z],o=[t.x,t.y,t.z];return o.reduce(function(r,i,a){return r+i*n[a]})}function YJ(e,t){var n=HJ(e,t),o=Math.acos(XJ(TP(e),TP(t)));return n>=0?o:-o}function TP(e){var t=Math.hypot(e.x,e.y);return{x:e.x/t,y:e.y/t,z:0}}function qJ(e){return YJ(WJ,e)}function KJ(e){return e*(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"}},ZJ={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"}},JJ={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"}},QJ={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:QJ,dark:JJ,radius:ZJ,default:SI},eQ={background:"#23272e"},tQ={background:"#fefeff"},WA={background:"#ffffff"},j_={colorful:tQ,dark:eQ,radius:WA,default:WA},nQ={color:"#66676a",thickness:1},rQ={color:"#dadada",thickness:1},zA={color:"#acacac",thickness:1},L_={colorful:rQ,dark:nQ,radius:zA,default:zA},AI=function(e,t){var n=to(SI);return t&&(n=Yv(n,D_[t])),e&&(n=Yv(n,e)),n},oQ=function(e,t){if(D_[e]){console.warn("theme mode ".concat(e," already exists"));return}D_[e]=t,j_[e]=t.background||WA,L_[e]=t.grid||zA},iQ=function(e){delete D_[e],delete j_[e],delete L_[e]},aQ=function(){var e={colorful:{},dark:{},radius:{},default:{}};Xo(D_,e),Xo(j_,e),Xo(L_,e)},lQ=AI,sQ=1e3,uQ=999,I_=function(){return++sQ},cQ=function(){return--uQ},Da=function(){return Da=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Da.apply(this,arguments)},Pr=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},K1=(function(){function e(t,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=Go.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=t.properties)!==null&&o!==void 0?o:{},this.initEdgeData(t),this.setAttributes()}return e.prototype.initEdgeData=function(t){var n=this;if(t.properties||(t.properties={}),!t.id){var o=this.graphModel.idGenerator,r=o&&o(t.type),i=this.createId();t.id=i||r||wh()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Xo(this,nJ(t));var s=this.graphModel,l=s.overlapMode,f=s.eventCenter;this.updateZIndexByOverlap(l,t.zIndex||I_()),this.setAnchors(),this.initPoints(),this.formatText(t),f.on("overlap:change",function(h){var v=h.overlapMode;n.updateZIndexByOverlap(v,n.zIndex||I_())})},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.getEdgeStyle=function(){return Da(Da({},this.graphModel.theme.baseEdge),this.style)},e.prototype.getAdjustPointStyle=function(){return Da({},this.graphModel.theme.edgeAdjust)},e.prototype.getTextStyle=function(){var t=this.graphModel.theme.edgeText;return to(t)},e.prototype.getEdgeAnimationStyle=function(){var t=this.graphModel.theme.edgeAnimation;return to(t)},e.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),o=this.graphModel.theme.arrow,r=this.isAnimation?n.stroke:t.stroke;return Da(Da(Da({},t),{fill:r,stroke:r}),o)},e.prototype.getOutlineStyle=function(){var t=this.graphModel,n=t.theme.outline;return to(n)},e.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(e.prototype,"sourceNode",{get:function(){var t,n;return(n=(t=this.graphModel)===null||t===void 0?void 0:t.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetNode",{get:function(){var t,n;return(n=(t=this.graphModel)===null||t===void 0?void 0:t.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),e.prototype.getBeginAnchor=function(t,n,o){var r,i,a=LA(t);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<i)&&(i=l,r=s)}),r},e.prototype.getEndAnchor=function(t,n){var o=this,r,i,a=LA(t);if(n){if(r=Sh(a,function(s){return s.id===n}),r)return r;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(o.startPoint){var l=bP(s,o.startPoint);(i===void 0||l<i)&&(i=l,r=s)}}),r},e.prototype.getProperties=function(){return Hc(this.properties)},e.prototype.getData=function(){var t=this.properties;Ug(t)&&(t=Hc(t));var n={id:this.id,type:this.type,properties:t,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:Xo({},this.startPoint),endPoint:Xo({},this.endPoint)};[vl.INCREASE,vl.STATIC].includes(this.graphModel.overlapMode)&&(n.zIndex=this.zIndex);var o=this.text,r=o.x,i=o.y,a=o.value;return a&&(n.text={x:r,y:i,value:a}),n},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.setProperty=function(t,n){SM(this.properties,t,Jl(n)),this.setAttributes()},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setProperties=function(t){this.properties=Da(Da({},Hc(this.properties)),Jl(t)),this.setAttributes()},e.prototype.changeEdgeId=function(t){var n=this.arrowConfig,o=n.markerEnd,r=n.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),o&&o==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},e.prototype.setStyle=function(t,n){var o;this.style=Da(Da({},this.style),(o={},o[t]=Jl(n),o))},e.prototype.setStyles=function(t){this.style=Da(Da({},this.style),Jl(t))},e.prototype.updateStyles=function(t){this.style=Da({},Jl(t))},e.prototype.setTextMode=function(t){this.textMode=t},e.prototype.formatText=function(t){var n,o,r,i=this.graphModel.editConfigModel,a=i.edgeTextDraggable,s=i.edgeTextEdit,l=this.textPosition,f=l.x,h=l.y,v=t.text,b={value:"",x:f,y:h,draggable:a,editable:s};v&&(typeof v=="string"?b=Da(Da({},b),{value:v}):(b=Da(Da({},b),{x:(n=v.x)!==null&&n!==void 0?n:f,y:(o=v.y)!==null&&o!==void 0?o:h,value:(r=v.value)!==null&&r!==void 0?r:""}),Xv(v.draggable)||(b.draggable=v.draggable),Xv(v.editable)||(b.editable=v.editable))),this.text=b},e.prototype.resetTextPosition=function(){var t=this.textPosition,n=t.x,o=t.y;this.text.x=n,this.text.y=o},e.prototype.moveText=function(t,n){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+t,y:i+n}},e.prototype.setText=function(t){t&&Xo(this.text,t)},e.prototype.updateText=function(t){this.text=Da(Da({},Hc(this.text)),{value:t})},e.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!t)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!t)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},e.prototype.setSelected=function(t){t===void 0&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){t===void 0&&(t=!0),this.isHovered=t},e.prototype.setHitable=function(t){t===void 0&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){t===void 0&&(t=!0),this.isHittable=t},e.prototype.openEdgeAnimation=function(){this.isAnimation=!0},e.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},e.prototype.setElementState=function(t,n){this.state=t,this.additionStateData=n},e.prototype.updateStartPoint=function(t){this.startPoint=t},e.prototype.moveStartPoint=function(t,n){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=n)},e.prototype.updateEndPoint=function(t){this.endPoint=t},e.prototype.moveEndPoint=function(t,n){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=n)},e.prototype.setZIndex=function(t){t===void 0&&(t=0),this.zIndex=t},e.prototype.initPoints=function(){},e.prototype.updateAttributes=function(t){Xo(this,t)},e.prototype.getAdjustStart=function(){return this.startPoint},e.prototype.getAdjustEnd=function(){return this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var n=t.startPoint,o=t.endPoint;this.updateStartPoint({x:n.x,y:n.y}),this.updateEndPoint({x:o.x,y:o.y})},e.prototype.updateZIndexByOverlap=function(t,n){switch(t){case vl.DEFAULT:this.zIndex=0;break;case vl.EDGE_TOP:this.zIndex=1;break;case vl.INCREASE:this.zIndex=n;break}},e.BaseType=da.EDGE,Pr([Ut],e.prototype,"type",void 0),Pr([Ut],e.prototype,"sourceNodeId",void 0),Pr([Ut],e.prototype,"targetNodeId",void 0),Pr([Ut],e.prototype,"startPoint",void 0),Pr([Ut],e.prototype,"endPoint",void 0),Pr([Ut],e.prototype,"textMode",void 0),Pr([Ut],e.prototype,"text",void 0),Pr([Ut],e.prototype,"properties",void 0),Pr([Ut],e.prototype,"points",void 0),Pr([Ut],e.prototype,"pointsList",void 0),Pr([Ut],e.prototype,"isSelected",void 0),Pr([Ut],e.prototype,"isHovered",void 0),Pr([Ut],e.prototype,"isHitable",void 0),Pr([Ut],e.prototype,"isHittable",void 0),Pr([Ut],e.prototype,"draggable",void 0),Pr([Ut],e.prototype,"visible",void 0),Pr([Ut],e.prototype,"isAnimation",void 0),Pr([Ut],e.prototype,"isShowAdjustPoint",void 0),Pr([Ut],e.prototype,"zIndex",void 0),Pr([Ut],e.prototype,"state",void 0),Pr([Ut],e.prototype,"style",void 0),Pr([Ut],e.prototype,"arrowConfig",void 0),Pr([Ai],e.prototype,"sourceNode",null),Pr([Ai],e.prototype,"targetNode",null),Pr([Ai],e.prototype,"textPosition",null),Pr([Bt],e.prototype,"setProperty",null),Pr([Bt],e.prototype,"deleteProperty",null),Pr([Bt],e.prototype,"setProperties",null),Pr([Bt],e.prototype,"changeEdgeId",null),Pr([Bt],e.prototype,"setStyle",null),Pr([Bt],e.prototype,"setStyles",null),Pr([Bt],e.prototype,"updateStyles",null),Pr([Bt],e.prototype,"setTextMode",null),Pr([Bt],e.prototype,"formatText",null),Pr([Bt],e.prototype,"resetTextPosition",null),Pr([Bt],e.prototype,"moveText",null),Pr([Bt],e.prototype,"setText",null),Pr([Bt],e.prototype,"updateText",null),Pr([Bt],e.prototype,"setAnchors",null),Pr([Bt],e.prototype,"setSelected",null),Pr([Bt],e.prototype,"setHovered",null),Pr([Bt],e.prototype,"setHitable",null),Pr([Bt],e.prototype,"setHittable",null),Pr([Bt],e.prototype,"openEdgeAnimation",null),Pr([Bt],e.prototype,"closeEdgeAnimation",null),Pr([Bt],e.prototype,"setElementState",null),Pr([Bt],e.prototype,"updateStartPoint",null),Pr([Bt],e.prototype,"moveStartPoint",null),Pr([Bt],e.prototype,"updateEndPoint",null),Pr([Bt],e.prototype,"moveEndPoint",null),Pr([Bt],e.prototype,"setZIndex",null),Pr([Bt],e.prototype,"initPoints",null),Pr([Bt],e.prototype,"updateAttributes",null),Pr([Bt],e.prototype,"getAdjustStart",null),Pr([Bt],e.prototype,"getAdjustEnd",null),Pr([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),Pr([Bt],e.prototype,"updateZIndexByOverlap",null),e})(),dQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Fv=function(){return Fv=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Fv.apply(this,arguments)},Uu=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},rS=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},CP=(function(e){dQ(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.modelType=_o.BEZIER_EDGE,r.path="",r.initEdgeData(n),r.setAttributes(),r}return t.prototype.initEdgeData=function(n){this.offset=om(n,"properties.offset",100),e.prototype.initEdgeData.call(this,n)},t.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,o=e.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Fv(Fv(Fv({},o),to(n)),to(i))},t.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}},t.prototype.getData=function(){var n=e.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})},t.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},t.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)},t.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},t.prototype.updatePoints=function(){var n=this.getControls(),o=n.sNext,r=n.ePre;this.updatePath(o,r)},t.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)},t.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},t.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},t.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)},t.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)},t.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))},t.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},t.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},t.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],t.prototype,"offset",void 0),Uu([Ut],t.prototype,"path",void 0),Uu([Bt],t.prototype,"initPoints",null),Uu([Bt],t.prototype,"updatePoints",null),Uu([Bt],t.prototype,"updateStartPoint",null),Uu([Bt],t.prototype,"updateEndPoint",null),Uu([Bt],t.prototype,"moveStartPoint",null),Uu([Bt],t.prototype,"moveEndPoint",null),Uu([Bt],t.prototype,"updateAdjustAnchor",null),Uu([Bt],t.prototype,"getAdjustStart",null),Uu([Bt],t.prototype,"getAdjustEnd",null),Uu([Bt],t.prototype,"updateAfterAdjustStartAndEnd",null),t})(K1),fQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),n_=function(){return n_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},n_.apply(this,arguments)},NP=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pQ=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},kP=(function(e){fQ(t,e);function t(){var n=e.apply(this,pQ([],NP(arguments),!1))||this;return n.modelType=_o.LINE_EDGE,n}return t.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.line,o=e.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return n_(n_(n_({},o),to(n)),to(i))},t.prototype.initEdgeData=function(n){e.prototype.initEdgeData.call(this,n),this.points=this.getPath([this.startPoint,this.endPoint])},t.prototype.getPath=function(n){var o=NP(n,2),r=o[0],i=o[1];return"".concat(r.x,",").concat(r.y," ").concat(i.x,",").concat(i.y)},t.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},t})(K1),hQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),r_=function(){return r_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r_.apply(this,arguments)},kl=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},PP=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},vQ=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},F_=(function(e){hQ(t,e);function t(){var n=e.apply(this,vQ([],PP(arguments),!1))||this;return n.modelType=_o.POLYLINE_EDGE,n.draggingPointList=[],n}return t.prototype.initEdgeData=function(n){var o=om(n,"properties.offset");if(this.offset=typeof o=="number"?o:this.getDefaultOffset(),n.pointsList){var r=this.orthogonalizePath(n.pointsList);n.pointsList=r,this.pointsList=r}e.prototype.initEdgeData.call(this,n)},t.prototype.setAttributes=function(){var n=this.properties.offset;n&&n!==this.offset&&(this.offset=n,this.updatePoints())},t.prototype.orthogonalizePath=function(n){if(!Array.isArray(n)||n.length<2)return n;var o=function(D,P){var B=D[D.length-1];(!B||B.x!==P.x||B.y!==P.y)&&D.push({x:P.x,y:P.y})},r=function(D,P){return D.x===P.x||D.y===P.y},i=function(D,P){return Math.abs(D.x-P.x)+Math.abs(D.y-P.y)},a=[];o(a,n[0]);for(var s,l=0;l<n.length-1;l++){var f=a[a.length-1],h=n[l+1];if(!(!f||!h)){if(r(f,h)){o(a,h),s=f.x===h.x?ni.VERTICAL:ni.HORIZONTAL;continue}var v={x:h.x,y:f.y},b={x:f.x,y:h.y},E=s===ni.VERTICAL?b:s===ni.HORIZONTAL||i(f,v)<=i(f,b)?v:b;(E.x!==f.x||E.y!==f.y)&&o(a,E),o(a,h);var O=a[a.length-2],w=a[a.length-1];s=O&&w?O.x===w.x?ni.VERTICAL:ni.HORIZONTAL:s}}for(var S=[],l=0;l<a.length;l++){var M=a[l-1],T=a[l],h=a[l+1];M&&T&&h&&(M.x===T.x&&T.x===h.x||M.y===T.y&&T.y===h.y)||o(S,T)}S.length>=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}]},t.prototype.getDefaultOffset=function(){var n=this.getArrowStyle(),o=typeof n.offset=="number"?n.offset:0;return o+5},t.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,o=e.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return r_(r_(r_({},o),to(n)),to(i))},t.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(QZ(s),2),f=l[0],h=l[1];return{x:(f.x+h.x)/2,y:(f.y+h.y)/2}},t.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},t.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},t.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);$<D&&(i[o+1]=T)}})}}return i},t.prototype.getDraggingPoints=function(n,o,r,i,a){var s=a.map(function(h){return h}),l=this.getAfterAnchor(n,r,i),f=this.getCrossPoint(n,r,l);return o==="start"?(s.unshift(f),s.unshift(l)):(s.push(f),s.push(l)),s},t.prototype.updateCrossPoints=function(n){var o=n.map(function(T){return T}),r=n[0],i=n[1],a=n[o.length-2],s=n[o.length-1],l=this,f=l.sourceNode,h=l.targetNode,v=f.modelType,b=h.modelType,E=Rw(r,i),O=o[0];switch(v){case _o.RECT_NODE:if(f.radius!==0){var w=xP(r,f);w||(O=EP(r,E,f))}break;case _o.CIRCLE_NODE:O=IA(r,E,f);break;case _o.ELLIPSE_NODE:O=OP(r,E,f);break;case _o.DIAMOND_NODE:O=E0(r,E,f);break;case _o.POLYGON_NODE:O=E0(r,E,f);break}O&&(o[0]=O);var S=Rw(a,s),M=o[o.length-1];switch(b){case _o.RECT_NODE:if(h.radius!==0){var w=xP(s,h);w||(M=EP(s,S,h))}break;case _o.CIRCLE_NODE:M=IA(s,S,h);break;case _o.ELLIPSE_NODE:M=OP(s,S,h);break;case _o.DIAMOND_NODE:M=E0(s,S,h);break;case _o.POLYGON_NODE:M=E0(s,S,h);break}return M&&(o[o.length-1]=M),o},t.prototype.updatePath=function(n){this.pointsList=this.orthogonalizePath(n),this.points=this.getPath(this.pointsList)},t.prototype.getData=function(){var n=e.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Object.assign({},n,{pointsList:o})},t.prototype.getPath=function(n){return n.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},t.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},t.prototype.updatePoints=function(){var 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(" ")},t.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},t.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o,this.updatePoints()},t.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},t.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o,this.updatePoints()},t.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()},t.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},t.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}},t.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}},t.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},t.prototype.updatePointsAfterDrag=function(n){var o=this.updateCrossPoints(n);this.points=o.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},t.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},t.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},t.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],t.prototype,"offset",void 0),kl([Ut],t.prototype,"dbClickPosition",void 0),kl([Bt],t.prototype,"initPoints",null),kl([Bt],t.prototype,"updatePoints",null),kl([Bt],t.prototype,"updateStartPoint",null),kl([Bt],t.prototype,"moveStartPoint",null),kl([Bt],t.prototype,"updateEndPoint",null),kl([Bt],t.prototype,"moveEndPoint",null),kl([Bt],t.prototype,"updatePointsList",null),kl([Bt],t.prototype,"dragAppendStart",null),kl([Bt],t.prototype,"dragAppendSimple",null),kl([Bt],t.prototype,"dragAppend",null),kl([Bt],t.prototype,"dragAppendEnd",null),kl([Bt],t.prototype,"updatePointsAfterDrag",null),kl([Bt],t.prototype,"getAdjustStart",null),kl([Bt],t.prototype,"getAdjustEnd",null),kl([Bt],t.prototype,"updateAfterAdjustStartAndEnd",null),t})(K1),il=function(){return il=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},il.apply(this,arguments)},Hr=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},RP=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mQ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lh=(function(){function e(t,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=Go.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=t.properties)!==null&&o!==void 0?o:{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;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(t).translate(r,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),e.prototype.initNodeData=function(t){var n=this;if(t.properties||(t.properties={}),!t.id){var o=this.graphModel.idGenerator,r=o&&o(t.type),i=this.createId();t.id=i||r||wh()}this.formatText(t),Xo(this,pJ(t));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,t.zIndex||I_()),l.on("overlap:change",function(f){var h=f.overlapMode;n.updateZIndexByOverlap(h,n.zIndex||I_())})},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.setTextMode=function(t){this.textMode=t},e.prototype.formatText=function(t){var n,o,r,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,s=i.nodeTextEdit,l=t.x,f=t.y,h=t.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))),t.text=v},e.prototype.resize=function(t){var n=t.width,o=t.height,r=t.deltaX,i=t.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()},e.prototype.proportionalResize=function(){},e.prototype.getData=function(){var t=this.text,n=t.x,o=t.y,r=t.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},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.getProperties=function(){return Hc(this.properties)},e.prototype.getOuterGAttributes=function(){return{className:""}},e.prototype.getNodeStyle=function(){return il(il({},this.graphModel.theme.baseNode),this.style)},e.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,n=this.properties.textStyle,o=n===void 0?{}:n;return il(il({},to(t)),to(o))},e.prototype.getRotateControlStyle=function(){var t=this.graphModel.theme.rotateControl;return to(t)},e.prototype.getResizeControlStyle=function(){var t=this.graphModel.theme.resizeControl;return to(t)},e.prototype.getResizeOutlineStyle=function(){var t=this.graphModel.theme.resizeOutline;return to(t)},e.prototype.getAnchorStyle=function(t){var n=this.graphModel.theme.anchor;return to(n)},e.prototype.getAnchorLineStyle=function(t){var n=this.graphModel.theme.anchorLine;return to(n)},e.prototype.getOutlineStyle=function(){var t=this.graphModel.theme.outline;return to(t)},e.prototype.isAllowConnectedAsSource=function(t,n,o,r){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var f=i[l];if(!f.validate.call(this,this,t,n,o,r)){a=!1,s=f.message;break}}return{isAllPass:a,msg:s}},e.prototype.getConnectedSourceRules=function(){return this.sourceRules},e.prototype.isAllowConnectedAsTarget=function(t,n,o,r){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var f=i[l];if(!f.validate.call(this,t,this,n,o,r)){a=!1,s=f.message;break}}return{isAllPass:a,msg:s}},e.prototype.isAllowMoveNode=function(t,n){var o,r,i=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=RP(s),f=l.next();!f.done;f=l.next()){var h=f.value,v=h(this,t,n);if(!v)return!1;if(typeof v=="object"){var b=v;if(!b.x&&!b.y)return!1;i=i&&b.x,a=a&&b.y}}}catch(E){o={error:E}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return{x:i,y:a}},e.prototype.getConnectedTargetRules=function(){return this.targetRules},e.prototype.getAnchorsByOffset=function(){var t=this,n=t.anchorsOffset,o=t.id,r=t.x,i=t.y;return n&&n.length>0?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()},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.getTargetAnchor=function(t){return cJ(t,this)},e.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(e.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),n=this,o=n.x,r=n.y,i=n.rotate;return t.forEach(function(a){var s=a.x,l=a.y,f=mQ(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}),t},enumerable:!1,configurable:!0}),e.prototype.getAnchorInfo=function(t){if(!ws(t))for(var n=0;n<this.anchors.length;n++){var o=this.anchors[n];if(o.id===t)return o}},e.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},e.prototype.isAllowMoveByXORY=function(t,n,o){var r,i;if(o)r=!0,i=!0;else{var a=this.isAllowMoveNode(t,n);typeof a=="boolean"?(r=a,i=a):(r=a.x,i=a.y)}return{isAllowMoveX:r,isAllowMoveY:i}},e.prototype.move=function(t,n,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(t,n,o),i=r.isAllowMoveX,a=r.isAllowMoveY;return i&&(this.x=this.x+t,this.text&&this.moveText(t,0)),a&&(this.y=this.y+n,this.text&&this.moveText(0,n)),(i||a)&&(this.rotate=this._rotate),i||a},e.prototype.getMoveDistance=function(t,n,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(t,n,o),i=r.isAllowMoveX,a=r.isAllowMoveY,s=0,l=0;return i&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),s=t),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),l=n),this.transform=new Dw(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},e.prototype.moveTo=function(t,n,o){o===void 0&&(o=!1);var r=t-this.x,i=n-this.y;return!o&&!this.isAllowMoveNode(r,i)?!1:(this.text&&this.moveText(r,i),this.x=t,this.y=n,!0)},e.prototype.moveText=function(t,n){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+t,y:i+n}},e.prototype.updateText=function(t){this.text=il(il({},Hc(this.text)),{value:t})},e.prototype.addNodeResizeRules=function(t){this.resizeRules.includes(t)||this.resizeRules.push(t)},e.prototype.isAllowResizeNode=function(t,n,o,r){var i,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=RP(s),f=l.next();!f.done;f=l.next()){var h=f.value,v=h(this,t,n,o,r);if(!v)return!1}}catch(b){i={error:b}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!0},e.prototype.setSelected=function(t){t===void 0&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){t===void 0&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},e.prototype.setIsShowAnchor=function(t){t===void 0&&(t=!0),this.isShowAnchor=t},e.prototype.setRotatable=function(t){t===void 0&&(t=!0),this.rotatable=t},e.prototype.setResizable=function(t){t===void 0&&(t=!0),this.resizable=t},e.prototype.setHitable=function(t){t===void 0&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){t===void 0&&(t=!0),this.isHittable=t},e.prototype.setElementState=function(t,n){this.state=t,this.additionStateData=n},e.prototype.updateProperties=function(t,n){var o=Hc(this.properties);this.properties=t,this.setAttributes(),this.graphModel.eventCenter.emit(pr.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:o,properties:t})},e.prototype.setProperty=function(t,n){var o=Hc(this.properties),r=to(o);Nj(r,t,Jl(n)),this.updateProperties(r,[t])},e.prototype.setProperties=function(t){var n=Hc(this.properties),o=il(il({},n),Jl(t)),r=[];XL(t,function(i,a){(hw(n,a)&&n[a]!==i||!hw(n,a))&&r.push(a)}),this.updateProperties(o,r)},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setStyle=function(t,n){var o;this.style=il(il({},this.style),(o={},o[t]=Jl(n),o))},e.prototype.setStyles=function(t){this.style=il(il({},this.style),Jl(t))},e.prototype.updateStyles=function(t){this.style=il({},Jl(t))},e.prototype.setZIndex=function(t){t===void 0&&(t=1),this.zIndex=t},e.prototype.updateAttributes=function(t){Xo(this,t)},e.prototype.updateZIndexByOverlap=function(t,n){switch(t){case vl.DEFAULT:this.zIndex=1;break;case vl.EDGE_TOP:this.zIndex=0;break;case vl.INCREASE:this.zIndex=n;break}},e.BaseType=da.NODE,Hr([Ut],e.prototype,"type",void 0),Hr([Ut],e.prototype,"x",void 0),Hr([Ut],e.prototype,"y",void 0),Hr([Ut],e.prototype,"textMode",void 0),Hr([Ut],e.prototype,"text",void 0),Hr([Ut],e.prototype,"properties",void 0),Hr([Ut],e.prototype,"_width",void 0),Hr([Ut],e.prototype,"_height",void 0),Hr([Ut],e.prototype,"anchorsOffset",void 0),Hr([Ut],e.prototype,"isSelected",void 0),Hr([Ut],e.prototype,"isHovered",void 0),Hr([Ut],e.prototype,"isShowAnchor",void 0),Hr([Ut],e.prototype,"isDragging",void 0),Hr([Ut],e.prototype,"isHitable",void 0),Hr([Ut],e.prototype,"isHittable",void 0),Hr([Ut],e.prototype,"draggable",void 0),Hr([Ut],e.prototype,"visible",void 0),Hr([Ut],e.prototype,"rotatable",void 0),Hr([Ut],e.prototype,"resizable",void 0),Hr([Ut],e.prototype,"zIndex",void 0),Hr([Ut],e.prototype,"state",void 0),Hr([Ut],e.prototype,"autoToFront",void 0),Hr([Ut],e.prototype,"style",void 0),Hr([Ut],e.prototype,"transform",void 0),Hr([Ut],e.prototype,"_rotate",void 0),Hr([Ai],e.prototype,"incoming",null),Hr([Ai],e.prototype,"outgoing",null),Hr([Bt],e.prototype,"setTextMode",null),Hr([Bt],e.prototype,"addNodeMoveRules",null),Hr([Bt],e.prototype,"move",null),Hr([Bt],e.prototype,"getMoveDistance",null),Hr([Bt],e.prototype,"moveTo",null),Hr([Bt],e.prototype,"moveText",null),Hr([Bt],e.prototype,"updateText",null),Hr([Bt],e.prototype,"addNodeResizeRules",null),Hr([Bt],e.prototype,"setSelected",null),Hr([Bt],e.prototype,"setHovered",null),Hr([Bt],e.prototype,"setIsShowAnchor",null),Hr([Bt],e.prototype,"setRotatable",null),Hr([Bt],e.prototype,"setResizable",null),Hr([Bt],e.prototype,"setHitable",null),Hr([Bt],e.prototype,"setHittable",null),Hr([Bt],e.prototype,"setElementState",null),Hr([Bt],e.prototype,"setProperty",null),Hr([Bt],e.prototype,"setProperties",null),Hr([Bt],e.prototype,"deleteProperty",null),Hr([Bt],e.prototype,"setStyle",null),Hr([Bt],e.prototype,"setStyles",null),Hr([Bt],e.prototype,"updateStyles",null),Hr([Bt],e.prototype,"setZIndex",null),Hr([Bt],e.prototype,"updateAttributes",null),Hr([Bt],e.prototype,"updateZIndexByOverlap",null),e})(),gQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),o_=function(){return o_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o_.apply(this,arguments)},oS=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},$w=(function(e){gQ(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.modelType=_o.CIRCLE_NODE,r.r=50,r.initNodeData(n),r.setAttributes(),r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),t.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},t.prototype.getNodeStyle=function(){var n=e.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))},t.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")}]},t.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],t.prototype,"r",void 0),oS([Ai],t.prototype,"width",null),oS([Ai],t.prototype,"height",null),t})(Lh),yQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i_=function(){return i_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},i_.apply(this,arguments)},og=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},O0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},HA=(function(e){yQ(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.modelType=_o.DIAMOND_NODE,r.rx=30,r.ry=50,r.initNodeData(n),r.setAttributes(),r}return t.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},t.prototype.getNodeStyle=function(){var n=e.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(t.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(t.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(t.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];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(t.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];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),t.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)}})},t.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],t.prototype,"rx",void 0),og([Ut],t.prototype,"ry",void 0),og([Ai],t.prototype,"points",null),og([Ai],t.prototype,"pointsPosition",null),og([Ai],t.prototype,"width",null),og([Ai],t.prototype,"height",null),t})(Lh),_Q=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),a_=function(){return a_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},a_.apply(this,arguments)},S0=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},XA=(function(e){_Q(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.modelType=_o.ELLIPSE_NODE,r.rx=30,r.ry=45,r.initNodeData(n),r.setAttributes(),r}return t.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},t.prototype.getNodeStyle=function(){var n=e.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(t.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),t.prototype.getDefaultAnchor=function(){var 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")}]},t.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],t.prototype,"rx",void 0),S0([Ut],t.prototype,"ry",void 0),S0([Ai],t.prototype,"width",null),S0([Ai],t.prototype,"height",null),t})(Lh),bQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l_=function(){return l_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},l_.apply(this,arguments)},A0=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},M0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Uw=(function(e){bQ(t,e);function t(n,o){var r=e.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 t.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var n=this.properties,o=n.points,r=n.width,i=n.height,a=o||this.points;this.points=iJ(a,r,i)},t.prototype.getNodeStyle=function(){var n=e.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(t.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(t.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];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(t.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];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),t.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)}})},t.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],t.prototype,"points",void 0),A0([Ai],t.prototype,"pointsPosition",null),A0([Ai],t.prototype,"width",null),A0([Ai],t.prototype,"height",null),t})(Lh),wQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s_=function(){return s_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s_.apply(this,arguments)},EQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},Hg=(function(e){wQ(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.modelType=_o.RECT_NODE,r.radius=0,r.initNodeData(n),r.setAttributes(),r}return t.prototype.setAttributes=function(){e.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)},t.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")}]},t.prototype.getNodeStyle=function(){var n=e.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))},EQ([Ut],t.prototype,"radius",void 0),t})(Lh),xQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u_=function(){return u_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u_.apply(this,arguments)},DP=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},OQ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},SQ=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},jP=(function(e){xQ(t,e);function t(){var n=e.apply(this,SQ([],OQ(arguments),!1))||this;return n.modelType=_o.TEXT_NODE,n}return t.prototype.getTextStyle=function(){var n=e.prototype.getTextStyle.call(this),o=this.graphModel.theme.text,r=this.properties.textStyle;return u_(u_(u_({},n),to(o)),to(r))},Object.defineProperty(t.prototype,"width",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=AP({rows:n,fontSize:o,rowsLength:n.length}).width;return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=AP({rows:n,fontSize:o,rowsLength:n.length}).height;return r},enumerable:!1,configurable:!0}),DP([Ai],t.prototype,"width",null),DP([Ai],t.prototype,"height",null),t})(Lh),AQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),YA=(function(e){AQ(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.modelType=_o.HTML_NODE,r.setAttributes(),r}return t.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height;o&&(this.width=o),r&&(this.height=r)},t.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")}]},t})(Lh),Jo=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},MQ={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"],TQ=(function(){function e(t){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(t))}return e.prototype.updateEditConfig=function(t){var n=this.computeConfig(t);Xo(this,n)},e.prototype.computeConfig=function(t){var n=t.isSilentMode,o=t.textDraggable,r=t.textMode,i=t.textEdit,a=t.adjustEdgeStartAndEnd,s={};if(n===!1&&Xo(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=Vv(MQ,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(t,T0);return Xo(s,f)},e.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},e.prototype.getConfig=function(){return Vv(this,T0)},Jo([Ut],e.prototype,"isSilentMode",void 0),Jo([Ut],e.prototype,"stopZoomGraph",void 0),Jo([Ut],e.prototype,"stopMoveGraph",void 0),Jo([Ut],e.prototype,"stopScrollGraph",void 0),Jo([Ut],e.prototype,"snapGrid",void 0),Jo([Ut],e.prototype,"textMode",void 0),Jo([Ut],e.prototype,"textEdit",void 0),Jo([Ut],e.prototype,"textDraggable",void 0),Jo([Ut],e.prototype,"nodeTextEdit",void 0),Jo([Ut],e.prototype,"nodeTextDraggable",void 0),Jo([Ut],e.prototype,"nodeTextMultiple",void 0),Jo([Ut],e.prototype,"nodeTextVertical",void 0),Jo([Ut],e.prototype,"nodeTextMode",void 0),Jo([Ut],e.prototype,"edgeTextMode",void 0),Jo([Ut],e.prototype,"edgeTextEdit",void 0),Jo([Ut],e.prototype,"edgeTextDraggable",void 0),Jo([Ut],e.prototype,"edgeTextMultiple",void 0),Jo([Ut],e.prototype,"edgeTextVertical",void 0),Jo([Ut],e.prototype,"hideAnchors",void 0),Jo([Ut],e.prototype,"allowRotate",void 0),Jo([Ut],e.prototype,"allowResize",void 0),Jo([Ut],e.prototype,"hoverOutline",void 0),Jo([Ut],e.prototype,"nodeSelectedOutline",void 0),Jo([Ut],e.prototype,"adjustNodePosition",void 0),Jo([Ut],e.prototype,"autoExpand",void 0),Jo([Ut],e.prototype,"adjustEdge",void 0),Jo([Ut],e.prototype,"adjustEdgeMiddle",void 0),Jo([Ut],e.prototype,"adjustEdgeStartAndEnd",void 0),Jo([Ut],e.prototype,"adjustEdgeStart",void 0),Jo([Ut],e.prototype,"adjustEdgeEnd",void 0),Jo([Ut],e.prototype,"edgeSelectedOutline",void 0),Jo([Bt],e.prototype,"updateEditConfig",null),Jo([Bt],e.prototype,"updateTextMode",null),e})(),CQ="*",NQ=(function(){function e(){this._events={}}return e.prototype.on=function(t,n,o){var r=this;t==null||t.split(",").forEach(function(i){i=i.trim(),r._events[i]||(r._events[i]=[]),r._events[i].push({callback:n,once:!!o})})},e.prototype.once=function(t,n){var o=this;t==null||t.split(",").forEach(function(r){r=r.trim(),o.on(r,n,!0)})},e.prototype.emit=function(t,n){var o=this;t==null||t.split(",").forEach(function(r){var i=o._events[r]||[],a=o._events[CQ]||[],s=function(l){for(var f=l.length,h=0;h<f;h++)if(l[h]){var v=l[h],b=v.callback,E=v.once;E&&(l.splice(h,1),l.length===0&&delete o._events[r],f--,h--),b.apply(o,[n])}};s(i),s(a)})},e.prototype.off=function(t,n){var o=this;t||(this._events={}),t.split(",").forEach(function(r){if(!n)delete o._events[r];else{for(var i=o._events[r]||[],a=i.length,s=0;s<a;s++)i[s].callback===n&&(i.splice(s,1),a--,s--);i.length===0&&delete o._events[r]}})},e.prototype.getEvents=function(){return this._events},e.prototype.destroy=function(){this._events={}},e})(),kQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),qA=function(){return qA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},qA.apply(this,arguments)},PQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},RQ=(function(e){kQ(t,e);function t(n){var o=e.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 t.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})}))},t=PQ([xs],t),t})(ko),MI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),B_=function(){return B_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},B_.apply(this,arguments)},DQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},jQ=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LP=(function(e){MI(t,e);function t(){var n=e.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 t.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)}}))},t})(ko),LQ=(function(e){MI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getBezierAdjust=function(n,o){var r=n.path,i=n.id,a=CM(r),s=jQ(a,4),l=s[0],f=s[1],h=s[2],v=s[3],b=n.getEdgeStyle().adjustLine,E=[];return E.push($t(Wg,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(Wg,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},t.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,o=n.edges,r=[],i=0;i<o.length;i++){var a=o[i];a.isSelected&&a.modelType===_o.BEZIER_EDGE&&a.draggable&&r.push(this.getBezierAdjust(a,n))}return r},t.prototype.render=function(){return $t("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},t=DQ([xs],t),t})(ko),IQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),FQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},BQ=(function(e){IQ(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.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"})})},t=FQ([xs],t),t})(ko),$Q=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),UQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},Sg=(function(e){$Q(t,e);function t(n){var o=e.call(this,n)||this;return o.id=wh(),o.gridOptions=o.props.graphModel.grid,o}return t.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})]})},t.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"})},t.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,")")})]})})},t=UQ([xs],t),t})(ko);(function(e){e.defaultProps={size:LZ,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function t(n){var o=to(e.defaultProps);return typeof n=="number"?Xo(o,{size:n}):typeof n=="boolean"?Xo(o,{visible:n}):Xo(o,n)}e.getGridOptions=t})(Sg||(Sg={}));var VQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),GQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},WQ=(function(e){VQ(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.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})})},t=GQ([xs],t),t})(ko),zQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),dh=function(){return dh=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},dh.apply(this,arguments)},HQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},XQ=(function(e){zQ(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.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},t.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<o.length;l++){var f=o[l];(i&&f.isSelected||a&&f.isHovered)&&(f.modelType===_o.LINE_EDGE?s.push(this.getLineOutline(f)):f.modelType===_o.POLYLINE_EDGE?s.push(this.getPolylineOutline(f)):f.modelType===_o.BEZIER_EDGE&&s.push(this.getBezierOutline(f)))}return s},t.prototype.getLineOutline=function(n){var o=n.startPoint,r=n.endPoint,i=(o.x+r.x)/2,a=(o.y+r.y)/2,s=Math.abs(o.x-r.x)+10,l=Math.abs(o.y-r.y)+10,f=n.getOutlineStyle();return $t(qu,dh({className:"lf-outline-edge",x:i,y:a,width:s,height:l},f))},t.prototype.getPolylineOutline=function(n){var o=n.points,r=Kv(o),i=N_(r,8),a=i.x,s=i.y,l=i.width,f=i.height,h=n.getOutlineStyle();return $t(qu,dh({className:"lf-outline",x:a,y:s,width:l,height:f},h))},t.prototype.getBezierOutline=function(n){var o=n.path,r=CM(o),i=N_(r,8),a=i.x,s=i.y,l=i.width,f=i.height,h=n.getOutlineStyle();return $t(qu,dh({className:"lf-outline",x:a,y:s,width:l,height:f},h))},t.prototype.render=function(){return $t("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},t=HQ([xs],t),t})(ko),YQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),fh=function(){return fh=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},fh.apply(this,arguments)},qQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},KQ=(function(e){YQ(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.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(Wg,fh({},E)),$t(Wg,fh({},O))]})},t=qQ([xs],t),t})(ko),ZQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),JQ=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},QQ=(function(e){ZQ(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){this.triggerToolRender()},t.prototype.componentDidUpdate=function(){this.triggerToolRender()},t.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},t.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=[]},t.prototype.render=function(){var n=this.props.graphModel;return $t("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},t=JQ([xs],t),t})(ko),$c=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},ig=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},eee={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]},tee=(function(){function e(t,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=t;var o=n.stopMoveGraph,r=o===void 0?!1:o;this.updateTranslateLimits(r)}return e.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},e.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},e.prototype.HtmlPointToCanvasPoint=function(t){var n=ig(t,2),o=n[0],r=n[1];return[(o-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},e.prototype.CanvasPointToHtmlPoint=function(t){var n=ig(t,2),o=n[0],r=n[1];return[o*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},e.prototype.moveCanvasPointByHtml=function(t,n,o){var r=ig(t,2),i=r[0],a=r[1];return[i+n/this.SCALE_X,a+o/this.SCALE_Y]},e.prototype.fixDeltaXY=function(t,n){return[t/this.SCALE_X,n/this.SCALE_Y]},e.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},e.prototype.zoom=function(t,n){t===void 0&&(t=!1);var o=this.SCALE_X,r=this.SCALE_Y;return typeof t=="number"?(o=t,r=t):t?(o+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(o-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),o<this.MINI_SCALE_SIZE||o>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(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,"%"))},e.prototype.emitGraphTransform=function(t){this.eventCenter.emit(pr.GRAPH_TRANSFORM,{type:t,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},e.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},e.prototype.translate=function(t,n){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},e.prototype.focusOn=function(t,n,o,r){var i=ig(this.CanvasPointToHtmlPoint([t,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")},e.prototype.updateTranslateLimits=function(t){var n;n=ig(Array.isArray(t)&&t.length===4?t:eee[t.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},$c([Ut],e.prototype,"SCALE_X",void 0),$c([Ut],e.prototype,"SKEW_Y",void 0),$c([Ut],e.prototype,"SKEW_X",void 0),$c([Ut],e.prototype,"SCALE_Y",void 0),$c([Ut],e.prototype,"TRANSLATE_X",void 0),$c([Ut],e.prototype,"TRANSLATE_Y",void 0),$c([Ut],e.prototype,"ZOOM_SIZE",void 0),$c([Bt],e.prototype,"zoom",null),$c([Bt],e.prototype,"resetZoom",null),$c([Bt],e.prototype,"translate",null),$c([Bt],e.prototype,"focusOn",null),e})(),nee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),iS=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ree=(function(e){nee(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.parentTransform=o.parentTransform,r}return t.prototype.setParentTransform=function(n){this.parentTransform=n},t.prototype.getCumulativeScale=function(){var n=this.SCALE_X,o=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof t){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}},t.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,o=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof t){var r=this.parentTransform.getCumulativeScale(),i=r.scaleX,a=r.scaleY;n=i*n,o=a*o}return{translateX:n,translateY:o}},t.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]},t.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]},t.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]},t.prototype.fixDeltaXY=function(n,o){var r=this.getCumulativeScale(),i=r.scaleX,a=r.scaleY;return[n/i,o/a]},t})(tee),Kl=function(){return Kl=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Kl.apply(this,arguments)},dr=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},oee=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ol=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},hu=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},iee=(function(){function e(t){var n=this,o,r;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=vl.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var i=t.container,a=t.partial,s=t.background,l=s===void 0?{}:s,f=t.grid,h=t.idGenerator,v=t.edgeGenerator,b=t.animation,E=t.customTrajectory;this.rootEl=i,this.partial=!!a,this.background=l,typeof f=="object"&&t.snapGrid&&(this.gridSize=f.size||1),this.customStyles=t.style||{},this.grid=Sg.getGridOptions(f??!1),this.theme=AI(t.style,t.themeMode),this.theme.grid=to(this.grid),this.theme.background=to(this.background),this.edgeType=t.edgeType||"polyline",this.animation=RZ(b),this.overlapMode=t.overlapMode||vl.DEFAULT,this.isMiniMap=t.isMiniMap||!1,this.width=(o=t.width)!==null&&o!==void 0?o:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ws(t.width),this.height=(r=t.height)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ws(t.height);var O=new ResizeObserver(D2((function(w){var S,M;try{for(var T=oee(w),$=T.next();!$.done;$=T.next()){var D=$.value;if(D.target===n.rootEl){var P=document.body.contains(n.rootEl);if(!P)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:D.contentRect})}}}catch(B){S={error:B}}finally{try{$&&!$.done&&(M=T.return)&&M.call(T)}finally{if(S)throw S.error}}}),16));O.observe(this.rootEl),this.waitCleanEffects.push(function(){O.disconnect()}),this.eventCenter=new NQ,this.editConfigModel=new TQ(t),this.transformModel=new ree(this.eventCenter,t),this.flowId=wh(),this.idGenerator=h,this.edgeGenerator=rJ(this,v),this.customTrajectory=E}return Object.defineProperty(e.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(t,n,o){return t[n.id]={index:o,model:n},t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(t,n,o){return t[n.id]={index:o,model:n},t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modelsMap",{get:function(){return hu(hu([],ol(this.nodes),!1),ol(this.edges),!1).reduce(function(t,n){return t[n.id]=n,t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortElements",{get:function(){for(var t=function(l){return hu([],ol(l),!1).sort(function(f,h){return f.zIndex-h.zIndex})},n=t(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1)),o=[],r=[-y0,-y0],i=[this.width+y0,this.height+y0],a=0;a<n.length;a++){var s=n[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,r,i,!1,!1))&&o.push(s)}return o},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textEditElement",{get:function(){var t=this.nodes.find(function(o){return o.state===Go.TEXT_EDIT}),n=this.edges.find(function(o){return o.state===Go.TEXT_EDIT});return t||n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach(function(n){n.isSelected&&t.set(n.id,n)}),this.edges.forEach(function(n){n.isSelected&&t.set(n.id,n)}),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach(function(n){n.isSelected&&t.push(n)}),t},enumerable:!1,configurable:!0}),e.prototype.getAreaElement=function(t,n,o,r,i){var a=this;o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1);var s=[];return ri(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1),function(l){var f=a.isElementInArea(l,t,n,o,r);(!i||l.visible)&&f&&s.push(l)}),s},e.prototype.getModel=function(t){return this.modelMap.get(t)},e.prototype.getNodeModelById=function(t){var n;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:(n=this.nodesMap[t])===null||n===void 0?void 0:n.model},e.prototype.getPointByClient=function(t){var n=t.x,o=t.y,r=this.rootEl.getBoundingClientRect(),i={x:n-r.left,y:o-r.top},a=ol(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2),s=a[0],l=a[1],f={x:s,y:l};return{domOverlayPosition:i,canvasOverlayPosition:f}},e.prototype.isElementInArea=function(t,n,o,r,i){var a;if(r===void 0&&(r=!0),i===void 0&&(i=!0),t.BaseType===da.NODE){t=t;for(var s=gu(t),l=s.minX,f=s.minY,h=s.maxX,v=s.maxY,b=[{x:l,y:f},{x:h,y:f},{x:h,y:v},{x:l,y:v}],E=i,O=0;O<b.length;O++){var w=b[O],S=w.x,M=w.y;if(a=ol(this.transformModel.CanvasPointToHtmlPoint([S,M]),2),S=a[0],M=a[1],tS([S,M],n,o)!==i){E=!i;break}}return E}if(t.BaseType===da.EDGE){t=t;var T=t.startPoint,$=t.endPoint,D=this.transformModel.CanvasPointToHtmlPoint([T.x,T.y]),P=this.transformModel.CanvasPointToHtmlPoint([$.x,$.y]),B=tS(D,n,o),F=tS(P,n,o);return r?B&&F:B||F}return!1},e.prototype.graphDataToModel=function(t){var n=this;if(!t){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),t.nodes?this.nodes=tc(t.nodes,function(r){var i=n.getModelAfterSnapToGrid(r);return n.elementsModelMap.set(i.id,i),n.nodeModelMap.set(i.id,i),i}):this.nodes=[],t.edges){var o=this.edgeType;this.edges=tc(t.edges,function(r){var i,a=n.getModel((i=r.type)!==null&&i!==void 0?i:o);if(!a)throw new Error("找不到".concat(r.type,"对应的边。"));var s=new a(r,n);return n.edgeModelMap.set(s.id,s),n.elementsModelMap.set(s.id,s),s})}else this.edges=[]},e.prototype.modelToGraphData=function(){var t=[];this.edges.forEach(function(o){var r=o.getData();r&&!o.virtual&&t.push(r)});var n=[];return this.nodes.forEach(function(o){var r=o.getData();r&&!o.virtual&&n.push(r)}),{nodes:n,edges:t}},e.prototype.modelToHistoryData=function(){for(var t=!1,n=[],o=0;o<this.nodes.length;o++){var r=this.nodes[o];if(r.isDragging){t=!0;break}else n.push(r.getHistoryData())}if(t)return!1;for(var i=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){i=!0;break}l.virtual||a.push(l.getHistoryData())}return i?!1:{nodes:n,edges:a}},e.prototype.getEdgeModelById=function(t){var n;return(n=this.edgesMap[t])===null||n===void 0?void 0:n.model},e.prototype.getElement=function(t){return this.modelsMap[t]},e.prototype.getNodeEdges=function(t){for(var n=[],o=0;o<this.edges.length;o++){var r=this.edges[o],i=r.sourceNodeId===t,a=r.targetNodeId===t;(i||a)&&n.push(r)}return n},e.prototype.getSelectElements=function(t){t===void 0&&(t=!0);var n=this.selectElements,o={nodes:[],edges:[]};return n.forEach(function(r){if(r.BaseType===da.NODE&&o.nodes.push(r.getData()),r.BaseType===da.EDGE){var i=r.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(t||a)&&o.edges.push(i)}}),o},e.prototype.updateAttributes=function(t,n){var o=this.getElement(t);o==null||o.updateAttributes(n)},e.prototype.changeNodeId=function(t,n){return n||(n=wh()),this.nodesMap[n]?(console.warn("当前流程图已存在节点".concat(n,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach(function(o){o.sourceNodeId===t&&(o.sourceNodeId=n),o.targetNodeId===t&&(o.targetNodeId=n)}),this.nodesMap[t].model.id=n,this.nodesMap[n]=this.nodesMap[t],n):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},e.prototype.changeEdgeId=function(t,n){return n||(n=wh()),this.edgesMap[n]?(console.warn("当前流程图已存在边: ".concat(n,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach(function(o){o.id===t&&o.changeEdgeId(n)}),n):(console.warn("当前流程图找不到边: ".concat(n,", 修改失败")),"")},e.prototype.getTextModel=function(t){var n=this.editConfigModel,o=n.textMode,r=n.nodeTextMode,i=n.edgeTextMode;if(t.BaseType===da.NODE)return t.textMode||r||o||Ju.TEXT;if(t.BaseType===da.EDGE)return t.textMode||i||o||Ju.TEXT},e.prototype.setOverlapMode=function(t){this.overlapMode=t,this.eventCenter.emit("overlap:change",{overlapMode:t})},e.prototype.setTextMode=function(t,n){this.editConfigModel.updateEditConfig({textMode:t})},e.prototype.setFakeNode=function(t){this.fakeNode=t},e.prototype.removeFakeNode=function(){this.fakeNode=null},e.prototype.setModel=function(t,n){return this.modelMap.set(t,n)},e.prototype.toFront=function(t){var n,o,r,i=((n=this.nodesMap[t])===null||n===void 0?void 0:n.model)||((o=this.edgesMap[t])===null||o===void 0?void 0:o.model);if(i){if(this.overlapMode===vl.STATIC)return;if(this.overlapMode===vl.INCREASE){this.setElementZIndex(t,"top");return}(r=this.topElement)===null||r===void 0||r.setZIndex(),i.setZIndex(jZ),this.topElement=i}},e.prototype.setElementZIndex=function(t,n){var o,r,i=((o=this.nodesMap[t])===null||o===void 0?void 0:o.model)||((r=this.edgesMap[t])===null||r===void 0?void 0:r.model);if(i){var a=void 0;typeof n=="number"?a=n:(n==="top"&&(a=I_()),n==="bottom"&&(a=cQ())),i.setZIndex(a)}},e.prototype.deleteNode=function(t){var n=this.nodesMap[t].model,o=n.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(pr.NODE_DELETE,{data:o,model:n})},e.prototype.addNode=function(t,n,o){n===void 0&&(n=pr.NODE_ADD);var r=Jl(t),i=r.id;i&&this.nodesMap[i]&&delete r.id;var a=this.getModelAfterSnapToGrid(r);this.nodes.push(a);var s=a.getData(),l={data:s};return o&&(l.e=o),this.eventCenter.emit(n,l),a},e.prototype.getModelAfterSnapToGrid=function(t){var n=this.getModel(t.type),o=this.editConfigModel.snapGrid;if(!n)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var r=t.x,i=t.y;r&&i&&(t.x=Gg(r,this.gridSize,o),t.y=Gg(i,this.gridSize,o),typeof t.text=="object"&&t.text!==null&&(t.text.x+=t.x-r,t.text.y+=t.y-i));var a=new n(t,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},e.prototype.cloneNode=function(t){var n=this.getNodeModelById(t),o=n==null?void 0:n.getData();if(o){o.x+=30,o.y+=30,o.id="",typeof o.text=="object"&&o.text!==null&&(o.text.x+=30,o.text.y+=30);var r=this.addNode(o);return r.setSelected(!0),n==null||n.setSelected(!1),r.getData()}},e.prototype.moveNode=function(t,n,o,r){var i;r===void 0&&(r=!1);var a=this.nodesMap[t];if(!a){console.warn("不存在id为".concat(t,"的节点"));return}var s=a.model;i=ol(s.getMoveDistance(n,o,r),2),n=i[0],o=i[1],this.moveEdge(t,n,o)},e.prototype.moveNode2Coordinate=function(t,n,o,r){r===void 0&&(r=!1);var i=this.nodesMap[t];if(!i){console.warn("不存在id为".concat(t,"的节点"));return}var a=i.model,s=a.x,l=a.y,f=n-s,h=o-l;this.moveNode(t,f,h,r)},e.prototype.editText=function(t){this.setElementStateById(t,Go.TEXT_EDIT)},e.prototype.addEdge=function(t){var n=Jl(t),o=n.type;o||(o=this.edgeType),n.id&&this.edgesMap[n.id]&&(delete n.id,delete n.sourceAnchorId,delete n.targetAnchorId);var r=this.getModel(o);if(!r)throw new Error("找不到".concat(o,"对应的边,请确认是否已注册此类型边。"));var i=new r(Kl(Kl({},n),{type:o}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var a=i.getData();return this.edges.push(i),this.eventCenter.emit(pr.EDGE_ADD,{data:a}),i},e.prototype.moveEdge=function(t,n,o){for(var r=0;r<this.edges.length;r++){var i=this.edges[r],a=i.textPosition,s=a.x,l=a.y,f=this.edges[r].sourceNodeId===t,h=this.edges[r].targetNodeId===t;f&&i.moveStartPoint(n,o),h&&i.moveEndPoint(n,o),(f||h)&&this.handleEdgeTextMove(i,s,l)}},e.prototype.handleEdgeTextMove=function(t,n,o){var r;if(t.customTextPosition){t.resetTextPosition();return}if(t.modelType===_o.POLYLINE_EDGE&&(!((r=t.text)===null||r===void 0)&&r.value)){var i=t.text,a=gI(i,t.points);t.moveText(a.x-i.x,a.y-i.y)}var s=t.textPosition,l=s.x,f=s.y;t.moveText(l-n,f-o)},e.prototype.deleteEdgeBySourceAndTarget=function(t,n){for(var o=0;o<this.edges.length;o++)if(this.edges[o].sourceNodeId===t&&this.edges[o].targetNodeId===n){var r=this.edges[o].getData();this.edges.splice(o,1),o--,this.eventCenter.emit(pr.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeById=function(t){var n=this.edgesMap[t];if(n){var o=this.edgesMap[t].index,r=this.edgesMap[t].model.getData();this.edges.splice(o,1),this.eventCenter.emit(pr.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeBySource=function(t){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===t){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(pr.EDGE_DELETE,{data:o})}},e.prototype.deleteEdgeByTarget=function(t){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===t){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(pr.EDGE_DELETE,{data:o})}},e.prototype.setElementStateById=function(t,n,o){this.nodes.forEach(function(r){r.id===t?r.setElementState(n,o):r.setElementState(Go.DEFAULT)}),this.edges.forEach(function(r){r.id===t?r.setElementState(n,o):r.setElementState(Go.DEFAULT)})},e.prototype.updateText=function(t,n){var o=Sh(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1),function(r){return r.id===t});o==null||o.updateText(n)},e.prototype.selectNodeById=function(t,n){var o;n===void 0&&(n=!1),n||this.clearSelectElements();var r=(o=this.nodesMap[t])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},e.prototype.selectEdgeById=function(t,n){var o;n===void 0&&(n=!1),n||this.clearSelectElements();var r=(o=this.edgesMap[t])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},e.prototype.selectElementById=function(t,n){n===void 0&&(n=!1),n||this.clearSelectElements();var o=this.getElement(t);o==null||o.setSelected(!0)},e.prototype.deselectElementById=function(t){var n=this.getElement(t);n&&n.setSelected(!1)},e.prototype.clearSelectElements=function(){var t;this.selectElements.forEach(function(n){n==null||n.setSelected(!1)}),this.selectElements.clear(),[vl.DEFAULT,vl.EDGE_TOP].includes(this.overlapMode)&&((t=this.topElement)===null||t===void 0||t.setZIndex())},e.prototype.moveNodes=function(t,n,o,r){var i,a,s,l=this;r===void 0&&(r=!1);for(var f=t.reduce(function($,D){var P,B=(P=l.nodesMap[D])===null||P===void 0?void 0:P.model;return B&&($[D]=B.getMoveDistance(n,o,r)),$},{}),h=0;h<this.edges.length;h++){var v=this.edges[h],b=v.textPosition,E=b.x,O=b.y,w=f[v.sourceNodeId],S=f[v.targetNodeId],M=void 0,T=void 0;w&&S&&v.modelType===_o.POLYLINE_EDGE?(i=ol(w,2),M=i[0],T=i[1],v.updatePointsList(M,T)):(w&&(a=ol(w,2),M=a[0],T=a[1],v.moveStartPoint(M,T)),S&&(s=ol(S,2),M=s[0],T=s[1],v.moveEndPoint(M,T))),(w||S)&&this.handleEdgeTextMove(v,E,O)}},e.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},e.prototype.addNodeResizeRules=function(t){this.nodeResizeRules.includes(t)||this.nodeResizeRules.push(t)},e.prototype.setDefaultEdgeType=function(t){this.edgeType=t},e.prototype.changeNodeType=function(t,n){var o=this.getNodeModelById(t);if(!o){console.warn("找不到id为".concat(t,"的节点"));return}var r=o.getData();r.type=n;var i=this.getModel(n);if(!i)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));var a=new i(r,this);this.nodes.splice(this.nodesMap[t].index,1,a);var s=this.getNodeEdges(t);s.forEach(function(l){if(l.sourceNodeId===t){var f=SP(a,l.startPoint,a.width,a.height);l.updateStartPoint(f)}if(l.targetNodeId===t){var f=SP(a,l.endPoint,a.width,a.height);l.updateEndPoint(f)}})},e.prototype.changeEdgeType=function(t,n){var o=this.getEdgeModelById(t);if(!o){console.warn("找不到id为".concat(t,"的边"));return}if(o.type!==n){var r=o.getData();r.type=n;var i=this.getModel(n);if(!i)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var a=new i(r,this);this.edges.splice(this.edgesMap[t].index,1,a)}},e.prototype.getNodeIncomingEdge=function(t){var n=[];return this.edges.forEach(function(o){o.targetNodeId===t&&n.push(o)}),n},e.prototype.getNodeOutgoingEdge=function(t){var n=[];return this.edges.forEach(function(o){o.sourceNodeId===t&&n.push(o)}),n},e.prototype.getAnchorIncomingEdge=function(t){var n=[];return this.edges.forEach(function(o){o.targetAnchorId===t&&n.push(o)}),n},e.prototype.getAnchorOutgoingEdge=function(t){var n=[];return this.edges.forEach(function(o){o.sourceAnchorId===t&&n.push(o)}),n},e.prototype.getNodeIncomingNode=function(t){var n=this,o=[];return this.edges.forEach(function(r){var i;r.targetNodeId===t&&o.push((i=n.nodesMap[r.sourceNodeId])===null||i===void 0?void 0:i.model)}),o},e.prototype.getNodeOutgoingNode=function(t){var n=this,o=[];return this.edges.forEach(function(r){r.sourceNodeId===t&&o.push(n.nodesMap[r.targetNodeId].model)}),o},e.prototype.setTheme=function(t,n){var o;if(n&&(j_[n]&&this.updateBackgroundOptions(Kl(Kl({},typeof this.background=="object"?this.background:{}),j_[n])),L_[n]&&this.updateGridOptions(Sg.getGridOptions(Kl(Kl({},this.grid),L_[n])))),t.background&&this.updateBackgroundOptions(t.background),t.grid){var r=Sg.getGridOptions((o=t.grid)!==null&&o!==void 0?o:!1);this.updateGridOptions(r)}this.theme=lQ(Kl(Kl({},this.customStyles),t),n),this.customStyles=Kl(Kl({},this.customStyles),t)},e.prototype.getTheme=function(){var t=this,n=t.background,o=t.grid,r=Kl(Kl({},to(this.theme)),{background:n,grid:o});return r},e.prototype.updateGridOptions=function(t){Yv(this.grid,t)},e.prototype.updateGridSize=function(t){this.gridSize=t},e.prototype.updateBackgroundOptions=function(t){mw(t)||mw(this.background)?this.background=t:this.background=Kl(Kl({},this.background),t)},e.prototype.resize=function(t,n){if(this.rootEl){var o=document.body.contains(this.rootEl);if(o){var r=this.rootEl.offsetParent!==null;if(r)try{this.width=t??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ws(t),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ws(n),r&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(i){console.warn("获取画布宽高时发生错误:",i)}}}},e.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},e.prototype.getVirtualRectSize=function(){var t=this.nodes,n=[],o=[];t.forEach(function(b){var E=b.x,O=b.y,w=b.width,S=b.height,M=b.getNodeStyle().strokeWidth,T=M===void 0?0:M,$=E+w/2+T,D=E-w/2-T,P=O+S/2+T,B=O-S/2-T;n=n.concat([$,D].filter(function(F){return!Number.isNaN(F)})),o=o.concat([P,B].filter(function(F){return!Number.isNaN(F)}))});var r=Math.min.apply(Math,hu([],ol(n),!1)),i=Math.max.apply(Math,hu([],ol(n),!1)),a=Math.min.apply(Math,hu([],ol(o),!1)),s=Math.max.apply(Math,hu([],ol(o),!1)),l=i-r||0,f=s-a||0,h=r+l/2,v=a+f/2;return{width:l,height:f,x:h,y:v}},e.prototype.translateCenter=function(){var t=this,n=t.nodes,o=t.width,r=t.height,i=t.rootEl,a=t.transformModel;if(n.length){var s=o||i.clientWidth,l=r||i.clientHeight,f=this.getVirtualRectSize(),h=f.x,v=f.y;a.focusOn(h,v,s,l)}},e.prototype.fitView=function(t,n){t===void 0&&(t=20),n===void 0&&(n=20);var o=this,r=o.nodes,i=o.width,a=o.height,s=o.rootEl,l=o.transformModel;if(r.length){var f=i||s.clientWidth,h=a||s.clientHeight,v=this.getVirtualRectSize(),b=v.width,E=v.height,O=v.x,w=v.y,S=(b+n)/f,M=(E+t)/h,T=1/Math.max(S,M),$=[f/2,h/2];l.zoom(T,$),l.focusOn(O,w,f,h)}},e.prototype.openEdgeAnimation=function(t){var n=this.getEdgeModelById(t);n==null||n.openEdgeAnimation()},e.prototype.closeEdgeAnimation=function(t){var n=this.getEdgeModelById(t);n==null||n.closeEdgeAnimation()},e.prototype.getPartial=function(){return this.partial},e.prototype.setPartial=function(t){this.partial=t},e.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(t){t()})}catch(t){console.warn("error on destroy GraphModel",t)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},dr([Ut],e.prototype,"width",void 0),dr([Ut],e.prototype,"height",void 0),dr([Ut],e.prototype,"theme",void 0),dr([Ut],e.prototype,"grid",void 0),dr([Ut],e.prototype,"edgeType",void 0),dr([Ut],e.prototype,"nodes",void 0),dr([Ut],e.prototype,"edges",void 0),dr([Ut],e.prototype,"fakeNode",void 0),dr([Ut],e.prototype,"overlapMode",void 0),dr([Ut],e.prototype,"background",void 0),dr([Ut],e.prototype,"gridSize",void 0),dr([Ut],e.prototype,"transformModel",void 0),dr([Ut],e.prototype,"editConfigModel",void 0),dr([Ut],e.prototype,"partial",void 0),dr([Ai],e.prototype,"nodesMap",null),dr([Ai],e.prototype,"edgesMap",null),dr([Ai],e.prototype,"modelsMap",null),dr([Ai],e.prototype,"sortElements",null),dr([Ai],e.prototype,"textEditElement",null),dr([Ai],e.prototype,"selectElements",null),dr([Ai],e.prototype,"selectNodes",null),dr([Bt],e.prototype,"setOverlapMode",null),dr([Bt],e.prototype,"setTextMode",null),dr([Bt],e.prototype,"setFakeNode",null),dr([Bt],e.prototype,"removeFakeNode",null),dr([Bt],e.prototype,"setModel",null),dr([Bt],e.prototype,"toFront",null),dr([Bt],e.prototype,"setElementZIndex",null),dr([Bt],e.prototype,"deleteNode",null),dr([Bt],e.prototype,"addNode",null),dr([Bt],e.prototype,"cloneNode",null),dr([Bt],e.prototype,"moveNode",null),dr([Bt],e.prototype,"moveNode2Coordinate",null),dr([Bt],e.prototype,"editText",null),dr([Bt],e.prototype,"addEdge",null),dr([Bt],e.prototype,"moveEdge",null),dr([Bt],e.prototype,"deleteEdgeBySourceAndTarget",null),dr([Bt],e.prototype,"deleteEdgeById",null),dr([Bt],e.prototype,"deleteEdgeBySource",null),dr([Bt],e.prototype,"deleteEdgeByTarget",null),dr([Bt],e.prototype,"setElementStateById",null),dr([Bt],e.prototype,"updateText",null),dr([Bt],e.prototype,"selectNodeById",null),dr([Bt],e.prototype,"selectEdgeById",null),dr([Bt],e.prototype,"selectElementById",null),dr([Bt],e.prototype,"deselectElementById",null),dr([Bt],e.prototype,"clearSelectElements",null),dr([Bt],e.prototype,"moveNodes",null),dr([Bt],e.prototype,"setDefaultEdgeType",null),dr([Bt],e.prototype,"changeNodeType",null),dr([Bt],e.prototype,"changeEdgeType",null),dr([Bt],e.prototype,"getNodeIncomingEdge",null),dr([Bt],e.prototype,"getNodeOutgoingEdge",null),dr([Bt],e.prototype,"getAnchorIncomingEdge",null),dr([Bt],e.prototype,"getAnchorOutgoingEdge",null),dr([Bt],e.prototype,"getNodeIncomingNode",null),dr([Bt],e.prototype,"getNodeOutgoingNode",null),dr([Bt],e.prototype,"setTheme",null),dr([Bt],e.prototype,"getTheme",null),dr([Bt],e.prototype,"resize",null),dr([Bt],e.prototype,"clearData",null),dr([Bt],e.prototype,"translateCenter",null),dr([Bt],e.prototype,"fitView",null),dr([Bt],e.prototype,"openEdgeAnimation",null),dr([Bt],e.prototype,"closeEdgeAnimation",null),dr([Bt],e.prototype,"setPartial",null),e})(),Bv=function(){return Bv=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Bv.apply(this,arguments)},Iy=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},aee=(function(){function e(t,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t,this.epsilon=n}return e.prototype.getStyle=function(){return Bv({},this.graphModel.theme.snapline)},e.prototype.getCenterSnapLine=function(t,n){for(var o=t.x,r=t.y,i=!1,a=!1,s=0;s<n.length;s++){var l=n[s];if(l.id!==t.id&&(Uc(o,l.x,this.epsilon)&&(i=!0),Uc(r,l.y,this.epsilon)&&(a=!0),i&&a))break}return{isShowVertical:i,isShowHorizontal:a,position:{x:o,y:r}}},e.prototype.getHorizontalSnapline=function(t,n){var o=!1,r=0,i=t.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=gu(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=gu(l))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==t.id){var v=gu(h);if(Uc(v.minY,a==null?void 0:a.minY,this.epsilon)||Uc(v.maxY,a==null?void 0:a.minY,this.epsilon)){o=!0,r=a.minY;break}if(Uc(v.minY,a==null?void 0:a.maxY,this.epsilon)||Uc(v.maxY,a==null?void 0:a.maxY,this.epsilon)){o=!0,r=a.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:Bv(Bv({},this.position),{y:r})}},e.prototype.getVerticalSnapline=function(t,n){var o=!1,r=0,i=t.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=gu(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=gu(l))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==t.id){var v=gu(h);if(Uc(v.minX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Uc(v.minX,a==null?void 0:a.minX,this.epsilon)||Uc(v.maxX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Uc(v.minX,a==null?void 0:a.maxX,this.epsilon)||Uc(v.maxX,a==null?void 0:a.maxX,this.epsilon)){o=!0,r=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:Bv(Bv({},this.position),{x:r})}},e.prototype.getSnapLinePosition=function(t,n){var o=this.getCenterSnapLine(t,n),r=o.isShowHorizontal,i=o.isShowVertical;if(!r){var a=this.getHorizontalSnapline(t,n);a.isShowHorizontal&&(o.isShowHorizontal=a.isShowHorizontal,o.position.y=a.position.y)}if(!i){var s=this.getVerticalSnapline(t,n);s.isShowVertical&&(o.isShowVertical=s.isShowVertical,o.position.x=s.position.x)}return o},e.prototype.setSnaplineInfo=function(t){var n=t.isShowHorizontal,o=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=n,this.isShowVertical=o},e.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},e.prototype.setNodeSnapLine=function(t){var n=this.graphModel.nodes,o=this.getSnapLinePosition(t,n);this.setSnaplineInfo(o)},Iy([Ut],e.prototype,"isShowHorizontal",void 0),Iy([Ut],e.prototype,"isShowVertical",void 0),Iy([Ut],e.prototype,"position",void 0),Iy([Bt],e.prototype,"clearSnapline",null),Iy([Bt],e.prototype,"setNodeSnapLine",null),e})();function Uc(e,t,n){return Math.abs(e-t)<=n}var lee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),see=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},uee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},cee=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},dee=(function(e){lee(t,e);function t(){var n=e.apply(this,cee([],uee(arguments),!1))||this;return n.handleResize=function(){var o=n.props,r=o.graphModel,i=o.options,a=r.width,s=r.height,l=r.isContainerWidth,f=r.isContainerHeight,h=a,v=s,b=!1;l&&(h=void 0,b=!0),f&&(v=void 0,b=!0),b&&r.resize(h,v),i.width=a,i.height=s},n.throttleResize=Cj(n.handleResize,200),n}return t.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},t.prototype.componentDidUpdate=function(){var n=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(pr.GRAPH_UPDATED,{data:n})},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},t.prototype.getComponent=function(n,o,r){r===void 0&&(r="canvas-overlay");var i=this.props.getView,a=i(n.type);return a?$t(a,{model:n,graphModel:o,overlay:r},n.id):null},t.prototype.render=function(){var n=this,o=this.props,r=o.graphModel,i=o.tool,a=o.options,s=o.dnd,l=o.snaplineModel,f={};a.width&&(f.width="".concat(r.width,"px")),a.height&&(f.height="".concat(r.height,"px"));var h=r.fakeNode,v=r.editConfigModel,b=r.background,E=v.adjustEdge;return $t("div",{className:"lf-graph","flow-id":r.flowId,style:f,children:[$t(RQ,{graphModel:r,dnd:s,children:[$t("g",{className:"lf-base",children:tc(r.sortElements,function(O){return n.getComponent(O,r)})}),h?this.getComponent(h,r):""]}),$t(WQ,{graphModel:r,children:[$t(XQ,{graphModel:r}),E?$t(LQ,{graphModel:r}):"",a.snapline!==!1?$t(KQ,{snaplineModel:l}):""]}),$t(QQ,{graphModel:r,tool:i}),b&&$t(BQ,{background:b}),$t(Sg,{graphModel:r})]})},t=see([xs],t),t})(ko),fee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Bd=function(){return Bd=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Bd.apply(this,arguments)},pee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},hee=(function(e){fee(t,e);function t(){var n=e.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 q=pee(V,2),X=q[0],G=q[1];f.translate(X,G);var Q=n.state,J=Q.endX,ie=Q.endY;n.setState({endX:J-X,endY:ie-G}),n.moveAnchorEnd(J-X,ie-G)})),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!==Go.DEFAULT&&n.preTargetNode.setElementState(Go.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(Go.DEFAULT);var z=a.getNodeModelById(S.node.id),q=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,s.getData(),z==null?void 0:z.getData()),X=a.addEdge(Bd(Bd({},q),{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}})),G=n.props.anchorData;return a.eventCenter.emit(pr.ANCHOR_DROP,{data:G,e:o,nodeModel:s,edgeModel:X}),X}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 t.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(t.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(t.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}),t.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(Go.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(Go.ALLOW_CONNECT):v.setElementState(Go.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Go.DEFAULT&&this.preTargetNode.setElementState(Go.DEFAULT)},t.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},t.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(Wg,Bd({x1:r,y1:i,x2:a,y2:s},h,{"pointer-events":"none"})))]})},t})(ko),vee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KA=function(){return KA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},KA.apply(this,arguments)},mee=(function(e){vee(t,e);function t(n){var o=e.call(this,n)||this;return o.style={},o.onDragging=function(r){var i,a=r.event,s=o.props,l=s.graphModel,f=s.nodeModel,h=s.eventCenter,v=l.selectNodes,b=f.x,E=f.y,O=a.clientX,w=a.clientY,S=l.getPointByClient({x:O,y:w}).canvasOverlayPosition,M=S.x,T=S.y,$=new Il(M-b,T-E),D=((i=o.normal)===null||i===void 0?void 0:i.angle($))-o.defaultAngle,P=new Dw(-b,-E).rotate(D).translate(b,E).toString();f.transform=P,f.rotate=D;var B=tc(v,function(I){return I.id});B.indexOf(f.id)===-1&&(B=[f.id]);var F=Vj(B,function(I,V){var z=l.getNodeModelById(V);return I[V]=z==null?void 0:z.getMoveDistance(0,0,!1),I},{});B.forEach(function(I){var V=l.getNodeEdges(I);V.forEach(function(z){if(F[z.sourceNodeId]){var q=l.getNodeModelById(z.sourceNodeId),X=q.anchors.find(function(G){return G.id===z.sourceAnchorId});z.updateStartPoint(X)}if(F[z.targetNodeId]){var q=l.getNodeModelById(z.targetNodeId),X=q.anchors.find(function(J){return J.id===z.targetAnchorId});z.updateEndPoint(X)}})}),h.emit(pr.NODE_ROTATE,{e:a,model:f,data:f.getData()})},o.style=n.style,o.stepperDrag=new ac({onDragging:o.onDragging}),o}return t.prototype.render=function(){var n=this,o=this.props.nodeModel,r=o.x,i=o.y,a=o.width,s=o.height,l=r+a/2+20,f=i-s/2-20;return this.normal=new Il(1,0),this.defaultAngle=this.normal.angle(new Il(l-r,f-i)),o.defaultAngle=this.defaultAngle,$t("g",{className:"lf-rotate-control",children:$t("g",{onMouseDown:function(h){n.stepperDrag.handleMouseDown(h)},children:$t(zg,KA({},this.style,{cx:l,cy:f}))})})},t})(ko),aS={exports:{}};/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/var IP;function gee(){return IP||(IP=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(aS)),aS.exports}var yee=gee();const ZA=Z_(yee);var _ee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),JA=function(){return JA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},JA.apply(this,arguments)},bee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TI=(function(e){_ee(t,e);function t(n){var o=e.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=bee(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(Go.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 t.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}))},t.prototype.render=function(){var n=this.props.model.text;if(n)return $t("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},t})(ko),wee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Gc=function(){return Gc=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Gc.apply(this,arguments)},C0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Eee=(function(e){wee(t,e);function t(n){var o=e.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 t.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=Gc(Gc({},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=Gc(Gc({},a),{x:O,y:w,width:l,height:M})}else{var T=oJ({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 q=C0(P,3),X=q[0],z=q[1],G=q[2];P=[X,z,G,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=Gc(Gc({},a),{x:O-1,y:w-1,width:$,height:D})}return $t(qu,Gc({},S))}return null},t.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=Gc({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,Gc({},l))]})},t})(TI),xee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Vw=function(){return Vw=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Vw.apply(this,arguments)},Oee=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},N0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ih=(function(e){xee(t,e);function t(n){var o=e.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,q=z.clientX,X=z.clientY,G=o.mouseDownPosition,Q=G.x,J=G.y;(q-Q>V||X-J>V)&&(w.isDragging=!0);var ie=S.getPointByClient({x:q,y:X}).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=Gg(Se,V,D),Ae=Gg(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){DZ()&&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,Go.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,Go.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 t.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},t.prototype.componentDidMount=function(){},t.prototype.componentDidUpdate=function(){},t.prototype.getAnchorShape=function(n){return null},t.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(hee,{anchorData:h,node:n,style:E,edgeStyle:b,anchorIndex:v,nodeModel:r,graphModel:i,setHoverOff:n.setHoverOff})}):[]},t.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(mee,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:E})},t.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(DJ,{style:E,model:o,graphModel:r}):null},t.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==Ju.TEXT||r.state===Go.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},t.prototype.getStateClassName=function(){var n=this.props.model,o=n.state,r=n.isDragging,i=n.isSelected,a="lf-node";switch(o){case Go.ALLOW_CONNECT:a+=" lf-node-allow";break;case Go.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return r&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},t.prototype.toFront=function(){var n=this.props,o=n.model,r=n.graphModel;o.autoToFront&&r.toFront(o.id)},t.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=Oee(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},t.isObserved=!1,t})(ko),See=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),QA=function(){return QA=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},QA.apply(this,arguments)},Zv=(function(e){See(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t(qu,QA({},o,{x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius}))},t})(Ih),Aee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),e2=function(){return e2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},e2.apply(this,arguments)},Gw=(function(e){Aee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.r,a=n.getNodeStyle();return $t(zg,e2({},a,{x:o,y:r,r:i}))},t})(Ih),Mee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Ww=function(){return Ww=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ww.apply(this,arguments)},zw=(function(e){Mee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,o=n,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,f=n.getNodeStyle(),h={transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")};return $t("g",Ww({},h,{children:$t(kM,Ww({},f,{points:l,x:r,y:i}))}))},t})(Ih),Tee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),t2=function(){return t2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},t2.apply(this,arguments)},n2=(function(e){Tee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t("g",{children:$t(kM,t2({},o,{points:n.points,x:n.x,y:n.y}))})},t})(Ih),Cee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),r2=function(){return r2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},r2.apply(this,arguments)},o2=(function(e){Cee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t(AJ,r2({},o,{x:n.x,y:n.y,rx:n.rx,ry:n.ry}))},t})(Ih),Nee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c_=function(){return c_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},c_.apply(this,arguments)},FP=(function(e){Nee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getBackground=function(){var n=this.props.model,o=n.getTextStyle(),r=n.width,i=n.height,a=n.x,s=n.y,l=c_(c_({},o.background),{x:a,y:s,width:r,height:i});return $t(qu,c_({},l))},t.prototype.getResizeControl=function(){return null},t.prototype.getShape=function(){return $t("g",{children:this.getBackground()})},t})(Ih),kee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i2=function(){return i2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},i2.apply(this,arguments)},Pee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ree=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},a2=(function(e){kee(t,e);function t(){var n=e.apply(this,Ree([],Pee(arguments),!1))||this;return n.ref=G1(),n}return Object.defineProperty(t.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),t.prototype.setHtml=function(n){n.appendChild(document.createElement("div"))},t.prototype.confirmUpdate=function(n){this.setHtml(n)},t.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},t.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},t.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},t.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.height,a=n.width,s=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),$t("foreignObject",i2({},s,{x:o-a/2,y:r-i/2,width:a,height:i,ref:this.ref}))},t})(Ih),Dee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Wc=function(){return Wc=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Wc.apply(this,arguments)},jee=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},Lee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ud;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ud||(Ud={}));var BP=(function(e){Dee(t,e);function t(n){var o=e.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,$=Lee(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,q=B.targetNode,X=S===Ud.SOURCE?{startPoint:{x:F.anchor.x,y:F.anchor.y},endPoint:{x:V.x,y:V.y},sourceNode:F.node,targetNode:q}:{startPoint:{x:I.x,y:I.y},endPoint:{x:F.anchor.x,y:F.anchor.y},sourceNode:z,targetNode:F.node};B.updateAfterAdjustStartAndEnd(X)}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,q=I.newTargetNode;if(V){var X=w.getData(),G=X.text,Q=X.sourceAnchorId,J=Q===void 0?"":Q,ie=X.targetAnchorId,Se=ie===void 0?"":ie,Ae=jee(X,["text","sourceAnchorId","targetAnchorId"]);if(F=Wc(Wc({sourceAnchorId:J,targetAnchorId:Se},Ae),{text:(G==null?void 0:G.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=Wc(Wc({},ze),{sourceNodeId:P.node.id,sourceAnchorId:P.anchor.id,startPoint:{x:P.anchor.x,y:P.anchor.y},targetNodeId:w.targetNodeId,endPoint:Wc({},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=Wc(Wc({},ze),{sourceNodeId:w.sourceNodeId,startPoint:Wc({},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=q.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(Wc({},F));O.eventCenter.emit(pr.EDGE_EXCHANGE_NODE,{data:{newEdge:Je.getData(),oldEdge:Be}})}(v=o.preTargetNode)===null||v===void 0||v.setElementState(Go.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 t.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(Go.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?Go.ALLOW_CONNECT:Go.NOT_ALLOW_CONNECT;return h===Ud.SOURCE?v.setElementState(I):b.setElementState(I),{pass:$&&B,msg:F||D,newTargetNode:b}},t.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)})},t})(ko),Iee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l2=function(){return l2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},l2.apply(this,arguments)};(function(e){Iee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getArrowAttributes=function(){var n=this.props,o=n.arrowInfo,r=n.style,i=o.start,a=o.end,s={start:i,end:a,offset:r.offset,verticalLength:r.verticalLength,type:"end"},l=C_(s),f=l.leftX,h=l.leftY,v=l.rightX,b=l.rightY;return l2({d:"M".concat(f," ").concat(h," L").concat(a.x," ").concat(a.y," L").concat(v," ").concat(b," z")},r)},t.prototype.getShape=function(){var n=this.getArrowAttributes(),o=n.d,r=n.strokeWidth,i=n.stroke,a=n.fill;return $t(P_,{d:o,fill:a,strokeWidth:r,stroke:i})},t.prototype.render=function(){return $t("g",{className:"lf-arrow",children:this.getShape()})},t})(ko);var Fee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),d_=function(){return d_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},d_.apply(this,arguments)},Bee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Z1=(function(e){Fee(t,e);function t(){var n=e.call(this)||this;return n.textRef=G1(),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,Go.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,Go.DEFAULT),v.edgeTextEdit&&O.editable&&(s.setSelected(!1),l.setElementStateById(E,Go.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 t.prototype.getShape=function(){return $t("g",{children:this.getEdge()})},t.prototype.getTextStyle=function(){},t.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==Ju.TEXT||r.state===Go.TEXT_EDIT)return null;if(r.text){var s=!1;return a.edgeTextDraggable&&r.text.draggable&&(s=!0),$t(Eee,{ref:this.textRef,editable:a.edgeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},t.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}},t.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint;return[o,r]},t.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},t.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=Bee(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=KJ(qJ({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()})]})})},t.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})},t.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})},t.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)"})},t.prototype.getAdjustPointShape=function(n,o,r){var i=r.getAdjustPointStyle();return $t(zg,d_({className:"lf-edge-adjust-point"},i,{x:n,y:o}))},t.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}))]})},t.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},t.prototype.getAppendWidth=function(){return $t("g",{})},t.prototype.getAppend=function(){return $t("g",{className:"lf-edge-append",children:this.getAppendWidth()})},t.prototype.getEdge=function(){return null},t.prototype.toFront=function(){var n=this.props,o=n.graphModel,r=n.model;o.toFront(r.id)},t.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():""]})},t.isObserved=!1,t})(ko),$ee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s2=function(){return s2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s2.apply(this,arguments)},Uee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$P=(function(e){$ee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.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}}:{}))},t.prototype.getAppendWidth=function(){var n=this.props.model.path;return $t(P_,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},t.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=Uee(_P(a,i),2),l=s[0],f=s[1],h={start:l,end:f,hover:o,isSelected:r};return h},t.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)},t})(Z1),Vee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u2=function(){return u2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u2.apply(this,arguments)},UP=(function(e){Vee(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEdge=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isAnimation,a=n.arrowConfig,s=n.getEdgeStyle(),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(Wg,u2({},s,{x1:o.x,y1:o.y,x2:r.x,y2:r.y},a,i?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:E,animationIterationCount:O,animationTimingFunction:w,animationDirection:S}}:{}))},t.prototype.getAppendWidth=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i={start:o,end:r},a=tJ(i),s=a.d,l=a.strokeWidth,f=a.fill,h=a.strokeDasharray,v=a.stroke;return $t(P_,{d:s,fill:f,strokeWidth:l,stroke:v,strokeDasharray:h})},t})(Z1),Gee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),$v=function(){return $v=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$v.apply(this,arguments)},Wee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$_=(function(e){Gee(t,e);function t(){var n=e.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=Wee(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 t.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(NJ,$v({points:o},a,i,r?{strokeDasharray:l,stroke:f,style:{strokeDashoffset:h,animationName:v,animationDuration:b,animationIterationCount:E,animationTimingFunction:O,animationDirection:w}}:{}))},t.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}},t.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]},t.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"}},t.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})},t.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<f-1;b++)h(b);return $t("g",{children:l})},t})(Z1),wg=function(){return wg=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},wg.apply(this,arguments)},zee=(function(){function e(t){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(r){!n.nodeConfig||n.fakeNode||(n.fakeNode=n.lf.createFakeNode(wg(wg({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY}))))},this.onDragOver=function(r){if(n.lf.graphModel.eventCenter.emit(pr.BLANK_CANVAS_MOUSEMOVE,{e:r}),r.preventDefault(),n.fakeNode){var i=n.clientToLocalPoint({x:r.clientX,y:r.clientY}),a=i.x,s=i.y;n.fakeNode.moveTo(a,s);var l=n.fakeNode.getData();n.lf.setNodeSnapLine(l),n.lf.graphModel.eventCenter.emit(pr.NODE_DND_DRAG,{data:l,e:r})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(r){!n.lf.graphModel||!r||!n.nodeConfig||(n.lf.addNode(wg(wg({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY})),pr.NODE_DND_ADD,r),r.preventDefault(),r.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var o=t.lf;this.lf=o}return e.prototype.clientToLocalPoint=function(t){var n=t.x,o=t.y,r=om(this.lf.options,["grid","size"]),i=this.lf.graphModel.getPointByClient({x:n,y:o}),a=i.canvasOverlayPosition,s=a.x,l=a.y,f=this.lf.graphModel.editConfigModel.snapGrid;return{x:Gg(s,r,f),y:Gg(l,r,f)}},e.prototype.startDrag=function(t){var n=this.lf.graphModel.editConfigModel;n!=null&&n.isSilentMode||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},e.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},e})();function Hee(e,t){e.on("node:mousemove",function(n){var o=n.data;t.setNodeSnapLine(o)}),e.on("node:mouseup",function(){t.clearSnapline()})}var Xee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),np=function(){return np=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},np.apply(this,arguments)},Yee=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},qee=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Kee=(function(e){Xee(t,e);function t(n){var o=e.call(this,n)||this;return o.ref=G1(),o.__prevText={type:"",text:"",id:""},o.keyupHandler=function(r){var i=o.props.graphModel.textEditElement;r.key==="Enter"&&r.altKey&&(i==null||i.setElementState(Go.DEFAULT))},o.inputHandler=function(r){var i=r.target.innerText,a=o.props.graphModel.textEditElement;a&&(o.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},o.keydownHandler=function(r){r.stopPropagation()},o.state={style:{left:0,top:0}},o}return t.getDerivedStateFromProps=function(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,q=V.y,X=qee(a.CanvasPointToHtmlPoint([z,q]),2),G=X[0],Q=X[1];return{style:np(np({left:G,top:Q},f),l)}}return null},t.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=""}},t.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)}},t.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},t.toolName="text-edit-tool",t=Yee([xs],t),t})(ko),Zee=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Jee=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},lS=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Qee=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},ete=(function(e){Zee(t,e);function t(n){var o=e.call(this,n)||this;o.handleMouseDown=function(s){var l=o.props,f=l.graphModel.gridSize,h=l.lf,v=h.getTransform().SCALE_X;o.stepDrag.setStep(f*v),o.stepDrag.handleMouseDown(s)},o.handleWheelEvent=function(s){var l,f;s.preventDefault();var h=s.deltaX,v=s.deltaY,b=s.clientX,E=s.clientY,O=s.ctrlKey,w=new WheelEvent("wheel",{deltaX:h,deltaY:v,clientX:b,clientY:E,ctrlKey:O});(f=(l=o.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||f===void 0||f.dispatchEvent(w)},o.onDragging=function(s){var l=s.deltaX,f=s.deltaY,h=o.props,v=h.graphModel,b=h.lf,E=b.getTransform(),O=E.SCALE_X,w=E.SCALE_Y,S=v.getSelectElements(!0);v.moveNodes(S.nodes.map(function(M){return M.id}),l/O,f/w)},o.handleContextMenu=function(s){s.preventDefault();var l=o.props,f=l.graphModel,h=l.graphModel,v=h.eventCenter,b=h.selectElements,E=f.getPointByClient({x:s.clientX,y:s.clientY}),O={nodes:[],edges:[]},w=Qee([],lS(b.values()),!1);w.forEach(function(S){S.BaseType===da.NODE&&O.nodes.push(S.getData()),S.BaseType===da.EDGE&&O.edges.push(S.getData())}),v.emit(pr.SELECTION_CONTEXTMENU,{data:O,e:s,position:E})};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ac({onDragging:o.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),o}return t.prototype.render=function(){var n,o,r=this.props.graphModel,i=r.selectElements,a=r.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,f=s.SCALE_Y;if(!(i.size<=1)){var h=Number.MAX_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER;i.forEach(function(w){var S;w.BaseType===da.NODE&&(S=FZ(w)),w.BaseType===da.EDGE&&(S=VZ(w)),S!==void 0&&(h=Math.min(h,S.x),v=Math.min(v,S.y),b=Math.max(b,S.x1),E=Math.max(E,S.y1))}),n=lS(a.CanvasPointToHtmlPoint([h,v]),2),h=n[0],v=n[1],o=lS(a.CanvasPointToHtmlPoint([b,E]),2),b=o[0],E=o[1];var O={left:"".concat(h-20*l/2,"px"),top:"".concat(v-20*f/2,"px"),width:"".concat(b-h+20*l,"px"),height:"".concat(E-v+20*f,"px"),"border-width":"".concat(2*l,"px")};return $t("div",{className:"lf-multiple-select",style:O,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},t.toolName="multiple-select-tool",t=Jee([xs],t),t})(ko),sS=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},tte=[Kee,ete],nte=(function(){function e(t){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=t,ri(tte,function(i){n.isDisabled(i.toolName)||n.registerTool(i.toolName,i)});var o=t.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(Go.DEFAULT))})}return e.prototype.isDisabled=function(t){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(t))!==-1},e.prototype.registerTool=function(t,n){this.toolMap.set(t,n)},e.prototype.disableTool=function(t){var n=this.toolMap.get(t);if(n)return this.disabledToolMap.set(t,n),this.toolMap.delete(t),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},e.prototype.enableTool=function(t){var n=this.disabledToolMap.get(t);if(n)return this.toolMap.set(t,n),this.disabledToolMap.delete(t),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},e.prototype.getTools=function(){return Array.from(this.toolMap.values())},e.prototype.getInstance=function(){return this.instance},e.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},sS([Ut],e.prototype,"toolMap",void 0),sS([Bt],e.prototype,"disableTool",null),sS([Bt],e.prototype,"enableTool",null),e})();function rte(e){throw new Error("[mobx-utils] "+e)}function Hw(e,t){t===void 0&&(t="Illegal state"),e||rte(t)}var CI=function(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).concat(CI(Object.getPrototypeOf(e))||[])},ote=function(e){var t=CI(e),n=t.filter(function(o,r){return t.indexOf(o)===r});return n},ite=function(e){return ote(e).filter(function(t){return t!=="constructor"&&!~t.indexOf("__")})},NI="pending",Xw="fulfilled",PM="rejected";function ate(e){switch(this.state){case NI:return e.pending&&e.pending(this.value);case PM:return e.rejected&&e.rejected(this.value);case Xw:return e.fulfilled?e.fulfilled(this.value):this.value}}function VP(e,t){if(Hw(arguments.length<=2,"fromPromise expects up to two arguments"),Hw(typeof e=="function"||typeof e=="object"&&e&&typeof e.then=="function","Please pass a promise or function to fromPromise"),e.isPromiseBasedObservable===!0)return e;typeof e=="function"&&(e=new Promise(e));var n=e;e.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=ate;var o=t&&t.state===Xw?t.value:void 0;return NA(n,{value:o,state:NI},{},{deep:!1}),n}(function(e){e.reject=Bt("fromPromise.reject",function(n){var o=e(Promise.reject(n));return o.state=PM,o.value=n,o});function t(n){n===void 0&&(n=void 0);var o=e(Promise.resolve(n));return o.state=Xw,o.value=n,o}e.resolve=Bt("fromPromise.resolve",t)})(VP||(VP={}));var k0=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i};(function(){function e(t,n){var o=this;RK(function(){o.current=n,o.subscription=t.subscribe(o)})}return e.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.next=function(t){this.current=t},e.prototype.complete=function(){this.dispose()},e.prototype.error=function(t){this.current=t,this.dispose()},k0([Ut.ref],e.prototype,"current",void 0),k0([Bt.bound],e.prototype,"next",null),k0([Bt.bound],e.prototype,"complete",null),k0([Bt.bound],e.prototype,"error",null),e})();var Yw=function(){return Yw=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Yw.apply(this,arguments)},Fy=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},lte=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function e(t){var n=this;this.model=t,this.localValues=Ut.map({}),this.localComputedValues=Ut.map({}),this.isPropertyDirty=function(o){return n.localValues.has(o)},Hw(rd(t),"createViewModel expects an observable object"),ite(t).forEach(function(o){if(!(o===eo||o==="__mobxDidRunLazyInitializers")){if(Hw(lte.indexOf(o)===-1,"The propertyname "+o+" is reserved and cannot be used with viewModels"),Nk(t,o)){var r=Y1(t,o).derivation;n.localComputedValues.set(o,Ai(r.bind(n)))}var i=Object.getOwnPropertyDescriptor(t,o),a=i?{enumerable:i.enumerable}:{};Object.defineProperty(n,o,Yw(Yw({},a),{configurable:!0,get:function(){return Nk(t,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(e.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),e.prototype.submit=function(){var t=this;Vg(this.localValues).forEach(function(n){var o=t.localValues.get(n),r=t.model[n];tf(r)?r.replace(o):Ys(r)?(r.clear(),r.merge(o)):$K(o)||(t.model[n]=o)}),this.localValues.clear()},e.prototype.reset=function(){this.localValues.clear()},e.prototype.resetProperty=function(t){this.localValues.delete(t)},Fy([Ai],e.prototype,"isDirty",null),Fy([Ai],e.prototype,"changedValues",null),Fy([Bt.bound],e.prototype,"submit",null),Fy([Bt.bound],e.prototype,"reset",null),Fy([Bt.bound],e.prototype,"resetProperty",null),e})();function uS(e){if(!e)return"ROOT";for(var t=[];e.parent;)t.push(e.path),e=e.parent;return t.reverse().join("/")}function cS(e){return rd(e)||tf(e)||Ys(e)}function ste(e,t){var n=new WeakMap;function o(s){var l=n.get(s.object);r(s,l),t(s,uS(l),e)}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;f<s.object.length;f++)if(cS(s.object[f])){var h=n.get(s.object[f]);h&&(h.path=""+f)}break}}function i(s,l,f){if(cS(s)){var h=n.get(s);if(h){if(h.parent!==l||h.path!==f)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+uS(l)+"/"+f+"',")+(" but it already exists at '"+uS(h.parent)+"/"+h.path+"'"))}else{var v={parent:l,path:f,dispose:Q3(s,o)};n.set(s,v),GK(s).forEach(function(b){var E=b[0],O=b[1];return i(O,v,E)})}}}function a(s){if(cS(s)){var l=n.get(s);if(!l)return;n.delete(s),l.dispose(),VK(s).forEach(a)}}return i(e,void 0,""),function(){a(e)}}var ute=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i])},e(t,n)};return function(t,n){e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(e){ute(t,e);function t(n,o,r){var i=r===void 0?{}:r,a=i.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=i.keyToName,f=l===void 0?function(b){return""+b}:l,h=e.call(this)||this;h._keyToName=f,h._groupBy=o,h._ogmInfoKey=Symbol("ogmInfo"+s),h._base=n;for(var v=0;v<n.length;v++)h._addItem(n[v]);return h._disposeBaseObserver=Q3(h._base,function(b){if(b.type==="splice")Yc(function(){for(var E=0,O=b.removed;E<O.length;E++){var w=O[E];h._removeItem(w)}for(var S=0,M=b.added;S<M.length;S++){var T=M[S];h._addItem(T)}});else if(b.type==="update")Yc(function(){h._removeItem(b.oldValue),h._addItem(b.newValue)});else throw new Error("illegal state")}),h}return t.prototype.clear=function(){throw new Error("not supported")},t.prototype.delete=function(n){throw new Error("not supported")},t.prototype.set=function(n,o){throw new Error("not supported")},t.prototype.dispose=function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var o=this._base[n],r=o[this._ogmInfoKey];r.reaction(),delete o[this._ogmInfoKey]}},t.prototype._getGroupArr=function(n){var o=e.prototype.get.call(this,n);return o===void 0&&(o=Ut([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),e.prototype.set.call(this,n,o)),o},t.prototype._removeFromGroupArr=function(n,o){var r=e.prototype.get.call(this,n);r.length===1?e.prototype.delete.call(this,n):(o===r.length-1||(r[o]=r[r.length-1],r[o][this._ogmInfoKey].groupArrIndex=o),r.length--)},t.prototype._addItem=function(n){var o=this,r=this._groupBy(n),i=this._getGroupArr(r),a={groupByValue:r,groupArrIndex:i.length,reaction:H3(function(){return o._groupBy(n)},function(s,l){var f=n[o._ogmInfoKey];o._removeFromGroupArr(f.groupByValue,f.groupArrIndex);var h=o._getGroupArr(s),v=h.length;h.push(n),f.groupByValue=s,f.groupArrIndex=v})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),i.push(n)},t.prototype._removeItem=function(n){var o=n[this._ogmInfoKey];this._removeFromGroupArr(o.groupByValue,o.groupArrIndex),o.reaction(),delete n[this._ogmInfoKey]},t})(AM);Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var c2=function(){return c2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},c2.apply(this,arguments)},cte=(function(){function e(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return e.prototype.add=function(t){uA(ec(this.undos),t)||(this.undos.push(t),uA(this.curData,t)||(this.redos=[]),this.eventCenter.emit(pr.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},e.prototype.undoAble=function(){return this.undos.length>1},e.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var n=this.undos.pop();return this.curData=to(n),n}},e.prototype.redoAble=function(){return this.redos.length>0},e.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=to(t),t}},e.prototype.watch=function(t){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=ste(t,D2(function(){var o=t.modelToHistoryData();o&&n.add(c2({},o))},this.waitTime))},e.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},e})(),dS={exports:{}},GP;function dte(){return GP||(GP=1,(function(e){(function(t,n,o){if(!t)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,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,q,X=[];for(V=$(F),q=0;q<V.length;++q)z=V[q],s[z]&&(z=s[z]),I&&I!="keypress"&&a[z]&&(z=a[z],X.push("shift")),S(z)&&X.push(z);return I=T(z,X,I),{key:z,modifiers:X,action:I}}function P(F,I){return F===null||F===n?!1:F===I?!0:P(F.parentNode,I)}function B(F){var I=this;if(F=F||n,!(I instanceof B))return new B(F);I.target=F,I._callbacks={},I._directMap={};var V={},z,q=!1,X=!1,G=!1;function Q(ze){ze=ze||{};var Ye=!1,Be;for(Be in V){if(ze[Be]){Ye=!0;continue}V[Be]=0}Ye||(G=!1)}function J(ze,Ye,Be,Je,gt,le){var Ze,pe,se=[],we=Be.type;if(!I._callbacks[ze])return[];for(we=="keyup"&&S(ze)&&(Ye=[ze]),Ze=0;Ze<I._callbacks[ze].length;++Ze)if(pe=I._callbacks[ze][Ze],!(!Je&&pe.seq&&V[pe.seq]!=pe.level)&&we==pe.action&&(we=="keypress"&&!Be.metaKey&&!Be.ctrlKey||b(Ye,pe.modifiers))){var $e=!Je&&pe.combo==gt,rt=Je&&pe.seq==Je&&pe.level==le;($e||rt)&&I._callbacks[ze].splice(Ze,1),se.push(pe)}return se}function ie(ze,Ye,Be,Je){I.stopCallback(Ye,Ye.target||Ye.srcElement,Be,Je)||ze(Ye,Be)===!1&&(O(Ye),w(Ye))}I._handleKey=function(ze,Ye,Be){var Je=J(ze,Ye,Be),gt,le={},Ze=0,pe=!1;for(gt=0;gt<Je.length;++gt)Je[gt].seq&&(Ze=Math.max(Ze,Je[gt].level));for(gt=0;gt<Je.length;++gt){if(Je[gt].seq){if(Je[gt].level!=Ze)continue;pe=!0,le[Je[gt].seq]=1,ie(Je[gt].callback,Be,Je[gt].combo,Je[gt].seq);continue}pe||ie(Je[gt].callback,Be,Je[gt].combo)}var se=Be.type=="keypress"&&X;Be.type==G&&!S(ze)&&!se&&Q(le),X=pe&&Be.type=="keydown"};function Se(ze){typeof ze.which!="number"&&(ze.which=ze.keyCode);var Ye=v(ze);if(Ye){if(ze.type=="keyup"&&q===Ye){q=!1;return}I.handleKey(Ye,E(ze),ze)}}function Ae(){clearTimeout(z),z=setTimeout(Q,1e3)}function Pe(ze,Ye,Be,Je){V[ze]=0;function gt(we){return function(){G=we,++V[ze],Ae()}}function le(we){ie(Be,we,ze),Je!=="keyup"&&(q=v(we)),setTimeout(Q,10)}for(var Ze=0;Ze<Ye.length;++Ze){var pe=Ze+1===Ye.length,se=pe?le:gt(Je||D(Ye[Ze+1]).action);De(Ye[Ze],se,Je,ze,Ze)}}function De(ze,Ye,Be,Je,gt){I._directMap[ze+":"+Be]=Ye,ze=ze.replace(/\s+/g," ");var le=ze.split(" "),Ze;if(le.length>1){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<ze.length;++Je)De(ze[Je],Ye,Be)},h(F,"keypress",Se),h(F,"keydown",Se),h(F,"keyup",Se)}B.prototype.bind=function(F,I,V){var z=this;return F=F instanceof Array?F:[F],z._bindMultiple.call(z,F,I,V),z},B.prototype.unbind=function(F,I){var V=this;return V.bind.call(V,F,function(){},I)},B.prototype.trigger=function(F,I){var V=this;return V._directMap[F+":"+I]&&V._directMap[F+":"+I]({},F),V},B.prototype.reset=function(){var F=this;return F._callbacks={},F._directMap={},F},B.prototype.stopCallback=function(F,I){var V=this;if((" "+I.className+" ").indexOf(" mousetrap ")>-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(),t.Mousetrap=B,e.exports&&(e.exports=B)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(dS)),dS.exports}var fte=dte();const pte=Z_(fte);var Rd=null;function WP(e,t){var n,o;return e.x+=t,e.y+=t,dw(e.text)||(e.text.x+=t,e.text.y+=t),dw((n=e.properties)===null||n===void 0?void 0:n._label)||(o=e.properties)===null||o===void 0||o._label.forEach(function(r){r.x+=t,r.y+=t}),e}function zP(e,t){return e.startPoint&&(e.startPoint.x+=t,e.startPoint.y+=t),e.endPoint&&(e.endPoint.x+=t,e.endPoint.y+=t),e.pointsList&&e.pointsList.length>0&&e.pointsList.forEach(function(n){n.x+=t,n.y+=t}),dw(e.text)||(e.text.x+=t,e.text.y+=t),e}var ag=40,P0=40;function hte(e,t){var n=e.keyboard,o=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(P0=ag,!(o!=null&&o.enabled)||t.textEditElement)return!0;var r=e.options.guards,i=t.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 WP(s,ag)}),Rd.edges.forEach(function(s){return zP(s,ag)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||t.textEditElement)return!0;if(Rd&&(Rd.nodes||Rd.edges)){e.clearSelectElements();var r=e.addElements(Rd,P0);if(!r)return!0;r.nodes.forEach(function(i){return e.selectElementById(i.id,!0)}),r.edges.forEach(function(i){return e.selectElementById(i.id,!0)}),Rd.nodes.forEach(function(i){return WP(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)||t.textEditElement?!0:(e.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(o!=null&&o.enabled)||t.textEditElement?!0:(e.redo(),!1)}),n.on(["backspace"],function(){if(!(o!=null&&o.enabled)||t.textEditElement)return!0;var r=t.getSelectElements(!0);return e.clearSelectElements(),r.edges.forEach(function(i){return i.id&&e.deleteEdge(i.id)}),r.nodes.forEach(function(i){return i.id&&e.deleteNode(i.id)}),!1})}var vte=(function(){function e(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var n=t.lf;this.target=n.container,this.mousetrap=new pte(this.target),t.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return e.prototype.initShortcuts=function(){var t=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 t.on(l,f,h)});else{var r=o.keys,i=o.callback,a=o.action;this.on(r,i,a)}},e.prototype.on=function(t,n,o){this.mousetrap.bind(this.getKeys(t),n,o)},Object.defineProperty(e.prototype,"disabled",{get:function(){var t,n;return((n=(t=this.options)===null||t===void 0?void 0:t.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),e.prototype.off=function(t,n){this.mousetrap.unbind(this.getKeys(t),n)},e.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},e.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},e.prototype.destroy=function(){this.mousetrap.reset()},e.prototype.getKeys=function(t){var n=this;return(Array.isArray(t)?t:[t]).map(function(o){return n.formatKey(o)})},e.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},e})(),ph=function(){return ph=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},ph.apply(this,arguments)},R0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fS=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},pS=Symbol("plugin registered by Logicflow.use"),HP=(function(){function e(t){var n=this,o;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(f,h){return n.viewMap.set(f,h)},this.getView=function(f){return n.viewMap.get(f)};var r=M_.get(t),i=r.container,a=r.width,s=r.height;this.options=r,this.container=this.initContainer(i,a,s),this.graphModel=new iee(ph(ph({},r),{container:this.container})),this.plugins=(o=r.plugins)!==null&&o!==void 0?o:[];var l=this.graphModel.eventCenter;this.tool=new nte(this),this.dnd=new zee({lf:this}),this.history=new cte(l),this.keyboard=new vte({lf:this,keyboard:r.keyboard}),r.snapline!==!1&&(this.snaplineModel=new aee(this.graphModel,r.snaplineEpsilon),Hee(l,this.snaplineModel)),r.isSilentMode||(hte(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(r.disabledPlugins)}return e.prototype.initContainer=function(t,n,o){var r=document.createElement("div");return r.style.position="relative",r.style.width=n?"".concat(n,"px"):"100%",r.style.height=o?"".concat(o,"px"):"100%",t.innerHTML="",t.appendChild(r),r},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.register=function(t,n,o){if(o===void 0&&(o=!0),typeof t!="string"){this.registerElement(t);return}var r={BaseEdge:Z1,BaseEdgeModel:K1,BaseNode:Ih,BaseNodeModel:Lh,RectNode:Zv,RectNodeModel:Hg,CircleNode:Gw,CircleNodeModel:$w,PolygonNode:zw,PolygonNodeModel:Uw,TextNode:FP,TextNodeModel:jP,LineEdge:UP,LineEdgeModel:kP,DiamondNode:n2,DiamondNodeModel:HA,PolylineEdge:$_,PolylineEdgeModel:F_,BezierEdge:$P,BezierEdgeModel:CP,EllipseNode:o2,EllipseNodeModel:XA,HtmlNode:a2,HtmlNodeModel:YA,h:Lr,type:t};if(this.viewMap.forEach(function(f){var h=f.extendKey;h&&(r[h]=f)}),this.graphModel.modelMap.forEach(function(f){var h=f.extendKey;h&&(r[h]=f)}),n){var i=n(r),a=i.view,s=i.model,l=a;o&&!l.isObserved&&(l.isObserved=!0,l=xs(l)),this.setView(t,l),this.graphModel.setModel(t,s)}},e.prototype.registerElement=function(t){var n=t.view;t.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=xs(n)),this.setView(t.type,n),this.graphModel.setModel(t.type,t.model)},e.prototype.batchRegister=function(t){var n=this;t===void 0&&(t=[]),ri(t,function(o){n.registerElement(o)})},e.prototype.defaultRegister=function(){var t=[{type:"rect",view:Zv,model:Hg},{type:"circle",view:Gw,model:$w},{type:"polygon",view:zw,model:Uw},{type:"text",view:FP,model:jP},{type:"ellipse",view:o2,model:XA},{type:"diamond",view:n2,model:HA},{type:"html",view:a2,model:YA},{type:"line",view:UP,model:kP},{type:"polyline",view:$_,model:F_},{type:"bezier",view:$P,model:CP}];this.batchRegister(t)},e.prototype.addNode=function(t,n,o){return n===void 0&&(n=pr.NODE_ADD),this.graphModel.addNode(t,n,o)},e.prototype.deleteNode=function(t){var n=this.graphModel.getNodeModelById(t);if(!n)return!1;var o=n.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteNode(t),i},e.prototype.cloneNode=function(t){var n=this.graphModel.getNodeModelById(t),o=n==null?void 0:n.getData();if(o){var r=this.options.guards,i=r!=null&&r.beforeClone?r.beforeClone(o):!0;if(i)return this.graphModel.cloneNode(t)}},e.prototype.changeNodeId=function(t,n){return this.graphModel.changeNodeId(t,n)},e.prototype.changeNodeType=function(t,n){this.graphModel.changeNodeType(t,n)},e.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},e.prototype.getNodeDataById=function(t){var n=this.getNodeModelById(t);return n==null?void 0:n.getData()},e.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},e.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},e.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},e.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},e.prototype.createFakeNode=function(t){var n=this.graphModel.modelMap.get(t.type);if(!n)return console.warn("不存在为".concat(t.type,"类型的节点")),null;var o=new n(ph(ph({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(o),o},e.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},e.prototype.setNodeSnapLine=function(t){var n;(n=this.snaplineModel)===null||n===void 0||n.setNodeSnapLine(t)},e.prototype.removeNodeSnapLine=function(){var t;(t=this.snaplineModel)===null||t===void 0||t.clearSnapline()},e.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},e.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},e.prototype.getEdgeDataById=function(t){var n=this.getEdgeModelById(t);return n==null?void 0:n.getData()},e.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},e.prototype.getEdgeModels=function(t){var n=t.sourceNodeId,o=t.targetNodeId,r=[],i=this.graphModel.edges;return n&&o?ri(i,function(a){a.sourceNodeId===n&&a.targetNodeId===o&&r.push(a)}):n?ri(i,function(a){a.sourceNodeId===n&&r.push(a)}):o&&ri(i,function(a){a.targetNodeId===o&&r.push(a)}),r},e.prototype.changeEdgeId=function(t,n){return this.graphModel.changeEdgeId(t,n)},e.prototype.changeEdgeType=function(t,n){this.graphModel.changeEdgeType(t,n)},e.prototype.deleteEdge=function(t){var n=this.graphModel.getEdgeModelById(t);if(!n)return!1;var o=n.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteEdgeById(t),i},e.prototype.deleteEdgeByNodeId=function(t){var n=t.sourceNodeId,o=t.targetNodeId;n&&o?this.graphModel.deleteEdgeBySourceAndTarget(n,o):n?this.graphModel.deleteEdgeBySource(n):o&&this.graphModel.deleteEdgeByTarget(o)},e.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},e.prototype.addElements=function(t,n){var o=this,r=t.nodes,i=t.edges;n===void 0&&(n=40),console.log("distance",n);var a={},s={nodes:[],edges:[]};return ri(r,function(l){var f=l.id,h=o.addNode(l);f&&(a[f]=h.id),s.nodes.push(h)}),ri(i,function(l){var f=l.sourceNodeId,h=l.targetNodeId;a[f]&&(f=a[f]),a[h]&&(h=a[h]);var v=o.graphModel.addEdge(ph(ph({},l),{sourceNodeId:f,targetNodeId:h}));s.edges.push(v)}),s},e.prototype.selectElementById=function(t,n,o){n===void 0&&(n=!1),o===void 0&&(o=!0),this.graphModel.selectElementById(t,n),!n&&o&&this.graphModel.toFront(t)},e.prototype.deselectElementById=function(t){this.graphModel.deselectElementById(t)},e.prototype.getSelectElements=function(t){return t===void 0&&(t=!0),this.graphModel.getSelectElements(t)},e.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},e.prototype.getModelById=function(t){return this.graphModel.getElement(t)},e.prototype.getDataById=function(t){var n;return(n=this.graphModel.getElement(t))===null||n===void 0?void 0:n.getData()},e.prototype.deleteElement=function(t){var n,o,r,i=this.getModelById(t);if(!i)return!1;var a=(n={},n[da.NODE]=this.deleteNode,n[da.EDGE]=this.deleteEdge,n);return(r=(o=a[i.BaseType])===null||o===void 0?void 0:o.call(this,t))!==null&&r!==void 0?r:!1},e.prototype.setElementZIndex=function(t,n){return this.graphModel.setElementZIndex(t,n)},e.prototype.getAreaElement=function(t,n,o,r,i){return o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1),this.graphModel.getAreaElement(t,n,o,r,i).map(function(a){return a.getData()})},e.prototype.setProperties=function(t,n){var o;(o=this.graphModel.getElement(t))===null||o===void 0||o.setProperties(Jl(n))},e.prototype.getProperties=function(t){var n;return(n=this.graphModel.getElement(t))===null||n===void 0?void 0:n.getProperties()},e.prototype.deleteProperty=function(t,n){var o;(o=this.graphModel.getElement(t))===null||o===void 0||o.deleteProperty(n)},e.prototype.updateAttributes=function(t,n){this.graphModel.updateAttributes(t,n)},e.prototype.editText=function(t){this.graphModel.editText(t)},e.prototype.updateText=function(t,n){this.graphModel.updateText(t,n)},e.prototype.updateEditConfig=function(t){var n=this.graphModel,o=n.editConfigModel,r=n.transformModel,i=o.snapGrid;if(o.updateEditConfig(t),(t==null?void 0:t.stopMoveGraph)!==void 0&&r.updateTranslateLimits(t.stopMoveGraph),t!=null&&t.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!ws(t==null?void 0:t.snapGrid)&&t.snapGrid!==i){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(t.snapGrid?s:1)}this.emit(pr.EDIT_CONFIG_CHANGED,{data:o.getConfig()})},e.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},e.prototype.setTheme=function(t,n){this.graphModel.setTheme(t,n)},e.prototype.getTheme=function(){return this.graphModel.getTheme()},e.prototype.focusByElement=function(t){var n=void 0,o=this.getNodeModelById(t);if(o){var r=o.getData(),i=r.x,a=r.y;n={x:i,y:a}}var s=this.getEdgeModelById(t);if(s){var l=s.textPosition,i=l.x,a=l.y;n={x:i,y:a}}n&&this.focusByCoordinate(n)},e.prototype.focusByCoordinate=function(t){var n=this.graphModel,o=n.transformModel,r=n.width,i=n.height,a=t.x,s=t.y;o.focusOn(a,s,r,i)},e.prototype.focusOn=function(t){if(typeof t=="string")this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var n=t.id,o=t.coordinate;n&&this.focusByElement(n),o&&this.focusByCoordinate(o)}},e.prototype.resize=function(t,n){this.graphModel.resize(t,n),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},e.prototype.toFront=function(t){this.graphModel.toFront(t)},e.prototype.getPointByClient=function(t,n){if(typeof t=="object")return this.graphModel.getPointByClient(t);if(typeof n=="number")return this.graphModel.getPointByClient({x:t,y:n})},e.prototype.getGraphData=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,fS([o],R0(t),!1)):o},e.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},e.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},e.prototype.setOverlapMode=function(t){this.graphModel.setOverlapMode(t)},e.prototype.renderRawData=function(t){this.graphModel.graphDataToModel(Jl(t)),this.options.history!==!1&&this.history.watch(this.graphModel),rP($t(dee,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(pr.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},e.prototype.render=function(t){var n=to(t);this.adapterIn&&(n=this.adapterIn(n)),this.renderRawData(n)},e.prototype.undo=function(){if(this.history.undoAble()){var t=Jl(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.redo=function(){if(this.history.redoAble()){var t=Jl(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.zoom=function(t,n){var o=this.graphModel.transformModel;return o.zoom(t,n)},e.prototype.resetZoom=function(){var t=this.graphModel.transformModel;t.resetZoom()},e.prototype.setZoomMiniSize=function(t){var n=this.graphModel.transformModel;n.setZoomMiniSize(t)},e.prototype.setZoomMaxSize=function(t){var n=this.graphModel.transformModel;n.setZoomMaxSize(t)},e.prototype.getTransform=function(){var t=this.graphModel.transformModel,n=t.SCALE_X,o=t.SCALE_Y,r=t.TRANSLATE_X,i=t.TRANSLATE_Y;return{SCALE_X:n,SCALE_Y:o,TRANSLATE_X:r,TRANSLATE_Y:i}},e.prototype.translate=function(t,n){var o=this.graphModel.transformModel;o.translate(t,n)},e.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,n=t.TRANSLATE_X,o=t.TRANSLATE_Y;this.translate(-n,-o)},e.prototype.translateCenter=function(){this.graphModel.translateCenter()},e.prototype.fitView=function(t,n){n===void 0&&(n=t),this.graphModel.fitView(t,n)},e.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},e.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},e.prototype.on=function(t,n){this.graphModel.eventCenter.on(t,n)},e.prototype.off=function(t,n){this.graphModel.eventCenter.off(t,n)},e.prototype.once=function(t,n){this.graphModel.eventCenter.once(t,n)},e.prototype.emit=function(t,n){this.graphModel.eventCenter.emit(t,n)},e.use=function(t,n){var o,r=t.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,(o={},o[pS]=pS,o.extension=t,o.props=n,o))},e.addThemeMode=function(t,n){oQ(t,n)},e.removeThemeMode=function(t){iQ(t)},e.clearThemeMode=function(){aQ()},e.prototype.installPlugins=function(t){var n=this;t===void 0&&(t=[]);var o=Array.from(e.extensions,function(i){var a=R0(i,2),s=a[1];return s}),r=fS(fS([],R0(this.plugins),!1),R0(o),!1);ri(r,function(i){var a,s;pS in i?(a=i.extension,s=i.props):a=i;var l=a==null?void 0:a.pluginName;zj(t,l)===-1&&n.installPlugin(a,s)})},e.prototype.installPlugin=function(t,n){var o,r;if("pluginName"in t&&"install"in t){var i=t.pluginName,a=t.install,s=t.render;i&&(a&&a.call(t,this,e),s&&this.components.push(s.bind(t)),this.extension[i]=t);return}var l=t,f=l.pluginName,h=new l({lf:this,LogicFlow:e,props:n,options:(r=(o=this.options.pluginsOptions)===null||o===void 0?void 0:o[f])!==null&&r!==void 0?r:{}});h.render&&this.components.push(h.render.bind(h)),this.extension[f]=h},e.prototype.destroy=function(){var t;this.clearData(),rP(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var n in this.extension){var o=this.extension[n];"destroy"in o&&((t=o.destroy)===null||t===void 0||t.call(o))}},e.extensions=new Map,e})();(function(e){e.toStringTag="LF.".concat(e.name)})(HP||(HP={}));function xs(e){return TM(e)}var mte=(function(){function e(){globalThis._ids=this,this._ids=new Set}return e.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(t){var n=Math.random()*16|0,o=t==="x"?n:n&3|8;return o.toString(16)})},e.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},e})(),gte=(globalThis==null?void 0:globalThis._ids)||new mte;function sy(){return gte.next()}var kI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(e){kI(t,e);function t(n,o){return n.id||(n.id="Event_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),e.call(this,n,o)||this}return t.prototype.setAttributes=function(){this.r=18},t.prototype.getConnectedTargetRules=function(){var n=e.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(o),n},t.extendKey="StartEventModel",t})($w);(function(e){kI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.extendKey="StartEventNode",t})(Gw);var PI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),qw=function(){return qw=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},qw.apply(this,arguments)};(function(e){PI(t,e);function t(n,o){return n.id||(n.id="Event_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),e.call(this,n,o)||this}return t.prototype.setAttributes=function(){this.r=18},t.prototype.getConnectedSourceRules=function(){var n=e.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(o),n},t.extendKey="EndEventModel",t})($w);(function(e){PI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},t.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=e.prototype.getShape.call(this);return Lr("g",{},l,Lr("circle",qw(qw({},o),{cx:i,cy:a,r:s-5})))},t.extendKey="EndEventView",t})(Gw);var RI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(e){RI(t,e);function t(n,o){return n.id||(n.id="Flow_".concat(sy())),e.call(this,n,o)||this}return t.extendKey="SequenceFlowModel",t})(F_);(function(e){RI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.extendKey="SequenceFlowEdge",t})($_);var DI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f_=function(){return f_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f_.apply(this,arguments)};(function(e){DI(t,e);function t(n,o){var r=this;return n.id||(n.id="Gateway_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),r=e.call(this,n,o)||this,r.points=[[25,0],[50,25],[25,50],[0,25]],r}return t.extendKey="ExclusiveGatewayModel",t})(Uw);(function(e){DI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getShape=function(){var n=this.props.model,o=n,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,f=n.getNodeStyle();return Lr("g",{transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")},Lr("polygon",f_(f_({},f),{x:r,y:i,points:l})),Lr("path",f_({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},f)))},t.extendKey="ExclusiveGatewayNode",t})(zw);var jI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),d2=function(){return d2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},d2.apply(this,arguments)};(function(e){jI(t,e);function t(n,o){return n.id||(n.id="Activity_".concat(sy())),e.call(this,n,o)||this}return t.extendKey="ServiceTaskModel",t})(Hg);(function(e){jI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getNodeStyle();return Lr("svg",{x:o-i/2+5,y:r-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Lr("path",{fill:s.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},t.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Lr("g",{},[Lr("rect",d2({x:o-i/2,y:r-a/2,rx:s,ry:s,width:i,height:a},l)),this.getLabelShape()])},t.extendKey="ServiceTaskNode",t})(Zv);var LI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kw=function(){return Kw=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Kw.apply(this,arguments)};(function(e){LI(t,e);function t(n,o){return n.id||(n.id="Activity_".concat(sy())),e.call(this,n,o)||this}return t.extendKey="UserTaskModel",t})(Hg);(function(e){LI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getNodeStyle();return Lr("svg",{x:o-i/2+5,y:r-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Lr("path",{fill:s.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},t.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Lr("g",{},[Lr("rect",Kw(Kw({},l),{x:o-i/2,y:r-a/2,rx:s,ry:s,width:i,height:a})),this.getLabelShape()])},t.extendKey="UserTaskNode",t})(Zv);var yte=(function(){function e(){globalThis._ids=this,this._ids=new Set}return e.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(t){var n=Math.random()*16|0,o=t==="x"?n:n&3|8;return o.toString(16)})},e.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},e})(),_te=(globalThis==null?void 0:globalThis._ids)||new yte;function XP(){return _te.next()}function II(e){return Object.prototype.toString.call(e)}function bte(e){return" ".repeat(e)}function Zw(e){var t=e;return II(e)==="[object Object]"?(t={},Object.keys(e).forEach(function(n){var o=n;n.charAt(0)==="-"&&(o=n.substring(1)),t[o]=Zw(e[n])})):Array.isArray(e)&&(t=[],e.forEach(function(n,o){t[o]=Zw(n)})),t}function Jw(e){return e==null?"":e.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function wte(e){var t=e;try{typeof t!="string"&&(t=JSON.parse(e))}catch{t=JSON.stringify(Zw(e)).replace(/"/g,"'")}return Jw(String(t))}var Tv=`
|
||
`;function Z0(e,t,n){var o=bte(n);if(e!==0&&e!==!1&&!e)return Tv+o+"<".concat(t," />");var r="";if(t==="#text")return Tv+o+Jw(String(e));if(t==="#cdata-section")return Tv+o+"<![CDATA["+e+"]]>";if(t==="#comment")return Tv+o+"<!--"+e+"-->";if("".concat(t).charAt(0)==="-")return" "+t.substring(1)+'="'+wte(e)+'"';if(Array.isArray(e))e.forEach(function(l){r+=Z0(l,t,n+1)});else if(II(e)==="[object Object]"){var i=Object.keys(e),a="",s="";r+=(n===0?"":Tv+o)+"<"+t,i.forEach(function(l){l.charAt(0)==="-"?a+=Z0(e[l],l,n+1):s+=Z0(e[l],l,n+1)}),r+=a+(s!==""?">".concat(s).concat(Tv+o,"</").concat(t,">"):" />")}else r+=Tv+o+"<".concat(t,">").concat(Jw(String(e)),"</").concat(t,">");return r}function Ete(e){var t="";for(var n in e)t+=Z0(e[n],n,0);return t}var As=function(){};As.ObjTree=function(){return this};As.ObjTree.VERSION="0.23";As.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;As.ObjTree.prototype.attr_prefix="-";As.ObjTree.prototype.parseXML=function(e){var t;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(e,"application/xml");if(!o)return;t=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(e),t=n.documentElement);if(t)return this.parseDOM(t)};As.ObjTree.prototype.parseHTTP=function(e,t,n){var o={};for(var r in t)o[r]=t[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=e;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(e,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(e){if(e){if(this.__force_array={},this.force_array)for(var t=0;t<this.force_array.length;t++)this.__force_array[this.force_array[t]]=1;var n=this.parseElement(e);if(this.__force_array[e.nodeName]&&(n=[n]),e.nodeType!=11){var o={};o[e.nodeName]=n,n=o}return n}};As.ObjTree.prototype.parseElement=function(e){if(e.nodeType!=7){if(e.nodeType==3||e.nodeType==4||e.nodeType==8){var t=e.nodeValue.match(/[^\x00-\x20]/);return t==null?void 0:e.nodeValue}var n=null,o={};if(e.attributes&&e.attributes.length){n={};for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r].nodeName;if(typeof i=="string"){var a=e.attributes[r].nodeValue;try{a=JSON.parse(e.attributes[r].nodeValue.replace(/'/g,'"'))}catch{a=e.attributes[r].nodeValue}a&&(i=this.attr_prefix+i,typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(e.childNodes&&e.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r<e.childNodes.length&&s;r++){var l=e.childNodes[r].nodeType;l==3||l==4||l==8||(s=!1)}if(s){n||(n="");for(var r=0;r<e.childNodes.length;r++)n+=e.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<e.childNodes.length;r++){var i=e.childNodes[r].nodeName;if(typeof i=="string"){var a=this.parseElement(e.childNodes[r]);a&&(typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};As.ObjTree.prototype.addNode=function(e,t,n,o){this.__force_array[t]?(n==1&&(e[t]=[]),e[t][e[t].length]=o):n==1?e[t]=o:n==2?e[t]=[e[t],o]:e[t][e[t].length]=o};As.ObjTree.prototype.writeXML=function(e){var t=this.hash_to_xml(null,e);return this.xmlDecl+t};As.ObjTree.prototype.hash_to_xml=function(e,t){var n=[],o=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[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 e>"u"||e==null||(n.length>0?s.match(/\n/)?s="<"+e+a+`>
|
||
`+s+"</"+e+`>
|
||
`:s="<"+e+a+">"+s+"</"+e+`>
|
||
`:s="<"+e+a+` />
|
||
`),s};As.ObjTree.prototype.array_to_xml=function(e,t){for(var n=[],o=0;o<t.length;o++){var r=t[o];typeof r>"u"||r==null?n[n.length]="<"+e+" />":typeof r=="object"&&r.constructor==Array?n[n.length]=this.array_to_xml(e,r):typeof r=="object"?n[n.length]=this.hash_to_xml(e,r):n[n.length]=this.scalar_to_xml(e,r)}return n.join("")};As.ObjTree.prototype.scalar_to_xml=function(e,t){return e=="#text"?this.xml_escape(t):"<"+e+">"+this.xml_escape(t)+"</"+e+`>
|
||
`};As.ObjTree.prototype.xml_escape=Jw;var xte=function(e){return new As.ObjTree().parseXML(e)},Ote=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f2=function(){return f2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f2.apply(this,arguments)},J1=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xd;(function(e){e.START="bpmn:startEvent",e.END="bpmn:endEvent",e.GATEWAY="bpmn:exclusiveGateway",e.USER="bpmn:userTask",e.SYSTEM="bpmn:serviceTask",e.FLOW="bpmn:sequenceFlow"})(Xd||(Xd={}));var FI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],YP=["properties","startPoint","endPoint","pointsList"],BI=function(e){return String(e||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function qP(e){var t=e?YP.concat(e):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:t.includes(l)?i["-".concat(l)]=o(f):i[l]=o(f)}),i)}return o(n)}}function Qw(e){var t={};return Object.entries(e).forEach(function(n){var o=J1(n,2),r=o[0],i=o[1];r.indexOf("-")===0?t[r.substring(1)]=Zw(i):typeof i=="string"?t[r]=i:Object.prototype.toString.call(i)==="[object Object]"?t[r]=Qw(i):Array.isArray(i)?t[r]=i.map(function(a){return Qw(a)}):t[r]=i}),t}function Ste(e,t,n){var o=new Map;t.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),e[i.type]?Array.isArray(e[i.type])?e[i.type].push(s):e[i.type]=[e[i.type],s]:e[i.type]=s});var r=t.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});t.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}),e[Xd.FLOW]=r}function Ate(e,t){e["bpmndi:BPMNEdge"]=t.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}),e["bpmndi:BPMNShape"]=t.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 Mte(e){var t=[],n=[],o=e["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:t,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=Cte(l,h)}else{var v=a["bpmndi:BPMNShape"],b=(Array.isArray(v),v);t=t.concat(Tte(l,b,s))}}})}return{nodes:t,edges:n}}function Tte(e,t,n){var o=[];if(Array.isArray(e))e.forEach(function(a){var s;Array.isArray(t)?s=t.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=t;var l=KP(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(t)?r=t.find(function(a){return a["-bpmnElement"]===e["-id"]}):r=t;var i=KP(r,n,e);o.push(i)}return o}function KP(e,t,n){var o=Number(e["dc:Bounds"]["-x"]),r=Number(e["dc:Bounds"]["-y"]),i=BI(n["-name"]),a=Fh.shapeConfigMap.get(t);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},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var f=e["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:e["-bpmnElement"],type:t,x:o,y:r,properties:s};return l&&(h.text=l),h}function Cte(e,t){var n=[];if(Array.isArray(e))e.forEach(function(r){var i;Array.isArray(t)?i=t.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=t,n.push(ZP(i,r))});else{var o=void 0;Array.isArray(t)?o=t.find(function(r){return r["-bpmnElement"]===e["-id"]}):o=t,n.push(ZP(o,e))}return n}function ZP(e,t){var n,o=t["-name"]?BI("".concat(t["-name"])):"";if(o){var r=void 0;e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"]&&(r=e["bpmndi:BPMNLabel"]["dc:Bounds"]);var i=0;if(o.split(`
|
||
`).forEach(function(E){i<E.length&&(i=E.length)}),r)n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7};else{var a=e["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,f=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,h=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;n={value:o,x:f,y:h}}}var v;Object.entries(t).forEach(function(E){var O=J1(E,2),w=O[0],S=O[1];FI.indexOf(w)===-1&&(v||(v={}),v[w]=S)}),v&&(v=Qw(v));var b={id:t["-id"],type:Xd.FLOW,pointsList:e["di:waypoint"].map(function(E){return{x:Number(E["-x"]),y:Number(E["-y"])}}),sourceNodeId:t["-sourceRef"],targetNodeId:t["-targetRef"],properties:v};return n&&(b.text=n),b}var Fh=(function(){function e(t){var n=t.lf,o=this;this.adapterOut=function(r,i){var a=f2({},o.processAttributes);Ste(a,r,i);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};Ate(s,r);var l=o.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var f={"bpmn:definitions":l};return f},this.adapterIn=function(r){if(r)return Mte(r)},n.adapterIn=function(r){return o.adapterIn(r)},n.adapterOut=function(r,i){return o.adapterOut(r,i)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(XP())},this.definitionAttributes={"-id":"Definitions_".concat(XP()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return e.prototype.setCustomShape=function(t,n){e.shapeConfigMap.set(t,n)},e.pluginName="bpmn-adapter",e.shapeConfigMap=new Map,e})();Fh.shapeConfigMap.set(Xd.START,{width:gk.width,height:gk.height});Fh.shapeConfigMap.set(Xd.END,{width:yk.width,height:yk.height});Fh.shapeConfigMap.set(Xd.GATEWAY,{width:_k.width,height:_k.height});Fh.shapeConfigMap.set(Xd.SYSTEM,{width:bk.width,height:bk.height});Fh.shapeConfigMap.set(Xd.USER,{width:wk.width,height:wk.height});(function(e){Ote(t,e);function t(n){var o=e.call(this,n)||this;o.adapterXmlIn=function(i){var a=typeof i=="string"?o.sanitizeNameAttributes(i):i,s=xte(a);return o.adapterIn(s)},o.adapterXmlOut=function(i,a){var s=o.adapterOut(i,a);return Ete(s)};var r=n.lf;return r.adapterIn=o.adapterXmlIn,r.adapterOut=o.adapterXmlOut,o}return t.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(o,r){var i=r.replace(/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">");return'name="'.concat(i,'"')})},t.pluginName="bpmnXmlAdapter",t})(Fh);var Nte=(function(){function e(){globalThis._ids=this,this._ids=new Set}return e.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,function(n){var o=Math.random()*16|0,r=n==="x"?o:o&3|8;return r.toString(16)});return t},e.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},e})(),kte=(globalThis==null?void 0:globalThis._ids)||new Nte;function Pte(){return kte.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 Rte=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Uv=function(){return Uv=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Uv.apply(this,arguments)},Dte=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},jte=ac,Lte=(function(e){Rte(t,e);function t(n){var o=e.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.width<w||B.width>M||B.height<S||B.height>T){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.width<w/2||F.width>M/2||F.height<S/2||F.height>T/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.width<w/2||F.width>M/2||F.height<S/2||F.height>T/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=Dte(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 jte({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return t.prototype.getNodeEdges=function(n){for(var o=this.graphModel,r=o.edges,i=[],a=[],s=0;s<r.length;s++){var l=r[s];l.sourceNodeId===n?i.push(l):r[s].targetNodeId===n&&a.push(l)}return{sourceEdges:i,targetEdges:a}},t.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.index,a=n.model,s=a.getControlPointStyle();return $t("g",{className:"lf-resize-control-".concat(i),children:$t(qu,Uv({className:"lf-node-control",x:o,y:r},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},t})(ko),Ite=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),e1=function(){return e1=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},e1.apply(this,arguments)},Q1=(function(e){Ite(t,e);function t(){var n=e.call(this)||this;return n.state={},n}return t.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=o.x,a=o.y,s=o.width,l=o.height,f={minX:i-s/2,minY:a-l/2,maxX:i+s/2,maxY:a+l/2},h=f.minX,v=f.minY,b=f.maxX,E=f.maxY,O=[{x:h,y:v},{x:b,y:v},{x:b,y:E},{x:h,y:E}];return O.map(function(w,S){return $t(Lte,e1({index:S},w,{model:o,graphModel:r}))})},t.prototype.getGroupSolid=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getResizeOutlineStyle();return $t(qu,e1({},s,{x:o,y:r,width:i,height:a}))},t.prototype.render=function(){return $t("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},t})(ko),$I=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(e){$I(t,e);function t(n,o){var r=e.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},i={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},t})(XA);(function(e){$I(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o.isSelected&&!r?this.getControlGroup():""]})},t})(o2);var UI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p2=function(){return p2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},p2.apply(this,arguments)};(function(e){UI(t,e);function t(n,o){var r=e.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},i={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},t})(HA);(function(e){UI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},t.prototype.getResizeShape=function(){var n=this.props.model,o=n.points,r=n.getNodeStyle();return $t("g",{children:$t(kM,p2({},r,{points:o}))})},t.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},t})(n2);var VI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Fte=(function(e){VI(t,e);function t(n,o){var r=e.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.width,basisHeight:this.height},i={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},t})(YA),Bte=(function(e){VI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},t})(a2),GI={view:Bte,model:Fte},WI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),$te=(function(e){WI(t,e);function t(n,o){var r=e.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return t.prototype.initNodeData=function(n){e.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},t.prototype.getOutlineStyle=function(){var n=e.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},t.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},t.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},t.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.width,basisHeight:this.height},i={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},t})(Hg),Ute=(function(e){WI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},t})(Zv),zI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),t1=function(){return t1=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},t1.apply(this,arguments)},Cv=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nv=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},JP=500,QP=300,Vte=-1e4;(function(e){zI(t,e);function t(){var n=e.apply(this,Nv([],Cv(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=JP,n.unfoldedHeight=QP,n.childrenLastFoldStatus={},n}return t.prototype.initNodeData=function(n){var o=this;e.prototype.initNodeData.call(this,n);var r=[];qa(n.children)&&(r=n.children),this.children=new Set(r),this.width=JP,this.height=QP,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=Vte,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){o.isFolded&&o.foldGroup(o.isFolded)})},t.prototype.getResizeOutlineStyle=function(){var n=e.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},t.prototype.foldGroup=function(n){var o=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var r=Nv(Nv([],Cv(this.incoming.edges),!1),Cv(this.outgoing.edges),!1);this.children.forEach(function(i){var a=o.graphModel.getElement(i);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var l=o.childrenLastFoldStatus[i];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}o.childrenLastFoldStatus[i]=!!s,a.visible=!n;var f=a.incoming.edges,h=a.outgoing.edges;r=Nv(Nv(Nv([],Cv(r),!1),Cv(f),!1),Cv(h),!1)}}),this.foldEdge(n,r)}},t.prototype.getAnchorStyle=function(n){var o=e.prototype.getAnchorStyle.call(this,n);return o.stroke="transparent",o.fill="transparent",o.hover.fill="transparent",o.hover.stroke="transparent",o},t.prototype.foldEdge=function(n,o){var r=this;o.forEach(function(i,a){var s=i.id,l=i.sourceNodeId,f=i.targetNodeId,h=i.startPoint,v=i.endPoint,b=i.type,E=i.text,O=i.getProperties(),w={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:f,startPoint:h,endPoint:v,type:b,properties:O,text:E==null?void 0:E.value};i.virtual&&r.graphModel.deleteEdgeById(i.id);var S=r.graphModel.group.getNodeGroup(f);S||(S=r.graphModel.getNodeModelById(f));var M=r.graphModel.group.getNodeGroup(l);M||(M=r.graphModel.getNodeModelById(l)),n&&i.visible!==!1&&(r.children.has(l)||r.id===l?(w.startPoint=void 0,w.sourceNodeId=r.id):(w.endPoint=void 0,w.targetNodeId=r.id),(S.id!==r.id||M.id!==r.id)&&r.createVirtualEdge(w),i.visible=!1),!n&&i.visible===!1&&(S&&S.isGroup&&S.isFolded?(w.targetNodeId=S.id,w.endPoint=void 0,r.createVirtualEdge(w)):M&&M.isGroup&&M.isFolded?(w.sourceNodeId=M.id,w.startPoint=void 0,r.createVirtualEdge(w)):i.visible=!0)})},t.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var o=this.graphModel.addEdge(n);o.virtual=!0,o.text.editable=!1,o.isFoldedEdge=!0},t.prototype.isInRange=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return o>=this.x-this.width/2&&i<=this.x+this.width/2&&r>=this.y-this.height/2&&a<=this.y+this.height/2},t.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}},t.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},t.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},t.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},t.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},t.prototype.getData=function(){var n=this,o=e.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},t.prototype.getHistoryData=function(){var n=e.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},t.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},t.prototype.toBack=function(){this.zIndex--},t})($te);(function(e){zI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getControlGroup=function(){var n=this.props.model,o=n.resizable,r=n.properties;return o&&!r.isFolded?e.prototype.getControlGroup.call(this):null},t.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}))},t.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])},t.prototype.getResizeShape=function(){return Lr("g",{},[this.getAddableShape(),e.prototype.getResizeShape.call(this),this.getFoldIcon()])},t})(Ute);var eR=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p_=function(){return p_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},p_.apply(this,arguments)};function Gte(e){var t=(function(o){eR(r,o);function r(i,a){i.id||(i.id="Flow_".concat(Pte()));var s=p_(p_(p_({},{}),i.properties),{isDefaultFlow:!1});return i.properties=s,o.call(this,i,a)||this}return r.extendKey="SequenceFlowModel",r})(F_),n=(function(o){eR(r,o);function r(){return o!==null&&o.apply(this,arguments)||this}return r.prototype.getStartArrow=function(){var i=this.props.model,a=i.properties.isDefaultFlow;return a?Lr("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):Lr("path",{d:""})},r.extendKey="SequenceFlowEdge",r})($_);return{type:"bpmn:sequenceFlow",view:n,model:t}}Gte();var tR={width:40,height:40},nR={width:40,height:40},rR={width:100,height:80},n1={width:100,height:80},oR={width:100,height:80},iR={width:100,height:80},aR={width:100,height:80},lR={width:100,height:80},sR={width:100,height:80},uR={width:100,height:80};function HI(e){return Object.prototype.toString.call(e)}function cR(e){return" ".repeat(e)}function r1(e){return HI(e)==="[object Object]"?Object.keys(e).reduce(function(t,n){var o=n;return n.charAt(0)==="-"&&(o=n.substring(1)),t[o]=r1(e[n]),t},{}):Array.isArray(e)?e.map(function(t){return r1(t)}):e}function o1(e){return e==null?"":e.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Wte(e){var t=e;try{typeof t!="string"&&(t=JSON.parse(e))}catch{t=JSON.stringify(r1(e)).replace(/"/g,"'")}return o1(String(t))}var dR=`
|
||
`;function J0(e,t,n){var o=cR(n),r="",i=dR+o;if(t==="-json")return"";if(t==="#text")return i+o1(String(e));if(t==="#cdata-section")return"".concat(i,"<![CDATA[").concat(e,"]]>");if(t==="#comment")return"".concat(i,"<!--").concat(e,"-->");if(e!==0&&e!==!1&&!e)return"".concat(i,"<").concat(t," />");if("".concat(t).charAt(0)==="-")return" ".concat(t.substring(1),'="').concat(Wte(e),'"');if(Array.isArray(e))r+=e.map(function(f){return J0(f,t,n+1)}).join("");else if(HI(e)==="[object Object]"){var a=Object.keys(e),s="",l=e["-json"]?dR+cR(n+1)+e["-json"]:"";r+="".concat(n===0?"":i,"<").concat(t),a.forEach(function(f){f.charAt(0)==="-"?s+=J0(e[f],f,n+1):l+=J0(e[f],f,n+1)}),r+=s+(l!==""?">".concat(l).concat(i,"</").concat(t,">"):" />")}else r+="".concat(i,"<").concat(t,">").concat(o1(String(e)),"</").concat(t,">");return r}function zte(e){var t="";for(var n in e)t+=J0(e[n],n,0);return t}var Ms=function(){};Ms.ObjTree=function(){return this};Ms.ObjTree.VERSION="0.23";Ms.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;Ms.ObjTree.prototype.attr_prefix="-";Ms.ObjTree.prototype.parseXML=function(e){var t;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(e,"application/xml");if(!o)return;t=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(e),t=n.documentElement);if(t){var r=this.parseDOM(t);return r}};Ms.ObjTree.prototype.parseHTTP=function(e,t,n){var o={};for(var r in t)o[r]=t[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=e;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(e,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(e){if(e){if(this.__force_array={},this.force_array)for(var t=0;t<this.force_array.length;t++)this.__force_array[this.force_array[t]]=1;var n=this.parseElement(e);if(this.__force_array[e.nodeName]&&(n=[n]),e.nodeType!==11){var o={};o[e.nodeName]=n,n=o}return n}};Ms.ObjTree.prototype.parseElement=function(e){if(e.nodeType!==7){if(e.nodeType===3||e.nodeType===4||e.nodeType===8){var t=e.nodeValue.match(/[^\x00-\x20]/);return t==null?void 0:e.nodeValue}var n=null,o={};if(e.attributes&&e.attributes.length){n={};for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r].nodeName;if(typeof i=="string"){var a=e.attributes[r].nodeValue;try{a=JSON.parse(e.attributes[r].nodeValue.replace(/'/g,'"'))}catch{a=e.attributes[r].nodeValue}a!=null&&(i=this.attr_prefix+i,typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(e.childNodes&&e.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r<e.childNodes.length&&s;r++){var l=e.childNodes[r].nodeType;l===3||l===4||l===8||(s=!1)}if(s){n||(n="");for(var r=0;r<e.childNodes.length;r++)n+=e.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<e.childNodes.length;r++){var i=e.childNodes[r].nodeName;if(typeof i=="string"){var a=this.parseElement(e.childNodes[r]);a&&(typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};Ms.ObjTree.prototype.addNode=function(e,t,n,o){this.__force_array[t]?(n===1&&(e[t]=[]),e[t][e[t].length]=o):n===1?e[t]=o:n===2?e[t]=[e[t],o]:e[t][e[t].length]=o};Ms.ObjTree.prototype.writeXML=function(e){var t=this.hash_to_xml(null,e);return this.xmlDecl+t};Ms.ObjTree.prototype.hash_to_xml=function(e,t){var n=[],o=[];for(var r in t)if(hw(t,r)){var i=t[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 e>"u"||e==null||(n.length>0?s.match(/\n/)?s="<".concat(e).concat(a,`>
|
||
`).concat(s,"</").concat(e,`>
|
||
`):s="<".concat(e).concat(a,">").concat(s,"</").concat(e,`>
|
||
`):s="<".concat(e).concat(a,` />
|
||
`)),s};Ms.ObjTree.prototype.array_to_xml=function(e,t){for(var n=[],o=0;o<t.length;o++){var r=t[o];typeof r>"u"||r==null?n[n.length]="<".concat(e," />"):typeof r=="object"&&r.constructor===Array?n[n.length]=this.array_to_xml(e,r):typeof r=="object"?n[n.length]=this.hash_to_xml(e,r):n[n.length]=this.scalar_to_xml(e,r)}return n.join("")};Ms.ObjTree.prototype.scalar_to_xml=function(e,t){return e==="#text"?this.xml_escape(t):"<".concat(e,">").concat(this.xml_escape(t),"</").concat(e,`>
|
||
`)};Ms.ObjTree.prototype.xml_escape=o1;var Hte=function(e){return new Ms.ObjTree().parseXML(e)},Xte=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h2=function(){return h2=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},h2.apply(this,arguments)},fR=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},RM=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zl=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xc=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},Os;(function(e){e.START="bpmn:startEvent",e.END="bpmn:endEvent",e.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",e.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",e.BOUNDARY="bpmn:boundaryEvent",e.PARALLEL_GATEWAY="bpmn:parallelGateway",e.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",e.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",e.USER="bpmn:userTask",e.SYSTEM="bpmn:serviceTask",e.FLOW="bpmn:sequenceFlow",e.SUBPROCESS="bpmn:subProcess"})(Os||(Os={}));var XI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],Yte=["properties","startPoint","endPoint","pointsList"],i1={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},YI=function(e,t){var n=Object.keys(t||{});return n.forEach(function(o){if(e[o]){var r=t[o],i=r.in,a=r.out;i&&(e[o].in=i),a&&(e[o].out=a)}else e[o]=t[o]}),e},Xu={"bpmn:startEvent":{out:function(e){var t,n,o=e.properties;return((n=(t=Xu[o.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:intermediateCatchEvent":{out:function(e){var t,n,o=e.properties;return((n=(t=Xu[o.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:intermediateThrowEvent":{out:function(e){var t,n,o=e.properties;return((n=(t=Xu[o.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:boundaryEvent":{out:function(e){var t,n,o=e.properties;return((n=(t=Xu[o.definitionType])===null||t===void 0?void 0:t.out)===null||n===void 0?void 0:n.call(t,e))||{}}},"bpmn:sequenceFlow":{out:function(e){var t=e.properties,n=t.expressionType,o=t.condition;return o?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(e){var t=e.properties,n=t.timerType,o=t.timerValue,r=t.definitionId,i=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(r,'"').concat(n&&o?">".concat(i(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(e,t){var n,o,r,i,a=e,s=t["-id"],l="",f="";try{for(var h=RM(Object.keys(t)),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=t[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(e,t){var n,o="",r="";return t["#cdata-section"]?(r="cdata",o=((n=/^\$\{(.*)\}$/g.exec(t["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):t["#text"]&&(r="normal",o=t["#text"]),{"-condition":o,"-expressionType":r}}}};function qte(e){var t=e??{},n=t.retainedAttrsFields,o=t.excludeFields,r=t.transformer,i=new Set(Xc(Xc([],Zl(Yte),!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(q){return q.id===V})||f.find(function(q){return q.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(e){var t,n,o={};try{for(var r=RM(Object.entries(e)),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){t={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o}function Kte(e,t,n){var o,r=new Map,i=qte(n)(t);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),e[f]||(e[f]=[]),e[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 t.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=e["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=e[w["-type"]])===null||S===void 0?void 0:S.findIndex(function($){return $["-id"]===w["-id"]});T>=0&&e[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;O<f.length;)b(O),O=E;delete s.children}),e[Os.FLOW]=a,e}function Zte(e,t){e["bpmndi:BPMNEdge"]=t.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}),e["bpmndi:BPMNShape"]=t.nodes.map(function(n){var o,r=n.id,i=100,a=80,s=n.x,l=n.y,f=qs.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})}var Jte=["bpmn:incoming","bpmn:outgoing"];function Qte(e,t){var n=[],o=[],r=new Map,i=t??{},a=i.transformer,s=i.excludeFields,l={in:new Set(Xc(Xc([],Zl(i1.in),!1),Zl((s==null?void 0:s.in)||[]),!1)),out:new Set(Xc(Xc([],Zl(i1.out),!1),Zl((s==null?void 0:s.out)||[]),!1))};Xu=YI(Xu,a);var f=e["bpmn:definitions"];if(f){var h=f["bpmn:process"];(function(b,E){E.forEach(function(O){try{Object.keys(b).forEach(function(w){try{O(w)}catch(S){console.error(S)}})}catch(w){console.error(w)}})})(h,[function(b){function E(w){w["-children"]||(w["-children"]=[]),Object.keys(w).forEach(function(S){var M;S.indexOf("bpmn:")===0&&!Jte.includes(S)&&(h[S]||(h[S]=[]),!Array.isArray(h[S])&&(h[S]=[h[S]]),Array.isArray(w[S])?(M=h[S]).push.apply(M,Xc([],Zl(w[S]),!1)):h[S].push(w[S]),Array.isArray(w[S])?w[S].forEach(function(T){!S.includes("Flow")&&w["-children"].push(T["-id"])}):!S.includes("Flow")&&w["-children"].push(w[S]["-id"]),delete w[S])})}if(b==="bpmn:subProcess"){var O=h[b];Array.isArray(O)?O.forEach(function(w){b==="bpmn:subProcess"&&E(w)}):E(O)}},function(b){var E=function(w){Object.keys(w).forEach(function(S){var M,T;if(S.includes("bpmn:")){var $={};Xu[S]&&Xu[S].in?($=(T=(M=Xu[S]).in)===null||T===void 0?void 0:T.call(M,S,ge.cloneDeep(w[S])),delete w[S]):O(w[S]);var D=void 0;(D=Reflect.ownKeys($)).length>0&&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=tne(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(ene(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=t==null?void 0:t.mapping)===null||E===void 0)&&E.in){var w=(O=t==null?void 0:t.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=t==null?void 0:t.mapping)===null||E===void 0)&&E.in){var w=(O=t==null?void 0:t.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 ene(e,t,n){var o=[];if(Array.isArray(e))e.forEach(function(a){var s;Array.isArray(t)?s=t.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=t;var l=pR(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(t)?r=t.find(function(a){return a["-bpmnElement"]===e["-id"]}):r=t;var i=pR(r,n,e);o.push(i)}return o}function pR(e,t,n){var o=Number(e["dc:Bounds"]["-x"]),r=Number(e["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=qs.shapeConfigMap.get(t);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},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var h=e["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:e["-bpmnElement"],type:t,x:o,y:r,properties:l};return i&&(v.children=i),f&&(v.text=f),v}function tne(e,t){var n=[];if(Array.isArray(e))e.forEach(function(r){var i;Array.isArray(t)?i=t.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=t,n.push(hR(i,r))});else{var o=void 0;Array.isArray(t)?o=t.find(function(r){return r["-bpmnElement"]===e["-id"]}):o=t,n.push(hR(o,e))}return n}function hR(e,t){var n,o=t["-name"]?"".concat(t["-name"]):"";if(o){var r=e["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split(`
|
||
`).forEach(function(f){i<f.length&&(i=f.length)}),n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7}}var a={};Object.entries(t).forEach(function(f){var h=Zl(f,2),v=h[0],b=h[1];XI.includes(v)||(a[v]=b)}),a=a1(a);var s=e["di:waypoint"].map(function(f){return{x:Number(f["-x"]),y:Number(f["-y"])}}),l={id:t["-id"],type:Os.FLOW,pointsList:s,sourceNodeId:t["-sourceRef"],targetNodeId:t["-targetRef"],properties:a};return n&&(l.text=n),l}var qs=(function(){function e(t){var n=t.lf,o=this;this.adapterOut=function(r,i){var a,s,l=h2({},o.processAttributes);Kte(l,r,i);var f={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};Zte(f,r);var h=o.definitionAttributes;h["bpmn:process"]=l,h["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":f};var v={"bpmn:definitions":h};if(!((a=i==null?void 0:i.mapping)===null||a===void 0)&&a.out){var b=(s=i==null?void 0:i.mapping)===null||s===void 0?void 0:s.out,E=function(O){Array.isArray(O)&&O.forEach(function(w){return E(w)}),typeof O=="object"&&Object.keys(O).forEach(function(w){var S;(S=b[w])?(O[S]=ge.cloneDeep(O[w]),delete O[w],E(O[S])):E(O[w])})};E(v)}return v},this.adapterIn=function(r,i){if(r)return Qte(r,i)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return e.prototype.setCustomShape=function(t,n){e.shapeConfigMap.set(t,n)},e.pluginName="bpmn-adapter",e.shapeConfigMap=new Map,e})();qs.shapeConfigMap.set(Os.START,{width:tR.width,height:tR.height});qs.shapeConfigMap.set(Os.END,{width:nR.width,height:nR.height});qs.shapeConfigMap.set(Os.INTERMEDIATE_CATCH,{width:n1.width,height:n1.height});qs.shapeConfigMap.set(Os.INTERMEDIATE_THROW,{width:n1.width,height:n1.height});qs.shapeConfigMap.set(Os.BOUNDARY,{width:rR.width,height:rR.height});qs.shapeConfigMap.set(Os.PARALLEL_GATEWAY,{width:oR.width,height:oR.height});qs.shapeConfigMap.set(Os.INCLUSIVE_GATEWAY,{width:iR.width,height:iR.height});qs.shapeConfigMap.set(Os.EXCLUSIVE_GATEWAY,{width:aR.width,height:aR.height});qs.shapeConfigMap.set(Os.SYSTEM,{width:lR.width,height:lR.height});qs.shapeConfigMap.set(Os.USER,{width:sR.width,height:sR.height});qs.shapeConfigMap.set(Os.SUBPROCESS,{width:uR.width,height:uR.height});(function(e){Xte(t,e);function t(n){var o=e.call(this,n)||this;o.adapterXmlIn=function(a){var s=Hte(a);return o.adapterIn(s,o.props)},o.adapterXmlOut=function(a){var s=o.adapterOut(a,o.props);return zte(s)};var r=n.lf,i=n.props;return r.adapterIn=o.adapterXmlIn,r.adapterOut=o.adapterXmlOut,o.props=i,o}return t.pluginName="BPMNAdapter",t})(qs);function nne(e,t,n){var o=t.x,r=t.y,i=e.x,a=e.y,s=i-o,l=a-r,f=s*Math.cos(n)-l*Math.sin(n),h=s*Math.sin(n)+l*Math.cos(n),v=f+o,b=h+r;return{x:v,y:b}}var rne=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l1=function(){return l1=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},l1.apply(this,arguments)},one=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ine=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))};(function(e){rne(t,e);function t(){var n=e.apply(this,ine([],one(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(o){var r=o.model,i=n.props,a=i.model,s=i.graphModel,l=a.transformWithContainer,f=a.isRestrict,h=n.childrenPositionMap;if(!(!l||f)&&r.id===a.id){var v={x:a.x,y:a.y};ri(Array.from(a.children),function(b){var E=s.getNodeModelById(b);if(E){var O={x:E.x,y:E.y};h.has(E.id)?O=h.get(E.id):h.set(E.id,O);var w=r.rotate*(180/Math.PI);w<0&&(w+=360);var S=w*(Math.PI/180),M=nne(O,v,S);E.moveTo(M.x,M.y),E.rotate=r.rotate}})}},n.onNodeResize=function(o){var r=o.deltaX,i=o.deltaY,a=o.index,s=o.model,l=o.preData,f=n.props,h=f.model,v=f.graphModel,b=h.transformWithContainer,E=h.isRestrict;if(!(!b||E)&&s.id===h.id){var O=l.properties,w=O||{},S=w.width,M=w.height;ri(Array.from(h.children),function(T){var $=v.getNodeModelById(T);if($){var D=$.width/S*r,P=$.height/M*i;OI({deltaX:D,deltaY:P,index:a,nodeModel:$,graphModel:v,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var o=n.props.model;o.isCollapsed&&o.toggleCollapse(!0)},n}return t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},t.prototype.getNodesInGroup=function(n,o){var r=this,i=[];return n.isGroup&&ri(Array.from(n.children),function(a){i.push(a);var s=o.getNodeModelById(a);s!=null&&s.isGroup&&(i=i.concat(r.getNodesInGroup(s,o)))}),i},t.prototype.getResizeControl=function(){var n=this.props.model,o=n.resizable,r=n.isCollapsed,i=o&&!r;return i?e.prototype.getResizeControl.call(this):null},t.prototype.getAppendAreaShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,s=n.radius,l=n.groupAddable;if(!l)return null;var f=n.getNodeStyle().strokeWidth,h=f===void 0?0:f,v=n.getAddableOutlineStyle(),b=o+h+8,E=r+h+8;return Lr("rect",l1(l1({},v),{width:b,height:E,x:i-b/2,y:a-E/2,rx:s,ry:s}))},t.prototype.getCollapseIcon=function(n,o){return"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," M").concat(n+7,",").concat(o+2," ").concat(n+7,",").concat(o+10)},t.prototype.getExpandIcon=function(n,o){return"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," ")},t.prototype.getOperateIcon=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=o-i/2+10,l=r-a/2+10;if(!n.collapsible)return null;var f=n!=null&&n.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),h=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:f});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),h])},t.prototype.getShape=function(){return Lr("g",{},[this.getAppendAreaShape(),e.prototype.getShape.call(this),this.getOperateIcon()])},t})(Zv);var ane=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s1=function(){return s1=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s1.apply(this,arguments)},hS=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},lg=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},By=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},lne=400,sne=230,une=80,cne=60,dne=-1e4;(function(e){ane(t,e);function t(n,o){var r=e.call(this,n,o)||this;return r.isGroup=!0,r.isRestrict=!1,r.autoResize=!1,r.collapsible=!0,r.isCollapsed=!1,r.groupAddable=!1,r.transformWithContainer=!1,r.childrenLastCollapseStateDict=new Map,r.childrenLastCollapseStateDict=new Map,r.initNodeData(n),r.setAttributes(),r}return t.prototype.initNodeData=function(n){var o;e.prototype.initNodeData.call(this,n);var r=(o=n.properties)!==null&&o!==void 0?o:{},i=r.children,a=r.width,s=r.height,l=r.collapsedWidth,f=r.collapsedHeight,h=r.collapsible,v=r.isCollapsed,b=r.zIndex,E=r.isRestrict,O=r.autoResize,w=r.autoToFront,S=r.transformWithContainer;this.children=i?new Set(i):new Set,this.zIndex=b??dne,this.isCollapsed=v??!1,this.setProperties({isCollapsed:v??!1});var M=a??lne,T=s??sne;this.width=M,this.height=T,this.expandWidth=M,this.expandHeight=T,this.collapsedWidth=l??une,this.collapsedHeight=f??cne,this.isRestrict=E??!1,this.transformWithContainer=S??!1,this.autoResize=O??!1,this.collapsible=h??!0,this.autoToFront=w??!1,this.text.editable=!1,this.text.draggable=!1},t.prototype.setAttributes=function(){e.prototype.setAttributes.call(this)},t.prototype.getData=function(){var n=this,o=e.prototype.getData.call(this),r=[];return ri(Array.from(this.children),function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&r.push(i)}),o.children=r,o.properties&&(o.properties.children=r,o.properties.isCollapsed=this.isCollapsed),o},t.prototype.getNodesInGroup=function(n){var o=[];return n.isGroup&&ri(Array.from(n.children),function(r){o.push(r)}),o},t.prototype.getMoveDistance=function(n,o,r){r===void 0&&(r=!1);var i=lg(e.prototype.getMoveDistance.call(this,n,o,r),2),a=i[0],s=i[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,n,o,r),[a,s]},t.prototype.getHistoryData=function(){var n=e.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var o=this,r=o.x,i=o.y,a=o.collapsedWidth,s=o.collapsedHeight,l=o.expandWidth,f=o.expandHeight,h=o.isCollapsed;return h&&(n.x=r+l/2-a/2,n.y=i+f/2-s/2,n.text&&(n.text.x=n.text.x+l/2-a/2,n.text.y=n.text.y+f/2-s/2)),n},t.prototype.toggleCollapse=function(n){var o=this,r=this.graphModel,i=!!n;this.isCollapsed=i,this.setProperties({isCollapsed:i}),r.eventCenter.emit("dynamicGroup:collapse",{collapse:i,nodeModel:this}),i?this.collapse():this.expand();var a=By(By([],lg(this.incoming.edges),!1),lg(this.outgoing.edges),!1),s=Array.from(this.children);ri(s,function(l){var f,h,v=o.graphModel.elementsModelMap.get(l);if(v){var b=v.isCollapsed;if(v.isGroup){var E=v;if(E.isCollapsed||E.toggleCollapse(n),!n){var O=(f=o.childrenLastCollapseStateDict)===null||f===void 0?void 0:f.get(l);O!==void 0&&O!==v.isCollapsed&&E.toggleCollapse(O)}}if((h=o.childrenLastCollapseStateDict)===null||h===void 0||h.set(l,!!b),v.visible=!n,v.BaseType===da.NODE){var w=v.incoming.edges,S=v.outgoing.edges;a=By(By(By([],lg(a),!1),lg(w),!1),lg(S),!1)}}}),this.collapseEdge(i,a)},t.prototype.collapse=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.width,s=n.height,l=n.collapsedWidth,f=n.collapsedHeight;this.x=o-a/2+l/2,this.y=r-s/2+f/2,this.text.x=i.x-a/2+l/2,this.text.y=i.y-s/2+f/2,this.expandWidth=a,this.expandHeight=s,this.width=l,this.height=f},t.prototype.expand=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.expandWidth,s=n.expandHeight,l=n.collapsedWidth,f=n.collapsedHeight;this.width=a,this.height=s,this.x=o+this.width/2-l/2,this.y=r+this.height/2-f/2,this.text.x=i.x+this.width/2-l/2,this.text.y=i.y+this.height/2-f/2},t.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var o=this.graphModel.addEdge(n);o.virtual=!0,o.text.editable=!1,o.isCollapsedEdge=!0},t.prototype.collapseEdge=function(n,o){var r=this,i=this.graphModel;ri(o,function(a,s){var l,f=a.getData(),h=f.targetNodeId,v=f.sourceNodeId,b=s1(s1({},f),{id:"".concat(f.id,"__").concat(s),text:(l=f.text)===null||l===void 0?void 0:l.value});a.virtual&&i.deleteEdgeById(a.id);var E=i.dynamicGroup.getGroupByNodeId(h);E||(E=i.getNodeModelById(h));var O=i.dynamicGroup.getGroupByNodeId(v);O||(O=i.getNodeModelById(v)),n&&a.visible&&(r.children.has(v)||r.id===v?(b.startPoint=void 0,b.sourceNodeId=r.id):(b.endPoint=void 0,b.targetNodeId=r.id),(E.id!==r.id||O.id!==r.id)&&r.createVirtualEdge(b),a.visible=!1),!n&&!a.visible&&(E&&E.isGroup&&E.isCollapsed?(b.targetNodeId=E.id,b.endPoint=void 0,r.createVirtualEdge(b)):O&&O.isGroup&&O.isCollapsed?(b.sourceNodeId=O.id,b.startPoint=void 0,r.createVirtualEdge(b)):a.visible=!0)})},t.prototype.isAllowAppendIn=function(n){return!0},t.prototype.setAllowAppendChild=function(n){this.groupAddable=n},t.prototype.addChild=function(n){this.children.add(n);var o=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:o,childId:n})},t.prototype.removeChild=function(n){this.children.delete(n);var o=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:o})},t.prototype.toBack=function(){this.zIndex--},t.prototype.getResizeOutlineStyle=function(){var n=e.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},t.prototype.getAnchorStyle=function(){var n=e.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},t.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},hS([Ut],t.prototype,"isCollapsed",void 0),hS([Ut],t.prototype,"groupAddable",void 0),hS([Ut],t.prototype,"transformWithContainer",void 0),t})(Hg);var vR;(function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"})(vR||(vR={}));var fne=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h_=function(){return h_=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},h_.apply(this,arguments)},pne=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},hne=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},vne=(function(e){fne(t,e);function t(n){var o=e.call(this,n)||this;o.textRef=G1(),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=hne(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(Go.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 t.prototype.setElementModelLabelInfo=function(n){var o=this.props,r=o.label,i=o.element,a=o.graphModel,s=i.properties._label,l=s,f=Gj(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)},t.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(Go.DEFAULT)}((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},t.prototype.componentDidUpdate=function(){},t.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},t.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}})})},t=pne([xs],t),t})(ko),Vu=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},mne=wh,gne=(function(){function e(t,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=t.id)!==null&&r!==void 0?r:mne(),this.initLabelData(t)}return e.prototype.initLabelData=function(t){Xo(this,t)},e.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],e.prototype,"x",void 0),Vu([Ut],e.prototype,"y",void 0),Vu([Ut],e.prototype,"content",void 0),Vu([Ut],e.prototype,"value",void 0),Vu([Ut],e.prototype,"rotate",void 0),Vu([Ut],e.prototype,"style",void 0),Vu([Ut],e.prototype,"zIndex",void 0),Vu([Ut],e.prototype,"vertical",void 0),Vu([Ut],e.prototype,"editable",void 0),Vu([Ut],e.prototype,"draggable",void 0),Vu([Ut],e.prototype,"labelWidth",void 0),Vu([Ut],e.prototype,"textOverflowMode",void 0),e})(),Q0={exports:{}},vS=Q0.exports,mR;function yne(){return mR||(mR=1,(function(e){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(t){if("Element"in t){var n="classList",o="prototype",r=t.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;w<S;w++)if(w in this&&this[w]===O)return w;return-1},l=function(O,w){this.name=O,this.code=DOMException[O],this.message=w},f=function(O,w){if(w==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(w))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(O,w)},h=function(O){for(var w=a.call(O.getAttribute("class")||""),S=w?w.split(/\s+/):[],M=0,T=S.length;M<T;M++)this.push(S[M]);this._updateClassName=function(){O.setAttribute("class",this.toString())}},v=h[o]=[],b=function(){return new h(this)};if(l[o]=Error[o],v.item=function(O){return this[O]||null},v.contains=function(O){return O+="",f(this,O)!==-1},v.add=function(){var O=arguments,w=0,S=O.length,M,T=!1;do M=O[w]+"",f(this,M)===-1&&(this.push(M),T=!0);while(++w<S);T&&this._updateClassName()},v.remove=function(){var O=arguments,w=0,S=O.length,M,T=!1,$;do for(M=O[w]+"",$=f(this,M);$!==-1;)this.splice($,1),T=!0,$=f(this,M);while(++w<S);T&&this._updateClassName()},v.toggle=function(O,w){O+="";var S=this.contains(O),M=S?w!==!0&&"remove":w!==!1&&"add";return M&&this[M](O),w===!0||w===!1?w:!S},v.toString=function(){return this.join(" ")},i.defineProperty){var E={get:b,enumerable:!0,configurable:!0};try{i.defineProperty(r,n,E)}catch(O){O.number===-2146823252&&(E.enumerable=!1,i.defineProperty(r,n,E))}}else i[o].__defineGetter__&&r.__defineGetter__(n,b)}})(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(t){if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{new Blob;return}catch{}var n=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||(function(r){var i=function(F){return Object.prototype.toString.call(F).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(I,V,z){this.data=I,this.size=I.length,this.type=V,this.encoding=z},l=a.prototype,f=s.prototype,h=r.FileReaderSync,v=function(F){this.code=this[this.name=F]},b="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),E=b.length,O=r.URL||r.webkitURL||r,w=O.createObjectURL,S=O.revokeObjectURL,M=O,T=r.btoa,$=r.atob,D=r.ArrayBuffer,P=r.Uint8Array,B=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=f.fake=!0;E--;)v.prototype[b[E]]=E+1;return O.createObjectURL||(M=r.URL=function(F){var I=document.createElementNS("http://www.w3.org/1999/xhtml","a"),V;return I.href=F,"origin"in I||(I.protocol.toLowerCase()==="data:"?I.origin=null:(V=F.match(B),I.origin=V&&V[1])),I}),M.createObjectURL=function(F){var I=F.type,V;if(I===null&&(I="application/octet-stream"),F instanceof s)return V="data:"+I,F.encoding==="base64"?V+";base64,"+F.data:F.encoding==="URI"?V+","+decodeURIComponent(F.data):T?V+";base64,"+T(F.data):V+","+encodeURIComponent(F.data);if(w)return w.call(O,F)},M.revokeObjectURL=function(F){F.substring(0,5)!=="data:"&&S&&S.call(O,F)},l.append=function(F){var I=this.data;if(P&&(F instanceof D||F instanceof P)){for(var V="",z=new P(F),q=0,X=z.length;q<X;q++)V+=String.fromCharCode(z[q]);I.push(V)}else if(i(F)==="Blob"||i(F)==="File")if(h){var G=new h;I.push(G.readAsBinaryString(F))}else throw new v("NOT_READABLE_ERR");else F instanceof s?F.encoding==="base64"&&$?I.push($(F.data)):F.encoding==="URI"?I.push(decodeURIComponent(F.data)):F.encoding==="raw"&&I.push(F.data):(typeof F!="string"&&(F+=""),I.push(unescape(encodeURIComponent(F))))},l.getBlob=function(F){return arguments.length||(F=null),new s(this.data.join(""),F,"raw")},l.toString=function(){return"[object BlobBuilder]"},f.slice=function(F,I,V){var z=arguments.length;return z<3&&(V=null),new s(this.data.slice(F,z>1?I:this.data.length),V,this.encoding)},f.toString=function(){return"[object Blob]"},f.close=function(){this.size=0,delete this.data},a})(t);t.Blob=function(r,i){var a=i&&i.type||"",s=new n;if(r)for(var l=0,f=r.length;l<f;l++)Uint8Array&&r[l]instanceof Uint8Array?s.append(r[l].buffer):s.append(r[l]);var h=s.getBlob(a);return!h.slice&&h.webkitSlice&&(h.slice=h.webkitSlice),h};var o=Object.getPrototypeOf||function(r){return r.__proto__};t.Blob.prototype=o(new t.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||vS.content||vS),(function(t,n){var o=typeof process<"u"&&process&&process.versions&&process.versions.electron;o?t.MediumEditor=n:e.exports=n})(vS,(function(){function t(n,o){return this.init(n,o)}return t.extensions={},(function(n){function o(l,f){var h,v=Array.prototype.slice.call(arguments,2);f=f||{};for(var b=0;b<v.length;b++){var E=v[b];if(E)for(h in E)E.hasOwnProperty(h)&&typeof E[h]<"u"&&(l||f.hasOwnProperty(h)===!1)&&(f[h]=E[h])}return f}var r=!1;try{var i=document.createElement("div"),a=document.createTextNode(" ");i.appendChild(a),r=i.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-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.start<E+w.nodeValue.length&&(O=!0,S=s.splitStartNodeIfNeeded(w,h.start,E)),O&&s.splitEndNodeIfNeeded(w,S,h.end,E),O&&E===h.end)break;if(O&&E>h.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=t.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(h).length===0)return[l];for(var v=0;v<l.childNodes.length;v++){var b=l.childNodes[v];if(b.nodeType===3)f.push(b);else if(b.nodeType===1){var E=b.querySelectorAll(h);E.length===0?f.push(b):f=f.concat(t.util.splitByBlockElements(b))}}return f},findAdjacentTextNodeWithContent:function(f,h,v){var b=!1,E,O=v.createNodeIterator(f,NodeFilter.SHOW_TEXT,null,!1);for(E=O.nextNode();E;){if(E===h)b=!0;else if(b&&E.nodeType===3&&E.nodeValue&&E.nodeValue.trim().length>0)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,">").replace(/"/g,""")},insertHTMLCommand:function(l,f){var h,v,b,E,O,w,S,M=!1,T=["insertHTML",!1,f];if(!t.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),t.selection.selectRange(l,v)),M=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(T,M),M},execFormatBlock:function(l,f){var h=s.getTopBlockContainer(t.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==="<p>")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;h<l.length;h+=1)(v===!1||v===l[h].attributes.href.value)&&(l[h].target="_blank",l[h].rel="noopener noreferrer")},removeTargetBlank:function(l,f){var h;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),h=0;h<l.length;h+=1)f===l[h].attributes.href.value&&(l[h].removeAttribute("target"),l[h].removeAttribute("rel"))},addClassToAnchors:function(l,f){var h=f.split(" "),v,b;if(l.nodeName.toLowerCase()==="a")for(b=0;b<h.length;b+=1)l.classList.add(h[b]);else{var E=l.getElementsByTagName("a");if(E.length===0){var O=s.getClosestTag(l,"a");l=O?[O]:[]}else l=E;for(v=0;v<l.length;v+=1)for(b=0;b<h.length;b+=1)l[v].classList.add(h[b])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var f=l.parentNode,h=f.nodeName.toLowerCase();h==="li"||!s.isBlockContainer(f)&&h!=="div";){if(h==="li")return!0;if(f=f.parentNode,f)h=f.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,f){if(f.nodeName.toLowerCase()==="li"){var h=f.parentElement;h.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(h.parentElement,l),t.selection.moveCursor(l,f.firstChild,f.firstChild.textContent.length))}},splitOffDOMTree:function(l,f,h){for(var v=f,b=null,E=!h;v!==l;){var O=v.parentNode,w=O.cloneNode(!1),S=E?v:O.firstChild,M;for(b&&(E?w.appendChild(b):M=b),b=w;S;){var T=S.nextSibling;S===v?(S.hasChildNodes()?S=S.cloneNode(!1):S.parentNode.removeChild(S),S.textContent&&b.appendChild(S),S=E?T:null):(S.parentNode.removeChild(S),(S.hasChildNodes()||S.textContent)&&b.appendChild(S),S=T)}M&&b.appendChild(M),v=O}return b},moveTextRangeIntoElement:function(l,f,h){if(!l||!f)return!1;var v=s.findCommonRoot(l,f);if(!v)return!1;if(f===l){var b=l.parentNode,E=l.nextSibling;return b.removeChild(l),h.appendChild(l),E?b.insertBefore(h,E):b.appendChild(h),h.hasChildNodes()}for(var O=[],w,S,M,T=0;T<v.childNodes.length;T++)if(M=v.childNodes[T],!w)s.isDescendant(M,l,!0)&&(w=M);else if(s.isDescendant(M,f,!0)){S=M;break}else O.push(M);var $=S.nextSibling,D=v.ownerDocument.createDocumentFragment();return w===l?(w.parentNode.removeChild(w),D.appendChild(w)):D.appendChild(s.splitOffDOMTree(w,l)),O.forEach(function(P){P.parentNode.removeChild(P),D.appendChild(P)}),S===f?(S.parentNode.removeChild(S),D.appendChild(S)):D.appendChild(s.splitOffDOMTree(S,f,!0)),h.appendChild(D),S.parentNode===v?v.insertBefore(h,S):$?v.insertBefore(h,$):v.appendChild(h),h.hasChildNodes()},depthOfNode:function(l){for(var f=0,h=l;h.parentNode!==null;)h=h.parentNode,f++;return f},findCommonRoot:function(l,f){for(var h=s.depthOfNode(l),v=s.depthOfNode(f),b=l,E=f;h!==v;)h>v?(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;f<l.childNodes.length;f++){var h=s._getFirstTextNode(l.childNodes[f]);if(h!==null)return h}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(l,f,h){var v=l+" is deprecated, please use "+f+" instead.";h&&(v+=" Will be removed in "+h),s.warn(v)},deprecatedMethod:function(l,f,h,v){s.deprecated(l,f,v),typeof this[f]=="function"&&this[f].apply(this,h)},cleanupAttrs:function(l,f){f.forEach(function(h){l.removeAttribute(h)})},cleanupTags:function(l,f){f.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,f){f.indexOf(l.nodeName.toLowerCase())!==-1&&t.util.unwrap(l,document)},getClosestTag:function(l,f){return s.traverseUp(l,function(h){return h.nodeName.toLowerCase()===f.toLowerCase()})},unwrap:function(l,f){for(var h=f.createDocumentFragment(),v=Array.prototype.slice.call(l.childNodes),b=0;b<v.length;b++)h.appendChild(v[b]);h.childNodes.length?l.parentNode.replaceChild(h,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};t.util=s})(window),(function(){var n=function(o){t.util.extend(this,o)};n.extend=function(o){var r=this,i;o&&o.hasOwnProperty("constructor")?i=o.constructor:i=function(){return r.apply(this,arguments)},t.util.extend(i,r);var a=function(){this.constructor=i};return a.prototype=r.prototype,i.prototype=new a,o&&t.util.extend(i.prototype,o),i},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(o){return this.base.options[o]}},["execAction","on","off","subscribe","trigger"].forEach(function(o){n.prototype[o]=function(){return this.base[o].apply(this.base,arguments)}}),t.Extension=n})(),(function(){function n(r){return t.util.isBlockContainer(r)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var o={findMatchingSelectionParent:function(r,i){var a=i.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,t.util.traverseUp(l,r))},getSelectionElement:function(r){return this.findMatchingSelectionParent(function(i){return t.util.isMediumEditorElement(i)},r)},exportSelection:function(r,i){if(!r)return null;var a=null,s=i.getSelection();if(s.rangeCount>0){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<S?(l.setStart(f,r.start-v),b=!0):T=f),b&&r.end>=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&&t.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&&h<l.parentNode.childNodes.length;h++)l.parentNode.childNodes[h]===l&&(f=h);i.setStart(l.parentNode,f+1),i.collapse(!0)}}return i},importSelectionMoveCursorPastBlocks:function(r,i,a,s){var l=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),f=s.startContainer,h,v,b=0;for(a=a||1,f.nodeType===3&&t.util.isBlockContainer(f.previousSibling)?h=f.previousSibling:h=t.util.getClosestBlockContainer(f);l.nextNode();)if(!v)h===l.currentNode&&(v=l.currentNode);else if(v=l.currentNode,b++,b===a||v.textContent.length>0)break;return v||(v=h),s.setStart(t.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(!t.util.isElementAtBeginningOfBlock(l))return-1;var f=t.util.findPreviousSibling(l);if(f){if(f.nodeValue)return-1}else return-1}for(var h=t.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<f;a+=1)h.appendChild(l.getRangeAt(a).cloneContents());s=h.innerHTML}return s},getCaretOffsets:function(i,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(i),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(i),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(r){var i=r.startContainer;return i===r.endContainer&&i.hasChildNodes()&&r.endOffset===r.startOffset+1},getSelectedParentElement:function(r){return r?this.rangeSelectsSingleNode(r)&&r.startContainer.childNodes[r.startOffset].nodeType!==3?r.startContainer.childNodes[r.startOffset]:r.startContainer.nodeType===3?r.startContainer.parentNode:r.startContainer:null},getSelectedElements:function(r){var i=r.getSelection(),a,s,l;if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(a=i.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(f){return typeof i.containsNode=="function"?i.containsNode(f,!0):!0})},selectNode:function(r,i){var a=i.createRange();a.selectNodeContents(r),this.selectRange(i,a)},select:function(r,i,a,s,l){var f=r.createRange();return f.setStart(i,a),s?f.setEnd(s,l):f.collapse(!0),this.selectRange(r,f),f},clearSelection:function(r,i){i?r.getSelection().collapseToStart():r.getSelection().collapseToEnd()},moveCursor:function(r,i,a){this.select(r,i,a)},getSelectionRange:function(r){var i=r.getSelection();return i.rangeCount===0?null:i.getRangeAt(0)},selectRange:function(r,i){var a=r.getSelection();a.removeAllRanges(),a.addRange(i)},getSelectionStart:function(r){var i=r.getSelection().anchorNode,a=i&&i.nodeType===3?i.parentNode:i;return a}};t.selection=o})(),(function(){function n(r,i){return r?r.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return t.util.isDescendant(l,i,!0)})):!1}):!1}var o=function(r){this.base=r,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};o.prototype={InputEventOnContenteditableSupported:!t.util.isIE&&!t.util.isEdge,attachDOMEvent:function(r,i,a,s){var l=this.base.options.contentWindow,f=this.base.options.ownerDocument;r=t.util.isElement(r)||[l,f].indexOf(r)>-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=t.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;l<f;l=l+1)if(h=this.events[l],h[0]===r&&h[1]===i&&h[2]===a&&h[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var r=this.events.pop();r;)r[0].removeEventListener(r[1],r[2],r[3]),r=this.events.pop()},detachAllEventsFromElement:function(r){for(var i=this.events.filter(function(f){return f&&f[0].getAttribute&&f[0].getAttribute("medium-editor-index")===r.getAttribute("medium-editor-index")}),a=0,s=i.length;a<s;a++){var l=i[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(r){this.listeners.editableInput&&(this.contentCache[r.getAttribute("medium-editor-index")]=r.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(i){this.attachDOMEvent(r,i.name,i.handler.bind(this))},this)},enableCustomEvent:function(r){this.disabledEvents[r]!==void 0&&delete this.disabledEvents[r]},disableCustomEvent:function(r){this.disabledEvents[r]=!0},attachCustomEvent:function(r,i){this.setupListener(r),this.customEvents[r]||(this.customEvents[r]=[]),this.customEvents[r].push(i)},detachCustomEvent:function(r,i){var a=this.indexOfCustomListener(r,i);a!==-1&&this.customEvents[r].splice(a,1)},indexOfCustomListener:function(r,i){return!this.customEvents[r]||!this.customEvents[r].length?-1:this.customEvents[r].indexOf(i)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(r,i,a){this.customEvents[r]&&!this.disabledEvents[r]&&this.customEvents[r].forEach(function(s){s(i,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(r){r.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(r){this.handleDocumentExecCommand(r)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var r=this.options.ownerDocument;if(!(!this.execCommandListener||!r.execCommand.listeners)){var i=r.execCommand.listeners.indexOf(this.execCommandListener);i!==-1&&r.execCommand.listeners.splice(i,1),r.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var r=this.options.ownerDocument;if(!r.execCommand.listeners){var i=function(s,l){r.execCommand.listeners&&r.execCommand.listeners.forEach(function(f){f({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=r.execCommand.orig.apply(this,arguments);if(!r.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return i(l,s),s};a.orig=r.execCommand,a.listeners=[],a.callListeners=i,r.execCommand=a}},unwrapExecCommand:function(){var r=this.options.ownerDocument;r.execCommand.orig&&(r.execCommand=r.execCommand.orig)},setupListener:function(r){if(!this.listeners[r]){switch(r){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(i){this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[r]=!0}},attachToEachElement:function(r,i){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,r,i.bind(this))},this),this.eventsCache.push({name:r,handler:i})},cleanupElement:function(r){var i=r.getAttribute("medium-editor-index");i&&(this.detachAllEventsFromElement(r),this.contentCache&&delete this.contentCache[i])},focusElement:function(r){r.focus(),this.updateFocus(r,{target:r,type:"focus"})},updateFocus:function(r,i){var a=this.base.getFocusedElement(),s;a&&i.type==="click"&&this.lastMousedownTarget&&(t.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(f){return!s&&t.util.isDescendant(f,r,!0)&&(s=f),!!s},this);var l=!t.util.isDescendant(a,r,!0)&&!n(this.base.extensions,r);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",i,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",i,s))),l&&this.triggerCustomEvent("externalInteraction",i)},updateInput:function(r,i){if(this.contentCache){var a=r.getAttribute("medium-editor-index"),s=r.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",i,r),this.contentCache[a]=s}},handleDocumentSelectionChange:function(r){if(r.currentTarget&&r.currentTarget.activeElement){var i=r.currentTarget.activeElement,a;this.base.elements.some(function(s){return t.util.isDescendant(s,i,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:i,currentTarget:a})}},handleDocumentExecCommand:function(){var r=this.base.getFocusedElement();r&&this.updateInput(r,{target:r,currentTarget:r})},handleBodyClick:function(r){this.updateFocus(r.target,r)},handleBodyFocus:function(r){this.updateFocus(r.target,r)},handleBodyMousedown:function(r){this.lastMousedownTarget=r.target},handleInput:function(r){this.updateInput(r.currentTarget,r)},handleClick:function(r){this.triggerCustomEvent("editableClick",r,r.currentTarget)},handleBlur:function(r){this.triggerCustomEvent("editableBlur",r,r.currentTarget)},handleKeypress:function(r){if(this.triggerCustomEvent("editableKeypress",r,r.currentTarget),this.keypressUpdateInput){var i={target:r.target,currentTarget:r.currentTarget};setTimeout((function(){this.updateInput(i.currentTarget,i)}).bind(this),0)}},handleKeyup:function(r){this.triggerCustomEvent("editableKeyup",r,r.currentTarget)},handleMouseover:function(r){this.triggerCustomEvent("editableMouseover",r,r.currentTarget)},handleDragging:function(r){this.triggerCustomEvent("editableDrag",r,r.currentTarget)},handleDrop:function(r){this.triggerCustomEvent("editableDrop",r,r.currentTarget)},handlePaste:function(r){this.triggerCustomEvent("editablePaste",r,r.currentTarget)},handleKeydown:function(r){if(this.triggerCustomEvent("editableKeydown",r,r.currentTarget),t.util.isKey(r,t.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",r,r.currentTarget);if(t.util.isKey(r,t.util.keyCode.ENTER)||r.ctrlKey&&t.util.isKey(r,t.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",r,r.currentTarget);if(t.util.isKey(r,t.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",r,r.currentTarget);if(t.util.isKey(r,[t.util.keyCode.DELETE,t.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",r,r.currentTarget)}},t.Events=o})(),(function(){var n=t.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(o){n.isBuiltInButton(o)?t.Extension.call(this,this.defaults[o]):t.Extension.call(this,o)},init:function(){t.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var o=this.document.createElement("button"),r=this.contentDefault,i=this.getAria(),a=this.getEditorOption("buttonLabels");return o.classList.add("medium-editor-action"),o.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){o.classList.add(s)}),o.setAttribute("data-action",this.getAction()),i&&(o.setAttribute("title",i),o.setAttribute("aria-label",i)),this.attrs&&Object.keys(this.attrs).forEach(function(s){o.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(r=this.contentFA),o.innerHTML=r,o},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=this.getAction();r&&this.execAction(r)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var o=null;return this.useQueryState&&(o=this.base.queryCommandState(this.getAction())),o},isAlreadyApplied:function(o){var r=!1,i=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(i&&i.length>0&&(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"&&t.extensions.button.prototype.defaults.hasOwnProperty(o)},t.extensions.button=n})(),(function(){t.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>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}})(),(function(){var n=t.extensions.button.extend({init:function(){t.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()}});t.extensions.form=n})(),(function(){var n=t.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:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=t.selection.getSelectionRange(this.document);return r.startContainer.nodeName.toLowerCase()==="a"||r.endContainer.nodeName.toLowerCase()==="a"||t.util.getClosestTag(t.selection.getSelectedParentElement(r),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(o){t.util.isKey(o,t.util.keyCode.K)&&t.util.isMetaCtrlKey(o)&&!o.shiftKey&&this.handleClick(o)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var o=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return o.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),o.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&o.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&o.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),o.join("")},isDisplayed:function(){return t.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){t.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(),t.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===t.util.keyCode.ENTER){o.preventDefault(),this.doFormSave();return}o.keyCode===t.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()}});t.extensions.anchor=n})(),(function(){var n=t.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'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},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",O<b?(this.anchorPreview.style.left=E+b+"px",this.anchorPreview.style.right="initial"):r-O<b?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=E+O+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(o){var r=this.base.getExtensionByName("anchor"),i=this.activeAnchor;r&&i&&(o.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(i){var a={value:i.attributes.href.value,target:i.getAttribute("target"),buttonClass:i.getAttribute("class")};r.showForm(a),i=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(o){var r=t.util.getClosestTag(o.target,"a");if(r!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(r.outerHTML)||/href=["']#\S+["']/.test(r.outerHTML)))return!0;var i=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&i&&i.isDisplayed&&i.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==r&&this.detachPreviewHandlers(),this.anchorToPreview=r,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(o){(!o.relatedTarget||!/anchor-preview/.test(o.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var o=new Date().getTime()-this.lastOver;o>this.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)}});t.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!t.util.getClosestTag(f,"a")}var l=t.Extension.extend({init:function(){t.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;h<this.window._mediumEditors.length;h++){var v=this.window._mediumEditors[h];v!==null&&v.getExtensionByName("autoLink")!==void 0&&f++}return f===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(f,h){this.performLinking(h)},onKeypress:function(f){this.disableEventHandling||t.util.isKey(f,[t.util.keyCode.SPACE,t.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var h=this.base.exportSelection();this.performLinking(f.target)&&this.base.importSelection(h,!0)}catch(v){window.console&&window.console.error("Failed to perform linking",v),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(f){var h=t.util.splitByBlockElements(f),v=!1;h.length===0&&(h=[f]);for(var b=0;b<h.length;b++)v=this.removeObsoleteAutoLinkSpans(h[b])||v,v=this.performLinkingWithinElement(h[b])||v;return this.base.events.updateInput(f,{target:f,currentTarget:f}),v},removeObsoleteAutoLinkSpans:function(f){if(!f||f.nodeType===3)return!1;for(var h=f.querySelectorAll('span[data-auto-link="true"]'),v=!1,b=0;b<h.length;b++){var E=h[b].textContent;if(E.indexOf("://")===-1&&(E=t.util.ensureUrlHasProtocol(E)),h[b].getAttribute("data-href")!==E&&s(h[b])){v=!0;var O=E.replace(/\s+$/,"");if(h[b].getAttribute("data-href")===O){var w=E.length-O.length,S=t.util.splitOffDOMTree(h[b],this.splitTextBeforeEnd(h[b],w));h[b].parentNode.insertBefore(S,h[b].nextSibling)}else t.util.unwrap(h[b],this.document)}}return v},splitTextBeforeEnd:function(f,h){for(var v=this.document.createTreeWalker(f,NodeFilter.SHOW_TEXT,null,!1),b=!0;b;)b=v.lastChild()!==null;for(var E,O,w;h>0&&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;b<h.length;b++){var E=t.util.findOrCreateMatchingTextNodes(this.document,f,h[b]);this.shouldNotLink(E)||this.createAutoLink(E,h[b].href)}return v},shouldNotLink:function(f){for(var h=!1,v=0;v<f.length&&h===!1;v++)h=!!t.util.traverseUp(f[v],function(b){return b.nodeName.toLowerCase()==="a"||b.getAttribute&&b.getAttribute("data-auto-link")==="true"});return h},findLinkableText:function(f){for(var h=f.textContent,v=null,b=[];(v=a.exec(h))!==null;){var E=!0,O=v.index+v[0].length;E=(v.index===0||n.indexOf(h[v.index-1])!==-1)&&(O===h.length||n.indexOf(h[O])!==-1),E=E&&(v[0].indexOf("/")!==-1||i.test(v[0].split(".").pop().split("?").shift())),E&&b.push({href:v[0],start:v.index,end:O})}return b},createAutoLink:function(f,h){h=t.util.ensureUrlHasProtocol(h);var v=t.util.createLink(this.document,f,h,this.getEditorOption("targetBlank")?"_blank":null),b=this.document.createElement("span");for(b.setAttribute("data-auto-link","true"),b.setAttribute("data-href",h),v.insertBefore(b,v.firstChild);v.childNodes.length>1;)b.appendChild(v.childNodes[1])}});t.extensions.autoLink=l})(),(function(){var n="medium-editor-dragover";function o(i){var a=t.util.getContainerEditorElement(i),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var r=t.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){t.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,t.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});t.extensions.fileDragging=r})(),(function(){var n=t.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(){t.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=t.util.getKeyCode(o);if(this.keys[r]){var i=t.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)}}});t.extensions.keyboardCommands=n})(),(function(){var n=t.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){t.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<this.fonts.length;f++)l=o.createElement("option"),l.innerHTML=this.fonts[f],l.value=this.fonts[f],i.appendChild(l);return i.className="medium-editor-toolbar-select",r.appendChild(i),this.on(i,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",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"?'<i class="fa fa-times"></i>':"×",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(){t.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()}});t.extensions.fontName=n})(),(function(){var n=t.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){t.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"?'<i class="fa fa-check"></i>':"✓",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"?'<i class="fa fa-times"></i>':"×",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(){t.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()}});t.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",o=null,r=null,i=function(f){f.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/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;w<b.types.length;w++){var S=b.types[w];E[S]=b.getData(S)}return E}var l=t.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){t.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(f){this.on(f,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(f,h){this.on(h,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(f,h){if(!f.defaultPrevented){var v=s(f,this.window,this.document),b=v["text/html"],E=v["text/plain"];this.window.clipboardData&&f.clipboardData===void 0&&!b&&(b=E),(b||E)&&(f.preventDefault(),this.doPaste(b,E,h))}},doPaste:function(f,h,v){var b,E="",O;if(this.cleanPastedHTML&&f)return this.cleanPaste(f);if(h){if(this.getEditorOption("disableReturn")||v&&v.getAttribute("data-disable-return"))E=t.util.htmlEntities(h);else if(b=h.split(/[\r\n]+/g),b.length>1)for(O=0;O<b.length;O+=1)b[O]!==""&&(E+="<p>"+t.util.htmlEntities(b[O])+"</p>");else E=t.util.htmlEntities(b[0]);t.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){t.util.isKey(f,t.util.keyCode.V)&&t.util.isMetaCtrlKey(f)&&(f.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(h))},createPasteBin:function(f){var h,v=t.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(),t.selection.selectNode(E,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(E,"paste",this.boundHandlePaste)},removePasteBin:function(){o!==null&&(t.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=/<p|<br|<div/.test(f),w=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(h=0;h<w.length;h+=1)f=f.replace(w[h][0],w[h][1]);if(!O)return this.pasteHTML(f);for(b=this.document.createElement("div"),b.innerHTML="<p>"+f.split("<br><br>").join("</p><p>")+"</p>",v=b.querySelectorAll("a,p,div,br"),h=0;h<v.length;h+=1)switch(E=v[h],E.innerHTML=E.innerHTML.replace(/\n/gi," "),E.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(E);break;case"br":this.filterLineBreak(E);break}this.pasteHTML(b.innerHTML)},pasteHTML:function(f,h){h=t.util.defaults({},h,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var v,b,E,O,w=this.document.createDocumentFragment();for(w.appendChild(this.document.createElement("body")),O=w.querySelector("body"),O.innerHTML=f,this.cleanupSpans(O),v=O.querySelectorAll("*"),E=0;E<v.length;E+=1)b=v[E],b.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&t.util.setTargetBlank(b),t.util.cleanupAttrs(b,h.cleanAttrs),t.util.cleanupTags(b,h.cleanTags),t.util.unwrapTags(b,h.unwrapTags);t.util.insertHTMLCommand(this.document,O.innerHTML.replace(/ /g," "))},isCommonBlock:function(f){return f&&(f.nodeName.toLowerCase()==="p"||f.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(f){/^\s*$/.test(f.textContent)&&f.parentNode&&f.parentNode.removeChild(f)},filterLineBreak:function(f){this.isCommonBlock(f.previousElementSibling)?this.removeWithParent(f):this.isCommonBlock(f.parentNode)&&(f.parentNode.firstChild===f||f.parentNode.lastChild===f)?this.removeWithParent(f):f.parentNode&&f.parentNode.childElementCount===1&&f.parentNode.textContent===""&&this.removeWithParent(f)},removeWithParent:function(f){f&&f.parentNode&&(f.parentNode.parentNode&&f.parentNode.childElementCount===1?f.parentNode.parentNode.removeChild(f.parentNode):f.parentNode.removeChild(f))},cleanupSpans:function(f){var h,v,b,E=f.querySelectorAll(".replace-with"),O=function(w){return w&&w.nodeName!=="#text"&&w.getAttribute("contenteditable")==="false"};for(h=0;h<E.length;h+=1)v=E[h],b=this.document.createElement(v.classList.contains("bold")?"b":"i"),v.classList.contains("bold")&&v.classList.contains("italic")?b.innerHTML="<i>"+v.innerHTML+"</i>":b.innerHTML=v.innerHTML,v.parentNode.replaceChild(b,v);for(E=f.querySelectorAll("span"),h=0;h<E.length;h+=1){if(v=E[h],t.util.traverseUp(v,O))return!1;t.util.unwrap(v,this.document)}}});t.extensions.paste=l})(),(function(){var n=t.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(o,r){this.initElement(r)},initElement:function(o){o.getAttribute("data-placeholder")||o.setAttribute("data-placeholder",this.text),this.updatePlaceholder(o)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(o,r){this.cleanupElement(r)},cleanupElement:function(o){o.getAttribute("data-placeholder")===this.text&&o.removeAttribute("data-placeholder")},showPlaceholder:function(o){o&&(t.util.isFF&&o.childNodes.length===0?(o.classList.add("medium-editor-placeholder-relative"),o.classList.remove("medium-editor-placeholder")):(o.classList.add("medium-editor-placeholder"),o.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(o){o&&(o.classList.remove("medium-editor-placeholder"),o.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(o,r){if(o.querySelector("img, blockquote, ul, ol, table")||o.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(o);r||this.showPlaceholder(o)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(o,r){var i=this.hideOnClick&&r===this.base.getFocusedElement();this.updatePlaceholder(r,i)},handleFocus:function(o,r){this.hidePlaceholder(r)},handleBlur:function(o,r){this.updatePlaceholder(r)}});t.extensions.placeholder=n})(),(function(){var n=t.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(o,r){return this.base.extensions.forEach(function(i){if(i!==this)return o.apply(r||this,arguments)},this)},createToolbar:function(){var o=this.document.createElement("div");return o.id="medium-editor-toolbar-"+this.getEditorId(),o.className="medium-editor-toolbar",this.static?o.className+=" static-toolbar":this.relativeContainer?o.className+=" medium-editor-relative-toolbar":o.className+=" medium-editor-stalker-toolbar",o.appendChild(this.createToolbarButtons()),this.forEachExtension(function(r){r.hasForm&&o.appendChild(r.getForm())}),this.attachEventHandlers(),o},createToolbarButtons:function(){var o=this.document.createElement("ul"),r,i,a,s,l,f;return o.id="medium-editor-toolbar-actions"+this.getEditorId(),o.className="medium-editor-toolbar-actions",o.style.display="block",this.buttons.forEach(function(h){typeof h=="string"?(l=h,f=null):(l=h.name,f=h),s=this.base.addBuiltInExtension(l,f),s&&typeof s.getButton=="function"&&(i=s.getButton(this.base),r=this.document.createElement("li"),t.util.isElement(i)?r.appendChild(i):r.innerHTML=i,o.appendChild(r))},this),a=o.querySelectorAll("button"),a.length>0&&(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=t.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&&t.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("<("+t.util.blockContainerElementNames.join("|")+")[^>]*>","g"),i=t.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=t.util.findAdjacentTextNodeWithContent(t.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=t.selection.select(this.document,i,a,r.endContainer,r.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||t.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var o=t.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(!t.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=t.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=t.selection.getSelectedParentElement(i),!!this.getEditorElements().some(function(l){return t.util.isDescendant(l,a,!0)})))for(;a&&(o.forEach(s),!t.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<v?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),w.top+=v+i.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),w.top+=this.diffTop),M<h?(w.left=b+h,w.right="initial"):a-M<h?(w.left="auto",w.right=0):(w.left=b+M,w.right="initial"),["top","left","right"].forEach(function($){s.style[$]=w[$]+(isNaN(w[$])?"":"px")})}});t.extensions.toolbar=n})(),(function(){var n=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){var r="medium-editor-dragover";o.preventDefault(),o.dataTransfer.dropEffect="copy",o.type==="dragover"?o.target.classList.add(r):o.type==="dragleave"&&o.target.classList.remove(r)},handleDrop:function(o){var r="medium-editor-dragover",i;o.preventDefault(),o.stopPropagation(),o.dataTransfer.files&&(i=Array.prototype.slice.call(o.dataTransfer.files,0),i.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,t.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),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)}});t.extensions.imageDragging=n})(),(function(){function n(G){var Q=t.selection.getSelectionStart(this.options.ownerDocument),J=Q.textContent,ie=t.selection.getCaretOffsets(Q);(J[ie.left-1]===void 0||J[ie.left-1].trim()===""||J[ie.left]!==void 0&&J[ie.left].trim()==="")&&G.preventDefault()}function o(G,Q){if(this.options.disableReturn||Q.getAttribute("data-disable-return"))G.preventDefault();else if(this.options.disableDoubleReturn||Q.getAttribute("data-disable-double-return")){var J=t.selection.getSelectionStart(this.options.ownerDocument);(J&&J.textContent.trim()===""&&J.nodeName.toLowerCase()!=="li"||J.previousElementSibling&&J.previousElementSibling.nodeName.toLowerCase()!=="br"&&J.previousElementSibling.textContent.trim()==="")&&G.preventDefault()}}function r(G){var Q=t.selection.getSelectionStart(this.options.ownerDocument),J=Q&&Q.nodeName.toLowerCase();J==="pre"&&(G.preventDefault(),t.util.insertHTMLCommand(this.options.ownerDocument," ")),t.util.isListItem(Q)&&(G.preventDefault(),G.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(G){var Q,J=t.selection.getSelectionStart(this.options.ownerDocument),ie=J.nodeName.toLowerCase(),Se=/^(\s+|<br\/?>)?$/i,Ae=/h\d/i;t.util.isKey(G,[t.util.keyCode.BACKSPACE,t.util.keyCode.ENTER])&&J.previousElementSibling&&Ae.test(ie)&&t.selection.getCaretOffsets(J).left===0?t.util.isKey(G,t.util.keyCode.BACKSPACE)&&Se.test(J.previousElementSibling.innerHTML)?(J.previousElementSibling.parentNode.removeChild(J.previousElementSibling),G.preventDefault()):!this.options.disableDoubleReturn&&t.util.isKey(G,t.util.keyCode.ENTER)&&(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.previousElementSibling.parentNode.insertBefore(Q,J),G.preventDefault()):t.util.isKey(G,t.util.keyCode.DELETE)&&J.nextElementSibling&&J.previousElementSibling&&!Ae.test(ie)&&Se.test(J.innerHTML)&&Ae.test(J.nextElementSibling.nodeName.toLowerCase())?(t.selection.moveCursor(this.options.ownerDocument,J.nextElementSibling),J.previousElementSibling.parentNode.removeChild(J),G.preventDefault()):t.util.isKey(G,t.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="<br>",J.parentElement.parentElement.insertBefore(Q,J.parentElement),t.selection.moveCursor(this.options.ownerDocument,Q),J.parentElement.removeChild(J),G.preventDefault()):t.util.isKey(G,t.util.keyCode.BACKSPACE)&&t.util.getClosestTag(J,"blockquote")!==!1&&t.selection.getCaretOffsets(J).left===0?(G.preventDefault(),t.util.execFormatBlock(this.options.ownerDocument,"p")):t.util.isKey(G,t.util.keyCode.ENTER)&&t.util.getClosestTag(J,"blockquote")!==!1&&t.selection.getCaretOffsets(J).right===0?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.parentElement.insertBefore(Q,J.nextSibling),t.selection.moveCursor(this.options.ownerDocument,Q),G.preventDefault()):t.util.isKey(G,t.util.keyCode.BACKSPACE)&&t.util.isMediumEditorElement(J.parentElement)&&!J.previousElementSibling&&J.nextElementSibling&&Se.test(J.innerHTML)&&(G.preventDefault(),t.selection.moveCursor(this.options.ownerDocument,J.nextSibling),J.parentElement.removeChild(J))}function a(G){var Q=t.selection.getSelectionStart(this.options.ownerDocument),J;Q&&(t.util.isMediumEditorElement(Q)&&Q.children.length===0&&!t.util.isBlockContainer(Q)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),t.util.isKey(G,t.util.keyCode.ENTER)&&!t.util.isListItem(Q)&&!t.util.isBlockContainer(Q)&&(J=Q.nodeName.toLowerCase(),J==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!G.shiftKey&&!G.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(G,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(G){G._mediumEditors||(G._mediumEditors=[null]),this.id||(this.id=G._mediumEditors.length),G._mediumEditors[this.id]=this}function f(G){!G._mediumEditors||!G._mediumEditors[this.id]||(G._mediumEditors[this.id]=null)}function h(G,Q,J){var ie=[];if(G||(G=[]),typeof G=="string"&&(G=Q.querySelectorAll(G)),t.util.isElement(G)&&(G=[G]),J)for(var Se=0;Se<G.length;Se++){var Ae=G[Se];t.util.isElement(Ae)&&!Ae.getAttribute("data-medium-editor-element")&&!Ae.getAttribute("medium-editor-textarea-id")&&ie.push(Ae)}else ie=Array.prototype.slice.apply(G);return ie}function v(G){var Q=G.parentNode.querySelector('textarea[medium-editor-textarea-id="'+G.getAttribute("medium-editor-textarea-id")+'"]');Q&&(Q.classList.remove("medium-editor-hidden"),Q.removeAttribute("medium-editor-textarea-id")),G.parentNode&&G.parentNode.removeChild(G)}function b(G,Q){return Object.keys(Q).forEach(function(J){G[J]===void 0&&(G[J]=Q[J])}),G}function E(G,Q,J){var ie={window:J.options.contentWindow,document:J.options.ownerDocument,base:J};return G=b(G,ie),typeof G.init=="function"&&G.init(),G.name||(G.name=Q),G}function O(){return this.elements.every(function(G){return!!G.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function w(){return O.call(this)?this.options.anchorPreview!==!1:!1}function S(){return this.options.placeholder!==!1}function M(){return this.options.autoLink!==!1}function T(){return this.options.imageDragging!==!1}function $(){return this.options.keyboardCommands!==!1}function D(){return!this.options.extensions.imageDragging}function P(G){for(var Q=this.options.ownerDocument.createElement("div"),J=Date.now(),ie="medium-editor-"+J,Se=G.attributes;this.options.ownerDocument.getElementById(ie);)J++,ie="medium-editor-"+J;Q.className=G.className,Q.id=ie,Q.innerHTML=G.value,G.setAttribute("medium-editor-textarea-id",ie);for(var Ae=0,Pe=Se.length;Ae<Pe;Ae++)Q.hasAttribute(Se[Ae].nodeName)||Q.setAttribute(Se[Ae].nodeName,Se[Ae].value);return G.form&&this.on(G.form,"reset",(function(De){De.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(ie))}).bind(this)),G.classList.add("medium-editor-hidden"),G.parentNode.insertBefore(Q,G),Q}function B(G,Q){if(!G.getAttribute("data-medium-editor-element")){G.nodeName.toLowerCase()==="textarea"&&(G=P.call(this,G),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!G.getAttribute("data-disable-editing")&&(G.setAttribute("contentEditable",!0),G.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(G.getAttribute("data-disable-return")||G.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=o.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!G.getAttribute("data-disable-return")&&this.on(G,"keyup",a.bind(this));var J=t.util.guid();G.setAttribute("data-medium-editor-element",!0),G.classList.add("medium-editor-element"),G.setAttribute("role","textbox"),G.setAttribute("aria-multiline",!0),G.setAttribute("data-medium-editor-editor-index",Q),G.setAttribute("medium-editor-index",J),X[J]=G.innerHTML,this.events.attachAllEventsToElement(G)}return G}function F(){this.subscribe("editableKeydownTab",r.bind(this)),this.subscribe("editableKeydownDelete",i.bind(this)),this.subscribe("editableKeydownEnter",i.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=o.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function I(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(Se){Se!=="toolbar"&&this.options.extensions[Se]&&this.extensions.push(E(this.options.extensions[Se],Se,this))},this),D.call(this)){var G=this.options.fileDragging;G||(G={},T.call(this)||(G.allowedTypes=[])),this.addBuiltInExtension("fileDragging",G)}var Q={paste:!0,"anchor-preview":w.call(this),autoLink:M.call(this),keyboardCommands:$.call(this),placeholder:S.call(this)};Object.keys(Q).forEach(function(Se){Q[Se]&&this.addBuiltInExtension(Se)},this);var J=this.options.extensions.toolbar;if(!J&&O.call(this)){var ie=t.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});J=new t.extensions.toolbar(ie)}J&&this.extensions.push(E(J,"toolbar",this))}function V(G,Q){var J=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return Q&&J.forEach(function(ie){Q.hasOwnProperty(ie[0])&&Q[ie[0]]!==void 0&&t.util.deprecated(ie[0],ie[1],"v6.0.0")}),t.util.defaults({},Q,G)}function z(G,Q){var J=/^append-(.+)$/gi,ie=/justify([A-Za-z]*)$/g,Se,Ae;if(Se=J.exec(G),Se)return t.util.execFormatBlock(this.options.ownerDocument,Se[1]);if(G==="fontSize")return Q.size&&t.util.deprecated(".size option for fontSize command",".value","6.0.0"),Ae=Q.value||Q.size,this.options.ownerDocument.execCommand("fontSize",!1,Ae);if(G==="fontName")return Q.name&&t.util.deprecated(".name option for fontName command",".value","6.0.0"),Ae=Q.value||Q.name,this.options.ownerDocument.execCommand("fontName",!1,Ae);if(G==="createLink")return this.createLink(Q);if(G==="image"){var Pe=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Pe)}if(G==="html"){var De=this.options.contentWindow.getSelection().toString().trim();return t.util.insertHTMLCommand(this.options.ownerDocument,De)}if(ie.exec(G)){var ze=this.options.ownerDocument.execCommand(G,!1,null),Ye=t.selection.getSelectedParentElement(t.selection.getSelectionRange(this.options.ownerDocument));return Ye&&q.call(this,t.util.getTopBlockContainer(Ye)),ze}return Ae=Q&&Q.value,this.options.ownerDocument.execCommand(G,!1,Ae)}function q(G){if(G){var Q,J=Array.prototype.slice.call(G.childNodes).filter(function(ie){var Se=ie.nodeName.toLowerCase()==="div";return Se&&!Q&&(Q=ie.style.textAlign),Se});J.length&&(this.saveSelection(),J.forEach(function(ie){if(ie.style.textAlign===Q){var Se=ie.lastChild;if(Se){t.util.unwrap(ie,this.options.ownerDocument);var Ae=this.options.ownerDocument.createElement("BR");Se.parentNode.insertBefore(Ae,Se.nextSibling)}}},this),G.style.textAlign=Q,this.restoreSelection())}}var X={};t.prototype={init:function(G,Q){return this.options=V.call(this,this.defaults,Q),this.origElements=G,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new t.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,I.call(this),F.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(G){typeof G.destroy=="function"&&G.destroy()},this),this.events.destroy(),this.elements.forEach(function(G){this.options.spellcheck&&(G.innerHTML=G.innerHTML),G.removeAttribute("contentEditable"),G.removeAttribute("spellcheck"),G.removeAttribute("data-medium-editor-element"),G.classList.remove("medium-editor-element"),G.removeAttribute("role"),G.removeAttribute("aria-multiline"),G.removeAttribute("medium-editor-index"),G.removeAttribute("data-medium-editor-editor-index"),G.getAttribute("medium-editor-textarea-id")&&v(G)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,f.call(this,this.options.contentWindow))},on:function(G,Q,J,ie){return this.events.attachDOMEvent(G,Q,J,ie),this},off:function(G,Q,J,ie){return this.events.detachDOMEvent(G,Q,J,ie),this},subscribe:function(G,Q){return this.events.attachCustomEvent(G,Q),this},unsubscribe:function(G,Q){return this.events.detachCustomEvent(G,Q),this},trigger:function(G,Q,J){return this.events.triggerCustomEvent(G,Q,J),this},delay:function(G){var Q=this;return setTimeout(function(){Q.isActive&&G()},this.options.delay)},serialize:function(){var G,Q,J={},ie=this.elements.length;for(G=0;G<ie;G+=1)Q=this.elements[G].id!==""?this.elements[G].id:"element-"+G,J[Q]={value:this.elements[G].innerHTML.trim()};return J},getExtensionByName:function(G){var Q;return this.extensions&&this.extensions.length&&this.extensions.some(function(J){return J.name===G?(Q=J,!0):!1}),Q},addBuiltInExtension:function(G,Q){var J=this.getExtensionByName(G),ie;if(J)return J;switch(G){case"anchor":ie=t.util.extend({},this.options.anchor,Q),J=new t.extensions.anchor(ie);break;case"anchor-preview":J=new t.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":J=new t.extensions.autoLink;break;case"fileDragging":J=new t.extensions.fileDragging(Q);break;case"fontname":J=new t.extensions.fontName(this.options.fontName);break;case"fontsize":J=new t.extensions.fontSize(Q);break;case"keyboardCommands":J=new t.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":J=new t.extensions.paste(this.options.paste);break;case"placeholder":J=new t.extensions.placeholder(this.options.placeholder);break;default:t.extensions.button.isBuiltInButton(G)&&(Q?(ie=t.util.defaults({},Q,t.extensions.button.prototype.defaults[G]),J=new t.extensions.button(ie)):J=new t.extensions.button(G))}return J&&this.extensions.push(E(J,G,this)),J},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var G=this.getExtensionByName("toolbar");return G&&G.checkState(),this},queryCommandState:function(G){var Q=/^full-(.+)$/gi,J,ie=null;J=Q.exec(G),J&&(G=J[1]);try{ie=this.options.ownerDocument.queryCommandState(G)}catch{ie=null}return ie},execAction:function(G,Q){var J=/^full-(.+)$/gi,ie,Se;return ie=J.exec(G),ie?(this.saveSelection(),this.selectAllContents(),Se=z.call(this,ie[1],Q),this.restoreSelection()):Se=z.call(this,G,Q),(G==="insertunorderedlist"||G==="insertorderedlist")&&t.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),Se},getSelectedParentElement:function(G){return G===void 0&&(G=this.options.contentWindow.getSelection().getRangeAt(0)),t.selection.getSelectedParentElement(G)},selectAllContents:function(){var G=t.selection.getSelectionElement(this.options.contentWindow);if(G){for(;G.children.length===1;)G=G.children[0];this.selectElement(G)}},selectElement:function(G){t.selection.selectNode(G,this.options.ownerDocument);var Q=t.selection.getSelectionElement(this.options.contentWindow);Q&&this.events.focusElement(Q)},getFocusedElement:function(){var G;return this.elements.some(function(Q){return!G&&Q.getAttribute("data-medium-focused")&&(G=Q),!!G},this),G},exportSelection:function(){var G=t.selection.getSelectionElement(this.options.contentWindow),Q=this.elements.indexOf(G),J=null;return Q>=0&&(J=t.selection.exportSelection(G,this.options.ownerDocument)),J!==null&&Q!==0&&(J.editableElementIndex=Q),J},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(G,Q){if(G){var J=this.elements[G.editableElementIndex||0];t.selection.importSelection(G,J,this.options.ownerDocument,Q)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(G){var Q=t.selection.getSelectionElement(this.options.contentWindow),J={},ie;if(this.elements.indexOf(Q)!==-1){try{if(this.events.disableCustomEvent("editableInput"),G.url&&t.util.deprecated(".url option for createLink",".value","6.0.0"),ie=G.url||G.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=t.util.getClosestBlockContainer(Ae.startContainer),Ye=t.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?t.selection.select(this.options.ownerDocument,Je.firstChild,0,Je.lastChild,Je.lastChild.nodeType===3?Je.lastChild.nodeValue.length:Je.lastChild.childNodes.length):t.selection.select(this.options.ownerDocument,Je,0,Je,Je.childNodes.length);var le=this.exportSelection();Be=t.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]),t.util.createLink(this.options.ownerDocument,Be,ie.trim());var Ze=(gt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;t.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||G.target==="_blank"?t.util.setTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),ie):t.util.removeTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),ie),G.buttonClass&&t.util.addClassToAnchors(t.selection.getSelectionStart(this.options.ownerDocument),G.buttonClass)}}if(this.options.targetBlank||G.target==="_blank"||G.buttonClass){J=this.options.ownerDocument.createEvent("HTMLEvents"),J.initEvent("input",!0,!0,this.options.contentWindow);for(var pe=0,se=this.elements.length;pe<se;pe+=1)this.elements[pe].dispatchEvent(J)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",J,Q)}},cleanPaste:function(G){this.getExtensionByName("paste").cleanPaste(G)},pasteHTML:function(G,Q){this.getExtensionByName("paste").pasteHTML(G,Q)},setContent:function(G,Q){if(Q=Q||0,this.elements[Q]){var J=this.elements[Q];J.innerHTML=G,this.checkContentChanged(J)}},getContent:function(G){return G=G||0,this.elements[G]?this.elements[G].innerHTML.trim():null},checkContentChanged:function(G){G=G||t.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(G,{target:G,currentTarget:G})},resetContent:function(G){if(G){var Q=this.elements.indexOf(G);Q!==-1&&this.setContent(X[G.getAttribute("medium-editor-index")],Q);return}this.elements.forEach(function(J,ie){this.setContent(X[J.getAttribute("medium-editor-index")],ie)},this)},addElements:function(G){var Q=h(G,this.options.ownerDocument,!0);if(Q.length===0)return!1;Q.forEach(function(J){J=B.call(this,J,this.id),this.elements.push(J),this.trigger("addElement",{target:J,currentTarget:J},J)},this)},removeElements:function(G){var Q=h(G,this.options.ownerDocument),J=Q.map(function(ie){return ie.getAttribute("medium-editor-textarea-id")&&ie.parentNode?ie.parentNode.querySelector('div[medium-editor-textarea-id="'+ie.getAttribute("medium-editor-textarea-id")+'"]'):ie});this.elements=this.elements.filter(function(ie){return J.indexOf(ie)!==-1?(this.events.cleanupElement(ie),ie.getAttribute("medium-editor-textarea-id")&&v(ie),this.trigger("removeElement",{target:ie,currentTarget:ie},ie),!1):!0},this)}},t.getEditorFromElement=function(G){var Q=G.getAttribute("data-medium-editor-editor-index"),J=G&&G.ownerDocument&&(G.ownerDocument.defaultView||G.ownerDocument.parentWindow);return J&&J._mediumEditors&&J._mediumEditors[Q]?J._mediumEditors[Q]:null}})(),(function(){t.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}})(),t.parseVersionString=function(n){var o=n.split("-"),r=o[0].split("."),i=o.length>1?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:"")}}},t.version=t.parseVersionString.call(this,"5.23.3"),t})())})(Q0)),Q0.exports}var _ne=yne();const D0=Z_(_ne);/*!
|
||
* 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(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},jM=(function(){function e(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}})(),j0=(function(){function e(t,n){var o=[],r=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(o.push(l.value),!(n&&o.length===n));r=!0);}catch(f){i=!0,a=f}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return o}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();String.prototype.startsWith=String.prototype.startsWith||function(e){return this.indexOf(e)===0};String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n};var bne={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function gR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return n||"0"}var wne=(function(){function e(t,n,o,r){DM(this,e);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=e.hexToRgb(l):i.rgba=e.nameToRgb(l)||e.hexToRgb(l)}if(t!==void 0)if(Array.isArray(t))this.rgba=t;else if(o===void 0){var s=t&&""+t;s&&a(s.toLowerCase())}else this.rgba=[t,n,o,r===void 0?1:r]}return jM(e,[{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=e.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=e.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=e.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=bne[o];return r===void 0?r:e.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+(i<a?6:0);break;case i:h=(a-r)/E+2;break;case a:h=(r-i)/E+4;break}h/=6}return[h,v,b,s]}},{key:"hslToRgb",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],s=o[3],l=void 0,f=void 0,h=void 0;if(i===0)l=f=h=a;else{var v=function(S,M,T){return T<0&&(T+=1),T>1&&(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}}]),e})(),Ene=(function(){function e(){DM(this,e),this._events=[]}return jM(e,[{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&&e._doRemove(i.target,i.type,i.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return e._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,o,r){n.removeEventListener(o,r,!1)}}]),e})();function xne(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function mS(e,t,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=t.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}e.add(t,"mousedown",function(l){a(l,!0)}),e.add(t,"touchstart",function(l){s(l,!0)}),e.add(window,"mousemove",a),e.add(t,"touchmove",s),e.add(window,"mouseup",function(l){o=!1}),e.add(t,"touchend",function(l){o=!1}),e.add(t,"touchcancel",function(l){o=!1})}var One=`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`,Sne=360,qI="keydown",L0="mousedown",gS="focusin";function Dd(e,t){return(t||document).querySelector(e)}function Ane(e){e.preventDefault(),e.stopPropagation()}function yS(e,t,n,o,r){e.add(t,qI,function(i){n.indexOf(i.key)>=0&&o(i)})}var KI=(function(){function e(t){DM(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new Ene,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return jM(e,[{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 Ane(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 wne(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||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',i=xne(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]*Sne+", 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+", "+One,!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}}]),e})();{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(e,t){(function(n,o){e.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;pe<se;++pe)Ze(le[pe],pe)},$={},D=typeof window!=r&&typeof document!=r,P={isHostMethod:f,isHostObject:h,isHostProperty:v,areHostMethods:E,areHostObjects:O,areHostProperties:w,isTextRange:S,getBody:M,forEach:T},B={version:"1.3.2",initialized:!1,isBrowser:D,supported:!0,util:P,features:{},modules:$,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==r?!0:rangyAutoInitialize}};function F(le){typeof console!=r&&f(console,"log")&&console.log(le)}function I(le,Ze){D&&Ze?alert(le):F(le)}function V(le){B.initialized=!0,B.supported=!1,I("Rangy is not supported in this environment. Reason: "+le,B.config.alertOnFail)}B.fail=V;function z(le){I("Rangy warning: "+le,B.config.alertOnWarn)}B.warn=z;var q;({}).hasOwnProperty?(P.extend=q=function(le,Ze,pe){var se,we;for(var $e in Ze)$e==="__proto__"||$e==="constructor"||$e==="prototype"||Ze.hasOwnProperty($e)&&(se=le[$e],we=Ze[$e],pe&&se!==null&&typeof se=="object"&&we!==null&&typeof we=="object"&&q(se,we,!0),le[$e]=we);return Ze.hasOwnProperty("toString")&&(le.toString=Ze.toString),le},P.createOptions=function(le,Ze){var pe={};return q(pe,Ze),le&&q(pe,le),pe}):V("hasOwnProperty not supported"),D||V("Rangy can only run in a browser"),(function(){var le;if(D){var Ze=document.createElement("div");Ze.appendChild(document.createElement("span"));var pe=[].slice;try{pe.call(Ze.childNodes,0)[0].nodeType==1&&(le=function(se){return pe.call(se,0)})}catch{}}le||(le=function(se){for(var we=[],$e=0,rt=se.length;$e<rt;++$e)we[$e]=se[$e];return we}),P.toArray=le})();var X;D&&(f(document,"addEventListener")?X=function(le,Ze,pe){le.addEventListener(Ze,pe,!1)}:f(document,"attachEvent")?X=function(le,Ze,pe){le.attachEvent("on"+Ze,pe)}:V("Document does not have required addEventListener or attachEvent method"),P.addListener=X);var G=[];function Q(le){return le.message||le.description||String(le)}function J(){if(!(!D||B.initialized)){var le,Ze=!1,pe=!1;f(document,"createRange")&&(le=document.createRange(),E(le,a)&&w(le,i)&&(Ze=!0));var se=M(document);if(!se||se.nodeName.toLowerCase()!="body"){V("No body element found");return}if(se&&f(se,"createTextRange")&&(le=se.createTextRange(),S(le)&&(pe=!0)),!Ze&&!pe){V("Neither Range nor TextRange are available");return}B.initialized=!0,B.features={implementsDomRange:Ze,implementsTextRange:pe};var we,$e;for(var rt in $)(we=$[rt])instanceof De&&we.init(we,B);for(var pt=0,Lt=G.length;pt<Lt;++pt)try{G[pt](B)}catch(Jt){$e="Rangy init listener threw an exception. Continuing. Detail: "+Q(Jt),F($e)}}}function ie(le,Ze,pe){pe&&(le+=" in module "+pe.name),B.warn("DEPRECATED: "+le+" is deprecated. Please use "+Ze+" instead.")}function Se(le,Ze,pe,se){le[Ze]=function(){return ie(Ze,pe,se),le[pe].apply(le,P.toArray(arguments))}}P.deprecationNotice=ie,P.createAliasForDeprecatedMethod=Se,B.init=J,B.addInitListener=function(le){B.initialized?le(B):G.push(le)};var Ae=[];B.addShimListener=function(le){Ae.push(le)};function Pe(le){le=le||window,J();for(var Ze=0,pe=Ae.length;Ze<pe;++Ze)Ae[Ze](le)}D&&(B.shim=B.createMissingNativeApi=Pe,Se(B,"createMissingNativeApi","shim"));function De(le,Ze,pe){this.name=le,this.dependencies=Ze,this.initialized=!1,this.supported=!1,this.initializer=pe}De.prototype={init:function(){for(var le=this.dependencies||[],Ze=0,pe=le.length,se,we;Ze<pe;++Ze){if(we=le[Ze],se=$[we],!se||!(se instanceof De))throw new Error("required module '"+we+"' not found");if(se.init(),!se.supported)throw new Error("required module '"+we+"' not supported")}this.initializer(this)},fail:function(le){throw this.initialized=!0,this.supported=!1,new Error(le)},warn:function(le){B.warn("Module "+this.name+": "+le)},deprecationNotice:function(le,Ze){B.warn("DEPRECATED: "+le+" in module "+this.name+" is deprecated. Please use "+Ze+" instead")},createError:function(le){return new Error("Error in Rangy "+this.name+" module: "+le)}};function ze(le,Ze,pe){var se=new De(le,Ze,function(we){if(!we.initialized){we.initialized=!0;try{pe(B,we),we.supported=!0}catch(rt){var $e="Module '"+le+"' failed to load: "+Q(rt);F($e),rt.stack&&F(rt.stack)}}});return $[le]=se,se}B.createModule=function(le){var Ze,pe;arguments.length==2?(Ze=arguments[1],pe=[]):(Ze=arguments[2],pe=arguments[1]);var se=ze(le,pe,Ze);B.initialized&&B.supported&&se.init()},B.createCoreModule=function(le,Ze,pe){ze(le,Ze,pe)};function Ye(){}B.RangePrototype=Ye,B.rangePrototype=new Ye;function Be(){}B.selectionPrototype=new Be,B.createCoreModule("DomUtil",[],function(le,Ze){var pe="undefined",se=le.util,we=se.getBody;se.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||Ze.fail("document missing a Node creation method"),se.isHostMethod(document,"getElementsByTagName")||Ze.fail("document missing getElementsByTagName method");var $e=document.createElement("div");se.areHostMethods($e,["insertBefore","appendChild","cloneNode"])||Ze.fail("Incomplete Element implementation"),se.isHostProperty($e,"innerHTML")||Ze.fail("Element is missing innerHTML property");var rt=document.createTextNode("test");se.areHostMethods(rt,["splitText","deleteData","insertData","appendData","cloneNode"])||Ze.fail("Incomplete Text Node implementation");var pt=function(ut,vn){for(var In=ut.length;In--;)if(ut[In]===vn)return!0;return!1};function Lt(ut){var vn;return typeof ut.namespaceURI==pe||(vn=ut.namespaceURI)===null||vn=="http://www.w3.org/1999/xhtml"}function Jt(ut){var vn=ut.parentNode;return vn.nodeType==1?vn:null}function en(ut){for(var vn=0;ut=ut.previousSibling;)++vn;return vn}function zt(ut){switch(ut.nodeType){case 7:case 10:return 0;case 3:case 8:return ut.length;default:return ut.childNodes.length}}function it(ut,vn){var In=[],sr;for(sr=ut;sr;sr=sr.parentNode)In.push(sr);for(sr=vn;sr;sr=sr.parentNode)if(pt(In,sr))return sr;return null}function ae(ut,vn,In){for(var sr=In?vn:vn.parentNode;sr;){if(sr===ut)return!0;sr=sr.parentNode}return!1}function re(ut,vn){return ae(ut,vn,!0)}function je(ut,vn,In){for(var sr,wo=In?ut:ut.parentNode;wo;){if(sr=wo.parentNode,sr===vn)return wo;wo=sr}return null}function vt(ut){var vn=ut.nodeType;return vn==3||vn==4||vn==8}function Y(ut){if(!ut)return!1;var vn=ut.nodeType;return vn==3||vn==8}function kt(ut,vn){var In=vn.nextSibling,sr=vn.parentNode;return In?sr.insertBefore(ut,In):sr.appendChild(ut),ut}function Rt(ut,vn,In){var sr=ut.cloneNode(!1);if(sr.deleteData(0,vn),ut.deleteData(vn,ut.length-vn),kt(sr,ut),In)for(var wo=0,oo;oo=In[wo++];)oo.node==ut&&oo.offset>vn?(oo.node=sr,oo.offset-=vn):oo.node==ut.parentNode&&oo.offset>en(ut)&&++oo.offset;return sr}function Wt(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 Wt(ut.parentNode);throw Ze.createError("getDocument: no document found for node")}function Pn(ut){var vn=Wt(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 xn(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):Wt(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<sr?-1:1;if(wo=je(In,ut,!0))return vn<=en(wo)?-1:1;if(wo=je(ut,In,!0))return en(wo)<sr?-1:1;if(oo=it(ut,In),!oo)throw new Error("comparePoints error: nodes have no common ancestor");if(ta=ut===oo?oo:je(ut,oo,!0),Ca=In===oo?oo:je(In,oo,!0),ta===Ca)throw Ze.createError("comparePoints got to case 4 and childA and childB are the same!");for(Yi=oo.firstChild;Yi;){if(Yi===ta)return-1;if(Yi===Ca)return 1;Yi=Yi.nextSibling}}var At=!1;function Tt(ut){var vn;try{return vn=ut.parentNode,!1}catch{return!0}}(function(){var ut=document.createElement("b");ut.innerHTML="1";var vn=ut.firstChild;ut.innerHTML="<br />",At=Tt(vn),le.features.crashyTextNodes=At})();function wn(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=Wt(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("+wn(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:Y,insertAfter:kt,splitDataNode:Rt,getDocument:Wt,getWindow:Pn,getIframeWindow:xn,getIframeDocument:qt,getBody:we,isWindow:ke,getContentDocument:Ke,getRootContainer:Le,comparePoints:dt,isBrokenNode:Tt,inspectNode:wn,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,Y=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 Wt(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 xn(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(On(ye),On(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 wn(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&&Y(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 On(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="<b>x</b>",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){On(ye);var fn=ye.startContainer,Rn=ye.startOffset,Cn=ye.endContainer,nr=ye.endOffset,Mn=fn===Cn;rt(Cn)&&nr>0&&nr<Cn.length&&zt(Cn,nr,ht),rt(fn)&&Rn>0&&Rn<fn.length&&(fn=zt(fn,Rn,ht),Mn?(nr-=Rn,Cn=fn):Cn==fn.parentNode&&nr>=pt(fn)&&nr++,Rn=0),ye.setStartAndEnd(fn,Rn,Cn,nr)}function gr(ye){On(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){On(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(On(this),wo(ye,ho),Ca(this.startContainer),Lt(ye,this.startContainer))throw new $e("HIERARCHY_REQUEST_ERR");var ht=xn(ye,this.startContainer,this.startOffset);this.setStartBefore(ht)},cloneContents:function(){On(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(){On(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);xn(ye,this.startContainer,this.startOffset),ye.appendChild(ht),this.selectNode(ye)},cloneRange:function(){On(this);for(var ye=new si(Rt(this)),ht=gl.length,fn;ht--;)fn=gl[ht],ye[fn]=this[fn];return ye},toString:function(){On(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){On(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 On(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(On(this),je(ye)!=Wt(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 On(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 On(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 wn(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(){On(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){On(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(){On(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(){On(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),Y(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),Y(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),Y(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),Y(Vi)));else if(or<Mn.childNodes.length){var Fl=Mn.childNodes[or];Fl&&rt(Fl)&&vi(Fl)}}else Mn=lr,or=qr;ht(this,Mn,or,lr,qr)},collapseToPoint:function(Mn,or){sr(Mn,!0),oo(Mn,or),this.setStartAndEnd(Mn,or)},parentElement:function(){On(this);var Mn=this.commonAncestorContainer;return Mn?In(this.commonAncestorContainer,!0):null}}),mt(ye)}function br(ye){ye.collapsed=ye.startContainer===ye.endContainer&&ye.startOffset===ye.endOffset,ye.commonAncestorContainer=ye.collapsed?ye.startContainer:pe.getCommonAncestor(ye.startContainer,ye.endContainer)}function so(ye,ht,fn,Rn,Cn){ye.startContainer=ht,ye.startOffset=fn,ye.endContainer=Rn,ye.endOffset=Cn,ye.document=pe.getDocument(ht),br(ye)}function si(ye){so(this,ye,0,ye,0)}Kn(si,so),se.extend(si,{rangeProperties:gl,RangeIterator:Zn,copyComparisonConstants:mt,createPrototypeRange:Kn,inspect:wn,toHtml:gr,getRangeDocument:Rt,rangesEqual:function(ye,ht){return ye.startContainer===ht.startContainer&&ye.startOffset===ht.startOffset&&ye.endContainer===ht.endContainer&&ye.endOffset===ht.endOffset}}),le.DomRange=si}),B.createCoreModule("WrappedRange",["DomRange"],function(le,Ze){var pe,se,we=le.dom,$e=le.util,rt=we.DomPosition,pt=le.DomRange,Lt=we.getBody,Jt=we.getContentDocument,en=we.isCharacterDataNode;if(le.features.implementsDomRange&&(function(){var Y,kt=pt.rangeProperties;function Rt(At){for(var Tt=kt.length,wn;Tt--;)wn=kt[Tt],At[wn]=At.nativeRange[wn];At.collapsed=At.startContainer===At.endContainer&&At.startOffset===At.endOffset}function Wt(At,Tt,wn,Zn,ao){var Lo=At.startContainer!==Tt||At.startOffset!=wn,yo=At.endContainer!==Zn||At.endOffset!=ao,ho=!At.equals(At.nativeRange);(Lo||yo||ho)&&(At.setEnd(Zn,ao),At.setStart(Tt,wn))}var Pn;pe=function(At){if(!At)throw Ze.createError("WrappedRange: Range must be specified");this.nativeRange=At,Rt(this)},pt.createPrototypeRange(pe,Wt),Y=pe.prototype,Y.selectNode=function(At){this.nativeRange.selectNode(At),Rt(this)},Y.cloneContents=function(){return this.nativeRange.cloneContents()},Y.surroundContents=function(At){this.nativeRange.surroundContents(At),Rt(this)},Y.collapse=function(At){this.nativeRange.collapse(At),Rt(this)},Y.cloneRange=function(){return new pe(this.nativeRange.cloneRange())},Y.refresh=function(){Rt(this)},Y.toString=function(){return this.nativeRange.toString()};var qt=document.createTextNode("test");Lt(document).appendChild(qt);var xn=document.createRange();xn.setStart(qt,0),xn.setEnd(qt,0);try{xn.setStart(qt,1),Y.setStart=function(At,Tt){this.nativeRange.setStart(At,Tt),Rt(this)},Y.setEnd=function(At,Tt){this.nativeRange.setEnd(At,Tt),Rt(this)},Pn=function(At){return function(Tt){this.nativeRange[At](Tt),Rt(this)}}}catch{Y.setStart=function(Tt,wn){try{this.nativeRange.setStart(Tt,wn)}catch{this.nativeRange.setEnd(Tt,wn),this.nativeRange.setStart(Tt,wn)}Rt(this)},Y.setEnd=function(Tt,wn){try{this.nativeRange.setEnd(Tt,wn)}catch{this.nativeRange.setStart(Tt,wn),this.nativeRange.setEnd(Tt,wn)}Rt(this)},Pn=function(Tt,wn){return function(Zn){try{this.nativeRange[Tt](Zn)}catch{this.nativeRange[wn](Zn),this.nativeRange[Tt](Zn)}Rt(this)}}}Y.setStartBefore=Pn("setStartBefore","setEndBefore"),Y.setStartAfter=Pn("setStartAfter","setEndAfter"),Y.setEndBefore=Pn("setEndBefore","setStartBefore"),Y.setEndAfter=Pn("setEndAfter","setStartAfter"),Y.selectNodeContents=function(At){this.setStartAndEnd(At,0,we.getNodeLength(At))},xn.selectNodeContents(qt),xn.setEnd(qt,3);var ke=document.createRange();ke.selectNodeContents(qt),ke.setEnd(qt,4),ke.setStart(qt,2),xn.compareBoundaryPoints(xn.START_TO_END,ke)==-1&&xn.compareBoundaryPoints(xn.END_TO_START,ke)==1?Y.compareBoundaryPoints=function(At,Tt){return Tt=Tt.nativeRange||Tt,At==Tt.START_TO_END?At=Tt.END_TO_START:At==Tt.END_TO_START&&(At=Tt.START_TO_END),this.nativeRange.compareBoundaryPoints(At,Tt)}:Y.compareBoundaryPoints=function(At,Tt){return this.nativeRange.compareBoundaryPoints(At,Tt.nativeRange||Tt)};var Ke=document.createElement("div");Ke.innerHTML="123";var Le=Ke.firstChild,dt=Lt(document);dt.appendChild(Ke),xn.setStart(Le,1),xn.setEnd(Le,2),xn.deleteContents(),Le.data=="13"&&(Y.deleteContents=function(){this.nativeRange.deleteContents(),Rt(this)},Y.extractContents=function(){var At=this.nativeRange.extractContents();return Rt(this),At}),dt.removeChild(Ke),dt=null,$e.isHostMethod(xn,"createContextualFragment")&&(Y.createContextualFragment=function(At){return this.nativeRange.createContextualFragment(At)}),Lt(document).removeChild(qt),Y.getName=function(){return"WrappedRange"},le.WrappedRange=pe,le.createNativeRange=function(At){return At=Jt(At,Ze,"createNativeRange"),At.createRange()}})(),le.features.implementsTextRange){var zt=function(Y){var kt=Y.parentElement(),Rt=Y.duplicate();Rt.collapse(!0);var Wt=Rt.parentElement();Rt=Y.duplicate(),Rt.collapse(!1);var Pn=Rt.parentElement(),qt=Wt==Pn?Wt:we.getCommonAncestor(Wt,Pn);return qt==kt?qt:we.getCommonAncestor(kt,qt)},it=function(Y){return Y.compareEndPoints("StartToEnd",Y)==0},ae=function(Y,kt,Rt,Wt,Pn){var qt=Y.duplicate();qt.collapse(Rt);var xn=qt.parentElement();if(we.isOrIsAncestorOf(kt,xn)||(xn=kt),!xn.canHaveHTML){var ke=new rt(xn.parentNode,we.getNodeIndex(xn));return{boundaryPosition:ke,nodeInfo:{nodeIndex:ke.offset,containerElement:ke.node}}}var Ke=we.getDocument(xn).createElement("span");Ke.parentNode&&we.removeNode(Ke);for(var Le,dt=Rt?"StartToStart":"StartToEnd",At,Tt,wn,Zn,ao=Pn&&Pn.containerElement==xn?Pn.nodeIndex:0,Lo=xn.childNodes.length,yo=Lo,ho=yo;ho==Lo?xn.appendChild(Ke):xn.insertBefore(Ke,xn.childNodes[ho]),qt.moveToElementText(Ke),Le=qt.compareEndPoints(dt,Y),!(Le==0||ao==yo);){if(Le==-1){if(yo==ao+1)break;ao=ho}else yo=yo==ao+1?ao:ho;ho=Math.floor((ao+yo)/2),xn.removeChild(Ke)}if(Zn=Ke.nextSibling,Le==-1&&Zn&&en(Zn)){qt.setEndPoint(Rt?"EndToStart":"EndToEnd",Y);var Nn;if(/[\r\n]/.test(Zn.data)){var qn=qt.duplicate(),rr=qn.text.replace(/\r\n/g,"\r").length;for(Nn=qn.moveStart("character",rr);(Le=qn.compareEndPoints("StartToEnd",qn))==-1;)Nn++,qn.moveStart("character",1)}else Nn=qt.text.length;wn=new rt(Zn,Nn)}else At=(Wt||!Rt)&&Ke.previousSibling,Tt=(Wt||Rt)&&Ke.nextSibling,Tt&&en(Tt)?wn=new rt(Tt,0):At&&en(At)?wn=new rt(At,At.data.length):wn=new rt(xn,we.getNodeIndex(Ke));return we.removeNode(Ke),{boundaryPosition:wn,nodeInfo:{nodeIndex:ho,containerElement:xn}}},re=function(Y,kt){var Rt,Wt,Pn=Y.offset,qt=we.getDocument(Y.node),xn,ke,Ke=Lt(qt).createTextRange(),Le=en(Y.node);return Le?(Rt=Y.node,Wt=Rt.parentNode):(ke=Y.node.childNodes,Rt=Pn<ke.length?ke[Pn]:null,Wt=Y.node),xn=qt.createElement("span"),xn.innerHTML="&#feff;",Rt?Wt.insertBefore(xn,Rt):Wt.appendChild(xn),Ke.moveToElementText(xn),Ke.collapse(!kt),Wt.removeChild(xn),Le&&Ke[kt?"moveStart":"moveEnd"]("character",Pn),Ke};se=function(Y){this.textRange=Y,this.refresh()},se.prototype=new pt(document),se.prototype.refresh=function(){var Y,kt,Rt,Wt=zt(this.textRange);it(this.textRange)?kt=Y=ae(this.textRange,Wt,!0,!0).boundaryPosition:(Rt=ae(this.textRange,Wt,!0,!1),Y=Rt.boundaryPosition,kt=ae(this.textRange,Wt,!1,!1,Rt.nodeInfo).boundaryPosition),this.setStart(Y.node,Y.offset),this.setEnd(kt.node,kt.offset)},se.prototype.getName=function(){return"WrappedTextRange"},pt.copyComparisonConstants(se);var je=function(Y){if(Y.collapsed)return re(new rt(Y.startContainer,Y.startOffset),!0);var kt=re(new rt(Y.startContainer,Y.startOffset),!0),Rt=re(new rt(Y.endContainer,Y.endOffset),!1),Wt=Lt(pt.getRangeDocument(Y)).createTextRange();return Wt.setEndPoint("StartToStart",kt),Wt.setEndPoint("EndToEnd",Rt),Wt};if(se.rangeToTextRange=je,se.prototype.toTextRange=function(){return je(this)},le.WrappedTextRange=se,!le.features.implementsDomRange||le.config.preferTextRange){var vt=(function(Y){return Y("return this;")()})(Function);typeof vt.Range>"u"&&(vt.Range=se),le.createNativeRange=function(Y){return Y=Jt(Y,Ze,"createNativeRange"),Lt(Y).createTextRange()},le.WrappedRange=se}}le.createRange=function(Y){return Y=Jt(Y,Ze,"createRange"),new le.WrappedRange(le.createNativeRange(Y))},le.createRangyRange=function(Y){return Y=Jt(Y,Ze,"createRangyRange"),new pt(Y)},$e.createAliasForDeprecatedMethod(le,"createIframeRange","createRange"),$e.createAliasForDeprecatedMethod(le,"createIframeRangyRange","createRangyRange"),le.addShimListener(function(Y){var kt=Y.document;typeof kt.createRange>"u"&&(kt.createRange=function(){return le.createRange(kt)}),kt=Y=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,Y=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 On)return ve.win;var cn=we.getContentDocument(ve,Ze,mt);return we.getWindow(cn)}else return window}function Wt(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 xn=rt(window,"getSelection"),ke=$e.isHostObject(document,"selection");ae.implementsWinGetSelection=xn,ae.implementsDocSelection=ke;var Ke=ke&&(!xn||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(xn)zt=Wt,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 wn=rt(Le,"extend");ae.selectionHasExtend=wn;var Zn=rt(Le,"setBaseAndExtent");ae.selectionHasSetBaseAndExtent=Zn;var ao=typeof Le.rangeCount==se;ae.selectionHasRangeCount=ao;var Lo=!1,yo=!0,ho=wn?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<mt;++so)Kn[so]=ve.getRangeAt(so);var si=we.createTestElement(document,"",!1),ye=si.appendChild(document.createTextNode(" ")),ht=document.createRange();if(ht.setStart(ye,1),ht.collapse(!0),ve.removeAllRanges(),ve.addRange(ht),yo=ve.rangeCount==1,ve.removeAllRanges(),!cn){var fn=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(fn&&parseInt(fn[1])>=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;so<mt;++so)so==0&&br?ho?ho(ve,Kn[so]):(le.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),ve.addRange(Kn[so])):ve.addRange(Kn[so])}})(),ae.selectionSupportsMultipleRanges=Lo,ae.collapsedNonEditableSelectionsSupported=yo;var Nn=!1,qn;At&&rt(At,"createControlRange")&&(qn=At.createControlRange(),$e.areHostProperties(qn,["item","add"])&&(Nn=!0)),ae.implementsControlRange=Nn,Tt?it=function(ve){return ve.anchorNode===ve.focusNode&&ve.anchorOffset===ve.focusOffset}:it=function(ve){return ve.rangeCount?ve.getRangeAt(ve.rangeCount-1).collapsed:!1};function rr(ve,mt,cn){var Kn=cn?"end":"start",br=cn?"start":"end";ve.anchorNode=mt[Kn+"Container"],ve.anchorOffset=mt[Kn+"Offset"],ve.focusNode=mt[br+"Container"],ve.focusOffset=mt[br+"Offset"]}function ut(ve){var mt=ve.nativeSelection;ve.anchorNode=mt.anchorNode,ve.anchorOffset=mt.anchorOffset,ve.focusNode=mt.focusNode,ve.focusOffset=mt.focusOffset}function vn(ve){ve.anchorNode=ve.focusNode=null,ve.anchorOffset=ve.focusOffset=0,ve.rangeCount=0,ve.isCollapsed=!0,ve._ranges.length=0,In(ve)}function In(ve){ve.type=ve.rangeCount==0?"None":it(ve)?"Caret":"Range"}function sr(ve){var mt;return ve instanceof pt?(mt=le.createNativeRange(ve.getDocument()),mt.setEnd(ve.endContainer,ve.endOffset),mt.setStart(ve.startContainer,ve.startOffset)):ve instanceof Lt?mt=ve.nativeRange:ae.implementsDomRange&&ve instanceof we.getWindow(ve.startContainer).Range&&(mt=ve),mt}function wo(ve){if(!ve.length||ve[0].nodeType!=1)return!1;for(var mt=1,cn=ve.length;mt<cn;++mt)if(!we.isAncestorOf(ve[0],ve[mt]))return!1;return!0}function oo(ve){var mt=ve.getNodes();if(!wo(mt))throw Ze.createError("getSingleElementFromRange: range "+ve.inspect()+" did not consist of a single element");return mt[0]}function ta(ve){return!!ve&&typeof ve.text<"u"}function Ca(ve,mt){var cn=new Lt(mt);ve._ranges=[cn],rr(ve,cn,!1),ve.rangeCount=1,ve.isCollapsed=cn.collapsed,In(ve)}function Yi(ve){if(ve._ranges.length=0,ve.docSelection.type=="None")vn(ve);else{var mt=ve.docSelection.createRange();if(ta(mt))Ca(ve,mt);else{ve.rangeCount=mt.length;for(var cn,Kn=je(mt.item(0)),br=0;br<ve.rangeCount;++br)cn=le.createRange(Kn),cn.selectNode(mt.item(br)),ve._ranges.push(cn);ve.isCollapsed=ve.rangeCount==1&&ve._ranges[0].collapsed,rr(ve,ve._ranges[ve.rangeCount-1],!1),In(ve)}}}function fa(ve,mt){for(var cn=ve.docSelection.createRange(),Kn=oo(mt),br=je(cn.item(0)),so=vt(br).createControlRange(),si=0,ye=cn.length;si<ye;++si)so.add(cn.item(si));try{so.add(Kn)}catch{throw Ze.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}so.select(),Yi(ve)}var Ka;rt(Le,"getRangeAt")?Ka=function(ve,mt){try{return ve.getRangeAt(mt)}catch{return null}}:Tt&&(Ka=function(ve){var mt=je(ve.anchorNode),cn=le.createRange(mt);return cn.setStartAndEnd(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset),cn.collapsed!==this.isCollapsed&&cn.setStartAndEnd(ve.focusNode,ve.focusOffset,ve.anchorNode,ve.anchorOffset),cn});function On(ve,mt,cn){this.nativeSelection=ve,this.docSelection=mt,this._ranges=[],this.win=cn,this.refresh()}On.prototype=le.selectionPrototype;function Ts(ve){ve.win=ve.anchorNode=ve.focusNode=ve._ranges=null,ve.rangeCount=ve.anchorOffset=ve.focusOffset=0,ve.detached=!0,In(ve)}var Oo=[];function es(ve,mt){for(var cn=Oo.length,Kn,br;cn--;)if(Kn=Oo[cn],br=Kn.selection,mt=="deleteAll")Ts(br);else if(Kn.win==ve)return mt=="delete"?(Oo.splice(cn,1),!0):br;return mt=="deleteAll"&&(Oo.length=0),null}var Ui=function(ve){if(ve&&ve instanceof On)return ve.refresh(),ve;ve=Rt(ve,"getNativeSelection");var mt=es(ve),cn=zt(ve),Kn=ke?Pn(ve):null;return mt?(mt.nativeSelection=cn,mt.docSelection=Kn,mt.refresh()):(mt=new On(cn,Kn,ve),Oo.push({win:ve,selection:mt})),mt};le.getSelection=Ui,$e.createAliasForDeprecatedMethod(le,"getIframeSelection","getSelection");var gr=On.prototype;function gl(ve,mt){for(var cn=je(mt[0].startContainer),Kn=vt(cn).createControlRange(),br=0,so,si=mt.length;br<si;++br){so=oo(mt[br]);try{Kn.add(so)}catch{throw Ze.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}Kn.select(),Yi(ve)}if(!Ke&&Tt&&$e.areHostMethods(Le,["removeAllRanges","addRange"])){gr.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),vn(this)};var pa=function(ve,mt){ho(ve.nativeSelection,mt),ve.refresh()};ao?gr.addRange=function(ve,mt){if(Nn&&ke&&this.docSelection.type==re)fa(this,ve);else if(kt(mt)&&wn)pa(this,ve);else{var cn;Lo?cn=this.rangeCount:(this.removeAllRanges(),cn=0);var Kn=sr(ve).cloneRange();try{this.nativeSelection.addRange(Kn)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==cn+1){if(le.config.checkSelectionRanges){var br=Ka(this.nativeSelection,this.rangeCount-1);br&&!Y(br,ve)&&(ve=new Lt(br))}this._ranges[this.rangeCount-1]=ve,rr(this,ve,al(this.nativeSelection)),this.isCollapsed=it(this),In(this)}else this.refresh()}}:gr.addRange=function(ve,mt){kt(mt)&&wn?pa(this,ve):(this.nativeSelection.addRange(sr(ve)),this.refresh())},gr.setRanges=function(ve){if(Nn&&ke&&ve.length>1)gl(this,ve);else{this.removeAllRanges();for(var mt=0,cn=ve.length;mt<cn;++mt)this.addRange(ve[mt])}}}else if(rt(Le,"empty")&&rt(dt,"select")&&Nn&&Ke)gr.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var ve;if(this.anchorNode)ve=je(this.anchorNode);else if(this.docSelection.type==re){var mt=this.docSelection.createRange();mt.length&&(ve=je(mt.item(0)))}if(ve){var cn=vt(ve).createTextRange();cn.select(),this.docSelection.empty()}}}catch{}vn(this)},gr.addRange=function(ve){this.docSelection.type==re?fa(this,ve):(le.WrappedTextRange.rangeToTextRange(ve).select(),this._ranges[0]=ve,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,rr(this,ve,!1),In(this))},gr.setRanges=function(ve){this.removeAllRanges();var mt=ve.length;mt>1?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<cn;++mt)ve._ranges[mt]=new le.WrappedRange(ve.nativeSelection.getRangeAt(mt));rr(ve,ve._ranges[ve.rangeCount-1],al(ve.nativeSelection)),ve.isCollapsed=it(ve),In(ve)}else vn(ve)};else if(Tt&&typeof Le.isCollapsed==pe&&typeof dt.collapsed==pe&&ae.implementsDomRange)qi=function(ve){var mt,cn=ve.nativeSelection;cn.anchorNode?(mt=Ka(cn,0),ve._ranges=[mt],ve.rangeCount=1,ut(ve),ve.isCollapsed=it(ve),In(ve)):vn(ve)};else return Ze.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;gr.refresh=function(ve){var mt=ve?this._ranges.slice(0):null,cn=this.anchorNode,Kn=this.anchorOffset;if(qi(this),ve){var br=mt.length;if(br!=this._ranges.length||this.anchorNode!=cn||this.anchorOffset!=Kn)return!0;for(;br--;)if(!Y(mt[br],this._ranges[br]))return!0;return!1}};var Na=function(ve,mt){var cn=ve.getAllRanges();ve.removeAllRanges();for(var Kn=0,br=cn.length;Kn<br;++Kn)Y(mt,cn[Kn])||ve.addRange(cn[Kn]);ve.rangeCount||vn(ve)};Nn&&ke?gr.removeRange=function(ve){if(this.docSelection.type==re){for(var mt=this.docSelection.createRange(),cn=oo(ve),Kn=je(mt.item(0)),br=vt(Kn).createControlRange(),so,si=!1,ye=0,ht=mt.length;ye<ht;++ye)so=mt.item(ye),so!==cn||si?br.add(mt.item(ye)):si=!0;br.select(),Yi(this)}else Na(this,ve)}:gr.removeRange=function(ve){Na(this,ve)};var al;!Ke&&Tt&&ae.implementsDomRange?(al=qt,gr.isBackward=function(){return al(this)}):al=gr.isBackward=function(){return!1},gr.isBackwards=gr.isBackward,gr.toString=function(){for(var ve=[],mt=0,cn=this.rangeCount;mt<cn;++mt)ve[mt]=""+this._ranges[mt];return ve.join("")};function yl(ve,mt){if(ve.win.document!=je(mt))throw new Jt("WRONG_DOCUMENT_ERR")}function Cs(ve,mt){if(mt<0||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()}:wn&&(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;Kn<br;++Kn)cn[Kn].deleteContents();this.addRange(cn[br-1])}}},gr.eachRange=function(ve,mt){for(var cn=0,Kn=this._ranges.length;cn<Kn;++cn)if(ve(this.getRangeAt(cn)))return mt},gr.getAllRanges=function(){var ve=[];return this.eachRange(function(mt){ve.push(mt)}),ve},gr.setSingleRange=function(ve,mt){this.removeAllRanges(),this.addRange(ve,mt)},gr.callMethodOnEachRange=function(ve,mt){var cn=[];return this.eachRange(function(Kn){cn.push(Kn[ve].apply(Kn,mt||[]))}),cn};function _l(ve){return function(mt,cn){var Kn;this.rangeCount?(Kn=this.getRangeAt(0),Kn["set"+(ve?"Start":"End")](mt,cn)):(Kn=le.createRange(this.win.document),Kn.setStartAndEnd(mt,cn)),this.setSingleRange(Kn,this.isBackward())}}gr.setStart=_l(!0),gr.setEnd=_l(!1),le.rangePrototype.select=function(ve){Ui(this.getDocument()).setSingleRange(this,ve)},gr.changeEachRange=function(ve){var mt=[],cn=this.isBackward();this.eachRange(function(Kn){ve(Kn),mt.push(Kn)}),this.removeAllRanges(),cn&&mt.length==1?this.addRange(mt[0],"backward"):this.setRanges(mt)},gr.containsNode=function(ve,mt){return this.eachRange(function(cn){return cn.containsNode(ve,mt)},!0)||!1},gr.getBookmark=function(ve){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[ve])}},gr.moveToBookmark=function(ve){for(var mt=[],cn=0,Kn,br;Kn=ve.rangeBookmarks[cn++];)br=le.createRange(this.win),br.moveToBookmark(Kn),mt.push(br);ve.backward?this.setSingleRange(mt[0],"backward"):this.setRanges(mt)},gr.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},gr.restoreRanges=function(ve){this.removeAllRanges();for(var mt=0,cn;cn=ve.ranges[mt];++mt)this.addRange(cn,ve.backward&&mt==0)},gr.toHtml=function(){var ve=[];return this.eachRange(function(mt){ve.push(pt.toHtml(mt))}),ve.join("")},ae.implementsTextRange&&(gr.getNativeTextRange=function(){var ve;if(ve=this.docSelection){var mt=ve.createRange();if(ta(mt))return mt;throw Ze.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)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<si;++so)mt[so]=pt.inspect(ve.getRangeAt(so));return"["+br+"(Ranges: "+mt.join(", ")+")(anchor: "+cn.inspect()+", focus: "+Kn.inspect()+"]"}gr.getName=function(){return"WrappedSelection"},gr.inspect=function(){return ts(this)},gr.detach=function(){es(this.win,"delete"),Ts(this)},On.detachAll=function(){es(null,"deleteAll")},On.inspect=ts,On.isDirectionBackward=kt,le.Selection=On,le.selectionPrototype=gr,le.addShimListener(function(ve){typeof ve.getSelection>"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),X(window,"load",gt))),B})})(bS)),bS.exports}var Mne=ZI();const _R=Z_(Mne);var wS={exports:{}},bR;function Tne(){return bR||(bR=1,(function(e,t){(function(n,o){e.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",Y=vt?re.className:re.getAttribute("class");Y=Y.replace(new RegExp("(^|\\s)"+je+"(\\s|$)"),ae),vt?re.className=Y:re.setAttribute("class",Y)}}})();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,Y=je.length;vt<Y;++vt)if(!w(ae,E(je[vt])))return!1;return!0}function F(ae){var re=ae.parentNode;return re&&re.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(re.nodeName)}function I(ae,re,je,vt,Y){var kt=ae.node,Rt=ae.offset,Wt=kt,Pn=Rt;kt==vt&&Rt>Y&&++Pn,kt==re&&(Rt==je||Rt==je+1)&&(Wt=vt,Pn+=Y-je),kt==re&&Rt>je+1&&--Pn,ae.node=Wt,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 Y=ae.parentNode,kt=i.getNodeIndex(ae);f(vt,function(Rt){I(Rt,Y,kt,re,je)}),re.childNodes.length==je?re.appendChild(ae):re.insertBefore(ae,re.childNodes[je])}function q(ae,re){var je=ae.parentNode,vt=i.getNodeIndex(ae);f(re,function(Y){V(Y,je,vt)}),i.removeNode(ae)}function X(ae,re,je,vt,Y){for(var kt,Rt=[];kt=ae.firstChild;)z(kt,re,je++,Y),Rt.push(kt);return q(ae,Y),Rt}function G(ae,re){return X(ae,ae.parentNode,i.getNodeIndex(ae),!0,re)}function Q(ae,re){var je=ae.cloneRange();je.selectNodeContents(re);var vt=je.intersection(ae),Y=vt?vt.toString():"";return Y!=""}function J(ae){for(var re=ae.getNodes([3]),je=0,vt;(vt=re[je])&&!Q(ae,vt);)++je;for(var Y=re.length-1;(vt=re[Y])&&!Q(ae,vt);)--Y;return re.slice(je,Y+1)}function ie(ae,re){if(ae.attributes.length!=re.attributes.length)return!1;for(var je=0,vt=ae.attributes.length,Y,kt,Rt;je<vt;++je)if(Y=ae.attributes[je],Rt=Y.name,Rt!="class"&&(kt=re.attributes.getNamedItem(Rt),Y===null!=(kt===null)||Y.specified!=kt.specified||Y.specified&&Y.nodeValue!==kt.nodeValue))return!1;return!0}function Se(ae,re){for(var je=0,vt=ae.attributes.length,Y;je<vt;++je)if(Y=ae.attributes[je].name,!(re&&s(re,Y))&&ae.attributes[je].specified&&Y!="class")return!0;return!1}var Ae=i.getComputedStyleProperty,Pe=(function(){var ae=document.createElement("div");return typeof ae.isContentEditable=="boolean"?function(re){return re&&re.nodeType==1&&re.isContentEditable}:function(re){return!re||re.nodeType!=1||re.contentEditable=="false"?!1:re.contentEditable=="true"||Pe(re.parentNode)}})();function De(ae){var re;return ae&&ae.nodeType==1&&((re=ae.parentNode)&&re.nodeType==9&&re.designMode=="on"||Pe(ae)&&!Pe(ae.parentNode))}function ze(ae){return(Pe(ae)||ae.nodeType!=1&&Pe(ae.parentNode))&&!De(ae)}var Ye=/^inline(-block|-table)?$/i;function Be(ae){return ae&&ae.nodeType==1&&!Ye.test(Ae(ae,"display"))}var Je=/[^\r\n\t\f \u200B]/;function gt(ae){if(ae.data.length==0)return!0;if(Je.test(ae.data))return!1;var re=Ae(ae.parentNode,"whiteSpace");switch(re){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(ae.data))return!1}return Be(ae.previousSibling)||Be(ae.nextSibling)}function le(ae){var re=[],je,vt;for(je=0;vt=ae[je++];)re.push(new a(vt.startContainer,vt.startOffset),new a(vt.endContainer,vt.endOffset));return re}function Ze(ae,re){for(var je=0,vt,Y,kt,Rt=ae.length;je<Rt;++je)vt=ae[je],Y=re[je*2],kt=re[je*2+1],vt.setStartAndEnd(Y.node,Y.offset,kt.node,kt.offset)}function pe(ae,re){return i.isCharacterDataNode(ae)?re==0?!!ae.previousSibling:re==ae.length?!!ae.nextSibling:!0:re>0&&re<ae.childNodes.length}function se(ae,re,je,vt){var Y,kt,Rt=je==0;if(i.isAncestorOf(re,ae))return ae;if(i.isCharacterDataNode(re)){var Wt=i.getNodeIndex(re);if(je==0)je=Wt;else if(je==re.length)je=Wt+1;else throw r.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+je+" in "+re.data);re=re.parentNode}if(pe(re,je)){Y=re.cloneNode(!1),kt=re.parentNode,Y.id&&Y.removeAttribute("id");for(var Pn,qt=0;Pn=re.childNodes[je];)z(Pn,Y,qt++,vt);return z(Y,kt,i.getNodeIndex(re)+1,vt),re==ae?Y:se(ae,kt,i.getNodeIndex(Y),vt)}else if(ae!=re){Y=re.parentNode;var xn=i.getNodeIndex(re);return Rt||xn++,se(ae,Y,xn,vt)}return ae}function we(ae,re){return ae.namespaceURI==re.namespaceURI&&ae.tagName.toLowerCase()==re.tagName.toLowerCase()&&P(ae,re)&&ie(ae,re)&&Ae(ae,"display")=="inline"&&Ae(re,"display")=="inline"}function $e(ae){var re=ae?"nextSibling":"previousSibling";return function(je,vt){var Y=je.parentNode,kt=je[re];if(kt){if(kt&&kt.nodeType==3)return kt}else if(vt&&(kt=Y[re],kt&&kt.nodeType==1&&we(Y,kt))){var Rt=kt[ae?"firstChild":"lastChild"];if(Rt&&Rt.nodeType==3)return Rt}return null}}var rt=$e(!1),pt=$e(!0);function Lt(ae){this.isElementMerge=ae.nodeType==1,this.textNodes=[];var re=this.isElementMerge?ae.lastChild:ae;re&&(this.textNodes[0]=re)}Lt.prototype={doMerge:function(ae){var re=this.textNodes,je=re[0];if(re.length>1){var vt=i.getNodeIndex(je),Y=[],kt=0,Rt;f(re,function(Wt,Pn){Rt=Wt.parentNode,Pn>0&&(Rt.removeChild(Wt),Rt.hasChildNodes()||i.removeNode(Rt),ae&&f(ae,function(qt){qt.node==Wt&&(qt.node=je,qt.offset+=kt),qt.node==Rt&&qt.offset>vt&&(--qt.offset,qt.offset==vt+1&&Pn<re.length-1&&(qt.node=je,qt.offset=kt))})),Y[Pn]=Wt.data,kt+=Wt.data.length}),je.data=Y.join("")}return je.data},getLength:function(){for(var ae=this.textNodes.length,re=0;ae--;)re+=this.textNodes[ae].length;return re},toString:function(){var ae=[];return f(this.textNodes,function(re,je){ae[je]="'"+re.data+"'"}),"[Merge("+ae.join(",")+")]"}};var Jt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],en={};function zt(ae,re,je){var vt,Y,kt,Rt,Wt=this;Wt.cssClass=Wt.className=ae;var Pn=null,qt={};if(typeof re=="object"&&re!==null){for(typeof re.elementTagName<"u"&&(re.elementTagName=re.elementTagName.toLowerCase()),je=re.tagNames,Pn=re.elementProperties,qt=re.elementAttributes,Y=0;Rt=Jt[Y++];)re.hasOwnProperty(Rt)&&(Wt[Rt]=re[Rt]);vt=re.normalize}else vt=re;Wt.normalize=typeof vt>"u"?!0:vt,Wt.attrExceptions=[];var xn=document.createElement(Wt.elementTagName);Wt.elementProperties=Wt.copyPropertiesToElement(Pn,xn,!0),b(qt,function(Ke,Le){Wt.attrExceptions.push(Ke),qt[Ke]=""+Le}),Wt.elementAttributes=qt,Wt.elementSortedClassName=Wt.elementProperties.hasOwnProperty("className")?$(Wt.elementProperties.className+" "+ae):ae,Wt.applyToAnyTagName=!1;var ke=typeof je;if(ke=="string")je=="*"?Wt.applyToAnyTagName=!0:Wt.tagNames=E(je.toLowerCase()).split(/\s*,\s*/);else if(ke=="object"&&typeof je.length=="number")for(Wt.tagNames=[],Y=0,kt=je.length;Y<kt;++Y)je[Y]=="*"?Wt.applyToAnyTagName=!0:Wt.tagNames.push(je[Y].toLowerCase());else Wt.tagNames=[Wt.elementTagName]}zt.prototype={elementTagName:h,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(ae,re,je){var vt,Y,kt={},Rt,Wt,Pn,qt;for(var xn in ae)if(ae.hasOwnProperty(xn))if(Wt=ae[xn],Pn=re[xn],xn=="className")S(re,Wt),S(re,this.className),re[xn]=$(re[xn]),je&&(kt[xn]=Wt);else if(xn=="style"){Y=Pn,je&&(kt[xn]=Rt={});for(vt in ae[xn])ae[xn].hasOwnProperty(vt)&&(Y[vt]=Wt[vt],je&&(Rt[vt]=Y[vt]));this.attrExceptions.push(xn)}else re[xn]=Wt,je&&(kt[xn]=re[xn],qt=en.hasOwnProperty(xn)?en[xn]:xn,this.attrExceptions.push(qt));return je?kt:""},copyAttributesToElement:function(ae,re){for(var je in ae)ae.hasOwnProperty(je)&&!/^class(?:Name)?$/i.test(je)&&re.setAttribute(je,ae[je])},appliesToElement:function(ae){return s(this.tagNames,ae.tagName.toLowerCase())},getEmptyElements:function(ae){var re=this;return ae.getNodes([1],function(je){return re.appliesToElement(je)&&!je.hasChildNodes()})},hasClass:function(ae){return ae.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(ae))&&w(ae,this.className)},getSelfOrAncestorWithClass:function(ae){for(;ae;){if(this.hasClass(ae))return ae;ae=ae.parentNode}return null},isModifiable:function(ae){return!this.applyToEditableOnly||ze(ae)},isIgnorableWhiteSpaceNode:function(ae){return this.ignoreWhiteSpace&&ae&&ae.nodeType==3&>(ae)},postApply:function(ae,re,je,vt){var Y=ae[0],kt=ae[ae.length-1],Rt=[],Wt,Pn=Y,qt=kt,xn=0,ke=kt.length,Ke;f(ae,function(Tt){Ke=rt(Tt,!vt),Ke?(Wt||(Wt=new Lt(Ke),Rt.push(Wt)),Wt.textNodes.push(Tt),Tt===Y&&(Pn=Wt.textNodes[0],xn=Pn.length),Tt===kt&&(qt=Wt.textNodes[0],ke=Wt.getLength())):Wt=null});var Le=pt(kt,!vt);if(Le&&(Wt||(Wt=new Lt(kt),Rt.push(Wt)),Wt.textNodes.push(Le)),Rt.length){for(var dt=0,At=Rt.length;dt<At;++dt)Rt[dt].doMerge(je);re.setStartAndEnd(Pn,xn,qt,ke)}},createContainer:function(ae){var re=i.getDocument(ae),je=v&&!i.isHtmlNamespace(ae)&&ae.namespaceURI?re.createElementNS(ae.namespaceURI,this.elementTagName):re.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,je,!1),this.copyAttributesToElement(this.elementAttributes,je),S(je,this.className),this.onElementCreate&&this.onElementCreate(je,this),je},elementHasProperties:function(ae,re){var je=this;return b(re,function(vt,Y){if(vt=="className")return B(ae,Y);if(typeof Y=="object"){if(!je.elementHasProperties(ae[vt],Y))return!1}else if(ae[vt]!==Y)return!1})},elementHasAttributes:function(ae,re){return b(re,function(je,vt){if(ae.getAttribute(je)!==vt)return!1})},applyToTextNode:function(ae,re){if(F(ae)){var je=ae.parentNode;if(je.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(je)&&this.elementHasProperties(je,this.elementProperties)&&this.elementHasAttributes(je,this.elementAttributes))S(je,this.className);else{var vt=ae.parentNode,Y=this.createContainer(vt);vt.insertBefore(Y,ae),Y.appendChild(ae)}}},isRemovable:function(ae){return ae.tagName.toLowerCase()==this.elementTagName&&D(ae)==this.elementSortedClassName&&this.elementHasProperties(ae,this.elementProperties)&&!Se(ae,this.attrExceptions)&&this.elementHasAttributes(ae,this.elementAttributes)&&this.isModifiable(ae)},isEmptyContainer:function(ae){var re=ae.childNodes.length;return ae.nodeType==1&&this.isRemovable(ae)&&(re==0||re==1&&this.isEmptyContainer(ae.firstChild))},removeEmptyContainers:function(ae){var re=this,je=ae.getNodes([1],function(kt){return re.isEmptyContainer(kt)}),vt=[ae],Y=le(vt);f(je,function(kt){q(kt,Y)}),Ze(vt,Y)},undoToTextNode:function(ae,re,je,vt){if(!re.containsNode(je)){var Y=re.cloneRange();Y.selectNode(je),Y.isPointInRange(re.endContainer,re.endOffset)&&(se(je,re.endContainer,re.endOffset,vt),re.setEndAfter(je)),Y.isPointInRange(re.startContainer,re.startOffset)&&(je=se(je,re.startContainer,re.startOffset,vt))}this.isRemovable(je)?G(je,vt):M(je,this.className)},splitAncestorWithClass:function(ae,re,je){var vt=this.getSelfOrAncestorWithClass(ae);vt&&se(vt,ae,re,je)},undoToAncestor:function(ae,re){this.isRemovable(ae)?G(ae,re):M(ae,this.className)},applyToRange:function(ae,re){var je=this;re=re||[];var vt=le(re||[]);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae);var Y=J(ae);if(Y.length){f(Y,function(Wt){!je.isIgnorableWhiteSpaceNode(Wt)&&!je.getSelfOrAncestorWithClass(Wt)&&je.isModifiable(Wt)&&je.applyToTextNode(Wt,vt)});var kt=Y[Y.length-1];ae.setStartAndEnd(Y[0],0,kt,kt.length),je.normalize&&je.postApply(Y,ae,vt,!1),Ze(re,vt)}var Rt=je.getEmptyElements(ae);f(Rt,function(Wt){S(Wt,je.className)})},applyToRanges:function(ae){for(var re=ae.length;re--;)this.applyToRange(ae[re],ae);return ae},applyToSelection:function(ae){var re=o.getSelection(ae);re.setRanges(this.applyToRanges(re.getAllRanges()))},undoToRange:function(ae,re){var je=this;re=re||[];var vt=le(re);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae,vt);var Y=J(ae),kt,Rt,Wt=Y[Y.length-1];if(Y.length){je.splitAncestorWithClass(ae.endContainer,ae.endOffset,vt),je.splitAncestorWithClass(ae.startContainer,ae.startOffset,vt);for(var Pn=0,qt=Y.length;Pn<qt;++Pn)kt=Y[Pn],Rt=je.getSelfOrAncestorWithClass(kt),Rt&&je.isModifiable(kt)&&je.undoToAncestor(Rt,vt);ae.setStartAndEnd(Y[0],0,Wt,Wt.length),je.normalize&&je.postApply(Y,ae,vt,!0),Ze(re,vt)}var xn=je.getEmptyElements(ae);f(xn,function(ke){M(ke,je.className)})},undoToRanges:function(ae){for(var re=ae.length;re--;)this.undoToRange(ae[re],ae);return ae},undoToSelection:function(ae){var re=o.getSelection(ae),je=o.getSelection(ae).getAllRanges();this.undoToRanges(je),re.setRanges(je)},isAppliedToRange:function(ae){if(ae.collapsed||ae.toString()=="")return!!this.getSelfOrAncestorWithClass(ae.commonAncestorContainer);var re=ae.getNodes([3]);if(re.length){for(var je=0,vt;vt=re[je++];)if(!this.isIgnorableWhiteSpaceNode(vt)&&Q(ae,vt)&&this.isModifiable(vt)&&!this.getSelfOrAncestorWithClass(vt))return!1}return!0},isAppliedToRanges:function(ae){var re=ae.length;if(re==0)return!1;for(;re--;)if(!this.isAppliedToRange(ae[re]))return!1;return!0},isAppliedToSelection:function(ae){var re=o.getSelection(ae);return this.isAppliedToRanges(re.getAllRanges())},toggleRange:function(ae){this.isAppliedToRange(ae)?this.undoToRange(ae):this.applyToRange(ae)},toggleSelection:function(ae){this.isAppliedToSelection(ae)?this.undoToSelection(ae):this.applyToSelection(ae)},getElementsWithClassIntersectingRange:function(ae){var re=[],je=this;return ae.getNodes([3],function(vt){var Y=je.getSelfOrAncestorWithClass(vt);Y&&!s(re,Y)&&re.push(Y)}),re},detach:function(){}};function it(ae,re,je){return new zt(ae,re,je)}zt.util={hasClass:w,addClass:S,removeClass:M,getClass:T,hasSameClasses:P,hasAllClasses:B,replaceWithOwnChildren:G,elementsHaveSameNonClassAttributes:ie,elementHasNonClassAttributes:Se,splitNodeAt:se,isEditableElement:Pe,isEditingHost:De,isEditable:ze},o.CssClassApplier=o.ClassApplier=zt,o.createClassApplier=it,l.createAliasForDeprecatedMethod(o,"createCssClassApplier","createClassApplier",r)}),n})})(wS)),wS.exports}Tne();var wR={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function ER(e){var t,n,o=((t=e==null?void 0:e.extensions)===null||t===void 0?void 0:t.button)||((n=e==null?void 0:e.extensions)===null||n===void 0?void 0:n.button),r=(e==null?void 0:e.Extension)||(e==null?void 0:e.Extension),i=o||r;return i?i.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",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 Cne=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Nne=function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i},xR=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},OR=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))};(function(e){Cne(t,e);function t(n){var o=e.call(this,n)||this;o.labelMap=new Map;var r=n.lf,i=n.graphModel;return o.lf=r,o.graphModel=i,o.state={tick:0},o}return t.prototype.componentDidMount=function(){var n=this,o=this.props.graphModel;this.editor=new D0(".lf-label-editor",Yv(wR,{autoLink:!0,extensions:{colorPicker:new(ER(D0))}})),o.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),o.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},t.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?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))}})))},t.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},t.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 gne(O,f,i);w.set(S.id,S),l.push($t(vne,{label:S,element:f,graphModel:i},S.id))})}),l}return null},t.prototype.render=function(){return $t("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},t.toolName="label-edit-tool",t=Nne([xs],t),t})(ko);var SR=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},AR=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},kne=(function(){function e(t){var n=t.lf,o=t.options,r=this,i;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;r.handleMouseDown(s)},this.draw=function(a){var s=r.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,f=s.y;if(r.endPoint={x:l,y:f},r.startPoint){var h=r.startPoint,v=h.x,b=h.y,E=v,O=b,w=l-v,S=f-b;l<v&&(E=l,w=v-l),f<b&&(O=f,S=b-f),r.wrapper&&(r.wrapper.style.left="".concat(E,"px"),r.wrapper.style.top="".concat(O,"px"),r.wrapper.style.width="".concat(w,"px"),r.wrapper.style.height="".concat(S,"px"))}},this.drawOff=function(a){if(r.lf.updateEditConfig({stopMoveGraph:r.originalStopMoveGraph}),r.originStatusSaved=!1,r.mouseDownInfo){var s=r.mouseDownInfo,l=s.x,f=s.y,h=s.time,v=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-f)<5&&Date.now()-h<200;if(v){r.lf.clearSelectElements(),r.cleanupSelectionState();return}}var b=to(r.startPoint),E=to(r.endPoint);if(document.removeEventListener("mousemove",r.draw),r.exclusiveMode||document.removeEventListener("mouseup",r.drawOff),b&&E){var l=b.x,f=b.y,O=E.x,w=E.y,S=[Math.min(l,O),Math.min(f,w)],M=[Math.max(l,O),Math.max(f,w)];if(r.lf.emit("selection:selected-area",{topLeft:S,bottomRight:M}),Math.abs(O-l)<10&&Math.abs(w-f)<10){r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0);return}var T=r.lf.graphModel.getAreaElement(S,M,r.isWholeEdge,r.isWholeNode,!0),$=r.lf.graphModel,D=$.dynamicGroup,P=$.group,B=[],F=r.lf.getSelectElements(),I=new Set(AR(AR([],SR(F.nodes.map(function(q){return q.id})),!1),SR(F.edges.map(function(q){return q.id})),!1));T.forEach(function(q){if(P){var X=P.getNodeGroup(q.id);if(T.includes(X))return}if(D){var X=D.getGroupByNodeId(q.id);if(T.includes(X))return}if(r.exclusiveMode&&I.has(q.id)){r.lf.deselectElementById(q.id);return}r.lf.selectElementById(q.id,!0),B.push(q)}),r.startPoint=void 0,r.endPoint=void 0,B.length>0&&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 e.prototype.render=function(t,n){this.container=n},e.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)},e.prototype.setExclusiveMode=function(t){t===void 0&&(t=!1),this.exclusiveMode!==t&&(this.cleanupSelectionState(),this.exclusiveMode=t,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},e.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)))},e.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},e.prototype.handleMouseDown=function(t){var n;if(!(!this.container||this.disabled)){var o=t.button===2;if(!o){this.cleanupSelectionState(),this.mouseDownInfo={x:t.clientX,y:t.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(t.clientX,t.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)}}},e.prototype.setSelectionSense=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=!0),this.isWholeEdge=t,this.isWholeNode=n},e.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},e.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var t=to(this.endPoint),n=new MouseEvent("mouseup",{clientX:t.x,clientY:t.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},e.prototype.open=function(){this.disabled=!1},e.prototype.close=function(){this.disabled=!0},e.pluginName="selectionSelect",e})();var JI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Eg=function(){return Eg=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Eg.apply(this,arguments)},v_=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Pne={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function Rne(e){for(var t=e,n=1;n<t.length-1;){var o=v_(t[n-1],2),r=o[0],i=o[1],a=v_(t[n],2),s=a[0],l=a[1],f=v_(t[n+1],2),h=f[0],v=f[1];r===s&&s===h||i===l&&l===v?t.splice(n,1):n++}return t}function Dne(e,t,n,o){var r=[e[0],e[1]],i=[e[0],e[1]];switch(n){case"tl":return t==="tr"?(r[1]+=o,i[0]+=o):t==="lb"&&(r[0]+=o,i[1]+=o),[r,i];case"tr":return t==="tl"?(r[1]+=o,i[0]-=o):t==="rb"&&(r[0]-=o,i[1]+=o),[r,i];case"bl":return t==="br"?(r[1]-=o,i[0]+=o):t==="lt"&&(r[0]+=o,i[1]-=o),[r,i];case"br":return t==="bl"?(r[1]-=o,i[0]-=o):t==="rt"&&(r[0]-=o,i[1]-=o),[r,i];default:return[]}}function jne(e,t,n,o){var r,i=1,a=function(S,M){var T=M[0]-S[0],$=M[1]-S[1],D=Math.abs(T),P=Math.abs($);return P<=i&&D>i?T<0?"l":"r":D<=i&&P>i?$<0?"t":"b":D<=i&&P<=i?"":D<P?T<0?"l":"r":$<0?"t":"b"},s=a(e,t),l=a(t,n),f=Math.min(Math.hypot(t[0]-e[0],t[1]-e[1])/2,Math.hypot(n[0]-t[0],n[1]-t[1])/2,o)||1/5*o,h="".concat(s).concat(l),v=Pne[h]||"-",b="";if(v==="-")b+="L ".concat(t[0]," ").concat(t[1]);else{var E=v_(Dne(t,h,v,f),2),O=E[0],w=E[1];O&&w&&(b+="L ".concat(O[0]," ").concat(O[1]," Q ").concat(t[0]," ").concat(t[1]," ").concat(w[0]," ").concat(w[1]),r=v_(w,2),t[0]=r[0],t[1]=r[1])}return b}function Lne(e,t){var n=0,o="";if(e.length===2)o+="M".concat(e[n][0]," ").concat(e[n++][1]," L ").concat(e[n][0]," ").concat(e[n][1]);else{for(o+="M".concat(e[n][0]," ").concat(e[n++][1]);n+1<e.length;){var r=e[n-1],i=e[n],a=e[n+++1];o+=jne(r,i,a,t)}o+="L ".concat(e[n][0]," ").concat(e[n][1])}return o}(function(e){JI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.radius,s=a===void 0?5:a,l=n.getEdgeStyle(),f=n.getEdgeAnimationStyle(),h=Rne(o.split(" ").map(function(E){return E.split(",").map(function(O){return+O})})),v=Lne(h,s),b=Eg(Eg(Eg({style:r?f:{}},l),i),{fill:"none"});return Lr("path",Eg({d:v},b))},t})($_);(function(e){JI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(F_);var QI=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u1=function(){return u1=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},u1.apply(this,arguments)},MR=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TR=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},Ine=(function(e){QI(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getLabelShape=function(){var n=this.props.model,o=n.id,r=n.x,i=n.y,a=n.width,s=n.height,l=n.properties,f=this.props.model.getNodeStyle();return Lr("svg",{x:r-a/2,y:i-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?Lr("text",{x:0,y:-5,fontSize:"16px",fill:f.stroke},l.labelText):"",l.disabledDelete?"":Lr("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:f.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,o)},"x")])},t.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.id,l=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",u1(u1({},l),{x:o-i/2,y:r-a/2,width:i,height:a,id:s})),this.getLabelShape()])},t.prototype.toFront=function(){},t.prototype.handleCustomDeleteIconClick=function(n){var o=this.props.graphModel;o.deleteNode(n)},t})(zw),Fne=(function(e){QI(t,e);function t(){var n=e.apply(this,TR([],MR(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return t.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},e.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},t.prototype.setAttributes=function(){var n=this,o;this.points=[],((o=this.properties)===null||o===void 0?void 0:o.node_selection_ids).length>1&&setTimeout(function(){var r;n.updatePointsByNodes(((r=n.properties)===null||r===void 0?void 0:r.node_selection_ids)||[])})},t.prototype.getNodeStyle=function(){var n=e.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.updatePoints=function(n){this.points=n},t.prototype.updateCoordinate=function(n){var o=n.x,r=n.y;this.x=o,this.y=r},t.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}))},t.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=e.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},t})(Uw),v2="node-selection";(function(){function e(t){var n=t.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:v2,view:Ine,model:Fne})}return Object.defineProperty(e.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(t){return t.id})},enumerable:!1,configurable:!0}),e.prototype.addNodeSelection=function(){var t=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});t.updatePointsByNodes(this.selectNodesIds)},e.prototype.updateNodeSelection=function(){var t,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(t=this.lf.getNodeModelById(n.id))===null||t===void 0||t.updatePointsByNodes(this.selectNodesIds))},e.prototype.getNodeSelection=function(){var t=this,n=this.selectNodesIds,o=this.lf.getGraphRawData(),r=n.filter(function(i){return i!==t.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})},e.prototype.onNodeChange=function(t,n){var o=t.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||[])})})},e.prototype.render=function(t){var n=this;this.lf=t,t.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=t.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?i?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),t.graphModel.addNodeMoveRules(function(o,r,i){if(n.onNodeChange(t,o),ew(o)&&!o.isResize){var a=o.properties.node_selection_ids||[];return t.graphModel.moveNodes(a,r,i,!0),!0}return!0}),t.graphModel.addNodeResizeRules(function(o){return ew(o)||n.onNodeChange(t,o),!0})},e.pluginName="node-selection",e})();var ew=function(e){return!!(e&&e.type===v2)},Bne=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c1=function(){return c1=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},c1.apply(this,arguments)};(function(e){Bne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.properties;return Lr("text",{x:o-i/2+5,y:r-a/2+16,fontSize:12,fill:"blue"},s.moreText)},t.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",c1(c1({},s),{fill:"#FFFFFF",x:o-i/2,y:r-a/2})),this.getLabelShape()])},t})(Zv);var I0={exports:{}},CR;function $ne(){return CR||(CR=1,(function(e,t){(function(n,o){e.exports=o()})(window,(function(){return(function(n){var o={};function r(i){if(o[i])return o[i].exports;var a=o[i]={i,l:!1,exports:{}};return n[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=n,r.c=o,r.d=function(i,a,s){r.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:s})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,a){if(1&a&&(i=r(i)),8&a||4&a&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var l in i)r.d(s,l,(function(f){return i[f]}).bind(null,l));return s},r.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(a,"a",a),a},r.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},r.p="",r(r.s=222)})([function(n,o,r){r.d(o,"a",(function(){return P})),r.d(o,"b",(function(){return D})),r.d(o,"c",(function(){return le})),r.d(o,"d",(function(){return Ze})),r.d(o,"e",(function(){return M})),r.d(o,"f",(function(){return $})),r.d(o,"g",(function(){return M})),r.d(o,"h",(function(){return gt})),r.d(o,"i",(function(){return a})),r.d(o,"j",(function(){return Je})),r.d(o,"k",(function(){return X}));var i,a,s,l,f,h,v,b={},E=[],O=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function w(pe,se){for(var we in se)pe[we]=se[we];return pe}function S(pe){var se=pe.parentNode;se&&se.removeChild(pe)}function M(pe,se,we){var $e,rt,pt,Lt={};for(pt in se)pt=="key"?$e=se[pt]:pt=="ref"?rt=se[pt]:Lt[pt]=se[pt];if(arguments.length>2&&(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;se<pe.__k.length;se++)if((we=pe.__k[se])!=null&&we.__e!=null)return we.__e;return typeof pe.type=="function"?B(pe):null}function F(pe){var se,we;if((pe=pe.__)!=null&&pe.__c!=null){for(pe.__e=pe.__c.base=null,se=0;se<pe.__k.length;se++)if((we=pe.__k[se])!=null&&we.__e!=null){pe.__e=pe.__c.base=we.__e;break}return F(pe)}}function I(pe){(!pe.__d&&(pe.__d=!0)&&l.push(pe)&&!V.__r++||h!==a.debounceRendering)&&((h=a.debounceRendering)||f)(V)}function V(){for(var pe;V.__r=l.length;)pe=l.sort((function(se,we){return se.__v.__b-we.__v.__b})),l=[],pe.some((function(se){var we,$e,rt,pt,Lt,Jt;se.__d&&(Lt=(pt=(we=se).__v).__e,(Jt=we.__P)&&($e=[],(rt=w({},pt)).__v=pt.__v+1,Ae(Jt,pt,rt,we.__n,Jt.ownerSVGElement!==void 0,pt.__h!=null?[Lt]:null,$e,Lt??B(pt),pt.__h),Pe($e,pt),pt.__e!=Lt&&F(pt)))}))}function z(pe,se,we,$e,rt,pt,Lt,Jt,en,zt){var it,ae,re,je,vt,Y,kt,Rt=$e&&$e.__k||E,Wt=Rt.length;for(we.__k=[],it=0;it<se.length;it++)if((je=we.__k[it]=(je=se[it])==null||typeof je=="boolean"?null:typeof je=="string"||typeof je=="number"||typeof je=="bigint"?T(null,je,null,null,je):Array.isArray(je)?T(D,{children:je},null,null,null):je.__b>0?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;ae<Wt;ae++){if((re=Rt[ae])&&je.key==re.key&&je.type===re.type){Rt[ae]=void 0;break}re=null}Ae(pe,je,re=re||b,rt,pt,Lt,Jt,en,zt),vt=je.__e,(ae=je.ref)&&re.ref!=ae&&(kt||(kt=[]),re.ref&&kt.push(re.ref,null,je),kt.push(ae,je.__c||vt,je)),vt!=null?(Y==null&&(Y=vt),typeof je.type=="function"&&je.__k===re.__k?je.__d=en=q(je,en,pe):en=G(pe,je,re,Rt,vt,en),typeof we.type=="function"&&(we.__d=en)):en&&re.__e==en&&en.parentNode!=pe&&(en=B(re))}for(we.__e=Y,it=Wt;it--;)Rt[it]!=null&&(typeof we.type=="function"&&Rt[it].__e!=null&&Rt[it].__e==we.__d&&(we.__d=B($e,it+1)),Ye(Rt[it],Rt[it]));if(kt)for(it=0;it<kt.length;it++)ze(kt[it],kt[++it],kt[++it])}function q(pe,se,we){for(var $e,rt=pe.__k,pt=0;rt&&pt<rt.length;pt++)($e=rt[pt])&&($e.__=pe,se=typeof $e.type=="function"?q($e,se,we):G(we,$e,$e,rt,$e.__e,se));return se}function X(pe,se){return se=se||[],pe==null||typeof pe=="boolean"||(Array.isArray(pe)?pe.some((function(we){X(we,se)})):se.push(pe)),se}function G(pe,se,we,$e,rt,pt){var Lt,Jt,en;if(se.__d!==void 0)Lt=se.__d,se.__d=void 0;else if(we==null||rt!=pt||rt.parentNode==null)e:if(pt==null||pt.parentNode!==pe)pe.appendChild(rt),Lt=null;else{for(Jt=pt,en=0;(Jt=Jt.nextSibling)&&en<$e.length;en+=2)if(Jt==rt)break e;pe.insertBefore(rt,pt),Lt=pt}return Lt!==void 0?Lt:rt.nextSibling}function Q(pe,se,we){se[0]==="-"?pe.setProperty(se,we):pe[se]=we==null?"":typeof we!="number"||O.test(se)?we:we+"px"}function J(pe,se,we,$e,rt){var pt;e:if(se==="style")if(typeof we=="string")pe.style.cssText=we;else{if(typeof $e=="string"&&(pe.style.cssText=$e=""),$e)for(se in $e)we&&se in we||Q(pe.style,se,"");if(we)for(se in we)$e&&we[se]===$e[se]||Q(pe.style,se,we[se])}else if(se[0]==="o"&&se[1]==="n")pt=se!==(se=se.replace(/Capture$/,"")),se=se.toLowerCase()in pe?se.toLowerCase().slice(2):se.slice(2),pe.l||(pe.l={}),pe.l[se+pt]=we,we?$e||pe.addEventListener(se,pt?Se:ie,pt):pe.removeEventListener(se,pt?Se:ie,pt);else if(se!=="dangerouslySetInnerHTML"){if(rt)se=se.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(se!=="href"&&se!=="list"&&se!=="form"&&se!=="tabIndex"&&se!=="download"&&se in pe)try{pe[se]=we??"";break e}catch{}typeof we=="function"||(we!=null&&(we!==!1||se[0]==="a"&&se[1]==="r")?pe.setAttribute(se,we):pe.removeAttribute(se))}}function ie(pe){this.l[pe.type+!1](a.event?a.event(pe):pe)}function Se(pe){this.l[pe.type+!0](a.event?a.event(pe):pe)}function Ae(pe,se,we,$e,rt,pt,Lt,Jt,en){var zt,it,ae,re,je,vt,Y,kt,Rt,Wt,Pn,qt=se.type;if(se.constructor!==void 0)return null;we.__h!=null&&(en=we.__h,Jt=se.__e=we.__e,se.__h=null,pt=[Jt]),(zt=a.__b)&&zt(se);try{e:if(typeof qt=="function"){if(kt=se.props,Rt=(zt=qt.contextType)&&$e[zt.__c],Wt=zt?Rt?Rt.props.value:zt.__:$e,we.__c?Y=(it=se.__c=we.__c).__=it.__E:("prototype"in qt&&qt.prototype.render?se.__c=it=new qt(kt,Wt):(se.__c=it=new P(kt,Wt),it.constructor=qt,it.render=Be),Rt&&Rt.sub(it),it.props=kt,it.state||(it.state={}),it.context=Wt,it.__n=$e,ae=it.__d=!0,it.__h=[]),it.__s==null&&(it.__s=it.state),qt.getDerivedStateFromProps!=null&&(it.__s==it.state&&(it.__s=w({},it.__s)),w(it.__s,qt.getDerivedStateFromProps(kt,it.__s))),re=it.props,je=it.state,ae)qt.getDerivedStateFromProps==null&&it.componentWillMount!=null&&it.componentWillMount(),it.componentDidMount!=null&&it.__h.push(it.componentDidMount);else{if(qt.getDerivedStateFromProps==null&&kt!==re&&it.componentWillReceiveProps!=null&&it.componentWillReceiveProps(kt,Wt),!it.__e&&it.shouldComponentUpdate!=null&&it.shouldComponentUpdate(kt,it.__s,Wt)===!1||se.__v===we.__v){it.props=kt,it.state=it.__s,se.__v!==we.__v&&(it.__d=!1),it.__v=se,se.__e=we.__e,se.__k=we.__k,se.__k.forEach((function(xn){xn&&(xn.__=se)})),it.__h.length&&Lt.push(it);break e}it.componentWillUpdate!=null&&it.componentWillUpdate(kt,it.__s,Wt),it.componentDidUpdate!=null&&it.__h.push((function(){it.componentDidUpdate(re,je,vt)}))}it.context=Wt,it.props=kt,it.state=it.__s,(zt=a.__r)&&zt(se),it.__d=!1,it.__v=se,it.__P=pe,zt=it.render(it.props,it.state,it.context),it.state=it.__s,it.getChildContext!=null&&($e=w(w({},$e),it.getChildContext())),ae||it.getSnapshotBeforeUpdate==null||(vt=it.getSnapshotBeforeUpdate(re,je)),Pn=zt!=null&&zt.type===D&&zt.key==null?zt.props.children:zt,z(pe,Array.isArray(Pn)?Pn:[Pn],se,we,$e,rt,pt,Lt,Jt,en),it.base=se.__e,se.__h=null,it.__h.length&&Lt.push(it),Y&&(it.__E=it.__=null),it.__e=!1}else pt==null&&se.__v===we.__v?(se.__k=we.__k,se.__e=we.__e):se.__e=De(we.__e,se,we,$e,rt,pt,Lt,en);(zt=a.diffed)&&zt(se)}catch(xn){se.__v=null,(en||pt!=null)&&(se.__e=Jt,se.__h=!!en,pt[pt.indexOf(Jt)]=null),a.__e(xn,se,we)}}function Pe(pe,se){a.__c&&a.__c(se,pe),pe.some((function(we){try{pe=we.__h,we.__h=[],pe.some((function($e){$e.call(we)}))}catch($e){a.__e($e,we.__v)}}))}function De(pe,se,we,$e,rt,pt,Lt,Jt){var en,zt,it,ae=we.props,re=se.props,je=se.type,vt=0;if(je==="svg"&&(rt=!0),pt!=null){for(;vt<pt.length;vt++)if((en=pt[vt])&&"setAttribute"in en==!!je&&(je?en.localName===je:en.nodeType===3)){pe=en,pt[vt]=null;break}}if(pe==null){if(je===null)return document.createTextNode(re);pe=rt?document.createElementNS("http://www.w3.org/2000/svg",je):document.createElement(je,re.is&&re),pt=null,Jt=!1}if(je===null)ae===re||Jt&&pe.data===re||(pe.data=re);else{if(pt=pt&&i.call(pe.childNodes),zt=(ae=we.props||b).dangerouslySetInnerHTML,it=re.dangerouslySetInnerHTML,!Jt){if(pt!=null)for(ae={},vt=0;vt<pe.attributes.length;vt++)ae[pe.attributes[vt].name]=pe.attributes[vt].value;(it||zt)&&(it&&(zt&&it.__html==zt.__html||it.__html===pe.innerHTML)||(pe.innerHTML=it&&it.__html||""))}if((function(Y,kt,Rt,Wt,Pn){var qt;for(qt in Rt)qt==="children"||qt==="key"||qt in kt||J(Y,qt,null,Rt[qt],Wt);for(qt in kt)Pn&&typeof kt[qt]!="function"||qt==="children"||qt==="key"||qt==="value"||qt==="checked"||Rt[qt]===kt[qt]||J(Y,qt,kt[qt],Rt[qt],Wt)})(pe,re,ae,rt,Jt),it)se.__k=[];else if(vt=se.props.children,z(pe,Array.isArray(vt)?vt:[vt],se,we,$e,rt&&je!=="foreignObject",pt,Lt,pt?pt[0]:we.__k&&B(we,0),Jt),pt!=null)for(vt=pt.length;vt--;)pt[vt]!=null&&S(pt[vt]);Jt||("value"in re&&(vt=re.value)!==void 0&&(vt!==ae.value||vt!==pe.value||je==="progress"&&!vt)&&J(pe,"value",vt,ae.value,!1),"checked"in re&&(vt=re.checked)!==void 0&&vt!==pe.checked&&J(pe,"checked",vt,ae.checked,!1))}return pe}function ze(pe,se,we){try{typeof pe=="function"?pe(se):pe.current=se}catch($e){a.__e($e,we)}}function Ye(pe,se,we){var $e,rt;if(a.unmount&&a.unmount(pe),($e=pe.ref)&&($e.current&&$e.current!==pe.__e||ze($e,null,se)),($e=pe.__c)!=null){if($e.componentWillUnmount)try{$e.componentWillUnmount()}catch(pt){a.__e(pt,se)}$e.base=$e.__P=null}if($e=pe.__k)for(rt=0;rt<$e.length;rt++)$e[rt]&&Ye($e[rt],se,typeof pe.type!="function");we||pe.__e==null||S(pe.__e),pe.__e=pe.__d=void 0}function Be(pe,se,we){return this.constructor(pe,we)}function Je(pe,se,we){var $e,rt,pt;a.__&&a.__(pe,se),rt=($e=typeof we=="function")?null:we&&we.__k||se.__k,pt=[],Ae(se,pe=(!$e&&we||se).__k=M(D,null,[pe]),rt||b,b,se.ownerSVGElement!==void 0,!$e&&we?[we]:rt?null:se.firstChild?i.call(se.childNodes):null,pt,!$e&&we?we:rt?rt.__e:se.firstChild,$e),Pe(pt,pe)}function gt(pe,se){Je(pe,se,gt)}function le(pe,se,we){var $e,rt,pt,Lt=w({},pe.props);for(pt in se)pt=="key"?$e=se[pt]:pt=="ref"?rt=se[pt]:Lt[pt]=se[pt];return arguments.length>2&&(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 Y})),r.d(o,"n",(function(){return or})),r.d(o,"o",(function(){return q})),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 Gi})),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++On.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 q(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 X={structural:function(R,L){return un(R,L)},default:function(R,L){return Object.is(R,L)}},G=function(R,L){return G=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])},G(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<fe;Z++)for(var Re in L=arguments[Z])Object.prototype.hasOwnProperty.call(L,Re)&&(R[Re]=L[Re]);return R},Q.apply(this,arguments)};function J(R){var L=typeof Symbol=="function"&&R[Symbol.iterator],Z=0;return L?L.call(R):{next:function(){return R&&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(_n){Re={error:_n}}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;L<arguments.length;L++)R=R.concat(ie(arguments[L]));return R}var Ae=Symbol("mobx did run lazy initializers"),Pe=Symbol("mobx pending decorators"),De={},ze={};function Ye(R,L){var Z=L?De:ze;return Z[R]||(Z[R]={configurable:!0,enumerable:L,get:function(){return Be(this),this[R]},set:function(fe){Be(this),this[R]=fe}})}function Be(R){var L,Z;if(R[Ae]!==!0){var fe=R[Pe];if(fe){S(R,Ae,!0);var Re=Se(Object.getOwnPropertySymbols(fe),Object.keys(fe));try{for(var lt=J(Re),It=lt.next();!It.done;It=lt.next()){var _n=fe[It.value];_n.propertyCreator(R,_n.prop,_n.descriptor,_n.decoratorTarget,_n.decoratorArguments)}}catch(Jn){L={error:Jn}}finally{try{It&&!It.done&&(Z=lt.return)&&Z.call(lt)}finally{if(L)throw L.error}}}}}function Je(R,L){return function(){var Z,fe=function(Re,lt,It,_n){if(_n===!0)return L(Re,lt,It,Re,Z),null;if(!Object.prototype.hasOwnProperty.call(Re,Pe)){var Jn=Re[Pe];S(Re,Pe,Q({},Jn))}return Re[Pe][lt]={prop:lt,propertyCreator:L,descriptor:It,decoratorTarget:Re,decoratorArguments:Z},Ye(lt,R)};return gt(arguments)?(Z=s,fe.apply(null,arguments)):(Z=Array.prototype.slice.call(arguments),fe)}}function gt(R){return(R.length===2||R.length===3)&&(typeof R[1]=="string"||typeof R[1]=="symbol")||R.length===4&&R[3]===!0}function le(R,L,Z){return ra(R)?R:Array.isArray(R)?zt.array(R,{name:Z}):w(R)?zt.object(R,void 0,{name:Z}):T(R)?zt.map(R,{name:Z}):$(R)?zt.set(R,{name:Z}):R}function Ze(R){return R}function pe(R){v(R);var L=Je(!0,(function(fe,Re,lt,It,_n){var Jn=lt?lt.initializer?lt.initializer.call(fe):lt.value:void 0;ll(fe).addObservableProp(Re,Jn,R)})),Z=(i!==void 0&&i.env,L);return Z.enhancer=R,Z}var se={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function we(R){return R==null?se:typeof R=="string"?{name:R,deep:!0,proxy:!0}:R}Object.freeze(se);var $e=pe(le),rt=pe((function(R,L,Z){return R==null||ia(R)||xl(R)||Gi(R)||Ki(R)?R:Array.isArray(R)?zt.array(R,{name:Z,deep:!1}):w(R)?zt.object(R,void 0,{name:Z,deep:!1}):T(R)?zt.map(R,{name:Z,deep:!1}):$(R)?zt.set(R,{name:Z,deep:!1}):h(!1)})),pt=pe(Ze),Lt=pe((function(R,L,Z){return un(R,L)?L:R}));function Jt(R){return R.defaultDecorator?R.defaultDecorator.enhancer:R.deep===!1?Ze:le}var en={box:function(R,L){arguments.length>2&&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,_n=Re[0]||{};ll(R).addComputedProp(R,L,Q({get:lt,set:It,context:R},_n))})),vt=je({equals:X.structural}),Y=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)};Y.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 Wt(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;lt<Re;lt++){var It=fe[lt];if(oo(It)){if(On.disableErrorBoundaries)It.get();else try{It.get()}catch{return dt(Z),Tt(L),!0}if(R.dependenciesState===ae.STALE)return dt(Z),Tt(L),!0}}return wn(R),dt(Z),Tt(L),!1}}function Pn(){return On.trackingDerivation!==null}function qt(R){var L=R.observers.size>0;On.computationDepth>0&&L&&h(!1),On.allowStateChanges||!L&&On.enforceActions!=="strict"||h(!1)}function xn(R,L,Z){var fe=At(!0);wn(R),R.newObserving=new Array(R.observing.length+100),R.unboundDepsCount=0,R.runId=++On.runId;var Re,lt=On.trackingDerivation;if(On.trackingDerivation=R,On.disableErrorBoundaries===!0)Re=L.call(Z);else try{Re=L.call(Z)}catch(It){Re=new kt(It)}return On.trackingDerivation=lt,(function(It){for(var _n=It.observing,Jn=It.observing=It.newObserving,no=ae.UP_TO_DATE,$n=0,Do=It.unboundDepsCount,Kr=0;Kr<Do;Kr++)(So=Jn[Kr]).diffValue===0&&(So.diffValue=1,$n!==Kr&&(Jn[$n]=So),$n++),So.dependenciesState>no&&(no=So.dependenciesState);for(Jn.length=$n,It.newObserving=null,Do=_n.length;Do--;)(So=_n[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=On.trackingDerivation;return On.trackingDerivation=null,R}function dt(R){On.trackingDerivation=R}function At(R){var L=On.allowStateReads;return On.allowStateReads=R,L}function Tt(R){On.allowStateReads=R}function wn(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&&(On.suppressReactionErrors=!0),vn(R.prevAllowStateChanges),Tt(R.prevAllowStateReads),gr(),dt(R.prevDerivation),R.notifySpy,On.suppressReactionErrors=!1}function rr(R,L){var Z,fe=ut(R);try{Z=L()}finally{vn(fe)}return Z}function ut(R){var L=On.allowStateChanges;return On.allowStateChanges=R,L}function vn(R){On.allowStateChanges=R}var In=(function(R){function L(Z,fe,Re,lt,It){Re===void 0&&(Re="ObservableValue@"+f()),It===void 0&&(It=X.default);var _n=R.call(this,Re)||this;return _n.enhancer=fe,_n.name=Re,_n.equals=It,_n.hasUnreportedChange=!1,_n.value=fe(Z,void 0,Re),_n}return(function(Z,fe){function Re(){this.constructor=Z}G(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))!==On.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 On.UNCHANGED;Z=fe.newValue}return Z=this.enhancer(Z,this.value,this.name),this.equals(this.value,Z)?On.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?X.structural:X.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),On.inBatch!==0||this.observers.size!==0||this.keepAlive?(gl(this),Wt(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)):Wt(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,On.computationDepth++,L)Z=xn(this,this.derivation,this.scope);else if(On.disableErrorBoundaries===!0)Z=this.derivation.call(this.scope);else try{Z=this.derivation.call(this.scope)}catch(fe){Z=new kt(fe)}return On.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 _n=Le();L({type:"update",object:fe,newValue:It,oldValue:lt}),dt(_n)}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,On=(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,On.pendingUnobservations.push(R))}function Ui(){On.inBatch++}function gr(){if(--On.inBatch==0){yl();for(var R=On.pendingUnobservations,L=0;L<R.length;L++){var Z=R[L];Z.isPendingUnobservation=!1,Z.observers.size===0&&(Z.isBeingObserved&&(Z.isBeingObserved=!1,Z.onBecomeUnobserved()),Z instanceof wo&&Z.suspend())}On.pendingUnobservations=[]}}function gl(R){var L=On.trackingDerivation;return L!==null?(L.runId!==R.lastAccessedBy&&(R.lastAccessedBy=L.runId,L.newObserving[L.unboundDepsCount++]=R,R.isBeingObserved||(R.isBeingObserved=!0,R.onBecomeObserved())),!0):(R.observers.size===0&&On.inBatch>0&&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,On.pendingReactions.push(this),yl())},R.prototype.isScheduled=function(){return this._isScheduled},R.prototype.runReaction=function(){if(!this.isDisposed){if(Ui(),this._isScheduled=!1,Wt(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=xn(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(On.disableErrorBoundaries)throw L;On.suppressReactionErrors,On.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;fe<arguments.length;fe++)Z[fe]=arguments[fe];var Re=!1;typeof Z[Z.length-1]=="boolean"&&(Re=Z.pop());var lt=Mo(Z);if(!lt)return h(!1);lt.isTracing,re.NONE,lt.isTracing=Re?re.BREAK:re.LOG})(this,L)},R})(),al=function(R){return R()};function yl(){On.inBatch>0||On.isRunningReactions||al(Cs)}function Cs(){On.isRunningReactions=!0;for(var R=On.pendingReactions,L=0;R.length>0;){++L==100&&R.splice(0);for(var Z=R.splice(0),fe=0,Re=Z.length;fe<Re;fe++)Z[fe].runReaction()}On.isRunningReactions=!1}var _l=M("Reaction",Na);function ts(R){var L=al;al=function(Z){return R((function(){return L(Z)}))}}function ve(R){return function(){}}function mt(){h(!1)}function cn(R){return function(L,Z,fe){if(fe){if(fe.value)return{value:yo(R,fe.value),enumerable:!1,configurable:!0,writable:!0};var Re=fe.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return yo(R,Re.call(this))}}}return Kn(R).apply(this,arguments)}}function Kn(R){return function(L,Z,fe){Object.defineProperty(L,Z,{configurable:!0,enumerable:!1,get:function(){},set:function(Re){S(this,Z,br(R,Re))}})}}var br=function(R,L,Z,fe){return arguments.length===1&&typeof R=="function"?yo(R.name||"<unnamed action>",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||"<unnamed action>",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(),_n=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?X.structural:Z.equals||X.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&&_n(lt,So),$n||wi!==!0||_n(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 _n=Re[It];_n&&(_n.delete(lt),_n.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,_n=R.observableRequiresReaction;if(R.isolateGlobalState===!0&&((On.pendingReactions.length||On.inBatch||On.isRunningReactions)&&h("isolateGlobalState should be called before MobX is running any reactions"),Ka=!0,fa&&(--Yi().__mobxInstanceCount==0&&(Yi().__mobxGlobals=void 0),On=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'")}On.enforceActions=Jn,On.allowStateChanges=Jn!==!0&&Jn!=="strict"}Z!==void 0&&(On.computedRequiresReaction=!!Z),It!==void 0&&(On.reactionRequiresObservable=!!It),_n!==void 0&&(On.observableRequiresReaction=!!_n,On.allowStateReads=!On.observableRequiresReaction),fe!==void 0&&(On.computedConfigurable=!!fe),Re!==void 0&&(On.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 _n=J(It),Jn=_n.next();!Jn.done;Jn=_n.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=_n.return)&<.call(_n)}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||"<unnamed flow>";return function(){var Z,fe=this,Re=arguments,lt=++Vi,It=br(L+" - runid: "+lt+" - init",R).apply(fe,Re),_n=void 0,Jn=new Promise((function(no,$n){var Do=0;function Kr(wi){var el;_n=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;_n=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):(_n=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{_n&&Ro(_n);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():Gi(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]})):Gi(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]]})):Gi(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(Gi(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,_n){return ka(Re,lt).observe(It,_n)})(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;lt<It;lt++)fe[lt]=Re[lt];return fe}if(Ki(R)||Object.getPrototypeOf(R)===Set.prototype){if(L.exportMapsAsObjects===!1){var _n=Ba(Z,R,new Set,L);return R.forEach((function(Kr){_n.add(Za(Kr,L,Z))})),_n}var Jn=Ba(Z,R,[],L);return R.forEach((function(Kr){Jn.push(Za(Kr,L,Z))})),Jn}if(Gi(R)||Object.getPrototypeOf(R)===Map.prototype){if(L.exportMapsAsObjects===!1){var no=Ba(Z,R,new Map,L);return R.forEach((function(Kr,So){no.set(So,Za(Kr,L,Z))})),no}var $n=Ba(Z,R,{},L);return R.forEach((function(Kr,So){$n[So]=Za(Kr,L,Z)})),$n}var Do=Ba(Z,R,{},L);return D(R).forEach((function(Kr){Do[Kr]=Za(R[Kr],L,Z)})),Do}function rf(R,L){var Z;return typeof L=="boolean"&&(L={detectCycles:L}),L||(L=yp),L.detectCycles=L.detectCycles===void 0?L.recurseEverything===!0:L.detectCycles===!0,L.detectCycles&&(Z=new Map),Za(R,L,Z)}function Mo(R){switch(R.length){case 0:return On.trackingDerivation;case 1:return sl(R[0]);case 2:return sl(R[0],R[1])}}function oa(R,L){L===void 0&&(L=void 0),Ui();try{return R.apply(L)}finally{gr()}}function ad(R,L,Z){return arguments.length===1||L&&typeof L=="object"?of(R,L):_p(R,L,Z||{})}function _p(R,L,Z){var fe;typeof Z.timeout=="number"&&(fe=setTimeout((function(){if(!lt[I].isDisposed){lt();var It=new Error("WHEN_TIMEOUT");if(!Z.onError)throw It;Z.onError(It)}}),Z.timeout)),Z.name=Z.name||"When@"+f();var Re=yo(Z.name+"-effect",L),lt=ht((function(It){R()&&(It.dispose(),fe&&clearTimeout(fe),Re())}),Z);return lt}function of(R,L){var Z,fe=new Promise((function(Re,lt){var It=_p(R,Re,Q(Q({},L),{onError:lt}));Z=function(){It(),lt("WHEN_CANCELLED")}}));return fe.cancel=Z,fe}function ld(R){return R[I]}function ns(R){return typeof R=="string"||typeof R=="number"||typeof R=="symbol"}var $a={has:function(R,L){if(L===I||L==="constructor"||L===Ae)return!0;var Z=ld(R);return ns(L)?Z.has(L):L in R},get:function(R,L){if(L===I||L==="constructor"||L===Ae)return R[L];var Z=ld(R),fe=Z.values.get(L);if(fe instanceof V){var Re=fe.get();return Re===void 0&&Z.has(L),Re}return ns(L)&&Z.has(L),R[L]},set:function(R,L,Z){return!!ns(L)&&(Fa(R,L,Z),!0)},deleteProperty:function(R,L){return!!ns(L)&&(ld(R).remove(L),!0)},ownKeys:function(R){return ld(R).keysAtom.reportObserved(),Reflect.ownKeys(R)},preventExtensions:function(R){return h("Dynamic observable objects cannot be frozen"),!1}};function bu(R){var L=new Proxy(R,$a);return R[I].proxy=L,L}function Ja(R){return R.interceptors!==void 0&&R.interceptors.length>0}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;Re<lt&&(v(!(L=fe[Re](L))||L.type,"Intercept handlers should return nothing or a change object"),L);Re++);return L}finally{dt(Z)}}function Ua(R){return R.changeListeners!==void 0&&R.changeListeners.length>0}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;Re<lt;Re++)fe[Re](L);dt(Z)}}var wu={get:function(R,L){return L===I?R[I]:L==="length"?R[I].getArrayLength():typeof L=="number"?ui.get.call(R,L):typeof L!="string"||isNaN(L)?ui.hasOwnProperty(L)?ui[L]:R[L]:ui.get.call(R,parseInt(L))},set:function(R,L,Z){return L==="length"&&R[I].setArrayLength(Z),typeof L=="number"&&ui.set.call(R,L,Z),typeof L=="symbol"||isNaN(L)?R[L]=Z:ui.set.call(R,parseInt(L),Z),!0},preventExtensions:function(R){return h("Observable arrays cannot be frozen"),!1}};function Ks(R,L,Z,fe){Z===void 0&&(Z="ObservableArray@"+f()),fe===void 0&&(fe=!1);var Re,lt,It,_n=new $l(Z,L,fe);Re=_n.values,lt=I,It=_n,Object.defineProperty(Re,lt,{enumerable:!1,writable:!1,configurable:!0,value:It});var Jn=new Proxy(_n.values,wu);if(_n.proxy=Jn,R&&R.length){var no=ut(!0);_n.spliceWithArray(0,0,R),vn(no)}return Jn}var $l=(function(){function R(L,Z,fe){this.owned=fe,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new V(L||"ObservableArray@"+f()),this.enhancer=function(Re,lt){return Z(Re,lt,L+"[..]")}}return R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.dehanceValues=function(L){return this.dehancer!==void 0&&L.length>0?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;Re<L-Z;Re++)fe[Re]=void 0;this.spliceWithArray(Z,0,fe)}else this.spliceWithArray(L,Z-L)},R.prototype.updateArrayLength=function(L,Z){if(L!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=Z},R.prototype.spliceWithArray=function(L,Z,fe){var Re=this;qt(this.atom);var lt=this.values.length;if(L===void 0?L=0:L>lt?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 _n=this.spliceItemsIntoValues(L,Z,fe);return Z===0&&fe.length===0||this.notifyArraySplice(L,fe,_n),this.dehanceValues(_n)},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<arguments.length;fe++)Z[fe-2]=arguments[fe];var Re=this[I];switch(arguments.length){case 0:return[];case 1:return Re.spliceWithArray(R);case 2:return Re.spliceWithArray(R,L)}return Re.spliceWithArray(R,L,Z)},spliceWithArray:function(R,L,Z){return this[I].spliceWithArray(R,L,Z)},push:function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var Z=this[I];return Z.spliceWithArray(Z.values.length,0,R),Z.values.length},pop:function(){return this.splice(Math.max(this[I].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var Z=this[I];return Z.spliceWithArray(0,0,R),Z.values.length},reverse:function(){var R=this.slice();return R.reverse.apply(R,arguments)},sort:function(R){var L=this.slice();return L.sort.apply(L,arguments)},remove:function(R){var L=this[I],Z=L.dehanceValues(L.values).indexOf(R);return Z>-1&&(this.splice(Z,1),!0)},get:function(R){var L=this[I];if(L&&R<L.values.length)return L.atom.reportObserved(),L.dehanceValue(L.values[R])},set:function(R,L){var Z=this[I],fe=Z.values;if(R<fe.length){qt(Z.atom);var Re=fe[R];if(Ja(Z)){var lt=vo(Z,{type:"update",object:Z.proxy,index:R,newValue:L});if(!lt)return;L=lt.newValue}(L=Z.enhancer(L,Re))!==Re&&(fe[R]=L,Z.notifyArrayChildUpdate(R,L,Re))}else{if(R!==fe.length)throw new Error("[mobx.array] Index out of bounds, "+R+" is larger than "+fe.length);Z.spliceWithArray(R,0,[L])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(R){typeof Array.prototype[R]=="function"&&(ui[R]=function(){var L=this[I];L.atom.reportObserved();var Z=L.dehanceValues(L.values);return Z[R].apply(Z,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(R){typeof Array.prototype[R]=="function"&&(ui[R]=function(L,Z){var fe=this,Re=this[I];return Re.atom.reportObserved(),Re.dehanceValues(Re.values)[R]((function(lt,It){return L.call(Z,lt,It,fe)}),Z)})})),["reduce","reduceRight"].forEach((function(R){ui[R]=function(){var L=this,Z=this[I];Z.atom.reportObserved();var fe=arguments[0];return arguments[0]=function(Re,lt,It){return lt=Z.dehanceValue(lt),fe(Re,lt,It,L)},Z.values[R].apply(Z.values,arguments)}}));var lc,rs=M("ObservableArrayAdministration",$l);function xl(R){return O(R)&&rs(R[I])}var af,Vh={},lf=(function(){function R(L,Z,fe){if(Z===void 0&&(Z=le),fe===void 0&&(fe="ObservableMap@"+f()),this.enhancer=Z,this.name=fe,this[lc]=Vh,this._keysAtom=q(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(L)}return R.prototype._has=function(L){return this._data.has(L)},R.prototype.has=function(L){var Z=this;if(!On.trackingDerivation)return this._has(L);var fe=this._hasMap.get(L);if(!fe){var Re=fe=new In(this._has(L),Ze,this.name+"."+P(L)+"?",!1);this._hasMap.set(L,Re),nr(Re,(function(){return Z._hasMap.delete(L)}))}return fe.get()},R.prototype.set=function(L,Z){var fe=this._has(L);if(Ja(this)){var Re=vo(this,{type:fe?"update":"add",object:this,newValue:Z,name:L});if(!Re)return this;Z=Re.newValue}return fe?this._updateValue(L,Z):this._addValue(L,Z),this},R.prototype.delete=function(L){var Z=this;if(qt(this._keysAtom),Ja(this)&&!(Re=vo(this,{type:"delete",object:this,name:L})))return!1;if(this._has(L)){var fe=Ua(this),Re=fe?{type:"delete",object:this,oldValue:this._data.get(L).value,name:L}:null;return oa((function(){Z._keysAtom.reportChanged(),Z._updateHasMapEntry(L,!1),Z._data.get(L).setNewValue(void 0),Z._data.delete(L)})),fe&&ha(this,Re),!0}return!1},R.prototype._updateHasMapEntry=function(L,Z){var fe=this._hasMap.get(L);fe&&fe.setNewValue(Z)},R.prototype._updateValue=function(L,Z){var fe=this._data.get(L);if((Z=fe.prepareNewValue(Z))!==On.UNCHANGED){var Re=Ua(this),lt=Re?{type:"update",object:this,oldValue:fe.value,name:L,newValue:Z}:null;fe.setNewValue(Z),Re&&ha(this,lt)}},R.prototype._addValue=function(L,Z){var fe=this;qt(this._keysAtom),oa((function(){var It=new In(Z,fe.enhancer,fe.name+"."+P(L),!1);fe._data.set(L,It),Z=It.value,fe._updateHasMapEntry(L,!0),fe._keysAtom.reportChanged()}));var Re=Ua(this),lt=Re?{type:"add",object:this,name:L,newValue:Z}:null;Re&&ha(this,lt)},R.prototype.get=function(L){return this.has(L)?this.dehanceValue(this._data.get(L).get()):this.dehanceValue(void 0)},R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},R.prototype.values=function(){var L=this,Z=this.keys();return mo({next:function(){var fe=Z.next(),Re=fe.done,lt=fe.value;return{done:Re,value:Re?void 0:L.get(lt)}}})},R.prototype.entries=function(){var L=this,Z=this.keys();return mo({next:function(){var fe=Z.next(),Re=fe.done,lt=fe.value;return{done:Re,value:Re?void 0:[lt,L.get(lt)]}}})},R.prototype[lc=I,Symbol.iterator]=function(){return this.entries()},R.prototype.forEach=function(L,Z){var fe,Re;try{for(var lt=J(this),It=lt.next();!It.done;It=lt.next()){var _n=ie(It.value,2),Jn=_n[0],no=_n[1];L.call(Z,no,Jn,this)}}catch($n){fe={error:$n}}finally{try{It&&!It.done&&(Re=lt.return)&&Re.call(lt)}finally{if(fe)throw fe.error}}},R.prototype.merge=function(L){var Z=this;return Gi(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{w(L)?D(L).forEach((function(Re){return Z.set(Re,L[Re])})):Array.isArray(L)?L.forEach((function(Re){var lt=ie(Re,2),It=lt[0],_n=lt[1];return Z.set(It,_n)})):T(L)?(L.constructor!==Map&&h("Cannot initialize from classes that inherit from Map: "+L.constructor.name),L.forEach((function(Re,lt){return Z.set(lt,Re)}))):L!=null&&h("Cannot initialize map from "+L)}finally{vn(fe)}})),this},R.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L.keys()),lt=Re.next();!lt.done;lt=Re.next()){var It=lt.value;L.delete(It)}}catch(_n){Z={error:_n}}finally{try{lt&&!lt.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},R.prototype.replace=function(L){var Z=this;return oa((function(){var fe,Re,lt,It,_n=(function(Zi){if(T(Zi)||Gi(Zi))return Zi;if(Array.isArray(Zi))return new Map(Zi);if(w(Zi)){var Js=new Map;for(var Rs in Zi)Js.set(Rs,Zi[Rs]);return Js}return h("Cannot convert to map from '"+Zi+"'")})(L),Jn=new Map,no=!1;try{for(var $n=J(Z._data.keys()),Do=$n.next();!Do.done;Do=$n.next()){var Kr=Do.value;if(!_n.has(Kr))if(Z.delete(Kr))no=!0;else{var So=Z._data.get(Kr);Jn.set(Kr,So)}}}catch(Zi){fe={error:Zi}}finally{try{Do&&!Do.done&&(Re=$n.return)&&Re.call($n)}finally{if(fe)throw fe.error}}try{for(var ul=J(_n.entries()),wi=ul.next();!wi.done;wi=ul.next()){var el=ie(wi.value,2),ks=(Kr=el[0],So=el[1],Z._data.has(Kr));if(Z.set(Kr,So),Z._data.has(Kr)){var Ps=Z._data.get(Kr);Jn.set(Kr,Ps),ks||(no=!0)}}}catch(Zi){lt={error:Zi}}finally{try{wi&&!wi.done&&(It=ul.return)&&It.call(ul)}finally{if(lt)throw lt.error}}if(!no)if(Z._data.size!==Jn.size)Z._keysAtom.reportChanged();else for(var Zs=Z._data.keys(),Eu=Jn.keys(),is=Zs.next(),xu=Eu.next();!is.done;){if(is.value!==xu.value){Z._keysAtom.reportChanged();break}is=Zs.next(),xu=Eu.next()}Z._data=Jn})),this},Object.defineProperty(R.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),R.prototype.toPOJO=function(){var L,Z,fe={};try{for(var Re=J(this),lt=Re.next();!lt.done;lt=Re.next()){var It=ie(lt.value,2),_n=It[0],Jn=It[1];fe[typeof _n=="symbol"?_n:P(_n)]=Jn}}catch(no){L={error:no}}finally{try{lt&&!lt.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},R.prototype.toJS=function(){return new Map(this)},R.prototype.toJSON=function(){return this.toPOJO()},R.prototype.toString=function(){var L=this;return this.name+"[{ "+Array.from(this.keys()).map((function(Z){return P(Z)+": "+L.get(Z)})).join(", ")+" }]"},R.prototype.observe=function(L,Z){return Bl(this,L)},R.prototype.intercept=function(L){return El(this,L)},R})(),Gi=M("ObservableMap",lf),sc={},os=(function(){function R(L,Z,fe){if(Z===void 0&&(Z=le),fe===void 0&&(fe="ObservableSet@"+f()),this.name=fe,this[af]=sc,this._data=new Set,this._atom=q(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(Re,lt){return Z(Re,lt,fe)},L&&this.replace(L)}return R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L._data.values()),lt=Re.next();!lt.done;lt=Re.next()){var It=lt.value;L.delete(It)}}catch(_n){Z={error:_n}}finally{try{lt&&!lt.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},R.prototype.forEach=function(L,Z){var fe,Re;try{for(var lt=J(this),It=lt.next();!It.done;It=lt.next()){var _n=It.value;L.call(Z,_n,_n,this)}}catch(Jn){fe={error:Jn}}finally{try{It&&!It.done&&(Re=lt.return)&&Re.call(lt)}finally{if(fe)throw fe.error}}},Object.defineProperty(R.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),R.prototype.add=function(L){var Z=this;if(qt(this._atom),Ja(this)&&!(Re=vo(this,{type:"add",object:this,newValue:L})))return this;if(!this.has(L)){oa((function(){Z._data.add(Z.enhancer(L,void 0)),Z._atom.reportChanged()}));var fe=Ua(this),Re=fe?{type:"add",object:this,newValue:L}:null;fe&&ha(this,Re)}return this},R.prototype.delete=function(L){var Z=this;if(Ja(this)&&!(Re=vo(this,{type:"delete",object:this,oldValue:L})))return!1;if(this.has(L)){var fe=Ua(this),Re=fe?{type:"delete",object:this,oldValue:L}:null;return oa((function(){Z._atom.reportChanged(),Z._data.delete(L)})),fe&&ha(this,Re),!0}return!1},R.prototype.has=function(L){return this._atom.reportObserved(),this._data.has(this.dehanceValue(L))},R.prototype.entries=function(){var L=0,Z=Array.from(this.keys()),fe=Array.from(this.values());return mo({next:function(){var Re=L;return L+=1,Re<fe.length?{value:[Z[Re],fe[Re]],done:!1}:{done:!0}}})},R.prototype.keys=function(){return this.values()},R.prototype.values=function(){this._atom.reportObserved();var L=this,Z=0,fe=Array.from(this._data.values());return mo({next:function(){return Z<fe.length?{value:L.dehanceValue(fe[Z++]),done:!1}:{done:!0}}})},R.prototype.replace=function(L){var Z=this;return Ki(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{Array.isArray(L)||$(L)?(Z.clear(),L.forEach((function(Re){return Z.add(Re)}))):L!=null&&h("Cannot initialize set from "+L)}finally{vn(fe)}})),this},R.prototype.observe=function(L,Z){return Bl(this,L)},R.prototype.intercept=function(L){return El(this,L)},R.prototype.toJS=function(){return new Set(this)},R.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},R.prototype[af=I,Symbol.iterator]=function(){return this.values()},R})(),Ki=M("ObservableSet",os),sf=(function(){function R(L,Z,fe,Re){Z===void 0&&(Z=new Map),this.target=L,this.values=Z,this.name=fe,this.defaultEnhancer=Re,this.keysAtom=new V(fe+".keys")}return R.prototype.read=function(L){return this.values.get(L).get()},R.prototype.write=function(L,Z){var fe=this.target,Re=this.values.get(L);if(Re instanceof wo)Re.set(Z);else{if(Ja(this)){if(!(It=vo(this,{type:"update",object:this.proxy||fe,name:L,newValue:Z})))return;Z=It.newValue}if((Z=Re.prepareNewValue(Z))!==On.UNCHANGED){var lt=Ua(this),It=lt?{type:"update",object:this.proxy||fe,oldValue:Re.value,name:L,newValue:Z}:null;Re.setNewValue(Z),lt&&ha(this,It)}}},R.prototype.has=function(L){var Z=this.pendingKeys||(this.pendingKeys=new Map),fe=Z.get(L);if(fe)return fe.get();var Re=!!this.values.get(L);return fe=new In(Re,Ze,this.name+"."+P(L)+"?",!1),Z.set(L,fe),fe.get()},R.prototype.addObservableProp=function(L,Z,fe){fe===void 0&&(fe=this.defaultEnhancer);var Re=this.target;if(Ja(this)){var lt=vo(this,{object:this.proxy||Re,name:L,type:"add",newValue:Z});if(!lt)return;Z=lt.newValue}var It=new In(Z,fe,this.name+"."+P(L),!1);this.values.set(L,It),Z=It.value,Object.defineProperty(Re,L,(function(_n){return Ol[_n]||(Ol[_n]={configurable:!0,enumerable:!0,get:function(){return this[I].read(_n)},set:function(Jn){this[I].write(_n,Jn)}})})(L)),this.notifyPropertyAddition(L,Z)},R.prototype.addComputedProp=function(L,Z,fe){var Re,lt,It,_n=this.target;fe.name=fe.name||this.name+"."+P(Z),this.values.set(Z,new wo(fe)),(L===_n||(Re=L,lt=Z,!(It=Object.getOwnPropertyDescriptor(Re,lt))||It.configurable!==!1&&It.writable!==!1))&&Object.defineProperty(L,Z,(function(Jn){return sd[Jn]||(sd[Jn]={configurable:On.computedConfigurable,enumerable:!1,get:function(){return Va(this).read(Jn)},set:function(no){Va(this).write(Jn,no)}})})(Z))},R.prototype.remove=function(L){if(this.values.has(L)){var Z=this.target;if(Ja(this)&&!(Jn=vo(this,{object:this.proxy||Z,name:L,type:"remove"})))return;try{Ui();var fe=Ua(this),Re=!1,lt=this.values.get(L),It=lt&<.get();if(lt&<.set(void 0),this.keysAtom.reportChanged(),this.values.delete(L),this.pendingKeys){var _n=this.pendingKeys.get(L);_n&&_n.set(!1)}delete this.target[L];var Jn=fe?{type:"remove",object:this.proxy||Z,oldValue:It,name:L}:null;fe&&ha(this,Jn)}finally{gr()}}},R.prototype.illegalAccess=function(L,Z){},R.prototype.observe=function(L,Z){return Bl(this,L)},R.prototype.intercept=function(L){return El(this,L)},R.prototype.notifyPropertyAddition=function(L,Z){var fe=Ua(this),Re=fe?{type:"add",object:this.proxy||this.target,name:L,newValue:Z}:null;if(fe&&ha(this,Re),this.pendingKeys){var lt=this.pendingKeys.get(L);lt&<.set(!0)}this.keysAtom.reportChanged()},R.prototype.getKeys=function(){var L,Z;this.keysAtom.reportObserved();var fe=[];try{for(var Re=J(this.values),lt=Re.next();!lt.done;lt=Re.next()){var It=ie(lt.value,2),_n=It[0];It[1]instanceof In&&fe.push(_n)}}catch(Jn){L={error:Jn}}finally{try{lt&&!lt.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},R})();function ll(R,L,Z){if(L===void 0&&(L=""),Z===void 0&&(Z=le),Object.prototype.hasOwnProperty.call(R,I))return R[I];w(R)||(L=(R.constructor.name||"ObservableObject")+"@"+f()),L||(L="ObservableObject@"+f());var fe=new sf(R,new Map,P(L),Z);return S(R,I,fe),fe}var Ol=Object.create(null),sd=Object.create(null);function Va(R){var L=R[I];return L||(Be(R),R[I])}var Qa=M("ObservableObjectAdministration",sf);function ia(R){return!!O(R)&&(Be(R),Qa(R[I]))}function sl(R,L){if(typeof R=="object"&&R!==null){if(xl(R))return L!==void 0&&h(!1),R[I].atom;if(Ki(R))return R[I];if(Gi(R)){var Z=R;return L===void 0?Z._keysAtom:((fe=Z._data.get(L)||Z._hasMap.get(L))||h(!1),fe)}var fe;if(Be(R),L&&!R[I]&&R[L],ia(R))return L?((fe=R[I].values.get(L))||h(!1),fe):h(!1);if(z(R)||oo(R)||_l(R))return R}else if(typeof R=="function"&&_l(R[I]))return R[I];return h(!1)}function ka(R,L){return R||h("Expecting some object"),L!==void 0?ka(sl(R,L)):z(R)||oo(R)||_l(R)||Gi(R)||Ki(R)?R:(Be(R),R[I]?R[I]:void h(!1))}var Ct=Object.prototype.toString;function un(R,L,Z){return Z===void 0&&(Z=-1),dn(R,L,Z)}function dn(R,L,Z,fe,Re){if(R===L)return R!==0||1/R==1/L;if(R==null||L==null)return!1;if(R!=R)return L!=L;var lt=typeof R;if(lt!=="function"&<!=="object"&&typeof L!="object")return!1;var It=Ct.call(R);if(It!==Ct.call(L))return!1;switch(It){case"[object RegExp]":case"[object String]":return""+R==""+L;case"[object Number]":return+R!=+R?+L!=+L:+R==0?1/+R==1/L:+R==+L;case"[object Date]":case"[object Boolean]":return+R==+L;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(R)===Symbol.valueOf.call(L);case"[object Map]":case"[object Set]":Z>=0&&Z++}R=Wn(R),L=Wn(L);var _n=It==="[object Array]";if(!_n){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),_n){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(!Gr(L,Kr=Do[$n])||!dn(R[Kr],L[Kr],Z-1,fe,Re))return!1}return fe.pop(),Re.pop(),!0}function Wn(R){return xl(R)?R.slice():T(R)||Gi(R)||$(R)||Ki(R)?Array.from(R.entries()):R}function Gr(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)||Gi(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),q=r(60),X=r(77),G=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,Y=Se.f,kt=Q.f,Rt=Ae.f,Wt=h([].push),Pn=ze("symbols"),qt=ze("op-symbols"),xn=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 q(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a!=7}))?function(Nn,qn,rr){var ut=vt(en,qn);ut&&delete en[qn],Y(Nn,qn,rr),ut&&Nn!==en&&Y(en,qn,ut)}:Y,At=function(Nn,qn){var rr=Pn[Nn]=q(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=q(rr,{enumerable:z(0,!1)})):(w(Nn,$e)||Y(Nn,$e,z(1,{})),Nn[$e][ut]=!0),dt(Nn,ut,rr)):Y(Nn,ut,rr)},wn=function(Nn,qn){P(Nn);var rr=F(qn),ut=X(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)||Wt(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)||Wt(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,G.f=Q.f=Lo,J.f=yo,le.f=function(Nn){return At(gt(Nn),Nn)},b&&(Y(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(X(Ke),(function(Nn){Ze(Nn)})),i({target:rt,stat:!0,forced:!E},{for:function(Nn){var qn=V(Nn);if(w(xn,qn))return xn[qn];var rr=zt(qn);return xn[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?q(Nn):wn(q(Nn),qn)},defineProperty:Tt,defineProperties:wn,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 q=$?I(z,7,-1):F(z,B,"$1");return q===""?void 0:q}}),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(G,ke)}function T(ke,Ke,Le){var dt=S(i++,2);return dt.t=ke,dt.__c||(dt.__=[Le?Le(Ke):G(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&&X(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&&X(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__h.push(Le))}function P(ke,Ke){var Le=S(i++,7);return X(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(q),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(q),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.__||q(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 q(ke){var Ke=a;ke.__c=ke.__(),a=Ke}function X(ke,Ke){return!ke||ke.length!==Ke.length||Ke.some((function(Le,dt){return Le!==ke[dt]}))}function G(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,wn=Tt==At.ref;return!wn&&Tt&&(Tt.call?Tt(null):Tt.current=null),Ke?!Ke(this.props,At)||!wn: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,wn=function(){Tt||(Tt=!0,Le.__R=null,At?At(Zn):Zn())};Le.__R=wn;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(wn,wn)},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]<Le[0])break;ke.u=Le=Le[2]}};function $e(ke){return this.getChildContext=function(){return ke.context},ke.children}function rt(ke){var Ke=this,Le=ke.i;Ke.componentWillUnmount=function(){Object(l.j)(null,Ke.l),Ke.l=null,Ke.i=null},Ke.i&&Ke.i!==Le&&Ke.componentWillUnmount(),ke.__v?(Ke.l||(Ke.i=Le,Ke.l={nodeType:1,parentNode:Le,childNodes:[],appendChild:function(dt){this.childNodes.push(dt),Ke.i.appendChild(dt)},insertBefore:function(dt,At){this.childNodes.push(dt),Ke.i.appendChild(dt)},removeChild:function(dt){this.childNodes.splice(this.childNodes.indexOf(dt)>>>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}},Y=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 wn=Le[Tt];Jt&&Tt==="children"&&Ke==="noscript"||Tt==="value"&&"defaultValue"in Le&&wn==null||(Tt==="defaultValue"&&"value"in Le&&Le.value==null?Tt="value":Tt==="download"&&wn===!0?wn="":/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():wn===null&&(wn=void 0),dt[Tt]=wn)}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,Y&&Y(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 Wt(ke){return!!ke&&ke.$$typeof===pt}var Pn=function(ke,Ke){return ke(Ke)},qt=l.b,xn={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 Wt(ke)?l.c.apply(null,arguments):ke},createRef:l.f,Fragment:l.b,isValidElement:Wt,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(wn){Le=wn.default||wn}),(function(wn){dt=wn})),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=xn},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),q=v(z),X=h(P,q),G=h(B===void 0?q:B,q);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,X,G);for(I=new(F===void 0?$:F)(D(G-X,0)),V=0;X<G;X++,V++)X in z&&E(I,V,z[X]);return I.length=V,I}})},function(n,o){n.exports=function(r){try{return!!r()}catch{return!0}}},function(n,o,r){var i=r(16),a=r(103);i({target:"RegExp",proto:!0,forced:/./.exec!==a},{exec:a})},function(n,o,r){var i=r(16),a=r(40),s=r(77);i({target:"Object",stat:!0,forced:r(18)((function(){s(1)}))},{keys:function(l){return s(a(l))}})},function(n,o,r){var i=r(36),a=r(73).EXISTS,s=r(15),l=r(38).f,f=Function.prototype,h=s(f.toString),v=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,b=s(v.exec);i&&!a&&l(f,"name",{configurable:!0,get:function(){try{return b(v,h(this))[1]}catch{return""}}})},function(n,o,r){var i=r(16),a=r(18),s=r(41),l=r(50).f,f=r(36),h=a((function(){l(1)}));i({target:"Object",stat:!0,forced:!f||h,sham:!f},{getOwnPropertyDescriptor:function(v,b){return l(s(v),b)}})},function(n,o,r){var i=r(16),a=r(188);i({target:"Array",stat:!0,forced:!r(120)((function(s){Array.from(s)}))},{from:a})},function(n,o,r){var i=r(16),a=r(79).filter;i({target:"Array",proto:!0,forced:!r(81)("filter")},{filter:function(s){return a(this,s,arguments.length>1?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,q,X,G,Q=h(this),J=E(Q,0),ie=0;for(V=-1,q=arguments.length;V<q;V++)if(F(G=V===-1?Q:arguments[V])){if(ie+(X=v(G))>T)throw D($);for(z=0;z<X;z++,ie++)z in G&&b(J,ie,G[z])}else{if(ie>=T)throw D($);b(J,ie++,G)}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=t&&!t.nodeType&&t,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=t&&!t.nodeType&&t,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 q;if(!v(z)||(q=a(z)).type!==V)throw T("Incompatible receiver, "+V+" required");return q}}}},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"<script>"+T+"<\/script>"},S=function(T){T.write(w("")),T.close();var $=T.parentWindow.Object;return T=null,$},M=function(){try{i=new ActiveXObject("htmlfile")}catch{}var T,$;M=typeof document<"u"?document.domain&&i?S(i):(($=v("iframe")).style.display="none",h.appendChild($),$.src="javascript:",(T=$.contentWindow.document).open(),T.write(w("document.F=Object")),T.close(),T.F):S(i);for(var D=l.length;D--;)delete M.prototype[l[D]];return M()};f[E]=!0,n.exports=Object.create||function(T,$){var D;return T!==null?(O.prototype=a(T),D=new O,O.prototype=null,D[E]=T):D=M(),$===void 0?D:s(D,$)}},function(n,o,r){var i=r(36),a=r(7),s=r(15),l=r(95),f=r(42),h=r(35),v=r(148),b=r(54),E=r(87),O=r(131),w=r(18),S=r(74).f,M=r(50).f,T=r(38).f,$=r(160),D=r(161).trim,P="Number",B=a.Number,F=B.prototype,I=a.TypeError,V=s("".slice),z=s("".charCodeAt),q=function(Se){var Ae=O(Se,"number");return typeof Ae=="bigint"?Ae:X(Ae)},X=function(Se){var Ae,Pe,De,ze,Ye,Be,Je,gt,le=O(Se,"number");if(E(le))throw I("Cannot convert a Symbol value to a number");if(typeof le=="string"&&le.length>2){if(le=D(le),(Ae=z(le,0))===43||Ae===45){if((Pe=z(le,2))===88||Pe===120)return NaN}else if(Ae===48){switch(z(le,1)){case 66:case 98:De=2,ze=49;break;case 79:case 111:De=8,ze=55;break;default:return+le}for(Be=(Ye=V(le,2)).length,Je=0;Je<Be;Je++)if((gt=z(Ye,Je))<48||gt>ze)return NaN;return parseInt(Ye,De)}}return+le};if(l(P,!B(" 0o1")||!B("0b1")||B("+0x1"))){for(var G,Q=function(Se){var Ae=arguments.length<1?0:B(q(Se)),Pe=this;return b(F,Pe)&&w((function(){$(Pe)}))?v(Object(Ae),Pe,Q):Ae},J=i?S(B):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),ie=0;J.length>ie;ie++)h(B,G=J[ie])&&!h(Q,G)&&T(Q,G,M(B,G));Q.prototype=F,F.constructor=Q,f(a,P,Q)}},function(n,o,r){var i=r(56);n.exports=function(a,s){var l=a[s];return l==null?void 0:i(l)}},function(n,o,r){var i=r(86),a=r(38),s=r(69);n.exports=function(l,f,h){var v=i(f);v in l?a.f(l,v,s(0,h)):l[v]=h}},function(n,o,r){var i=r(15),a=r(56),s=i(i.bind);n.exports=function(l,f){return a(l),f===void 0?l:s?s(l,f):function(){return l.apply(f,arguments)}}},function(n,o,r){var i=r(16),a=r(15),s=r(85),l=r(41),f=r(121),h=a([].join),v=s!=Object,b=f("join",",");i({target:"Array",proto:!0,forced:v||!b},{join:function(E){return h(l(this),E===void 0?",":E)}})},function(n,o,r){var i=r(15),a=r(73).PROPER,s=r(42),l=r(32),f=r(54),h=r(39),v=r(18),b=r(154),E="toString",O=RegExp.prototype,w=O.toString,S=i(b),M=v((function(){return w.call({source:"a",flags:"b"})!="/a/b"})),T=a&&w.name!=E;(M||T)&&s(RegExp.prototype,E,(function(){var $=l(this),D=h($.source),P=$.flags;return"/"+D+"/"+h(P===void 0&&f(O,$)&&!("flags"in O)?S($):P)}),{unsafe:!0})},function(n,o,r){var i=r(16),a=r(217),s=r(100);i({target:"Array",proto:!0},{fill:a}),s("fill")},function(n,o){var r;r=(function(){return this})();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}n.exports=r},function(n,o){n.exports=function(r,i){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:i}}},function(n,o,r){var i,a,s=r(7),l=r(55),f=s.process,h=s.Deno,v=f&&f.versions||h&&h.version,b=v&&v.v8;b&&(a=(i=b.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!a&&l&&(!(i=l.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=l.match(/Chrome\/(\d+)/))&&(a=+i[1]),n.exports=a},function(n,o){n.exports=!1},function(n,o){n.exports={}},function(n,o,r){var i=r(36),a=r(35),s=Function.prototype,l=i&&Object.getOwnPropertyDescriptor,f=a(s,"name"),h=f&&(function(){}).name==="something",v=f&&(!i||i&&l(s,"name").configurable);n.exports={EXISTS:f,PROPER:h,CONFIGURABLE:v}},function(n,o,r){var i=r(136),a=r(111).concat("length","prototype");o.f=Object.getOwnPropertyNames||function(s){return i(s,a)}},function(n,o,r){var i=r(59),a=Math.max,s=Math.min;n.exports=function(l,f){var h=i(l);return h<0?a(h+f,0):s(h,f)}},function(n,o){var r=Function.prototype,i=r.apply,a=r.bind,s=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(a?s.bind(i):function(){return s.apply(i,arguments)})},function(n,o,r){var i=r(136),a=r(111);n.exports=Object.keys||function(s){return i(s,a)}},function(n,o,r){var i=r(38).f,a=r(35),s=r(28)("toStringTag");n.exports=function(l,f,h){l&&!a(l=h?l:l.prototype,s)&&i(l,s,{configurable:!0,value:f})}},function(n,o,r){var i=r(64),a=r(15),s=r(85),l=r(40),f=r(45),h=r(115),v=a([].push),b=function(E){var O=E==1,w=E==2,S=E==3,M=E==4,T=E==6,$=E==7,D=E==5||T;return function(P,B,F,I){for(var V,z,q=l(P),X=s(q),G=i(B,F),Q=f(X),J=0,ie=I||h,Se=O?ie(P,Q):w||$?ie(P,0):void 0;Q>J;J++)if((D||J in X)&&(z=G(V=X[J],J,q),E))if(O)Se[J]=z;else if(z)switch(E){case 3:return!0;case 5:return V;case 6:return J;case 2:v(Se,V)}else switch(E){case 4:return!1;case 7:v(Se,V)}return T?-1:S||M?M:Se}};n.exports={forEach:b(0),map:b(1),filter:b(2),some:b(3),every:b(4),find:b(5),findIndex:b(6),filterReject:b(7)}},function(n,o){n.exports={}},function(n,o,r){var i=r(18),a=r(28),s=r(70),l=a("species");n.exports=function(f){return s>=51||!i((function(){var h=[];return(h.constructor={})[l]=function(){return{foo:1}},h[f](Boolean).foo!==1}))}},function(n,o,r){var i=r(76),a=r(34),s=r(15),l=r(123),f=r(159),h=r(32),v=r(44),b=r(164),E=r(124),O=r(94),w=r(39),S=r(62),M=r(114),T=r(125),$=r(103),D=r(155),P=r(18),B=D.UNSUPPORTED_Y,F=4294967295,I=Math.min,V=[].push,z=s(/./.exec),q=s(V),X=s("".slice),G=!P((function(){var Q=/(?:)/,J=Q.exec;Q.exec=function(){return J.apply(this,arguments)};var ie="ab".split(Q);return ie.length!==2||ie[0]!=="a"||ie[1]!=="b"}));l("split",(function(Q,J,ie){var Se;return Se="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(Ae,Pe){var De=w(v(this)),ze=Pe===void 0?F:Pe>>>0;if(ze===0)return[];if(Ae===void 0)return[De];if(!f(Ae))return a(J,De,Ae,ze);for(var Ye,Be,Je,gt=[],le=(Ae.ignoreCase?"i":"")+(Ae.multiline?"m":"")+(Ae.unicode?"u":"")+(Ae.sticky?"y":""),Ze=0,pe=new RegExp(Ae.source,le+"g");(Ye=a($,pe,De))&&!((Be=pe.lastIndex)>Ze&&(q(gt,X(De,Ze,Ye.index)),Ye.length>1&&Ye.index<De.length&&i(V,gt,M(Ye,1)),Je=Ye[0].length,Ze=Be,gt.length>=ze));)pe.lastIndex===Ye.index&&pe.lastIndex++;return Ze===De.length?!Je&&z(pe,"")||q(gt,""):q(gt,X(De,Ze)),gt.length>ze?M(gt,0,ze):gt}:"0".split(void 0,0).length?function(Ae,Pe){return Ae===void 0&&Pe===0?[]:a(J,this,Ae,Pe)}:J,[function(Ae,Pe){var De=v(this),ze=Ae==null?void 0:S(Ae,Q);return ze?a(ze,Ae,De,Pe):a(Se,w(De),Ae,Pe)},function(Ae,Pe){var De=h(this),ze=w(Ae),Ye=ie(Se,De,ze,Pe,Se!==J);if(Ye.done)return Ye.value;var Be=b(De,RegExp),Je=De.unicode,gt=(De.ignoreCase?"i":"")+(De.multiline?"m":"")+(De.unicode?"u":"")+(B?"g":"y"),le=new Be(B?"^(?:"+De.source+")":De,gt),Ze=Pe===void 0?F:Pe>>>0;if(Ze===0)return[];if(ze.length===0)return T(le,ze)===null?[ze]:[];for(var pe=0,se=0,we=[];se<ze.length;){le.lastIndex=B?0:se;var $e,rt=T(le,B?X(ze,se):ze);if(rt===null||($e=I(O(le.lastIndex+(B?se:0)),ze.length))===pe)se=E(ze,se,Je);else{if(q(we,X(ze,pe,se)),we.length===Ze)return we;for(var pt=1;pt<=rt.length-1;pt++)if(q(we,rt[pt]),we.length===Ze)return we;se=pe=$e}}return q(we,X(ze,pe)),we}]}),!G,B)},function(n,o,r){r(16)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(n,o,r){var i={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,s=a&&!i.call({1:2},1);o.f=s?function(l){var f=a(this,l);return!!f&&f.enumerable}:i},function(n,o,r){var i=r(7),a=r(15),s=r(18),l=r(51),f=i.Object,h=a("".split);n.exports=s((function(){return!f("z").propertyIsEnumerable(0)}))?function(v){return l(v)=="String"?h(v,""):f(v)}:f},function(n,o,r){var i=r(131),a=r(87);n.exports=function(s){var l=i(s,"string");return a(l)?l:l+""}},function(n,o,r){var i=r(7),a=r(46),s=r(30),l=r(54),f=r(132),h=i.Object;n.exports=f?function(v){return typeof v=="symbol"}:function(v){var b=a("Symbol");return s(b)&&l(b.prototype,h(v))}},function(n,o,r){var i=r(7).String;n.exports=function(a){try{return i(a)}catch{return"Object"}}},function(n,o,r){var i=r(71),a=r(109);(n.exports=function(s,l){return a[s]||(a[s]=l!==void 0?l:{})})("versions",[]).push({version:"3.19.3",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(n,o,r){var i=r(15),a=0,s=Math.random(),l=i(1 .toString);n.exports=function(f){return"Symbol("+(f===void 0?"":f)+")_"+l(++a+s,36)}},function(n,o,r){var i=r(7),a=r(33),s=i.document,l=a(s)&&a(s.createElement);n.exports=function(f){return l?s.createElement(f):{}}},function(n,o,r){var i=r(15),a=r(30),s=r(109),l=i(Function.toString);a(s.inspectSource)||(s.inspectSource=function(f){return l(f)}),n.exports=s.inspectSource},function(n,o,r){var i=r(89),a=r(90),s=i("keys");n.exports=function(l){return s[l]||(s[l]=a(l))}},function(n,o,r){var i=r(59),a=Math.min;n.exports=function(s){return s>0?a(i(s),9007199254740991):0}},function(n,o,r){var i=r(18),a=r(30),s=/#|\.prototype\./,l=function(E,O){var w=h[f(E)];return w==b||w!=v&&(a(O)?i(O):!!O)},f=l.normalize=function(E){return String(E).replace(s,".").toLowerCase()},h=l.data={},v=l.NATIVE="N",b=l.POLYFILL="P";n.exports=l},function(n,o,r){var i=r(51);n.exports=Array.isArray||function(a){return i(a)=="Array"}},function(n,o,r){var i=r(7),a=r(113),s=r(30),l=r(51),f=r(28)("toStringTag"),h=i.Object,v=l((function(){return arguments})())=="Arguments";n.exports=a?l:function(b){var E,O,w;return b===void 0?"Undefined":b===null?"Null":typeof(O=(function(S,M){try{return S[M]}catch{}})(E=h(b),f))=="string"?O:v?l(E):(w=l(E))=="Object"&&s(E.callee)?"Arguments":w}},function(n,o,r){var i=r(15);n.exports=i([].slice)},function(n,o,r){var i=r(15),a=r(18),s=r(30),l=r(97),f=r(46),h=r(92),v=function(){},b=[],E=f("Reflect","construct"),O=/^\s*(?:class|function)\b/,w=i(O.exec),S=!O.exec(v),M=function(T){if(!s(T))return!1;try{return E(v,b,T),!0}catch{return!1}};n.exports=!E||a((function(){var T;return M(M.call)||!M(Object)||!M((function(){T=!0}))||T}))?function(T){if(!s(T))return!1;switch(l(T)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return S||!!w(O,h(T))}:M},function(n,o,r){var i=r(28),a=r(60),s=r(38),l=i("unscopables"),f=Array.prototype;f[l]==null&&s.f(f,l,{configurable:!0,value:a(null)}),n.exports=function(h){f[l][h]=!0}},function(n,o,r){var i=r(7),a=r(35),s=r(30),l=r(40),f=r(93),h=r(143),v=f("IE_PROTO"),b=i.Object,E=b.prototype;n.exports=h?b.getPrototypeOf:function(O){var w=l(O);if(a(w,v))return w[v];var S=w.constructor;return s(S)&&w instanceof S?S.prototype:w instanceof b?E:null}},function(n,o,r){var i=r(15),a=r(32),s=r(181);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l,f=!1,h={};try{(l=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(h,[]),f=h instanceof Array}catch{}return function(v,b){return a(v),s(b),f?l(v,b):v.__proto__=b,v}})():void 0)},function(n,o,r){var i,a,s=r(34),l=r(15),f=r(39),h=r(154),v=r(155),b=r(89),E=r(60),O=r(58).get,w=r(190),S=r(191),M=b("native-string-replace",String.prototype.replace),T=RegExp.prototype.exec,$=T,D=l("".charAt),P=l("".indexOf),B=l("".replace),F=l("".slice),I=(a=/b*/g,s(T,i=/a/,"a"),s(T,a,"a"),i.lastIndex!==0||a.lastIndex!==0),V=v.BROKEN_CARET,z=/()??/.exec("")[1]!==void 0;(I||z||V||w||S)&&($=function(q){var X,G,Q,J,ie,Se,Ae,Pe=this,De=O(Pe),ze=f(q),Ye=De.raw;if(Ye)return Ye.lastIndex=Pe.lastIndex,X=s($,Ye,ze),Pe.lastIndex=Ye.lastIndex,X;var Be=De.groups,Je=V&&Pe.sticky,gt=s(h,Pe),le=Pe.source,Ze=0,pe=ze;if(Je&&(gt=B(gt,"y",""),P(gt,"g")===-1&&(gt+="g"),pe=F(ze,Pe.lastIndex),Pe.lastIndex>0&&(!Pe.multiline||Pe.multiline&&D(ze,Pe.lastIndex-1)!==`
|
||
`)&&(le="(?: "+le+")",pe=" "+pe,Ze++),G=new RegExp("^(?:"+le+")",gt)),z&&(G=new RegExp("^"+le+"$(?!\\s)",gt)),I&&(Q=Pe.lastIndex),J=s(T,Je?G:Pe,pe),Je?J?(J.input=F(J.input,Ze),J[0]=F(J[0],Ze),J.index=Pe.lastIndex,Pe.lastIndex+=J[0].length):Pe.lastIndex=0:I&&J&&(Pe.lastIndex=Pe.global?J.index+J[0].length:Q),z&&J&&J.length>1&&s(M,J[0],G,(function(){for(ie=1;ie<arguments.length-2;ie++)arguments[ie]===void 0&&(J[ie]=void 0)})),J&&Be)for(J.groups=Se=E(null),ie=0;ie<Be.length;ie++)Se[(Ae=Be[ie])[0]]=J[Ae[1]];return J}),n.exports=$},function(n,o,r){var i=r(16),a=r(7),s=r(75),l=r(59),f=r(45),h=r(40),v=r(115),b=r(63),E=r(81)("splice"),O=a.TypeError,w=Math.max,S=Math.min,M=9007199254740991,T="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!E},{splice:function($,D){var P,B,F,I,V,z,q=h(this),X=f(q),G=s($,X),Q=arguments.length;if(Q===0?P=B=0:Q===1?(P=0,B=X-G):(P=Q-2,B=S(w(l(D),0),X-G)),X+P-B>M)throw O(T);for(F=v(q,B),I=0;I<B;I++)(V=G+I)in q&&b(F,I,q[V]);if(F.length=B,P<B){for(I=G;I<X-B;I++)z=I+P,(V=I+B)in q?q[z]=q[V]:delete q[z];for(I=X;I>X-B+P;I--)delete q[I-1]}else if(P>B)for(I=X-B;I>G;I--)z=I+P-1,(V=I+B-1)in q?q[z]=q[V]:delete q[z];for(I=0;I<P;I++)q[I+G]=arguments[I+2];return q.length=X-B+P,F}})},function(n,o,r){var i=r(16),a=r(205);i({target:"String",proto:!0,forced:r(206)("anchor")},{anchor:function(s){return a(this,"a","name",s)}})},function(n,o,r){(function(i){var a=typeof i=="object"&&i&&i.Object===Object&&i;o.a=a}).call(this,r(68))},function(n,o,r){(function(i){var a=r(31),s=t&&!t.nodeType&&t,l=s&&typeof i=="object"&&i&&!i.nodeType&&i,f=l&&l.exports===s?a.a.Buffer:void 0,h=f?f.allocUnsafe:void 0;o.a=function(v,b){if(b)return v.slice();var E=v.length,O=h?h(E):new v.constructor(E);return v.copy(O),O}}).call(this,r(122)(n))},function(n,o,r){var i=r(70),a=r(18);n.exports=!!Object.getOwnPropertySymbols&&!a((function(){var s=Symbol();return!String(s)||!(Object(s)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},function(n,o,r){var i=r(7),a=r(110),s="__core-js_shared__",l=i[s]||a(s,{});n.exports=l},function(n,o,r){var i=r(7),a=Object.defineProperty;n.exports=function(s,l){try{a(i,s,{value:l,configurable:!0,writable:!0})}catch{i[s]=l}return l}},function(n,o){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(n,o){o.f=Object.getOwnPropertySymbols},function(n,o,r){var i={};i[r(28)("toStringTag")]="z",n.exports=String(i)==="[object z]"},function(n,o,r){var i=r(7),a=r(75),s=r(45),l=r(63),f=i.Array,h=Math.max;n.exports=function(v,b,E){for(var O=s(v),w=a(b,O),S=a(E===void 0?O:E,O),M=f(h(S-w,0)),T=0;w<S;w++,T++)l(M,T,v[w]);return M.length=T,M}},function(n,o,r){var i=r(178);n.exports=function(a,s){return new(i(a))(s===0?0:s)}},function(n,o,r){var i=r(16),a=r(34),s=r(71),l=r(73),f=r(30),h=r(180),v=r(101),b=r(102),E=r(78),O=r(57),w=r(42),S=r(28),M=r(80),T=r(142),$=l.PROPER,D=l.CONFIGURABLE,P=T.IteratorPrototype,B=T.BUGGY_SAFARI_ITERATORS,F=S("iterator"),I="keys",V="values",z="entries",q=function(){return this};n.exports=function(X,G,Q,J,ie,Se,Ae){h(Q,G,J);var Pe,De,ze,Ye=function(se){if(se===ie&&Ze)return Ze;if(!B&&se in gt)return gt[se];switch(se){case I:case V:case z:return function(){return new Q(this,se)}}return function(){return new Q(this)}},Be=G+" Iterator",Je=!1,gt=X.prototype,le=gt[F]||gt["@@iterator"]||ie&>[ie],Ze=!B&&le||Ye(ie),pe=G=="Array"&>.entries||le;if(pe&&(Pe=v(pe.call(new X)))!==Object.prototype&&Pe.next&&(s||v(Pe)===P||(b?b(Pe,P):f(Pe[F])||w(Pe,F,q)),E(Pe,Be,!0,!0),s&&(M[Be]=q)),$&&ie==V&&le&&le.name!==V&&(!s&&D?O(gt,"name",V):(Je=!0,Ze=function(){return a(le,this)})),ie)if(De={values:Ye(V),keys:Se?Ze:Ye(I),entries:Ye(z)},Ae)for(ze in De)(B||Je||!(ze in gt))&&w(gt,ze,De[ze]);else i({target:G,proto:!0,forced:B||Je},De);return s&&!Ae||gt[F]===Ze||w(gt,F,Ze,{name:ie}),M[G]=Ze,De}},function(n,o,r){var i=r(7),a=r(64),s=r(34),l=r(32),f=r(88),h=r(145),v=r(45),b=r(54),E=r(146),O=r(118),w=r(147),S=i.TypeError,M=function($,D){this.stopped=$,this.result=D},T=M.prototype;n.exports=function($,D,P){var B,F,I,V,z,q,X,G=P&&P.that,Q=!(!P||!P.AS_ENTRIES),J=!(!P||!P.IS_ITERATOR),ie=!(!P||!P.INTERRUPTED),Se=a(D,G),Ae=function(De){return B&&w(B,"normal",De),new M(!0,De)},Pe=function(De){return Q?(l(De),ie?Se(De[0],De[1],Ae):Se(De[0],De[1])):ie?Se(De,Ae):Se(De)};if(J)B=$;else{if(!(F=O($)))throw S(f($)+" is not iterable");if(h(F)){for(I=0,V=v($);V>I;I++)if((z=Pe($[I]))&&b(T,z))return z;return new M(!1)}B=E($,F)}for(q=B.next;!(X=s(q,B)).done;){try{z=Pe(X.value)}catch(De){w(B,"throw",De)}if(typeof z=="object"&&z&&b(T,z))return z}return new M(!1)}},function(n,o,r){var i=r(97),a=r(62),s=r(80),l=r(28)("iterator");n.exports=function(f){if(f!=null)return a(f,l)||a(f,"@@iterator")||s[i(f)]}},function(n,o,r){var i=r(7),a=r(54),s=i.TypeError;n.exports=function(l,f){if(a(f,l))return l;throw s("Incorrect invocation")}},function(n,o,r){var i=r(28)("iterator"),a=!1;try{var s=0,l={next:function(){return{done:!!s++}},return:function(){a=!0}};l[i]=function(){return this},Array.from(l,(function(){throw 2}))}catch{}n.exports=function(f,h){if(!h&&!a)return!1;var v=!1;try{var b={};b[i]=function(){return{next:function(){return{done:v=!0}}}},f(b)}catch{}return v}},function(n,o,r){var i=r(18);n.exports=function(a,s){var l=[][a];return!!l&&i((function(){l.call(null,s||function(){throw 1},1)}))}},function(n,o){n.exports=function(r){if(!r.webpackPolyfill){var i=Object.create(r);i.children||(i.children=[]),Object.defineProperty(i,"loaded",{enumerable:!0,get:function(){return i.l}}),Object.defineProperty(i,"id",{enumerable:!0,get:function(){return i.i}}),Object.defineProperty(i,"exports",{enumerable:!0}),i.webpackPolyfill=1}return i}},function(n,o,r){r(19);var i=r(15),a=r(42),s=r(103),l=r(18),f=r(28),h=r(57),v=f("species"),b=RegExp.prototype;n.exports=function(E,O,w,S){var M=f(E),T=!l((function(){var B={};return B[M]=function(){return 7},""[E](B)!=7})),$=T&&!l((function(){var B=!1,F=/a/;return E==="split"&&((F={}).constructor={},F.constructor[v]=function(){return F},F.flags="",F[M]=/./[M]),F.exec=function(){return B=!0,null},F[M](""),!B}));if(!T||!$||w){var D=i(/./[M]),P=O(M,""[E],(function(B,F,I,V,z){var q=i(B),X=F.exec;return X===s||X===b.exec?T&&!z?{done:!0,value:D(F,I,V)}:{done:!0,value:q(I,F,V)}:{done:!1}}));a(String.prototype,E,P[0]),a(b,M,P[1])}S&&h(b[M],"sham",!0)}},function(n,o,r){var i=r(151).charAt;n.exports=function(a,s,l){return s+(l?i(a,s).length:1)}},function(n,o,r){var i=r(7),a=r(34),s=r(32),l=r(30),f=r(51),h=r(103),v=i.TypeError;n.exports=function(b,E){var O=b.exec;if(l(O)){var w=a(O,b,E);return w!==null&&s(w),w}if(f(b)==="RegExp")return a(h,b,E);throw v("RegExp#exec called on incompatible receiver")}},function(n,o,r){var i=r(76),a=r(34),s=r(15),l=r(123),f=r(18),h=r(32),v=r(30),b=r(59),E=r(94),O=r(39),w=r(44),S=r(124),M=r(62),T=r(201),$=r(125),D=r(28)("replace"),P=Math.max,B=Math.min,F=s([].concat),I=s([].push),V=s("".indexOf),z=s("".slice),q="a".replace(/./,"$0")==="$0",X=!!/./[D]&&/./[D]("a","$0")==="";l("replace",(function(G,Q,J){var ie=X?"$":"$0";return[function(Se,Ae){var Pe=w(this),De=Se==null?void 0:M(Se,D);return De?a(De,Se,Pe,Ae):a(Q,O(Pe),Se,Ae)},function(Se,Ae){var Pe=h(this),De=O(Se);if(typeof Ae=="string"&&V(Ae,ie)===-1&&V(Ae,"$<")===-1){var ze=J(Q,Pe,De,Ae);if(ze.done)return ze.value}var Ye=v(Ae);Ye||(Ae=O(Ae));var Be=Pe.global;if(Be){var Je=Pe.unicode;Pe.lastIndex=0}for(var gt=[];;){var le=$(Pe,De);if(le===null||(I(gt,le),!Be))break;O(le[0])===""&&(Pe.lastIndex=S(De,E(Pe.lastIndex),Je))}for(var Ze,pe="",se=0,we=0;we<gt.length;we++){for(var $e=O((le=gt[we])[0]),rt=P(B(b(le.index),De.length),0),pt=[],Lt=1;Lt<le.length;Lt++)I(pt,(Ze=le[Lt])===void 0?Ze:String(Ze));var Jt=le.groups;if(Ye){var en=F([$e],pt,rt,De);Jt!==void 0&&I(en,Jt);var zt=O(i(Ae,void 0,en))}else zt=T($e,De,rt,pt,Jt,Ae);rt>=se&&(pe+=z(De,se,rt)+zt,se=rt+$e.length)}return pe+z(De,se)}]}),!!f((function(){var G=/./;return G.exec=function(){var Q=[];return Q.groups={a:"7"},Q},"".replace(G,"$<a>")!=="7"}))||!q||X)},function(n,o,r){var i=r(16),a=Math.hypot,s=Math.abs,l=Math.sqrt;i({target:"Math",stat:!0,forced:!!a&&a(1/0,NaN)!==1/0},{hypot:function(f,h){for(var v,b,E=0,O=0,w=arguments.length,S=0;O<w;)S<(v=s(arguments[O++]))?(E=E*(b=S/v)*b+1,S=v):E+=v>0?(b=v/S)*b:v;return S===1/0?1/0:S*l(E)}})},function(n,o,r){var i=r(51),a=r(7);n.exports=i(a.process)=="process"},function(n,o,r){r(16)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(n,o,r){(function(i,a){var s;/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/(function(){var l,f="Expected a function",h="__lodash_hash_undefined__",v="__lodash_placeholder__",b=16,E=32,O=64,w=128,S=256,M=1/0,T=9007199254740991,$=NaN,D=4294967295,P=[["ary",w],["bind",1],["bindKey",2],["curry",8],["curryRight",b],["flip",512],["partial",E],["partialRight",O],["rearg",S]],B="[object Arguments]",F="[object Array]",I="[object Boolean]",V="[object Date]",z="[object Error]",q="[object Function]",X="[object GeneratorFunction]",G="[object Map]",Q="[object Number]",J="[object Object]",ie="[object Promise]",Se="[object RegExp]",Ae="[object Set]",Pe="[object String]",De="[object Symbol]",ze="[object WeakMap]",Ye="[object ArrayBuffer]",Be="[object DataView]",Je="[object Float32Array]",gt="[object Float64Array]",le="[object Int8Array]",Ze="[object Int16Array]",pe="[object Int32Array]",se="[object Uint8Array]",we="[object Uint8ClampedArray]",$e="[object Uint16Array]",rt="[object Uint32Array]",pt=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,en=/&(?:amp|lt|gt|quot|#39);/g,zt=/[&<>"']/g,it=RegExp(en.source),ae=RegExp(zt.source),re=/<%-([\s\S]+?)%>/g,je=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kt=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wt=/[\\^$.*+?()[\]{}|]/g,Pn=RegExp(Wt.source),qt=/^\s+/,xn=/\s/,ke=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ke=/\{\n\/\* \[wrapped with (.+)\] \*/,Le=/,? & /,dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,At=/[()=,{}\[\]\/\s]/,Tt=/\\(\\)?/g,wn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zn=/\w*$/,ao=/^[-+]0x[0-9a-f]+$/i,Lo=/^0b[01]+$/i,yo=/^\[object .+?Constructor\]$/,ho=/^0o[0-7]+$/i,Nn=/^(?:0|[1-9]\d*)$/,qn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rr=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,vn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",In="\\u2700-\\u27bf",sr="a-z\\xdf-\\xf6\\xf8-\\xff",wo="A-Z\\xc0-\\xd6\\xd8-\\xde",oo="\\ufe0e\\ufe0f",ta="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ca="['’]",Yi="[\\ud800-\\udfff]",fa="["+ta+"]",Ka="["+vn+"]",On="\\d+",Ts="[\\u2700-\\u27bf]",Oo="["+sr+"]",es="[^\\ud800-\\udfff"+ta+On+In+sr+wo+"]",Ui="\\ud83c[\\udffb-\\udfff]",gr="[^\\ud800-\\udfff]",gl="(?:\\ud83c[\\udde6-\\uddff]){2}",pa="[\\ud800-\\udbff][\\udc00-\\udfff]",qi="["+wo+"]",Na="(?:"+Oo+"|"+es+")",al="(?:"+qi+"|"+es+")",yl="(?:['’](?:d|ll|m|re|s|t|ve))?",Cs="(?:['’](?:D|LL|M|RE|S|T|VE))?",_l="(?:"+Ka+"|"+Ui+")?",ts="[\\ufe0e\\ufe0f]?",ve=ts+_l+("(?:\\u200d(?:"+[gr,gl,pa].join("|")+")"+ts+_l+")*"),mt="(?:"+[Ts,gl,pa].join("|")+")"+ve,cn="(?:"+[gr+Ka+"?",Ka,gl,pa,Yi].join("|")+")",Kn=RegExp(Ca,"g"),br=RegExp(Ka,"g"),so=RegExp(Ui+"(?="+Ui+")|"+cn+ve,"g"),si=RegExp([qi+"?"+Oo+"+"+yl+"(?="+[fa,qi,"$"].join("|")+")",al+"+"+Cs+"(?="+[fa,qi+Na,"$"].join("|")+")",qi+"?"+Na+"+"+yl,qi+"+"+Cs,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",On,mt].join("|"),"g"),ye=RegExp("[\\u200d\\ud800-\\udfff"+vn+oo+"]"),ht=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rn=-1,Cn={};Cn[Je]=Cn[gt]=Cn[le]=Cn[Ze]=Cn[pe]=Cn[se]=Cn[we]=Cn[$e]=Cn[rt]=!0,Cn[B]=Cn[F]=Cn[Ye]=Cn[I]=Cn[Be]=Cn[V]=Cn[z]=Cn[q]=Cn[G]=Cn[Q]=Cn[J]=Cn[Se]=Cn[Ae]=Cn[Pe]=Cn[ze]=!1;var nr={};nr[B]=nr[F]=nr[Ye]=nr[Be]=nr[I]=nr[V]=nr[Je]=nr[gt]=nr[le]=nr[Ze]=nr[pe]=nr[G]=nr[Q]=nr[J]=nr[Se]=nr[Ae]=nr[Pe]=nr[De]=nr[se]=nr[we]=nr[$e]=nr[rt]=!0,nr[z]=nr[q]=nr[ze]=!1;var Mn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},or=parseFloat,lr=parseInt,qr=typeof i=="object"&&i&&i.Object===Object&&i,na=typeof self=="object"&&self&&self.Object===Object&&self,vi=qr||na||Function("return this")(),bl=o&&!o.nodeType&&o,Vi=bl&&typeof a=="object"&&a&&!a.nodeType&&a,Ns=Vi&&Vi.exports===bl,Fl=Ns&&qr.process,Ro=(function(){try{var Ct=Vi&&Vi.require&&Vi.require("util").types;return Ct||Fl&&Fl.binding&&Fl.binding("util")}catch{}})(),La=Ro&&Ro.isArrayBuffer,id=Ro&&Ro.isDate,_u=Ro&&Ro.isMap,Ia=Ro&&Ro.isRegExp,ra=Ro&&Ro.isSet,wl=Ro&&Ro.isTypedArray;function qo(Ct,un,dn){switch(dn.length){case 0:return Ct.call(un);case 1:return Ct.call(un,dn[0]);case 2:return Ct.call(un,dn[0],dn[1]);case 3:return Ct.call(un,dn[0],dn[1],dn[2])}return Ct.apply(un,dn)}function Uh(Ct,un,dn,Wn){for(var Gr=-1,mo=Ct==null?0:Ct.length;++Gr<mo;){var ci=Ct[Gr];un(Wn,ci,dn(ci),Ct)}return Wn}function Fa(Ct,un){for(var dn=-1,Wn=Ct==null?0:Ct.length;++dn<Wn&&un(Ct[dn],dn,Ct)!==!1;);return Ct}function gp(Ct,un){for(var dn=Ct==null?0:Ct.length;dn--&&un(Ct[dn],dn,Ct)!==!1;);return Ct}function yp(Ct,un){for(var dn=-1,Wn=Ct==null?0:Ct.length;++dn<Wn;)if(!un(Ct[dn],dn,Ct))return!1;return!0}function Ba(Ct,un){for(var dn=-1,Wn=Ct==null?0:Ct.length,Gr=0,mo=[];++dn<Wn;){var ci=Ct[dn];un(ci,dn,Ct)&&(mo[Gr++]=ci)}return mo}function Za(Ct,un){return!!(Ct!=null&&Ct.length)&&bu(Ct,un,0)>-1}function rf(Ct,un,dn){for(var Wn=-1,Gr=Ct==null?0:Ct.length;++Wn<Gr;)if(dn(un,Ct[Wn]))return!0;return!1}function Mo(Ct,un){for(var dn=-1,Wn=Ct==null?0:Ct.length,Gr=Array(Wn);++dn<Wn;)Gr[dn]=un(Ct[dn],dn,Ct);return Gr}function oa(Ct,un){for(var dn=-1,Wn=un.length,Gr=Ct.length;++dn<Wn;)Ct[Gr+dn]=un[dn];return Ct}function ad(Ct,un,dn,Wn){var Gr=-1,mo=Ct==null?0:Ct.length;for(Wn&&mo&&(dn=Ct[++Gr]);++Gr<mo;)dn=un(dn,Ct[Gr],Gr,Ct);return dn}function _p(Ct,un,dn,Wn){var Gr=Ct==null?0:Ct.length;for(Wn&&Gr&&(dn=Ct[--Gr]);Gr--;)dn=un(dn,Ct[Gr],Gr,Ct);return dn}function of(Ct,un){for(var dn=-1,Wn=Ct==null?0:Ct.length;++dn<Wn;)if(un(Ct[dn],dn,Ct))return!0;return!1}var ld=Ua("length");function ns(Ct,un,dn){var Wn;return dn(Ct,(function(Gr,mo,ci){if(un(Gr,mo,ci))return Wn=mo,!1})),Wn}function $a(Ct,un,dn,Wn){for(var Gr=Ct.length,mo=dn+(Wn?1:-1);Wn?mo--:++mo<Gr;)if(un(Ct[mo],mo,Ct))return mo;return-1}function bu(Ct,un,dn){return un==un?(function(Wn,Gr,mo){for(var ci=mo-1,R=Wn.length;++ci<R;)if(Wn[ci]===Gr)return ci;return-1})(Ct,un,dn):$a(Ct,El,dn)}function Ja(Ct,un,dn,Wn){for(var Gr=dn-1,mo=Ct.length;++Gr<mo;)if(Wn(Ct[Gr],un))return Gr;return-1}function El(Ct){return Ct!=Ct}function vo(Ct,un){var dn=Ct==null?0:Ct.length;return dn?wu(Ct,un)/dn:$}function Ua(Ct){return function(un){return un==null?l:un[Ct]}}function Bl(Ct){return function(un){return Ct==null?l:Ct[un]}}function ha(Ct,un,dn,Wn,Gr){return Gr(Ct,(function(mo,ci,R){dn=Wn?(Wn=!1,mo):un(dn,mo,ci,R)})),dn}function wu(Ct,un){for(var dn,Wn=-1,Gr=Ct.length;++Wn<Gr;){var mo=un(Ct[Wn]);mo!==l&&(dn=dn===l?mo:dn+mo)}return dn}function Ks(Ct,un){for(var dn=-1,Wn=Array(Ct);++dn<Ct;)Wn[dn]=un(dn);return Wn}function $l(Ct){return Ct&&Ct.slice(0,ia(Ct)+1).replace(qt,"")}function ui(Ct){return function(un){return Ct(un)}}function lc(Ct,un){return Mo(un,(function(dn){return Ct[dn]}))}function rs(Ct,un){return Ct.has(un)}function xl(Ct,un){for(var dn=-1,Wn=Ct.length;++dn<Wn&&bu(un,Ct[dn],0)>-1;);return dn}function af(Ct,un){for(var dn=Ct.length;dn--&&bu(un,Ct[dn],0)>-1;);return dn}function Vh(Ct,un){for(var dn=Ct.length,Wn=0;dn--;)Ct[dn]===un&&++Wn;return Wn}var lf=Bl({À:"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"}),Gi=Bl({"&":"&","<":"<",">":">",'"':""","'":"'"});function sc(Ct){return"\\"+Mn[Ct]}function os(Ct){return ye.test(Ct)}function Ki(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Wn,Gr){dn[++un]=[Gr,Wn]})),dn}function sf(Ct,un){return function(dn){return Ct(un(dn))}}function ll(Ct,un){for(var dn=-1,Wn=Ct.length,Gr=0,mo=[];++dn<Wn;){var ci=Ct[dn];ci!==un&&ci!==v||(Ct[dn]=v,mo[Gr++]=dn)}return mo}function Ol(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Wn){dn[++un]=Wn})),dn}function sd(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Wn){dn[++un]=[Wn,Wn]})),dn}function Va(Ct){return os(Ct)?(function(un){for(var dn=so.lastIndex=0;so.test(un);)++dn;return dn})(Ct):ld(Ct)}function Qa(Ct){return os(Ct)?(function(un){return un.match(so)||[]})(Ct):(function(un){return un.split("")})(Ct)}function ia(Ct){for(var un=Ct.length;un--&&xn.test(Ct.charAt(un)););return un}var sl=Bl({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ka=(function Ct(un){var dn,Wn=(un=un==null?vi:ka.defaults(vi.Object(),un,ka.pick(vi,fn))).Array,Gr=un.Date,mo=un.Error,ci=un.Function,R=un.Math,L=un.Object,Z=un.RegExp,fe=un.String,Re=un.TypeError,lt=Wn.prototype,It=ci.prototype,_n=L.prototype,Jn=un["__core-js_shared__"],no=It.toString,$n=_n.hasOwnProperty,Do=0,Kr=(dn=/[^.]+$/.exec(Jn&&Jn.keys&&Jn.keys.IE_PROTO||""))?"Symbol(src)_1."+dn:"",So=_n.toString,ul=no.call(L),wi=vi._,el=Z("^"+no.call($n).replace(Wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ks=Ns?un.Buffer:l,Ps=un.Symbol,Zs=un.Uint8Array,Eu=ks?ks.allocUnsafe:l,is=sf(L.getPrototypeOf,L),xu=L.create,Zi=_n.propertyIsEnumerable,Js=lt.splice,Rs=Ps?Ps.isConcatSpreadable:l,as=Ps?Ps.iterator:l,ls=Ps?Ps.toStringTag:l,uc=(function(){try{var g=hs(L,"defineProperty");return g({},"",{}),g}catch{}})(),fm=un.clearTimeout!==vi.clearTimeout&&un.clearTimeout,pm=Gr&&Gr.now!==vi.Date.now&&Gr.now,Gh=un.setTimeout!==vi.setTimeout&&un.setTimeout,uf=R.ceil,cc=R.floor,bp=L.getOwnPropertySymbols,hm=ks?ks.isBuffer:l,dc=un.isFinite,cf=lt.join,wp=sf(L.keys,L),ji=R.max,Ga=R.min,Ep=Gr.now,xp=un.parseInt,ud=R.random,dy=lt.reverse,cd=hs(un,"DataView"),dd=hs(un,"Map"),df=hs(un,"Promise"),fc=hs(un,"Set"),Ou=hs(un,"WeakMap"),fd=hs(L,"create"),ff=Ou&&new Ou,Su={},fy=Ru(cd),pf=Ru(dd),py=Ru(df),hy=Ru(fc),vm=Ru(Ou),Op=Ps?Ps.prototype:l,Pa=Op?Op.valueOf:l,mm=Op?Op.toString:l;function he(g){if(Bi(g)&&!Jr(g)&&!(g instanceof go)){if(g instanceof Ul)return g;if($n.call(g,"__wrapped__"))return Xp(g)}return new Ul(g)}var pc=(function(){function g(){}return function(x){if(!Ni(x))return{};if(xu)return xu(x);g.prototype=x;var C=new g;return g.prototype=l,C}})();function Qs(){}function Ul(g,x){this.__wrapped__=g,this.__actions__=[],this.__chain__=!!x,this.__index__=0,this.__values__=l}function go(g){this.__wrapped__=g,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function ba(g){var x=-1,C=g==null?0:g.length;for(this.clear();++x<C;){var W=g[x];this.set(W[0],W[1])}}function To(g){var x=-1,C=g==null?0:g.length;for(this.clear();++x<C;){var W=g[x];this.set(W[0],W[1])}}function ss(g){var x=-1,C=g==null?0:g.length;for(this.clear();++x<C;){var W=g[x];this.set(W[0],W[1])}}function eu(g){var x=-1,C=g==null?0:g.length;for(this.__data__=new ss;++x<C;)this.add(g[x])}function Sl(g){var x=this.__data__=new To(g);this.size=x.size}function Sp(g,x){var C=Jr(g),W=!C&&Nc(g),te=!C&&!W&&nl(g),ce=!C&&!W&&!te&&yt(g),Oe=C||W||te||ce,Fe=Oe?Ks(g.length,fe):[],et=Fe.length;for(var jt in g)!x&&!$n.call(g,jt)||Oe&&(jt=="length"||te&&(jt=="offset"||jt=="parent")||ce&&(jt=="buffer"||jt=="byteLength"||jt=="byteOffset")||Ra(jt,et))||Fe.push(jt);return Fe}function Ap(g){var x=g.length;return x?g[ev(0,x-1)]:l}function Wh(g,x){return Bs(va(g),Au(x,0,g.length))}function gm(g){return Bs(va(g))}function tu(g,x,C){(C!==l&&!zl(g[x],C)||C===l&&!(x in g))&&us(g,x,C)}function Li(g,x,C){var W=g[x];$n.call(g,x)&&zl(W,C)&&(C!==l||x in g)||us(g,x,C)}function pd(g,x){for(var C=g.length;C--;)if(zl(g[C][0],x))return C;return-1}function zh(g,x,C,W){return mi(g,(function(te,ce,Oe){x(W,te,C(te),Oe)})),W}function nu(g,x){return g&&ds(x,on(x),g)}function us(g,x,C){x=="__proto__"&&uc?uc(g,x,{configurable:!0,enumerable:!0,value:C,writable:!0}):g[x]=C}function hf(g,x){for(var C=-1,W=x.length,te=Wn(W),ce=g==null;++C<W;)te[C]=ce?l:yn(g,x[C]);return te}function Au(g,x,C){return g==g&&(C!==l&&(g=g<=C?g:C),x!==l&&(g=g>=x?g:x)),g}function Al(g,x,C,W,te,ce){var Oe,Fe=1&x,et=2&x,jt=4&x;if(C&&(Oe=te?C(g,W,te,ce):C(g)),Oe!==l)return Oe;if(!Ni(g))return g;var Vt=Jr(g);if(Vt){if(Oe=(function(an){var Tn=an.length,Br=new an.constructor(Tn);return Tn&&typeof an[0]=="string"&&$n.call(an,"index")&&(Br.index=an.index,Br.input=an.input),Br})(g),!Fe)return va(g,Oe)}else{var gn=Ti(g),Yn=gn==q||gn==X;if(nl(g))return Sm(g,Fe);if(gn==J||gn==B||Yn&&!te){if(Oe=et||Yn?{}:tl(g),!Fe)return et?(function(an,Tn){return ds(an,Ec(an),Tn)})(g,(function(an,Tn){return an&&ds(Tn,Zt(Tn),an)})(Oe,g)):(function(an,Tn){return ds(an,aa(an),Tn)})(g,nu(Oe,g))}else{if(!nr[gn])return te?g:{};Oe=(function(an,Tn,Br){var ir=an.constructor;switch(Tn){case Ye:return mc(an);case I:case V:return new ir(+an);case Be:return(function(Yr,Ao){var Mr=Ao?mc(Yr.buffer):Yr.buffer;return new Yr.constructor(Mr,Yr.byteOffset,Yr.byteLength)})(an,Br);case Je:case gt:case le:case Ze:case pe:case se:case we:case $e:case rt:return Am(an,Br);case G:return new ir;case Q:case Pe:return new ir(an);case Se:return(function(Yr){var Ao=new Yr.constructor(Yr.source,Zn.exec(Yr));return Ao.lastIndex=Yr.lastIndex,Ao})(an);case Ae:return new ir;case De:return at=an,Pa?L(Pa.call(at)):{}}var at})(g,gn,Fe)}}ce||(ce=new Sl);var Qn=ce.get(g);if(Qn)return Qn;ce.set(g,Oe),Ie(g)?g.forEach((function(an){Oe.add(Al(an,x,C,an,g,ce))})):Jp(g)&&g.forEach((function(an,Tn){Oe.set(Tn,Al(an,x,C,Tn,g,ce))}));var Sr=Vt?l:(jt?et?Vp:xf:et?Zt:on)(g);return Fa(Sr||g,(function(an,Tn){Sr&&(an=g[Tn=an]),Li(Oe,Tn,Al(an,x,C,Tn,g,ce))})),Oe}function Hh(g,x,C){var W=C.length;if(g==null)return!W;for(g=L(g);W--;){var te=C[W],ce=x[te],Oe=g[te];if(Oe===l&&!(te in g)||!ce(Oe))return!1}return!0}function Xh(g,x,C){if(typeof g!="function")throw new Re(f);return Sc((function(){g.apply(l,C)}),x)}function cs(g,x,C,W){var te=-1,ce=Za,Oe=!0,Fe=g.length,et=[],jt=x.length;if(!Fe)return et;C&&(x=Mo(x,ui(C))),W?(ce=rf,Oe=!1):x.length>=200&&(ce=rs,Oe=!1,x=new eu(x));e:for(;++te<Fe;){var Vt=g[te],gn=C==null?Vt:C(Vt);if(Vt=W||Vt!==0?Vt:0,Oe&&gn==gn){for(var Yn=jt;Yn--;)if(x[Yn]===gn)continue e;et.push(Vt)}else ce(x,gn,W)||et.push(Vt)}return et}he.templateSettings={escape:re,evaluate:je,interpolate:vt,variable:"",imports:{_:he}},he.prototype=Qs.prototype,he.prototype.constructor=he,Ul.prototype=pc(Qs.prototype),Ul.prototype.constructor=Ul,go.prototype=pc(Qs.prototype),go.prototype.constructor=go,ba.prototype.clear=function(){this.__data__=fd?fd(null):{},this.size=0},ba.prototype.delete=function(g){var x=this.has(g)&&delete this.__data__[g];return this.size-=x?1:0,x},ba.prototype.get=function(g){var x=this.__data__;if(fd){var C=x[g];return C===h?l:C}return $n.call(x,g)?x[g]:l},ba.prototype.has=function(g){var x=this.__data__;return fd?x[g]!==l:$n.call(x,g)},ba.prototype.set=function(g,x){var C=this.__data__;return this.size+=this.has(g)?0:1,C[g]=fd&&x===l?h:x,this},To.prototype.clear=function(){this.__data__=[],this.size=0},To.prototype.delete=function(g){var x=this.__data__,C=pd(x,g);return!(C<0)&&(C==x.length-1?x.pop():Js.call(x,C,1),--this.size,!0)},To.prototype.get=function(g){var x=this.__data__,C=pd(x,g);return C<0?l:x[C][1]},To.prototype.has=function(g){return pd(this.__data__,g)>-1},To.prototype.set=function(g,x){var C=this.__data__,W=pd(C,g);return W<0?(++this.size,C.push([g,x])):C[W][1]=x,this},ss.prototype.clear=function(){this.size=0,this.__data__={hash:new ba,map:new(dd||To),string:new ba}},ss.prototype.delete=function(g){var x=wd(this,g).delete(g);return this.size-=x?1:0,x},ss.prototype.get=function(g){return wd(this,g).get(g)},ss.prototype.has=function(g){return wd(this,g).has(g)},ss.prototype.set=function(g,x){var C=wd(this,g),W=C.size;return C.set(g,x),this.size+=C.size==W?0:1,this},eu.prototype.add=eu.prototype.push=function(g){return this.__data__.set(g,h),this},eu.prototype.has=function(g){return this.__data__.has(g)},Sl.prototype.clear=function(){this.__data__=new To,this.size=0},Sl.prototype.delete=function(g){var x=this.__data__,C=x.delete(g);return this.size=x.size,C},Sl.prototype.get=function(g){return this.__data__.get(g)},Sl.prototype.has=function(g){return this.__data__.has(g)},Sl.prototype.set=function(g,x){var C=this.__data__;if(C instanceof To){var W=C.__data__;if(!dd||W.length<199)return W.push([g,x]),this.size=++C.size,this;C=this.__data__=new ss(W)}return C.set(g,x),this.size=C.size,this};var mi=_c(ur),ym=_c(ti,!0);function Yh(g,x){var C=!0;return mi(g,(function(W,te,ce){return C=!!x(W,te,ce)})),C}function Ii(g,x,C){for(var W=-1,te=g.length;++W<te;){var ce=g[W],Oe=x(ce);if(Oe!=null&&(Fe===l?Oe==Oe&&!Dt(Oe):C(Oe,Fe)))var Fe=Oe,et=ce}return et}function Io(g,x){var C=[];return mi(g,(function(W,te,ce){x(W,te,ce)&&C.push(W)})),C}function Ji(g,x,C,W,te){var ce=-1,Oe=g.length;for(C||(C=Sf),te||(te=[]);++ce<Oe;){var Fe=g[ce];x>0&&C(Fe)?x>1?Ji(Fe,x-1,C,W,te):oa(te,Fe):W||(te[te.length]=Fe)}return te}var lo=bc(),ei=bc(!0);function ur(g,x){return g&&lo(g,x,on)}function ti(g,x){return g&&ei(g,x,on)}function vf(g,x){return Ba(x,(function(C){return Cl(g[C])}))}function Ds(g,x){for(var C=0,W=(x=jo(x,g)).length;g!=null&&C<W;)g=g[vs(x[C++])];return C&&C==W?g:l}function Mp(g,x,C){var W=x(g);return Jr(g)?W:oa(W,C(g))}function Ei(g){return g==null?g===l?"[object Undefined]":"[object Null]":ls&&ls in L(g)?(function(x){var C=$n.call(x,ls),W=x[ls];try{x[ls]=l;var te=!0}catch{}var ce=So.call(x);return te&&(C?x[ls]=W:delete x[ls]),ce})(g):(function(x){return So.call(x)})(g)}function Mi(g,x){return g>x}function qh(g,x){return g!=null&&$n.call(g,x)}function Kh(g,x){return g!=null&&x in L(g)}function mf(g,x,C){for(var W=C?rf:Za,te=g[0].length,ce=g.length,Oe=ce,Fe=Wn(ce),et=1/0,jt=[];Oe--;){var Vt=g[Oe];Oe&&x&&(Vt=Mo(Vt,ui(x))),et=Ga(Vt.length,et),Fe[Oe]=!C&&(x||te>=120&&Vt.length>=120)?new eu(Oe&&Vt):l}Vt=g[0];var gn=-1,Yn=Fe[0];e:for(;++gn<te&&jt.length<et;){var Qn=Vt[gn],Sr=x?x(Qn):Qn;if(Qn=C||Qn!==0?Qn:0,!(Yn?rs(Yn,Sr):W(jt,Sr,C))){for(Oe=ce;--Oe;){var an=Fe[Oe];if(!(an?rs(an,Sr):W(g[Oe],Sr,C)))continue e}Yn&&Yn.push(Sr),jt.push(Qn)}}return jt}function Wa(g,x,C){var W=(g=Pu(g,x=jo(x,g)))==null?g:g[vs(gi(x))];return W==null?l:qo(W,g,C)}function Tp(g){return Bi(g)&&Ei(g)==B}function hd(g,x,C,W,te){return g===x||(g==null||x==null||!Bi(g)&&!Bi(x)?g!=g&&x!=x:(function(ce,Oe,Fe,et,jt,Vt){var gn=Jr(ce),Yn=Jr(Oe),Qn=gn?F:Ti(ce),Sr=Yn?F:Ti(Oe),an=(Qn=Qn==B?J:Qn)==J,Tn=(Sr=Sr==B?J:Sr)==J,Br=Qn==Sr;if(Br&&nl(ce)){if(!nl(Oe))return!1;gn=!0,an=!1}if(Br&&!an)return Vt||(Vt=new Sl),gn||yt(ce)?bd(ce,Oe,Fe,et,jt,Vt):(function(Mr,Ur,xa,Hl,uu,Oa,Iu){switch(xa){case Be:if(Mr.byteLength!=Ur.byteLength||Mr.byteOffset!=Ur.byteOffset)return!1;Mr=Mr.buffer,Ur=Ur.buffer;case Ye:return!(Mr.byteLength!=Ur.byteLength||!Oa(new Zs(Mr),new Zs(Ur)));case I:case V:case Q:return zl(+Mr,+Ur);case z:return Mr.name==Ur.name&&Mr.message==Ur.message;case Se:case Pe:return Mr==Ur+"";case G:var Pc=Ki;case Ae:var Qp=1&Hl;if(Pc||(Pc=Ol),Mr.size!=Ur.size&&!Qp)return!1;var yv=Iu.get(Mr);if(yv)return yv==Ur;Hl|=2,Iu.set(Mr,Ur);var Fu=bd(Pc(Mr),Pc(Ur),Hl,uu,Oa,Iu);return Iu.delete(Mr),Fu;case De:if(Pa)return Pa.call(Mr)==Pa.call(Ur)}return!1})(ce,Oe,Qn,Fe,et,jt,Vt);if(!(1&Fe)){var ir=an&&$n.call(ce,"__wrapped__"),at=Tn&&$n.call(Oe,"__wrapped__");if(ir||at){var Yr=ir?ce.value():ce,Ao=at?Oe.value():Oe;return Vt||(Vt=new Sl),jt(Yr,Ao,Fe,et,Vt)}}return Br?(Vt||(Vt=new Sl),(function(Mr,Ur,xa,Hl,uu,Oa){var Iu=1&xa,Pc=xf(Mr),Qp=Pc.length,yv=xf(Ur).length;if(Qp!=yv&&!Iu)return!1;for(var Fu=Qp;Fu--;){var Sd=Pc[Fu];if(!(Iu?Sd in Ur:$n.call(Ur,Sd)))return!1}var wy=Oa.get(Mr),eh=Oa.get(Ur);if(wy&&eh)return wy==Ur&&eh==Mr;var _v=!0;Oa.set(Mr,Ur),Oa.set(Ur,Mr);for(var Ey=Iu;++Fu<Qp;){var bv=Mr[Sd=Pc[Fu]],Vf=Ur[Sd];if(Hl)var Gf=Iu?Hl(Vf,bv,Sd,Ur,Mr,Oa):Hl(bv,Vf,Sd,Mr,Ur,Oa);if(!(Gf===l?bv===Vf||uu(bv,Vf,xa,Hl,Oa):Gf)){_v=!1;break}Ey||(Ey=Sd=="constructor")}if(_v&&!Ey){var Rc=Mr.constructor,wv=Ur.constructor;Rc==wv||!("constructor"in Mr)||!("constructor"in Ur)||typeof Rc=="function"&&Rc instanceof Rc&&typeof wv=="function"&&wv instanceof wv||(_v=!1)}return Oa.delete(Mr),Oa.delete(Ur),_v})(ce,Oe,Fe,et,jt,Vt)):!1})(g,x,C,W,hd,te))}function Vl(g,x,C,W){var te=C.length,ce=te,Oe=!W;if(g==null)return!ce;for(g=L(g);te--;){var Fe=C[te];if(Oe&&Fe[2]?Fe[1]!==g[Fe[0]]:!(Fe[0]in g))return!1}for(;++te<ce;){var et=(Fe=C[te])[0],jt=g[et],Vt=Fe[1];if(Oe&&Fe[2]){if(jt===l&&!(et in g))return!1}else{var gn=new Sl;if(W)var Yn=W(jt,Vt,et,g,x,gn);if(!(Yn===l?hd(Vt,jt,3,W,gn):Yn))return!1}}return!0}function Mu(g){return!(!Ni(g)||(x=g,Kr&&Kr in x))&&(Cl(g)?el:yo).test(Ru(g));var x}function ru(g){return typeof g=="function"?g:g==null?Nr:typeof g=="object"?Jr(g)?Jh(g[0],g[1]):Zh(g):xe(g)}function Gl(g){if(!Qt(g))return wp(g);var x=[];for(var C in L(g))$n.call(g,C)&&C!="constructor"&&x.push(C);return x}function _m(g){if(!Ni(g))return(function(te){var ce=[];if(te!=null)for(var Oe in L(te))ce.push(Oe);return ce})(g);var x=Qt(g),C=[];for(var W in g)(W!="constructor"||!x&&$n.call(g,W))&&C.push(W);return C}function js(g,x){return g<x}function Ml(g,x){var C=-1,W=fl(g)?Wn(g.length):[];return mi(g,(function(te,ce,Oe){W[++C]=x(te,ce,Oe)})),W}function Zh(g){var x=Of(g);return x.length==1&&x[0][2]?Af(x[0][0],x[0][1]):function(C){return C===g||Vl(C,g,x)}}function Jh(g,x){return Is(g)&&xc(x)?Af(vs(g),x):function(C){var W=yn(C,g);return W===l&&W===x?Yt(C,g):hd(x,W,3)}}function Cp(g,x,C,W,te){g!==x&&lo(x,(function(ce,Oe){if(te||(te=new Sl),Ni(ce))(function(et,jt,Vt,gn,Yn,Qn,Sr){var an=zp(et,Vt),Tn=zp(jt,Vt),Br=Sr.get(Tn);if(Br)return void tu(et,Vt,Br);var ir=Qn?Qn(an,Tn,Vt+"",et,jt,Sr):l,at=ir===l;if(at){var Yr=Jr(Tn),Ao=!Yr&&nl(Tn),Mr=!Yr&&!Ao&&yt(Tn);ir=Tn,Yr||Ao||Mr?Jr(an)?ir=an:Oi(an)?ir=va(an):Ao?(at=!1,ir=Sm(Tn,!0)):Mr?(at=!1,ir=Am(Tn,!0)):ir=[]:K(Tn)||Nc(Tn)?(ir=an,Nc(an)?ir=rn(an):Ni(an)&&!Cl(an)||(ir=tl(Tn))):at=!1}at&&(Sr.set(Tn,ir),Yn(ir,Tn,gn,Qn,Sr),Sr.delete(Tn)),tu(et,Vt,ir)})(g,x,Oe,C,Cp,W,te);else{var Fe=W?W(zp(g,Oe),ce,Oe+"",g,x,te):l;Fe===l&&(Fe=ce),tu(g,Oe,Fe)}}),Zt)}function bm(g,x){var C=g.length;if(C)return Ra(x+=x<0?C:0,C)?g[x]:l}function wm(g,x,C){x=x.length?Mo(x,(function(ce){return Jr(ce)?function(Oe){return Ds(Oe,ce.length===1?ce[0]:ce)}:ce})):[Nr];var W=-1;x=Mo(x,ui(Rr()));var te=Ml(g,(function(ce,Oe,Fe){var et=Mo(x,(function(jt){return jt(ce)}));return{criteria:et,index:++W,value:ce}}));return(function(ce,Oe){var Fe=ce.length;for(ce.sort(Oe);Fe--;)ce[Fe]=ce[Fe].value;return ce})(te,(function(ce,Oe){return(function(Fe,et,jt){for(var Vt=-1,gn=Fe.criteria,Yn=et.criteria,Qn=gn.length,Sr=jt.length;++Vt<Qn;){var an=vd(gn[Vt],Yn[Vt]);if(an)return Vt>=Sr?an:an*(jt[Vt]=="desc"?-1:1)}return Fe.index-et.index})(ce,Oe,C)}))}function Em(g,x,C){for(var W=-1,te=x.length,ce={};++W<te;){var Oe=x[W],Fe=Ds(g,Oe);C(Fe,Oe)&&hc(ce,jo(Oe,g),Fe)}return ce}function Np(g,x,C,W){var te=W?Ja:bu,ce=-1,Oe=x.length,Fe=g;for(g===x&&(x=va(x)),C&&(Fe=Mo(g,ui(C)));++ce<Oe;)for(var et=0,jt=x[ce],Vt=C?C(jt):jt;(et=te(Fe,Vt,et,W))>-1;)Fe!==g&&Js.call(Fe,et,1),Js.call(g,et,1);return g}function Qh(g,x){for(var C=g?x.length:0,W=C-1;C--;){var te=x[C];if(C==W||te!==ce){var ce=te;Ra(te)?Js.call(g,te,1):Pp(g,te)}}return g}function ev(g,x){return g+cc(ud()*(x-g+1))}function gf(g,x){var C="";if(!g||x<1||x>T)return C;do x%2&&(C+=g),(x=cc(x/2))&&(g+=g);while(x);return C}function uo(g,x){return Tf(Mf(g,x,Nr),g+"")}function vy(g){return Ap(Qr(g))}function tv(g,x){var C=Qr(g);return Bs(C,Au(x,0,C.length))}function hc(g,x,C,W){if(!Ni(g))return g;for(var te=-1,ce=(x=jo(x,g)).length,Oe=ce-1,Fe=g;Fe!=null&&++te<ce;){var et=vs(x[te]),jt=C;if(et==="__proto__"||et==="constructor"||et==="prototype")return g;if(te!=Oe){var Vt=Fe[et];(jt=W?W(Vt,et,Fe):l)===l&&(jt=Ni(Vt)?Vt:Ra(x[te+1])?[]:{})}Li(Fe,et,jt),Fe=Fe[et]}return g}var yf=ff?function(g,x){return ff.set(g,x),g}:Nr,my=uc?function(g,x){return uc(g,"toString",{configurable:!0,enumerable:!1,value:co(x),writable:!0})}:Nr;function xm(g){return Bs(Qr(g))}function Tl(g,x,C){var W=-1,te=g.length;x<0&&(x=-x>te?0:te+x),(C=C>te?te:C)<0&&(C+=te),te=x>C?0:C-x>>>0,x>>>=0;for(var ce=Wn(te);++W<te;)ce[W]=g[W+x];return ce}function gy(g,x){var C;return mi(g,(function(W,te,ce){return!(C=x(W,te,ce))})),!!C}function _f(g,x,C){var W=0,te=g==null?W:g.length;if(typeof x=="number"&&x==x&&te<=2147483647){for(;W<te;){var ce=W+te>>>1,Oe=g[ce];Oe!==null&&!Dt(Oe)&&(C?Oe<=x:Oe<x)?W=ce+1:te=ce}return te}return kp(g,x,Nr,C)}function kp(g,x,C,W){var te=0,ce=g==null?0:g.length;if(ce===0)return 0;for(var Oe=(x=C(x))!=x,Fe=x===null,et=Dt(x),jt=x===l;te<ce;){var Vt=cc((te+ce)/2),gn=C(g[Vt]),Yn=gn!==l,Qn=gn===null,Sr=gn==gn,an=Dt(gn);if(Oe)var Tn=W||Sr;else Tn=jt?Sr&&(W||Yn):Fe?Sr&&Yn&&(W||!Qn):et?Sr&&Yn&&!Qn&&(W||!an):!Qn&&!an&&(W?gn<=x:gn<x);Tn?te=Vt+1:ce=Vt}return Ga(ce,4294967294)}function nv(g,x){for(var C=-1,W=g.length,te=0,ce=[];++C<W;){var Oe=g[C],Fe=x?x(Oe):Oe;if(!C||!zl(Fe,et)){var et=Fe;ce[te++]=Oe===0?0:Oe}}return ce}function Om(g){return typeof g=="number"?g:Dt(g)?$:+g}function cl(g){if(typeof g=="string")return g;if(Jr(g))return Mo(g,cl)+"";if(Dt(g))return mm?mm.call(g):"";var x=g+"";return x=="0"&&1/g==-1/0?"-0":x}function Tu(g,x,C){var W=-1,te=Za,ce=g.length,Oe=!0,Fe=[],et=Fe;if(C)Oe=!1,te=rf;else if(ce>=200){var jt=x?null:Tm(g);if(jt)return Ol(jt);Oe=!1,te=rs,et=new eu}else et=x?[]:Fe;e:for(;++W<ce;){var Vt=g[W],gn=x?x(Vt):Vt;if(Vt=C||Vt!==0?Vt:0,Oe&&gn==gn){for(var Yn=et.length;Yn--;)if(et[Yn]===gn)continue e;x&&et.push(gn),Fe.push(Vt)}else te(et,gn,C)||(et!==Fe&&et.push(gn),Fe.push(Vt))}return Fe}function Pp(g,x){return(g=Pu(g,x=jo(x,g)))==null||delete g[vs(gi(x))]}function vc(g,x,C,W){return hc(g,x,C(Ds(g,x)),W)}function Rp(g,x,C,W){for(var te=g.length,ce=W?te:-1;(W?ce--:++ce<te)&&x(g[ce],ce,g););return C?Tl(g,W?0:ce,W?ce+1:te):Tl(g,W?ce+1:0,W?te:ce)}function rv(g,x){var C=g;return C instanceof go&&(C=C.value()),ad(x,(function(W,te){return te.func.apply(te.thisArg,oa([W],te.args))}),C)}function Dp(g,x,C){var W=g.length;if(W<2)return W?Tu(g[0]):[];for(var te=-1,ce=Wn(W);++te<W;)for(var Oe=g[te],Fe=-1;++Fe<W;)Fe!=te&&(ce[te]=cs(ce[te]||Oe,g[Fe],x,C));return Tu(Ji(ce,1),x,C)}function bf(g,x,C){for(var W=-1,te=g.length,ce=x.length,Oe={};++W<te;){var Fe=W<ce?x[W]:l;C(Oe,g[W],Fe)}return Oe}function jp(g){return Oi(g)?g:[]}function Lp(g){return typeof g=="function"?g:Nr}function jo(g,x){return Jr(g)?g:Is(g,x)?[g]:dv(Gt(g))}var yy=uo;function Uo(g,x,C){var W=g.length;return C=C===l?W:C,!x&&C>=W?g:Tl(g,x,C)}var Ip=fm||function(g){return vi.clearTimeout(g)};function Sm(g,x){if(x)return g.slice();var C=g.length,W=Eu?Eu(C):new g.constructor(C);return g.copy(W),W}function mc(g){var x=new g.constructor(g.byteLength);return new Zs(x).set(new Zs(g)),x}function Am(g,x){var C=x?mc(g.buffer):g.buffer;return new g.constructor(C,g.byteOffset,g.length)}function vd(g,x){if(g!==x){var C=g!==l,W=g===null,te=g==g,ce=Dt(g),Oe=x!==l,Fe=x===null,et=x==x,jt=Dt(x);if(!Fe&&!jt&&!ce&&g>x||ce&&Oe&&et&&!Fe&&!jt||W&&Oe&&et||!C&&et||!te)return 1;if(!W&&!ce&&!jt&&g<x||jt&&C&&te&&!W&&!ce||Fe&&C&&te||!Oe&&te||!et)return-1}return 0}function Mm(g,x,C,W){for(var te=-1,ce=g.length,Oe=C.length,Fe=-1,et=x.length,jt=ji(ce-Oe,0),Vt=Wn(et+jt),gn=!W;++Fe<et;)Vt[Fe]=x[Fe];for(;++te<Oe;)(gn||te<ce)&&(Vt[C[te]]=g[te]);for(;jt--;)Vt[Fe++]=g[te++];return Vt}function gc(g,x,C,W){for(var te=-1,ce=g.length,Oe=-1,Fe=C.length,et=-1,jt=x.length,Vt=ji(ce-Fe,0),gn=Wn(Vt+jt),Yn=!W;++te<Vt;)gn[te]=g[te];for(var Qn=te;++et<jt;)gn[Qn+et]=x[et];for(;++Oe<Fe;)(Yn||te<ce)&&(gn[Qn+C[Oe]]=g[te++]);return gn}function va(g,x){var C=-1,W=g.length;for(x||(x=Wn(W));++C<W;)x[C]=g[C];return x}function ds(g,x,C,W){var te=!C;C||(C={});for(var ce=-1,Oe=x.length;++ce<Oe;){var Fe=x[ce],et=W?W(C[Fe],g[Fe],Fe,C,g):l;et===l&&(et=g[Fe]),te?us(C,Fe,et):Li(C,Fe,et)}return C}function ou(g,x){return function(C,W){var te=Jr(C)?Uh:zh,ce=x?x():{};return te(C,g,Rr(W,2),ce)}}function yc(g){return uo((function(x,C){var W=-1,te=C.length,ce=te>1?C[te-1]:l,Oe=te>2?C[2]:l;for(ce=g.length>3&&typeof ce=="function"?(te--,ce):l,Oe&&Fi(C[0],C[1],Oe)&&(ce=te<3?l:ce,te=1),x=L(x);++W<te;){var Fe=C[W];Fe&&g(x,Fe,W,ce)}return x}))}function _c(g,x){return function(C,W){if(C==null)return C;if(!fl(C))return g(C,W);for(var te=C.length,ce=x?te:-1,Oe=L(C);(x?ce--:++ce<te)&&W(Oe[ce],ce,Oe)!==!1;);return C}}function bc(g){return function(x,C,W){for(var te=-1,ce=L(x),Oe=W(x),Fe=Oe.length;Fe--;){var et=Oe[g?Fe:++te];if(C(ce[et],et,ce)===!1)break}return x}}function Fp(g){return function(x){var C=os(x=Gt(x))?Qa(x):l,W=C?C[0]:x.charAt(0),te=C?Uo(C,1).join(""):x.slice(1);return W[g]()+te}}function iu(g){return function(x){return ad(di(jr(x).replace(Kn,"")),g,"")}}function wc(g){return function(){var x=arguments;switch(x.length){case 0:return new g;case 1:return new g(x[0]);case 2:return new g(x[0],x[1]);case 3:return new g(x[0],x[1],x[2]);case 4:return new g(x[0],x[1],x[2],x[3]);case 5:return new g(x[0],x[1],x[2],x[3],x[4]);case 6:return new g(x[0],x[1],x[2],x[3],x[4],x[5]);case 7:return new g(x[0],x[1],x[2],x[3],x[4],x[5],x[6])}var C=pc(g.prototype),W=g.apply(C,x);return Ni(W)?W:C}}function Bp(g){return function(x,C,W){var te=L(x);if(!fl(x)){var ce=Rr(C,3);x=on(x),C=function(Fe){return ce(te[Fe],Fe,te)}}var Oe=g(x,C,W);return Oe>-1?te[ce?x[Oe]:Oe]:l}}function fs(g){return Ls((function(x){var C=x.length,W=C,te=Ul.prototype.thru;for(g&&x.reverse();W--;){var ce=x[W];if(typeof ce!="function")throw new Re(f);if(te&&!Oe&&Cu(ce)=="wrapper")var Oe=new Ul([],!0)}for(W=Oe?W:C;++W<C;){var Fe=Cu(ce=x[W]),et=Fe=="wrapper"?Gp(ce):l;Oe=et&&Fs(et[0])&&et[1]==424&&!et[4].length&&et[9]==1?Oe[Cu(et[0])].apply(Oe,et[3]):ce.length==1&&Fs(ce)?Oe[Fe]():Oe.thru(ce)}return function(){var jt=arguments,Vt=jt[0];if(Oe&&jt.length==1&&Jr(Vt))return Oe.plant(Vt).value();for(var gn=0,Yn=C?x[gn].apply(this,jt):Vt;++gn<C;)Yn=x[gn].call(this,Yn);return Yn}}))}function wf(g,x,C,W,te,ce,Oe,Fe,et,jt){var Vt=x&w,gn=1&x,Yn=2&x,Qn=24&x,Sr=512&x,an=Yn?l:wc(g);return function Tn(){for(var Br=arguments.length,ir=Wn(Br),at=Br;at--;)ir[at]=arguments[at];if(Qn)var Yr=Nu(Tn),Ao=Vh(ir,Yr);if(W&&(ir=Mm(ir,W,te,Qn)),ce&&(ir=gc(ir,ce,Oe,Qn)),Br-=Ao,Qn&&Br<jt){var Mr=ll(ir,Yr);return ov(g,x,wf,Tn.placeholder,C,ir,Mr,Fe,et,jt-Br)}var Ur=gn?C:this,xa=Yn?Ur[g]:g;return Br=ir.length,Fe?ir=Oc(ir,Fe):Sr&&Br>1&&ir.reverse(),Vt&&et<Br&&(ir.length=et),this&&this!==vi&&this instanceof Tn&&(xa=an||wc(xa)),xa.apply(Ur,ir)}}function Ef(g,x){return function(C,W){return(function(te,ce,Oe,Fe){return ur(te,(function(et,jt,Vt){ce(Fe,Oe(et),jt,Vt)})),Fe})(C,g,x(W),{})}}function md(g,x){return function(C,W){var te;if(C===l&&W===l)return x;if(C!==l&&(te=C),W!==l){if(te===l)return W;typeof C=="string"||typeof W=="string"?(C=cl(C),W=cl(W)):(C=Om(C),W=Om(W)),te=g(C,W)}return te}}function gd(g){return Ls((function(x){return x=Mo(x,ui(Rr())),uo((function(C){var W=this;return g(x,(function(te){return qo(te,W,C)}))}))}))}function yd(g,x){var C=(x=x===l?" ":cl(x)).length;if(C<2)return C?gf(x,g):x;var W=gf(x,uf(g/Va(x)));return os(x)?Uo(Qa(W),0,g).join(""):W.slice(0,g)}function $p(g){return function(x,C,W){return W&&typeof W!="number"&&Fi(x,C,W)&&(C=W=l),x=nn(x),C===l?(C=x,x=0):C=nn(C),(function(te,ce,Oe,Fe){for(var et=-1,jt=ji(uf((ce-te)/(Oe||1)),0),Vt=Wn(jt);jt--;)Vt[Fe?jt:++et]=te,te+=Oe;return Vt})(x,C,W=W===l?x<C?1:-1:nn(W),g)}}function _d(g){return function(x,C){return typeof x=="string"&&typeof C=="string"||(x=pn(x),C=pn(C)),g(x,C)}}function ov(g,x,C,W,te,ce,Oe,Fe,et,jt){var Vt=8&x;x|=Vt?E:O,4&(x&=~(Vt?O:E))||(x&=-4);var gn=[g,x,te,Vt?ce:l,Vt?Oe:l,Vt?l:ce,Vt?l:Oe,Fe,et,jt],Yn=C.apply(l,gn);return Fs(g)&&uv(Yn,gn),Yn.placeholder=W,Hp(Yn,g,x)}function Up(g){var x=R[g];return function(C,W){if(C=pn(C),(W=W==null?0:Ga(Mt(W),292))&&dc(C)){var te=(Gt(C)+"e").split("e");return+((te=(Gt(x(te[0]+"e"+(+te[1]+W)))+"e").split("e"))[0]+"e"+(+te[1]-W))}return x(C)}}var Tm=fc&&1/Ol(new fc([,-0]))[1]==M?function(g){return new fc(g)}:Et;function iv(g){return function(x){var C=Ti(x);return C==G?Ki(x):C==Ae?sd(x):(function(W,te){return Mo(te,(function(ce){return[ce,W[ce]]}))})(x,g(x))}}function ps(g,x,C,W,te,ce,Oe,Fe){var et=2&x;if(!et&&typeof g!="function")throw new Re(f);var jt=W?W.length:0;if(jt||(x&=-97,W=te=l),Oe=Oe===l?Oe:ji(Mt(Oe),0),Fe=Fe===l?Fe:Mt(Fe),jt-=te?te.length:0,x&O){var Vt=W,gn=te;W=te=l}var Yn=et?l:Gp(g),Qn=[g,x,C,W,te,Vt,gn,ce,Oe,Fe];if(Yn&&(function(an,Tn){var Br=an[1],ir=Tn[1],at=Br|ir,Yr=at<131,Ao=ir==w&&Br==8||ir==w&&Br==S&&an[7].length<=Tn[8]||ir==384&&Tn[7].length<=Tn[8]&&Br==8;if(!Yr&&!Ao)return an;1&ir&&(an[2]=Tn[2],at|=1&Br?0:4);var Mr=Tn[3];if(Mr){var Ur=an[3];an[3]=Ur?Mm(Ur,Mr,Tn[4]):Mr,an[4]=Ur?ll(an[3],v):Tn[4]}(Mr=Tn[5])&&(Ur=an[5],an[5]=Ur?gc(Ur,Mr,Tn[6]):Mr,an[6]=Ur?ll(an[5],v):Tn[6]),(Mr=Tn[7])&&(an[7]=Mr),ir&w&&(an[8]=an[8]==null?Tn[8]:Ga(an[8],Tn[8])),an[9]==null&&(an[9]=Tn[9]),an[0]=Tn[0],an[1]=at})(Qn,Yn),g=Qn[0],x=Qn[1],C=Qn[2],W=Qn[3],te=Qn[4],!(Fe=Qn[9]=Qn[9]===l?et?0:g.length:ji(Qn[9]-jt,0))&&24&x&&(x&=-25),x&&x!=1)Sr=x==8||x==b?(function(an,Tn,Br){var ir=wc(an);return function at(){for(var Yr=arguments.length,Ao=Wn(Yr),Mr=Yr,Ur=Nu(at);Mr--;)Ao[Mr]=arguments[Mr];var xa=Yr<3&&Ao[0]!==Ur&&Ao[Yr-1]!==Ur?[]:ll(Ao,Ur);return(Yr-=xa.length)<Br?ov(an,Tn,wf,at.placeholder,l,Ao,xa,l,l,Br-Yr):qo(this&&this!==vi&&this instanceof at?ir:an,this,Ao)}})(g,x,Fe):x!=E&&x!=33||te.length?wf.apply(l,Qn):(function(an,Tn,Br,ir){var at=1&Tn,Yr=wc(an);return function Ao(){for(var Mr=-1,Ur=arguments.length,xa=-1,Hl=ir.length,uu=Wn(Hl+Ur),Oa=this&&this!==vi&&this instanceof Ao?Yr:an;++xa<Hl;)uu[xa]=ir[xa];for(;Ur--;)uu[xa++]=arguments[++Mr];return qo(Oa,at?Br:this,uu)}})(g,x,C,W);else var Sr=(function(an,Tn,Br){var ir=1&Tn,at=wc(an);return function Yr(){return(this&&this!==vi&&this instanceof Yr?at:an).apply(ir?Br:this,arguments)}})(g,x,C);return Hp((Yn?yf:uv)(Sr,Qn),g,x)}function av(g,x,C,W){return g===l||zl(g,_n[C])&&!$n.call(W,C)?x:g}function lv(g,x,C,W,te,ce){return Ni(g)&&Ni(x)&&(ce.set(x,g),Cp(g,x,l,lv,ce),ce.delete(x)),g}function sv(g){return K(g)?l:g}function bd(g,x,C,W,te,ce){var Oe=1&C,Fe=g.length,et=x.length;if(Fe!=et&&!(Oe&&et>Fe))return!1;var jt=ce.get(g),Vt=ce.get(x);if(jt&&Vt)return jt==x&&Vt==g;var gn=-1,Yn=!0,Qn=2&C?new eu:l;for(ce.set(g,x),ce.set(x,g);++gn<Fe;){var Sr=g[gn],an=x[gn];if(W)var Tn=Oe?W(an,Sr,gn,x,g,ce):W(Sr,an,gn,g,x,ce);if(Tn!==l){if(Tn)continue;Yn=!1;break}if(Qn){if(!of(x,(function(Br,ir){if(!rs(Qn,ir)&&(Sr===Br||te(Sr,Br,C,W,ce)))return Qn.push(ir)}))){Yn=!1;break}}else if(Sr!==an&&!te(Sr,an,C,W,ce)){Yn=!1;break}}return ce.delete(g),ce.delete(x),Yn}function Ls(g){return Tf(Mf(g,l,Cf),g+"")}function xf(g){return Mp(g,on,aa)}function Vp(g){return Mp(g,Zt,Ec)}var Gp=ff?function(g){return ff.get(g)}:Et;function Cu(g){for(var x=g.name+"",C=Su[x],W=$n.call(Su,x)?C.length:0;W--;){var te=C[W],ce=te.func;if(ce==null||ce==g)return te.name}return x}function Nu(g){return($n.call(he,"placeholder")?he:g).placeholder}function Rr(){var g=he.iteratee||fi;return g=g===fi?ru:g,arguments.length?g(arguments[0],arguments[1]):g}function wd(g,x){var C,W,te=g.__data__;return((W=typeof(C=x))=="string"||W=="number"||W=="symbol"||W=="boolean"?C!=="__proto__":C===null)?te[typeof x=="string"?"string":"hash"]:te.map}function Of(g){for(var x=on(g),C=x.length;C--;){var W=x[C],te=g[W];x[C]=[W,te,xc(te)]}return x}function hs(g,x){var C=(function(W,te){return W==null?l:W[te]})(g,x);return Mu(C)?C:l}var aa=bp?function(g){return g==null?[]:(g=L(g),Ba(bp(g),(function(x){return Zi.call(g,x)})))}:tt,Ec=bp?function(g){for(var x=[];g;)oa(x,aa(g)),g=is(g);return x}:tt,Ti=Ei;function ku(g,x,C){for(var W=-1,te=(x=jo(x,g)).length,ce=!1;++W<te;){var Oe=vs(x[W]);if(!(ce=g!=null&&C(g,Oe)))break;g=g[Oe]}return ce||++W!=te?ce:!!(te=g==null?0:g.length)&&Uf(te)&&Ra(Oe,te)&&(Jr(g)||Nc(g))}function tl(g){return typeof g.constructor!="function"||Qt(g)?{}:pc(is(g))}function Sf(g){return Jr(g)||Nc(g)||!!(Rs&&g&&g[Rs])}function Ra(g,x){var C=typeof g;return!!(x=x??T)&&(C=="number"||C!="symbol"&&Nn.test(g))&&g>-1&&g%1==0&&g<x}function Fi(g,x,C){if(!Ni(C))return!1;var W=typeof x;return!!(W=="number"?fl(C)&&Ra(x,C.length):W=="string"&&x in C)&&zl(C[x],g)}function Is(g,x){if(Jr(g))return!1;var C=typeof g;return!(C!="number"&&C!="symbol"&&C!="boolean"&&g!=null&&!Dt(g))||kt.test(g)||!Y.test(g)||x!=null&&g in L(x)}function Fs(g){var x=Cu(g),C=he[x];if(typeof C!="function"||!(x in go.prototype))return!1;if(g===C)return!0;var W=Gp(C);return!!W&&g===W[0]}(cd&&Ti(new cd(new ArrayBuffer(1)))!=Be||dd&&Ti(new dd)!=G||df&&Ti(df.resolve())!=ie||fc&&Ti(new fc)!=Ae||Ou&&Ti(new Ou)!=ze)&&(Ti=function(g){var x=Ei(g),C=x==J?g.constructor:l,W=C?Ru(C):"";if(W)switch(W){case fy:return Be;case pf:return G;case py:return ie;case hy:return Ae;case vm:return ze}return x});var Wp=Jn?Cl:ct;function Qt(g){var x=g&&g.constructor;return g===(typeof x=="function"&&x.prototype||_n)}function xc(g){return g==g&&!Ni(g)}function Af(g,x){return function(C){return C!=null&&C[g]===x&&(x!==l||g in L(C))}}function Mf(g,x,C){return x=ji(x===l?g.length-1:x,0),function(){for(var W=arguments,te=-1,ce=ji(W.length-x,0),Oe=Wn(ce);++te<ce;)Oe[te]=W[x+te];te=-1;for(var Fe=Wn(x+1);++te<x;)Fe[te]=W[te];return Fe[x]=C(Oe),qo(g,this,Fe)}}function Pu(g,x){return x.length<2?g:Ds(g,Tl(x,0,-1))}function Oc(g,x){for(var C=g.length,W=Ga(x.length,C),te=va(g);W--;){var ce=x[W];g[W]=Ra(ce,C)?te[ce]:l}return g}function zp(g,x){if((x!=="constructor"||typeof g[x]!="function")&&x!="__proto__")return g[x]}var uv=cv(yf),Sc=Gh||function(g,x){return vi.setTimeout(g,x)},Tf=cv(my);function Hp(g,x,C){var W=x+"";return Tf(g,(function(te,ce){var Oe=ce.length;if(!Oe)return te;var Fe=Oe-1;return ce[Fe]=(Oe>1?"& ":"")+ce[Fe],ce=ce.join(Oe>2?", ":" "),te.replace(ke,`{
|
||
/* [wrapped with `+ce+`] */
|
||
`)})(W,(function(te,ce){return Fa(P,(function(Oe){var Fe="_."+Oe[0];ce&Oe[1]&&!Za(te,Fe)&&te.push(Fe)})),te.sort()})((function(te){var ce=te.match(Ke);return ce?ce[1].split(Le):[]})(W),C)))}function cv(g){var x=0,C=0;return function(){var W=Ep(),te=16-(W-C);if(C=W,te>0){if(++x>=800)return arguments[0]}else x=0;return g.apply(l,arguments)}}function Bs(g,x){var C=-1,W=g.length,te=W-1;for(x=x===l?W:x;++C<x;){var ce=ev(C,te),Oe=g[ce];g[ce]=g[C],g[C]=Oe}return g.length=x,g}var dv=(function(g){var x=su(g,(function(W){return C.size===500&&C.clear(),W})),C=x.cache;return x})((function(g){var x=[];return g.charCodeAt(0)===46&&x.push(""),g.replace(Rt,(function(C,W,te,ce){x.push(te?ce.replace(Tt,"$1"):W||C)})),x}));function vs(g){if(typeof g=="string"||Dt(g))return g;var x=g+"";return x=="0"&&1/g==-1/0?"-0":x}function Ru(g){if(g!=null){try{return no.call(g)}catch{}try{return g+""}catch{}}return""}function Xp(g){if(g instanceof go)return g.clone();var x=new Ul(g.__wrapped__,g.__chain__);return x.__actions__=va(g.__actions__),x.__index__=g.__index__,x.__values__=g.__values__,x}var Cm=uo((function(g,x){return Oi(g)?cs(g,Ji(x,1,Oi,!0)):[]})),Nm=uo((function(g,x){var C=gi(x);return Oi(C)&&(C=l),Oi(g)?cs(g,Ji(x,1,Oi,!0),Rr(C,2)):[]})),km=uo((function(g,x){var C=gi(x);return Oi(C)&&(C=l),Oi(g)?cs(g,Ji(x,1,Oi,!0),l,C):[]}));function fv(g,x,C){var W=g==null?0:g.length;if(!W)return-1;var te=C==null?0:Mt(C);return te<0&&(te=ji(W+te,0)),$a(g,Rr(x,3),te)}function Yp(g,x,C){var W=g==null?0:g.length;if(!W)return-1;var te=W-1;return C!==l&&(te=Mt(C),te=C<0?ji(W+te,0):Ga(te,W-1)),$a(g,Rr(x,3),te,!0)}function Cf(g){return g!=null&&g.length?Ji(g,1):[]}function Pm(g){return g&&g.length?g[0]:l}var ms=uo((function(g){var x=Mo(g,jp);return x.length&&x[0]===g[0]?mf(x):[]})),Du=uo((function(g){var x=gi(g),C=Mo(g,jp);return x===gi(C)?x=l:C.pop(),C.length&&C[0]===g[0]?mf(C,Rr(x,2)):[]})),_y=uo((function(g){var x=gi(g),C=Mo(g,jp);return(x=typeof x=="function"?x:l)&&C.pop(),C.length&&C[0]===g[0]?mf(C,l,x):[]}));function gi(g){var x=g==null?0:g.length;return x?g[x-1]:l}var Nf=uo(Ac);function Ac(g,x){return g&&g.length&&x&&x.length?Np(g,x):g}var kf=Ls((function(g,x){var C=g==null?0:g.length,W=hf(g,x);return Qh(g,Mo(x,(function(te){return Ra(te,C)?+te:te})).sort(vd)),W}));function Ed(g){return g==null?g:dy.call(g)}var Pf=uo((function(g){return Tu(Ji(g,1,Oi,!0))})),Rf=uo((function(g){var x=gi(g);return Oi(x)&&(x=l),Tu(Ji(g,1,Oi,!0),Rr(x,2))})),Df=uo((function(g){var x=gi(g);return x=typeof x=="function"?x:l,Tu(Ji(g,1,Oi,!0),l,x)}));function Mc(g){if(!g||!g.length)return[];var x=0;return g=Ba(g,(function(C){if(Oi(C))return x=ji(C.length,x),!0})),Ks(x,(function(C){return Mo(g,Ua(C))}))}function au(g,x){if(!g||!g.length)return[];var C=Mc(g);return x==null?C:Mo(C,(function(W){return qo(x,l,W)}))}var ma=uo((function(g,x){return Oi(g)?cs(g,x):[]})),qp=uo((function(g){return Dp(Ba(g,Oi))})),jf=uo((function(g){var x=gi(g);return Oi(x)&&(x=l),Dp(Ba(g,Oi),Rr(x,2))})),Tc=uo((function(g){var x=gi(g);return x=typeof x=="function"?x:l,Dp(Ba(g,Oi),l,x)})),xd=uo(Mc),wa=uo((function(g){var x=g.length,C=x>1?g[x-1]:l;return C=typeof C=="function"?(g.pop(),C):l,au(g,C)}));function xi(g){var x=he(g);return x.__chain__=!0,x}function Lf(g,x){return x(g)}var za=Ls((function(g){var x=g.length,C=x?g[0]:0,W=this.__wrapped__,te=function(ce){return hf(ce,g)};return!(x>1||this.__actions__.length)&&W instanceof go&&Ra(C)?((W=W.slice(C,+C+(x?1:0))).__actions__.push({func:Lf,args:[te],thisArg:l}),new Ul(W,this.__chain__).thru((function(ce){return x&&!ce.length&&ce.push(l),ce}))):this.thru(te)})),wr=ou((function(g,x,C){$n.call(g,C)?++g[C]:us(g,C,1)})),Kp=Bp(fv),If=Bp(Yp);function Zp(g,x){return(Jr(g)?Fa:mi)(g,Rr(x,3))}function pv(g,x){return(Jr(g)?gp:ym)(g,Rr(x,3))}var Rm=ou((function(g,x,C){$n.call(g,C)?g[C].push(x):us(g,C,[x])})),ju=uo((function(g,x,C){var W=-1,te=typeof x=="function",ce=fl(g)?Wn(g.length):[];return mi(g,(function(Oe){ce[++W]=te?qo(x,Oe,C):Wa(Oe,x,C)})),ce})),Dm=ou((function(g,x,C){us(g,C,x)}));function Cc(g,x){return(Jr(g)?Mo:Ml)(g,Rr(x,3))}var jm=ou((function(g,x,C){g[C?0:1].push(x)}),(function(){return[[],[]]})),hv=uo((function(g,x){if(g==null)return[];var C=x.length;return C>1&&Fi(g,x[0],x[1])?x=[]:C>2&&Fi(x[0],x[1],x[2])&&(x=[x[0]]),wm(g,Ji(x,1),[])})),Ff=pm||function(){return vi.Date.now()};function Lm(g,x,C){return x=C?l:x,x=g&&x==null?g.length:x,ps(g,w,l,l,l,l,x)}function Wl(g,x){var C;if(typeof x!="function")throw new Re(f);return g=Mt(g),function(){return--g>0&&(C=x.apply(this,arguments)),g<=1&&(x=l),C}}var lu=uo((function(g,x,C){var W=1;if(C.length){var te=ll(C,Nu(lu));W|=E}return ps(g,W,x,C,te)})),Lu=uo((function(g,x,C){var W=3;if(C.length){var te=ll(C,Nu(Lu));W|=E}return ps(x,W,g,C,te)}));function Er(g,x,C){var W,te,ce,Oe,Fe,et,jt=0,Vt=!1,gn=!1,Yn=!0;if(typeof g!="function")throw new Re(f);function Qn(at){var Yr=W,Ao=te;return W=te=l,jt=at,Oe=g.apply(Ao,Yr)}function Sr(at){return jt=at,Fe=Sc(Tn,x),Vt?Qn(at):Oe}function an(at){var Yr=at-et;return et===l||Yr>=x||Yr<0||gn&&at-jt>=ce}function Tn(){var at=Ff();if(an(at))return Br(at);Fe=Sc(Tn,(function(Yr){var Ao=x-(Yr-et);return gn?Ga(Ao,ce-(Yr-jt)):Ao})(at))}function Br(at){return Fe=l,Yn&&W?Qn(at):(W=te=l,Oe)}function ir(){var at=Ff(),Yr=an(at);if(W=arguments,te=this,et=at,Yr){if(Fe===l)return Sr(et);if(gn)return Ip(Fe),Fe=Sc(Tn,x),Qn(et)}return Fe===l&&(Fe=Sc(Tn,x)),Oe}return x=pn(x)||0,Ni(C)&&(Vt=!!C.leading,ce=(gn="maxWait"in C)?ji(pn(C.maxWait)||0,x):ce,Yn="trailing"in C?!!C.trailing:Yn),ir.cancel=function(){Fe!==l&&Ip(Fe),jt=0,W=et=te=Fe=l},ir.flush=function(){return Fe===l?Oe:Br(Ff())},ir}var vv=uo((function(g,x){return Xh(g,1,x)})),Od=uo((function(g,x,C){return Xh(g,pn(x)||0,C)}));function su(g,x){if(typeof g!="function"||x!=null&&typeof x!="function")throw new Re(f);var C=function(){var W=arguments,te=x?x.apply(this,W):W[0],ce=C.cache;if(ce.has(te))return ce.get(te);var Oe=g.apply(this,W);return C.cache=ce.set(te,Oe)||ce,Oe};return C.cache=new(su.Cache||ss),C}function Bf(g){if(typeof g!="function")throw new Re(f);return function(){var x=arguments;switch(x.length){case 0:return!g.call(this);case 1:return!g.call(this,x[0]);case 2:return!g.call(this,x[0],x[1]);case 3:return!g.call(this,x[0],x[1],x[2])}return!g.apply(this,x)}}su.Cache=ss;var Ha=yy((function(g,x){var C=(x=x.length==1&&Jr(x[0])?Mo(x[0],ui(Rr())):Mo(Ji(x,1),ui(Rr()))).length;return uo((function(W){for(var te=-1,ce=Ga(W.length,C);++te<ce;)W[te]=x[te].call(this,W[te]);return qo(g,this,W)}))})),gs=uo((function(g,x){var C=ll(x,Nu(gs));return ps(g,E,l,x,C)})),Ci=uo((function(g,x){var C=ll(x,Nu(Ci));return ps(g,O,l,x,C)})),dl=Ls((function(g,x){return ps(g,S,l,l,l,x)}));function zl(g,x){return g===x||g!=g&&x!=x}var by=_d(Mi),$f=_d((function(g,x){return g>=x})),Nc=Tp((function(){return arguments})())?Tp:function(g){return Bi(g)&&$n.call(g,"callee")&&!Zi.call(g,"callee")},Jr=Wn.isArray,Im=La?ui(La):function(g){return Bi(g)&&Ei(g)==Ye};function fl(g){return g!=null&&Uf(g.length)&&!Cl(g)}function Oi(g){return Bi(g)&&fl(g)}var nl=hm||ct,mv=id?ui(id):function(g){return Bi(g)&&Ei(g)==V};function Ea(g){if(!Bi(g))return!1;var x=Ei(g);return x==z||x=="[object DOMException]"||typeof g.message=="string"&&typeof g.name=="string"&&!K(g)}function Cl(g){if(!Ni(g))return!1;var x=Ei(g);return x==q||x==X||x=="[object AsyncFunction]"||x=="[object Proxy]"}function kc(g){return typeof g=="number"&&g==Mt(g)}function Uf(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=T}function Ni(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Bi(g){return g!=null&&typeof g=="object"}var Jp=_u?ui(_u):function(g){return Bi(g)&&Ti(g)==G};function gv(g){return typeof g=="number"||Bi(g)&&Ei(g)==Q}function K(g){if(!Bi(g)||Ei(g)!=J)return!1;var x=is(g);if(x===null)return!0;var C=$n.call(x,"constructor")&&x.constructor;return typeof C=="function"&&C instanceof C&&no.call(C)==ul}var me=Ia?ui(Ia):function(g){return Bi(g)&&Ei(g)==Se},Ie=ra?ui(ra):function(g){return Bi(g)&&Ti(g)==Ae};function wt(g){return typeof g=="string"||!Jr(g)&&Bi(g)&&Ei(g)==Pe}function Dt(g){return typeof g=="symbol"||Bi(g)&&Ei(g)==De}var yt=wl?ui(wl):function(g){return Bi(g)&&Uf(g.length)&&!!Cn[Ei(g)]},Nt=_d(js),tn=_d((function(g,x){return g<=x}));function sn(g){if(!g)return[];if(fl(g))return wt(g)?Qa(g):va(g);if(as&&g[as])return(function(C){for(var W,te=[];!(W=C.next()).done;)te.push(W.value);return te})(g[as]());var x=Ti(g);return(x==G?Ki:x==Ae?Ol:Qr)(g)}function nn(g){return g?(g=pn(g))===M||g===-1/0?17976931348623157e292*(g<0?-1:1):g==g?g:0:g===0?g:0}function Mt(g){var x=nn(g),C=x%1;return x==x?C?x-C:x:0}function bn(g){return g?Au(Mt(g),0,D):0}function pn(g){if(typeof g=="number")return g;if(Dt(g))return $;if(Ni(g)){var x=typeof g.valueOf=="function"?g.valueOf():g;g=Ni(x)?x+"":x}if(typeof g!="string")return g===0?g:+g;g=$l(g);var C=Lo.test(g);return C||ho.test(g)?lr(g.slice(2),C?2:8):ao.test(g)?$:+g}function rn(g){return ds(g,Zt(g))}function Gt(g){return g==null?"":cl(g)}var st=yc((function(g,x){if(Qt(x)||fl(x))ds(x,on(x),g);else for(var C in x)$n.call(x,C)&&Li(g,C,x[C])})),St=yc((function(g,x){ds(x,Zt(x),g)})),ln=yc((function(g,x,C,W){ds(x,Zt(x),g,W)})),Sn=yc((function(g,x,C,W){ds(x,on(x),g,W)})),Xt=Ls(hf),kn=uo((function(g,x){g=L(g);var C=-1,W=x.length,te=W>2?x[2]:l;for(te&&Fi(x[0],x[1],te)&&(W=1);++C<W;)for(var ce=x[C],Oe=Zt(ce),Fe=-1,et=Oe.length;++Fe<et;){var jt=Oe[Fe],Vt=g[jt];(Vt===l||zl(Vt,_n[jt])&&!$n.call(g,jt))&&(g[jt]=ce[jt])}return g})),Kt=uo((function(g){return g.push(l,lv),qo(fr,l,g)}));function yn(g,x,C){var W=g==null?l:Ds(g,x);return W===l?C:W}function Yt(g,x){return g!=null&&ku(g,x,Kh)}var En=Ef((function(g,x,C){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),g[x]=C}),co(Nr)),ar=Ef((function(g,x,C){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),$n.call(g,x)?g[x].push(C):g[x]=[C]}),Rr),xr=uo(Wa);function on(g){return fl(g)?Sp(g):Gl(g)}function Zt(g){return fl(g)?Sp(g,!0):_m(g)}var Ht=yc((function(g,x,C){Cp(g,x,C)})),fr=yc((function(g,x,C,W){Cp(g,x,C,W)})),Dr=Ls((function(g,x){var C={};if(g==null)return C;var W=!1;x=Mo(x,(function(ce){return ce=jo(ce,g),W||(W=ce.length>1),ce})),ds(g,Vp(g),C),W&&(C=Al(C,7,sv));for(var te=x.length;te--;)Pp(C,x[te]);return C})),Un=Ls((function(g,x){return g==null?{}:(function(C,W){return Em(C,W,(function(te,ce){return Yt(C,ce)}))})(g,x)}));function $r(g,x){if(g==null)return{};var C=Mo(Vp(g),(function(W){return[W]}));return x=Rr(x),Em(g,C,(function(W,te){return x(W,te[0])}))}var Or=iv(on),Fr=iv(Zt);function Qr(g){return g==null?[]:lc(g,on(g))}var ki=iu((function(g,x,C){return x=x.toLowerCase(),g+(C?Si(x):x)}));function Si(g){return zi(Gt(g).toLowerCase())}function jr(g){return(g=Gt(g))&&g.replace(qn,lf).replace(br,"")}var Wi=iu((function(g,x,C){return g+(C?"-":"")+x.toLowerCase()})),Ko=iu((function(g,x,C){return g+(C?" ":"")+x.toLowerCase()})),Pi=Fp("toLowerCase"),$i=iu((function(g,x,C){return g+(C?"_":"")+x.toLowerCase()})),Qi=iu((function(g,x,C){return g+(C?" ":"")+zi(x)})),la=iu((function(g,x,C){return g+(C?" ":"")+x.toUpperCase()})),zi=Fp("toUpperCase");function di(g,x,C){return g=Gt(g),(x=C?l:x)===l?(function(W){return ht.test(W)})(g)?(function(W){return W.match(si)||[]})(g):(function(W){return W.match(dt)||[]})(g):g.match(x)||[]}var Cr=uo((function(g,x){try{return qo(g,l,x)}catch(C){return Ea(C)?C:new mo(C)}})),sa=Ls((function(g,x){return Fa(x,(function(C){C=vs(C),us(g,C,lu(g[C],g))})),g}));function co(g){return function(){return g}}var cr=fs(),Xr=fs(!0);function Nr(g){return g}function fi(g){return ru(typeof g=="function"?g:Al(g,1))}var $s=uo((function(g,x){return function(C){return Wa(C,g,x)}})),yi=uo((function(g,x){return function(C){return Wa(g,C,x)}}));function Te(g,x,C){var W=on(x),te=vf(x,W);C!=null||Ni(x)&&(te.length||!W.length)||(C=x,x=g,g=this,te=vf(x,on(x)));var ce=!(Ni(C)&&"chain"in C&&!C.chain),Oe=Cl(g);return Fa(te,(function(Fe){var et=x[Fe];g[Fe]=et,Oe&&(g.prototype[Fe]=function(){var jt=this.__chain__;if(ce||jt){var Vt=g(this.__wrapped__),gn=Vt.__actions__=va(this.__actions__);return gn.push({func:et,args:arguments,thisArg:g}),Vt.__chain__=jt,Vt}return et.apply(g,oa([this.value()],arguments))})})),g}function Et(){}var _t=gd(Mo),Ln=gd(yp),Wr=gd(of);function xe(g){return Is(g)?Ua(vs(g)):(function(x){return function(C){return Ds(C,x)}})(g)}var de=$p(),Ge=$p(!0);function tt(){return[]}function ct(){return!1}var Xe=md((function(g,x){return g+x}),0),We=Up("ceil"),Qe=md((function(g,x){return g/x}),1),Ee=Up("floor"),Ue,be=md((function(g,x){return g*x}),1),nt=Up("round"),ot=md((function(g,x){return g-x}),0);return he.after=function(g,x){if(typeof x!="function")throw new Re(f);return g=Mt(g),function(){if(--g<1)return x.apply(this,arguments)}},he.ary=Lm,he.assign=st,he.assignIn=St,he.assignInWith=ln,he.assignWith=Sn,he.at=Xt,he.before=Wl,he.bind=lu,he.bindAll=sa,he.bindKey=Lu,he.castArray=function(){if(!arguments.length)return[];var g=arguments[0];return Jr(g)?g:[g]},he.chain=xi,he.chunk=function(g,x,C){x=(C?Fi(g,x,C):x===l)?1:ji(Mt(x),0);var W=g==null?0:g.length;if(!W||x<1)return[];for(var te=0,ce=0,Oe=Wn(uf(W/x));te<W;)Oe[ce++]=Tl(g,te,te+=x);return Oe},he.compact=function(g){for(var x=-1,C=g==null?0:g.length,W=0,te=[];++x<C;){var ce=g[x];ce&&(te[W++]=ce)}return te},he.concat=function(){var g=arguments.length;if(!g)return[];for(var x=Wn(g-1),C=arguments[0],W=g;W--;)x[W-1]=arguments[W];return oa(Jr(C)?va(C):[C],Ji(x,1))},he.cond=function(g){var x=g==null?0:g.length,C=Rr();return g=x?Mo(g,(function(W){if(typeof W[1]!="function")throw new Re(f);return[C(W[0]),W[1]]})):[],uo((function(W){for(var te=-1;++te<x;){var ce=g[te];if(qo(ce[0],this,W))return qo(ce[1],this,W)}}))},he.conforms=function(g){return(function(x){var C=on(x);return function(W){return Hh(W,x,C)}})(Al(g,1))},he.constant=co,he.countBy=wr,he.create=function(g,x){var C=pc(g);return x==null?C:nu(C,x)},he.curry=function g(x,C,W){var te=ps(x,8,l,l,l,l,l,C=W?l:C);return te.placeholder=g.placeholder,te},he.curryRight=function g(x,C,W){var te=ps(x,b,l,l,l,l,l,C=W?l:C);return te.placeholder=g.placeholder,te},he.debounce=Er,he.defaults=kn,he.defaultsDeep=Kt,he.defer=vv,he.delay=Od,he.difference=Cm,he.differenceBy=Nm,he.differenceWith=km,he.drop=function(g,x,C){var W=g==null?0:g.length;return W?Tl(g,(x=C||x===l?1:Mt(x))<0?0:x,W):[]},he.dropRight=function(g,x,C){var W=g==null?0:g.length;return W?Tl(g,0,(x=W-(x=C||x===l?1:Mt(x)))<0?0:x):[]},he.dropRightWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!0,!0):[]},he.dropWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!0):[]},he.fill=function(g,x,C,W){var te=g==null?0:g.length;return te?(C&&typeof C!="number"&&Fi(g,x,C)&&(C=0,W=te),(function(ce,Oe,Fe,et){var jt=ce.length;for((Fe=Mt(Fe))<0&&(Fe=-Fe>jt?0:jt+Fe),(et=et===l||et>jt?jt:Mt(et))<0&&(et+=jt),et=Fe>et?0:bn(et);Fe<et;)ce[Fe++]=Oe;return ce})(g,x,C,W)):[]},he.filter=function(g,x){return(Jr(g)?Ba:Io)(g,Rr(x,3))},he.flatMap=function(g,x){return Ji(Cc(g,x),1)},he.flatMapDeep=function(g,x){return Ji(Cc(g,x),M)},he.flatMapDepth=function(g,x,C){return C=C===l?1:Mt(C),Ji(Cc(g,x),C)},he.flatten=Cf,he.flattenDeep=function(g){return g!=null&&g.length?Ji(g,M):[]},he.flattenDepth=function(g,x){return g!=null&&g.length?Ji(g,x=x===l?1:Mt(x)):[]},he.flip=function(g){return ps(g,512)},he.flow=cr,he.flowRight=Xr,he.fromPairs=function(g){for(var x=-1,C=g==null?0:g.length,W={};++x<C;){var te=g[x];W[te[0]]=te[1]}return W},he.functions=function(g){return g==null?[]:vf(g,on(g))},he.functionsIn=function(g){return g==null?[]:vf(g,Zt(g))},he.groupBy=Rm,he.initial=function(g){return g!=null&&g.length?Tl(g,0,-1):[]},he.intersection=ms,he.intersectionBy=Du,he.intersectionWith=_y,he.invert=En,he.invertBy=ar,he.invokeMap=ju,he.iteratee=fi,he.keyBy=Dm,he.keys=on,he.keysIn=Zt,he.map=Cc,he.mapKeys=function(g,x){var C={};return x=Rr(x,3),ur(g,(function(W,te,ce){us(C,x(W,te,ce),W)})),C},he.mapValues=function(g,x){var C={};return x=Rr(x,3),ur(g,(function(W,te,ce){us(C,te,x(W,te,ce))})),C},he.matches=function(g){return Zh(Al(g,1))},he.matchesProperty=function(g,x){return Jh(g,Al(x,1))},he.memoize=su,he.merge=Ht,he.mergeWith=fr,he.method=$s,he.methodOf=yi,he.mixin=Te,he.negate=Bf,he.nthArg=function(g){return g=Mt(g),uo((function(x){return bm(x,g)}))},he.omit=Dr,he.omitBy=function(g,x){return $r(g,Bf(Rr(x)))},he.once=function(g){return Wl(2,g)},he.orderBy=function(g,x,C,W){return g==null?[]:(Jr(x)||(x=x==null?[]:[x]),Jr(C=W?l:C)||(C=C==null?[]:[C]),wm(g,x,C))},he.over=_t,he.overArgs=Ha,he.overEvery=Ln,he.overSome=Wr,he.partial=gs,he.partialRight=Ci,he.partition=jm,he.pick=Un,he.pickBy=$r,he.property=xe,he.propertyOf=function(g){return function(x){return g==null?l:Ds(g,x)}},he.pull=Nf,he.pullAll=Ac,he.pullAllBy=function(g,x,C){return g&&g.length&&x&&x.length?Np(g,x,Rr(C,2)):g},he.pullAllWith=function(g,x,C){return g&&g.length&&x&&x.length?Np(g,x,l,C):g},he.pullAt=kf,he.range=de,he.rangeRight=Ge,he.rearg=dl,he.reject=function(g,x){return(Jr(g)?Ba:Io)(g,Bf(Rr(x,3)))},he.remove=function(g,x){var C=[];if(!g||!g.length)return C;var W=-1,te=[],ce=g.length;for(x=Rr(x,3);++W<ce;){var Oe=g[W];x(Oe,W,g)&&(C.push(Oe),te.push(W))}return Qh(g,te),C},he.rest=function(g,x){if(typeof g!="function")throw new Re(f);return uo(g,x=x===l?x:Mt(x))},he.reverse=Ed,he.sampleSize=function(g,x,C){return x=(C?Fi(g,x,C):x===l)?1:Mt(x),(Jr(g)?Wh:tv)(g,x)},he.set=function(g,x,C){return g==null?g:hc(g,x,C)},he.setWith=function(g,x,C,W){return W=typeof W=="function"?W:l,g==null?g:hc(g,x,C,W)},he.shuffle=function(g){return(Jr(g)?gm:xm)(g)},he.slice=function(g,x,C){var W=g==null?0:g.length;return W?(C&&typeof C!="number"&&Fi(g,x,C)?(x=0,C=W):(x=x==null?0:Mt(x),C=C===l?W:Mt(C)),Tl(g,x,C)):[]},he.sortBy=hv,he.sortedUniq=function(g){return g&&g.length?nv(g):[]},he.sortedUniqBy=function(g,x){return g&&g.length?nv(g,Rr(x,2)):[]},he.split=function(g,x,C){return C&&typeof C!="number"&&Fi(g,x,C)&&(x=C=l),(C=C===l?D:C>>>0)?(g=Gt(g))&&(typeof x=="string"||x!=null&&!me(x))&&!(x=cl(x))&&os(g)?Uo(Qa(g),0,C):g.split(x,C):[]},he.spread=function(g,x){if(typeof g!="function")throw new Re(f);return x=x==null?0:ji(Mt(x),0),uo((function(C){var W=C[x],te=Uo(C,0,x);return W&&oa(te,W),qo(g,this,te)}))},he.tail=function(g){var x=g==null?0:g.length;return x?Tl(g,1,x):[]},he.take=function(g,x,C){return g&&g.length?Tl(g,0,(x=C||x===l?1:Mt(x))<0?0:x):[]},he.takeRight=function(g,x,C){var W=g==null?0:g.length;return W?Tl(g,(x=W-(x=C||x===l?1:Mt(x)))<0?0:x,W):[]},he.takeRightWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!1,!0):[]},he.takeWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3)):[]},he.tap=function(g,x){return x(g),g},he.throttle=function(g,x,C){var W=!0,te=!0;if(typeof g!="function")throw new Re(f);return Ni(C)&&(W="leading"in C?!!C.leading:W,te="trailing"in C?!!C.trailing:te),Er(g,x,{leading:W,maxWait:x,trailing:te})},he.thru=Lf,he.toArray=sn,he.toPairs=Or,he.toPairsIn=Fr,he.toPath=function(g){return Jr(g)?Mo(g,vs):Dt(g)?[g]:va(dv(Gt(g)))},he.toPlainObject=rn,he.transform=function(g,x,C){var W=Jr(g),te=W||nl(g)||yt(g);if(x=Rr(x,4),C==null){var ce=g&&g.constructor;C=te?W?new ce:[]:Ni(g)&&Cl(ce)?pc(is(g)):{}}return(te?Fa:ur)(g,(function(Oe,Fe,et){return x(C,Oe,Fe,et)})),C},he.unary=function(g){return Lm(g,1)},he.union=Pf,he.unionBy=Rf,he.unionWith=Df,he.uniq=function(g){return g&&g.length?Tu(g):[]},he.uniqBy=function(g,x){return g&&g.length?Tu(g,Rr(x,2)):[]},he.uniqWith=function(g,x){return x=typeof x=="function"?x:l,g&&g.length?Tu(g,l,x):[]},he.unset=function(g,x){return g==null||Pp(g,x)},he.unzip=Mc,he.unzipWith=au,he.update=function(g,x,C){return g==null?g:vc(g,x,Lp(C))},he.updateWith=function(g,x,C,W){return W=typeof W=="function"?W:l,g==null?g:vc(g,x,Lp(C),W)},he.values=Qr,he.valuesIn=function(g){return g==null?[]:lc(g,Zt(g))},he.without=ma,he.words=di,he.wrap=function(g,x){return gs(Lp(x),g)},he.xor=qp,he.xorBy=jf,he.xorWith=Tc,he.zip=xd,he.zipObject=function(g,x){return bf(g||[],x||[],Li)},he.zipObjectDeep=function(g,x){return bf(g||[],x||[],hc)},he.zipWith=wa,he.entries=Or,he.entriesIn=Fr,he.extend=St,he.extendWith=ln,Te(he,he),he.add=Xe,he.attempt=Cr,he.camelCase=ki,he.capitalize=Si,he.ceil=We,he.clamp=function(g,x,C){return C===l&&(C=x,x=l),C!==l&&(C=(C=pn(C))==C?C:0),x!==l&&(x=(x=pn(x))==x?x:0),Au(pn(g),x,C)},he.clone=function(g){return Al(g,4)},he.cloneDeep=function(g){return Al(g,5)},he.cloneDeepWith=function(g,x){return Al(g,5,x=typeof x=="function"?x:l)},he.cloneWith=function(g,x){return Al(g,4,x=typeof x=="function"?x:l)},he.conformsTo=function(g,x){return x==null||Hh(g,x,on(x))},he.deburr=jr,he.defaultTo=function(g,x){return g==null||g!=g?x:g},he.divide=Qe,he.endsWith=function(g,x,C){g=Gt(g),x=cl(x);var W=g.length,te=C=C===l?W:Au(Mt(C),0,W);return(C-=x.length)>=0&&g.slice(C,te)==x},he.eq=zl,he.escape=function(g){return(g=Gt(g))&&ae.test(g)?g.replace(zt,Gi):g},he.escapeRegExp=function(g){return(g=Gt(g))&&Pn.test(g)?g.replace(Wt,"\\$&"):g},he.every=function(g,x,C){var W=Jr(g)?yp:Yh;return C&&Fi(g,x,C)&&(x=l),W(g,Rr(x,3))},he.find=Kp,he.findIndex=fv,he.findKey=function(g,x){return ns(g,Rr(x,3),ur)},he.findLast=If,he.findLastIndex=Yp,he.findLastKey=function(g,x){return ns(g,Rr(x,3),ti)},he.floor=Ee,he.forEach=Zp,he.forEachRight=pv,he.forIn=function(g,x){return g==null?g:lo(g,Rr(x,3),Zt)},he.forInRight=function(g,x){return g==null?g:ei(g,Rr(x,3),Zt)},he.forOwn=function(g,x){return g&&ur(g,Rr(x,3))},he.forOwnRight=function(g,x){return g&&ti(g,Rr(x,3))},he.get=yn,he.gt=by,he.gte=$f,he.has=function(g,x){return g!=null&&ku(g,x,qh)},he.hasIn=Yt,he.head=Pm,he.identity=Nr,he.includes=function(g,x,C,W){g=fl(g)?g:Qr(g),C=C&&!W?Mt(C):0;var te=g.length;return C<0&&(C=ji(te+C,0)),wt(g)?C<=te&&g.indexOf(x,C)>-1:!!te&&bu(g,x,C)>-1},he.indexOf=function(g,x,C){var W=g==null?0:g.length;if(!W)return-1;var te=C==null?0:Mt(C);return te<0&&(te=ji(W+te,0)),bu(g,x,te)},he.inRange=function(g,x,C){return x=nn(x),C===l?(C=x,x=0):C=nn(C),(function(W,te,ce){return W>=Ga(te,ce)&&W<ji(te,ce)})(g=pn(g),x,C)},he.invoke=xr,he.isArguments=Nc,he.isArray=Jr,he.isArrayBuffer=Im,he.isArrayLike=fl,he.isArrayLikeObject=Oi,he.isBoolean=function(g){return g===!0||g===!1||Bi(g)&&Ei(g)==I},he.isBuffer=nl,he.isDate=mv,he.isElement=function(g){return Bi(g)&&g.nodeType===1&&!K(g)},he.isEmpty=function(g){if(g==null)return!0;if(fl(g)&&(Jr(g)||typeof g=="string"||typeof g.splice=="function"||nl(g)||yt(g)||Nc(g)))return!g.length;var x=Ti(g);if(x==G||x==Ae)return!g.size;if(Qt(g))return!Gl(g).length;for(var C in g)if($n.call(g,C))return!1;return!0},he.isEqual=function(g,x){return hd(g,x)},he.isEqualWith=function(g,x,C){var W=(C=typeof C=="function"?C:l)?C(g,x):l;return W===l?hd(g,x,l,C):!!W},he.isError=Ea,he.isFinite=function(g){return typeof g=="number"&&dc(g)},he.isFunction=Cl,he.isInteger=kc,he.isLength=Uf,he.isMap=Jp,he.isMatch=function(g,x){return g===x||Vl(g,x,Of(x))},he.isMatchWith=function(g,x,C){return C=typeof C=="function"?C:l,Vl(g,x,Of(x),C)},he.isNaN=function(g){return gv(g)&&g!=+g},he.isNative=function(g){if(Wp(g))throw new mo("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mu(g)},he.isNil=function(g){return g==null},he.isNull=function(g){return g===null},he.isNumber=gv,he.isObject=Ni,he.isObjectLike=Bi,he.isPlainObject=K,he.isRegExp=me,he.isSafeInteger=function(g){return kc(g)&&g>=-9007199254740991&&g<=T},he.isSet=Ie,he.isString=wt,he.isSymbol=Dt,he.isTypedArray=yt,he.isUndefined=function(g){return g===l},he.isWeakMap=function(g){return Bi(g)&&Ti(g)==ze},he.isWeakSet=function(g){return Bi(g)&&Ei(g)=="[object WeakSet]"},he.join=function(g,x){return g==null?"":cf.call(g,x)},he.kebabCase=Wi,he.last=gi,he.lastIndexOf=function(g,x,C){var W=g==null?0:g.length;if(!W)return-1;var te=W;return C!==l&&(te=(te=Mt(C))<0?ji(W+te,0):Ga(te,W-1)),x==x?(function(ce,Oe,Fe){for(var et=Fe+1;et--;)if(ce[et]===Oe)return et;return et})(g,x,te):$a(g,El,te,!0)},he.lowerCase=Ko,he.lowerFirst=Pi,he.lt=Nt,he.lte=tn,he.max=function(g){return g&&g.length?Ii(g,Nr,Mi):l},he.maxBy=function(g,x){return g&&g.length?Ii(g,Rr(x,2),Mi):l},he.mean=function(g){return vo(g,Nr)},he.meanBy=function(g,x){return vo(g,Rr(x,2))},he.min=function(g){return g&&g.length?Ii(g,Nr,js):l},he.minBy=function(g,x){return g&&g.length?Ii(g,Rr(x,2),js):l},he.stubArray=tt,he.stubFalse=ct,he.stubObject=function(){return{}},he.stubString=function(){return""},he.stubTrue=function(){return!0},he.multiply=be,he.nth=function(g,x){return g&&g.length?bm(g,Mt(x)):l},he.noConflict=function(){return vi._===this&&(vi._=wi),this},he.noop=Et,he.now=Ff,he.pad=function(g,x,C){g=Gt(g);var W=(x=Mt(x))?Va(g):0;if(!x||W>=x)return g;var te=(x-W)/2;return yd(cc(te),C)+g+yd(uf(te),C)},he.padEnd=function(g,x,C){g=Gt(g);var W=(x=Mt(x))?Va(g):0;return x&&W<x?g+yd(x-W,C):g},he.padStart=function(g,x,C){g=Gt(g);var W=(x=Mt(x))?Va(g):0;return x&&W<x?yd(x-W,C)+g:g},he.parseInt=function(g,x,C){return C||x==null?x=0:x&&(x=+x),xp(Gt(g).replace(qt,""),x||0)},he.random=function(g,x,C){if(C&&typeof C!="boolean"&&Fi(g,x,C)&&(x=C=l),C===l&&(typeof x=="boolean"?(C=x,x=l):typeof g=="boolean"&&(C=g,g=l)),g===l&&x===l?(g=0,x=1):(g=nn(g),x===l?(x=g,g=0):x=nn(x)),g>x){var W=g;g=x,x=W}if(C||g%1||x%1){var te=ud();return Ga(g+te*(x-g+or("1e-"+((te+"").length-1))),x)}return ev(g,x)},he.reduce=function(g,x,C){var W=Jr(g)?ad:ha,te=arguments.length<3;return W(g,Rr(x,4),C,te,mi)},he.reduceRight=function(g,x,C){var W=Jr(g)?_p:ha,te=arguments.length<3;return W(g,Rr(x,4),C,te,ym)},he.repeat=function(g,x,C){return x=(C?Fi(g,x,C):x===l)?1:Mt(x),gf(Gt(g),x)},he.replace=function(){var g=arguments,x=Gt(g[0]);return g.length<3?x:x.replace(g[1],g[2])},he.result=function(g,x,C){var W=-1,te=(x=jo(x,g)).length;for(te||(te=1,g=l);++W<te;){var ce=g==null?l:g[vs(x[W])];ce===l&&(W=te,ce=C),g=Cl(ce)?ce.call(g):ce}return g},he.round=nt,he.runInContext=Ct,he.sample=function(g){return(Jr(g)?Ap:vy)(g)},he.size=function(g){if(g==null)return 0;if(fl(g))return wt(g)?Va(g):g.length;var x=Ti(g);return x==G||x==Ae?g.size:Gl(g).length},he.snakeCase=$i,he.some=function(g,x,C){var W=Jr(g)?of:gy;return C&&Fi(g,x,C)&&(x=l),W(g,Rr(x,3))},he.sortedIndex=function(g,x){return _f(g,x)},he.sortedIndexBy=function(g,x,C){return kp(g,x,Rr(C,2))},he.sortedIndexOf=function(g,x){var C=g==null?0:g.length;if(C){var W=_f(g,x);if(W<C&&zl(g[W],x))return W}return-1},he.sortedLastIndex=function(g,x){return _f(g,x,!0)},he.sortedLastIndexBy=function(g,x,C){return kp(g,x,Rr(C,2),!0)},he.sortedLastIndexOf=function(g,x){if(g!=null&&g.length){var C=_f(g,x,!0)-1;if(zl(g[C],x))return C}return-1},he.startCase=Qi,he.startsWith=function(g,x,C){return g=Gt(g),C=C==null?0:Au(Mt(C),0,g.length),x=cl(x),g.slice(C,C+x.length)==x},he.subtract=ot,he.sum=function(g){return g&&g.length?wu(g,Nr):0},he.sumBy=function(g,x){return g&&g.length?wu(g,Rr(x,2)):0},he.template=function(g,x,C){var W=he.templateSettings;C&&Fi(g,x,C)&&(x=l),g=Gt(g),x=ln({},x,W,av);var te,ce,Oe=ln({},x.imports,W.imports,av),Fe=on(Oe),et=lc(Oe,Fe),jt=0,Vt=x.interpolate||rr,gn="__p += '",Yn=Z((x.escape||rr).source+"|"+Vt.source+"|"+(Vt===vt?wn:rr).source+"|"+(x.evaluate||rr).source+"|$","g"),Qn="//# sourceURL="+($n.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rn+"]")+`
|
||
`;g.replace(Yn,(function(Tn,Br,ir,at,Yr,Ao){return ir||(ir=at),gn+=g.slice(jt,Ao).replace(ut,sc),Br&&(te=!0,gn+=`' +
|
||
__e(`+Br+`) +
|
||
'`),Yr&&(ce=!0,gn+=`';
|
||
`+Yr+`;
|
||
__p += '`),ir&&(gn+=`' +
|
||
((__t = (`+ir+`)) == null ? '' : __t) +
|
||
'`),jt=Ao+Tn.length,Tn})),gn+=`';
|
||
`;var Sr=$n.call(x,"variable")&&x.variable;if(Sr){if(At.test(Sr))throw new mo("Invalid `variable` option passed into `_.template`")}else gn=`with (obj) {
|
||
`+gn+`
|
||
}
|
||
`;gn=(ce?gn.replace(pt,""):gn).replace(Lt,"$1").replace(Jt,"$1;"),gn="function("+(Sr||"obj")+`) {
|
||
`+(Sr?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+gn+`return __p
|
||
}`;var an=Cr((function(){return ci(Fe,Qn+"return "+gn).apply(l,et)}));if(an.source=gn,Ea(an))throw an;return an},he.times=function(g,x){if((g=Mt(g))<1||g>T)return[];var C=D,W=Ga(g,D);x=Rr(x),g-=D;for(var te=Ks(W,x);++C<g;)x(C);return te},he.toFinite=nn,he.toInteger=Mt,he.toLength=bn,he.toLower=function(g){return Gt(g).toLowerCase()},he.toNumber=pn,he.toSafeInteger=function(g){return g?Au(Mt(g),-9007199254740991,T):g===0?g:0},he.toString=Gt,he.toUpper=function(g){return Gt(g).toUpperCase()},he.trim=function(g,x,C){if((g=Gt(g))&&(C||x===l))return $l(g);if(!g||!(x=cl(x)))return g;var W=Qa(g),te=Qa(x);return Uo(W,xl(W,te),af(W,te)+1).join("")},he.trimEnd=function(g,x,C){if((g=Gt(g))&&(C||x===l))return g.slice(0,ia(g)+1);if(!g||!(x=cl(x)))return g;var W=Qa(g);return Uo(W,0,af(W,Qa(x))+1).join("")},he.trimStart=function(g,x,C){if((g=Gt(g))&&(C||x===l))return g.replace(qt,"");if(!g||!(x=cl(x)))return g;var W=Qa(g);return Uo(W,xl(W,Qa(x))).join("")},he.truncate=function(g,x){var C=30,W="...";if(Ni(x)){var te="separator"in x?x.separator:te;C="length"in x?Mt(x.length):C,W="omission"in x?cl(x.omission):W}var ce=(g=Gt(g)).length;if(os(g)){var Oe=Qa(g);ce=Oe.length}if(C>=ce)return g;var Fe=C-Va(W);if(Fe<1)return W;var et=Oe?Uo(Oe,0,Fe).join(""):g.slice(0,Fe);if(te===l)return et+W;if(Oe&&(Fe+=et.length-Fe),me(te)){if(g.slice(Fe).search(te)){var jt,Vt=et;for(te.global||(te=Z(te.source,Gt(Zn.exec(te))+"g")),te.lastIndex=0;jt=te.exec(Vt);)var gn=jt.index;et=et.slice(0,gn===l?Fe:gn)}}else if(g.indexOf(cl(te),Fe)!=Fe){var Yn=et.lastIndexOf(te);Yn>-1&&(et=et.slice(0,Yn))}return et+W},he.unescape=function(g){return(g=Gt(g))&&it.test(g)?g.replace(en,sl):g},he.uniqueId=function(g){var x=++Do;return Gt(g)+x},he.upperCase=la,he.upperFirst=zi,he.each=Zp,he.eachRight=pv,he.first=Pm,Te(he,(Ue={},ur(he,(function(g,x){$n.call(he.prototype,x)||(Ue[x]=g)})),Ue),{chain:!1}),he.VERSION="4.17.21",Fa(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(g){he[g].placeholder=he})),Fa(["drop","take"],(function(g,x){go.prototype[g]=function(C){C=C===l?1:ji(Mt(C),0);var W=this.__filtered__&&!x?new go(this):this.clone();return W.__filtered__?W.__takeCount__=Ga(C,W.__takeCount__):W.__views__.push({size:Ga(C,D),type:g+(W.__dir__<0?"Right":"")}),W},go.prototype[g+"Right"]=function(C){return this.reverse()[g](C).reverse()}})),Fa(["filter","map","takeWhile"],(function(g,x){var C=x+1,W=C==1||C==3;go.prototype[g]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:Rr(te,3),type:C}),ce.__filtered__=ce.__filtered__||W,ce}})),Fa(["head","last"],(function(g,x){var C="take"+(x?"Right":"");go.prototype[g]=function(){return this[C](1).value()[0]}})),Fa(["initial","tail"],(function(g,x){var C="drop"+(x?"":"Right");go.prototype[g]=function(){return this.__filtered__?new go(this):this[C](1)}})),go.prototype.compact=function(){return this.filter(Nr)},go.prototype.find=function(g){return this.filter(g).head()},go.prototype.findLast=function(g){return this.reverse().find(g)},go.prototype.invokeMap=uo((function(g,x){return typeof g=="function"?new go(this):this.map((function(C){return Wa(C,g,x)}))})),go.prototype.reject=function(g){return this.filter(Bf(Rr(g)))},go.prototype.slice=function(g,x){g=Mt(g);var C=this;return C.__filtered__&&(g>0||x<0)?new go(C):(g<0?C=C.takeRight(-g):g&&(C=C.drop(g)),x!==l&&(C=(x=Mt(x))<0?C.dropRight(-x):C.take(x-g)),C)},go.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},go.prototype.toArray=function(){return this.take(D)},ur(go.prototype,(function(g,x){var C=/^(?:filter|find|map|reject)|While$/.test(x),W=/^(?:head|last)$/.test(x),te=he[W?"take"+(x=="last"?"Right":""):x],ce=W||/^find/.test(x);te&&(he.prototype[x]=function(){var Oe=this.__wrapped__,Fe=W?[1]:arguments,et=Oe instanceof go,jt=Fe[0],Vt=et||Jr(Oe),gn=function(Br){var ir=te.apply(he,oa([Br],Fe));return W&&Yn?ir[0]:ir};Vt&&C&&typeof jt=="function"&&jt.length!=1&&(et=Vt=!1);var Yn=this.__chain__,Qn=!!this.__actions__.length,Sr=ce&&!Yn,an=et&&!Qn;if(!ce&&Vt){Oe=an?Oe:new go(this);var Tn=g.apply(Oe,Fe);return Tn.__actions__.push({func:Lf,args:[gn],thisArg:l}),new Ul(Tn,Yn)}return Sr&&an?g.apply(this,Fe):(Tn=this.thru(gn),Sr?W?Tn.value()[0]:Tn.value():Tn)})})),Fa(["pop","push","shift","sort","splice","unshift"],(function(g){var x=lt[g],C=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",W=/^(?:pop|shift)$/.test(g);he.prototype[g]=function(){var te=arguments;if(W&&!this.__chain__){var ce=this.value();return x.apply(Jr(ce)?ce:[],te)}return this[C]((function(Oe){return x.apply(Jr(Oe)?Oe:[],te)}))}})),ur(go.prototype,(function(g,x){var C=he[x];if(C){var W=C.name+"";$n.call(Su,W)||(Su[W]=[]),Su[W].push({name:x,func:C})}})),Su[wf(l,2).name]=[{name:"wrapper",func:l}],go.prototype.clone=function(){var g=new go(this.__wrapped__);return g.__actions__=va(this.__actions__),g.__dir__=this.__dir__,g.__filtered__=this.__filtered__,g.__iteratees__=va(this.__iteratees__),g.__takeCount__=this.__takeCount__,g.__views__=va(this.__views__),g},go.prototype.reverse=function(){if(this.__filtered__){var g=new go(this);g.__dir__=-1,g.__filtered__=!0}else(g=this.clone()).__dir__*=-1;return g},go.prototype.value=function(){var g=this.__wrapped__.value(),x=this.__dir__,C=Jr(g),W=x<0,te=C?g.length:0,ce=(function(Ao,Mr,Ur){for(var xa=-1,Hl=Ur.length;++xa<Hl;){var uu=Ur[xa],Oa=uu.size;switch(uu.type){case"drop":Ao+=Oa;break;case"dropRight":Mr-=Oa;break;case"take":Mr=Ga(Mr,Ao+Oa);break;case"takeRight":Ao=ji(Ao,Mr-Oa)}}return{start:Ao,end:Mr}})(0,te,this.__views__),Oe=ce.start,Fe=ce.end,et=Fe-Oe,jt=W?Fe:Oe-1,Vt=this.__iteratees__,gn=Vt.length,Yn=0,Qn=Ga(et,this.__takeCount__);if(!C||!W&&te==et&&Qn==et)return rv(g,this.__actions__);var Sr=[];e:for(;et--&&Yn<Qn;){for(var an=-1,Tn=g[jt+=x];++an<gn;){var Br=Vt[an],ir=Br.iteratee,at=Br.type,Yr=ir(Tn);if(at==2)Tn=Yr;else if(!Yr){if(at==1)continue e;break e}}Sr[Yn++]=Tn}return Sr},he.prototype.at=za,he.prototype.chain=function(){return xi(this)},he.prototype.commit=function(){return new Ul(this.value(),this.__chain__)},he.prototype.next=function(){this.__values__===l&&(this.__values__=sn(this.value()));var g=this.__index__>=this.__values__.length;return{done:g,value:g?l:this.__values__[this.__index__++]}},he.prototype.plant=function(g){for(var x,C=this;C instanceof Qs;){var W=Xp(C);W.__index__=0,W.__values__=l,x?te.__wrapped__=W:x=W;var te=W;C=C.__wrapped__}return te.__wrapped__=g,x},he.prototype.reverse=function(){var g=this.__wrapped__;if(g instanceof go){var x=g;return this.__actions__.length&&(x=new go(this)),(x=x.reverse()).__actions__.push({func:Lf,args:[Ed],thisArg:l}),new Ul(x,this.__chain__)}return this.thru(Ed)},he.prototype.toJSON=he.prototype.valueOf=he.prototype.value=function(){return rv(this.__wrapped__,this.__actions__)},he.prototype.first=he.prototype.head,as&&(he.prototype[as]=function(){return this}),he})();vi._=ka,(s=(function(){return ka}).call(o,r,o,a))===l||(a.exports=s)}).call(this)}).call(this,r(68),r(221)(n))},function(n,o,r){var i=r(7),a=r(34),s=r(33),l=r(87),f=r(62),h=r(174),v=r(28),b=i.TypeError,E=v("toPrimitive");n.exports=function(O,w){if(!s(O)||l(O))return O;var S,M=f(O,E);if(M){if(w===void 0&&(w="default"),S=a(M,O,w),!s(S)||l(S))return S;throw b("Can't convert object to primitive value")}return w===void 0&&(w="number"),h(O,w)}},function(n,o,r){var i=r(108);n.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(n,o,r){var i=r(36),a=r(18),s=r(91);n.exports=!i&&!a((function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7}))},function(n,o,r){var i=r(35),a=r(135),s=r(50),l=r(38);n.exports=function(f,h){for(var v=a(h),b=l.f,E=s.f,O=0;O<v.length;O++){var w=v[O];i(f,w)||b(f,w,E(h,w))}}},function(n,o,r){var i=r(46),a=r(15),s=r(74),l=r(112),f=r(32),h=a([].concat);n.exports=i("Reflect","ownKeys")||function(v){var b=s.f(f(v)),E=l.f;return E?h(b,E(v)):b}},function(n,o,r){var i=r(15),a=r(35),s=r(41),l=r(137).indexOf,f=r(72),h=i([].push);n.exports=function(v,b){var E,O=s(v),w=0,S=[];for(E in O)!a(f,E)&&a(O,E)&&h(S,E);for(;b.length>w;)a(O,E=b[w++])&&(~l(S,E)||h(S,E));return S}},function(n,o,r){var i=r(41),a=r(75),s=r(45),l=function(f){return function(h,v,b){var E,O=i(h),w=s(O),S=a(b,w);if(f&&v!=v){for(;w>S;)if((E=O[S++])!=E)return!0}else for(;w>S;S++)if((f||S in O)&&O[S]===v)return f||S||0;return!f&&-1}};n.exports={includes:l(!0),indexOf:l(!1)}},function(n,o,r){var i=r(46);n.exports=i("document","documentElement")},function(n,o,r){var i=r(51),a=r(41),s=r(74).f,l=r(114),f=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function(h){return f&&i(h)=="Window"?(function(v){try{return s(v)}catch{return l(f)}})(h):s(a(h))}},function(n,o,r){var i=r(28);o.f=i},function(n,o,r){var i=r(177),a=r(35),s=r(140),l=r(38).f;n.exports=function(f){var h=i.Symbol||(i.Symbol={});a(h,f)||l(h,f,{value:s.f(f)})}},function(n,o,r){var i,a,s,l=r(18),f=r(30),h=r(60),v=r(101),b=r(42),E=r(28),O=r(71),w=E("iterator"),S=!1;[].keys&&("next"in(s=[].keys())?(a=v(v(s)))!==Object.prototype&&(i=a):S=!0),i==null||l((function(){var M={};return i[w].call(M)!==M}))?i={}:O&&(i=h(i)),f(i[w])||b(i,w,(function(){return this})),n.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:S}},function(n,o,r){var i=r(18);n.exports=!i((function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}))},function(n,o,r){var i=r(16),a=r(15),s=r(72),l=r(33),f=r(35),h=r(38).f,v=r(74),b=r(139),E=r(183),O=r(90),w=r(185),S=!1,M=O("meta"),T=0,$=function(P){h(P,M,{value:{objectID:"O"+T++,weakData:{}}})},D=n.exports={enable:function(){D.enable=function(){},S=!0;var P=v.f,B=a([].splice),F={};F[M]=1,P(F).length&&(v.f=function(I){for(var V=P(I),z=0,q=V.length;z<q;z++)if(V[z]===M){B(V,z,1);break}return V},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:b.f}))},fastKey:function(P,B){if(!l(P))return typeof P=="symbol"?P:(typeof P=="string"?"S":"P")+P;if(!f(P,M)){if(!E(P))return"F";if(!B)return"E";$(P)}return P[M].objectID},getWeakData:function(P,B){if(!f(P,M)){if(!E(P))return!0;if(!B)return!1;$(P)}return P[M].weakData},onFreeze:function(P){return w&&S&&E(P)&&!f(P,M)&&$(P),P}};s[M]=!0},function(n,o,r){var i=r(28),a=r(80),s=i("iterator"),l=Array.prototype;n.exports=function(f){return f!==void 0&&(a.Array===f||l[s]===f)}},function(n,o,r){var i=r(7),a=r(34),s=r(56),l=r(32),f=r(88),h=r(118),v=i.TypeError;n.exports=function(b,E){var O=arguments.length<2?h(b):E;if(s(O))return l(a(O,b));throw v(f(b)+" is not iterable")}},function(n,o,r){var i=r(34),a=r(32),s=r(62);n.exports=function(l,f,h){var v,b;a(l);try{if(!(v=s(l,"return"))){if(f==="throw")throw h;return h}v=i(v,l)}catch(E){b=!0,v=E}if(f==="throw")throw h;if(b)throw v;return a(v),h}},function(n,o,r){var i=r(30),a=r(33),s=r(102);n.exports=function(l,f,h){var v,b;return s&&i(v=f.constructor)&&v!==h&&a(b=v.prototype)&&b!==h.prototype&&s(l,b),l}},function(n,o,r){var i=r(42);n.exports=function(a,s,l){for(var f in s)i(a,f,s[f],l);return a}},function(n,o,r){var i=r(46),a=r(38),s=r(28),l=r(36),f=s("species");n.exports=function(h){var v=i(h),b=a.f;l&&v&&!v[f]&&b(v,f,{configurable:!0,get:function(){return this}})}},function(n,o,r){var i=r(15),a=r(59),s=r(39),l=r(44),f=i("".charAt),h=i("".charCodeAt),v=i("".slice),b=function(E){return function(O,w){var S,M,T=s(l(O)),$=a(w),D=T.length;return $<0||$>=D?E?"":void 0:(S=h(T,$))<55296||S>56319||$+1===D||(M=h(T,$+1))<56320||M>57343?E?f(T,$):S:E?v(T,$,$+2):M-56320+(S-55296<<10)+65536}};n.exports={codeAt:b(!1),charAt:b(!0)}},function(n,o){n.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(n,o,r){var i=r(91)("span").classList,a=i&&i.constructor&&i.constructor.prototype;n.exports=a===Object.prototype?void 0:a},function(n,o,r){var i=r(32);n.exports=function(){var a=i(this),s="";return a.global&&(s+="g"),a.ignoreCase&&(s+="i"),a.multiline&&(s+="m"),a.dotAll&&(s+="s"),a.unicode&&(s+="u"),a.sticky&&(s+="y"),s}},function(n,o,r){var i=r(18),a=r(7).RegExp,s=i((function(){var h=a("a","y");return h.lastIndex=2,h.exec("abcd")!=null})),l=s||i((function(){return!a("a","y").sticky})),f=s||i((function(){var h=a("^r","gy");return h.lastIndex=2,h.exec("str")!=null}));n.exports={BROKEN_CARET:f,MISSED_STICKY:l,UNSUPPORTED_Y:s}},function(n,o,r){var i=r(16),a=r(79).find,s=r(100),l="find",f=!0;l in[]&&Array(1).find((function(){f=!1})),i({target:"Array",proto:!0,forced:f},{find:function(h){return a(this,h,arguments.length>1?arguments[1]:void 0)}}),s(l)},function(n,o,r){var i=r(16),a=r(137).includes,s=r(100);i({target:"Array",proto:!0},{includes:function(l){return a(this,l,arguments.length>1?arguments[1]:void 0)}}),s("includes")},function(n,o,r){var i=r(16),a=r(15),s=r(197),l=r(44),f=r(39),h=r(198),v=a("".indexOf);i({target:"String",proto:!0,forced:!h("includes")},{includes:function(b){return!!~v(f(l(this)),f(s(b)),arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(33),a=r(51),s=r(28)("match");n.exports=function(l){var f;return i(l)&&((f=l[s])!==void 0?!!f:a(l)=="RegExp")}},function(n,o,r){var i=r(15);n.exports=i(1 .valueOf)},function(n,o,r){var i=r(15),a=r(44),s=r(39),l=r(162),f=i("".replace),h="["+l+"]",v=RegExp("^"+h+h+"*"),b=RegExp(h+h+"*$"),E=function(O){return function(w){var S=s(a(w));return 1&O&&(S=f(S,v,"")),2&O&&(S=f(S,b,"")),S}};n.exports={start:E(1),end:E(2),trim:E(3)}},function(n,o){n.exports=`
|
||
\v\f\r \u2028\u2029\uFEFF`},function(n,o){var r,i,a=n.exports={};function s(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function f(T){if(r===setTimeout)return setTimeout(T,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(T,0);try{return r(T,0)}catch{try{return r.call(null,T,0)}catch{return r.call(this,T,0)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:s}catch{r=s}try{i=typeof clearTimeout=="function"?clearTimeout:l}catch{i=l}})();var h,v=[],b=!1,E=-1;function O(){b&&h&&(b=!1,h.length?v=h.concat(v):E=-1,v.length&&w())}function w(){if(!b){var T=f(O);b=!0;for(var $=v.length;$;){for(h=v,v=[];++E<$;)h&&h[E].run();E=-1,$=v.length}h=null,b=!1,(function(D){if(i===clearTimeout)return clearTimeout(D);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(D);try{i(D)}catch{try{return i.call(null,D)}catch{return i.call(this,D)}}})(T)}}function S(T,$){this.fun=T,this.array=$}function M(){}a.nextTick=function(T){var $=new Array(arguments.length-1);if(arguments.length>1)for(var D=1;D<arguments.length;D++)$[D-1]=arguments[D];v.push(new S(T,$)),v.length!==1||b||f(w)},S.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=M,a.addListener=M,a.once=M,a.off=M,a.removeListener=M,a.removeAllListeners=M,a.emit=M,a.prependListener=M,a.prependOnceListener=M,a.listeners=function(T){return[]},a.binding=function(T){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(T){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(n,o,r){var i=r(32),a=r(165),s=r(28)("species");n.exports=function(l,f){var h,v=i(l).constructor;return v===void 0||(h=i(v)[s])==null?f:a(h)}},function(n,o,r){var i=r(7),a=r(99),s=r(88),l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not a constructor")}},function(n,o,r){var i=r(16),a=r(161).trim;i({target:"String",proto:!0,forced:r(200)("trim")},{trim:function(){return a(this)}})},function(n,o,r){var i=r(34),a=r(123),s=r(32),l=r(94),f=r(39),h=r(44),v=r(62),b=r(124),E=r(125);a("match",(function(O,w,S){return[function(M){var T=h(this),$=M==null?void 0:v(M,O);return $?i($,M,T):new RegExp(M)[O](f(T))},function(M){var T=s(this),$=f(M),D=S(w,T,$);if(D.done)return D.value;if(!T.global)return E(T,$);var P=T.unicode;T.lastIndex=0;for(var B,F=[],I=0;(B=E(T,$))!==null;){var V=f(B[0]);F[I]=V,V===""&&(T.lastIndex=b($,l(T.lastIndex),P)),I++}return I===0?null:F}]}))},function(n,o,r){var i,a,s,l,f=r(7),h=r(76),v=r(64),b=r(30),E=r(35),O=r(18),w=r(138),S=r(98),M=r(91),T=r(169),$=r(128),D=f.setImmediate,P=f.clearImmediate,B=f.process,F=f.Dispatch,I=f.Function,V=f.MessageChannel,z=f.String,q=0,X={},G="onreadystatechange";try{i=f.location}catch{}var Q=function(Ae){if(E(X,Ae)){var Pe=X[Ae];delete X[Ae],Pe()}},J=function(Ae){return function(){Q(Ae)}},ie=function(Ae){Q(Ae.data)},Se=function(Ae){f.postMessage(z(Ae),i.protocol+"//"+i.host)};D&&P||(D=function(Ae){var Pe=S(arguments,1);return X[++q]=function(){h(b(Ae)?Ae:I(Ae),void 0,Pe)},a(q),q},P=function(Ae){delete X[Ae]},$?a=function(Ae){B.nextTick(J(Ae))}:F&&F.now?a=function(Ae){F.now(J(Ae))}:V&&!T?(l=(s=new V).port2,s.port1.onmessage=ie,a=v(l.postMessage,l)):f.addEventListener&&b(f.postMessage)&&!f.importScripts&&i&&i.protocol!=="file:"&&!O(Se)?(a=Se,f.addEventListener("message",ie,!1)):a=G in M("script")?function(Ae){w.appendChild(M("script")).onreadystatechange=function(){w.removeChild(this),Q(Ae)}}:function(Ae){setTimeout(J(Ae),0)}),n.exports={set:D,clear:P}},function(n,o,r){var i=r(55);n.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},function(n,o,r){var i=r(56),a=function(s){var l,f;this.promise=new s((function(h,v){if(l!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");l=h,f=v})),this.resolve=i(l),this.reject=i(f)};n.exports.f=function(s){return new a(s)}},function(n,o,r){o.a=function(){return!1}},function(n,o,r){(function(i){r.d(o,"a",(function(){return B}));var a=r(1);function s(V){throw new Error("[mobx-utils] "+V)}function l(V,z){z===void 0&&(z="Illegal state"),V||s(z)}var f=function(V){return V&&V!==Object.prototype&&Object.getOwnPropertyNames(V).concat(f(Object.getPrototypeOf(V))||[])},h=function(V){return(function(z){var q=f(z);return q.filter((function(X,G){return q.indexOf(X)===G}))})(V).filter((function(z){return z!=="constructor"&&!~z.indexOf("__")}))},v="pending",b="fulfilled",E="rejected";function O(V){switch(this.state){case v:return V.pending&&V.pending(this.value);case E:return V.rejected&&V.rejected(this.value);case b:return V.fulfilled?V.fulfilled(this.value):this.value}}function w(V,z){if(l(arguments.length<=2,"fromPromise expects up to two arguments"),l(typeof V=="function"||typeof V=="object"&&V&&typeof V.then=="function","Please pass a promise or function to fromPromise"),V.isPromiseBasedObservable===!0)return V;typeof V=="function"&&(V=new Promise(V));var q=V;V.then(Object(a.k)("observableFromPromise-resolve",(function(G){q.value=G,q.state=b})),Object(a.k)("observableFromPromise-reject",(function(G){q.value=G,q.state=E}))),q.isPromiseBasedObservable=!0,q.case=O;var X=z&&z.state===b?z.value:void 0;return Object(a.q)(q,{value:X,state:v},{},{deep:!1}),q}(function(V){V.reject=Object(a.k)("fromPromise.reject",(function(z){var q=V(Promise.reject(z));return q.state=E,q.value=z,q})),V.resolve=Object(a.k)("fromPromise.resolve",(function(z){z===void 0&&(z=void 0);var q=V(Promise.resolve(z));return q.state=b,q.value=z,q}))})(w||(w={}));var S=function(V,z,q,X){var G,Q=arguments.length,J=Q<3?z:X===null?X=Object.getOwnPropertyDescriptor(z,q):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(V,z,q,X);else for(var ie=V.length-1;ie>=0;ie--)(G=V[ie])&&(J=(Q<3?G(J):Q>3?G(z,q,J):G(z,q))||J);return Q>3&&J&&Object.defineProperty(z,q,J),J};(function(){function V(z,q){var X=this;Object(a.G)((function(){X.current=q,X.subscription=z.subscribe(X)}))}V.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},V.prototype.next=function(z){this.current=z},V.prototype.complete=function(){this.dispose()},V.prototype.error=function(z){this.current=z,this.dispose()},S([a.C.ref],V.prototype,"current",void 0),S([a.k.bound],V.prototype,"next",null),S([a.k.bound],V.prototype,"complete",null),S([a.k.bound],V.prototype,"error",null)})();var M=function(){return M=Object.assign||function(V){for(var z,q=1,X=arguments.length;q<X;q++)for(var G in z=arguments[q])Object.prototype.hasOwnProperty.call(z,G)&&(V[G]=z[G]);return V},M.apply(this,arguments)},T=function(V,z,q,X){var G,Q=arguments.length,J=Q<3?z:X===null?X=Object.getOwnPropertyDescriptor(z,q):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(V,z,q,X);else for(var ie=V.length-1;ie>=0;ie--)(G=V[ie])&&(J=(Q<3?G(J):Q>3?G(z,q,J):G(z,q))||J);return Q>3&&J&&Object.defineProperty(z,q,J),J},$=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function V(z){var q=this;this.model=z,this.localValues=a.C.map({}),this.localComputedValues=a.C.map({}),this.isPropertyDirty=function(X){return q.localValues.has(X)},l(Object(a.A)(z),"createViewModel expects an observable object"),h(z).forEach((function(X){if(X!==a.a&&X!=="__mobxDidRunLazyInitializers"){if(l($.indexOf(X)===-1,"The propertyname "+X+" is reserved and cannot be used with viewModels"),Object(a.w)(z,X)){var G=Object(a.h)(z,X).derivation;q.localComputedValues.set(X,Object(a.m)(G.bind(q)))}var Q=Object.getOwnPropertyDescriptor(z,X),J=Q?{enumerable:Q.enumerable}:{};Object.defineProperty(q,X,M(M({},J),{configurable:!0,get:function(){return Object(a.w)(z,X)?q.localComputedValues.get(X).get():q.isPropertyDirty(X)?q.localValues.get(X):q.model[X]},set:Object(a.k)((function(ie){ie!==q.model[X]?q.localValues.set(X,ie):q.localValues.delete(X)}))}))}}))}Object.defineProperty(V.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),V.prototype.submit=function(){var z=this;Object(a.B)(this.localValues).forEach((function(q){var X=z.localValues.get(q),G=z.model[q];Object(a.y)(G)?G.replace(X):Object(a.z)(G)?(G.clear(),G.merge(X)):Object(a.v)(X)||(z.model[q]=X)})),this.localValues.clear()},V.prototype.reset=function(){this.localValues.clear()},V.prototype.resetProperty=function(z){this.localValues.delete(z)},T([a.m],V.prototype,"isDirty",null),T([a.m],V.prototype,"changedValues",null),T([a.k.bound],V.prototype,"submit",null),T([a.k.bound],V.prototype,"reset",null),T([a.k.bound],V.prototype,"resetProperty",null)})();function D(V){if(!V)return"ROOT";for(var z=[];V.parent;)z.push(V.path),V=V.parent;return z.reverse().join("/")}function P(V){return Object(a.A)(V)||Object(a.y)(V)||Object(a.z)(V)}function B(V,z){var q=new WeakMap;function X(J){var ie=q.get(J.object);(function(Se,Ae){switch(Se.type){case"add":G(Se.newValue,Ae,Se.name);break;case"update":Q(Se.oldValue),G(Se.newValue,Ae,Se.name||""+Se.index);break;case"remove":case"delete":Q(Se.oldValue);break;case"splice":Se.removed.map(Q),Se.added.forEach((function(ze,Ye){return G(ze,Ae,""+(Se.index+Ye))}));for(var Pe=Se.index+Se.addedCount;Pe<Se.object.length;Pe++)if(P(Se.object[Pe])){var De=q.get(Se.object[Pe]);De&&(De.path=""+Pe)}}})(J,ie),z(J,D(ie),V)}function G(J,ie,Se){if(P(J)){var Ae=q.get(J);if(Ae){if(Ae.parent!==ie||Ae.path!==Se)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+D(ie)+"/"+Se+"', but it already exists at '"+D(Ae.parent)+"/"+Ae.path+"'")}else{var Pe={parent:ie,path:Se,dispose:Object(a.D)(J,X)};q.set(J,Pe),Object(a.p)(J).forEach((function(De){var ze=De[0];return G(De[1],Pe,ze)}))}}}function Q(J){if(P(J)){var ie=q.get(J);if(!ie)return;q.delete(J),ie.dispose(),Object(a.L)(J).forEach(Q)}}return G(V,void 0,""),function(){Q(V)}}var F,I=(F=function(V,z){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(q,X){q.__proto__=X}||function(q,X){for(var G in X)X.hasOwnProperty(G)&&(q[G]=X[G])},F(V,z)},function(V,z){function q(){this.constructor=V}F(V,z),V.prototype=z===null?Object.create(z):(q.prototype=z.prototype,new q)});(function(V){function z(q,X,G){var Q=G===void 0?{}:G,J=Q.name,ie=J===void 0?"ogm"+(1e3*Math.random()|0):J,Se=Q.keyToName,Ae=Se===void 0?function(ze){return""+ze}:Se,Pe=V.call(this)||this;Pe._keyToName=Ae,Pe._groupBy=X,Pe._ogmInfoKey=Symbol("ogmInfo"+ie),Pe._base=q;for(var De=0;De<q.length;De++)Pe._addItem(q[De]);return Pe._disposeBaseObserver=Object(a.D)(Pe._base,(function(ze){if(ze.type==="splice")Object(a.J)((function(){for(var Ye=0,Be=ze.removed;Ye<Be.length;Ye++){var Je=Be[Ye];Pe._removeItem(Je)}for(var gt=0,le=ze.added;gt<le.length;gt++){var Ze=le[gt];Pe._addItem(Ze)}}));else{if(ze.type!=="update")throw new Error("illegal state");Object(a.J)((function(){Pe._removeItem(ze.oldValue),Pe._addItem(ze.newValue)}))}})),Pe}I(z,V),z.prototype.clear=function(){throw new Error("not supported")},z.prototype.delete=function(q){throw new Error("not supported")},z.prototype.set=function(q,X){throw new Error("not supported")},z.prototype.dispose=function(){this._disposeBaseObserver();for(var q=0;q<this._base.length;q++){var X=this._base[q];X[this._ogmInfoKey].reaction(),delete X[this._ogmInfoKey]}},z.prototype._getGroupArr=function(q){var X=V.prototype.get.call(this,q);return X===void 0&&(X=Object(a.C)([],{name:"GroupArray["+this._keyToName(q)+"]",deep:!1}),V.prototype.set.call(this,q,X)),X},z.prototype._removeFromGroupArr=function(q,X){var G=V.prototype.get.call(this,q);G.length===1?V.prototype.delete.call(this,q):(X===G.length-1||(G[X]=G[G.length-1],G[X][this._ogmInfoKey].groupArrIndex=X),G.length--)},z.prototype._addItem=function(q){var X=this,G=this._groupBy(q),Q=this._getGroupArr(G),J={groupByValue:G,groupArrIndex:Q.length,reaction:Object(a.F)((function(){return X._groupBy(q)}),(function(ie,Se){var Ae=q[X._ogmInfoKey];X._removeFromGroupArr(Ae.groupByValue,Ae.groupArrIndex);var Pe=X._getGroupArr(ie),De=Pe.length;Pe.push(q),Ae.groupByValue=ie,Ae.groupArrIndex=De}))};Object.defineProperty(q,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:J}),Q.push(q)},z.prototype._removeItem=function(q){var X=q[this._ogmInfoKey];this._removeFromGroupArr(X.groupByValue,X.groupArrIndex),X.reaction(),delete q[this._ogmInfoKey]}})(a.b),(function(){function V(z,q){this.base=z,this.args=q,this.closestIdx=0,this.isDisposed=!1;for(var X=this.closest=this.root=z,G=0;G<this.args.length-1&&(X=X.get(q[G]));G++)this.closest=X;this.closestIdx=G}return V.prototype.exists=function(){this.assertNotDisposed();var z=this.args.length;return this.closestIdx>=z-1&&this.closest.has(this.args[z-1])},V.prototype.get=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");return this.closest.get(this.args[this.args.length-1])},V.prototype.set=function(z){this.assertNotDisposed();for(var q=this.args.length,X=this.closest,G=this.closestIdx;G<q-1;G++){var Q=new Map;X.set(this.args[G],Q),X=Q}this.closestIdx=q-1,this.closest=X,X.set(this.args[q-1],z)},V.prototype.delete=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");var z=this.args.length;this.closest.delete(this.args[z-1]);for(var q=this.root,X=[q],G=0;G<z-1;G++)q=q.get(this.args[G]),X.push(q);for(G=X.length-1;G>0;G--)X[G].size===0&&X[G-1].delete(this.args[G-1]);this.isDisposed=!0},V.prototype.assertNotDisposed=function(){if(this.isDisposed)throw new Error("Concurrent modification exception")},V})(),Promise.resolve(),typeof queueMicrotask<"u"||i!==void 0&&i.nextTick}).call(this,r(163))},function(n,o,r){var i;(function(a,s,l){if(a){for(var f,h={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"},v={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},b={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},E={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},O=1;O<20;++O)h[111+O]="f"+O;for(O=0;O<=9;++O)h[O+96]=O.toString();P.prototype.bind=function(B,F,I){var V=this;return B=B instanceof Array?B:[B],V._bindMultiple.call(V,B,F,I),V},P.prototype.unbind=function(B,F){return this.bind.call(this,B,(function(){}),F)},P.prototype.trigger=function(B,F){var I=this;return I._directMap[B+":"+F]&&I._directMap[B+":"+F]({},B),I},P.prototype.reset=function(){var B=this;return B._callbacks={},B._directMap={},B},P.prototype.stopCallback=function(B,F){if((" "+F.className+" ").indexOf(" mousetrap ")>-1||D(F,this.target))return!1;if("composedPath"in B&&typeof B.composedPath=="function"){var I=B.composedPath()[0];I!==B.target&&(F=I)}return F.tagName=="INPUT"||F.tagName=="SELECT"||F.tagName=="TEXTAREA"||F.isContentEditable},P.prototype.handleKey=function(){var B=this;return B._handleKey.apply(B,arguments)},P.addKeycodes=function(B){for(var F in B)B.hasOwnProperty(F)&&(h[F]=B[F]);f=null},P.init=function(){var B=P(s);for(var F in B)F.charAt(0)!=="_"&&(P[F]=(function(I){return function(){return B[I].apply(B,arguments)}})(F))},P.init(),a.Mousetrap=P,n.exports&&(n.exports=P),(i=(function(){return P}).call(o,r,o,n))===void 0||(n.exports=i)}function w(B,F,I){B.addEventListener?B.addEventListener(F,I,!1):B.attachEvent("on"+F,I)}function S(B){if(B.type=="keypress"){var F=String.fromCharCode(B.which);return B.shiftKey||(F=F.toLowerCase()),F}return h[B.which]?h[B.which]:v[B.which]?v[B.which]:String.fromCharCode(B.which).toLowerCase()}function M(B){return B=="shift"||B=="ctrl"||B=="alt"||B=="meta"}function T(B,F,I){return I||(I=(function(){if(!f)for(var V in f={},h)V>95&&V<112||h.hasOwnProperty(V)&&(f[h[V]]=V);return f})()[B]?"keydown":"keypress"),I=="keypress"&&F.length&&(I="keydown"),I}function $(B,F){var I,V,z,q=[];for(I=(function(X){return X==="+"?["+"]:(X=X.replace(/\+{2}/g,"+plus")).split("+")})(B),z=0;z<I.length;++z)V=I[z],E[V]&&(V=E[V]),F&&F!="keypress"&&b[V]&&(V=b[V],q.push("shift")),M(V)&&q.push(V);return{key:V,modifiers:q,action:F=T(V,q,F)}}function D(B,F){return B!==null&&B!==s&&(B===F||D(B.parentNode,F))}function P(B){var F=this;if(B=B||s,!(F instanceof P))return new P(B);F.target=B,F._callbacks={},F._directMap={};var I,V={},z=!1,q=!1,X=!1;function G(Pe){Pe=Pe||{};var De,ze=!1;for(De in V)Pe[De]?ze=!0:V[De]=0;ze||(X=!1)}function Q(Pe,De,ze,Ye,Be,Je){var gt,le,Ze,pe,se=[],we=ze.type;if(!F._callbacks[Pe])return[];for(we=="keyup"&&M(Pe)&&(De=[Pe]),gt=0;gt<F._callbacks[Pe].length;++gt)if(le=F._callbacks[Pe][gt],(Ye||!le.seq||V[le.seq]==le.level)&&we==le.action&&(we=="keypress"&&!ze.metaKey&&!ze.ctrlKey||(Ze=De,pe=le.modifiers,Ze.sort().join(",")===pe.sort().join(",")))){var $e=!Ye&&le.combo==Be,rt=Ye&&le.seq==Ye&&le.level==Je;($e||rt)&&F._callbacks[Pe].splice(gt,1),se.push(le)}return se}function J(Pe,De,ze,Ye){F.stopCallback(De,De.target||De.srcElement,ze,Ye)||Pe(De,ze)===!1&&((function(Be){Be.preventDefault?Be.preventDefault():Be.returnValue=!1})(De),(function(Be){Be.stopPropagation?Be.stopPropagation():Be.cancelBubble=!0})(De))}function ie(Pe){typeof Pe.which!="number"&&(Pe.which=Pe.keyCode);var De=S(Pe);De&&(Pe.type!="keyup"||z!==De?F.handleKey(De,(function(ze){var Ye=[];return ze.shiftKey&&Ye.push("shift"),ze.altKey&&Ye.push("alt"),ze.ctrlKey&&Ye.push("ctrl"),ze.metaKey&&Ye.push("meta"),Ye})(Pe),Pe):z=!1)}function Se(Pe,De,ze,Ye){function Be(Ze){return function(){X=Ze,++V[Pe],clearTimeout(I),I=setTimeout(G,1e3)}}function Je(Ze){J(ze,Ze,Pe),Ye!=="keyup"&&(z=S(Ze)),setTimeout(G,10)}V[Pe]=0;for(var gt=0;gt<De.length;++gt){var le=gt+1===De.length?Je:Be(Ye||$(De[gt+1]).action);Ae(De[gt],le,Ye,Pe,gt)}}function Ae(Pe,De,ze,Ye,Be){F._directMap[Pe+":"+ze]=De;var Je,gt=(Pe=Pe.replace(/\s+/g," ")).split(" ");gt.length>1?Se(Pe,gt,De,ze):(Je=$(Pe,ze),F._callbacks[Je.key]=F._callbacks[Je.key]||[],Q(Je.key,Je.modifiers,{type:Je.action},Ye,Pe,Be),F._callbacks[Je.key][Ye?"unshift":"push"]({callback:De,modifiers:Je.modifiers,action:Je.action,seq:Ye,level:Be,combo:Pe}))}F._handleKey=function(Pe,De,ze){var Ye,Be=Q(Pe,De,ze),Je={},gt=0,le=!1;for(Ye=0;Ye<Be.length;++Ye)Be[Ye].seq&&(gt=Math.max(gt,Be[Ye].level));for(Ye=0;Ye<Be.length;++Ye)if(Be[Ye].seq){if(Be[Ye].level!=gt)continue;le=!0,Je[Be[Ye].seq]=1,J(Be[Ye].callback,ze,Be[Ye].combo,Be[Ye].seq)}else le||J(Be[Ye].callback,ze,Be[Ye].combo);var Ze=ze.type=="keypress"&&q;ze.type!=X||M(Pe)||Ze||G(Je),q=le&&ze.type=="keydown"},F._bindMultiple=function(Pe,De,ze){for(var Ye=0;Ye<Pe.length;++Ye)Ae(Pe[Ye],De,ze)},w(B,"keypress",ie),w(B,"keydown",ie),w(B,"keyup",ie)}})(typeof window<"u"?window:null,typeof window<"u"?document:null)},function(n,o,r){var i=r(7),a=r(34),s=r(30),l=r(33),f=i.TypeError;n.exports=function(h,v){var b,E;if(v==="string"&&s(b=h.toString)&&!l(E=a(b,h))||s(b=h.valueOf)&&!l(E=a(b,h))||v!=="string"&&s(b=h.toString)&&!l(E=a(b,h)))return E;throw f("Can't convert object to primitive value")}},function(n,o,r){var i=r(7),a=r(30),s=r(92),l=i.WeakMap;n.exports=a(l)&&/native code/.test(s(l))},function(n,o,r){var i=r(36),a=r(38),s=r(32),l=r(41),f=r(77);n.exports=i?Object.defineProperties:function(h,v){s(h);for(var b,E=l(v),O=f(v),w=O.length,S=0;w>S;)a.f(h,b=O[S++],E[b]);return h}},function(n,o,r){var i=r(7);n.exports=i},function(n,o,r){var i=r(7),a=r(96),s=r(99),l=r(33),f=r(28)("species"),h=i.Array;n.exports=function(v){var b;return a(v)&&(b=v.constructor,(s(b)&&(b===h||a(b.prototype))||l(b)&&(b=b[f])===null)&&(b=void 0)),b===void 0?h:b}},function(n,o,r){var i=r(113),a=r(97);n.exports=i?{}.toString:function(){return"[object "+a(this)+"]"}},function(n,o,r){var i=r(142).IteratorPrototype,a=r(60),s=r(69),l=r(78),f=r(80),h=function(){return this};n.exports=function(v,b,E,O){var w=b+" Iterator";return v.prototype=a(i,{next:s(+!O,E)}),l(v,w,!1,!0),f[w]=h,v}},function(n,o,r){var i=r(7),a=r(30),s=i.String,l=i.TypeError;n.exports=function(f){if(typeof f=="object"||a(f))return f;throw l("Can't set "+s(f)+" as a prototype")}},function(n,o,r){var i=r(16),a=r(7),s=r(15),l=r(95),f=r(42),h=r(144),v=r(117),b=r(119),E=r(30),O=r(33),w=r(18),S=r(120),M=r(78),T=r(148);n.exports=function($,D,P){var B=$.indexOf("Map")!==-1,F=$.indexOf("Weak")!==-1,I=B?"set":"add",V=a[$],z=V&&V.prototype,q=V,X={},G=function(Pe){var De=s(z[Pe]);f(z,Pe,Pe=="add"?function(ze){return De(this,ze===0?0:ze),this}:Pe=="delete"?function(ze){return!(F&&!O(ze))&&De(this,ze===0?0:ze)}:Pe=="get"?function(ze){return F&&!O(ze)?void 0:De(this,ze===0?0:ze)}:Pe=="has"?function(ze){return!(F&&!O(ze))&&De(this,ze===0?0:ze)}:function(ze,Ye){return De(this,ze===0?0:ze,Ye),this})};if(l($,!E(V)||!(F||z.forEach&&!w((function(){new V().entries().next()})))))q=P.getConstructor(D,$,B,I),h.enable();else if(l($,!0)){var Q=new q,J=Q[I](F?{}:-0,1)!=Q,ie=w((function(){Q.has(1)})),Se=S((function(Pe){new V(Pe)})),Ae=!F&&w((function(){for(var Pe=new V,De=5;De--;)Pe[I](De,De);return!Pe.has(-0)}));Se||((q=D((function(Pe,De){b(Pe,z);var ze=T(new V,Pe,q);return De!=null&&v(De,ze[I],{that:ze,AS_ENTRIES:B}),ze}))).prototype=z,z.constructor=q),(ie||Ae)&&(G("delete"),G("has"),B&&G("get")),(Ae||J)&&G(I),F&&z.clear&&delete z.clear}return X[$]=q,i({global:!0,forced:q!=V},X),M(q,$),F||P.setStrong(q,$,B),q}},function(n,o,r){var i=r(18),a=r(33),s=r(51),l=r(184),f=Object.isExtensible,h=i((function(){}));n.exports=h||l?function(v){return!!a(v)&&(!l||s(v)!="ArrayBuffer")&&(!f||f(v))}:f},function(n,o,r){var i=r(18);n.exports=i((function(){if(typeof ArrayBuffer=="function"){var a=new ArrayBuffer(8);Object.isExtensible(a)&&Object.defineProperty(a,"a",{value:8})}}))},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(n,o,r){var i=r(38).f,a=r(60),s=r(149),l=r(64),f=r(119),h=r(117),v=r(116),b=r(150),E=r(36),O=r(144).fastKey,w=r(58),S=w.set,M=w.getterFor;n.exports={getConstructor:function(T,$,D,P){var B=T((function(q,X){f(q,F),S(q,{type:$,index:a(null),first:void 0,last:void 0,size:0}),E||(q.size=0),X!=null&&h(X,q[P],{that:q,AS_ENTRIES:D})})),F=B.prototype,I=M($),V=function(q,X,G){var Q,J,ie=I(q),Se=z(q,X);return Se?Se.value=G:(ie.last=Se={index:J=O(X,!0),key:X,value:G,previous:Q=ie.last,next:void 0,removed:!1},ie.first||(ie.first=Se),Q&&(Q.next=Se),E?ie.size++:q.size++,J!=="F"&&(ie.index[J]=Se)),q},z=function(q,X){var G,Q=I(q),J=O(X);if(J!=="F")return Q.index[J];for(G=Q.first;G;G=G.next)if(G.key==X)return G};return s(F,{clear:function(){for(var q=I(this),X=q.index,G=q.first;G;)G.removed=!0,G.previous&&(G.previous=G.previous.next=void 0),delete X[G.index],G=G.next;q.first=q.last=void 0,E?q.size=0:this.size=0},delete:function(q){var X=this,G=I(X),Q=z(X,q);if(Q){var J=Q.next,ie=Q.previous;delete G.index[Q.index],Q.removed=!0,ie&&(ie.next=J),J&&(J.previous=ie),G.first==Q&&(G.first=J),G.last==Q&&(G.last=ie),E?G.size--:X.size--}return!!Q},forEach:function(q){for(var X,G=I(this),Q=l(q,arguments.length>1?arguments[1]:void 0);X=X?X.next:G.first;)for(Q(X.value,X.key,this);X&&X.removed;)X=X.previous},has:function(q){return!!z(this,q)}}),s(F,D?{get:function(q){var X=z(this,q);return X&&X.value},set:function(q,X){return V(this,q===0?0:q,X)}}:{add:function(q){return V(this,q=q===0?0:q,q)}}),E&&i(F,"size",{get:function(){return I(this).size}}),B},setStrong:function(T,$,D){var P=$+" Iterator",B=M($),F=M(P);v(T,$,(function(I,V){S(this,{type:P,target:I,state:B(I),kind:V,last:void 0})}),(function(){for(var I=F(this),V=I.kind,z=I.last;z&&z.removed;)z=z.previous;return I.target&&(I.last=z=z?z.next:I.state.first)?V=="keys"?{value:z.key,done:!1}:V=="values"?{value:z.value,done:!1}:{value:[z.key,z.value],done:!1}:(I.target=void 0,{value:void 0,done:!0})}),D?"entries":"values",!D,!0),b($)}}},function(n,o,r){var i=r(79).forEach,a=r(121)("forEach");n.exports=a?[].forEach:function(s){return i(this,s,arguments.length>1?arguments[1]:void 0)}},function(n,o,r){var i=r(7),a=r(64),s=r(34),l=r(40),f=r(189),h=r(145),v=r(99),b=r(45),E=r(63),O=r(146),w=r(118),S=i.Array;n.exports=function(M){var T=l(M),$=v(this),D=arguments.length,P=D>1?arguments[1]:void 0,B=P!==void 0;B&&(P=a(P,D>2?arguments[2]:void 0));var F,I,V,z,q,X,G=w(T),Q=0;if(!G||this==S&&h(G))for(F=b(T),I=$?new this(F):S(F);F>Q;Q++)X=B?P(T[Q],Q):T[Q],E(I,Q,X);else for(q=(z=O(T,G)).next,I=$?new this:[];!(V=s(q,z)).done;Q++)X=B?f(z,P,[V.value,Q],!0):V.value,E(I,Q,X);return I.length=Q,I}},function(n,o,r){var i=r(32),a=r(147);n.exports=function(s,l,f,h){try{return h?l(i(f)[0],f[1]):l(f)}catch(v){a(s,"throw",v)}}},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var s=a(".","s");return!(s.dotAll&&s.exec(`
|
||
`)&&s.flags==="s")}))},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var s=a("(?<a>b)","g");return s.exec("b").groups.a!=="b"||"b".replace(s,"$<a>c")!=="bc"}))},function(n,o,r){var i=r(16),a=r(15),s=r(56),l=r(40),f=r(45),h=r(39),v=r(18),b=r(193),E=r(121),O=r(194),w=r(195),S=r(70),M=r(196),T=[],$=a(T.sort),D=a(T.push),P=v((function(){T.sort(void 0)})),B=v((function(){T.sort(null)})),F=E("sort"),I=!v((function(){if(S)return S<70;if(!(O&&O>3)){if(w)return!0;if(M)return M<603;var V,z,q,X,G="";for(V=65;V<76;V++){switch(z=String.fromCharCode(V),V){case 66:case 69:case 70:case 72:q=3;break;case 68:case 71:q=4;break;default:q=2}for(X=0;X<47;X++)T.push({k:z+X,v:q})}for(T.sort((function(Q,J){return J.v-Q.v})),X=0;X<T.length;X++)z=T[X].k.charAt(0),G.charAt(G.length-1)!==z&&(G+=z);return G!=="DGBEFHACIJK"}}));i({target:"Array",proto:!0,forced:P||!B||!F||!I},{sort:function(V){V!==void 0&&s(V);var z=l(this);if(I)return V===void 0?$(z):$(z,V);var q,X,G=[],Q=f(z);for(X=0;X<Q;X++)X in z&&D(G,z[X]);for(b(G,(function(J){return function(ie,Se){return Se===void 0?-1:ie===void 0?1:J!==void 0?+J(ie,Se)||0:h(ie)>h(Se)?1:-1}})(V)),q=G.length,X=0;X<q;)z[X]=G[X++];for(;X<Q;)delete z[X++];return z}})},function(n,o,r){var i=r(114),a=Math.floor,s=function(h,v){var b=h.length,E=a(b/2);return b<8?l(h,v):f(h,s(i(h,0,E),v),s(i(h,E),v),v)},l=function(h,v){for(var b,E,O=h.length,w=1;w<O;){for(E=w,b=h[w];E&&v(h[E-1],b)>0;)h[E]=h[--E];E!==w++&&(h[E]=b)}return h},f=function(h,v,b,E){for(var O=v.length,w=b.length,S=0,M=0;S<O||M<w;)h[S+M]=S<O&&M<w?E(v[S],b[M])<=0?v[S++]:b[M++]:S<O?v[S++]:b[M++];return h};n.exports=s},function(n,o,r){var i=r(55).match(/firefox\/(\d+)/i);n.exports=!!i&&+i[1]},function(n,o,r){var i=r(55);n.exports=/MSIE|Trident/.test(i)},function(n,o,r){var i=r(55).match(/AppleWebKit\/(\d+)\./);n.exports=!!i&&+i[1]},function(n,o,r){var i=r(7),a=r(159),s=i.TypeError;n.exports=function(l){if(a(l))throw s("The method doesn't accept regular expressions");return l}},function(n,o,r){var i=r(28)("match");n.exports=function(a){var s=/./;try{"/./"[a](s)}catch{try{return s[i]=!1,"/./"[a](s)}catch{}}return!1}},function(n,o,r){r(16)({target:"Number",stat:!0},{isNaN:function(i){return i!=i}})},function(n,o,r){var i=r(73).PROPER,a=r(18),s=r(162);n.exports=function(l){return a((function(){return!!s[l]()||"
"[l]()!=="
"||i&&s[l].name!==l}))}},function(n,o,r){var i=r(15),a=r(40),s=Math.floor,l=i("".charAt),f=i("".replace),h=i("".slice),v=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,b=/\$([$&'`]|\d{1,2})/g;n.exports=function(E,O,w,S,M,T){var $=w+E.length,D=S.length,P=b;return M!==void 0&&(M=a(M),P=v),f(T,P,(function(B,F){var I;switch(l(F,0)){case"$":return"$";case"&":return E;case"`":return h(O,0,w);case"'":return h(O,$);case"<":I=M[h(F,1,-1)];break;default:var V=+F;if(V===0)return B;if(V>D){var z=s(V/10);return z===0?B:z<=D?S[z-1]===void 0?l(F,1):S[z-1]+l(F,1):B}I=S[V-1]}return I===void 0?"":I}))}},function(n,o,r){var i=r(36),a=r(15),s=r(34),l=r(18),f=r(77),h=r(112),v=r(84),b=r(40),E=r(85),O=Object.assign,w=Object.defineProperty,S=a([].concat);n.exports=!O||l((function(){if(i&&O({b:1},O(w({},"a",{enumerable:!0,get:function(){w(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var M={},T={},$=Symbol(),D="abcdefghijklmnopqrst";return M[$]=7,D.split("").forEach((function(P){T[P]=P})),O({},M)[$]!=7||f(O({},T)).join("")!=D}))?function(M,T){for(var $=b(M),D=arguments.length,P=1,B=h.f,F=v.f;D>P;)for(var I,V=E(arguments[P++]),z=B?S(f(V),B(V)):f(V),q=z.length,X=0;q>X;)I=z[X++],i&&!s(F,V,I)||($[I]=V[I]);return $}:O},function(n,o,r){var i=r(7),a=r(15),s=r(56),l=r(33),f=r(35),h=r(98),v=i.Function,b=a([].concat),E=a([].join),O={},w=function(S,M,T){if(!f(O,M)){for(var $=[],D=0;D<M;D++)$[D]="a["+D+"]";O[M]=v("C,a","return new C("+E($,",")+")")}return O[M](S,T)};n.exports=v.bind||function(S){var M=s(this),T=M.prototype,$=h(arguments,1),D=function(){var P=b($,h(arguments));return this instanceof D?w(M,P.length,P):M.apply(S,P)};return l(T)&&(D.prototype=T),D}},function(n,o,r){var i=r(35);n.exports=function(a){return a!==void 0&&(i(a,"value")||i(a,"writable"))}},function(n,o,r){var i=r(15),a=r(44),s=r(39),l=/"/g,f=i("".replace);n.exports=function(h,v,b,E){var O=s(a(h)),w="<"+v;return b!==""&&(w+=" "+b+'="'+f(s(E),l,""")+'"'),w+">"+O+"</"+v+">"}},function(n,o,r){var i=r(18);n.exports=function(a){return i((function(){var s=""[a]('"');return s!==s.toLowerCase()||s.split('"').length>3}))}},function(n,o,r){r(16)({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},function(n,o,r){var i,a,s,l,f=r(16),h=r(71),v=r(7),b=r(46),E=r(34),O=r(209),w=r(42),S=r(149),M=r(102),T=r(78),$=r(150),D=r(56),P=r(30),B=r(33),F=r(119),I=r(92),V=r(117),z=r(120),q=r(164),X=r(168).set,G=r(210),Q=r(213),J=r(214),ie=r(170),Se=r(215),Ae=r(58),Pe=r(95),De=r(28),ze=r(216),Ye=r(128),Be=r(70),Je=De("species"),gt="Promise",le=Ae.getterFor(gt),Ze=Ae.set,pe=Ae.getterFor(gt),se=O&&O.prototype,we=O,$e=se,rt=v.TypeError,pt=v.document,Lt=v.process,Jt=ie.f,en=Jt,zt=!!(pt&&pt.createEvent&&v.dispatchEvent),it=P(v.PromiseRejectionEvent),ae="unhandledrejection",re=!1,je=Pe(gt,(function(){var Le=I(we),dt=Le!==String(we);if(!dt&&Be===66||h&&!$e.finally)return!0;if(Be>=51&&/native code/.test(Le))return!1;var At=new we((function(wn){wn(1)})),Tt=function(wn){wn((function(){}),(function(){}))};return(At.constructor={})[Je]=Tt,!(re=At.then((function(){}))instanceof Tt)||!dt&&ze&&!it})),vt=je||!z((function(Le){we.all(Le).catch((function(){}))})),Y=function(Le){var dt;return!(!B(Le)||!P(dt=Le.then))&&dt},kt=function(Le,dt){if(!Le.notified){Le.notified=!0;var At=Le.reactions;G((function(){for(var Tt=Le.value,wn=Le.state==1,Zn=0;At.length>Zn;){var ao,Lo,yo,ho=At[Zn++],Nn=wn?ho.ok:ho.fail,qn=ho.resolve,rr=ho.reject,ut=ho.domain;try{Nn?(wn||(Le.rejection===2&&qt(Le),Le.rejection=1),Nn===!0?ao=Tt:(ut&&ut.enter(),ao=Nn(Tt),ut&&(ut.exit(),yo=!0)),ao===ho.promise?rr(rt("Promise-chain cycle")):(Lo=Y(ao))?E(Lo,ao,qn,rr):qn(ao)):rr(Tt)}catch(vn){ut&&!yo&&ut.exit(),rr(vn)}}Le.reactions=[],Le.notified=!1,dt&&!Le.rejection&&Wt(Le)}))}},Rt=function(Le,dt,At){var Tt,wn;zt?((Tt=pt.createEvent("Event")).promise=dt,Tt.reason=At,Tt.initEvent(Le,!1,!0),v.dispatchEvent(Tt)):Tt={promise:dt,reason:At},!it&&(wn=v["on"+Le])?wn(Tt):Le===ae&&J("Unhandled promise rejection",At)},Wt=function(Le){E(X,v,(function(){var dt,At=Le.facade,Tt=Le.value;if(Pn(Le)&&(dt=Se((function(){Ye?Lt.emit("unhandledRejection",Tt,At):Rt(ae,At,Tt)})),Le.rejection=Ye||Pn(Le)?2:1,dt.error))throw dt.value}))},Pn=function(Le){return Le.rejection!==1&&!Le.parent},qt=function(Le){E(X,v,(function(){var dt=Le.facade;Ye?Lt.emit("rejectionHandled",dt):Rt("rejectionhandled",dt,Le.value)}))},xn=function(Le,dt,At){return function(Tt){Le(dt,Tt,At)}},ke=function(Le,dt,At){Le.done||(Le.done=!0,At&&(Le=At),Le.value=dt,Le.state=2,kt(Le,!0))},Ke=function(Le,dt,At){if(!Le.done){Le.done=!0,At&&(Le=At);try{if(Le.facade===dt)throw rt("Promise can't be resolved itself");var Tt=Y(dt);Tt?G((function(){var wn={done:!1};try{E(Tt,dt,xn(Ke,wn,Le),xn(ke,wn,Le))}catch(Zn){ke(wn,Zn,Le)}})):(Le.value=dt,Le.state=1,kt(Le,!1))}catch(wn){ke({done:!1},wn,Le)}}};if(je&&($e=(we=function(Le){F(this,$e),D(Le),E(i,this);var dt=le(this);try{Le(xn(Ke,dt),xn(ke,dt))}catch(At){ke(dt,At)}}).prototype,(i=function(Le){Ze(this,{type:gt,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=S($e,{then:function(Le,dt){var At=pe(this),Tt=At.reactions,wn=Jt(q(this,we));return wn.ok=!P(Le)||Le,wn.fail=P(dt)&&dt,wn.domain=Ye?Lt.domain:void 0,At.parent=!0,Tt[Tt.length]=wn,At.state!=0&&kt(At,!1),wn.promise},catch:function(Le){return this.then(void 0,Le)}}),a=function(){var Le=new i,dt=le(Le);this.promise=Le,this.resolve=xn(Ke,dt),this.reject=xn(ke,dt)},ie.f=Jt=function(Le){return Le===we||Le===s?new a(Le):en(Le)},!h&&P(O)&&se!==Object.prototype)){l=se.then,re||(w(se,"then",(function(Le,dt){var At=this;return new we((function(Tt,wn){E(l,At,Tt,wn)})).then(Le,dt)}),{unsafe:!0}),w(se,"catch",$e.catch,{unsafe:!0}));try{delete se.constructor}catch{}M&&M(se,$e)}f({global:!0,wrap:!0,forced:je},{Promise:we}),T(we,gt,!1,!0),$(gt),s=b(gt),f({target:gt,stat:!0,forced:je},{reject:function(Le){var dt=Jt(this);return E(dt.reject,void 0,Le),dt.promise}}),f({target:gt,stat:!0,forced:h||je},{resolve:function(Le){return Q(h&&this===s?we:this,Le)}}),f({target:gt,stat:!0,forced:vt},{all:function(Le){var dt=this,At=Jt(dt),Tt=At.resolve,wn=At.reject,Zn=Se((function(){var ao=D(dt.resolve),Lo=[],yo=0,ho=1;V(Le,(function(Nn){var qn=yo++,rr=!1;ho++,E(ao,dt,Nn).then((function(ut){rr||(rr=!0,Lo[qn]=ut,--ho||Tt(Lo))}),wn)})),--ho||Tt(Lo)}));return Zn.error&&wn(Zn.value),At.promise},race:function(Le){var dt=this,At=Jt(dt),Tt=At.reject,wn=Se((function(){var Zn=D(dt.resolve);V(Le,(function(ao){E(Zn,dt,ao).then(At.resolve,Tt)}))}));return wn.error&&Tt(wn.value),At.promise}})},function(n,o,r){var i=r(7);n.exports=i.Promise},function(n,o,r){var i,a,s,l,f,h,v,b,E=r(7),O=r(64),w=r(50).f,S=r(168).set,M=r(169),T=r(211),$=r(212),D=r(128),P=E.MutationObserver||E.WebKitMutationObserver,B=E.document,F=E.process,I=E.Promise,V=w(E,"queueMicrotask"),z=V&&V.value;z||(i=function(){var q,X;for(D&&(q=F.domain)&&q.exit();a;){X=a.fn,a=a.next;try{X()}catch(G){throw a?l():s=void 0,G}}s=void 0,q&&q.enter()},M||D||$||!P||!B?!T&&I&&I.resolve?((v=I.resolve(void 0)).constructor=I,b=O(v.then,v),l=function(){b(i)}):D?l=function(){F.nextTick(i)}:(S=O(S,E),l=function(){S(i)}):(f=!0,h=B.createTextNode(""),new P(i).observe(h,{characterData:!0}),l=function(){h.data=f=!f})),n.exports=z||function(q){var X={fn:q,next:void 0};s&&(s.next=X),a||(a=X,l()),s=X}},function(n,o,r){var i=r(55),a=r(7);n.exports=/ipad|iphone|ipod/i.test(i)&&a.Pebble!==void 0},function(n,o,r){var i=r(55);n.exports=/web0s(?!.*chrome)/i.test(i)},function(n,o,r){var i=r(32),a=r(33),s=r(170);n.exports=function(l,f){if(i(l),a(f)&&f.constructor===l)return f;var h=s.f(l);return(0,h.resolve)(f),h.promise}},function(n,o,r){var i=r(7);n.exports=function(a,s){var l=i.console;l&&l.error&&(arguments.length==1?l.error(a):l.error(a,s))}},function(n,o){n.exports=function(r){try{return{error:!1,value:r()}}catch(i){return{error:!0,value:i}}}},function(n,o){n.exports=typeof window=="object"},function(n,o,r){var i=r(40),a=r(75),s=r(45);n.exports=function(l){for(var f=i(this),h=s(f),v=arguments.length,b=a(v>1?arguments[1]:void 0,h),E=v>2?arguments[2]:void 0,O=E===void 0?h:a(E,h);O>b;)f[b++]=l;return f}},function(n,o,r){var i=r(16),a=r(7),s=r(15),l=r(59),f=r(160),h=r(219),v=r(18),b=a.RangeError,E=a.String,O=Math.floor,w=s(h),S=s("".slice),M=s(1 .toFixed),T=function(B,F,I){return F===0?I:F%2==1?T(B,F-1,I*B):T(B*B,F/2,I)},$=function(B,F,I){for(var V=-1,z=I;++V<6;)z+=F*B[V],B[V]=z%1e7,z=O(z/1e7)},D=function(B,F){for(var I=6,V=0;--I>=0;)V+=B[I],B[I]=O(V/F),V=V%F*1e7},P=function(B){for(var F=6,I="";--F>=0;)if(I!==""||F===0||B[F]!==0){var V=E(B[F]);I=I===""?V:I+w("0",7-V.length)+V}return I};i({target:"Number",proto:!0,forced:v((function(){return M(8e-5,3)!=="0.000"||M(.9,0)!=="1"||M(1.255,2)!=="1.25"||M(0xde0b6b3a7640080,0)!=="1000000000000000128"}))||!v((function(){M({})}))},{toFixed:function(B){var F,I,V,z,q=f(this),X=l(B),G=[0,0,0,0,0,0],Q="",J="0";if(X<0||X>20)throw b("Incorrect fraction digits");if(q!=q)return"NaN";if(q<=-1e21||q>=1e21)return E(q);if(q<0&&(Q="-",q=-q),q>1e-21)if(I=(F=(function(ie){for(var Se=0,Ae=ie;Ae>=4096;)Se+=12,Ae/=4096;for(;Ae>=2;)Se+=1,Ae/=2;return Se})(q*T(2,69,1))-69)<0?q*T(2,-F,1):q/T(2,F,1),I*=4503599627370496,(F=52-F)>0){for($(G,0,I),V=X;V>=7;)$(G,1e7,0),V-=7;for($(G,T(10,V,1),0),V=F-1;V>=23;)D(G,1<<23),V-=23;D(G,1<<V),$(G,1,1),D(G,2),J=P(G)}else $(G,0,I),$(G,1<<-F,0),J=P(G)+w("0",X);return J=X>0?Q+((z=J.length)<=X?"0."+w("0",X-z)+J:S(J,0,z-X)+"."+S(J,z-X)):Q+J}})},function(n,o,r){var i=r(7),a=r(59),s=r(39),l=r(44),f=i.RangeError;n.exports=function(h){var v=s(l(this)),b="",E=a(h);if(E<0||E==1/0)throw f("Wrong number of repetitions");for(;E>0;(E>>>=1)&&(v+=v))1&E&&(b+=v);return b}},function(n,o,r){var i=r(36),a=r(15),s=r(77),l=r(41),f=a(r(84).f),h=a([].push),v=function(b){return function(E){for(var O,w=l(E),S=s(w),M=S.length,T=0,$=[];M>T;)O=S[T++],i&&!f(w,O)||h($,b?[O,w[O]]:w[O]);return $}};n.exports={entries:v(!0),values:v(!1)}},function(n,o){n.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(n,o,r){r.r(o),r.d(o,"observer",(function(){return Fc})),r.d(o,"LogicFlow",(function(){return XO})),r.d(o,"h",(function(){return re.g})),r.d(o,"LogicFlowUtil",(function(){return i})),r.d(o,"BaseNode",(function(){return Yf})),r.d(o,"RectNode",(function(){return Fx})),r.d(o,"CircleNode",(function(){return Vx})),r.d(o,"PolygonNode",(function(){return Xx})),r.d(o,"DiamondNode",(function(){return Zx})),r.d(o,"EllipseNode",(function(){return nO})),r.d(o,"TextNode",(function(){return iO})),r.d(o,"HtmlNode",(function(){return uO})),r.d(o,"BaseEdge",(function(){return Py})),r.d(o,"LineEdge",(function(){return xO})),r.d(o,"PolylineEdge",(function(){return TO})),r.d(o,"BezierEdge",(function(){return PO})),r.d(o,"Arrow",(function(){return VB})),r.d(o,"BaseEdgeModel",(function(){return Kp})),r.d(o,"BezierEdgeModel",(function(){return WE})),r.d(o,"LineEdgeModel",(function(){return Od})),r.d(o,"PolylineEdgeModel",(function(){return Cl})),r.d(o,"BaseNodeModel",(function(){return Xf})),r.d(o,"CircleNodeModel",(function(){return KE})),r.d(o,"DiamondNodeModel",(function(){return tx})),r.d(o,"EllipseNodeModel",(function(){return ix})),r.d(o,"PolygonNodeModel",(function(){return dx})),r.d(o,"RectNodeModel",(function(){return vx})),r.d(o,"TextNodeModel",(function(){return _x})),r.d(o,"HtmlNodeModel",(function(){return Ex})),r.d(o,"EditConfigModel",(function(){return Mp})),r.d(o,"GraphModel",(function(){return lT})),r.d(o,"SnaplineModel",(function(){return WC})),r.d(o,"Keyboard",(function(){return NN})),r.d(o,"get",(function(){return NT})),r.d(o,"defaults",(function(){return PT})),r.d(o,"ElementState",(function(){return Io})),r.d(o,"ModelType",(function(){return lo})),r.d(o,"ElementType",(function(){return ei})),r.d(o,"EventType",(function(){return ur})),r.d(o,"formateAnchorConnectValidateData",(function(){return au}));var i={};r.r(i),r.d(i,"createUuid",(function(){return tl})),r.d(i,"refreshGraphId",(function(){return Sf})),r.d(i,"StepDrag",(function(){return Te})),r.d(i,"setupEdgeModel",(function(){return sn})),r.d(i,"isBboxOverLapping",(function(){return nn})),r.d(i,"filterRepeatPoints",(function(){return Mt})),r.d(i,"getSimplePolyline",(function(){return bn})),r.d(i,"getExpandedBBox",(function(){return pn})),r.d(i,"pointDirection",(function(){return rn})),r.d(i,"getExpandedBBoxPoint",(function(){return Gt})),r.d(i,"mergeBBox",(function(){return st})),r.d(i,"getBBoxOfPoints",(function(){return St})),r.d(i,"getPointsFromBBox",(function(){return ln})),r.d(i,"isPointOutsideBBox",(function(){return Sn})),r.d(i,"getBBoxXCrossPoints",(function(){return Xt})),r.d(i,"getBBoxYCrossPoints",(function(){return kn})),r.d(i,"getBBoxCrossPointsByPoint",(function(){return Kt})),r.d(i,"estimateDistance",(function(){return yn})),r.d(i,"costByPoints",(function(){return Yt})),r.d(i,"heuristicCostEstimate",(function(){return En})),r.d(i,"rebuildPath",(function(){return ar})),r.d(i,"removeClosePointFromOpenList",(function(){return xr})),r.d(i,"isSegmentsIntersected",(function(){return on})),r.d(i,"isSegmentCrossingBBox",(function(){return Zt})),r.d(i,"getNextNeighborPoints",(function(){return Ht})),r.d(i,"pathFinder",(function(){return fr})),r.d(i,"getBoxByOriginNode",(function(){return Dr})),r.d(i,"pointFilter",(function(){return Un})),r.d(i,"getPolylinePoints",(function(){return $r})),r.d(i,"getLongestEdge",(function(){return Or})),r.d(i,"isSegmentsInNode",(function(){return Fr})),r.d(i,"isSegmentsCrossNode",(function(){return Qr})),r.d(i,"getCrossPointInRect",(function(){return ki})),r.d(i,"segmentDirection",(function(){return Si})),r.d(i,"points2PointsList",(function(){return jr})),r.d(i,"getSimplePoints",(function(){return Wi})),r.d(i,"getBytesLength",(function(){return Pi})),r.d(i,"getTextWidth",(function(){return Qi})),r.d(i,"getAppendAttributes",(function(){return la})),r.d(i,"getBezierControlPoints",(function(){return zi})),r.d(i,"getBezierPoints",(function(){return di})),r.d(i,"getEndTangent",(function(){return sa})),r.d(i,"getClosestPointOfPolyline",(function(){return co})),r.d(i,"pickEdgeConfig",(function(){return cr})),r.d(i,"twoPointDistance",(function(){return Xr})),r.d(i,"createEdgeGenerator",(function(){return Nr})),r.d(i,"snapToGrid",(function(){return fs})),r.d(i,"getGridOffset",(function(){return wf})),r.d(i,"sampleCubic",(function(){return Ni})),r.d(i,"getThetaOfVector",(function(){return Jp})),r.d(i,"degrees",(function(){return gv})),r.d(i,"Vector",(function(){return ot})),r.d(i,"Point",(function(){return g})),r.d(i,"Matrix",(function(){return Fu})),r.d(i,"RotateMatrix",(function(){return Sd})),r.d(i,"ScaleMatrix",(function(){return wy})),r.d(i,"TranslateMatrix",(function(){return eh}));var a=r(1),s=r(10);if(!s.j)throw new Error("mobx-react-lite requires React with Hooks support");if(!a.H)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");var l=r(43),f=Object(l.b)("observerBatching");function h(c){c()}var v=!1;function b(){return v}function E(c){return Object(a.t)(c)}var O,w=1e4,S=new Set;function M(){O===void 0&&(O=setTimeout(T,1e4))}function T(){O=void 0;var c=Date.now();S.forEach((function(u){var d=u.current;d&&c>=d.cleanAt&&(d.reaction.dispose(),u.current=null,S.delete(u))})),S.size>0&&M()}var $=!1,D=[],P={};function B(c){return"observer"+c}function F(c,u,d){u===void 0&&(u="observed"),d===void 0&&(d=P),b();var p,y=(function(U){return function(){$?D.push(U):U()}})((d.useForceUpdate||l.d)()),m=s.d.useRef(null);if(!m.current){var _=new a.c(B(u),(function(){A.mounted?y():(_.dispose(),m.current=null)})),A=(function(U){return{cleanAt:Date.now()+w,reaction:U}})(_);m.current=A,p=m,S.add(p),M()}var N=m.current.reaction;return s.d.useDebugValue(N,E),s.d.useEffect((function(){var U;return U=m,S.delete(U),m.current?m.current.mounted=!0:(m.current={reaction:new a.c(B(u),(function(){y()})),cleanAt:1/0},y()),function(){m.current.reaction.dispose(),m.current=null}}),[]),(function(U){$=!0,D=[];try{var H=U();$=!1;var oe=D.length>0?D:void 0;return s.d.useLayoutEffect((function(){oe&&oe.forEach((function(ue){return ue()}))}),[oe]),H}finally{$=!1}})((function(){var U,H;if(N.track((function(){try{U=c()}catch(oe){H=oe}})),H)throw H;return U}))}var I=function(){return I=Object.assign||function(c){for(var u,d=1,p=arguments.length;d<p;d++)for(var y in u=arguments[d])Object.prototype.hasOwnProperty.call(u,y)&&(c[y]=u[y]);return c},I.apply(this,arguments)};function V(c,u){var d,p,y,m=I({forwardRef:!1},u),_=c.displayName||c.name,A=function(N,U){return F((function(){return c(N,U)}),_)};return A.displayName=_,d=m.forwardRef?Object(s.f)(Object(s.e)(A)):Object(s.f)(A),p=c,y=d,Object.keys(p).forEach((function(N){z[N]||Object.defineProperty(y,N,Object.getOwnPropertyDescriptor(p,N))})),d.displayName=_,d}var z={$$typeof:!0,render:!0,compare:!0,type:!0};function q(c){var u=c.children,d=c.render,p=u||d;return typeof p!="function"?null:F(p)}function X(c,u,d,p,y){var m=u==="children"?"render":"children",_=typeof c[u]=="function",A=typeof c[m]=="function";return _&&A?new Error("MobX Observer: Do not use children and render in the same time in`"+d):_||A?null:new Error("Invalid prop `"+y+"` of type `"+typeof c[u]+"` supplied to `"+d+"`, expected `function`.")}q.propTypes={children:X,render:X},q.displayName="Observer";var G;(G=s.g)||(G=h),Object(a.n)({reactionScheduler:G}),Object(l.a)()[f]=!0;var Q=0,J={};function ie(c){return J[c]||(J[c]=(function(u){if(typeof Symbol=="function")return Symbol(u);var d="__$mobx-react "+u+" ("+Q+")";return Q++,d})(c)),J[c]}function Se(c,u){if(Ae(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var d=Object.keys(c),p=Object.keys(u);if(d.length!==p.length)return!1;for(var y=0;y<d.length;y++)if(!Object.hasOwnProperty.call(u,d[y])||!Ae(c[d[y]],u[d[y]]))return!1;return!0}function Ae(c,u){return c===u?c!==0||1/c==1/u:c!=c&&u!=u}function Pe(c,u,d){Object.hasOwnProperty.call(c,u)?c[u]=d:Object.defineProperty(c,u,{enumerable:!1,configurable:!0,writable:!0,value:d})}var De=ie("patchMixins"),ze=ie("patchedDefinition");function Ye(c,u){for(var d=this,p=arguments.length,y=new Array(p>2?p-2:0),m=2;m<p;m++)y[m-2]=arguments[m];u.locks++;try{var _;return c!=null&&(_=c.apply(this,y)),_}finally{u.locks--,u.locks===0&&u.methods.forEach((function(A){A.apply(d,y)}))}}function Be(c,u){return function(){for(var d=arguments.length,p=new Array(d),y=0;y<d;y++)p[y]=arguments[y];Ye.call.apply(Ye,[this,c,u].concat(p))}}function Je(c,u,d){var p=(function(A,N){var U=A[De]=A[De]||{},H=U[N]=U[N]||{};return H.locks=H.locks||0,H.methods=H.methods||[],H})(c,u);p.methods.indexOf(d)<0&&p.methods.push(d);var y=Object.getOwnPropertyDescriptor(c,u);if(!y||!y[ze]){var m=c[u],_=gt(c,u,y?y.enumerable:void 0,p,m);Object.defineProperty(c,u,_)}}function gt(c,u,d,p,y){var m,_=Be(y,p);return(m={})[ze]=!0,m.get=function(){return _},m.set=function(A){if(this===c)_=Be(A,p);else{var N=gt(this,u,d,p,A);Object.defineProperty(this,u,N)}},m.configurable=!0,m.enumerable=d,m}var le=a.a||"$mobx",Ze=ie("isMobXReactObserver"),pe=ie("isUnmounted"),se=ie("skipRender"),we=ie("isForcingUpdate");function $e(c){var u=c.prototype;if(c[Ze]?rt(u):c[Ze]=!0,u.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(c.__proto__!==s.b)if(u.shouldComponentUpdate){if(u.shouldComponentUpdate!==Lt)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else u.shouldComponentUpdate=Lt;Jt(u,"props"),Jt(u,"state");var d=u.render;return u.render=function(){return pt.call(this,d)},Je(u,"componentWillUnmount",(function(){var p;(p=this.render[le])===null||p===void 0||p.dispose(),this[pe]=!0,!this.render[le]&&rt(this)})),c}function rt(c){return c.displayName||c.name||c.constructor&&(c.constructor.displayName||c.constructor.name)||"<component>"}function pt(c){var u=this;Pe(this,se,!1),Pe(this,we,!1);var d=rt(this),p=c.bind(this),y=!1,m=new a.c(d+".render()",(function(){if(!y&&(y=!0,u[pe]!==!0)){var A=!0;try{Pe(u,we,!0),u[se]||s.a.prototype.forceUpdate.call(u),A=!1}finally{Pe(u,we,!1),A&&m.dispose()}}}));function _(){y=!1;var A=void 0,N=void 0;if(m.track((function(){try{N=Object(a.d)(!1,p)}catch(U){A=U}})),A)throw A;return N}return m.reactComponent=this,_[le]=m,this.render=_,_.call(this)}function Lt(c,u){return this.state!==u||!Se(this.props,c)}function Jt(c,u){var d=ie("reactProp_"+u+"_valueHolder"),p=ie("reactProp_"+u+"_atomHolder");function y(){return this[p]||Pe(this,p,Object(a.o)("reactive "+u)),this[p]}Object.defineProperty(c,u,{configurable:!0,enumerable:!0,get:function(){var m=!1;return a.f&&a.e&&(m=Object(a.f)(!0)),y.call(this).reportObserved(),a.f&&a.e&&Object(a.e)(m),this[d]},set:function(m){this[we]||Se(this[d],m)?Pe(this,d,m):(Pe(this,d,m),Pe(this,se,!0),y.call(this).reportChanged(),Pe(this,se,!1))}})}var en=typeof Symbol=="function"&&Symbol.for,zt=en?Symbol.for("react.forward_ref"):typeof s.e=="function"&&Object(s.e)((function(c){return null})).$$typeof,it=en?Symbol.for("react.memo"):typeof s.f=="function"&&Object(s.f)((function(c){return null})).$$typeof;function ae(c){if(c.isMobxInjector,it&&c.$$typeof===it)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(zt&&c.$$typeof===zt){var u=c.render;if(typeof u!="function")throw new Error("render property of ForwardRef was not a function");return Object(s.e)((function(){var d=arguments;return Object(s.c)(q,null,(function(){return u.apply(void 0,d)}))}))}return typeof c!="function"||c.prototype&&c.prototype.render||c.isReactClass||Object.prototype.isPrototypeOf.call(s.a,c)?$e(c):V(c)}if(!s.a)throw new Error("mobx-react requires React to be available");if(!a.C)throw new Error("mobx-react requires mobx to be available");var re=r(0);r(4),r(8),r(2),r(3),r(52),r(6),r(5),r(11),r(37),r(27),r(21),r(20),r(24),r(22),r(25),r(9),r(17),r(23),r(19),r(192),r(156),r(104),r(157),r(158),r(199),r(61);var je=function(c,u){for(var d=-1,p=c==null?0:c.length,y=Array(p);++d<p;)y[d]=u(c[d],d,c);return y},vt=function(){this.__data__=[],this.size=0},Y=function(c,u){return c===u||c!=c&&u!=u},kt=function(c,u){for(var d=c.length;d--;)if(Y(c[d][0],u))return d;return-1},Rt=Array.prototype.splice,Wt=function(c){var u=this.__data__,d=kt(u,c);return!(d<0)&&(d==u.length-1?u.pop():Rt.call(u,d,1),--this.size,!0)},Pn=function(c){var u=this.__data__,d=kt(u,c);return d<0?void 0:u[d][1]},qt=function(c){return kt(this.__data__,c)>-1},xn=function(c,u){var d=this.__data__,p=kt(d,c);return p<0?(++this.size,d.push([c,u])):d[p][1]=u,this};function ke(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}ke.prototype.clear=vt,ke.prototype.delete=Wt,ke.prototype.get=Pn,ke.prototype.has=qt,ke.prototype.set=xn;var Ke=ke,Le=function(){this.__data__=new Ke,this.size=0},dt=function(c){var u=this.__data__,d=u.delete(c);return this.size=u.size,d},At=function(c){return this.__data__.get(c)},Tt=function(c){return this.__data__.has(c)},wn=r(31),Zn=wn.a.Symbol,ao=Object.prototype,Lo=ao.hasOwnProperty,yo=ao.toString,ho=Zn?Zn.toStringTag:void 0,Nn=function(c){var u=Lo.call(c,ho),d=c[ho];try{c[ho]=void 0;var p=!0}catch{}var y=yo.call(c);return p&&(u?c[ho]=d:delete c[ho]),y},qn=Object.prototype.toString,rr=function(c){return qn.call(c)},ut=Zn?Zn.toStringTag:void 0,vn=function(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":ut&&ut in Object(c)?Nn(c):rr(c)},In=function(c){var u=typeof c;return c!=null&&(u=="object"||u=="function")},sr,wo=function(c){if(!In(c))return!1;var u=vn(c);return u=="[object Function]"||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"},oo=wn.a["__core-js_shared__"],ta=(sr=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||""))?"Symbol(src)_1."+sr:"",Ca=function(c){return!!ta&&ta in c},Yi=Function.prototype.toString,fa=function(c){if(c!=null){try{return Yi.call(c)}catch{}try{return c+""}catch{}}return""},Ka=/^\[object .+?Constructor\]$/,On=Function.prototype,Ts=Object.prototype,Oo=On.toString,es=Ts.hasOwnProperty,Ui=RegExp("^"+Oo.call(es).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=function(c){return!(!In(c)||Ca(c))&&(wo(c)?Ui:Ka).test(fa(c))},gl=function(c,u){return c==null?void 0:c[u]},pa=function(c,u){var d=gl(c,u);return gr(d)?d:void 0},qi=pa(wn.a,"Map"),Na=pa(Object,"create"),al=function(){this.__data__=Na?Na(null):{},this.size=0},yl=function(c){var u=this.has(c)&&delete this.__data__[c];return this.size-=u?1:0,u},Cs=Object.prototype.hasOwnProperty,_l=function(c){var u=this.__data__;if(Na){var d=u[c];return d==="__lodash_hash_undefined__"?void 0:d}return Cs.call(u,c)?u[c]:void 0},ts=Object.prototype.hasOwnProperty,ve=function(c){var u=this.__data__;return Na?u[c]!==void 0:ts.call(u,c)},mt=function(c,u){var d=this.__data__;return this.size+=this.has(c)?0:1,d[c]=Na&&u===void 0?"__lodash_hash_undefined__":u,this};function cn(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}cn.prototype.clear=al,cn.prototype.delete=yl,cn.prototype.get=_l,cn.prototype.has=ve,cn.prototype.set=mt;var Kn=cn,br=function(){this.size=0,this.__data__={hash:new Kn,map:new(qi||Ke),string:new Kn}},so=function(c){var u=typeof c;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?c!=="__proto__":c===null},si=function(c,u){var d=c.__data__;return so(u)?d[typeof u=="string"?"string":"hash"]:d.map},ye=function(c){var u=si(this,c).delete(c);return this.size-=u?1:0,u},ht=function(c){return si(this,c).get(c)},fn=function(c){return si(this,c).has(c)},Rn=function(c,u){var d=si(this,c),p=d.size;return d.set(c,u),this.size+=d.size==p?0:1,this};function Cn(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}Cn.prototype.clear=br,Cn.prototype.delete=ye,Cn.prototype.get=ht,Cn.prototype.has=fn,Cn.prototype.set=Rn;var nr=Cn,Mn=function(c,u){var d=this.__data__;if(d instanceof Ke){var p=d.__data__;if(!qi||p.length<199)return p.push([c,u]),this.size=++d.size,this;d=this.__data__=new nr(p)}return d.set(c,u),this.size=d.size,this};function or(c){var u=this.__data__=new Ke(c);this.size=u.size}or.prototype.clear=Le,or.prototype.delete=dt,or.prototype.get=At,or.prototype.has=Tt,or.prototype.set=Mn;var lr=or,qr=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},na=function(c){return this.__data__.has(c)};function vi(c){var u=-1,d=c==null?0:c.length;for(this.__data__=new nr;++u<d;)this.add(c[u])}vi.prototype.add=vi.prototype.push=qr,vi.prototype.has=na;var bl=vi,Vi=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p;)if(u(c[d],d,c))return!0;return!1},Ns=function(c,u){return c.has(u)},Fl=function(c,u,d,p,y,m){var _=1&d,A=c.length,N=u.length;if(A!=N&&!(_&&N>A))return!1;var U=m.get(c),H=m.get(u);if(U&&H)return U==u&&H==c;var oe=-1,ue=!0,Ce=2&d?new bl:void 0;for(m.set(c,u),m.set(u,c);++oe<A;){var Ve=c[oe],qe=u[oe];if(p)var Ot=_?p(qe,Ve,oe,u,c,m):p(Ve,qe,oe,c,u,m);if(Ot!==void 0){if(Ot)continue;ue=!1;break}if(Ce){if(!Vi(u,(function(xt,Ft){if(!Ns(Ce,Ft)&&(Ve===xt||y(Ve,xt,d,p,m)))return Ce.push(Ft)}))){ue=!1;break}}else if(Ve!==qe&&!y(Ve,qe,d,p,m)){ue=!1;break}}return m.delete(c),m.delete(u),ue},Ro=wn.a.Uint8Array,La=function(c){var u=-1,d=Array(c.size);return c.forEach((function(p,y){d[++u]=[y,p]})),d},id=function(c){var u=-1,d=Array(c.size);return c.forEach((function(p){d[++u]=p})),d},_u=Zn?Zn.prototype:void 0,Ia=_u?_u.valueOf:void 0,ra=function(c,u,d,p,y,m,_){switch(d){case"[object DataView]":if(c.byteLength!=u.byteLength||c.byteOffset!=u.byteOffset)return!1;c=c.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(c.byteLength!=u.byteLength||!m(new Ro(c),new Ro(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Y(+c,+u);case"[object Error]":return c.name==u.name&&c.message==u.message;case"[object RegExp]":case"[object String]":return c==u+"";case"[object Map]":var A=La;case"[object Set]":var N=1&p;if(A||(A=id),c.size!=u.size&&!N)return!1;var U=_.get(c);if(U)return U==u;p|=2,_.set(c,u);var H=Fl(A(c),A(u),p,y,m,_);return _.delete(c),H;case"[object Symbol]":if(Ia)return Ia.call(c)==Ia.call(u)}return!1},wl=function(c,u){for(var d=-1,p=u.length,y=c.length;++d<p;)c[y+d]=u[d];return c},qo=Array.isArray,Uh=function(c,u,d){var p=u(c);return qo(c)?p:wl(p,d(c))},Fa=function(c,u){for(var d=-1,p=c==null?0:c.length,y=0,m=[];++d<p;){var _=c[d];u(_,d,c)&&(m[y++]=_)}return m},gp=function(){return[]},yp=Object.prototype.propertyIsEnumerable,Ba=Object.getOwnPropertySymbols,Za=Ba?function(c){return c==null?[]:(c=Object(c),Fa(Ba(c),(function(u){return yp.call(c,u)})))}:gp,rf=function(c,u){for(var d=-1,p=Array(c);++d<c;)p[d]=u(d);return p},Mo=function(c){return c!=null&&typeof c=="object"},oa=function(c){return Mo(c)&&vn(c)=="[object Arguments]"},ad=Object.prototype,_p=ad.hasOwnProperty,of=ad.propertyIsEnumerable,ld=oa((function(){return arguments})())?oa:function(c){return Mo(c)&&_p.call(c,"callee")&&!of.call(c,"callee")},ns=ld,$a=r(48),bu=/^(?:0|[1-9]\d*)$/,Ja=function(c,u){var d=typeof c;return!!(u=u??9007199254740991)&&(d=="number"||d!="symbol"&&bu.test(c))&&c>-1&&c%1==0&&c<u},El=function(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991},vo={};vo["[object Float32Array]"]=vo["[object Float64Array]"]=vo["[object Int8Array]"]=vo["[object Int16Array]"]=vo["[object Int32Array]"]=vo["[object Uint8Array]"]=vo["[object Uint8ClampedArray]"]=vo["[object Uint16Array]"]=vo["[object Uint32Array]"]=!0,vo["[object Arguments]"]=vo["[object Array]"]=vo["[object ArrayBuffer]"]=vo["[object Boolean]"]=vo["[object DataView]"]=vo["[object Date]"]=vo["[object Error]"]=vo["[object Function]"]=vo["[object Map]"]=vo["[object Number]"]=vo["[object Object]"]=vo["[object RegExp]"]=vo["[object Set]"]=vo["[object String]"]=vo["[object WeakMap]"]=!1;var Ua=function(c){return Mo(c)&&El(c.length)&&!!vo[vn(c)]},Bl=function(c){return function(u){return c(u)}},ha=r(49),wu=ha.a&&ha.a.isTypedArray,Ks=wu?Bl(wu):Ua,$l=Object.prototype.hasOwnProperty,ui=function(c,u){var d=qo(c),p=!d&&ns(c),y=!d&&!p&&Object($a.a)(c),m=!d&&!p&&!y&&Ks(c),_=d||p||y||m,A=_?rf(c.length,String):[],N=A.length;for(var U in c)!u&&!$l.call(c,U)||_&&(U=="length"||y&&(U=="offset"||U=="parent")||m&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||Ja(U,N))||A.push(U);return A},lc=Object.prototype,rs=function(c){var u=c&&c.constructor;return c===(typeof u=="function"&&u.prototype||lc)},xl=function(c,u){return function(d){return c(u(d))}},af=xl(Object.keys,Object),Vh=Object.prototype.hasOwnProperty,lf=function(c){if(!rs(c))return af(c);var u=[];for(var d in Object(c))Vh.call(c,d)&&d!="constructor"&&u.push(d);return u},Gi=function(c){return c!=null&&El(c.length)&&!wo(c)},sc=function(c){return Gi(c)?ui(c):lf(c)},os=function(c){return Uh(c,sc,Za)},Ki=Object.prototype.hasOwnProperty,sf=function(c,u,d,p,y,m){var _=1&d,A=os(c),N=A.length;if(N!=os(u).length&&!_)return!1;for(var U=N;U--;){var H=A[U];if(!(_?H in u:Ki.call(u,H)))return!1}var oe=m.get(c),ue=m.get(u);if(oe&&ue)return oe==u&&ue==c;var Ce=!0;m.set(c,u),m.set(u,c);for(var Ve=_;++U<N;){var qe=c[H=A[U]],Ot=u[H];if(p)var xt=_?p(Ot,qe,H,u,c,m):p(qe,Ot,H,c,u,m);if(!(xt===void 0?qe===Ot||y(qe,Ot,d,p,m):xt)){Ce=!1;break}Ve||(Ve=H=="constructor")}if(Ce&&!Ve){var Ft=c.constructor,hn=u.constructor;Ft==hn||!("constructor"in c)||!("constructor"in u)||typeof Ft=="function"&&Ft instanceof Ft&&typeof hn=="function"&&hn instanceof hn||(Ce=!1)}return m.delete(c),m.delete(u),Ce},ll=pa(wn.a,"DataView"),Ol=pa(wn.a,"Promise"),sd=pa(wn.a,"Set"),Va=pa(wn.a,"WeakMap"),Qa="[object Map]",ia="[object Promise]",sl="[object Set]",ka="[object WeakMap]",Ct="[object DataView]",un=fa(ll),dn=fa(qi),Wn=fa(Ol),Gr=fa(sd),mo=fa(Va),ci=vn;(ll&&ci(new ll(new ArrayBuffer(1)))!=Ct||qi&&ci(new qi)!=Qa||Ol&&ci(Ol.resolve())!=ia||sd&&ci(new sd)!=sl||Va&&ci(new Va)!=ka)&&(ci=function(c){var u=vn(c),d=u=="[object Object]"?c.constructor:void 0,p=d?fa(d):"";if(p)switch(p){case un:return Ct;case dn:return Qa;case Wn:return ia;case Gr:return sl;case mo:return ka}return u});var R=ci,L="[object Arguments]",Z="[object Array]",fe="[object Object]",Re=Object.prototype.hasOwnProperty,lt=function(c,u,d,p,y,m){var _=qo(c),A=qo(u),N=_?Z:R(c),U=A?Z:R(u),H=(N=N==L?fe:N)==fe,oe=(U=U==L?fe:U)==fe,ue=N==U;if(ue&&Object($a.a)(c)){if(!Object($a.a)(u))return!1;_=!0,H=!1}if(ue&&!H)return m||(m=new lr),_||Ks(c)?Fl(c,u,d,p,y,m):ra(c,u,N,d,p,y,m);if(!(1&d)){var Ce=H&&Re.call(c,"__wrapped__"),Ve=oe&&Re.call(u,"__wrapped__");if(Ce||Ve){var qe=Ce?c.value():c,Ot=Ve?u.value():u;return m||(m=new lr),y(qe,Ot,d,p,m)}}return!!ue&&(m||(m=new lr),sf(c,u,d,p,y,m))},It=function c(u,d,p,y,m){return u===d||(u==null||d==null||!Mo(u)&&!Mo(d)?u!=u&&d!=d:lt(u,d,p,y,c,m))},_n=function(c,u,d,p){var y=d.length,m=y;if(c==null)return!m;for(c=Object(c);y--;){var _=d[y];if(_[2]?_[1]!==c[_[0]]:!(_[0]in c))return!1}for(;++y<m;){var A=(_=d[y])[0],N=c[A],U=_[1];if(_[2]){if(N===void 0&&!(A in c))return!1}else{var H=new lr,oe;if(!(oe===void 0?It(U,N,3,p,H):oe))return!1}}return!0},Jn=function(c){return c==c&&!In(c)},no=function(c){for(var u=sc(c),d=u.length;d--;){var p=u[d],y=c[p];u[d]=[p,y,Jn(y)]}return u},$n=function(c,u){return function(d){return d!=null&&d[c]===u&&(u!==void 0||c in Object(d))}},Do=function(c){var u=no(c);return u.length==1&&u[0][2]?$n(u[0][0],u[0][1]):function(d){return d===c||_n(d,c,u)}},Kr=function(c){return typeof c=="symbol"||Mo(c)&&vn(c)=="[object Symbol]"},So=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ul=/^\w*$/,wi=function(c,u){if(qo(c))return!1;var d=typeof c;return!(d!="number"&&d!="symbol"&&d!="boolean"&&c!=null&&!Kr(c))||ul.test(c)||!So.test(c)||u!=null&&c in Object(u)};function el(c,u){if(typeof c!="function"||u!=null&&typeof u!="function")throw new TypeError("Expected a function");var d=function(){var p=arguments,y=u?u.apply(this,p):p[0],m=d.cache;if(m.has(y))return m.get(y);var _=c.apply(this,p);return d.cache=m.set(y,_)||m,_};return d.cache=new(el.Cache||nr),d}el.Cache=nr;var ks=el,Ps=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zs=/\\(\\)?/g,Eu=(function(c){var u=ks(c,(function(p){return d.size===500&&d.clear(),p})),d=u.cache;return u})((function(c){var u=[];return c.charCodeAt(0)===46&&u.push(""),c.replace(Ps,(function(d,p,y,m){u.push(y?m.replace(Zs,"$1"):p||d)})),u})),is=Zn?Zn.prototype:void 0,xu=is?is.toString:void 0,Zi=function c(u){if(typeof u=="string")return u;if(qo(u))return je(u,c)+"";if(Kr(u))return xu?xu.call(u):"";var d=u+"";return d=="0"&&1/u==-1/0?"-0":d},Js=function(c){return c==null?"":Zi(c)},Rs=function(c,u){return qo(c)?c:wi(c,u)?[c]:Eu(Js(c))},as=function(c){if(typeof c=="string"||Kr(c))return c;var u=c+"";return u=="0"&&1/c==-1/0?"-0":u},ls=function(c,u){for(var d=0,p=(u=Rs(u,c)).length;c!=null&&d<p;)c=c[as(u[d++])];return d&&d==p?c:void 0},uc=function(c,u,d){var p=c==null?void 0:ls(c,u);return p===void 0?d:p},fm=function(c,u){return c!=null&&u in Object(c)},pm=function(c,u,d){for(var p=-1,y=(u=Rs(u,c)).length,m=!1;++p<y;){var _=as(u[p]);if(!(m=c!=null&&d(c,_)))break;c=c[_]}return m||++p!=y?m:!!(y=c==null?0:c.length)&&El(y)&&Ja(_,y)&&(qo(c)||ns(c))},Gh=function(c,u){return c!=null&&pm(c,u,fm)},uf=function(c,u){return wi(c)&&Jn(u)?$n(as(c),u):function(d){var p=uc(d,c);return p===void 0&&p===u?Gh(d,c):It(u,p,3)}},cc=function(c){return c},bp=function(c){return function(u){return u==null?void 0:u[c]}},hm=function(c){return function(u){return ls(u,c)}},dc=function(c){return wi(c)?bp(as(c)):hm(c)},cf=function(c){return typeof c=="function"?c:c==null?cc:typeof c=="object"?qo(c)?uf(c[0],c[1]):Do(c):dc(c)},wp=(function(c){return function(u,d,p){for(var y=-1,m=Object(u),_=p(u),A=_.length;A--;){var N=_[++y];if(d(m[N],N,m)===!1)break}return u}})(),ji=(function(c,u){return function(d,p){if(d==null)return d;if(!Gi(d))return c(d,p);for(var y=d.length,m=-1,_=Object(d);++m<y&&p(_[m],m,_)!==!1;);return d}})((function(c,u){return c&&wp(c,u,sc)})),Ga=function(c,u){var d=-1,p=Gi(c)?Array(c.length):[];return ji(c,(function(y,m,_){p[++d]=u(y,m,_)})),p},Ep=function(c,u){return(qo(c)?je:Ga)(c,cf(u))};Object(a.n)({isolateGlobalState:!0});var xp=(function(){try{var c=pa(Object,"defineProperty");return c({},"",{}),c}catch{}})(),ud=function(c,u,d){u=="__proto__"&&xp?xp(c,u,{configurable:!0,enumerable:!0,value:d,writable:!0}):c[u]=d},dy=Object.prototype.hasOwnProperty,cd=function(c,u,d){var p=c[u];dy.call(c,u)&&Y(p,d)&&(d!==void 0||u in c)||ud(c,u,d)},dd=function(c,u,d,p){var y=!d;d||(d={});for(var m=-1,_=u.length;++m<_;){var A=u[m],N=void 0;N===void 0&&(N=c[A]),y?ud(d,A,N):cd(d,A,N)}return d},df=function(c,u,d){switch(d.length){case 0:return c.call(u);case 1:return c.call(u,d[0]);case 2:return c.call(u,d[0],d[1]);case 3:return c.call(u,d[0],d[1],d[2])}return c.apply(u,d)},fc=Math.max,Ou=function(c,u,d){return u=fc(u===void 0?c.length-1:u,0),function(){for(var p=arguments,y=-1,m=fc(p.length-u,0),_=Array(m);++y<m;)_[y]=p[u+y];y=-1;for(var A=Array(u+1);++y<u;)A[y]=p[y];return A[u]=d(_),df(c,this,A)}},fd=function(c){return function(){return c}},ff=xp?function(c,u){return xp(c,"toString",{configurable:!0,enumerable:!1,value:fd(u),writable:!0})}:cc,Su=Date.now,fy=function(c){var u=0,d=0;return function(){var p=Su(),y=16-(p-d);if(d=p,y>0){if(++u>=800)return arguments[0]}else u=0;return c.apply(void 0,arguments)}},pf=fy(ff),py=function(c,u){return pf(Ou(c,u,cc),c+"")},hy=function(c,u,d){if(!In(d))return!1;var p=typeof u;return!!(p=="number"?Gi(d)&&Ja(u,d.length):p=="string"&&u in d)&&Y(d[u],c)},vm=function(c){return py((function(u,d){var p=-1,y=d.length,m=y>1?d[y-1]:void 0,_=y>2?d[2]:void 0;for(m=c.length>3&&typeof m=="function"?(y--,m):void 0,_&&hy(d[0],d[1],_)&&(m=y<3?void 0:m,y=1),u=Object(u);++p<y;){var A=d[p];A&&c(u,A,p,m)}return u}))},Op=Object.prototype.hasOwnProperty,Pa=vm((function(c,u){if(rs(u)||Gi(u))dd(u,sc(u),c);else for(var d in u)Op.call(u,d)&&cd(c,d,u[d])})),mm=function(c,u,d,p){if(!In(c))return c;for(var y=-1,m=(u=Rs(u,c)).length,_=m-1,A=c;A!=null&&++y<m;){var N=as(u[y]),U=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return c;if(y!=_){var H=A[N];(U=void 0)==void 0&&(U=In(H)?H:Ja(u[y+1])?[]:{})}cd(A,N,U),A=A[N]}return c},he=function(c,u,d){for(var p=-1,y=u.length,m={};++p<y;){var _=u[p],A=ls(c,_);d(A,_)&&mm(m,Rs(_,c),A)}return m},pc=function(c,u){return he(c,u,(function(d,p){return Gh(c,p)}))},Qs=Zn?Zn.isConcatSpreadable:void 0,Ul=function(c){return qo(c)||ns(c)||!!(Qs&&c&&c[Qs])},go=function(u,d,p,y,m){var _=-1,A=u.length;for(p||(p=Ul),m||(m=[]);++_<A;){var N=u[_];p(N)?wl(m,N):m[m.length]=N}return m},ba=function(c){return c!=null&&c.length?go(c):[]},To,ss,eu,Sl,Sp,Ap,Wh,gm,tu,Li,pd,zh,nu,us,hf,Au,Al,Hh,Xh,cs=(function(c){return pf(Ou(c,void 0,ba),c+"")})((function(c,u){return c==null?{}:pc(c,u)}));function mi(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function ym(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Yh(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ii(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Io,Ji,lo,ei,ur,ti,vf={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotation:!1,nodeSelectedOutline:!0,nodeTextEdit:!1,edgeTextEdit:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Ds=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotation","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],Mp=(ss=Ii((To=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),mi(this,"isSilentMode",ss,this),mi(this,"stopZoomGraph",eu,this),mi(this,"stopScrollGraph",Sl,this),mi(this,"stopMoveGraph",Sp,this),mi(this,"adjustEdge",Ap,this),mi(this,"adjustEdgeMiddle",Wh,this),mi(this,"adjustEdgeStartAndEnd",gm,this),mi(this,"adjustNodePosition",tu,this),mi(this,"hideAnchors",Li,this),mi(this,"allowRotation",pd,this),mi(this,"hoverOutline",zh,this),mi(this,"nodeSelectedOutline",nu,this),mi(this,"edgeSelectedOutline",us,this),mi(this,"nodeTextEdit",hf,this),mi(this,"edgeTextEdit",Au,this),mi(this,"nodeTextDraggable",Al,this),mi(this,"edgeTextDraggable",Hh,this),mi(this,"autoExpand",Xh,this),Yh(this,"multipleSelectKey",""),Yh(this,"defaultConfig",{}),Pa(this,this.getConfigDetail(p))}var u,d;return u=c,(d=[{key:"updateEditConfig",value:function(p){var y=this.getConfigDetail(p);Pa(this,y)}},{key:"getConfigDetail",value:function(p){var y=p.isSilentMode,m=p.textEdit,_={};if(y===!1&&Pa(_,this.defaultConfig),y===!0&&y!==this.isSilentMode){var A=cs(vf,Ds);this.defaultConfig={stopZoomGraph:this.stopZoomGraph,stopScrollGraph:this.stopScrollGraph,stopMoveGraph:this.stopMoveGraph,adjustEdge:this.adjustEdge,adjustEdgeMiddle:this.adjustEdgeMiddle,adjustEdgeStartAndEnd:this.adjustEdgeStartAndEnd,adjustNodePosition:this.adjustNodePosition,hideAnchors:this.hideAnchors,allowRotation:this.allowRotation,hoverOutline:this.hoverOutline,nodeSelectedOutline:this.nodeSelectedOutline,edgeSelectedOutline:this.edgeSelectedOutline,nodeTextEdit:this.nodeTextEdit,edgeTextEdit:this.edgeTextEdit,nodeTextDraggable:this.nodeTextDraggable,edgeTextDraggable:this.edgeTextDraggable,autoExpand:this.autoExpand},Pa(_,A)}m===!1&&Pa(_,{nodeTextEdit:!1,edgeTextEdit:!1});var N=cs(p,Ds);return Pa(_,N)}},{key:"getConfig",value:function(){return cs(this,Ds)}}])&&ym(u.prototype,d),c})()).prototype,"isSilentMode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),eu=Ii(To.prototype,"stopZoomGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sl=Ii(To.prototype,"stopScrollGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sp=Ii(To.prototype,"stopMoveGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ap=Ii(To.prototype,"adjustEdge",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Wh=Ii(To.prototype,"adjustEdgeMiddle",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),gm=Ii(To.prototype,"adjustEdgeStartAndEnd",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),tu=Ii(To.prototype,"adjustNodePosition",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Li=Ii(To.prototype,"hideAnchors",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pd=Ii(To.prototype,"allowRotation",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zh=Ii(To.prototype,"hoverOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),nu=Ii(To.prototype,"nodeSelectedOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),us=Ii(To.prototype,"edgeSelectedOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),hf=Ii(To.prototype,"nodeTextEdit",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Au=Ii(To.prototype,"edgeTextEdit",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Al=Ii(To.prototype,"nodeTextDraggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Hh=Ii(To.prototype,"edgeTextDraggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xh=Ii(To.prototype,"autoExpand",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ii(To.prototype,"updateEditConfig",[a.k],Object.getOwnPropertyDescriptor(To.prototype,"updateEditConfig"),To.prototype),To);r(65),r(66),(function(c){c[c.DEFAULT=1]="DEFAULT",c[c.TEXT_EDIT=2]="TEXT_EDIT",c[c.SHOW_MENU=3]="SHOW_MENU",c[c.ALLOW_CONNECT=4]="ALLOW_CONNECT",c[c.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Io||(Io={})),(function(c){c.KEY="logic-flow",c.NODE_NAME="lf-node",c.EDGE_NAME="lf-edge"})(Ji||(Ji={})),(function(c){c.NODE="node",c.CIRCLE_NODE="circle-node",c.POLYGON_NODE="polygon-node",c.RECT_NODE="rect-node",c.TEXT_NODE="text-node",c.ELLIPSE_NODE="ellipse-node",c.DIAMOND_NODE="diamond-node",c.HTML_NODE="html-node",c.EDGE="edge",c.LINE_EDGE="line-edge",c.POLYLINE_EDGE="polyline-edge",c.BEZIER_EDGE="bezier-edge",c.GRAPH="graph"})(lo||(lo={})),(function(c){c.NODE="node",c.EDGE="edge",c.GRAPH="graph"})(ei||(ei={})),(function(c){c.ELEMENT_CLICK="element:click",c.NODE_CLICK="node:click",c.NODE_DBCLICK="node:dbclick",c.NODE_DELETE="node:delete",c.NODE_ADD="node:add",c.NODE_GROUP_COPY="node:group-copy-add",c.NODE_DND_ADD="node:dnd-add",c.NODE_DND_DRAG="node:dnd-drag",c.NODE_MOUSEDOWN="node:mousedown",c.NODE_DRAGSTART="node:dragstart",c.NODE_DRAG="node:drag",c.NODE_DROP="node:drop",c.NODE_MOUSEUP="node:mouseup",c.NODE_MOUSEMOVE="node:mousemove",c.NODE_MOUSEENTER="node:mouseenter",c.NODE_MOUSELEAVE="node:mouseleave",c.NODE_CONTEXTMENU="node:contextmenu",c.NODE_ROTATE="node:rotate",c.EDGE_DELETE="edge:delete",c.EDGE_ADD="edge:add",c.EDGE_CLICK="edge:click",c.EDGE_DBCLICK="edge:dbclick",c.EDGE_MOUSEENTER="edge:mouseenter",c.EDGE_MOUSELEAVE="edge:mouseleave",c.EDGE_CONTEXTMENU="edge:contextmenu",c.EDGE_ADJUST="edge:adjust",c.EDGE_EXCHANGE_NODE="edge:exchange-node",c.ANCHOR_DRAGSTART="anchor:dragstart",c.ANCHOR_DRAG="anchor:drag",c.ANCHOR_DROP="anchor:drop",c.ANCHOR_DRAGEND="anchor:dragend",c.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",c.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",c.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",c.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",c.ADJUST_POINT_DRAG="adjustPoint:drag",c.ADJUST_POINT_DROP="adjustPoint:drop",c.ADJUST_POINT_DRAGEND="adjustPoint:dragend",c.BLANK_MOUSEDOWN="blank:mousedown",c.BLANK_DRAGSTART="blank:dragstart",c.BLANK_DRAG="blank:drag",c.BLANK_DROP="blank:drop",c.BLANK_MOUSEMOVE="blank:mousemove",c.BLANK_MOUSEUP="blank:mouseup",c.BLANK_CLICK="blank:click",c.BLANK_CONTEXTMENU="blank:contextmenu",c.SELECTION_MOUSEDOWN="selection:mousedown",c.SELECTION_DRAGSTART="selection:dragstart",c.SELECTION_DRAG="selection:drag",c.SELECTION_DROP="selection:drop",c.SELECTION_MOUSEMOVE="selection:mousemove",c.SELECTION_MOUSEUP="selection:mouseup",c.SELECTION_CONTEXTMENU="selection:contextmenu",c.CONNECTION_NOT_ALLOWED="connection:not-allowed",c.HISTORY_CHANGE="history:change",c.TEXT_UPDATE="text:update",c.GRAPH_TRANSFORM="graph:transform",c.GRAPH_RENDERED="graph:rendered"})(ur||(ur={})),(function(c){c.HORIZONTAL="horizontal",c.VERTICAL="vertical"})(ti||(ti={}));var Ei,Mi,qh,Kh,mf,Wa,Tp,hd,Vl;function Mu(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ru(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ru(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ru(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function Gl(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function _m(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function js(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ml(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}(function(c){c[c.DEFAULT=0]="DEFAULT",c[c.INCREASE=1]="INCREASE"})(Ei||(Ei={}));var Zh={false:[-1/0,-1/0,1/0,1/0],true:[0,0,0,0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},Jh=(Mi=(function(){function c(p,y){(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,c),js(this,"MINI_SCALE_SIZE",.2),js(this,"MAX_SCALE_SIZE",16),Gl(this,"SCALE_X",qh,this),Gl(this,"SKEW_Y",Kh,this),Gl(this,"SKEW_X",mf,this),Gl(this,"SCALE_Y",Wa,this),Gl(this,"TRANSLATE_X",Tp,this),Gl(this,"TRANSLATE_Y",hd,this),Gl(this,"ZOOM_SIZE",Vl,this),js(this,"eventCenter",void 0),js(this,"translateLimitMinX",void 0),js(this,"translateLimitMinY",void 0),js(this,"translateLimitMaxX",void 0),js(this,"translateLimitMaxY",void 0),this.eventCenter=p;var m=y.stopMoveGraph,_=m!==void 0&&m;this.updateTranslateLimits(_)}var u,d;return u=c,d=[{key:"setZoomMiniSize",value:function(p){this.MINI_SCALE_SIZE=p}},{key:"setZoomMaxSize",value:function(p){this.MAX_SCALE_SIZE=p}},{key:"HtmlPointToCanvasPoint",value:function(p){var y=Mu(p,2),m=y[0],_=y[1];return[(m-this.TRANSLATE_X)/this.SCALE_X,(_-this.TRANSLATE_Y)/this.SCALE_Y]}},{key:"CanvasPointToHtmlPoint",value:function(p){var y=Mu(p,2),m=y[0],_=y[1];return[m*this.SCALE_X+this.TRANSLATE_X,_*this.SCALE_Y+this.TRANSLATE_Y]}},{key:"moveCanvasPointByHtml",value:function(p,y,m){var _=Mu(p,2),A=_[0],N=_[1];return[A+y/this.SCALE_X,N+m/this.SCALE_Y]}},{key:"fixDeltaXY",value:function(p,y){return[p/this.SCALE_X,y/this.SCALE_Y]}},{key:"getTransformStyle",value:function(){var p=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(p,")")}}},{key:"zoom",value:function(){var p=arguments.length>0&&arguments[0]!==void 0&&arguments[0],y=arguments.length>1?arguments[1]:void 0,m=this.SCALE_X,_=this.SCALE_Y;return p===!0?(m+=this.ZOOM_SIZE,_+=this.ZOOM_SIZE):p===!1?(m-=this.ZOOM_SIZE,_-=this.ZOOM_SIZE):typeof p=="number"&&(m=p,_=p),m<this.MINI_SCALE_SIZE||m>this.MAX_SCALE_SIZE||(y&&(this.TRANSLATE_X-=(m-this.SCALE_X)*y[0],this.TRANSLATE_Y-=(_-this.SCALE_Y)*y[1]),this.SCALE_X=m,this.SCALE_Y=_,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")}},{key:"emitGraphTransform",value:function(p){this.eventCenter.emit(ur.GRAPH_TRANSFORM,{type:p,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}})}},{key:"resetZoom",value:function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")}},{key:"translate",value:function(p,y){this.TRANSLATE_X+p<=this.translateLimitMaxX&&this.TRANSLATE_X+p>=this.translateLimitMinX&&(this.TRANSLATE_X+=p),this.TRANSLATE_Y+y<=this.translateLimitMaxY&&this.TRANSLATE_Y+y>=this.translateLimitMinY&&(this.TRANSLATE_Y+=y),this.emitGraphTransform("translate")}},{key:"focusOn",value:function(p,y,m,_){var A=Mu(this.CanvasPointToHtmlPoint([p,y]),2),N=m/2-A[0],U=_/2-A[1];this.TRANSLATE_X+=N,this.TRANSLATE_Y+=U,this.emitGraphTransform("focusOn")}},{key:"updateTranslateLimits",value:function(p){var y=Mu(Array.isArray(p)&&p.length===4?p:Zh[p.toString()],4);this.translateLimitMinX=y[0],this.translateLimitMinY=y[1],this.translateLimitMaxX=y[2],this.translateLimitMaxY=y[3]}}],d&&_m(u.prototype,d),c})(),qh=Ml(Mi.prototype,"SCALE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Kh=Ml(Mi.prototype,"SKEW_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),mf=Ml(Mi.prototype,"SKEW_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Wa=Ml(Mi.prototype,"SCALE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Tp=Ml(Mi.prototype,"TRANSLATE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),hd=Ml(Mi.prototype,"TRANSLATE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Vl=Ml(Mi.prototype,"ZOOM_SIZE",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return .04}}),Ml(Mi.prototype,"zoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"zoom"),Mi.prototype),Ml(Mi.prototype,"resetZoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"resetZoom"),Mi.prototype),Ml(Mi.prototype,"translate",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"translate"),Mi.prototype),Ml(Mi.prototype,"focusOn",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"focusOn"),Mi.prototype),Mi),Cp=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p&&u(c[d],d,c)!==!1;);return c},bm=function(c){var u=[];if(c!=null)for(var d in Object(c))u.push(d);return u},wm=Object.prototype.hasOwnProperty,Em=function(c){if(!In(c))return bm(c);var u=rs(c),d=[];for(var p in c)(p!="constructor"||!u&&wm.call(c,p))&&d.push(p);return d},Np=function(c){return Gi(c)?ui(c,!0):Em(c)},Qh=r(107),ev=function(c,u){var d=-1,p=c.length;for(u||(u=Array(p));++d<p;)u[d]=c[d];return u},gf=xl(Object.getPrototypeOf,Object),uo=Object.prototype.hasOwnProperty,vy=function(c){var u=c.length,d=new c.constructor(u);return u&&typeof c[0]=="string"&&uo.call(c,"index")&&(d.index=c.index,d.input=c.input),d},tv=function(c){var u=new c.constructor(c.byteLength);return new Ro(u).set(new Ro(c)),u},hc=function(c,u){var d=tv(c.buffer);return new c.constructor(d,c.byteOffset,c.byteLength)},yf=/\w*$/,my=function(c){var u=new c.constructor(c.source,yf.exec(c));return u.lastIndex=c.lastIndex,u},xm=Zn?Zn.prototype:void 0,Tl=xm?xm.valueOf:void 0,gy=function(c){return Tl?Object(Tl.call(c)):{}},_f=function(c,u){var d=u?tv(c.buffer):c.buffer;return new c.constructor(d,c.byteOffset,c.length)},kp=function(c,u,d){var p=c.constructor;switch(u){case"[object ArrayBuffer]":return tv(c);case"[object Boolean]":case"[object Date]":return new p(+c);case"[object DataView]":return hc(c);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return _f(c,d);case"[object Map]":case"[object Set]":return new p;case"[object Number]":case"[object String]":return new p(c);case"[object RegExp]":return my(c);case"[object Symbol]":return gy(c)}},nv=Object.create,Om=(function(){function c(){}return function(u){if(!In(u))return{};if(nv)return nv(u);c.prototype=u;var d=new c;return c.prototype=void 0,d}})(),cl=function(c){return typeof c.constructor!="function"||rs(c)?{}:Om(gf(c))},Tu=function(c){return Mo(c)&&R(c)=="[object Map]"},Pp=ha.a&&ha.a.isMap,vc=Pp?Bl(Pp):Tu,Rp=function(c){return Mo(c)&&R(c)=="[object Set]"},rv=ha.a&&ha.a.isSet,Dp=rv?Bl(rv):Rp,bf="[object Arguments]",jp="[object Function]",Lp="[object Object]",jo={};jo[bf]=jo["[object Array]"]=jo["[object ArrayBuffer]"]=jo["[object DataView]"]=jo["[object Boolean]"]=jo["[object Date]"]=jo["[object Float32Array]"]=jo["[object Float64Array]"]=jo["[object Int8Array]"]=jo["[object Int16Array]"]=jo["[object Int32Array]"]=jo["[object Map]"]=jo["[object Number]"]=jo["[object Object]"]=jo["[object RegExp]"]=jo["[object Set]"]=jo["[object String]"]=jo["[object Symbol]"]=jo["[object Uint8Array]"]=jo["[object Uint8ClampedArray]"]=jo["[object Uint16Array]"]=jo["[object Uint32Array]"]=!0,jo["[object Error]"]=jo[jp]=jo["[object WeakMap]"]=!1;var yy=function c(u,d,p,y,m,_){var A,N=1&d;if(A!==void 0)return A;if(!In(u))return u;var U=qo(u);if(U)A=vy(u);else{var H=R(u),oe=H==jp||H=="[object GeneratorFunction]";if(Object($a.a)(u))return Object(Qh.a)(u,N);if(H==Lp||H==bf||oe&&!m)A=oe?{}:cl(u);else{if(!jo[H])return m?u:{};A=kp(u,H,N)}}_||(_=new lr);var ue=_.get(u);if(ue)return ue;_.set(u,A),Dp(u)?u.forEach((function(Ve){A.add(c(Ve,d,p,Ve,u,_))})):vc(u)&&u.forEach((function(Ve,qe){A.set(qe,c(Ve,d,p,qe,u,_))}));var Ce=U?void 0:os(u);return Cp(Ce||u,(function(Ve,qe){Ce&&(Ve=u[qe=Ve]),cd(A,qe,c(Ve,d,p,qe,u,_))})),A},Uo=function(c){return yy(c,5)},Ip=function(c,u,d){(d!==void 0&&!Y(c[u],d)||d===void 0&&!(u in c))&&ud(c,u,d)},Sm=function(c){return Mo(c)&&Gi(c)},mc=Function.prototype,Am=Object.prototype,vd=mc.toString,Mm=Am.hasOwnProperty,gc=vd.call(Object),va=function(c){if(!Mo(c)||vn(c)!="[object Object]")return!1;var u=gf(c);if(u===null)return!0;var d=Mm.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&vd.call(d)==gc},ds=function(c,u){if((u!=="constructor"||typeof c[u]!="function")&&u!="__proto__")return c[u]},ou=function(c){return dd(c,Np(c))},yc=function(c,u,d,p,y,m,_){var A=ds(c,d),N=ds(u,d),U=_.get(N);if(U)Ip(c,d,U);else{var H=void 0,oe=H===void 0;if(oe){var ue=qo(N),Ce=!ue&&Object($a.a)(N),Ve=!ue&&!Ce&&Ks(N);H=N,ue||Ce||Ve?qo(A)?H=A:Sm(A)?H=ev(A):Ce?(oe=!1,H=Object(Qh.a)(N,!0)):Ve?(oe=!1,H=_f(N,!0)):H=[]:va(N)||ns(N)?(H=A,ns(A)?H=ou(A):In(A)&&!wo(A)||(H=cl(N))):oe=!1}oe&&(_.set(N,H),y(H,N,p,m,_),_.delete(N)),Ip(c,d,H)}},_c=function c(u,d,p,y,m){u!==d&&wp(d,(function(_,A){if(m||(m=new lr),In(_))yc(u,d,A,p,c,y,m);else{var N=void 0;N===void 0&&(N=_),Ip(u,A,N)}}),Np)},bc=vm((function(c,u,d){_c(c,u,d)})),Fp={baseNode:{fill:"#FFFFFF",stroke:"#000000",strokeWidth:2},baseEdge:{stroke:"#000000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000000",fill:"#FFFFFF",r:4,hover:{fill:"#949494",fillOpacity:.5,stroke:"#949494",r:10}},nodeText:{color:"#000000",overflowMode:"default",lineHeight:1.2,fontSize:12},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#FFFFFF"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",stroke:"#949494",fillOpacity:1}},arrow:{offset:10,verticalLength:5},anchorLine:{stroke:"#000000",strokeWidth:2,strokeDasharray:"3,2"},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#FFFFFF",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}},iu=function(c){var u=Uo(Fp);return c&&(u=bc(u,c)),u};r(82),r(166);function wc(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}var Bp=(function(){function c(){var p,y,m;(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),m={},(y="_events")in(p=this)?Object.defineProperty(p,y,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[y]=m}var u,d;return u=c,(d=[{key:"on",value:function(p,y,m){var _=this;return p==null||p.split(",").forEach((function(A){A=A.trim(),_._events[A]||(_._events[A]=[]),_._events[A].push({callback:y,once:!!m})})),this}},{key:"once",value:function(p,y){var m=this;p==null||p.split(",").forEach((function(_){return _=_.trim(),m.on(_,y,!0)}))}},{key:"emit",value:function(p,y){var m=this;p==null||p.split(",").forEach((function(_){var A=m._events[_]||[],N=m._events["*"]||[],U=function(H){for(var oe=H.length,ue=0;ue<oe;ue++)if(H[ue]){var Ce=H[ue],Ve=Ce.callback;Ce.once&&(H.splice(ue,1),H.length===0&&delete m._events[_],oe--,ue--),Ve.apply(m,[y])}};U(A),U(N)}))}},{key:"off",value:function(p,y){var m=this;return p||(this._events={}),p.split(",").forEach((function(_){if(y){for(var A=m._events[_]||[],N=A.length,U=0;U<N;U++)A[U].callback===y&&(A.splice(U,1),N--,U--);A.length===0&&delete m._events[_]}else delete m._events[_]})),this}},{key:"getEvents",value:function(){return this._events}}])&&wc(u.prototype,d),c})();function fs(c,u){return u*Math.round(c/u)||c}function wf(c,u){return c%u}function Ef(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return md(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return md(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function md(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var gd=function(c,u,d){var p=Ef(c,2),y=p[0],m=p[1],_=Ef(u,2),A=_[0],N=_[1],U=Ef(d,2),H=U[0],oe=U[1];return y>A&&y<H&&m>N&&m<oe},yd=function(c,u){var d=!1;switch(u.multipleSelectKey){case"meta":d=c.metaKey;break;case"alt":d=c.altKey;break;case"shift":d=c.shiftKey;break;case"ctrl":d=c.ctrlKey;break;default:d=!1}return d};r(167),r(126),r(83),r(29),r(12),r(13),r(14),r(47);var $p=function(c){return function(u,d,p){var y=Object(u);if(!Gi(u)){var m=cf(d);u=sc(u),d=function(A){return m(y[A],A,y)}}var _=c(u,d,p);return _>-1?y[m?u[_]:_]:void 0}},_d=function(c,u,d,p){for(var y=c.length,m=d+-1;++m<y;)if(u(c[m],m,c))return m;return-1},ov=/\s/,Up=function(c){for(var u=c.length;u--&&ov.test(c.charAt(u)););return u},Tm=/^\s+/,iv=function(c){return c&&c.slice(0,Up(c)+1).replace(Tm,"")},ps=/^[-+]0x[0-9a-f]+$/i,av=/^0b[01]+$/i,lv=/^0o[0-7]+$/i,sv=parseInt,bd=function(c){if(typeof c=="number")return c;if(Kr(c))return NaN;if(In(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=In(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=iv(c);var d=av.test(c);return d||lv.test(c)?sv(c.slice(2),d?2:8):ps.test(c)?NaN:+c},Ls=1/0,xf=function(c){return c?(c=bd(c))===Ls||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0},Vp=function(c){var u=xf(c),d=u%1;return u==u?d?u-d:u:0},Gp=Math.max,Cu,Nu=$p((function(c,u,d){var p=c==null?0:c.length;if(!p)return-1;var y=d==null?0:Vp(d);return y<0&&(y=Gp(p+y,0)),_d(c,cf(u),y)})),Rr=new Uint8Array(16);function wd(){if(!Cu&&!(Cu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cu(Rr)}for(var Of=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,hs=function(c){return typeof c=="string"&&Of.test(c)},aa=[],Ec=0;Ec<256;++Ec)aa.push((Ec+256).toString(16).substr(1));var Ti=function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=(aa[c[u+0]]+aa[c[u+1]]+aa[c[u+2]]+aa[c[u+3]]+"-"+aa[c[u+4]]+aa[c[u+5]]+"-"+aa[c[u+6]]+aa[c[u+7]]+"-"+aa[c[u+8]]+aa[c[u+9]]+"-"+aa[c[u+10]]+aa[c[u+11]]+aa[c[u+12]]+aa[c[u+13]]+aa[c[u+14]]+aa[c[u+15]]).toLowerCase();if(!hs(d))throw TypeError("Stringified UUID is invalid");return d},ku=function(c,u,d){var p=(c=c||{}).random||(c.rng||wd)();return p[6]=15&p[6]|64,p[8]=63&p[8]|128,Ti(p)},tl=function(){return ku()},Sf=function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",d=c.nodes.reduce((function(p,y){return p[y.id]=u+ku(),y.id=p[y.id],p}),{});return c.edges.forEach((function(p){p.id=u+ku(),p.sourceNodeId=d[p.sourceNodeId],p.targetNodeId=d[p.targetNodeId]})),c},Ra=(r(105),r(127),r(207),function(c,u,d){var p=c.x,y=c.y,m=u.x,_=u.y,A=d.x,N=d.y,U=(N-_)/(A-m),H=_-U*m;return p>=m&&p<=A&&y>=_&&y<=N&&Math.abs(y-U*p+H)<Number.EPSILON});function Fi(c){return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Fi(c)}function Is(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Fs(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?Is(Object(d),!0).forEach((function(p){Wp(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):Is(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Wp(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Qt,xc,Af,Mf,Pu,Oc,zp,uv,Sc,Tf,Hp,cv,Bs,dv,vs,Ru,Xp,Cm,Nm,km,fv,Yp=function(c){return c.anchors},Cf=function(c,u){for(var d,p=u.nodes,y=p.length-1;y>=0;y--){var m=p[y];if(_y(c,m)){var _=m.getTargetAnchor(c);if(_){var A={node:m,anchorIndex:_.index,anchor:_.anchor};d&&!Pm(m,d.node,u)||(d=A)}}}return d},Pm=function(c,u,d){return c.zIndex>u.zIndex||d.nodesMap[c.id].index>d.nodesMap[u.id].index},ms=function(c,u,d,p){return Math.hypot(c-d,u-p)},Du=function(c,u){var d=!1,p=gi(u);return c.x>=p.minX-0&&c.x<=p.maxX+0&&c.y>=p.minY-0&&c.y<=p.maxY+0&&(d=!0),d},_y=function(c,u){var d=!1,p=gi(u);return c.x>=p.minX-5&&c.x<=p.maxX+5&&c.y>=p.minY-5&&c.y<=p.maxY+5&&(d=!0),d},gi=function(c){var u=c.x,d=c.y,p=c.width,y=c.height;return{minX:u-p/2,minY:d-y/2,maxX:u+p/2,maxY:d+y/2,x:u,y:d,width:p,height:y,centerX:u,centerY:d}},Nf=function(c,u,d){var p,y=(function(_){var A=_,N=A.x,U=A.y,H=A.width,oe=A.height,ue=A.radius;return[{x:N-H/2+ue,y:U-oe/2+ue,r:ue},{x:N+H/2-ue,y:U-oe/2+ue,r:ue},{x:N-H/2+ue,y:U+oe/2-ue,r:ue},{x:N+H/2-ue,y:U+oe/2-ue,r:ue}]})(d),m=Number.MAX_SAFE_INTEGER;return y.forEach((function(_){var A=ms(c.x,c.y,_.x,_.y);A<m&&(m=A,p=_)})),Ac(c,u,p)},Ac=function(c,u,d){var p,y=d,m=y.x,_=y.y,A=y.r;if(u===ti.HORIZONTAL){var N=m-Math.sqrt(A*A-(c.y-_)*(c.y-_)),U=m+Math.sqrt(A*A-(c.y-_)*(c.y-_));p={x:Math.abs(N-c.x)<Math.abs(U-c.x)?N:U,y:c.y}}else if(u===ti.VERTICAL){var H=_-Math.sqrt(A*A-(c.x-m)*(c.x-m)),oe=_+Math.sqrt(A*A-(c.x-m)*(c.x-m)),ue=Math.abs(H-c.y)<Math.abs(oe-c.y)?H:oe;p={x:c.x,y:ue}}return p},kf=function(c,u){var d=u,p=!1,y=d.x-d.width/2+d.radius,m=d.x+d.width/2-d.radius,_=d.y-d.height/2+d.radius,A=d.y+d.height/2-d.radius,N=d.x,U=d.y,H=d.width,oe=d.height;return c.y===U+oe/2||c.y===U-oe/2?p=c.x>y&&c.x<m:c.x!==N+H/2&&c.x!==N-H/2||(p=c.y>_&&c.y<A),p},Ed=function(c,u,d){var p,y=d,m=y.x,_=y.y,A=y.rx,N=y.ry;if(u===ti.HORIZONTAL){var U=m-Math.sqrt(A*A-(c.y-_)*(c.y-_)*A*A/(N*N)),H=m+Math.sqrt(A*A-(c.y-_)*(c.y-_)*A*A/(N*N));p={x:Math.abs(U-c.x)<Math.abs(H-c.x)?U:H,y:c.y}}else if(u===ti.VERTICAL){var oe=_-Math.sqrt(N*N-(c.x-m)*(c.x-m)*N*N/(A*A)),ue=_+Math.sqrt(N*N-(c.x-m)*(c.x-m)*N*N/(A*A)),Ce=Math.abs(oe-c.y)<Math.abs(ue-c.y)?oe:ue;p={x:c.x,y:Ce}}return p},Pf=function(c,u,d){for(var p,y=d.pointsPosition,m=Number.MAX_SAFE_INTEGER,_=[],A=0;A<y.length;A++)_.push({start:y[A],end:y[(A+1)%y.length]});return _.forEach((function(N){var U=N.start,H=N.end,oe=U,ue=H;U.x>H.x&&(oe=H,ue=U);var Ce={x:c.x,y:c.y};if(oe.x===ue.x&&u===ti.HORIZONTAL&&(Ce={x:oe.x,y:c.y}),oe.y===ue.y&&u===ti.VERTICAL&&(Ce={x:c.x,y:oe.y}),oe.x!==ue.x&&oe.y!==ue.y){var Ve=(ue.y-oe.y)/(ue.x-oe.x),qe=(oe.x*ue.y-ue.x*oe.y)/(oe.x-ue.x);u===ti.HORIZONTAL?Ce={x:(c.y-qe)/Ve,y:c.y}:u===ti.VERTICAL&&(Ce={x:c.x,y:Ve*c.x+qe})}if(Ra(Ce,U,H)){var Ot=ms(Ce.x,Ce.y,c.x,c.y);Ot<m&&(m=Ot,p=Ce)}})),p},Rf=function(c,u,d,p){var y=c.x,m=c.y;return u.x>c.x?y=c.x+d/2:u.x<c.x&&(y=c.x-d/2),u.y>c.y?m=c.y+p/2:u.y<c.y&&(m=c.y-p/2),{x:y,y:m}},Df=function(c){var u=c.rows,d=c.style,p=c.rowsLength,y=c.className,m=document.createElement("div");m.style.fontSize=d.fontSize,m.style.width=d.width,m.className=y,m.style.lineHeight=d.lineHeight,m.style.padding=d.padding,d.fontFamily&&(m.style.fontFamily=d.fontFamily),p>1?u.forEach((function(A){var N=document.createElement("div");N.textContent=A,m.appendChild(N)})):m.textContent=u,document.body.appendChild(m);var _=m.clientHeight;return document.body.removeChild(m),_},Mc=function(c){var u=c.rows,d=c.rowsLength,p=c.fontSize,y=0;return u&&u.forEach((function(m){var _=Pi(m);y=_>y?_:y})),{width:Math.ceil(y/2)*p+p/4,height:d*(p+2)+p/4}},au=function(c){return Fi(c)!=="object"?{isAllPass:!!c,msg:c?"":"不允许连接"}:c},ma=function(c){try{return JSON.parse(JSON.stringify(c))}catch{return c}},qp=1e3,jf=999,Tc=function(){return++qp};function xd(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function wa(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?xd(Object(d),!0).forEach((function(p){za(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):xd(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function xi(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function Lf(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function za(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function wr(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Kp=(Qt=(function(){function c(p,y){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),za(this,"id",""),xi(this,"type",xc,this),xi(this,"sourceNodeId",Af,this),xi(this,"targetNodeId",Mf,this),xi(this,"startPoint",Pu,this),xi(this,"endPoint",Oc,this),xi(this,"text",zp,this),xi(this,"properties",uv,this),xi(this,"points",Sc,this),xi(this,"pointsList",Tf,this),xi(this,"isSelected",Hp,this),xi(this,"isHovered",cv,this),xi(this,"isHitable",Bs,this),xi(this,"draggable",dv,this),xi(this,"visible",vs,this),za(this,"virtual",!1),xi(this,"isAnimation",Ru,this),xi(this,"isShowAdjustPoint",Xp,this),za(this,"graphModel",void 0),xi(this,"zIndex",Cm,this),za(this,"BaseType",ei.EDGE),za(this,"modelType",lo.EDGE),xi(this,"state",Nm,this),za(this,"additionStateData",void 0),za(this,"sourceAnchorId",""),za(this,"targetAnchorId",""),za(this,"menu",void 0),za(this,"customTextPosition",!1),xi(this,"style",km,this),xi(this,"arrowConfig",fv,this),this.graphModel=y,this.initEdgeData(p),this.setAttributes()}var u,d;return u=c,d=[{key:"initEdgeData",value:function(p){if(p.properties||(p.properties={}),!p.id){var y=this.graphModel.idGenerator,m=y&&y(p.type),_=this.createId();p.id=_||m||tl()}this.arrowConfig.markerEnd="url(#marker-end-".concat(p.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(p.id,")");var A=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=A,Pa(this,cr(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Tc()),this.setAnchors(),this.initPoints(),this.formatText(p)}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"getEdgeStyle",value:function(){return wa(wa({},this.graphModel.theme.baseEdge),this.style)}},{key:"getAdjustPointStyle",value:function(){return wa({},this.graphModel.theme.edgeAdjust)}},{key:"getTextStyle",value:function(){var p=this.graphModel.theme.edgeText;return Uo(p)}},{key:"getEdgeAnimationStyle",value:function(){var p=this.graphModel.theme.edgeAnimation;return Uo(p)}},{key:"getArrowStyle",value:function(){var p=this.getEdgeStyle(),y=this.getEdgeAnimationStyle(),m=this.graphModel.theme.arrow,_=this.isAnimation?y.stroke:p.stroke;return wa(wa({},p),{},{fill:_,stroke:_},m)}},{key:"getOutlineStyle",value:function(){var p=this.graphModel.theme.outline;return Uo(p)}},{key:"getTextPosition",value:function(){return{x:0,y:0}}},{key:"sourceNode",get:function(){var p,y;return(p=this.graphModel)===null||p===void 0||(y=p.nodesMap[this.sourceNodeId])===null||y===void 0?void 0:y.model}},{key:"targetNode",get:function(){var p,y;return(p=this.graphModel)===null||p===void 0||(y=p.nodesMap[this.targetNodeId])===null||y===void 0?void 0:y.model}},{key:"textPosition",get:function(){return this.getTextPosition()}},{key:"getBeginAnchor",value:function(p,y,m){var _,A,N=Yp(p);return m&&(_=Nu(N,(function(U){return U.id===m})))||N.forEach((function(U){var H=Xr(U,y);(A===void 0||H<A)&&(A=H,_=U)})),_}},{key:"getEndAnchor",value:function(p,y){var m,_,A=this,N=Yp(p);return y&&(m=Nu(N,(function(U){return U.id===y})))||N.forEach((function(U){var H=Xr(U,A.startPoint);(_===void 0||H<_)&&(_=H,m=U)})),m}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getData",value:function(){var p=this.text,y=p.x,m=p.y,_=p.value,A={id:this.id,type:this.type,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Object.assign({},this.startPoint),endPoint:Object.assign({},this.endPoint),properties:Object(a.I)(this.properties)};return _&&(A.text={x:y,y:m,value:_}),this.graphModel.overlapMode===Ei.INCREASE&&(A.zIndex=this.zIndex),A}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"setProperty",value:function(p,y){this.properties[p]=ma(y),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=wa(wa({},Object(a.I)(this.properties)),ma(p)),this.setAttributes()}},{key:"changeEdgeId",value:function(p){var y=this.arrowConfig,m=y.markerEnd,_=y.markerStart;_&&_==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(p,")")),m&&m==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(p,")")),this.id=p}},{key:"setStyle",value:function(p,y){this.style=wa(wa({},this.style),{},za({},p,ma(y)))}},{key:"setStyles",value:function(p){this.style=wa(wa({},this.style),ma(p))}},{key:"updateStyles",value:function(p){this.style=wa({},ma(p))}},{key:"formatText",value:function(p){var y=this.textPosition,m=y.x,_=y.y;p.text&&typeof p.text!="string"?Object.prototype.toString.call(p.text)==="[object Object]"&&(this.text={x:p.text.x||m,y:p.text.y||_,value:p.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:p.text||"",x:m,y:_,draggable:this.text.draggable,editable:this.text.editable}}},{key:"resetTextPosition",value:function(){var p=this.textPosition,y=p.x,m=p.y;this.text.x=y,this.text.y=m}},{key:"moveText",value:function(p,y){if(this.text){var m=this.text,_=m.x,A=m.y,N=m.value,U=m.draggable,H=m.editable;this.text={value:N,draggable:U,x:_+p,y:A+y,editable:H}}}},{key:"setText",value:function(p){p&&Pa(this.text,p)}},{key:"updateText",value:function(p){this.text=wa(wa({},Object(a.I)(this.text)),{},{value:p})}},{key:"setAnchors",value:function(){if(!this.sourceAnchorId||!this.startPoint){var p=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!p)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:p.x,y:p.y}),this.sourceAnchorId||(this.sourceAnchorId=p.id)}if(!this.targetAnchorId||!this.endPoint){var y=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!y)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:y.x,y:y.y}),this.targetAnchorId||(this.targetAnchorId=y.id)}}},{key:"setSelected",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=p}},{key:"setHovered",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=p}},{key:"setHitable",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=p}},{key:"openEdgeAnimation",value:function(){this.isAnimation=!0}},{key:"closeEdgeAnimation",value:function(){this.isAnimation=!1}},{key:"setElementState",value:function(p,y){this.state=p,this.additionStateData=y}},{key:"updateStartPoint",value:function(p){this.startPoint=p}},{key:"moveStartPoint",value:function(p,y){this.startPoint.x+=p,this.startPoint.y+=y}},{key:"updateEndPoint",value:function(p){this.endPoint=p}},{key:"moveEndPoint",value:function(p,y){this.endPoint.x+=p,this.endPoint.y+=y}},{key:"setZIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.zIndex=p}},{key:"initPoints",value:function(){}},{key:"updateAttributes",value:function(p){Pa(this,p)}},{key:"getAdjustStart",value:function(){return this.startPoint}},{key:"getAdjustEnd",value:function(){return this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(p){var y=p.startPoint,m=p.endPoint;this.updateStartPoint({x:y.x,y:y.y}),this.updateEndPoint({x:m.x,y:m.y})}}],d&&Lf(u.prototype,d),c})(),xc=wr(Qt.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Af=wr(Qt.prototype,"sourceNodeId",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Mf=wr(Qt.prototype,"targetNodeId",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Pu=wr(Qt.prototype,"startPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Oc=wr(Qt.prototype,"endPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),zp=wr(Qt.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),uv=wr(Qt.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),Sc=wr(Qt.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Tf=wr(Qt.prototype,"pointsList",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Hp=wr(Qt.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),cv=wr(Qt.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Bs=wr(Qt.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),dv=wr(Qt.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),vs=wr(Qt.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Ru=wr(Qt.prototype,"isAnimation",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xp=wr(Qt.prototype,"isShowAdjustPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Cm=wr(Qt.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Nm=wr(Qt.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),km=wr(Qt.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),fv=wr(Qt.prototype,"arrowConfig",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")}}}),wr(Qt.prototype,"sourceNode",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"sourceNode"),Qt.prototype),wr(Qt.prototype,"targetNode",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"targetNode"),Qt.prototype),wr(Qt.prototype,"textPosition",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"textPosition"),Qt.prototype),wr(Qt.prototype,"setProperty",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setProperty"),Qt.prototype),wr(Qt.prototype,"deleteProperty",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"deleteProperty"),Qt.prototype),wr(Qt.prototype,"setProperties",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setProperties"),Qt.prototype),wr(Qt.prototype,"changeEdgeId",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"changeEdgeId"),Qt.prototype),wr(Qt.prototype,"setStyle",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setStyle"),Qt.prototype),wr(Qt.prototype,"setStyles",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setStyles"),Qt.prototype),wr(Qt.prototype,"updateStyles",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateStyles"),Qt.prototype),wr(Qt.prototype,"formatText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"formatText"),Qt.prototype),wr(Qt.prototype,"resetTextPosition",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"resetTextPosition"),Qt.prototype),wr(Qt.prototype,"moveText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveText"),Qt.prototype),wr(Qt.prototype,"setText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setText"),Qt.prototype),wr(Qt.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateText"),Qt.prototype),wr(Qt.prototype,"setAnchors",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setAnchors"),Qt.prototype),wr(Qt.prototype,"setSelected",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setSelected"),Qt.prototype),wr(Qt.prototype,"setHovered",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setHovered"),Qt.prototype),wr(Qt.prototype,"setHitable",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setHitable"),Qt.prototype),wr(Qt.prototype,"openEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"openEdgeAnimation"),Qt.prototype),wr(Qt.prototype,"closeEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"closeEdgeAnimation"),Qt.prototype),wr(Qt.prototype,"setElementState",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setElementState"),Qt.prototype),wr(Qt.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateStartPoint"),Qt.prototype),wr(Qt.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveStartPoint"),Qt.prototype),wr(Qt.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateEndPoint"),Qt.prototype),wr(Qt.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveEndPoint"),Qt.prototype),wr(Qt.prototype,"setZIndex",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setZIndex"),Qt.prototype),wr(Qt.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"initPoints"),Qt.prototype),wr(Qt.prototype,"updateAttributes",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateAttributes"),Qt.prototype),wr(Qt.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"getAdjustStart"),Qt.prototype),wr(Qt.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"getAdjustEnd"),Qt.prototype),wr(Qt.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateAfterAdjustStartAndEnd"),Qt.prototype),Qt),If=Kp;function Zp(c){return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Zp(c)}function pv(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Rm(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?pv(Object(d),!0).forEach((function(p){Lu(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):pv(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ju(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Dm(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Cc(){return Cc=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=jm(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Cc.apply(this,arguments)}function jm(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=lu(c))!==null;);return c}function hv(c,u){return hv=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hv(c,u)}function Ff(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=lu(c);if(u){var y=lu(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Lm(this,d)}}function Lm(c,u){if(u&&(Zp(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wl(c)}function Wl(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function lu(c){return lu=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},lu(c)}function Lu(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Er,vv,Od=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&hv(m,_)})(y,c);var u,d,p=Ff(y);function y(){var m;ju(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Lu(Wl(m=p.call.apply(p,[this].concat(A))),"modelType",lo.LINE_EDGE),m}return u=y,(d=[{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.line;return Rm(Rm({},Cc(lu(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}])&&Dm(u.prototype,d),y})(If);function su(c){return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},su(c)}function Bf(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return Ha(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return Ha(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Ha(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function gs(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ci(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gs(Object(d),!0).forEach((function(p){mv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gs(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function dl(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function zl(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function by(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function $f(){return $f=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=Nc(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},$f.apply(this,arguments)}function Nc(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=nl(c))!==null;);return c}function Jr(c,u){return Jr=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Jr(c,u)}function Im(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=nl(c);if(u){var y=nl(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return fl(this,d)}}function fl(c,u){if(u&&(su(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oi(c)}function Oi(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function nl(c){return nl=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},nl(c)}function mv(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ea(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Cl=(Er=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Jr(m,_)})(y,c);var u,d,p=Im(y);function y(){var m;zl(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return mv(Oi(m=p.call.apply(p,[this].concat(A))),"modelType",lo.POLYLINE_EDGE),mv(Oi(m),"draggingPointList",void 0),dl(Oi(m),"dbClickPosition",vv,Oi(m)),m}return u=y,(d=[{key:"initEdgeData",value:function(m){this.offset=30,$f(nl(y.prototype),"initEdgeData",this).call(this,m)}},{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.polyline;return Ci(Ci({},$f(nl(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){var m,_=(m=this.text)===null||m===void 0?void 0:m.value;if(this.dbClickPosition&&!_){var A=this.dbClickPosition;return{x:A.x,y:A.y}}var N=jr(this.points),U=Bf(Or(N),2),H=U[0],oe=U[1];return{x:(H.x+oe.x)/2,y:(H.y+oe.y)/2}}},{key:"getAfterAnchor",value:function(m,_,A){var N,U;return A.forEach((function(H){var oe;m===ti.HORIZONTAL?oe=Math.abs(_.y-H.y):m===ti.VERTICAL&&(oe=Math.abs(_.x-H.x)),(!U||U>oe)&&(U=oe,N=H)})),N}},{key:"getCrossPoint",value:function(m,_,A){var N;return m===ti.HORIZONTAL?N={x:A.x,y:_.y}:m===ti.VERTICAL&&(N={x:_.x,y:A.y}),N}},{key:"removeCrossPoints",value:function(m,_,A){var N=A.map((function(xt){return xt}));if(m===1){var U=N[m],H=N[_],oe=N[m-1];if(Fr(oe,U,this.sourceNode)){if(Qr(U,H,this.sourceNode)){var ue=ki(U,H,this.sourceNode);ue&&(N[m]=ue,N.splice(m-1,1),m--,_--)}}else this.sourceNode.anchors.forEach((function(xt){(xt.x===oe.x&&xt.x===U.x||xt.y===oe.y&&xt.y===U.y)&&ms(xt.x,xt.y,U.x,U.y)<ms(oe.x,oe.y,U.x,U.y)&&(N[m-1]=xt)}))}if(_===A.length-2){var Ce=N[m],Ve=N[_],qe=N[_+1];if(Fr(Ve,qe,this.targetNode)){if(Qr(Ce,Ve,this.targetNode)){var Ot=ki(Ce,Ve,this.targetNode);Ot&&(N[_]=Ot,N.splice(_+1,1))}}else this.targetNode.anchors.forEach((function(xt){(xt.x===qe.x&&xt.x===Ve.x||xt.y===qe.y&&xt.y===Ve.y)&&ms(xt.x,xt.y,Ve.x,Ve.y)<ms(qe.x,qe.y,Ve.x,Ve.y)&&(N[_+1]=xt)}))}return N}},{key:"getDraggingPoints",value:function(m,_,A,N,U){var H=U.map((function(Ce){return Ce})),oe=this.getAfterAnchor(m,A,N),ue=this.getCrossPoint(m,A,oe);return _==="start"?(H.unshift(ue),H.unshift(oe)):(H.push(ue),H.push(oe)),H}},{key:"updateCrossPoints",value:function(m){var _=m.map((function(hn){return hn})),A=m[0],N=m[1],U=m[_.length-2],H=m[_.length-1],oe=this.sourceNode,ue=this.targetNode,Ce=oe.modelType,Ve=ue.modelType,qe=Si(A,N),Ot=_[0];switch(Ce){case lo.RECT_NODE:oe.radius!==0&&(kf(A,oe)||(Ot=Nf(A,qe,oe)));break;case lo.CIRCLE_NODE:Ot=Ac(A,qe,oe);break;case lo.ELLIPSE_NODE:Ot=Ed(A,qe,oe);break;case lo.DIAMOND_NODE:case lo.POLYGON_NODE:Ot=Pf(A,qe,oe)}Ot&&(_[0]=Ot);var xt=Si(U,H),Ft=_[_.length-1];switch(Ve){case lo.RECT_NODE:ue.radius!==0&&(kf(H,ue)||(Ft=Nf(H,xt,ue)));break;case lo.CIRCLE_NODE:Ft=Ac(H,xt,ue);break;case lo.ELLIPSE_NODE:Ft=Ed(H,xt,ue);break;case lo.DIAMOND_NODE:case lo.POLYGON_NODE:Ft=Pf(H,xt,ue)}return Ft&&(_[_.length-1]=Ft),_}},{key:"getData",value:function(){var m=$f(nl(y.prototype),"getData",this).call(this),_=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Object.assign({},m,{pointsList:_})}},{key:"initPoints",value:function(){this.pointsList.length>0?this.points=this.pointsList.map((function(m){return"".concat(m.x,",").concat(m.y)})).join(" "):this.updatePoints()}},{key:"updatePoints",value:function(){var m=$r({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=m,this.points=m.map((function(_){return"".concat(_.x,",").concat(_.y)})).join(" ")}},{key:"updateStartPoint",value:function(m){this.startPoint=Object.assign({},m),this.updatePoints()}},{key:"moveStartPoint",value:function(m,_){this.startPoint.x+=m,this.startPoint.y+=_,this.updatePoints()}},{key:"updateEndPoint",value:function(m){this.endPoint=Object.assign({},m),this.updatePoints()}},{key:"moveEndPoint",value:function(m,_){this.endPoint.x+=m,this.endPoint.y+=_,this.updatePoints()}},{key:"updatePointsList",value:function(m,_){this.pointsList.forEach((function(U){U.x+=m,U.y+=_}));var A=this.pointsList[0];this.startPoint=Object.assign({},A);var N=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},N),this.initPoints()}},{key:"dragAppendStart",value:function(){this.draggingPointList=this.pointsList.map((function(m){return m}))}},{key:"dragAppendSimple",value:function(m,_){this.isDragging=!0;var A=m.start,N=m.end,U=m.startIndex,H=m.endIndex,oe=m.direction,ue=this.pointsList,Ce=ue;return oe===ti.HORIZONTAL?(ue[U]={x:A.x,y:A.y+_.y},ue[H]={x:N.x,y:N.y+_.y},Ce=this.pointsList.map((function(Ve){return Ve}))):oe===ti.VERTICAL&&(ue[U]={x:A.x+_.x,y:A.y},ue[H]={x:N.x+_.x,y:N.y},Ce=this.pointsList.map((function(Ve){return Ve}))),this.updatePointsAfterDrag(Ce),this.draggingPointList=Ce,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[U]),end:Object.assign({},ue[H]),startIndex:U,endIndex:H,direction:oe}}},{key:"dragAppend",value:function(m,_){this.isDragging=!0;var A=m.start,N=m.end,U=m.startIndex,H=m.endIndex,oe=m.direction,ue=this.pointsList;if(oe===ti.HORIZONTAL){ue[U]={x:A.x,y:A.y+_.y},ue[H]={x:N.x,y:N.y+_.y};var Ce=this.pointsList.map((function(Vn){return Vn}));if(U!==0&&H!==this.pointsList.length-1&&(Ce=this.removeCrossPoints(U,H,Ce)),U===0){var Ve={x:A.x,y:A.y+_.y};if(!Du(Ve,this.sourceNode)){var qe=this.sourceNode.anchors;Ce=this.getDraggingPoints(oe,"start",Ve,qe,Ce)}}if(H===this.pointsList.length-1){var Ot={x:N.x,y:N.y+_.y};if(!Du(Ot,this.targetNode)){var xt=this.targetNode.anchors;Ce=this.getDraggingPoints(oe,"end",Ot,xt,Ce)}}this.updatePointsAfterDrag(Ce),this.draggingPointList=Ce}else if(oe===ti.VERTICAL){ue[U]={x:A.x+_.x,y:A.y},ue[H]={x:N.x+_.x,y:N.y};var Ft=this.pointsList.map((function(Vn){return Vn}));if(U!==0&&H!==this.pointsList.length-1&&(Ft=this.removeCrossPoints(U,H,Ft)),U===0){var hn={x:A.x+_.x,y:A.y};if(!Du(hn,this.sourceNode)){var Hn=this.sourceNode.anchors;Ft=this.getDraggingPoints(oe,"start",hn,Hn,Ft)}}if(H===this.pointsList.length-1){var zn={x:N.x+_.x,y:N.y};if(!Du(zn,this.targetNode)){var Ar=this.targetNode.anchors;Ft=this.getDraggingPoints(oe,"end",zn,Ar,Ft)}}this.updatePointsAfterDrag(Ft),this.draggingPointList=Ft}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[U]),end:Object.assign({},ue[H]),startIndex:U,endIndex:H,direction:oe}}},{key:"dragAppendEnd",value:function(){if(this.draggingPointList){var m=Un(jr(this.points));this.pointsList=m.map((function(N){return N})),this.draggingPointList=[];var _=m[0];this.startPoint=Object.assign({},_);var A=m[m.length-1];this.endPoint=Object.assign({},A)}this.isDragging=!1}},{key:"updatePointsAfterDrag",value:function(m){var _=this.updateCrossPoints(m);this.points=_.map((function(A){return"".concat(A.x,",").concat(A.y)})).join(" ")}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var m=this.pointsList;return m[m.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(m){var _=m.startPoint,A=m.endPoint,N=m.sourceNode,U=m.targetNode,H=$r({x:_.x,y:_.y},{x:A.x,y:A.y},N,U,this.offset||0);this.pointsList=H,this.initPoints()}}])&&by(u.prototype,d),y})(If),vv=Ea(Er.prototype,"dbClickPosition",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ea(Er.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"initPoints"),Er.prototype),Ea(Er.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePoints"),Er.prototype),Ea(Er.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateStartPoint"),Er.prototype),Ea(Er.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"moveStartPoint"),Er.prototype),Ea(Er.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateEndPoint"),Er.prototype),Ea(Er.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"moveEndPoint"),Er.prototype),Ea(Er.prototype,"updatePointsList",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePointsList"),Er.prototype),Ea(Er.prototype,"dragAppendStart",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendStart"),Er.prototype),Ea(Er.prototype,"dragAppendSimple",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendSimple"),Er.prototype),Ea(Er.prototype,"dragAppend",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppend"),Er.prototype),Ea(Er.prototype,"dragAppendEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendEnd"),Er.prototype),Ea(Er.prototype,"updatePointsAfterDrag",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePointsAfterDrag"),Er.prototype),Ea(Er.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"getAdjustStart"),Er.prototype),Ea(Er.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"getAdjustEnd"),Er.prototype),Ea(Er.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateAfterAdjustStartAndEnd"),Er.prototype),Er),kc=function(c){var u=c.start,d=c.end,p=c.offset,y=c.verticalLength,m=c.type,_={leftX:0,leftY:0,rightX:0,rightY:0},A=Math.atan((d.y-u.y)/(d.x-u.x)),N=Math.atan(p/y),U=Math.sqrt(y*y+p*p);return m==="start"?d.x>=u.x?(_.leftX=u.x+U*Math.sin(A+N),_.leftY=u.y-U*Math.cos(A+N),_.rightX=u.x-U*Math.sin(A-N),_.rightY=u.y+U*Math.cos(A-N)):(_.leftX=u.x-U*Math.sin(A+N),_.leftY=u.y+U*Math.cos(A+N),_.rightX=u.x+U*Math.sin(A-N),_.rightY=u.y-U*Math.cos(A-N)):m==="end"&&(d.x>=u.x?(_.leftX=d.x+U*Math.sin(A-N),_.leftY=d.y-U*Math.cos(A-N),_.rightX=d.x-U*Math.sin(A+N),_.rightY=d.y+U*Math.cos(A+N)):(_.leftX=d.x-U*Math.sin(A-N),_.leftY=d.y+U*Math.cos(A-N),_.rightX=d.x+U*Math.sin(A+N),_.rightY=d.y-U*Math.cos(A+N))),_},Uf={x:1,y:0,z:0};function Ni(c,u,d,p,y){for(var m=function(Ve){if(Ve<0||Ve>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:c.x*Math.pow(1-Ve,3)+3*u.x*Ve*Math.pow(1-Ve,2)+3*d.x*Math.pow(Ve,2)*(1-Ve)+p.x*Math.pow(Ve,3),y:c.y*Math.pow(1-Ve,3)+3*u.y*Ve*Math.pow(1-Ve,2)+3*d.y*Math.pow(Ve,2)*(1-Ve)+p.y*Math.pow(Ve,3)}},_=0,A=2,N=p.x,U=p.y,H=p;_<y&&A<50;){var oe=H=m(1-A/100),ue=oe.x,Ce=oe.y;_=ms(N,U,ue,Ce),A++}return H}function Bi(c){var u=Math.hypot(c.x,c.y);return{x:c.x/u,y:c.y/u,z:0}}function Jp(c){return p=(function(m,_){return m.x*_.y-m.y*_.x})(u=Uf,d=c),y=Math.acos((function(m,_){var A=[m.x,m.y,m.z];return[_.x,_.y,_.z].reduce((function(N,U,H){return N+U*A[H]}))})(Bi(u),Bi(d))),p>=0?y:-y;var u,d,p,y}function gv(c){return c*(180/Math.PI)}function K(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function me(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?K(Object(d),!0).forEach((function(p){Ie(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):K(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Ie(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function wt(c){return(function(u){if(Array.isArray(u))return tn(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||Nt(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Dt(c){return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Dt(c)}function yt(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||Nt(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Nt(c,u){if(c){if(typeof c=="string")return tn(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?tn(c,u):void 0}}function tn(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var sn=function(c,u){var d;switch(c.type){case"line":default:d=new Od(c,u);break;case"polyline":d=new Cl(c,u)}return d},nn=function(c,u){return 2*Math.abs(c.centerX-u.centerX)<c.width+u.width&&2*Math.abs(c.centerY-u.centerY)<c.height+u.height},Mt=function(c){var u=[],d={};return c.forEach((function(p){var y="".concat(p.x,"-").concat(p.y);p.id=y,d[y]=p})),Object.keys(d).forEach((function(p){u.push(d[p])})),u},bn=function(c,u){var d=[c,{x:c.x,y:u.y},u];return Mt(d)},pn=function(c,u){return c.width===0&&c.height===0?c:{centerX:c.centerX,centerY:c.centerY,minX:c.minX-u,minY:c.minY-u,maxX:c.maxX+u,maxY:c.maxY+u,height:c.height+2*u,width:c.width+2*u}},rn=function(c,u){var d=Math.abs(c.x-u.centerX),p=Math.abs(c.y-u.centerY);return d/u.width>p/u.height?ti.HORIZONTAL:ti.VERTICAL},Gt=function(c,u,d){return rn(d,u)===ti.HORIZONTAL?{x:d.x>c.centerX?c.maxX:c.minX,y:d.y}:{x:d.x,y:d.y>c.centerY?c.maxY:c.minY}},st=function(c,u){var d=Math.min(c.minX,u.minX),p=Math.min(c.minY,u.minY),y=Math.max(c.maxX,u.maxX),m=Math.max(c.maxY,u.maxY);return{centerX:(d+y)/2,centerY:(p+m)/2,minX:d,minY:p,maxX:y,maxY:m,height:m-p,width:y-d}},St=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=arguments.length>1?arguments[1]:void 0,d=[],p=[];c.forEach((function(H){d.push(H.x),p.push(H.y)}));var y=Math.min.apply(Math,d),m=Math.max.apply(Math,d),_=Math.min.apply(Math,p),A=Math.max.apply(Math,p),N=m-y,U=A-_;return u&&(N+=u,U+=u),{centerX:(y+m)/2,centerY:(_+A)/2,maxX:m,maxY:A,minX:y,minY:_,x:(y+m)/2,y:(_+A)/2,height:U,width:N}},ln=function(c){var u=c.minX,d=c.minY,p=c.maxX,y=c.maxY;return[{x:u,y:d},{x:p,y:d},{x:p,y},{x:u,y}]},Sn=function(c,u){var d=c.x,p=c.y;return d<u.minX||d>u.maxX||p<u.minY||p>u.maxY},Xt=function(c,u){return u<c.minX||u>c.maxX?[]:[{x:u,y:c.minY},{x:u,y:c.maxY}]},kn=function(c,u){return u<c.minY||u>c.maxY?[]:[{x:c.minX,y:u},{x:c.maxX,y:u}]},Kt=function(c,u){return Xt(c,u.x).concat(kn(c,u.y))},yn=function(c,u){return Math.abs(c.x-u.x)+Math.abs(c.y-u.y)},Yt=function(c,u){var d=0;return u.forEach((function(p){p&&(c.x===p.x&&(d+=-2),c.y===p.y&&(d+=-2))})),d},En=function(c,u,d,p,y){return yn(c,u)+yn(c,d)+Yt(c,[u,d,p,y])},ar=function c(u,d,p,y,m){m||(m=0),u.unshift(d[y]),p[y]&&p[y]!==y&&m<=100&&c(u,d,p,p[y],m+1)},xr=function(c,u){var d=c.indexOf(u);d>-1&&c.splice(d,1)},on=function(c,u,d,p){var y=u.x-c.x,m=u.y-c.y,_=p.x-d.x,A=p.y-d.y,N=(-m*(c.x-d.x)+y*(c.y-d.y))/(-_*m+y*A),U=(_*(c.y-d.y)-A*(c.x-d.x))/(-_*m+y*A);return N>=0&&N<=1&&U>=0&&U<=1},Zt=function(c,u,d){if(d.width===0&&d.height===0)return!1;var p=yt(ln(d),4),y=p[0],m=p[1],_=p[2],A=p[3];return on(c,u,y,m)||on(c,u,y,A)||on(c,u,m,_)||on(c,u,_,A)},Ht=function(c,u,d,p){var y=[];return c.forEach((function(m){m!==u&&(m.x!==u.x&&m.y!==u.y||Zt(m,u,d)||Zt(m,u,p)||y.push(m))})),Mt(y)},fr=function(c,u,d,p,y,m,_){var A=[],N=[u],U={},H={},oe={};H[u.id]=0,oe[u.id]=En(u,d,u);var ue={};c.forEach((function(qe){ue[qe.id]=qe}));for(var Ce=function(){var qe=void 0,Ot=1/0;if(N.forEach((function(Ft){oe[Ft.id]<Ot&&(Ot=oe[Ft.id],qe=Ft)})),qe===d){var xt=[];return ar(xt,ue,U,d.id),{v:xt}}xr(N,qe),A.push(qe),Ht(c,qe,p,y).forEach((function(Ft){if(A.indexOf(Ft)===-1){N.indexOf(Ft)===-1&&N.push(Ft);var hn=oe[qe.id]+yn(qe,Ft);H[Ft.id]&&hn>=H[Ft.id]||(U[Ft.id]=qe.id,H[Ft.id]=hn,oe[Ft.id]=H[Ft.id]+En(Ft,d,u,m,_))}}))};N.length;){var Ve=Ce();if(Dt(Ve)==="object")return Ve.v}return[u,d]},Dr=function(c){return gi(c)},Un=function(c){for(var u=1;u<c.length-1;){var d=c[u-1],p=c[u],y=c[u+1];d.x===p.x&&p.x===y.x||d.y===p.y&&p.y===y.y?c.splice(u,1):u++}return c},$r=function(c,u,d,p,y){var m=Dr(d),_=Dr(p),A=pn(m,y),N=pn(_,y),U=Gt(A,m,c),H=Gt(N,_,u);if(nn(A,N)){var oe=Wi(c,u,U,H);return[c,U].concat(wt(oe),[H,u])}var ue=St([U,H]),Ce=st(A,ue),Ve=st(N,ue),qe=[];qe=(qe=qe.concat(ln(Ce))).concat(ln(Ve));var Ot={x:(c.x+u.x)/2,y:(c.y+u.y)/2};[ue,Ce,Ve].forEach((function(Ft){qe=qe.concat(Kt(Ft,Ot).filter((function(hn){return Sn(hn,A)&&Sn(hn,N)})))})),[{x:U.x,y:H.y},{x:H.x,y:U.y}].forEach((function(Ft){Sn(Ft,A)&&Sn(Ft,N)&&qe.push(Ft)})),qe.unshift(U),qe.push(H),qe=Mt(qe);var xt=fr(qe,U,H,m,_,c,u);return xt.unshift(c),xt.push(u),xt.length>2&&(xt=Un(xt)),Mt(xt)},Or=function(c){var u;if(c.length===1)u=[c[0],c[0]];else if(c.length>=2){for(var d=c[0],p=c[1],y=ms(d.x,d.y,p.x,p.y),m=1;m<c.length-1;m++){var _=c[m],A=c[m+1],N=ms(_.x,_.y,A.x,A.y);N>y&&(y=N,d=_,p=A)}u=[d,p]}return u},Fr=function(c,u,d){var p=Du(c,d),y=Du(u,d);return p&&y},Qr=function(c,u,d){var p=Du(c,d),y=Du(u,d);return!(p&&y)&&(p||y)},ki=function(c,u,d){for(var p,y,m=gi(d),_=ln(m),A=0;A<_.length;A++)on(c,u,_[A],_[(A+1)%_.length])&&(y=[_[A],_[(A+1)%_.length]]);return y&&(p=(function(N,U,H,oe){var ue=(U.y-N.y)*(oe.x-H.x)-(N.x-U.x)*(H.y-oe.y);if(ue===0)return!1;var Ce=((U.x-N.x)*(oe.x-H.x)*(H.y-N.y)+(U.y-N.y)*(oe.x-H.x)*N.x-(oe.y-H.y)*(U.x-N.x)*H.x)/ue,Ve=-((U.y-N.y)*(oe.y-H.y)*(H.x-N.x)+(U.x-N.x)*(oe.y-H.y)*N.y-(oe.x-H.x)*(U.y-N.y)*H.y)/ue;return(Ce-N.x)*(Ce-U.x)<=0&&(Ve-N.y)*(Ve-U.y)<=0&&(Ce-H.x)*(Ce-oe.x)<=0&&(Ve-H.y)*(Ve-oe.y)<=0&&{x:Ce,y:Ve}})(c,u,y[0],y[1])),p},Si=function(c,u){var d;return c.x===u.x?d=ti.VERTICAL:c.y===u.y&&(d=ti.HORIZONTAL),d},jr=function(c){var u=c.split(" "),d=[];return u&&u.forEach((function(p){var y=yt(p.split(","),2),m=y[0],_=y[1];d.push({x:Number(m),y:Number(_)})})),d},Wi=function(c,u,d,p){var y=[];if(Si(c,d)===Si(u,p))c.y===d.y?(y.push({x:d.x,y:(d.y+p.y)/2}),y.push({x:p.x,y:(d.y+p.y)/2})):(y.push({x:(d.x+p.x)/2,y:d.y}),y.push({x:(d.x+p.x)/2,y:p.y}));else{var m={x:d.x,y:p.y},_=Ra(m,c,d),A=Ra(m,u,p);if(_||A)m={x:p.x,y:d.y};else{var N=Ko(m,c,d),U=Ko(m,u,p);N&&U&&(m={x:p.x,y:d.y})}y.push(m)}return y},Ko=function(c,u,d){return c.x===u.x&&c.x===d.x||c.y===u.y&&c.y===d.y},Pi=function(c){if(!c)return 0;for(var u=0,d=0;d<c.length;d++){var p=c.charCodeAt(d);c.match(/[A-Z]/)?u+=1.5:u+=p>=1&&p<=126||p>=65376&&p<=65439?1:2}return u},$i=null,Qi=function(c,u){$i||($i=document.createElement("canvas"));var d=$i.getContext("2d");return d.font=u,d.measureText(c).width},la=function(c){var u,d=c.start,p=c.end;if(d.x===p.x&&d.y===p.y)u="";else{var y={start:d,end:p,offset:10,verticalLength:5},m=kc(me(me({},y),{},{type:"start"})),_=kc(me(me({},y),{},{type:"end"}));u="M".concat(m.leftX," ").concat(m.leftY,`
|
||
L`).concat(m.rightX," ").concat(m.rightY,`
|
||
L`).concat(_.rightX," ").concat(_.rightY,`
|
||
L`).concat(_.leftX," ").concat(_.leftY," z")}return{d:u,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},zi=function(c){var u=c.start,d=c.end,p=c.sourceNode,y=c.targetNode,m=c.offset,_=gi(p),A=gi(y),N=pn(_,m),U=pn(A,m);return{sNext:Gt(N,_,u),ePre:Gt(U,A,d)}},di=function(c){var u=c.replace(/M/g,"").replace(/C/g,",").split(",");return[Cr(u[0]),Cr(u[1]),Cr(u[2]),Cr(u[3])]},Cr=function(c){var u=yt(c.replace(/(^\s*)/g,"").split(" "),2);return{x:+u[0],y:+u[1]}},sa=function(c,u){var d=yt(c,4);return[Ni(d[0],d[1],d[2],d[3],u),c[3]]},co=function(c,u){for(var d,p=c.x,y=c.y,m=jr(u),_=Number.MAX_SAFE_INTEGER,A=[],N=0;N<m.length;N++)A.push({start:m[N],end:m[(N+1)%m.length]});if(A.forEach((function(ue){var Ce=ue.start,Ve=ue.end;if(Ce.x===Ve.x){var qe={x:Ce.x,y};if(Ra(qe,Ce,Ve)){var Ot=Math.abs(Ce.x-p);Ot<_&&(_=Ot,d=qe)}}else if(Ce.y===Ve.y){var xt={x:p,y:Ce.y};if(Ra(xt,Ce,Ve)){var Ft=Math.abs(Ce.y-y);Ft<_&&(_=Ft,d=xt)}}})),!d){var U=A[0],H=U.start,oe=U.end;d={x:H.x+(oe.x-H.x)/2,y:H.y+(oe.y-H.y)/2}}return d},cr=function(c){return cs(c,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Xr=function(c,u){return Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2))};function Nr(c,u){return typeof u!="function"?function(d,p,y){return Object.assign({type:c.edgeType},y)}:function(d,p,y){var m=u(d,p,y);return m?typeof m=="string"?Object.assign({},y,{type:m}):Object.assign({type:m},y):{type:c.edgeType}}}r(208);var fi=function(){};function $s(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function yi(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Te=(function(){function c(p){var y=this,m=p.onDragStart,_=m===void 0?fi:m,A=p.onDragging,N=A===void 0?fi:A,U=p.onDragEnd,H=U===void 0?fi:U,oe=p.eventType,ue=oe===void 0?"":oe,Ce=p.eventCenter,Ve=Ce===void 0?null:Ce,qe=p.step,Ot=qe===void 0?1:qe,xt=p.isStopPropagation,Ft=xt===void 0||xt,hn=p.model,Hn=hn===void 0?null:hn,zn=p.data,Ar=zn===void 0?null:zn;(function(Vn,vr){if(!(Vn instanceof vr))throw new TypeError("Cannot call a class as a function")})(this,c),yi(this,"onDragStart",void 0),yi(this,"onDragging",void 0),yi(this,"onDragEnd",void 0),yi(this,"step",void 0),yi(this,"isStopPropagation",void 0),yi(this,"isDragging",!1),yi(this,"isStartDragging",!1),yi(this,"startX",0),yi(this,"startY",0),yi(this,"sumDeltaX",0),yi(this,"sumDeltaY",0),yi(this,"eventType",void 0),yi(this,"eventCenter",void 0),yi(this,"model",void 0),yi(this,"data",void 0),yi(this,"startTime",void 0),yi(this,"handleMouseDown",(function(Vn){var vr,er,Eo,Co=(vr=window)===null||vr===void 0?void 0:vr.document;if(Vn.button===0){y.isStopPropagation&&Vn.stopPropagation(),y.isStartDragging=!0,y.startX=Vn.clientX,y.startY=Vn.clientY,Co.addEventListener("mousemove",y.handleMouseMove,!1),Co.addEventListener("mouseup",y.handleMouseUp,!1);var zr=(er=y.model)===null||er===void 0?void 0:er.getData();(Eo=y.eventCenter)===null||Eo===void 0||Eo.emit(ur["".concat(y.eventType,"_MOUSEDOWN")],{e:Vn,data:y.data||zr}),y.startTime=new Date().getTime()}})),yi(this,"handleMouseMove",(function(Vn){if(y.isStopPropagation&&Vn.stopPropagation(),y.isStartDragging&&(y.sumDeltaX+=Vn.clientX-y.startX,y.sumDeltaY+=Vn.clientY-y.startY,y.startX=Vn.clientX,y.startY=Vn.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var vr,er=y.sumDeltaX%y.step,Eo=y.sumDeltaY%y.step,Co=y.sumDeltaX-er,zr=y.sumDeltaY-Eo;y.sumDeltaX=er,y.sumDeltaY=Eo;var Fo,ga=(vr=y.model)===null||vr===void 0?void 0:vr.getData();y.isDragging||((Fo=y.eventCenter)===null||Fo===void 0||Fo.emit(ur["".concat(y.eventType,"_DRAGSTART")],{e:Vn,data:y.data||ga}),y.onDragStart({event:Vn})),y.isDragging=!0,Promise.resolve().then((function(){var ya,Nl;y.onDragging({deltaX:Co,deltaY:zr,event:Vn}),(ya=y.eventCenter)===null||ya===void 0||ya.emit(ur["".concat(y.eventType,"_MOUSEMOVE")],{e:Vn,data:y.data||ga}),(Nl=y.eventCenter)===null||Nl===void 0||Nl.emit(ur["".concat(y.eventType,"_DRAG")],{e:Vn,data:y.data||ga})}))}})),yi(this,"handleMouseUp",(function(Vn){var vr=window.document;y.isStartDragging=!1,y.isStopPropagation&&Vn.stopPropagation(),Promise.resolve().then((function(){var er,Eo,Co;vr.removeEventListener("mousemove",y.handleMouseMove,!1),vr.removeEventListener("mouseup",y.handleMouseUp,!1);var zr=(er=y.model)===null||er===void 0?void 0:er.getData();(Eo=y.eventCenter)===null||Eo===void 0||Eo.emit(ur["".concat(y.eventType,"_MOUSEUP")],{e:Vn,data:y.data||zr}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:Vn}),(Co=y.eventCenter)===null||Co===void 0||Co.emit(ur["".concat(y.eventType,"_DROP")],{e:Vn,data:y.data||zr}))}))})),yi(this,"cancelDrag",(function(){var Vn,vr=(Vn=window)===null||Vn===void 0?void 0:Vn.document;vr.removeEventListener("mousemove",y.handleMouseMove,!1),vr.removeEventListener("mouseup",y.handleMouseUp,!1),y.onDragEnd({event:null}),y.isDragging=!1})),this.onDragStart=_,this.onDragging=N,this.onDragEnd=H,this.step=Ot,this.isStopPropagation=Ft,this.eventType=ue,this.eventCenter=Ve,this.model=Hn,this.data=Ar}var u,d;return u=c,(d=[{key:"setStep",value:function(p){this.step=p}},{key:"setModel",value:function(p){this.model=p}}])&&$s(u.prototype,d),c})();function Et(c){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Et(c)}function _t(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Ln(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Wr(c,u,d){return u&&Ln(c.prototype,u),c}function xe(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&Qe(c,u)}function de(c){var u=We();return function(){var d,p=Ee(c);if(u){var y=Ee(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Ge(this,d)}}function Ge(c,u){if(u&&(Et(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tt(c)}function tt(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function ct(c){var u=typeof Map=="function"?new Map:void 0;return ct=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,y)}function y(){return Xe(d,arguments,Ee(this).constructor)}return y.prototype=Object.create(d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),Qe(y,d)},ct(c)}function Xe(c,u,d){return Xe=We()?Reflect.construct:function(p,y,m){var _=[null];_.push.apply(_,y);var A=new(Function.bind.apply(p,_));return m&&Qe(A,m.prototype),A},Xe.apply(null,arguments)}function We(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function Qe(c,u){return Qe=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Qe(c,u)}function Ee(c){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ee(c)}function Ue(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function be(c,u){return c instanceof ot&&u instanceof ot}var nt=(function(c){xe(d,c);var u=de(d);function d(p,y,m){var _;return _t(this,d),Ue(tt(_=u.call(this,3)),"x",void 0),Ue(tt(_),"y",void 0),Ue(tt(_),"z",void 0),_[0]=p,_[1]=y,_[2]=m,_.x=p,_.y=y,_.z=m,Object.setPrototypeOf(tt(_),d.prototype),_}return Wr(d,[{key:"add",value:function(p){if(be(this,p))return new ot(this.x+p.x,this.y+p.y);var y=this.z+p.z;return new g((this.x+p.x)/y,(this.y+p.y)/y)}},{key:"subtract",value:function(p){if(be(this,p))return new ot(this.x-p.x,this.y-p.y);var y=this.z-p.z;return y===0?new ot(this.x-p.x,this.y-p.y):new g((this.x-p.x)/y,(this.y-p.y)/y)}}]),d})(ct(Array)),ot=(function(c){xe(d,c);var u=de(d);function d(p,y,m){var _;return _t(this,d),_=u.call(this,p,y,m??0),Object.setPrototypeOf(tt(_),d.prototype),_}return Wr(d,[{key:"toString",value:function(){return"Vector"}},{key:"dot",value:function(p){var y=this;return p.reduce((function(m,_,A){return m+_*y[A]}))}},{key:"cross",value:function(p){return new d(this.y*p.z-this.z*p.y,this.z*p.x-this.x*p.z,this.x*p.y-this.y*p.x)}},{key:"getLength",value:function(){return Math.hypot(this.x,this.y)}},{key:"normalize",value:function(){var p=this.getLength();return new d(this.x/p,this.y/p)}},{key:"crossZ",value:function(p){return this.x*p.y-this.y*p.x}},{key:"angle",value:function(p){var y=this.crossZ(p),m=Math.acos(this.normalize().dot(p.normalize()));return y>=0?m:-m}}]),d})(nt),g=(function(c){xe(d,c);var u=de(d);function d(p,y){var m;return _t(this,d),m=u.call(this,p,y,1),Object.setPrototypeOf(tt(m),d.prototype),m}return Wr(d,[{key:"toString",value:function(){return"Point"}}]),d})(nt);r(67),r(218);function x(c){return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},x(c)}function C(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||te(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function W(c){return(function(u){if(Array.isArray(u))return ce(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||te(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function te(c,u){if(c){if(typeof c=="string")return ce(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?ce(c,u):void 0}}function ce(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function Oe(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Fe(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function et(c,u,d){return u&&Fe(c.prototype,u),c}function jt(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&Tn(c,u)}function Vt(c){var u=an();return function(){var d,p=Br(c);if(u){var y=Br(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return gn(this,d)}}function gn(c,u){if(u&&(x(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yn(c)}function Yn(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Qn(c){var u=typeof Map=="function"?new Map:void 0;return Qn=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,y)}function y(){return Sr(d,arguments,Br(this).constructor)}return y.prototype=Object.create(d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),Tn(y,d)},Qn(c)}function Sr(c,u,d){return Sr=an()?Reflect.construct:function(p,y,m){var _=[null];_.push.apply(_,y);var A=new(Function.bind.apply(p,_));return m&&Tn(A,m.prototype),A},Sr.apply(null,arguments)}function an(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function Tn(c,u){return Tn=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Tn(c,u)}function Br(c){return Br=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Br(c)}function ir(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var at,Yr,Ao,Mr,Ur,xa,Hl,uu,Oa,Iu,Pc,Qp,yv,Fu=(function(c){jt(d,c);var u=Vt(d);function d(){var p;Oe(this,d);for(var y=arguments.length,m=new Array(y),_=0;_<y;_++)m[_]=arguments[_];return ir(Yn(p=u.call(this,m.length)),"rows",void 0),ir(Yn(p),"columns",void 0),p.fill(new Array(3)),m.forEach((function(A,N){p[N]=A})),p.columns=m[0].length,p.rows=m.length,Object.setPrototypeOf(Yn(p),d.prototype),p}return et(d,[{key:"getRow",value:function(p){return this[p]}},{key:"getColumn",value:function(p){return W(this.map((function(y){return y[p]})))}},{key:"transpose",value:function(){for(var p=[],y=0;y<this.columns;y++)p.push(this.getColumn(y));return Sr(d,p)}},{key:"cross",value:function(p){var y=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===p.rows)for(var m=0;m<this.rows;m++)for(var _=this.getRow(m),A=function(U){var H=p.getColumn(U);y[m][U]=_.reduce((function(oe,ue,Ce){return oe+ue*H[Ce]}),0)},N=0;N<p.columns;N++)A(N);return Sr(d,W(y))}},{key:"to2D",value:function(){return this.map((function(p){return[p[0],p[1]]}))}},{key:"toPoints",value:function(){return this.map((function(p){return new g(p[0],p[1])}))}},{key:"toString",value:function(){var p=C(this[0],2),y=p[0],m=p[1],_=C(this[1],2),A=_[0],N=_[1],U=C(this[2],2),H=U[0],oe=U[1];return"matrix(".concat(y," ").concat(m," ").concat(A," ").concat(N," ").concat(H," ").concat(oe,")")}},{key:"translate",value:function(p,y){return this.cross(new eh(p,y))}},{key:"rotate",value:function(p){return this.cross(new Sd(p))}},{key:"scale",value:function(p,y){return this.cross(new wy(p,y))}}]),d})(Qn(Array)),Sd=(function(c){jt(d,c);var u=Vt(d);function d(p){var y;return Oe(this,d),y=u.call(this,new ot(+Math.cos(p).toFixed(2),+Math.sin(p).toFixed(2),0),new ot(-Math.sin(p).toFixed(2),+Math.cos(p).toFixed(2),0),new ot(0,0,1)),Object.setPrototypeOf(Yn(y),d.prototype),y}return et(d,[{key:"inverse",value:function(){return this.transpose()}}]),d})(Fu),wy=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var m;return Oe(this,d),ir(Yn(m=u.call(this,new ot(p,0,0),new ot(0,y,0),new ot(0,0,1))),"sx",void 0),ir(Yn(m),"sy",void 0),m.sx=p,m.sy=y,Object.setPrototypeOf(Yn(m),d.prototype),m}return et(d,[{key:"inverse",value:function(){return new d(1/this.sx,1/this.sy)}}]),d})(Fu),eh=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var m;return Oe(this,d),ir(Yn(m=u.call(this,new ot(1,0,0),new ot(0,1,0),new ot(p,y,1))),"tx",void 0),ir(Yn(m),"ty",void 0),m.tx=p,m.ty=y,Object.setPrototypeOf(Yn(m),d.prototype),m}return et(d,[{key:"inverse",value:function(){return new d(-this.tx,-this.ty)}}]),d})(Fu),_v={node:!1,edge:!1},Ey={node:!0,edge:!0};function bv(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Vf(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?bv(Object(d),!0).forEach((function(p){Dc(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):bv(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Gf(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||wv(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Rc(c){return(function(u){if(Array.isArray(u))return mE(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||wv(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wv(c,u){if(c){if(typeof c=="string")return mE(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?mE(c,u):void 0}}function mE(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function pb(c){return pb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},pb(c)}function Bu(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function h5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Dc(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Tr(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var iT,aT=200,lT=(at=(function(){function c(p){(function(Ce,Ve){if(!(Ce instanceof Ve))throw new TypeError("Cannot call a class as a function")})(this,c),Dc(this,"rootEl",void 0),Bu(this,"width",Yr,this),Bu(this,"height",Ao,this),Dc(this,"theme",void 0),Dc(this,"eventCenter",void 0),Dc(this,"modelMap",new Map),Dc(this,"topElement",void 0),Dc(this,"animation",void 0),Dc(this,"idGenerator",void 0),Dc(this,"edgeGenerator",void 0),Dc(this,"nodeMoveRules",[]),Dc(this,"customTrajectory",void 0),Bu(this,"edgeType",Mr,this),Bu(this,"nodes",Ur,this),Bu(this,"edges",xa,this),Bu(this,"overlapMode",Hl,this),Bu(this,"background",uu,this),Bu(this,"transformModel",Oa,this),Bu(this,"editConfigModel",Iu,this),Bu(this,"gridSize",Pc,this),Bu(this,"partial",Qp,this),Bu(this,"fakerNode",yv,this);var y,m=p.container,_=p.background,A=_===void 0?{}:_,N=p.grid,U=p.idGenerator,H=p.edgeGenerator,oe=p.animation,ue=p.customTrajectory;this.background=A,pb(N)==="object"&&(this.gridSize=N.size),this.rootEl=m,this.editConfigModel=new Mp(p),this.eventCenter=new Bp,this.transformModel=new Jh(this.eventCenter,p),this.theme=iu(p.style),this.edgeType=p.edgeType||"polyline",this.width=p.width,this.height=p.height,this.animation=(y=oe)&&typeof y!="boolean"?bc(Uo(_v),y):Uo(y===!0?Ey:_v),this.partial=p.partial,this.overlapMode=p.overlapMode||0,this.idGenerator=U,this.customTrajectory=ue,this.edgeGenerator=Nr(this,H),this.width=p.width||this.rootEl.getBoundingClientRect().width,this.height=p.height||this.rootEl.getBoundingClientRect().height,this.flowId=tl()}var u,d;return u=c,d=[{key:"nodesMap",get:function(){return this.nodes.reduce((function(p,y,m){return p[y.id]={index:m,model:y},p}),{})}},{key:"edgesMap",get:function(){return this.edges.reduce((function(p,y,m){return p[y.id]={index:m,model:y},p}),{})}},{key:"modelsMap",get:function(){return[].concat(Rc(this.nodes),Rc(this.edges)).reduce((function(p,y){return p[y.id]=y,p}),{})}},{key:"sortElements",get:function(){var p=[];this.nodes.forEach((function(U){return p.push(U)})),this.edges.forEach((function(U){return p.push(U)})),p=p.sort((function(U,H){return U.zIndex-H.zIndex}));for(var y=[],m=[-200,-200],_=[this.width+aT,this.height+aT],A=0;A<p.length;A++){var N=p[A];N.visible&&(!this.partial||N.isSelected||this.isElementInArea(N,m,_,!1,!1))&&y.push(N)}return y}},{key:"textEditElement",get:function(){var p=this.nodes.find((function(m){return m.state===Io.TEXT_EDIT})),y=this.edges.find((function(m){return m.state===Io.TEXT_EDIT}));return p||y}},{key:"selectElements",get:function(){var p=new Map;return this.nodes.forEach((function(y){y.isSelected&&p.set(y.id,y)})),this.edges.forEach((function(y){y.isSelected&&p.set(y.id,y)})),p}},{key:"selectNodes",get:function(){var p=[];return this.nodes.forEach((function(y){y.isSelected&&p.push(y)})),p}},{key:"getAreaElement",value:function(p,y){var m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=arguments.length>4&&arguments[4]!==void 0&&arguments[4],N=[],U=[];this.nodes.forEach((function(ue){return U.push(ue)})),this.edges.forEach((function(ue){return U.push(ue)}));for(var H=0;H<U.length;H++){var oe=U[H];A&&!oe.visible||!this.isElementInArea(oe,p,y,m,_)||N.push(oe)}return N}},{key:"getModel",value:function(p){return this.modelMap.get(p)}},{key:"getNodeModelById",value:function(p){var y;return this.fakerNode&&p===this.fakerNode.id?this.fakerNode:(y=this.nodesMap[p])===null||y===void 0?void 0:y.model}},{key:"getPointByClient",value:function(p){var y=p.x,m=p.y,_=this.rootEl.getBoundingClientRect(),A={x:y-_.left,y:m-_.top},N=Gf(this.transformModel.HtmlPointToCanvasPoint([A.x,A.y]),2);return{domOverlayPosition:A,canvasOverlayPosition:{x:N[0],y:N[1]}}}},{key:"isElementInArea",value:function(p,y,m){var _=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(p.BaseType===ei.NODE){for(var N=gi(p=p),U=N.minX,H=N.minY,oe=N.maxX,ue=N.maxY,Ce=[{x:U,y:H},{x:oe,y:H},{x:oe,y:ue},{x:U,y:ue}],Ve=A,qe=0;qe<Ce.length;qe++){var Ot=Ce[qe],xt=Ot.x,Ft=Ot.y,hn=this.transformModel.CanvasPointToHtmlPoint([xt,Ft]),Hn=Gf(hn,2);if(xt=Hn[0],Ft=Hn[1],gd([xt,Ft],y,m)!==A){Ve=!A;break}}return Ve}if(p.BaseType===ei.EDGE){var zn=p=p,Ar=zn.startPoint,Vn=zn.endPoint,vr=this.transformModel.CanvasPointToHtmlPoint([Ar.x,Ar.y]),er=this.transformModel.CanvasPointToHtmlPoint([Vn.x,Vn.y]),Eo=gd(vr,y,m),Co=gd(er,y,m);return _?Eo&&Co:Eo||Co}return!1}},{key:"graphDataToModel",value:function(p){var y=this;if(this.width&&this.height||this.resize(),!p)return this.nodes=[],void(this.edges=[]);p.nodes?this.nodes=Ep(p.nodes,(function(m){return y.getModelAfterSnapToGrid(m)})):this.nodes=[],p.edges?this.edges=Ep(p.edges,(function(m){var _=y.getModel(m.type);if(!_)throw new Error("找不到".concat(m.type,"对应的边。"));return new _(m,y)})):this.edges=[]}},{key:"modelToGraphData",value:function(){var p=[];this.edges.forEach((function(m){var _=m.getData();_&&!m.virtual&&p.push(_)}));var y=[];return this.nodes.forEach((function(m){var _=m.getData();_&&!m.virtual&&y.push(_)})),{nodes:y,edges:p}}},{key:"modelToHistoryData",value:function(){for(var p=!1,y=[],m=0;m<this.nodes.length;m++){var _=this.nodes[m];if(_.isDragging){p=!0;break}y.push(_.getHistoryData())}if(p)return!1;for(var A=!1,N=[],U=0;U<this.edges.length;U++){var H=this.edges[U];if(H.isDragging){A=!0;break}N.push(H.getHistoryData())}return!A&&{nodes:y,edges:N}}},{key:"getEdgeModelById",value:function(p){var y;return(y=this.edgesMap[p])===null||y===void 0?void 0:y.model}},{key:"getElement",value:function(p){return this.modelsMap[p]}},{key:"getNodeEdges",value:function(p){for(var y=[],m=0;m<this.edges.length;m++){var _=this.edges[m],A=this.edges[m].sourceNodeId===p,N=this.edges[m].targetNodeId===p;(A||N)&&y.push(_)}return y}},{key:"getSelectElements",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],y=this.selectElements,m={nodes:[],edges:[]};return y.forEach((function(_){if(_.BaseType===ei.NODE&&m.nodes.push(_.getData()),_.BaseType===ei.EDGE){var A=_.getData(),N=y.get(A.sourceNodeId)&&y.get(A.targetNodeId);(p||N)&&m.edges.push(A)}})),m}},{key:"updateAttributes",value:function(p,y){this.getElement(p).updateAttributes(y)}},{key:"changeNodeId",value:function(p,y){return y||(y=tl()),this.nodesMap[y]?"":this.nodesMap[p]?(this.edges.forEach((function(m){m.sourceNodeId===p&&(m.sourceNodeId=y),m.targetNodeId===p&&(m.targetNodeId=y)})),this.nodesMap[p].model.id=y,this.nodesMap[y]=this.nodesMap[p],y):""}},{key:"changeEdgeId",value:function(p,y){return y||(y=tl()),this.edgesMap[y]?"":this.edgesMap[p]?(this.edges.forEach((function(m){m.id===p&&m.changeEdgeId(y)})),y):""}},{key:"setFakerNode",value:function(p){this.fakerNode=p}},{key:"removeFakerNode",value:function(){this.fakerNode=null}},{key:"setModel",value:function(p,y){return this.modelMap.set(p,y)}},{key:"toFront",value:function(p){var y,m,_,A=((y=this.nodesMap[p])===null||y===void 0?void 0:y.model)||((m=this.edgesMap[p])===null||m===void 0?void 0:m.model);A&&(this.overlapMode===Ei.DEFAULT&&((_=this.topElement)===null||_===void 0||_.setZIndex(),A.setZIndex(9999),this.topElement=A),this.overlapMode===Ei.INCREASE&&this.setElementZIndex(p,"top"))}},{key:"setElementZIndex",value:function(p,y){var m,_,A,N=((m=this.nodesMap[p])===null||m===void 0?void 0:m.model)||((_=this.edgesMap[p])===null||_===void 0?void 0:_.model);N&&(typeof y=="number"&&(A=y),y==="top"&&(A=Tc()),y==="bottom"&&(A=--jf),N.setZIndex(A))}},{key:"deleteNode",value:function(p){var y=this.nodesMap[p].model.getData();this.deleteEdgeBySource(p),this.deleteEdgeByTarget(p),this.nodes.splice(this.nodesMap[p].index,1),this.eventCenter.emit(ur.NODE_DELETE,{data:y})}},{key:"addNode",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,m=arguments.length>2?arguments[2]:void 0,_=ma(p);_.id&&this.nodesMap[p.id]&&delete _.id;var A=this.getModelAfterSnapToGrid(_);this.nodes.push(A);var N=A.getData(),U={data:N};return m&&(U.e=m),this.eventCenter.emit(y,U),A}},{key:"getModelAfterSnapToGrid",value:function(p){var y=this.getModel(p.type);if(!y)throw new Error("找不到".concat(p.type,"对应的节点,请确认是否已注册此类型节点。"));var m=p.x,_=p.y;return m&&_&&(p.x=fs(m,this.gridSize),p.y=fs(_,this.gridSize),pb(p.text)==="object"&&(p.text.x+=p.x-m,p.text.y+=p.y-_)),new y(p,this)}},{key:"cloneNode",value:function(p){var y=this.getNodeModelById(p),m=y.getData();m.x+=30,m.y+=30,delete m.id,m.text&&(m.text.x+=30,m.text.y+=30);var _=this.addNode(m);return _.setSelected(!0),y.setSelected(!1),_.getData()}},{key:"moveNode",value:function(p,y,m){var _=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,U=N.getMoveDistance(y,m,_),H=Gf(U,2);y=H[0],m=H[1],this.moveEdge(p,y,m)}}},{key:"moveNode2Coordinate",value:function(p,y,m){var _=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,U=N.x,H=N.y,oe=y-U,ue=m-H;this.moveNode(p,oe,ue,_)}}},{key:"editText",value:function(p){this.setElementStateById(p,Io.TEXT_EDIT)}},{key:"addEdge",value:function(p){var y=ma(p),m=y.type;m||(m=this.edgeType),y.id&&this.edgesMap[y.id]&&delete y.id;var _=this.getModel(m);if(!_)throw new Error("找不到".concat(m,"对应的边,请确认是否已注册此类型边。"));var A=new _(Vf(Vf({},y),{},{type:m}),this),N=A.getData();return this.edges.push(A),this.eventCenter.emit(ur.EDGE_ADD,{data:N}),A}},{key:"moveEdge",value:function(p,y,m){for(var _=0;_<this.edges.length;_++){var A=this.edges[_],N=A.textPosition,U=N.x,H=N.y,oe=this.edges[_].sourceNodeId===p,ue=this.edges[_].targetNodeId===p;oe&&A.moveStartPoint(y,m),ue&&A.moveEndPoint(y,m),(oe||ue)&&this.handleEdgeTextMove(A,U,H)}}},{key:"handleEdgeTextMove",value:function(p,y,m){var _;if(p.customTextPosition===!0)p.resetTextPosition();else if(p.modelType===lo.POLYLINE_EDGE&&(_=p.text)!==null&&_!==void 0&&_.value){var A=p.text,N=co(A,p.points);p.moveText(N.x-A.x,N.y-A.y)}else{var U=p.textPosition,H=U.x,oe=U.y;p.moveText(H-y,oe-m)}}},{key:"deleteEdgeBySourceAndTarget",value:function(p,y){for(var m=0;m<this.edges.length;m++)if(this.edges[m].sourceNodeId===p&&this.edges[m].targetNodeId===y){var _=this.edges[m].getData();this.edges.splice(m,1),m--,this.eventCenter.emit(ur.EDGE_DELETE,{data:_})}}},{key:"deleteEdgeById",value:function(p){if(this.edgesMap[p]){var y=this.edgesMap[p].index,m=this.edgesMap[p].model.getData();this.edges.splice(y,1),this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeBySource",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].sourceNodeId===p){var m=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeByTarget",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].targetNodeId===p){var m=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"setElementStateById",value:function(p,y,m){this.nodes.forEach((function(_){_.id===p?_.setElementState(y,m):_.setElementState(Io.DEFAULT)})),this.edges.forEach((function(_){_.id===p?_.setElementState(y,m):_.setElementState(Io.DEFAULT)}))}},{key:"updateText",value:function(p,y){this.nodes.forEach((function(m){m.id===p&&m.updateText(y)})),this.edges.forEach((function(m){m.id===p&&m.updateText(y)}))}},{key:"selectNodeById",value:function(p){var y,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];m||this.clearSelectElements();var _=(y=this.nodesMap[p])===null||y===void 0?void 0:y.model;_==null||_.setSelected(!0)}},{key:"selectEdgeById",value:function(p){var y,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];m||this.clearSelectElements();var _=(y=this.edgesMap[p])===null||y===void 0?void 0:y.model;_==null||_.setSelected(!0)}},{key:"selectElementById",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0&&arguments[1];y||this.clearSelectElements();var m=this.getElement(p);m==null||m.setSelected(!0)}},{key:"clearSelectElements",value:function(){var p;this.selectElements.forEach((function(y){y==null||y.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Ei.DEFAULT&&((p=this.topElement)===null||p===void 0||p.setZIndex())}},{key:"moveNodes",value:function(p,y,m){for(var _=this,A=arguments.length>3&&arguments[3]!==void 0&&arguments[3],N=p.reduce((function(zn,Ar){var Vn=_.nodesMap[Ar].model.getMoveDistance(y,m,A);return zn[Ar]=Vn,zn}),{}),U=0;U<this.edges.length;U++){var H=this.edges[U],oe=H.textPosition,ue=oe.x,Ce=oe.y,Ve=N[H.sourceNodeId],qe=N[H.targetNodeId],Ot=void 0,xt=void 0;if(Ve&&qe&&H.modelType===lo.POLYLINE_EDGE){var Ft=Gf(Ve,2);Ot=Ft[0],xt=Ft[1],H.updatePointsList(Ot,xt)}else{if(Ve){var hn=Gf(Ve,2);Ot=hn[0],xt=hn[1],H.moveStartPoint(Ot,xt)}if(qe){var Hn=Gf(qe,2);Ot=Hn[0],xt=Hn[1],H.moveEndPoint(Ot,xt)}}(Ve||qe)&&this.handleEdgeTextMove(H,ue,Ce)}}},{key:"addNodeMoveRules",value:function(p){this.nodeMoveRules.includes(p)||this.nodeMoveRules.push(p)}},{key:"setDefaultEdgeType",value:function(p){this.edgeType=p}},{key:"changeNodeType",value:function(p,y){var m=this.getNodeModelById(p);if(m){var _=m.getData();_.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));var N=new A(_,this);this.nodes.splice(this.nodesMap[p].index,1,N),this.getNodeEdges(p).forEach((function(U){if(U.sourceNodeId===p){var H=Rf(N,U.startPoint,N.width,N.height);U.updateStartPoint(H)}if(U.targetNodeId===p){var oe=Rf(N,U.endPoint,N.width,N.height);U.updateEndPoint(oe)}}))}}},{key:"changeEdgeType",value:function(p,y){var m=this.getEdgeModelById(p);if(m&&m.type!==y){var _=m.getData();_.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));delete _.pointsList;var N=new A(_,this);this.edges.splice(this.edgesMap[p].index,1,N)}}},{key:"getNodeIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.targetNodeId===p&&y.push(m)})),y}},{key:"getNodeOutgoingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.sourceNodeId===p&&y.push(m)})),y}},{key:"getAnchorIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.targetAnchorId===p&&y.push(m)})),y}},{key:"getAnchorOutcomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.sourceAnchorId===p&&y.push(m)})),y}},{key:"getNodeIncomingNode",value:function(p){var y=this,m=[];return this.edges.forEach((function(_){_.targetNodeId===p&&m.push(y.nodesMap[_.sourceNodeId].model)})),m}},{key:"getNodeOutgoingNode",value:function(p){var y=this,m=[];return this.edges.forEach((function(_){_.sourceNodeId===p&&m.push(y.nodesMap[_.targetNodeId].model)})),m}},{key:"setTheme",value:function(p){this.theme=iu(Vf(Vf({},this.theme),p))}},{key:"resize",value:function(p,y){this.width=p||this.rootEl.getBoundingClientRect().width,this.height=y||this.rootEl.getBoundingClientRect().height,!this.width||this.height}},{key:"clearData",value:function(){this.nodes=[],this.edges=[]}},{key:"getVirtualRectSize",value:function(){var p=this.nodes,y=[],m=[];p.forEach((function(oe){var ue=oe.x,Ce=oe.y,Ve=oe.width,qe=oe.height,Ot=oe.getNodeStyle().strokeWidth,xt=Ot===void 0?0:Ot,Ft=ue+Ve/2+xt,hn=ue-Ve/2-xt,Hn=Ce+qe/2+xt,zn=Ce-qe/2-xt;y=y.concat([Ft,hn].filter((function(Ar){return!Number.isNaN(Ar)}))),m=m.concat([Hn,zn].filter((function(Ar){return!Number.isNaN(Ar)})))}));var _=Math.min.apply(Math,Rc(y)),A=Math.max.apply(Math,Rc(y)),N=Math.min.apply(Math,Rc(m)),U=A-_||0,H=Math.max.apply(Math,Rc(m))-N||0;return{virtualRectWidth:U,virtualRectHeight:H,virtualRectCenterPositionX:_+U/2,virtualRectCenterPositionY:N+H/2}}},{key:"translateCenter",value:function(){var p=this.nodes,y=this.width,m=this.height,_=this.rootEl,A=this.transformModel;if(p.length){var N=y||_.clientWidth,U=m||_.clientHeight,H=this.getVirtualRectSize(),oe=H.virtualRectCenterPositionX,ue=H.virtualRectCenterPositionY;A.focusOn(oe,ue,N,U)}}},{key:"fitView",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,m=this.nodes,_=this.width,A=this.height,N=this.rootEl,U=this.transformModel;if(m.length){var H=_||N.clientWidth,oe=A||N.clientHeight,ue=this.getVirtualRectSize(),Ce=ue.virtualRectWidth,Ve=ue.virtualRectHeight,qe=ue.virtualRectCenterPositionX,Ot=ue.virtualRectCenterPositionY,xt=(Ce+y)/H,Ft=(Ve+p)/oe,hn=0;hn=1/Math.max(xt,Ft);var Hn=[H/2,oe/2];U.zoom(hn,Hn),U.focusOn(qe,Ot,H,oe)}}},{key:"openEdgeAnimation",value:function(p){this.getEdgeModelById(p).openEdgeAnimation()}},{key:"closeEdgeAnimation",value:function(p){this.getEdgeModelById(p).closeEdgeAnimation()}}],d&&h5(u.prototype,d),c})(),Yr=Tr(at.prototype,"width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ao=Tr(at.prototype,"height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mr=Tr(at.prototype,"edgeType",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ur=Tr(at.prototype,"nodes",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),xa=Tr(at.prototype,"edges",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Hl=Tr(at.prototype,"overlapMode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Ei.DEFAULT}}),uu=Tr(at.prototype,"background",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oa=Tr(at.prototype,"transformModel",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Iu=Tr(at.prototype,"editConfigModel",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pc=Tr(at.prototype,"gridSize",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Qp=Tr(at.prototype,"partial",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yv=Tr(at.prototype,"fakerNode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tr(at.prototype,"nodesMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"nodesMap"),at.prototype),Tr(at.prototype,"edgesMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"edgesMap"),at.prototype),Tr(at.prototype,"modelsMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"modelsMap"),at.prototype),Tr(at.prototype,"sortElements",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"sortElements"),at.prototype),Tr(at.prototype,"textEditElement",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"textEditElement"),at.prototype),Tr(at.prototype,"selectElements",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"selectElements"),at.prototype),Tr(at.prototype,"selectNodes",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"selectNodes"),at.prototype),Tr(at.prototype,"setFakerNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setFakerNode"),at.prototype),Tr(at.prototype,"removeFakerNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"removeFakerNode"),at.prototype),Tr(at.prototype,"setModel",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setModel"),at.prototype),Tr(at.prototype,"toFront",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"toFront"),at.prototype),Tr(at.prototype,"setElementZIndex",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setElementZIndex"),at.prototype),Tr(at.prototype,"deleteNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteNode"),at.prototype),Tr(at.prototype,"addNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"addNode"),at.prototype),Tr(at.prototype,"cloneNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"cloneNode"),at.prototype),Tr(at.prototype,"moveNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNode"),at.prototype),Tr(at.prototype,"moveNode2Coordinate",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNode2Coordinate"),at.prototype),Tr(at.prototype,"editText",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"editText"),at.prototype),Tr(at.prototype,"addEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"addEdge"),at.prototype),Tr(at.prototype,"moveEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveEdge"),at.prototype),Tr(at.prototype,"deleteEdgeBySourceAndTarget",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeBySourceAndTarget"),at.prototype),Tr(at.prototype,"deleteEdgeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeById"),at.prototype),Tr(at.prototype,"deleteEdgeBySource",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeBySource"),at.prototype),Tr(at.prototype,"deleteEdgeByTarget",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeByTarget"),at.prototype),Tr(at.prototype,"setElementStateById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setElementStateById"),at.prototype),Tr(at.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"updateText"),at.prototype),Tr(at.prototype,"selectNodeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectNodeById"),at.prototype),Tr(at.prototype,"selectEdgeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectEdgeById"),at.prototype),Tr(at.prototype,"selectElementById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectElementById"),at.prototype),Tr(at.prototype,"clearSelectElements",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"clearSelectElements"),at.prototype),Tr(at.prototype,"moveNodes",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNodes"),at.prototype),Tr(at.prototype,"setDefaultEdgeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setDefaultEdgeType"),at.prototype),Tr(at.prototype,"changeNodeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"changeNodeType"),at.prototype),Tr(at.prototype,"changeEdgeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"changeEdgeType"),at.prototype),Tr(at.prototype,"getNodeIncomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeIncomingEdge"),at.prototype),Tr(at.prototype,"getNodeOutgoingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeOutgoingEdge"),at.prototype),Tr(at.prototype,"getAnchorIncomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getAnchorIncomingEdge"),at.prototype),Tr(at.prototype,"getAnchorOutcomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getAnchorOutcomingEdge"),at.prototype),Tr(at.prototype,"getNodeIncomingNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeIncomingNode"),at.prototype),Tr(at.prototype,"getNodeOutgoingNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeOutgoingNode"),at.prototype),Tr(at.prototype,"setTheme",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setTheme"),at.prototype),Tr(at.prototype,"resize",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"resize"),at.prototype),Tr(at.prototype,"clearData",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"clearData"),at.prototype),Tr(at.prototype,"translateCenter",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"translateCenter"),at.prototype),Tr(at.prototype,"fitView",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"fitView"),at.prototype),Tr(at.prototype,"openEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"openEdgeAnimation"),at.prototype),Tr(at.prototype,"closeEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"closeEdgeAnimation"),at.prototype),at),v5=lT;function gE(c){return gE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},gE(c)}function yE(){return yE=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},yE.apply(this,arguments)}function m5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function _E(c,u){return _E=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},_E(c,u)}function g5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=hb(c);if(u){var y=hb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return y5(this,d)}}function y5(c,u){if(u&&(gE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ad(c)}function Ad(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function hb(c){return hb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},hb(c)}function Wf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var sT,_5=Fc(iT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&_E(m,_)})(y,c);var u,d,p=g5(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Wf(Ad(_=p.call(this)),"stepDrag",void 0),Wf(Ad(_),"stepScrollX",0),Wf(Ad(_),"stepScrollY",0),Wf(Ad(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY;_.setState({isDragging:!0});var Ce=_.props.graphModel,Ve=Ce.transformModel;Ce.editConfigModel.stopMoveGraph!==!0&&Ve.translate(oe,ue)})),Wf(Ad(_),"onDragEnd",(function(){_.setState({isDragging:!1})})),Wf(Ad(_),"zoomHandler",(function(H){var oe=_.props,ue=oe.graphModel,Ce=ue.editConfigModel,Ve=ue.transformModel,qe=ue.gridSize,Ot=oe.graphModel,xt=H.deltaX,Ft=H.deltaY;if(Ce.stopScrollGraph||H.ctrlKey===!0){if(!Ce.stopZoomGraph){H.preventDefault();var hn=Ot.getPointByClient({x:H.clientX,y:H.clientY}).canvasOverlayPosition,Hn=hn.x,zn=hn.y;Ve.zoom(H.deltaY<0,[Hn,zn])}}else{if(H.preventDefault(),_.stepScrollX+=xt,_.stepScrollY+=Ft,Math.abs(_.stepScrollX)>=qe){var Ar=_.stepScrollX%qe,Vn=_.stepScrollX-Ar;Ve.translate(-Vn*Ve.SCALE_X,0),_.stepScrollX=Ar}if(Math.abs(_.stepScrollY)>=qe){var vr=_.stepScrollY%qe,er=_.stepScrollY-vr;Ve.translate(0,-er*Ve.SCALE_Y),_.stepScrollY=vr}}})),Wf(Ad(_),"clickHandler",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){var oe=_.props.graphModel;oe.selectElements.size>0&&oe.clearSelectElements(),oe.eventCenter.emit(ur.BLANK_CLICK,{e:H})}})),Wf(Ad(_),"handleContextMenu",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){H.preventDefault();var oe=_.props.graphModel,ue=oe.getPointByClient({x:H.clientX,y:H.clientY});oe.eventCenter.emit(ur.BLANK_CONTEXTMENU,{e:H,position:ue})}})),Wf(Ad(_),"mouseDownHandler",(function(H){var oe=_.props.graphModel,ue=oe.eventCenter,Ce=oe.editConfigModel,Ve=oe.transformModel.SCALE_X,qe=oe.gridSize,Ot=H.target,xt=!Ce.adjustEdge&&!Ce.adjustNodePosition;(Ot.getAttribute("name")==="canvas-overlay"||xt)&&(Ce.stopMoveGraph!==!0?(_.stepDrag.setStep(qe*Ve),_.stepDrag.handleMouseDown(H)):ue.emit(ur.BLANK_MOUSEDOWN,{e:H}),_.clickHandler(H))}));var A=m.graphModel,N=A.gridSize,U=A.eventCenter;return _.stepDrag=new Te({onDragging:_.onDragging,onDragEnd:_.onDragEnd,step:N,eventType:"BLANK",isStopPropagation:!1,eventCenter:U,model:null}),_.state={isDragging:!1},_}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel.transformModel.getTransformStyle().transform,_=this.props,A=_.children,N=_.dnd,U=this.state.isDragging;return Object(re.g)("svg",yE({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:U?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},N.eventMap()),Object(re.g)("g",{transform:m},A))}}])&&m5(u.prototype,d),y})(re.a))||iT;function bE(c){return bE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bE(c)}function b5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function w5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function wE(c,u){return wE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wE(c,u)}function E5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=vb(c);if(u){var y=vb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return x5(this,d)}}function x5(c,u){if(u&&(bE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function vb(c){return vb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},vb(c)}var O5=Fc(sT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&wE(m,_)})(y,c);var u,d,p=E5(y);function y(){return b5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"componentDidMount",value:function(){this.triggerToolRender()}},{key:"componentDidUpdate",value:function(){this.triggerToolRender()}},{key:"getTools",value:function(){var m=this.props,_=m.tool,A=m.graphModel,N=_.getTools().map((function(U){return Object(re.g)(U,{graphModel:A,logicFlow:_.instance})}));return _.components=N,N}},{key:"triggerToolRender",value:function(){var m=this.props,_=m.tool,A=m.graphModel,N=document.querySelector("#ToolOverlay_".concat(A.flowId)),U=_.getInstance();U.components.forEach((function(H){return H(U,N)})),U.components=[]}},{key:"render",value:function(){var m=this.props.graphModel;return Object(re.g)("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(m.flowId)},this.getTools())}}])&&w5(u.prototype,d),y})(re.a))||sT;function EE(c){return EE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},EE(c)}function S5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function A5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function xE(c,u){return xE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},xE(c,u)}function M5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=mb(c);if(u){var y=mb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return T5(this,d)}}function T5(c,u){if(u&&(EE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function mb(c){return mb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},mb(c)}var uT,C5=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&xE(m,_)})(y,c);var u,d,p=M5(y);function y(){return S5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.background;return Object(re.g)("div",{className:"lf-background"},Object(re.g)("div",{style:m,className:"lf-background-area"}))}}])&&A5(u.prototype,d),y})(re.a);function OE(c){return OE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},OE(c)}function N5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function k5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function SE(c,u){return SE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},SE(c,u)}function P5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=gb(c);if(u){var y=gb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return R5(this,d)}}function R5(c,u){if(u&&(OE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cT(c)}function cT(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function gb(c){return gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},gb(c)}function D5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var dT=Fc(uT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&SE(m,_)})(y,c);var u,d,p=P5(y);function y(){var m;N5(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return D5(cT(m=p.call.apply(p,[this].concat(A))),"id",tl()),m}return u=y,(d=[{key:"renderDot",value:function(){var m=this.props,_=m.config,A=_.color,N=_.thickness,U=N===void 0?2:N,H=m.size,oe=m.visible,ue=Math.min(Math.max(2,U),H/2),Ce=1;return oe||(Ce=0),Object(re.g)("rect",{width:ue,height:ue,rx:ue/2,ry:ue/2,fill:A,opacity:Ce})}},{key:"renderMesh",value:function(){var m=this.props,_=m.config,A=_.color,N=_.thickness,U=N===void 0?1:N,H=m.size,oe=m.visible,ue=Math.min(Math.max(1,U),H/2),Ce="M ".concat(H," 0 H0 M0 0 V0 ").concat(H),Ve=1;return oe||(Ve=0),Object(re.g)("path",{d:Ce,stroke:A,strokeWidth:ue,opacity:Ve})}},{key:"render",value:function(){var m=this.props,_=m.type,A=m.size,N=m.graphModel.transformModel,U=[N.SCALE_X,N.SKEW_Y,N.SKEW_X,N.SCALE_Y,N.TRANSLATE_X,N.TRANSLATE_Y].join(","),H="matrix(".concat(U,")");return Object(re.g)("div",{className:"lf-grid"},Object(re.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%"},Object(re.g)("defs",null,Object(re.g)("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:H,x:"0",y:"0",width:A,height:A},_==="dot"&&this.renderDot(),_==="mesh"&&this.renderMesh())),Object(re.g)("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})))}}])&&k5(u.prototype,d),y})(re.a))||uT;dT.defaultProps={size:20,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},r(53);function AE(c){return AE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},AE(c)}function j5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return fT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return fT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function fT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var pT,Fm=function(c){var u={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(c).forEach((function(d){var p=j5(d,2),y=p[0],m=p[1];(y==="style"||AE(m)!=="object")&&(u[y]=m)})),Object(re.g)("line",u)};function ME(c){return ME=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ME(c)}function hT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function yb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hT(Object(d),!0).forEach((function(p){L5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function L5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function I5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function F5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function TE(c,u){return TE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},TE(c,u)}function B5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=_b(c);if(u){var y=_b(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return $5(this,d)}}function $5(c,u){if(u&&(ME(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function _b(c){return _b=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},_b(c)}var vT,U5=Fc(pT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&TE(m,_)})(y,c);var u,d,p=B5(y);function y(){return I5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.snaplineModel,_=m.position,A=m.isShowHorizontal,N=m.isShowVertical,U=m.getStyle(),H=_.x,oe=H===void 0?0:H,ue=_.y,Ce=ue===void 0?0:ue,Ve=yb(yb({x1:-1e5,y1:Ce,x2:1e5,y2:Ce},U),{},{stroke:A?U.stroke:"none"}),qe=yb(yb({x1:oe,y1:-1e5,x2:oe,y2:1e5},U),{},{stroke:N?U.stroke:"none"});return Object(re.g)("g",{className:"lf-snapline"},Object(re.g)(Fm,Ve),Object(re.g)(Fm,qe))}}])&&F5(u.prototype,d),y})(re.a))||pT;function CE(c){return CE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},CE(c)}function V5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return mT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return mT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function mT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function th(c){var u=c.x,d=c.y,p=c.width,y=c.height,m=c.className,_=c.radius,A=u-p/2,N=d-y/2,U={};return Object.entries(c).forEach((function(H){var oe=V5(H,2),ue=oe[0],Ce=oe[1];CE(Ce)!=="object"&&(U[ue]=Ce)})),U.className=m?"lf-basic-shape ".concat(m):"lf-basic-shape",_&&(U.rx=_,U.ry=_),U.x=A,U.y=N,Object(re.g)("rect",U)}function NE(c){return NE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},NE(c)}function Bm(){return Bm=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Bm.apply(this,arguments)}function gT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function yT(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gT(Object(d),!0).forEach((function(p){G5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function G5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function W5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function z5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function kE(c,u){return kE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kE(c,u)}function H5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=bb(c);if(u){var y=bb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return X5(this,d)}}function X5(c,u){if(u&&(NE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function bb(c){return bb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},bb(c)}th.defaultProps={className:"",radius:""};var _T,Y5=Fc(vT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&kE(m,_)})(y,c);var u,d,p=H5(y);function y(){return W5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getNodesOutline",value:function(){var m=this.props.graphModel,_=m.nodes,A=m.editConfigModel,N=A.hoverOutline,U=A.nodeSelectedOutline,H=[];return _.forEach((function(oe){if(oe.isHovered||oe.isSelected){var ue=oe.isHovered,Ce=oe.isSelected,Ve=oe.x,qe=oe.y,Ot=oe.width,xt=oe.height;if(U&&Ce||N&&ue){var Ft=oe.getOutlineStyle(),hn={};if(Object.keys(Ft).forEach((function(zn){zn!=="hover"&&(hn[zn]=Ft[zn])})),ue){var Hn=Ft.hover;hn=yT(yT({},hn),Hn)}H.push(Object(re.g)(th,Bm({transform:oe.transform,className:"lf-outline-node",x:Ve,y:qe,width:Ot+10,height:xt+10},hn)))}}})),H}},{key:"getEdgeOutline",value:function(){for(var m=this.props.graphModel,_=m.edges,A=m.editConfigModel,N=A.edgeSelectedOutline,U=A.hoverOutline,H=[],oe=0;oe<_.length;oe++){var ue=_[oe];(N&&ue.isSelected||U&&ue.isHovered)&&(ue.modelType===lo.LINE_EDGE?H.push(this.getLineOutline(ue)):ue.modelType===lo.POLYLINE_EDGE?H.push(this.getPolylineOutline(ue)):ue.modelType===lo.BEZIER_EDGE&&H.push(this.getBezierOutline(ue)))}return H}},{key:"getLineOutline",value:function(m){var _=m.startPoint,A=m.endPoint,N=(_.x+A.x)/2,U=(_.y+A.y)/2,H=Math.abs(_.x-A.x)+10,oe=Math.abs(_.y-A.y)+10,ue=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline-edge",x:N,y:U,width:H,height:oe},ue))}},{key:"getPolylineOutline",value:function(m){var _=m.points,A=jr(_),N=St(A,8),U=N.x,H=N.y,oe=N.width,ue=N.height,Ce=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline",x:U,y:H,width:oe,height:ue},Ce))}},{key:"getBezierOutline",value:function(m){var _=m.path,A=di(_),N=St(A,8),U=N.x,H=N.y,oe=N.width,ue=N.height,Ce=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline",x:U,y:H,width:oe,height:ue},Ce))}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-outline"},this.getNodesOutline(),this.getEdgeOutline())}}])&&z5(u.prototype,d),y})(re.a))||vT;function PE(c){return PE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},PE(c)}function q5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return bT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return bT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function bT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function $m(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.r,_=m===void 0?4:m,A=c.className,N={cx:d,cy:y,r:_,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(U){var H=q5(U,2),oe=H[0],ue=H[1];PE(ue)!=="object"&&(N[oe]=ue)})),N.className=A?"lf-basic-shape ".concat(A):"lf-basic-shape",Object(re.g)("circle",N)}function RE(c){return RE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},RE(c)}function K5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return wT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return wT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function xy(){return xy=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},xy.apply(this,arguments)}function ET(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Z5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function xT(c,u,d){return u&&Z5(c.prototype,u),c}function OT(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&DE(c,u)}function DE(c,u){return DE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},DE(c,u)}function ST(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Eb(c);if(u){var y=Eb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return J5(this,d)}}function J5(c,u){if(u&&(RE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wb(c)}function wb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Eb(c){return Eb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Eb(c)}function jE(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var AT,MT=(function(c){OT(d,c);var u=ST(d);function d(){var p;return ET(this,d),jE(wb(p=u.call(this)),"dragHandler",void 0),jE(wb(p),"onDragging",(function(y){var m=y.event,_=p.props,A=_.graphModel,N=_.bezierModel,U=_.type,H=A.getPointByClient({x:m.clientX,y:m.clientY}).canvasOverlayPosition,oe=H.x,ue=H.y;N.updateAdjustAnchor({x:oe,y:ue},U),A.eventCenter.emit(ur.EDGE_ADJUST,{data:N.getData()})})),jE(wb(p),"onDragEnd",(function(){p.props.bezierModel.isDragging=!1})),p.dragHandler=new Te({onDragging:p.onDragging,onDragEnd:p.onDragEnd}),p}return xT(d,[{key:"render",value:function(){var p=this,y=this.props.position,m=y.x,_=y.y,A=this.props.bezierModel.getEdgeStyle().adjustAnchor;return Object(re.g)($m,xy({className:"lf-bezier-adjust-anchor",x:m,y:_},A,{onMouseDown:function(N){p.dragHandler.handleMouseDown(N)}}))}}]),d})(re.a),Q5=Fc(_T=(function(c){OT(d,c);var u=ST(d);function d(){return ET(this,d),u.apply(this,arguments)}return xT(d,[{key:"getBezierAdjust",value:function(p,y){var m=p.path,_=p.id,A=K5(di(m),4),N=A[0],U=A[1],H=A[2],oe=A[3],ue=p.getEdgeStyle().adjustLine,Ce=[];return Ce.push(Object(re.g)(Fm,xy({x1:N.x,y1:N.y,x2:U.x,y2:U.y},ue))),Ce.push(Object(re.g)(MT,{position:U,bezierModel:p,graphModel:y,key:"".concat(_,"_ePre"),type:"sNext"})),Ce.push(Object(re.g)(Fm,xy({x1:oe.x,y1:oe.y,x2:H.x,y2:H.y},ue))),Ce.push(Object(re.g)(MT,{position:H,bezierModel:p,graphModel:y,key:"".concat(_,"_sNext"),type:"ePre"})),Ce}},{key:"selectedBezierEdge",value:function(){for(var p=this.props.graphModel,y=p.edges,m=[],_=0;_<y.length;_++){var A=y[_];A.isSelected&&A.modelType===lo.BEZIER_EDGE&&A.draggable&&m.push(this.getBezierAdjust(A,p))}return m}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-bezier-adjust"},this.selectedBezierEdge())}}]),d})(re.a))||_T;function LE(c){return LE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},LE(c)}function e6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function t6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function IE(c,u){return IE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},IE(c,u)}function n6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=xb(c);if(u){var y=xb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return r6(this,d)}}function r6(c,u){if(u&&(LE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function xb(c){return xb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},xb(c)}var TT,o6=Fc(AT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&IE(m,_)})(y,c);var u,d,p=n6(y);function y(){return e6(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel.transformModel.getTransformStyle().transform,_=this.props.children;return Object(re.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay"},Object(re.g)("g",{transform:m},_))}}])&&t6(u.prototype,d),y})(re.a))||AT;function FE(c){return FE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},FE(c)}function BE(){return BE=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},BE.apply(this,arguments)}function i6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function a6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function $E(c,u){return $E=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},$E(c,u)}function l6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ob(c);if(u){var y=Ob(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return s6(this,d)}}function s6(c,u){if(u&&(FE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Ob(c){return Ob=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ob(c)}var u6=Fc(TT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&$E(m,_)})(y,c);var u,d,p=l6(y);function y(){return i6(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getComponent",value:function(m,_){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"canvas-overlay",N=this.props.getView,U=N(m.type);return Object(re.g)(U,{key:m.id,model:m,graphModel:_,overlay:A})}},{key:"render",value:function(){var m=this,_=this.props,A=_.graphModel,N=_.tool,U=_.options,H=_.dnd,oe=_.snaplineModel,ue={};U.width&&(ue.width="".concat(A.width,"px")),U.height&&(ue.height="".concat(A.height,"px"));var Ce=U.grid,Ve=A.fakerNode,qe=A.editConfigModel.adjustEdge;return Object(re.g)("div",{className:"lf-graph","flow-id":A.flowId,style:ue},Object(re.g)(_5,{graphModel:A,dnd:H},Object(re.g)("g",{className:"lf-base"},Ep(A.sortElements,(function(Ot){return m.getComponent(Ot,A)}))),Ve?this.getComponent(Ve,A):""),Object(re.g)(o6,{graphModel:A},Object(re.g)(Y5,{graphModel:A}),qe?Object(re.g)(Q5,{graphModel:A}):"",U.snapline!==!1?Object(re.g)(U5,{snaplineModel:oe}):""),Object(re.g)(O5,{graphModel:A,tool:N}),U.background&&Object(re.g)(C5,{background:U.background}),U.grid&&Object(re.g)(dT,BE({},Ce,{graphModel:A})))}}],d&&a6(u.prototype,d),y})(re.a))||TT,c6=u6;function CT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Sb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?CT(Object(d),!0).forEach((function(p){zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):CT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function d6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function zf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var f6=(function(){function c(p){var y=this;(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),zf(this,"nodeConfig",void 0),zf(this,"lf",void 0),zf(this,"fakerNode",void 0),zf(this,"stopDrag",(function(){y.nodeConfig=null,window.document.removeEventListener("mouseup",y.stopDrag)})),zf(this,"dragEnter",(function(_){y.nodeConfig&&!y.fakerNode&&(y.fakerNode=y.lf.createFakerNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:_.clientX,y:_.clientY}))))})),zf(this,"onDragOver",(function(_){if(_.preventDefault(),y.fakerNode){var A=y.clientToLocalPoint({x:_.clientX,y:_.clientY}),N=A.x,U=A.y;y.fakerNode.moveTo(N,U);var H=y.fakerNode.getData();y.lf.setNodeSnapLine(H),y.lf.graphModel.eventCenter.emit(ur.NODE_DND_DRAG,{data:H})}return!1})),zf(this,"onDragLeave",(function(){y.fakerNode&&(y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)})),zf(this,"onDrop",(function(_){y.lf.graphModel&&_&&y.nodeConfig&&(y.lf.addNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:_.clientX,y:_.clientY})),ur.NODE_DND_ADD,_),_.preventDefault(),_.stopPropagation(),y.nodeConfig=null,y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)}));var m=p.lf;this.lf=m}var u,d;return u=c,(d=[{key:"clientToLocalPoint",value:function(p){var y=p.x,m=p.y,_=uc(this.lf.options,["grid","size"]),A=this.lf.graphModel.getPointByClient({x:y,y:m}).canvasOverlayPosition,N=A.x,U=A.y;return{x:fs(N,_),y:fs(U,_)}}},{key:"startDrag",value:function(p){var y=this.lf.graphModel.editConfigModel;y!=null&&y.isSilentMode||(this.nodeConfig=p,window.document.addEventListener("mouseup",this.stopDrag))}},{key:"eventMap",value:function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}}}])&&d6(u.prototype,d),c})();function NT(c){var u=c.container,d=c.grid,p=c.width,y=c.height;if(!u)throw new Error("请检查 container 参数是否有效");if(typeof p=="string"||typeof y=="string")throw new Error("width或height不支持传入字符串,请传数字");return d&&(c.grid=bc({size:20,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}},d)),bc({},PT,c)}var Zo,kT,PT={background:!1,grid:!1,textEdit:!0,disabledTools:[]};function UE(c){return UE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},UE(c)}function VE(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return RT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return RT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function RT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function DT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ab(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?DT(Object(d),!0).forEach((function(p){jT(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):DT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function p6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function h6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function v6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Oy(){return Oy=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=m6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Oy.apply(this,arguments)}function m6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=nh(c))!==null;);return c}function GE(c,u){return GE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},GE(c,u)}function g6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=nh(c);if(u){var y=nh(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return y6(this,d)}}function y6(c,u){if(u&&(UE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mb(c)}function Mb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function nh(c){return nh=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},nh(c)}function jT(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function jc(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var WE=(Zo=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&GE(m,_)})(y,c);var u,d,p=g6(y);function y(){var m;h6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return jT(Mb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.BEZIER_EDGE),p6(Mb(m),"path",kT,Mb(m)),m}return u=y,(d=[{key:"initEdgeData",value:function(m){this.offset=100,Oy(nh(y.prototype),"initEdgeData",this).call(this,m)}},{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.bezier;return Ab(Ab({},Oy(nh(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){if(this.pointsList&&this.pointsList.length>0){var m=0,_=0;return this.pointsList.forEach((function(A){var N=A.x,U=A.y;m+=N,_+=U})),{x:m/this.pointsList.length,y:_/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}},{key:"getData",value:function(){var m=Oy(nh(y.prototype),"getData",this).call(this),_=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Ab(Ab({},m),{},{pointsList:_})}},{key:"getControls",value:function(){var m=this.startPoint,_=this.endPoint;return zi({start:m,end:_,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})}},{key:"getPath",value:function(m){var _=VE(m,4),A=_[0],N=_[1],U=_[2],H=_[3];return"M ".concat(A.x," ").concat(A.y,`
|
||
C `).concat(N.x," ").concat(N.y,`,
|
||
`).concat(U.x," ").concat(U.y,`,
|
||
`).concat(H.x," ").concat(H.y)}},{key:"initPoints",value:function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()}},{key:"updatePoints",value:function(){var m=this.getControls(),_=m.sNext,A=m.ePre;this.updatePath(_,A)}},{key:"updatePath",value:function(m,_){m=Uo(m),_=Uo(_);var A={x:this.startPoint.x,y:this.startPoint.y},N={x:this.endPoint.x,y:this.endPoint.y};if(!m||!_){var U=this.getControls();m=U.sNext,_=U.ePre}this.pointsList=[A,m,_,N],this.path=this.getPath(this.pointsList)}},{key:"updateStartPoint",value:function(m){this.startPoint=Object.assign({},m),this.updatePoints()}},{key:"updateEndPoint",value:function(m){this.endPoint=Object.assign({},m),this.updatePoints()}},{key:"moveStartPoint",value:function(m,_){this.startPoint.x+=m,this.startPoint.y+=_;var A=VE(this.pointsList,3),N=A[1],U=A[2];N.x+=m,N.y+=_,this.updatePath(N,U)}},{key:"moveEndPoint",value:function(m,_){this.endPoint.x+=m,this.endPoint.y+=_;var A=VE(this.pointsList,3),N=A[1],U=A[2];U.x+=m,U.y+=_,this.updatePath(N,U)}},{key:"updateAdjustAnchor",value:function(m,_){_==="sNext"?this.pointsList[1]=m:_==="ePre"&&(this.pointsList[2]=m),this.path=this.getPath(this.pointsList),this.setText(Object.assign({},this.text,this.textPosition))}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var m=this.pointsList;return m[m.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(m){var _=m.startPoint,A=m.endPoint,N=m.sourceNode,U=m.targetNode,H=zi({start:_,end:A,sourceNode:N,targetNode:U,offset:this.offset}),oe=H.sNext,ue=H.ePre;this.pointsList=[_,oe,ue,A],this.initPoints()}}])&&v6(u.prototype,d),y})(If),kT=jc(Zo.prototype,"path",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),jc(Zo.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"initPoints"),Zo.prototype),jc(Zo.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updatePoints"),Zo.prototype),jc(Zo.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateStartPoint"),Zo.prototype),jc(Zo.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateEndPoint"),Zo.prototype),jc(Zo.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveStartPoint"),Zo.prototype),jc(Zo.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveEndPoint"),Zo.prototype),jc(Zo.prototype,"updateAdjustAnchor",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAdjustAnchor"),Zo.prototype),jc(Zo.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustStart"),Zo.prototype),jc(Zo.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustEnd"),Zo.prototype),jc(Zo.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAfterAdjustStartAndEnd"),Zo.prototype),Zo),Dn,LT,IT,FT,BT,$T,UT,VT,GT,WT,zT,HT,XT,YT,qT,KT,ZT,JT,QT,eC,tC,nC,rC,_6=function(c){return c==null};function b6(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||oC(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function zE(c){return zE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},zE(c)}function oC(c,u){if(c){if(typeof c=="string")return iC(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?iC(c,u):void 0}}function iC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function aC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function ys(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?aC(Object(d),!0).forEach((function(p){Us(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):aC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Sa(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function w6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Us(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function fo(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Hf,lC,Xf=(Dn=(function(){function c(p,y){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),Us(this,"id",""),Sa(this,"type",LT,this),Sa(this,"x",IT,this),Sa(this,"y",FT,this),Sa(this,"text",BT,this),Sa(this,"properties",$T,this),Sa(this,"_width",UT,this),Sa(this,"_height",VT,this),Sa(this,"anchorsOffset",GT,this),Sa(this,"isSelected",WT,this),Sa(this,"isHovered",zT,this),Sa(this,"isShowAnchor",HT,this),Sa(this,"isDragging",XT,this),Sa(this,"isHitable",YT,this),Sa(this,"draggable",qT,this),Sa(this,"visible",KT,this),Sa(this,"enableRotate",ZT,this),Us(this,"virtual",!1),Us(this,"graphModel",void 0),Sa(this,"zIndex",JT,this),Sa(this,"state",QT,this),Sa(this,"autoToFront",eC,this),Sa(this,"style",tC,this),Sa(this,"transform",nC,this),Sa(this,"_rotate",rC,this),Us(this,"BaseType",ei.NODE),Us(this,"modelType",lo.NODE),Us(this,"additionStateData",void 0),Us(this,"targetRules",[]),Us(this,"sourceRules",[]),Us(this,"moveRules",[]),Us(this,"hasSetTargetRules",!1),Us(this,"hasSetSourceRules",!1),this.graphModel=y,this.initNodeData(p),this.setAttributes()}var u,d;return u=c,d=[{key:"width",get:function(){return this._width},set:function(p){this._width=p}},{key:"height",get:function(){return this._height},set:function(p){this._height=p}},{key:"rotate",get:function(){return this._rotate},set:function(p){this._rotate=p;var y=this.x,m=y===void 0?0:y,_=this.y,A=_===void 0?0:_;this.transform=new eh(-m,-A).rotate(p).translate(m,A).toString()}},{key:"incoming",get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}}},{key:"outgoing",get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}}},{key:"initNodeData",value:function(p){if(p.properties||(p.properties={}),!p.id){var y=this.graphModel.idGenerator,m=y&&y(p.type),_=this.createId();p.id=_||m||tl()}this.formatText(p),Pa(this,(function(A){return cs(A,["id","type","x","y","text","properties","virtual","rotate"])})(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Tc())}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"formatText",value:function(p){p.text||(p.text={value:"",x:p.x,y:p.y,draggable:!1,editable:!0}),p.text&&typeof p.text=="string"?p.text={value:p.text,x:p.x,y:p.y,draggable:!1,editable:!0}:p.text&&p.text.editable===void 0&&(p.text.editable=!0)}},{key:"getData",value:function(){var p=this.text,y=p.x,m=p.y,_=p.value,A=this.properties;Object(a.x)(A)&&(A=Object(a.I)(A));var N={id:this.id,type:this.type,x:this.x,y:this.y,properties:A};return this.rotate&&(N.rotate=this.rotate),this.graphModel.overlapMode===Ei.INCREASE&&(N.zIndex=this.zIndex),_&&(N.text={x:y,y:m,value:_}),N}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getOuterGAttributes",value:function(){return{className:""}}},{key:"getNodeStyle",value:function(){return ys(ys({},this.graphModel.theme.baseNode),this.style)}},{key:"getTextStyle",value:function(){var p=this.graphModel.theme.nodeText;return Uo(p)}},{key:"getRotateControlStyle",value:function(){var p=this.graphModel.theme.rotateControl;return Uo(p)}},{key:"getAnchorStyle",value:function(p){var y=this.graphModel.theme.anchor;return Uo(y)}},{key:"getAnchorLineStyle",value:function(p){var y=this.graphModel.theme.anchorLine;return Uo(y)}},{key:"getOutlineStyle",value:function(){var p=this.graphModel.theme.outline;return Uo(p)}},{key:"isAllowConnectedAsSource",value:function(p,y,m,_){var A=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var N,U=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,this,p,y,m,_)){U=!1,N=oe.message;break}}return{isAllPass:U,msg:N}}},{key:"getConnectedSourceRules",value:function(){return this.sourceRules}},{key:"isAllowConnectedAsTarget",value:function(p,y,m,_){var A=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var N,U=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,p,this,y,m,_)){U=!1,N=oe.message;break}}return{isAllPass:U,msg:N}}},{key:"isAllowMoveNode",value:function(p,y){var m,_=!0,A=!0,N=(function(oe,ue){var Ce=typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(!Ce){if(Array.isArray(oe)||(Ce=oC(oe))||ue){Ce&&(oe=Ce);var Ve=0,qe=function(){};return{s:qe,n:function(){return Ve>=oe.length?{done:!0}:{done:!1,value:oe[Ve++]}},e:function(hn){throw hn},f:qe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ot,xt=!0,Ft=!1;return{s:function(){Ce=Ce.call(oe)},n:function(){var hn=Ce.next();return xt=hn.done,hn},e:function(hn){Ft=!0,Ot=hn},f:function(){try{xt||Ce.return==null||Ce.return()}finally{if(Ft)throw Ot}}}})(this.moveRules.concat(this.graphModel.nodeMoveRules));try{for(N.s();!(m=N.n()).done;){var U=(0,m.value)(this,p,y);if(!U)return!1;if(zE(U)==="object"){var H=U;if(H.x===!1&&H.y===!1)return!1;_=_&&H.x,A=A&&H.y}}}catch(oe){N.e(oe)}finally{N.f()}return{x:_,y:A}}},{key:"getConnectedTargetRules",value:function(){return this.targetRules}},{key:"getAnchorsByOffset",value:function(){var p=this.anchorsOffset,y=this.id,m=this.x,_=this.y;return p&&p.length>0?p.map((function(A,N){return A.length?(A=A,{id:"".concat(y,"_").concat(N),x:m+A[0],y:_+A[1]}):ys(ys({},A=A),{},{x:m+A.x,y:_+A.y,id:A.id||"".concat(y,"_").concat(N)})})):this.getDefaultAnchor()}},{key:"getDefaultAnchor",value:function(){return[]}},{key:"getTargetAnchor",value:function(p){return(function(y,m){for(var _,A=Yp(m),N=Number.MAX_SAFE_INTEGER,U=0;U<A.length;U++){var H=ms(y.x,y.y,A[U].x,A[U].y);H<N&&(N=H,_={index:U,anchor:Fs(Fs({},A[U]),{},{x:A[U].x,y:A[U].y,id:A[U].id})})}return _})(p,this)}},{key:"getBounds",value:function(){return{x1:this.x-this.width/2,y1:this.y-this.height/2,x2:this.x+this.width/2,y2:this.y+this.height/2}}},{key:"anchors",get:function(){var p=this.getAnchorsByOffset(),y=this.x,m=this.y,_=this.rotate;return p.forEach((function(A){var N=A.x,U=A.y,H=b6(new Fu([N,U,1]).translate(-y,-m).rotate(_).translate(y,m)[0],2),oe=H[0],ue=H[1];A.x=oe,A.y=ue})),p}},{key:"getAnchorInfo",value:function(p){if(!_6(p))for(var y=0;y<this.anchors.length;y++){var m=this.anchors[y];if(m.id===p)return m}}},{key:"addNodeMoveRules",value:function(p){this.moveRules.includes(p)||this.moveRules.push(p)}},{key:"move",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=!1,A=!1;if(m)_=!0,A=!0;else{var N=this.isAllowMoveNode(p,y);typeof N=="boolean"?(_=N,A=N):(_=N.x,A=N.y)}if(_){var U=this.x+p;this.x=U,this.text&&this.moveText(p,0)}if(A){var H=this.y+y;this.y=H,this.text&&this.moveText(0,y)}return _||A}},{key:"getMoveDistance",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=!1,A=!1,N=0,U=0;if(m)_=!0,A=!0;else{var H=this.isAllowMoveNode(p,y);typeof H=="boolean"?(_=H,A=H):(_=H.x,A=H.y)}if(_&&p){var oe=this.x+p;this.x=oe,this.text&&this.moveText(p,0),N=p}if(A&&y){var ue=this.y+y;this.y=ue,this.text&&this.moveText(0,y),U=y}return[N,U]}},{key:"moveTo",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=p-this.x,A=y-this.y;return!(!m&&!this.isAllowMoveNode(_,A)||(this.text&&this.text&&this.moveText(_,A),this.x=p,this.y=y,0))}},{key:"moveText",value:function(p,y){var m=this.text,_=m.x,A=m.y,N=m.value,U=m.draggable,H=m.editable;this.text={value:N,editable:H,draggable:U,x:_+p,y:A+y}}},{key:"updateText",value:function(p){this.text=ys(ys({},Object(a.I)(this.text)),{},{value:p})}},{key:"setSelected",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=p}},{key:"setHovered",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=p,this.setIsShowAnchor(p)}},{key:"setIsShowAnchor",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isShowAnchor=p}},{key:"setEnableRotate",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.enableRotate=p}},{key:"setHitable",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=p}},{key:"setElementState",value:function(p,y){this.state=p,this.additionStateData=y}},{key:"setProperty",value:function(p,y){this.properties=ys(ys({},Object(a.I)(this.properties)),{},Us({},p,ma(y))),this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=ys(ys({},Object(a.I)(this.properties)),ma(p)),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setStyle",value:function(p,y){this.style=ys(ys({},this.style),{},Us({},p,ma(y)))}},{key:"setStyles",value:function(p){this.style=ys(ys({},this.style),ma(p))}},{key:"updateStyles",value:function(p){this.style=ys({},ma(p))}},{key:"setZIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.zIndex=p}},{key:"updateAttributes",value:function(p){Pa(this,p)}}],d&&w6(u.prototype,d),c})(),LT=fo(Dn.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IT=fo(Dn.prototype,"x",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),FT=fo(Dn.prototype,"y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),BT=fo(Dn.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),$T=fo(Dn.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),UT=fo(Dn.prototype,"_width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),VT=fo(Dn.prototype,"_height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),GT=fo(Dn.prototype,"anchorsOffset",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),WT=fo(Dn.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zT=fo(Dn.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),HT=fo(Dn.prototype,"isShowAnchor",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),XT=fo(Dn.prototype,"isDragging",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),YT=fo(Dn.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),qT=fo(Dn.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),KT=fo(Dn.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),ZT=fo(Dn.prototype,"enableRotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),JT=fo(Dn.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),QT=fo(Dn.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),eC=fo(Dn.prototype,"autoToFront",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),tC=fo(Dn.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),nC=fo(Dn.prototype,"transform",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rC=fo(Dn.prototype,"_rotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),fo(Dn.prototype,"incoming",[a.m],Object.getOwnPropertyDescriptor(Dn.prototype,"incoming"),Dn.prototype),fo(Dn.prototype,"outgoing",[a.m],Object.getOwnPropertyDescriptor(Dn.prototype,"outgoing"),Dn.prototype),fo(Dn.prototype,"addNodeMoveRules",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"addNodeMoveRules"),Dn.prototype),fo(Dn.prototype,"move",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"move"),Dn.prototype),fo(Dn.prototype,"getMoveDistance",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"getMoveDistance"),Dn.prototype),fo(Dn.prototype,"moveTo",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"moveTo"),Dn.prototype),fo(Dn.prototype,"moveText",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"moveText"),Dn.prototype),fo(Dn.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateText"),Dn.prototype),fo(Dn.prototype,"setSelected",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setSelected"),Dn.prototype),fo(Dn.prototype,"setHovered",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setHovered"),Dn.prototype),fo(Dn.prototype,"setIsShowAnchor",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setIsShowAnchor"),Dn.prototype),fo(Dn.prototype,"setEnableRotate",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setEnableRotate"),Dn.prototype),fo(Dn.prototype,"setHitable",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setHitable"),Dn.prototype),fo(Dn.prototype,"setElementState",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setElementState"),Dn.prototype),fo(Dn.prototype,"setProperty",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setProperty"),Dn.prototype),fo(Dn.prototype,"setProperties",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setProperties"),Dn.prototype),fo(Dn.prototype,"deleteProperty",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"deleteProperty"),Dn.prototype),fo(Dn.prototype,"setStyle",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setStyle"),Dn.prototype),fo(Dn.prototype,"setStyles",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setStyles"),Dn.prototype),fo(Dn.prototype,"updateStyles",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateStyles"),Dn.prototype),fo(Dn.prototype,"setZIndex",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setZIndex"),Dn.prototype),fo(Dn.prototype,"updateAttributes",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateAttributes"),Dn.prototype),Dn);function HE(c){return HE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},HE(c)}function sC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function uC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?sC(Object(d),!0).forEach((function(p){cC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):sC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function E6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function x6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function O6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function XE(){return XE=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=S6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},XE.apply(this,arguments)}function S6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Um(c))!==null;);return c}function YE(c,u){return YE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},YE(c,u)}function A6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Um(c);if(u){var y=Um(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return M6(this,d)}}function M6(c,u){if(u&&(HE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tb(c)}function Tb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Um(c){return Um=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Um(c)}function cC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function qE(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Xl,dC,fC,KE=(Hf=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&YE(m,_)})(y,c);var u,d,p=A6(y);function y(){var m;x6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return cC(Tb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.CIRCLE_NODE),E6(Tb(m),"r",lC,Tb(m)),m}return u=y,(d=[{key:"width",get:function(){return 2*this.r}},{key:"height",get:function(){return 2*this.r}},{key:"getNodeStyle",value:function(){var m=XE(Um(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.circle;return uC(uC({},m),Uo(_))}},{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.r;return[{x:m,y:_-A,id:"".concat(this.id,"_0")},{x:m+A,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+A,id:"".concat(this.id,"_2")},{x:m-A,y:_,id:"".concat(this.id,"_3")}]}}])&&O6(u.prototype,d),y})(Xf),lC=qE(Hf.prototype,"r",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),qE(Hf.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"width"),Hf.prototype),qE(Hf.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"height"),Hf.prototype),Hf);r(129);function ZE(c){return ZE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ZE(c)}function JE(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return pC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return pC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function hC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function vC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hC(Object(d),!0).forEach((function(p){gC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function mC(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function T6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function C6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function QE(){return QE=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=N6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},QE.apply(this,arguments)}function N6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Gm(c))!==null;);return c}function ex(c,u){return ex=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ex(c,u)}function k6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Gm(c);if(u){var y=Gm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return P6(this,d)}}function P6(c,u){if(u&&(ZE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vm(c)}function Vm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Gm(c){return Gm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Gm(c)}function gC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Wm(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Md,yC,_C,tx=(Xl=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ex(m,_)})(y,c);var u,d,p=k6(y);function y(){var m;T6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return gC(Vm(m=p.call.apply(p,[this].concat(A))),"modelType",lo.DIAMOND_NODE),mC(Vm(m),"rx",dC,Vm(m)),mC(Vm(m),"ry",fC,Vm(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=QE(Gm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.diamond;return vC(vC({},m),Uo(_))}},{key:"points",get:function(){var m=this.x,_=this.y,A=this.rx,N=this.ry;return[[m,_-N],[m+A,_],[m,_+N],[m-A,_]]}},{key:"pointsPosition",get:function(){return this.points.map((function(m){return{x:m[0],y:m[1]}}))}},{key:"width",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=JE(A,1)[0];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"height",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=JE(A,2)[1];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"getDefaultAnchor",value:function(){var m=this;return this.points.map((function(_,A){var N=JE(_,2);return{x:N[0],y:N[1],id:"".concat(m.id,"_").concat(A)}}))}}])&&C6(u.prototype,d),y})(Xf),dC=Wm(Xl.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),fC=Wm(Xl.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),Wm(Xl.prototype,"points",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"points"),Xl.prototype),Wm(Xl.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"pointsPosition"),Xl.prototype),Wm(Xl.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"width"),Xl.prototype),Wm(Xl.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"height"),Xl.prototype),Xl);function nx(c){return nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},nx(c)}function bC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function wC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?bC(Object(d),!0).forEach((function(p){xC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):bC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function EC(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function R6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function D6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function rx(){return rx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=j6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},rx.apply(this,arguments)}function j6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Hm(c))!==null;);return c}function ox(c,u){return ox=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ox(c,u)}function L6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Hm(c);if(u){var y=Hm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return I6(this,d)}}function I6(c,u){if(u&&(nx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zm(c)}function zm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Hm(c){return Hm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hm(c)}function xC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Cb(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var $u,OC,ix=(Md=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ox(m,_)})(y,c);var u,d,p=L6(y);function y(){var m;R6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return xC(zm(m=p.call.apply(p,[this].concat(A))),"modelType",lo.ELLIPSE_NODE),EC(zm(m),"rx",yC,zm(m)),EC(zm(m),"ry",_C,zm(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=rx(Hm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.ellipse;return wC(wC({},m),Uo(_))}},{key:"width",get:function(){return 2*this.rx}},{key:"height",get:function(){return 2*this.ry}},{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.rx,N=this.ry;return[{x:m,y:_-N,id:"".concat(this.id,"_0")},{x:m+A,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N,id:"".concat(this.id,"_2")},{x:m-A,y:_,id:"".concat(this.id,"_3")}]}}])&&D6(u.prototype,d),y})(Xf),yC=Cb(Md.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),_C=Cb(Md.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 45}}),Cb(Md.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Md.prototype,"width"),Md.prototype),Cb(Md.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Md.prototype,"height"),Md.prototype),Md);function ax(c){return ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ax(c)}function lx(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return SC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return SC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function SC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function AC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function MC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?AC(Object(d),!0).forEach((function(p){TC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):AC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function F6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function B6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function $6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function sx(){return sx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=U6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},sx.apply(this,arguments)}function U6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Xm(c))!==null;);return c}function ux(c,u){return ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ux(c,u)}function V6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Xm(c);if(u){var y=Xm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return G6(this,d)}}function G6(c,u){if(u&&(ax(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nb(c)}function Nb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Xm(c){return Xm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xm(c)}function TC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function kb(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var cx,CC,dx=($u=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ux(m,_)})(y,c);var u,d,p=V6(y);function y(){var m;B6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return TC(Nb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.POLYGON_NODE),F6(Nb(m),"points",OC,Nb(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=sx(Xm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.polygon;return MC(MC({},m),Uo(_))}},{key:"pointsPosition",get:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return this.points.map((function(U){return{x:U[0]+m-A/2,y:U[1]+_-N/2}}))}},{key:"width",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=lx(A,1)[0];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"height",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=lx(A,2)[1];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"getDefaultAnchor",value:function(){var m=this,_=this.x,A=this.y,N=this.width,U=this.height;return this.points.map((function(H,oe){var ue=lx(H,2),Ce=ue[0],Ve=ue[1];return{x:_+Ce-N/2,y:A+Ve-U/2,id:"".concat(m.id,"_").concat(oe)}}))}}])&&$6(u.prototype,d),y})(Xf),OC=kb($u.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[[50,0],[100,50],[50,100],[0,50]]}}),kb($u.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"pointsPosition"),$u.prototype),kb($u.prototype,"width",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"width"),$u.prototype),kb($u.prototype,"height",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"height"),$u.prototype),$u);function fx(c){return fx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},fx(c)}function NC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function kC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?NC(Object(d),!0).forEach((function(p){PC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):NC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function W6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function z6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function H6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function px(){return px=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=X6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},px.apply(this,arguments)}function X6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Ym(c))!==null;);return c}function hx(c,u){return hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hx(c,u)}function Y6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ym(c);if(u){var y=Ym(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return q6(this,d)}}function q6(c,u){if(u&&(fx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pb(c)}function Pb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ym(c){return Ym=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ym(c)}function PC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var rh,vx=(cx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&hx(m,_)})(y,c);var u,d,p=Y6(y);function y(){var m;z6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return PC(Pb(m=p.call.apply(p,[this].concat(A))),"modelType",lo.RECT_NODE),W6(Pb(m),"radius",CC,Pb(m)),m}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return[{x:m,y:_-N/2,id:"".concat(this.id,"_0")},{x:m+A/2,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N/2,id:"".concat(this.id,"_2")},{x:m-A/2,y:_,id:"".concat(this.id,"_3")}]}},{key:"getNodeStyle",value:function(){var m=px(Ym(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.rect;return kC(kC({},m),Uo(_))}}])&&H6(u.prototype,d),y})(Xf),CC=(function(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m})(cx.prototype,"radius",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),cx);function mx(c){return mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},mx(c)}function RC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function DC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?RC(Object(d),!0).forEach((function(p){LC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):RC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function K6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Z6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function gx(){return gx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=J6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},gx.apply(this,arguments)}function J6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=qm(c))!==null;);return c}function yx(c,u){return yx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yx(c,u)}function Q6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=qm(c);if(u){var y=qm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return eF(this,d)}}function eF(c,u){if(u&&(mx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jC(c)}function jC(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qm(c){return qm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qm(c)}function LC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function IC(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var _x=(rh=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&yx(m,_)})(y,c);var u,d,p=Q6(y);function y(){var m;K6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return LC(jC(m=p.call.apply(p,[this].concat(A))),"modelType",lo.TEXT_NODE),m}return u=y,(d=[{key:"getTextStyle",value:function(){var m=gx(qm(y.prototype),"getTextStyle",this).call(this),_=this.graphModel.theme.text;return DC(DC({},m),Uo(_))}},{key:"width",get:function(){var m=String(this.text.value).split(/[\r\n]/g),_=this.getTextStyle().fontSize;return Mc({rows:m,fontSize:_,rowsLength:m.length}).width}},{key:"height",get:function(){var m=String(this.text.value).split(/[\r\n]/g),_=this.getTextStyle().fontSize;return Mc({rows:m,fontSize:_,rowsLength:m.length}).height}}])&&Z6(u.prototype,d),y})(Xf),IC(rh.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(rh.prototype,"width"),rh.prototype),IC(rh.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(rh.prototype,"height"),rh.prototype),rh);function bx(c){return bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bx(c)}function tF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function nF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function wx(c,u){return wx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wx(c,u)}function rF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Rb(c);if(u){var y=Rb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return oF(this,d)}}function oF(c,u){if(u&&(bx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FC(c)}function FC(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Rb(c){return Rb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Rb(c)}function iF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Lc,BC,$C,UC,Ex=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&wx(m,_)})(y,c);var u,d,p=rF(y);function y(){var m;tF(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return iF(FC(m=p.call.apply(p,[this].concat(A))),"modelType",lo.HTML_NODE),m}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return[{x:m,y:_-N/2,id:"".concat(this.id,"_0")},{x:m+A/2,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N/2,id:"".concat(this.id,"_2")},{x:m-A/2,y:_,id:"".concat(this.id,"_3")}]}}])&&nF(u.prototype,d),y})(Xf);function VC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xx(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function aF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function GC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Sy(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var WC=(Lc=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),GC(this,"graphModel",void 0),xx(this,"isShowHorizontal",BC,this),xx(this,"isShowVertical",$C,this),xx(this,"position",UC,this),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=p}var u,d;return u=c,d=[{key:"getStyle",value:function(){return(function(p){for(var y=1;y<arguments.length;y++){var m=arguments[y]!=null?arguments[y]:{};y%2?VC(Object(m),!0).forEach((function(_){GC(p,_,m[_])})):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):VC(Object(m)).forEach((function(_){Object.defineProperty(p,_,Object.getOwnPropertyDescriptor(m,_))}))}return p})({},this.graphModel.theme.snapline)}},{key:"getCenterSnapLine",value:function(p,y){for(var m=p.x,_=p.y,A=!1,N=!1,U=0;U<y.length;U++){var H=y[U];if(H.id!==p.id&&(m===H.x&&(A=!0),_===H.y&&(N=!0),A&&N))break}return{isShowVertical:A,isShowHorizontal:N,position:{x:m,y:_}}}},{key:"getHorizontalSnapline",value:function(p,y){var m,_,A=!1,N=p.id;if(N){var U=this.graphModel.fakerNode;if(U&&U.id===N)_=gi(U);else{var H=this.graphModel.getNodeModelById(N);_=gi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ce=gi(ue);if(Ce.minY===_.minY||Ce.maxY===_.minY){A=!0,m=_.minY;break}if(Ce.minY===_.maxY||Ce.maxY===_.maxY){A=!0,m=_.maxY;break}}}return Pa({isShowHorizontal:A,position:{y:m}})}},{key:"getVerticalSnapline",value:function(p,y){var m,_,A=!1,N=p.id;if(N){var U=this.graphModel.fakerNode;if(U&&U.id===N)_=gi(U);else{var H=this.graphModel.getNodeModelById(N);_=gi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ce=gi(ue);if(Ce.minX===_.minX||Ce.maxX===_.minX){A=!0,m=_.minX;break}if(Ce.minX===_.maxX||Ce.maxX===_.maxX){A=!0,m=_.maxX;break}}}return Pa({isShowVertical:A,position:{x:m}})}},{key:"getSnapLinePosition",value:function(p,y){var m=this.getCenterSnapLine(p,y),_=m.isShowHorizontal,A=m.isShowVertical;if(!_){var N=this.getHorizontalSnapline(p,y);N.isShowHorizontal&&(m.isShowHorizontal=N.isShowHorizontal,m.position.y=N.position.y)}if(!A){var U=this.getVerticalSnapline(p,y);U.isShowVertical&&(m.isShowVertical=U.isShowVertical,m.position.x=U.position.x)}return m}},{key:"setSnaplineInfo",value:function(p){var y=p.isShowHorizontal,m=p.isShowVertical,_=p.position;this.position=_,this.isShowHorizontal=y,this.isShowVertical=m}},{key:"clearSnapline",value:function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1}},{key:"setNodeSnapLine",value:function(p){var y=this.graphModel.nodes,m=this.getSnapLinePosition(p,y);this.setSnaplineInfo(m)}}],d&&aF(u.prototype,d),c})(),BC=Sy(Lc.prototype,"isShowHorizontal",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$C=Sy(Lc.prototype,"isShowVertical",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),UC=Sy(Lc.prototype,"position",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sy(Lc.prototype,"clearSnapline",[a.k],Object.getOwnPropertyDescriptor(Lc.prototype,"clearSnapline"),Lc.prototype),Sy(Lc.prototype,"setNodeSnapLine",[a.k],Object.getOwnPropertyDescriptor(Lc.prototype,"setNodeSnapLine"),Lc.prototype),Lc),Ay=new Map,zC=function(c){var u=tl(),d=window.requestAnimationFrame((function p(){if(c(),Ay.get(u)){var y=window.requestAnimationFrame(p);Ay.set(u,y)}}));return Ay.set(u,d),u},Db=function(c){var u=Ay.get(c);u&&(window.cancelAnimationFrame(u),Ay.delete(c))};function Ox(c){return Ox=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Ox(c)}function My(){return My=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},My.apply(this,arguments)}function HC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ty(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?HC(Object(d),!0).forEach((function(p){Cd(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):HC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function lF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return XC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return XC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function XC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function sF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Sx(c,u){return Sx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Sx(c,u)}function uF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=jb(c);if(u){var y=jb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return cF(this,d)}}function cF(c,u){if(u&&(Ox(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Td(c)}function Td(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function jb(c){return jb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},jb(c)}function Cd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var dF=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Sx(m,_)})(y,c);var u,d,p=uF(y);function y(){var m;return(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Cd(Td(m=p.call(this)),"preTargetNode",void 0),Cd(Td(m),"sourceRuleResults",void 0),Cd(Td(m),"targetRuleResults",void 0),Cd(Td(m),"dragHandler",void 0),Cd(Td(m),"t",void 0),Cd(Td(m),"onDragStart",(function(_){var A=_.event,N=m.props,U=N.anchorData,H=N.nodeModel,oe=N.graphModel;oe.overlapMode,oe.selectNodeById(H.id),H.autoToFront&&oe.toFront(H.id),oe.eventCenter.emit(ur.ANCHOR_DRAGSTART,{data:U,e:A,nodeModel:H}),m.setState({startX:U.x,startY:U.y,endX:U.x,endY:U.y})})),Cd(Td(m),"onDragging",(function(_){var A=_.event,N=m.props,U=N.graphModel,H=N.nodeModel,oe=N.anchorData,ue=U.transformModel,Ce=U.eventCenter,Ve=U.width,qe=U.height,Ot=U.editConfigModel,xt=Ot.autoExpand,Ft=Ot.stopMoveGraph,hn=A.clientX,Hn=A.clientY,zn=U.getPointByClient({x:hn,y:Hn}),Ar=zn.domOverlayPosition,Vn=Ar.x,vr=Ar.y,er=zn.canvasOverlayPosition,Eo=er.x,Co=er.y;m.t&&Db(m.t);var zr=[];Vn<10?zr=[10,0]:Vn+10>Ve?zr=[-10,0]:vr<10?zr=[0,10]:vr+10>qe&&(zr=[0,-10]),m.setState({endX:Eo,endY:Co,dragging:!0}),m.moveAnchorEnd(Eo,Co),zr.length>0&&!Ft&&xt&&(m.t=zC((function(){var Fo=lF(zr,2),ga=Fo[0],ya=Fo[1];ue.translate(ga,ya);var Nl=m.state,fu=Nl.endX,pu=Nl.endY;m.setState({endX:fu-ga,endY:pu-ya}),m.moveAnchorEnd(fu-ga,pu-ya)}))),Ce.emit(ur.ANCHOR_DRAG,{data:oe,e:A,nodeModel:H})})),Cd(Td(m),"onDragEnd",(function(_){var A=_.event;m.t&&Db(m.t);var N=m.checkEnd(A);m.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),m.sourceRuleResults.clear(),m.targetRuleResults.clear();var U=m.props,H=U.graphModel,oe=U.nodeModel,ue=U.anchorData;H.eventCenter.emit(ur.ANCHOR_DRAGEND,{data:ue,e:A,nodeModel:oe,edgeModel:N})})),Cd(Td(m),"checkEnd",(function(_){var A=m.props,N=A.graphModel,U=A.nodeModel,H=A.anchorData,oe=H.x,ue=H.y,Ce=H.id,Ve=(N.edgeType,m.state),qe=Ve.endX,Ot=Ve.endY,xt=Ve.dragging,Ft=Cf({x:qe,y:Ot},N);if(m.preTargetNode&&m.preTargetNode.state!==Io.DEFAULT&&m.preTargetNode.setElementState(Io.DEFAULT),xt&&Ft&&Ft.node){var hn=Ft.node,Hn=Ft.anchor.id,zn="".concat(U.id,"_").concat(hn.id,"_").concat(Hn,"_").concat(Ce),Ar=m.sourceRuleResults.get(zn)||{},Vn=Ar.isAllPass,vr=Ar.msg,er=m.targetRuleResults.get(zn)||{},Eo=er.isAllPass,Co=er.msg;if(Vn&&Eo){hn.setElementState(Io.DEFAULT);var zr=N.edgeGenerator(U.getData(),N.getNodeModelById(Ft.node.id).getData()),Fo=N.addEdge(Ty(Ty({},zr),{},{sourceNodeId:U.id,sourceAnchorId:Ce,startPoint:{x:oe,y:ue},targetNodeId:Ft.node.id,targetAnchorId:Ft.anchor.id,endPoint:{x:Ft.anchor.x,y:Ft.anchor.y}})),ga=m.props.anchorData;return N.eventCenter.emit(ur.ANCHOR_DROP,{data:ga,e:_,nodeModel:U,edgeModel:Fo}),Fo}var ya=hn.getData();return N.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:ya,msg:Co||vr||"不允许添加连线"}),null}})),m.sourceRuleResults=new Map,m.targetRuleResults=new Map,m.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},m.dragHandler=new Te({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd}),m}return u=y,(d=[{key:"getAnchorShape",value:function(){var m=this.props,_=m.anchorData,A=m.style,N=m.node.getAnchorShape(_);if(N)return N;var U=_.x,H=_.y,oe=Ty(Ty({},A),A.hover);return Object(re.g)("g",null,Object(re.g)($m,My({className:"lf-node-anchor-hover"},oe,{x:U,y:H})),Object(re.g)($m,My({className:"lf-node-anchor"},A,{x:U,y:H})))}},{key:"customTrajectory",get:function(){return this.props.graphModel.customTrajectory}},{key:"relateEdges",get:function(){var m=this.props,_=m.graphModel,A=_.getAnchorIncomingEdge,N=_.getAnchorOutcomingEdge,U=m.anchorData.id;return{incomingEdgeList:A(U),outcomingEdgeList:N(U)}}},{key:"moveAnchorEnd",value:function(m,_){var A=this.props,N=A.graphModel,U=A.nodeModel,H=A.anchorData,oe=Cf({x:m,y:_},N);if(oe){var ue=oe.node,Ce=oe.anchor.id;if(this.preTargetNode&&this.preTargetNode!==oe.node&&this.preTargetNode.setElementState(Io.DEFAULT),H.id===Ce)return;this.preTargetNode=ue;var Ve="".concat(U.id,"_").concat(ue.id,"_").concat(Ce,"_").concat(H.id);if(!this.targetRuleResults.has(Ve)){var qe=oe.anchor,Ot=U.isAllowConnectedAsSource(ue,H,qe),xt=ue.isAllowConnectedAsTarget(U,H,qe);this.sourceRuleResults.set(Ve,au(Ot)),this.targetRuleResults.set(Ve,au(xt))}var Ft=this.sourceRuleResults.get(Ve).isAllPass,hn=this.targetRuleResults.get(Ve).isAllPass;Ft&&hn?ue.setElementState(Io.ALLOW_CONNECT):ue.setElementState(Io.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Io.DEFAULT&&this.preTargetNode.setElementState(Io.DEFAULT)}},{key:"isShowLine",value:function(){var m=this.state,_=m.startX,A=m.startY,N=m.endX,U=m.endY;return ms(_,A,N,U)>10}},{key:"render",value:function(){var m=this,_=this.state,A=_.startX,N=_.startY,U=_.endX,H=_.endY,oe=this.props,ue=oe.anchorData.edgeAddable,Ce=oe.edgeStyle;return Object(re.g)("g",{className:"lf-anchor"},Object(re.g)("g",{onMouseDown:function(Ve){ue!==!1&&m.dragHandler.handleMouseDown(Ve)}},this.getAnchorShape()),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Ty({sourcePoint:{x:A,y:N},targetPoint:{x:U,y:H}},Ce)):Object(re.g)(Fm,My({x1:A,y1:N,x2:U,y2:H},Ce,{"pointer-events":"none"}))))}}])&&sF(u.prototype,d),y})(re.a);function YC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function fF(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?YC(Object(d),!0).forEach((function(p){pF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):YC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function pF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ax(c){return Ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Ax(c)}function hF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return qC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return qC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function qC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function KC(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.value,_=c.fontSize,A=c.fill,N=A===void 0?"currentColor":A,U=c.overflowMode,H=U===void 0?"default":U,oe=c.textWidth,ue=oe===void 0?"":oe,Ce=c.model,Ve={textAnchor:"middle","dominant-baseline":"middle",x:d,y,fill:N};if(Object.entries(c).forEach((function(Hn){var zn=hF(Hn,2),Ar=zn[0],Vn=zn[1];Ax(Vn)!=="object"&&(Ve[Ar]=Vn)})),m){var qe=String(m).split(/[\r\n]/g),Ot=qe.length;if(H!=="default"){var xt=Ce.BaseType,Ft=Ce.modelType;if(xt===ei.NODE&&Ft!==lo.TEXT_NODE||xt===ei.EDGE&&ue)return(function(Hn){var zn=Hn.value,Ar=Hn.fontSize,Vn=Hn.model,vr=Hn.fontFamily,er=vr===void 0?"":vr,Eo=Hn.lineHeight,Co=Hn.wrapPadding,zr=Co===void 0?"0, 0":Co,Fo=Hn.overflowMode,ga=Hn.x,ya=Hn.y,Nl=Vn.width,fu=Vn.textHeight,pu=Hn.textWidth||Nl,Pd=String(zn).split(/[\r\n]/g),Av=Pd.length,a0=Df({rows:Pd,style:{fontSize:"".concat(Ar,"px"),width:"".concat(pu,"px"),fontFamily:er,lineHeight:Eo,padding:zr},rowsLength:Av,className:"lf-get-text-height"}),Mv=Vn.height>a0?Vn.height:a0;fu&&(Mv=fu);var ah=Fo==="ellipsis";return ah&&(Mv=Ar+2),Object(re.g)("g",null,Object(re.g)("foreignObject",{width:pu,height:Mv,x:ga-pu/2,y:ya-Mv/2},Object(re.g)("div",{className:"lf-node-text-auto-wrap",style:{minHeight:Mv,width:pu,padding:zr}},Object(re.g)("div",{className:ah?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:ah?Pd.join(""):"",style:fF({},Hn)},Pd.map((function(lh){return Object(re.g)("div",{className:"lf-node-text--auto-wrap-inner"},lh)}))))))})(c)}if(Ot>1){var hn=qe.map((function(Hn,zn){var Ar=(zn-(Ot-1)/2)*(_+2);return Object(re.g)("tspan",{className:"lf-text-tspan",x:d,y:y+Ar},Hn)}));return Object(re.g)("text",Ve,hn)}return Object(re.g)("text",Ve,m)}}function Mx(c){return Mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Mx(c)}function Tx(){return Tx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Tx.apply(this,arguments)}function vF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ZC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ZC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ZC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function mF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Cx(c,u){return Cx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Cx(c,u)}function gF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Lb(c);if(u){var y=Lb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return yF(this,d)}}function yF(c,u){if(u&&(Mx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oh(c)}function oh(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Lb(c){return Lb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Lb(c)}function Ev(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var JC=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Cx(m,_)})(y,c);var u,d,p=gF(y);function y(m){var _;(function(N,U){if(!(N instanceof U))throw new TypeError("Cannot call a class as a function")})(this,y),Ev(oh(_=p.call(this)),"dragHandler",void 0),Ev(oh(_),"sumDeltaX",0),Ev(oh(_),"sumDeltaY",0),Ev(oh(_),"stepDrag",void 0),Ev(oh(_),"onDragging",(function(N){var U=N.deltaX,H=N.deltaY,oe=_.props,ue=oe.model,Ce=vF(oe.graphModel.transformModel.fixDeltaXY(U,H),2),Ve=Ce[0],qe=Ce[1];ue.moveText(Ve,qe)})),Ev(oh(_),"dblClickHandler",(function(){_.props.editable&&_.props.model.setElementState(Io.TEXT_EDIT)})),Ev(oh(_),"mouseDownHandle",(function(N){var U=_.props,H=U.draggable,oe=U.model,ue=U.graphModel.editConfigModel.nodeTextDraggable;(H||ue)&&(_.stepDrag.model=oe,_.stepDrag.handleMouseDown(N))})),m.model;var A=m.draggable;return _.stepDrag=new Te({onDragging:_.onDragging,step:1,isStopPropagation:A}),_}return u=y,(d=[{key:"getShape",value:function(){var m=this.props,_=m.model,A=m.graphModel,N=_.text,U=A.editConfigModel,H=N.value,oe=N.x,ue=N.y,Ce=N.editable,Ve=N.draggable,qe={x:oe,y:ue,className:"",value:H};Ce?qe.className="lf-element-text":Ve||U.nodeTextDraggable?qe.className="lf-text-draggable":qe.className="lf-text-disabled";var Ot=_.getTextStyle();return Object(re.g)(KC,Tx({},qe,Ot,{model:_}))}},{key:"render",value:function(){if(this.props.model.text)return Object(re.g)("g",{onMouseDown:this.mouseDownHandle,onDblClick:this.dblClickHandler},this.getShape())}}])&&mF(u.prototype,d),y})(re.a),_F=uc(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null,QC=r(130);function Nx(c){return Nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Nx(c)}function kx(){return kx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},kx.apply(this,arguments)}function bF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Px(c,u){return Px=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Px(c,u)}function wF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ib(c);if(u){var y=Ib(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return EF(this,d)}}function EF(c,u){if(u&&(Nx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Km(c)}function Km(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ib(c){return Ib=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ib(c)}function Cy(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var xF=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Px(m,_)})(y,c);var u,d,p=wF(y);function y(m){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),Cy(Km(_=p.call(this,m)),"style",{}),Cy(Km(_),"defaultAngle",void 0),Cy(Km(_),"normal",void 0),Cy(Km(_),"stepperDrag",void 0),Cy(Km(_),"onDragging",(function(A){var N,U=A.event,H=_.props,oe=H.graphModel,ue=H.nodeModel,Ce=H.eventCenter,Ve=oe.selectNodes,qe=ue.x,Ot=ue.y,xt=U.clientX,Ft=U.clientY,hn=oe.getPointByClient({x:xt,y:Ft}).canvasOverlayPosition,Hn=hn.x,zn=hn.y,Ar=new ot(Hn-qe,zn-Ot),Vn=((N=_.normal)===null||N===void 0?void 0:N.angle(Ar))-_.defaultAngle,vr=new eh(-qe,-Ot).rotate(Vn).translate(qe,Ot).toString();ue.transform=vr,ue.rotate=Vn;var er=Object(QC.map)(Ve,(function(Co){return Co.id}));er.indexOf(ue.id)===-1&&(er=[ue.id]);var Eo=Object(QC.reduce)(er,(function(Co,zr){var Fo=oe.getNodeModelById(zr);return Co[zr]=Fo==null?void 0:Fo.getMoveDistance(0,0,!1),Co}),{});er.forEach((function(Co){oe.getNodeEdges(Co).forEach((function(zr){if(Eo[zr.sourceNodeId]){var Fo=oe.getNodeModelById(zr.sourceNodeId).anchors.find((function(ya){return ya.id===zr.sourceAnchorId}));zr.updateStartPoint(Fo)}if(Eo[zr.targetNodeId]){var ga=oe.getNodeModelById(zr.targetNodeId).anchors.find((function(ya){return ya.id===zr.targetAnchorId}));zr.updateEndPoint(ga)}}))})),Ce.emit(ur.NODE_ROTATE,{e:U,nodeModel:ue})})),_.style=m.style,_.stepperDrag=new Te({onDragging:_.onDragging}),_}return u=y,(d=[{key:"render",value:function(){var m=this,_=this.props.nodeModel,A=_.x,N=_.y,U=A+_.width/2+20,H=N-_.height/2-20;return this.normal=new ot(1,0),this.defaultAngle=this.normal.angle(new ot(U-A,H-N)),_.defaultAngle=this.defaultAngle,Object(re.g)("g",{className:"lf-rotate-control"},Object(re.g)("g",{onMouseDown:function(oe){m.stepperDrag.handleMouseDown(oe)}},Object(re.g)($m,kx({},this.style,{cx:U,cy:H}))))}}])&&bF(u.prototype,d),y})(re.a);function Rx(c){return Rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Rx(c)}var OF=["className"];function Fb(){return Fb=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Fb.apply(this,arguments)}function SF(c,u){if(c==null)return{};var d,p,y=(function(_,A){if(_==null)return{};var N,U,H={},oe=Object.keys(_);for(U=0;U<oe.length;U++)N=oe[U],A.indexOf(N)>=0||(H[N]=_[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);for(p=0;p<m.length;p++)d=m[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function Bb(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return eN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return eN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function eN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function tN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Dx(c,u){return Dx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Dx(c,u)}function AF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=$b(c);if(u){var y=$b(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return MF(this,d)}}function MF(c,u){if(u&&(Rx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rl(c)}function rl(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function $b(c){return $b=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},$b(c)}function pl(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Yf=(function(c){(function(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),A&&Dx(_,A)})(m,c);var u,d,p,y=AF(m);function m(_){var A;(function(ue,Ce){if(!(ue instanceof Ce))throw new TypeError("Cannot call a class as a function")})(this,m),pl(rl(A=y.call(this)),"t",void 0),pl(rl(A),"moveOffset",void 0),pl(rl(A),"stepDrag",void 0),pl(rl(A),"contextMenuTime",void 0),pl(rl(A),"mouseUpDrag",void 0),pl(rl(A),"startTime",void 0),pl(rl(A),"clickTimer",void 0),pl(rl(A),"modelDisposer",void 0),pl(rl(A),"onDragStart",(function(ue){var Ce=ue.event,Ve=Ce.clientX,qe=Ce.clientY,Ot=A.props,xt=Ot.model,Ft=Ot.graphModel.getPointByClient({x:Ve,y:qe}).canvasOverlayPosition,hn=Ft.x,Hn=Ft.y;A.moveOffset={x:xt.x-hn,y:xt.y-Hn}})),pl(rl(A),"onDragging",(function(ue){var Ce=ue.event,Ve=A.props,qe=Ve.model,Ot=Ve.graphModel,xt=Ot.editConfigModel,Ft=xt.stopMoveGraph,hn=xt.autoExpand,Hn=Ot.transformModel,zn=Ot.selectNodes,Ar=Ot.width,Vn=Ot.height,vr=Ot.gridSize;qe.isDragging=!0;var er=Ce.clientX,Eo=Ce.clientY,Co=Ot.getPointByClient({x:er,y:Eo}).canvasOverlayPosition,zr=Co.x,Fo=Co.y,ga=Bb(Hn.CanvasPointToHtmlPoint([zr,Fo]),2),ya=ga[0],Nl=ga[1];if(zr+=A.moveOffset.x,Fo+=A.moveOffset.y,zr=fs(zr,vr),Fo=fs(Fo,vr),Ar&&Vn){if(!hn||Ft||!(ya<0||Nl<0||ya>Ar||Nl>Vn)){var fu=Bb(Hn.CanvasPointToHtmlPoint([zr-qe.width/2,Fo-qe.height/2]),2),pu=fu[0],Pd=fu[1],Av=Bb(Hn.CanvasPointToHtmlPoint([zr+qe.width/2,Fo+qe.height/2]),2),a0=Av[0],Mv=Av[1],ah=Math.max(vr,20),lh=[];pu<0?lh=[ah,0]:a0>Ot.width?lh=[-ah,0]:Pd<0?lh=[0,ah]:Mv>Ot.height&&(lh=[0,-ah]),A.t&&Db(A.t);var c$=new eh(-zr,-Fo).rotate(qe.rotate).translate(zr,Fo).toString();qe.transform=c$;var l0=zn.map((function(s0){return s0.id}));l0.indexOf(qe.id)===-1&&(l0=[qe.id]),lh.length>0&&!Ft&&hn?A.t=zC((function(){var s0=Bb(lh,2),jN=s0[0],LN=s0[1];Hn.translate(jN,LN);var d$=-jN/Hn.SCALE_X,f$=-LN/Hn.SCALE_X;Ot.moveNodes(l0,d$,f$)})):Ot.moveNodes(l0,zr-qe.x,Fo-qe.y)}}else Ot.moveNode2Coordinate(qe.id,zr,Fo)})),pl(rl(A),"onDragEnd",(function(){A.t&&Db(A.t),A.props.model.isDragging=!1})),pl(rl(A),"handleMouseUp",(function(){var ue=A.props.model;A.mouseUpDrag=ue.isDragging})),pl(rl(A),"handleClick",(function(ue){var Ce=A.mouseUpDrag===!1;if(A.startTime){var Ve=A.props,qe=Ve.model,Ot=Ve.graphModel;if(Ce){var xt={data:qe.getData(),e:ue,position:Ot.getPointByClient({x:ue.clientX,y:ue.clientY}),isSelected:!1,isMultiple:!1},Ft=ue.button===2,hn=ue.detail===2;if(!Ft){var Hn=Ot.editConfigModel,zn=yd(ue,Hn);xt.isMultiple=zn,qe.isSelected&&!hn&&zn?(xt.isSelected=!1,qe.setSelected(!1)):(Ot.selectNodeById(qe.id,zn),xt.isSelected=!0,A.toFront()),hn?(Hn.nodeTextEdit&&qe.text.editable&&(qe.setSelected(!1),Ot.setElementStateById(qe.id,Io.TEXT_EDIT)),Ot.eventCenter.emit(ur.NODE_DBCLICK,xt)):(Ot.eventCenter.emit(ur.ELEMENT_CLICK,xt),Ot.eventCenter.emit(ur.NODE_CLICK,xt))}}}})),pl(rl(A),"handleContextMenu",(function(ue){ue.preventDefault();var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel,Ot=Ve.getData(),xt=qe.getPointByClient({x:ue.clientX,y:ue.clientY});qe.setElementStateById(Ve.id,Io.SHOW_MENU,xt.domOverlayPosition),Ve.isSelected||qe.selectNodeById(Ve.id),qe.eventCenter.emit(ur.NODE_CONTEXTMENU,{data:Ot,e:ue,position:xt}),A.toFront()})),pl(rl(A),"handleMouseDown",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel;A.startTime=new Date().getTime(),qe.editConfigModel.adjustNodePosition&&Ve.draggable&&A.stepDrag&&A.stepDrag.handleMouseDown(ue)})),pl(rl(A),"setHoverON",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel;if(!Ve.isHovered){var Ot=Ve.getData();Ve.setHovered(!0),qe.eventCenter.emit(ur.NODE_MOUSEENTER,{data:Ot,e:ue})}})),pl(rl(A),"setHoverOFF",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel,Ot=Ve.getData();Ve.isHovered&&(Ve.setHovered(!1),qe.eventCenter.emit(ur.NODE_MOUSELEAVE,{data:Ot,e:ue}))})),pl(rl(A),"onMouseOut",(function(ue){_F&&A.setHoverOFF(ue)}));var N=_.graphModel,U=N.gridSize,H=N.eventCenter,oe=_.model;return A.stepDrag=new Te({onDragStart:A.onDragStart,onDragging:A.onDragging,onDragEnd:A.onDragEnd,step:U,eventType:"NODE",isStopPropagation:!1,eventCenter:H,model:oe}),A.modelDisposer=Object(a.F)((function(){return A.props}),(function(ue){ue&&ue.model&&A.stepDrag.setModel(ue.model)})),A}return u=m,p=[{key:"getModel",value:function(_){return _}}],(d=[{key:"componentWillUnmount",value:function(){this.modelDisposer&&this.modelDisposer()}},{key:"getAnchorShape",value:function(_){return null}},{key:"getAnchors",value:function(){var _=this,A=this.props,N=A.model,U=A.graphModel,H=N.isSelected,oe=N.isHitable,ue=N.isDragging,Ce=N.isShowAnchor;return oe&&(H||Ce)&&!ue?Ep(N.anchors,(function(Ve,qe){var Ot=N.getAnchorLineStyle(Ve),xt=N.getAnchorStyle(Ve);return Object(re.g)(dF,{anchorData:Ve,node:_,style:xt,edgeStyle:Ot,anchorIndex:qe,nodeModel:N,graphModel:U,setHoverOFF:_.setHoverOFF})})):[]}},{key:"getRotateControl",value:function(){var _=this.props,A=_.model,N=_.graphModel,U=A.isSelected,H=A.isHitable,oe=A.enableRotate,ue=A.isHovered,Ce=A.getRotateControlStyle().style;if(H&&(U||ue)&&oe)return Object(re.g)(xF,{graphModel:N,nodeModel:A,eventCenter:N.eventCenter,style:Ce})}},{key:"getText",value:function(){var _=this.props,A=_.model,N=_.graphModel;if(A.state===Io.TEXT_EDIT)return"";if(A.text){var U=N.editConfigModel,H=!1;return(A.text.draggable||U.nodeTextDraggable)&&(H=!0),Object(re.g)(JC,{editable:U.nodeTextEdit&&A.text.editable,model:A,graphModel:N,draggable:H})}}},{key:"getStateClassName",value:function(){var _=this.props.model,A=_.state,N=_.isDragging,U=_.isSelected,H="lf-node";switch(A){case Io.ALLOW_CONNECT:H+=" lf-node-allow";break;case Io.NOT_ALLOW_CONNECT:H+=" lf-node-not-allow";break;default:H+=" lf-node-default"}return N&&(H+=" lf-isDragging"),U&&(H+=" lf-node-selected"),H}},{key:"toFront",value:function(){var _=this.props,A=_.model,N=_.graphModel;A.autoToFront&&N.toFront(A.id)}},{key:"render",value:function(){var _,A=this.props,N=A.model,U=A.graphModel,H=U.editConfigModel,oe=H.hideAnchors,ue=H.adjustNodePosition,Ce=H.allowRotation,Ve=U.gridSize,qe=U.transformModel.SCALE_X,Ot=N.isHitable,xt=N.draggable,Ft=N.transform,hn=N.getOuterGAttributes(),Hn=hn.className,zn=Hn===void 0?"":Hn,Ar=SF(hn,OF),Vn=Object(re.g)("g",{className:"lf-node-content"},Object(re.g)("g",{transform:Ft},this.getShape(),this.getText(),Ce&&this.getRotateControl()),!oe&&this.getAnchors());return Ot?(ue&&xt&&this.stepDrag.setStep(Ve*qe),_=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverON,onMouseOver:this.setHoverON,onMouseLeave:this.setHoverOFF,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},Ar),Vn)):_=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn)},Ar),Vn),_}}])&&tN(u.prototype,d),p&&tN(u,p),m})(re.a);function jx(c){return jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},jx(c)}function Lx(){return Lx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Lx.apply(this,arguments)}function TF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function CF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Ix(c,u){return Ix=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ix(c,u)}function NF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ub(c);if(u){var y=Ub(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return kF(this,d)}}function kF(c,u){if(u&&(jx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Ub(c){return Ub=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ub(c)}var Fx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Ix(m,_)})(y,c);var u,d,p=NF(y);function y(){return TF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)(th,Lx({},_,{x:m.x,y:m.y,width:m.width,height:m.height,radius:m.radius}))}}])&&CF(u.prototype,d),y})(Yf);function Bx(c){return Bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Bx(c)}function $x(){return $x=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},$x.apply(this,arguments)}function PF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function RF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Ux(c,u){return Ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ux(c,u)}function DF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Vb(c);if(u){var y=Vb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return jF(this,d)}}function jF(c,u){if(u&&(Bx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Vb(c){return Vb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Vb(c)}var Vx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Ux(m,_)})(y,c);var u,d,p=DF(y);function y(){return PF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.r,U=m.getNodeStyle();return Object(re.g)($m,$x({},U,{x:_,y:A,r:N}))}}])&&RF(u.prototype,d),y})(Yf);function Gx(c){return Gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Gx(c)}function LF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return nN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return nN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function nN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function rN(c){var u=c.points,d=c.className,p={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Object.entries(c).forEach((function(y){var m=LF(y,2),_=m[0],A=m[1];Gx(A)!=="object"&&(p[_]=A)})),p.className=d?"lf-basic-shape ".concat(d):"lf-basic-shape",p.points=u.map((function(y){return y.join(",")})).join(" "),Object(re.g)("polygon",p)}function Wx(c){return Wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Wx(c)}function zx(){return zx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},zx.apply(this,arguments)}function IF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function FF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Hx(c,u){return Hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Hx(c,u)}function BF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Gb(c);if(u){var y=Gb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return $F(this,d)}}function $F(c,u){if(u&&(Wx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Gb(c){return Gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Gb(c)}var Xx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Hx(m,_)})(y,c);var u,d,p=BF(y);function y(){return IF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.width,U=m.height,H=m.points,oe=m.getNodeStyle(),ue={transform:"matrix(1 0 0 1 ".concat(_-N/2," ").concat(A-U/2,")")};return Object(re.g)("g",ue,Object(re.g)(rN,zx({},oe,{points:H,x:_,y:A})))}}])&&FF(u.prototype,d),y})(Yf);function Yx(c){return Yx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Yx(c)}function qx(){return qx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},qx.apply(this,arguments)}function UF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function VF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Kx(c,u){return Kx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Kx(c,u)}function GF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Wb(c);if(u){var y=Wb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return WF(this,d)}}function WF(c,u){if(u&&(Yx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Wb(c){return Wb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Wb(c)}var Zx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Kx(m,_)})(y,c);var u,d,p=GF(y);function y(){return UF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)("g",null,Object(re.g)(rN,qx({},_,{points:m.points,x:m.x,y:m.y})))}}])&&VF(u.prototype,d),y})(Yf);function Jx(c){return Jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Jx(c)}function zF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return oN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return oN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function oN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function HF(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.rx,_=m===void 0?4:m,A=c.ry,N=A===void 0?4:A,U=c.className,H={cx:d,cy:y,rx:_,ry:N,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(oe){var ue=zF(oe,2),Ce=ue[0],Ve=ue[1];Jx(Ve)!=="object"&&(H[Ce]=Ve)})),H.className=U?"lf-basic-shape ".concat(U):"lf-basic-shape",Object(re.g)("ellipse",H)}function Qx(c){return Qx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Qx(c)}function eO(){return eO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},eO.apply(this,arguments)}function XF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function YF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function tO(c,u){return tO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},tO(c,u)}function qF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=zb(c);if(u){var y=zb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return KF(this,d)}}function KF(c,u){if(u&&(Qx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function zb(c){return zb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},zb(c)}var nO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&tO(m,_)})(y,c);var u,d,p=qF(y);function y(){return XF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)(HF,eO({},_,{x:m.x,y:m.y,rx:m.rx,ry:m.ry}))}}])&&YF(u.prototype,d),y})(Yf);function rO(c){return rO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},rO(c)}function iN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function aN(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?iN(Object(d),!0).forEach((function(p){ZF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):iN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ZF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function JF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function QF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function oO(c,u){return oO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},oO(c,u)}function eB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Hb(c);if(u){var y=Hb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return tB(this,d)}}function tB(c,u){if(u&&(rO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Hb(c){return Hb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hb(c)}var iO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&oO(m,_)})(y,c);var u,d,p=eB(y);function y(){return JF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getBackground",value:function(){var m=this.props.model,_=m.getTextStyle(),A=m.width,N=m.height,U=m.x,H=m.y,oe=aN(aN({},_.background),{},{x:U,y:H-1,width:A,height:N});return Object(re.g)(th,oe)}},{key:"getShape",value:function(){return Object(re.g)("g",null,this.getBackground())}}])&&QF(u.prototype,d),y})(Yf);function aO(c){return aO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},aO(c)}function lO(){return lO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},lO.apply(this,arguments)}function nB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function rB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function sO(c,u){return sO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},sO(c,u)}function oB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Xb(c);if(u){var y=Xb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return iB(this,d)}}function iB(c,u){if(u&&(aO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ny(c)}function Ny(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Xb(c){return Xb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xb(c)}function Yb(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var uO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&sO(m,_)})(y,c);var u,d,p=oB(y);function y(){var m;nB(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Yb(Ny(m=p.call.apply(p,[this].concat(A))),"ref",void 0),Yb(Ny(m),"currentProperties",void 0),Yb(Ny(m),"preProperties",void 0),Yb(Ny(m),"setRef",(function(U){m.ref=U})),m}return u=y,(d=[{key:"rootEl",get:function(){return this.ref}},{key:"setHtml",value:function(m){m.appendChild(document.createElement("div"))}},{key:"shouldUpdate",value:function(){if(!this.preProperties||this.preProperties!==this.currentProperties)return this.preProperties=this.currentProperties,!0}},{key:"componentDidMount",value:function(){this.shouldUpdate()&&this.setHtml(this.rootEl)}},{key:"componentDidUpdate",value:function(){this.shouldUpdate()&&this.setHtml(this.rootEl)}},{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.height,U=m.width,H=m.getNodeStyle();return this.currentProperties=JSON.stringify(m.properties),Object(re.g)("foreignObject",lO({},H,{x:_-U/2,y:A-N/2,width:U,height:N,ref:this.setRef}))}}])&&rB(u.prototype,d),y})(Yf);function cO(c){return cO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},cO(c)}function dO(){return dO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},dO.apply(this,arguments)}function lN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xv(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?lN(Object(d),!0).forEach((function(p){hO(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):lN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function aB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function fO(c,u){return fO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},fO(c,u)}function lB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=qb(c);if(u){var y=qb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return sB(this,d)}}function sB(c,u){if(u&&(cO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pO(c)}function pO(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qb(c){return qb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qb(c)}function hO(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var uB=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&fO(m,_)})(y,c);var u,d,p=lB(y);function y(m){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),hO(pO(_=p.call(this,m)),"setHoverON",(function(){_.setState({isHovered:!0})})),hO(pO(_),"setHoverOFF",(function(){_.setState({isHovered:!1})})),_.state={isHovered:!1},_}return u=y,(d=[{key:"getBackground",value:function(){var m=this.props.model,_=m.getTextStyle(),A=m.text,N=m.width,U=_.background||{};if(this.state.isHovered&&_.hover&&_.hover.background&&(U=xv(xv({},U),_.hover.background)),A&&A.value&&U.fill!=="transparent"){var H,oe=_.fontSize,ue=_.overflowMode,Ce=_.lineHeight,Ve=_.wrapPadding,qe=_.textWidth,Ot=A.value,xt=A.x,Ft=A.y,hn=String(Ot).split(/[\r\n]/g),Hn=hn.length;if(ue==="autoWrap"&&qe){var zn=Df({rows:hn,style:{fontSize:"".concat(oe,"px"),width:"".concat(qe,"px"),lineHeight:Ce,padding:Ve},rowsLength:Hn,className:"lf-get-text-height"});H=xv(xv({},U),{},{x:xt-1,y:Ft-1,width:qe,height:zn})}else{hn&&hn.forEach((function(Eo){Pi(Eo)}));var Ar=Mc({rows:hn,fontSize:oe,rowsLength:Hn}),Vn=Ar.width,vr=Ar.height;if(ue==="ellipsis"&&(Vn=qe||N,vr=oe+2),typeof U.wrapPadding=="string"){var er=U.wrapPadding.split(",").filter((function(Eo){return Eo.trim()})).map((function(Eo){return parseFloat(Eo.trim())}));er.length>0&&er.length<=4&&(er.length===1?er=[er[0],er[0],er[0],er[0]]:er.length===2?er=[er[0],er[1],er[0],er[1]]:er.length===3&&(er=[er[0],er[1],er[2],er[1]]),Vn+=er[1]+er[3],vr+=er[0]+er[2],xt+=(er[1]-er[3])/2,Ft+=(er[2]-er[0])/2)}H=xv(xv({},U),{},{x:xt-1,y:Ft-1,width:Vn,height:vr})}return Object(re.g)(th,H)}}},{key:"getShape",value:function(){var m=this.props.model,_=m.text,A=_.value,N=_.x,U=_.y;if(A){var H=xv({x:N,y:U,className:"lf-element-text",value:A},m.getTextStyle());return Object(re.g)("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getBackground(),Object(re.g)(KC,dO({},H,{model:m})))}}}])&&aB(u.prototype,d),y})(JC);function vO(c){return vO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},vO(c)}var Nd,cB=["text","sourceAnchorId","targetAnchorId"];function sN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function qf(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?sN(Object(d),!0).forEach((function(p){du(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):sN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function dB(c,u){if(c==null)return{};var d,p,y=(function(_,A){if(_==null)return{};var N,U,H={},oe=Object.keys(_);for(U=0;U<oe.length;U++)N=oe[U],A.indexOf(N)>=0||(H[N]=_[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);for(p=0;p<m.length;p++)d=m[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function fB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return uN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return uN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function uN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function pB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function mO(c,u){return mO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},mO(c,u)}function hB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Kb(c);if(u){var y=Kb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return vB(this,d)}}function vB(c,u){if(u&&(vO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cu(c)}function cu(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Kb(c){return Kb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Kb(c)}function du(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}(function(c){c.SOURCE="SOURCE",c.TARGET="TARGET"})(Nd||(Nd={}));var cN=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&mO(m,_)})(y,c);var u,d,p=hB(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),du(cu(_=p.call(this)),"stepDragData",void 0),du(cu(_),"stepDrag",void 0),du(cu(_),"oldEdge",void 0),du(cu(_),"preTargetNode",void 0),du(cu(_),"targetRuleResults",void 0),du(cu(_),"sourceRuleResults",void 0),du(cu(_),"handleMouseDown",(function(H){_.stepDrag&&_.stepDrag.handleMouseDown(H)})),du(cu(_),"onDragStart",(function(){var H=_.props,oe=H.x,ue=H.y,Ce=H.edgeModel,Ve=Ce.startPoint,qe=Ce.endPoint,Ot=Ce.pointsList;_.oldEdge={startPoint:Ve,endPoint:qe,pointsList:Ot},_.setState({endX:oe,endY:ue,dragging:!0})})),du(cu(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ce=_.state,Ve=Ce.endX,qe=Ce.endY,Ot=_.props,xt=Ot.graphModel,Ft=Ot.type,hn=xt.transformModel,Hn=xt.editConfigModel,zn=fB(hn.moveCanvasPointByHtml([Ve,qe],oe,ue),2),Ar=zn[0],Vn=zn[1];_.setState({endX:Ar,endY:Vn,dragging:!0});var vr=_.props.edgeModel,er=Cf({x:Ve,y:qe},xt);if(er&&er.node&&_.isAllowAdjust(er).pass){var Eo,Co=vr.startPoint,zr=vr.endPoint,Fo=vr.sourceNode,ga=vr.targetNode;Ft===Nd.SOURCE?Eo={startPoint:{x:er.anchor.x,y:er.anchor.y},endPoint:{x:zr.x,y:zr.y},sourceNode:er.node,targetNode:ga}:Ft===Nd.TARGET&&(Eo={startPoint:{x:Co.x,y:Co.y},endPoint:{x:er.anchor.x,y:er.anchor.y},sourceNode:Fo,targetNode:er.node}),vr.updateAfterAdjustStartAndEnd(Eo)}else Ft===Nd.SOURCE?vr.updateStartPoint({x:Ar,y:Vn}):Ft===Nd.TARGET&&vr.updateEndPoint({x:Ar,y:Vn});vr.text.value&&Hn.adjustEdge&&vr.setText(Object.assign({},vr.text,vr.textPosition))})),du(cu(_),"onDragEnd",(function(H){var oe=H.event;try{var ue;_.setState({dragging:!1});var Ce=_.props,Ve=Ce.graphModel,qe=Ce.edgeModel,Ot=Ce.type,xt=_.state,Ft=xt.endX,hn=xt.endY,Hn=xt.dragging,zn=Cf({x:Ft,y:hn},Ve);if(!Hn)return;var Ar,Vn=!1;if(zn&&zn.node){var vr=_.isAllowAdjust(zn),er=vr.pass,Eo=vr.msg,Co=vr.newTargetNode;if(er){var zr=qe.getData(),Fo=zr.text,ga=zr.sourceAnchorId,ya=ga===void 0?"":ga,Nl=zr.targetAnchorId;Ar=qf(qf({sourceAnchorId:ya,targetAnchorId:Nl===void 0?"":Nl},dB(zr,cB)),{},{text:(Fo==null?void 0:Fo.value)||""}),Ot===Nd.SOURCE?(Ar=qf(qf({},Ve.edgeGenerator(Ve.getNodeModelById(zn.node.id).getData(),Ve.getNodeModelById(qe.targetNodeId).getData(),Ar)),{},{sourceNodeId:zn.node.id,sourceAnchorId:zn.anchor.id,startPoint:{x:zn.anchor.x,y:zn.anchor.y},targetNodeId:qe.targetNodeId,endPoint:qf({},qe.endPoint)}),qe.sourceNodeId===zn.node.id&&qe.sourceAnchorId===zn.anchor.id&&(Vn=!0)):Ot===Nd.TARGET&&(Ar=qf(qf({},Ve.edgeGenerator(Ve.getNodeModelById(qe.sourceNodeId).getData(),Ve.getNodeModelById(zn.node.id).getData(),Ar)),{},{sourceNodeId:qe.sourceNodeId,startPoint:qf({},qe.startPoint),targetNodeId:zn.node.id,targetAnchorId:zn.anchor.id,endPoint:{x:zn.anchor.x,y:zn.anchor.y}}),qe.targetNodeId===zn.node.id&&qe.targetAnchorId===zn.anchor.id&&(Vn=!0))}else{Vn=!0;var fu=Co.getData();Ve.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:fu,msg:Eo})}}else Vn=!0;if(Vn)_.recoveryEdge();else{var pu=qe.getData();Ve.deleteEdgeById(qe.id);var Pd=Ve.addEdge(qf({},Ar));Ve.eventCenter.emit(ur.EDGE_EXCHANGE_NODE,{data:{newEdge:Pd.getData(),oldEdge:pu}})}(ue=_.preTargetNode)===null||ue===void 0||ue.setElementState(Io.DEFAULT)}finally{_.props.graphModel.eventCenter.emit(ur.ADJUST_POINT_DRAGEND,{e:oe,data:_.stepDragData})}})),du(cu(_),"recoveryEdge",(function(){var H=_.props.edgeModel,oe=_.oldEdge,ue=oe.startPoint,Ce=oe.endPoint,Ve=oe.pointsList;H.updateStartPoint(ue),H.updateEndPoint(Ce),H.modelType!==lo.LINE_EDGE&&(H.pointsList=Ve,H.initPoints())})),du(cu(_),"getAdjustPointStyle",(function(){var H=_.props,oe=H.graphModel.theme;return H.edgeModel,oe.edgeAdjust})),_.state={dragging:!1,endX:0,endY:0},_.targetRuleResults=new Map,_.sourceRuleResults=new Map;var A=m.type,N=m.edgeModel,U=m.graphModel.eventCenter;return _.stepDragData={type:A,edgeData:N.getData()},_.stepDrag=new Te({onDragStart:_.onDragStart,onDragging:_.onDragging,onDragEnd:_.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:U,data:_.stepDragData}),_}return u=y,(d=[{key:"isAllowAdjust",value:function(m){var _=this.props,A=_.edgeModel,N=A.id,U=A.sourceNode,H=A.targetNode,oe=A.sourceAnchorId,ue=A.targetAnchorId,Ce=_.type,Ve=null,qe=null,Ot=null,xt=null;if(Ce===Nd.SOURCE?(Ve=m.node,qe=H,Ot=m.anchor,xt=H.getAnchorInfo(ue)):(Ve=U,qe=m.node,xt=m.anchor,Ot=U.getAnchorInfo(oe)),this.preTargetNode&&this.preTargetNode!==m.node&&this.preTargetNode.setElementState(Io.DEFAULT),this.preTargetNode=m.node,xt.id===Ot.id)return{pass:!1,msg:"",newTargetNode:qe};var Ft="".concat(Ve.id,"_").concat(qe.id,"_").concat(Ot.id,"_").concat(xt.id);if(!this.targetRuleResults.has(Ft)){var hn=Ve.isAllowConnectedAsSource(qe,Ot,xt,N),Hn=qe.isAllowConnectedAsTarget(Ve,Ot,xt,N);this.sourceRuleResults.set(Ft,au(hn)),this.targetRuleResults.set(Ft,au(Hn))}var zn=this.sourceRuleResults.get(Ft),Ar=zn.isAllPass,Vn=zn.msg,vr=this.targetRuleResults.get(Ft),er=vr.isAllPass,Eo=vr.msg,Co=Ar&&er?Io.ALLOW_CONNECT:Io.NOT_ALLOW_CONNECT;return Ce===Nd.SOURCE?Ve.setElementState(Co):qe.setElementState(Co),{pass:Ar&&er,msg:Eo||Vn,newTargetNode:qe}}},{key:"render",value:function(){var m=this.props,_=m.x,A=m.y,N=m.getAdjustPointShape,U=m.edgeModel,H=this.state.dragging;return Object(re.g)("g",{pointerEvents:H?"none":"",onMouseDown:this.handleMouseDown},H?"":N(_,A,U))}}])&&pB(u.prototype,d),y})(re.a);function gO(c){return gO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},gO(c)}function ky(){return ky=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},ky.apply(this,arguments)}function mB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return dN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return dN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function dN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function gB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function yB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function yO(c,u){return yO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yO(c,u)}function _B(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Zb(c);if(u){var y=Zb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return bB(this,d)}}function bB(c,u){if(u&&(gO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ic(c)}function Ic(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Zb(c){return Zb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Zb(c)}function kd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Py=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&yO(m,_)})(y,c);var u,d,p=_B(y);function y(){var m;gB(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return kd(Ic(m=p.call.apply(p,[this].concat(A))),"startTime",void 0),kd(Ic(m),"contextMenuTime",void 0),kd(Ic(m),"clickTimer",void 0),kd(Ic(m),"textRef",Object(re.f)()),kd(Ic(m),"handleHover",(function(U,H){var oe=m.props,ue=oe.model,Ce=oe.graphModel.eventCenter;ue.setHovered(U);var Ve=U?ur.EDGE_MOUSEENTER:ur.EDGE_MOUSELEAVE,qe=ue.getData();Ce.emit(Ve,{data:qe,e:H})})),kd(Ic(m),"setHoverON",(function(U){m.props.model.isHovered||(m.textRef&&m.textRef.current&&m.textRef.current.setHoverON(),m.handleHover(!0,U))})),kd(Ic(m),"setHoverOFF",(function(U){m.props.model.isHovered&&(m.textRef&&m.textRef.current&&m.textRef.current.setHoverOFF(),m.handleHover(!1,U))})),kd(Ic(m),"handleContextMenu",(function(U){U.preventDefault(),m.contextMenuTime=new Date().getTime(),m.clickTimer&&clearTimeout(m.clickTimer);var H=m.props,oe=H.model,ue=H.graphModel,Ce=ue.getPointByClient({x:U.clientX,y:U.clientY});ue.setElementStateById(oe.id,Io.SHOW_MENU,Ce.domOverlayPosition),m.toFront(),oe.isSelected||ue.selectEdgeById(oe.id);var Ve=oe==null?void 0:oe.getData();ue.eventCenter.emit(ur.EDGE_CONTEXTMENU,{data:Ve,e:U,position:Ce})})),kd(Ic(m),"handleMouseDown",(function(U){U.stopPropagation(),m.startTime=new Date().getTime()})),kd(Ic(m),"handleMouseUp",(function(U){if(m.startTime&&!(new Date().getTime()-m.startTime>200||U.button===2)){var H=U.detail===2,oe=m.props,ue=oe.model,Ce=oe.graphModel,Ve=ue==null?void 0:ue.getData(),qe=Ce.getPointByClient({x:U.clientX,y:U.clientY});if(H){var Ot=Ce.editConfigModel,xt=Ce.textEditElement;if(xt&&xt.id===ue.id&&Ce.setElementStateById(ue.id,Io.DEFAULT),Ot.edgeTextEdit&&ue.text.editable&&Ce.setElementStateById(ue.id,Io.TEXT_EDIT),ue.modelType===lo.POLYLINE_EDGE){var Ft=ue,hn=Ce.getPointByClient({x:U.x,y:U.y}).canvasOverlayPosition,Hn=hn.x,zn=hn.y,Ar=co({x:Hn,y:zn},Ft.points);Ft.dbClickPosition=Ar}Ce.eventCenter.emit(ur.EDGE_DBCLICK,{data:Ve,e:U,position:qe})}else Ce.eventCenter.emit(ur.ELEMENT_CLICK,{data:Ve,e:U,position:qe}),Ce.eventCenter.emit(ur.EDGE_CLICK,{data:Ve,e:U,position:qe});var Vn=Ce.editConfigModel;Ce.selectEdgeById(ue.id,yd(U,Vn)),m.toFront()}})),m}return u=y,(d=[{key:"getShape",value:function(){return Object(re.g)("g",null,this.getEdge())}},{key:"getTextStyle",value:function(){}},{key:"getText",value:function(){var m=this.props,_=m.model,A=m.graphModel;if(_.state===Io.TEXT_EDIT)return null;var N=!1,U=A.editConfigModel;return(_.text.draggable||U.edgeTextDraggable)&&(N=!0),Object(re.g)(uB,{ref:this.textRef,editable:U.edgeTextEdit&&_.text.editable,model:_,graphModel:A,draggable:N})}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=m.isSelected;return{start:_,end:A,hover:this.state.hover,isSelected:N}}},{key:"getLastTwoPoints",value:function(){var m=this.props.model;return[m.startPoint,m.endPoint]}},{key:"getArrowStyle",value:function(){return null}},{key:"getArrow",value:function(){var m=this.props.model,_=m.id,A=m.getArrowStyle(),N=A.refY,U=N===void 0?0:N,H=A.refX,oe=H===void 0?2:H,ue=mB(this.getLastTwoPoints(),2),Ce=ue[0],Ve=ue[1],qe="auto";return Ce!==null&&Ve!==null&&(qe=gv(Jp({x:Ve.x-Ce.x,y:Ve.y-Ce.y,z:0}))),Object(re.g)("g",null,Object(re.g)("defs",null,Object(re.g)("marker",{id:"marker-start-".concat(_),refX:-oe,refY:U,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse"},this.getStartArrow()),Object(re.g)("marker",{id:"marker-end-".concat(_),refX:oe,refY:U,overflow:"visible",orient:qe,markerUnits:"userSpaceOnUse"},this.getEndArrow())))}},{key:"getStartArrow",value:function(){var m=this.props.model.getArrowStyle();return m.stroke,m.strokeWidth,m.offset,m.verticalLength,Object(re.g)("path",null)}},{key:"getEndArrow",value:function(){var m=this.props.model.getArrowStyle(),_=m.stroke,A=m.strokeWidth,N=m.offset,U=m.verticalLength;return Object(re.g)("path",{stroke:_,fill:_,strokeWidth:A,transform:"rotate(180)",d:"M 0 0 L ".concat(N," -").concat(U," L ").concat(N," ").concat(U," Z")})}},{key:"getAdjustPointShape",value:function(m,_,A){var N=A.getAdjustPointStyle();return Object(re.g)($m,ky({className:"lf-edge-adjust-point"},N,{x:m,y:_}))}},{key:"getAdjustPoints",value:function(){var m=this.props,_=m.model,A=m.graphModel,N=_.getAdjustStart(),U=_.getAdjustEnd();return Object(re.g)("g",null,Object(re.g)(cN,ky({type:"SOURCE"},N,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:_,graphModel:A})),Object(re.g)(cN,ky({type:"TARGET"},U,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:_,graphModel:A})))}},{key:"getAnimation",value:function(){}},{key:"getAppendWidth",value:function(){return Object(re.g)("g",null)}},{key:"getAppend",value:function(){return Object(re.g)("g",{className:"lf-edge-append"},this.getAppendWidth())}},{key:"getEdge",value:function(){return null}},{key:"toFront",value:function(){var m=this.props,_=m.graphModel,A=m.model;_.toFront(A.id)}},{key:"render",value:function(){var m=this.props,_=m.model,A=_.isSelected,N=_.isHitable,U=_.isShowAdjustPoint;return m.graphModel.animation,Object(re.g)("g",null,Object(re.g)("g",{className:["lf-edge",!N&&"pointer-none",A&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverON,onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getShape(),this.getAppend(),this.getText(),this.getArrow()),U&&A?this.getAdjustPoints():"")}}])&&yB(u.prototype,d),y})(re.a);function _O(c){return _O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},_O(c)}function wB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return fN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return fN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function fN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var Ry=function(c){var u={d:""};return Object.entries(c).forEach((function(d){var p=wB(d,2),y=p[0],m=p[1],_=_O(m);y!=="style"&&_==="object"||(u[y]=m)})),Object(re.g)("path",u)};function bO(c){return bO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bO(c)}function wO(){return wO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},wO.apply(this,arguments)}function EB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function xB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function EO(c,u){return EO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},EO(c,u)}function OB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Jb(c);if(u){var y=Jb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return SB(this,d)}}function SB(c,u){if(u&&(bO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Jb(c){return Jb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Jb(c)}var xO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&EO(m,_)})(y,c);var u,d,p=OB(y);function y(){return EB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=m.isAnimation,U=m.arrowConfig,H=m.getEdgeStyle(),oe=m.getEdgeAnimationStyle(),ue=oe.strokeDasharray,Ce=oe.stroke,Ve=oe.strokeDashoffset,qe=oe.animationName,Ot=oe.animationDuration,xt=oe.animationIterationCount,Ft=oe.animationTimingFunction,hn=oe.animationDirection;return Object(re.g)(Fm,wO({},H,{x1:_.x,y1:_.y,x2:A.x,y2:A.y},U,N?{strokeDasharray:ue,stroke:Ce,style:{strokeDashoffset:Ve,animationName:qe,animationDuration:Ot,animationIterationCount:xt,animationTimingFunction:Ft,animationDirection:hn}}:{}))}},{key:"getAppendWidth",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=la({start:_,end:A}),U=N.d,H=N.strokeWidth,oe=N.fill,ue=N.strokeDasharray,Ce=N.stroke;return Object(re.g)(Ry,{d:U,fill:oe,strokeWidth:H,stroke:Ce,strokeDasharray:ue})}}])&&xB(u.prototype,d),y})(Py);function OO(c){return OO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},OO(c)}function AB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return pN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return pN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var MB=function(c){var u={points:"",fill:"none"};return Object.entries(c).forEach((function(d){var p=AB(d,2),y=p[0],m=p[1];(y==="style"||OO(m)!=="object")&&(u[y]=m)})),Object(re.g)("polyline",u)};function SO(c){return SO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},SO(c)}function hN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Qb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hN(Object(d),!0).forEach((function(p){Zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function AO(){return AO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},AO.apply(this,arguments)}function TB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return vN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return vN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function vN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function CB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function MO(c,u){return MO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},MO(c,u)}function NB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=e0(c);if(u){var y=e0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return kB(this,d)}}function kB(c,u){if(u&&(SO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kf(c)}function Kf(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function e0(c){return e0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},e0(c)}function Zf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var TO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&MO(m,_)})(y,c);var u,d,p=NB(y);function y(){var m;return(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Zf(Kf(m=p.call(this)),"drag",void 0),Zf(Kf(m),"isDragging",void 0),Zf(Kf(m),"isShowAdjustPointTemp",void 0),Zf(Kf(m),"appendInfo",void 0),Zf(Kf(m),"onDragStart",(function(){var _=m.props.model;_.dragAppendStart(),m.isShowAdjustPointTemp=_.isShowAdjustPoint,_.isShowAdjustPoint=!1})),Zf(Kf(m),"onDragging",(function(_){var A=_.deltaX,N=_.deltaY,U=m.props,H=U.model,oe=U.graphModel;m.isDragging=!0;var ue=oe.transformModel,Ce=oe.editConfigModel,Ve=TB(ue.fixDeltaXY(A,N),2),qe=Ve[0],Ot=Ve[1],xt=H,Ft=Ce.adjustEdgeMiddle;m.appendInfo=Ft?xt.dragAppendSimple(m.appendInfo,{x:qe,y:Ot}):xt.dragAppend(m.appendInfo,{x:qe,y:Ot})})),Zf(Kf(m),"onDragEnd",(function(){var _=m.props,A=_.model,N=_.graphModel.eventCenter,U=A;U.dragAppendEnd(),m.isDragging=!1,U.isShowAdjustPoint=m.isShowAdjustPointTemp,m.appendInfo=void 0,N.emit(ur.EDGE_ADJUST,{data:U.getData()})})),Zf(Kf(m),"beforeDragStart",(function(_,A){A.dragAble&&m.drag.handleMouseDown(_),m.appendInfo=A})),m.drag=new Te({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd,isStopPropagation:!1}),m}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.points,A=m.isAnimation,N=m.arrowConfig,U=m.getEdgeStyle(),H=m.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ce=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(MB,AO({points:_},U,N,A?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ce,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=m.points,A=m.isSelected,N={start:null,end:null,hover:this.state.hover,isSelected:A},U=jr(_);return U.length>=2&&(N.start=U[U.length-2],N.end=U[U.length-1]),N}},{key:"getLastTwoPoints",value:function(){var m=this.props.model.points,_=jr(m);return _.length>=2?[_[_.length-2],_[_.length-1]]:[null,null]}},{key:"getAppendAttributes",value:function(m){var _,A=m.start,N=m.end;if(A.x===N.x&&A.y===N.y)_="";else{var U={start:A,end:N,offset:10,verticalLength:5},H=kc(Qb(Qb({},U),{},{type:"start"})),oe=kc(Qb(Qb({},U),{},{type:"end"}));_="M".concat(H.leftX," ").concat(H.leftY,`
|
||
L`).concat(H.rightX," ").concat(H.rightY,`
|
||
L`).concat(oe.rightX," ").concat(oe.rightY,`
|
||
L`).concat(oe.leftX," ").concat(oe.leftY," z")}return{d:_,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}}},{key:"getAppendShape",value:function(m){var _=this.getAppendAttributes(m),A=_.d,N=_.strokeWidth,U=_.fill,H=_.strokeDasharray,oe=_.stroke;return Object(re.g)(Ry,{d:A,fill:U,strokeWidth:N,stroke:oe,strokeDasharray:H})}},{key:"getAppendWidth",value:function(){for(var m=this,_=this.props,A=_.model,N=_.graphModel,U=A.pointsList,H=A.draggable,oe=[],ue=U.length,Ce=function(qe){var Ot="lf-polyline-append",xt={start:{x:U[qe].x,y:U[qe].y},end:{x:U[qe+1].x,y:U[qe+1].y},startIndex:qe,endIndex:qe+1,direction:"",dragAble:!0},Ft=Object(re.g)("g",{className:Ot},m.getAppendShape(xt)),hn=N.editConfigModel,Hn=hn.adjustEdge,zn=hn.adjustEdgeMiddle;if(Hn&&H){var Ar=xt.startIndex,Vn=xt.endIndex,vr=zn&&(Ar===0||Vn===ue-1);xt.dragAble=!vr,xt.start.x===xt.end.x?(xt.dragAble&&(Ot+="-ew-resize"),xt.direction=ti.VERTICAL):xt.start.y===xt.end.y&&(xt.dragAble&&(Ot+="-ns-resize"),xt.direction=ti.HORIZONTAL),Ft=Object(re.g)("g",{className:m.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(er){return m.beforeDragStart(er,xt)}},Object(re.g)("g",{className:Ot},m.getAppendShape(xt)))}oe.push(Ft)},Ve=0;Ve<ue-1;Ve++)Ce(Ve);return Object(re.g)("g",null,oe)}}])&&CB(u.prototype,d),y})(Py);function CO(c){return CO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},CO(c)}function PB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return mN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return mN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function mN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function NO(){return NO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},NO.apply(this,arguments)}function RB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function DB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function kO(c,u){return kO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kO(c,u)}function jB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=t0(c);if(u){var y=t0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return LB(this,d)}}function LB(c,u){if(u&&(CO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function t0(c){return t0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},t0(c)}var PO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&kO(m,_)})(y,c);var u,d,p=jB(y);function y(){return RB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.getEdgeStyle(),A=m.path,N=m.isAnimation,U=m.arrowConfig,H=m.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ce=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(Ry,NO({d:A},_,U,N?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ce,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getAppendWidth",value:function(){var m=this.props.model.path;return Object(re.g)(Ry,{d:m,strokeWidth:10,stroke:"transparent",fill:"none"})}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=this.state.hover,A=m.isSelected,N=m.getArrowStyle().offset,U=m.pointsList.map((function(oe){return{x:oe.x,y:oe.y}})),H=PB(sa(U,N),2);return{start:H[0],end:H[1],hover:_,isSelected:A}}},{key:"getLastTwoPoints",value:function(){var m=this.props.model,_=m.getArrowStyle().offset,A=m.pointsList.map((function(N){return{x:N.x,y:N.y}}));return sa(A,_)}}])&&DB(u.prototype,d),y})(Py);function RO(c){return RO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},RO(c)}function gN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function IB(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function FB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function BB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function DO(c,u){return DO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},DO(c,u)}function $B(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=n0(c);if(u){var y=n0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return UB(this,d)}}function UB(c,u){if(u&&(RO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function n0(c){return n0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},n0(c)}var VB=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&DO(m,_)})(y,c);var u,d,p=$B(y);function y(){return FB(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getArrowAttributes",value:function(){var m=this.props,_=m.arrowInfo,A=m.style,N=_.start,U=_.end,H={start:N,end:U,offset:A.offset,verticalLength:A.verticalLength,type:"end"},oe=kc(H),ue=oe.leftX,Ce=oe.leftY,Ve=oe.rightX,qe=oe.rightY;return(function(Ot){for(var xt=1;xt<arguments.length;xt++){var Ft=arguments[xt]!=null?arguments[xt]:{};xt%2?gN(Object(Ft),!0).forEach((function(hn){IB(Ot,hn,Ft[hn])})):Object.getOwnPropertyDescriptors?Object.defineProperties(Ot,Object.getOwnPropertyDescriptors(Ft)):gN(Object(Ft)).forEach((function(hn){Object.defineProperty(Ot,hn,Object.getOwnPropertyDescriptor(Ft,hn))}))}return Ot})({d:"M".concat(ue," ").concat(Ce," L").concat(U.x," ").concat(U.y," L").concat(Ve," ").concat(qe," z")},A)}},{key:"getShape",value:function(){var m=this.getArrowAttributes(),_=m.d,A=m.strokeWidth,N=m.stroke,U=m.fill;return Object(re.g)(Ry,{d:_,fill:U,strokeWidth:A,stroke:N})}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-arrow"},this.getShape())}}],d&&BB(u.prototype,d),y})(re.a),yN=function(c,u){return It(c,u)},GB=function(c){var u=c==null?0:c.length;return u?c[u-1]:void 0},jO=function(){return wn.a.Date.now()},WB=Math.max,zB=Math.min,HB=function(c,u,d){var p,y,m,_,A,N,U=0,H=!1,oe=!1,ue=!0;if(typeof c!="function")throw new TypeError("Expected a function");function Ce(hn){var Hn=p,zn=y;return p=y=void 0,U=hn,_=c.apply(zn,Hn)}function Ve(hn){return U=hn,A=setTimeout(Ot,u),H?Ce(hn):_}function qe(hn){var Hn=hn-N;return N===void 0||Hn>=u||Hn<0||oe&&hn-U>=m}function Ot(){var hn=jO();if(qe(hn))return xt(hn);A=setTimeout(Ot,(function(Hn){var zn=u-(Hn-N);return oe?zB(zn,m-(Hn-U)):zn})(hn))}function xt(hn){return A=void 0,ue&&p?Ce(hn):(p=y=void 0,_)}function Ft(){var hn=jO(),Hn=qe(hn);if(p=arguments,y=this,N=hn,Hn){if(A===void 0)return Ve(N);if(oe)return clearTimeout(A),A=setTimeout(Ot,u),Ce(N)}return A===void 0&&(A=setTimeout(Ot,u)),_}return u=bd(u)||0,In(d)&&(H=!!d.leading,m=(oe="maxWait"in d)?WB(bd(d.maxWait)||0,u):m,ue="trailing"in d?!!d.trailing:ue),Ft.cancel=function(){A!==void 0&&clearTimeout(A),U=0,p=N=y=A=void 0},Ft.flush=function(){return A===void 0?_:xt(jO())},Ft},XB=r(172);function YB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function ih(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var _N,bN,wN,qB=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),ih(this,"undos",[]),ih(this,"redos",[]),ih(this,"callbacks",[]),ih(this,"stopWatch",null),ih(this,"curData",null),ih(this,"maxSize",50),ih(this,"waitTime",100),ih(this,"eventCenter",void 0),this.eventCenter=p}var u,d;return u=c,(d=[{key:"add",value:function(p){yN(GB(this.undos),p)||(this.undos.push(p),yN(this.curData,p)||(this.redos=[]),this.eventCenter.emit(ur.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undos.length>1,redoAble:this.redos.length>0}}),this.undos.length>this.maxSize&&this.undos.shift())}},{key:"undoAble",value:function(){return this.undos.length>1}},{key:"undo",value:function(){if(this.undoAble()){var p=this.undos.pop();this.redos.push(p);var y=this.undos.pop();return this.curData=Uo(y),y}}},{key:"redoAble",value:function(){return this.redos.length>0}},{key:"redo",value:function(){if(this.redoAble()){var p=this.redos.pop();return this.curData=Uo(p),p}}},{key:"watch",value:function(p){var y=this;this.stopWatch&&this.stopWatch(),this.undos.push(p.modelToGraphData()),this.stopWatch=Object(XB.a)(p,HB((function(){var m=p.modelToHistoryData();m&&y.add(m)}),this.waitTime))}}])&&YB(u.prototype,d),c})();function LO(c){return LO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},LO(c)}function KB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return EN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return EN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function EN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function xN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ov(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?xN(Object(d),!0).forEach((function(p){Sv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):xN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ON(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function IO(c,u){return IO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},IO(c,u)}function ZB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=r0(c);if(u){var y=r0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return JB(this,d)}}function JB(c,u){if(u&&(LO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zm(c)}function Zm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function r0(c){return r0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},r0(c)}function Sv(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var SN,AN,MN,FO=Fc((wN=bN=(function(c){(function(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),A&&IO(_,A)})(m,c);var u,d,p,y=ZB(m);function m(){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,m),Sv(Zm(_=y.call(this)),"ref",Object(re.f)()),Sv(Zm(_),"__prevText",{type:"",text:"",id:""}),Sv(Zm(_),"keyupHandler",(function(A){var N=_.props.graphModel.textEditElement;A.key==="Enter"&&A.altKey&&N.setElementState(0)})),Sv(Zm(_),"inputHandler",(function(A){var N=A.target.innerText,U=_.props.graphModel.textEditElement;_.__prevText={type:U.type,text:N.replace(/(\r\n)+$|(\n)+$/,""),id:U.id}})),Sv(Zm(_),"keydownHandler",(function(A){A.stopPropagation()})),_.state={style:{left:0,top:0}},_}return u=m,p=[{key:"getDerivedStateFromProps",value:function(_){var A,N=_.graphModel,U=N.transformModel,H=N.theme,oe=H.inputText,ue=N.textEditElement;if(ue){var Ce;if((Ce=ue.text)===null||Ce===void 0||!Ce.value)if(ue.BaseType===ei.EDGE){var Ve=(ue=ue).text,qe=ue.textPosition,Ot=qe.x,xt=qe.y;Ve.x=Ot,Ve.y=xt,ue.setText(Ve)}else ue=ue;var Ft={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(ue.BaseType===ei.EDGE){var hn=H.edgeText,Hn=hn.overflowMode,zn=hn.lineHeight,Ar=hn.wrapPadding,Vn=hn.textWidth;Vn&&Hn==="autoWrap"&&(A=Ov(Ov({},Ft),{},{width:Vn,minWidth:Vn,lineHeight:zn,padding:Ar}))}else if(ue.BaseType===ei.NODE){var vr=H.nodeText,er=vr.overflowMode,Eo=vr.lineHeight,Co=vr.wrapPadding,zr=vr.textWidth,Fo=ue,ga=Fo.width,ya=Fo.modelType,Nl=Fo.textWidth||zr||ga;(ya!==lo.TEXT_NODE&&er==="autoWrap"||ya===lo.TEXT_NODE&&zr)&&(A=Ov(Ov({},Ft),{},{width:Nl,minWidth:Nl,lineHeight:Eo,padding:Co}))}var fu=ue.text,pu=fu.x,Pd=fu.y,Av=KB(U.CanvasPointToHtmlPoint([pu,Pd]),2);return{style:Ov(Ov({left:Av[0],top:Av[1]},A),oe)}}}}],(d=[{key:"componentDidUpdate",value:function(){var _=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var A=this.__prevText,N=A.text,U=A.id;_.updateText(U,N),_.eventCenter.emit(ur.TEXT_UPDATE,Ov({},this.__prevText)),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}}},{key:"placeCaretAtEnd",value:function(_){if(window.getSelection!==void 0&&document.createRange!==void 0){var A=document.createRange();A.selectNodeContents(_),A.collapse(!1);var N=window.getSelection();N.removeAllRanges(),N.addRange(A)}}},{key:"render",value:function(){var _,A=this.props.graphModel.textEditElement,N=this.state.style;return A?Object(re.g)("div",{contentEditable:!0,className:"lf-text-input",style:N,ref:this.ref,key:A.id,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler},(_=A.text)===null||_===void 0?void 0:_.value):null}}])&&ON(u.prototype,d),p&&ON(u,p),m})(re.a),Sv(bN,"toolName","textEdit"),_N=wN))||_N,QB=function(c){return c.modelType===lo.LINE_EDGE?(function(u){var d=u.startPoint,p=u.endPoint,y=(d.x+p.x)/2,m=(d.y+p.y)/2,_=Math.abs(d.x-p.x)+10,A=Math.abs(d.y-p.y)+10;return{x:y-_/2,y:m-A/2,x1:y+_/2,y1:m+A/2}})(c):c.modelType===lo.POLYLINE_EDGE?(function(u){var d=u.points,p=jr(d),y=St(p,8),m=y.x,_=y.y,A=y.width,N=y.height;return{x:m-A/2,y:_-N/2,x1:m+A/2,y1:_+N/2}})(c):c.modelType===lo.BEZIER_EDGE?(function(u){var d=u.path,p=di(d),y=St(p,8),m=y.x,_=y.y,A=y.width,N=y.height;return{x:m-A/2,y:_-N/2,x1:m+A/2,y1:_+N/2}})(c):void 0};function BO(c){return BO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},BO(c)}function TN(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||CN(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function e$(c){return(function(u){if(Array.isArray(u))return $O(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||CN(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function CN(c,u){if(c){if(typeof c=="string")return $O(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?$O(c,u):void 0}}function $O(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function t$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function UO(c,u){return UO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},UO(c,u)}function n$(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=o0(c);if(u){var y=o0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return r$(this,d)}}function r$(c,u){if(u&&(BO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jm(c)}function Jm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function o0(c){return o0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},o0(c)}function Qm(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var VO=Fc((MN=AN=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&UO(m,_)})(y,c);var u,d,p=n$(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Qm(Jm(_=p.call(this)),"stepDrag",void 0),Qm(Jm(_),"handleMouseDown",(function(H){_.stepDrag.handleMouseDown(H)})),Qm(Jm(_),"handleWheelEvent",(function(H){var oe,ue;H.preventDefault();var Ce=H.deltaX,Ve=H.deltaY,qe=H.clientX,Ot=H.clientY,xt=H.ctrlKey,Ft=new WheelEvent("wheel",{deltaX:Ce,deltaY:Ve,clientX:qe,clientY:Ot,ctrlKey:xt});(oe=_.props.logicFlow.container)===null||oe===void 0||(ue=oe.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||ue===void 0||ue.dispatchEvent(Ft)})),Qm(Jm(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ce=_.props.graphModel,Ve=Ce.getSelectElements(!0);Ce.moveNodes(Ve.nodes.map((function(qe){return qe.id})),oe,ue)})),Qm(Jm(_),"handleContextMenu",(function(H){H.preventDefault();var oe=_.props,ue=oe.graphModel,Ce=oe.graphModel,Ve=Ce.eventCenter,qe=Ce.selectElements,Ot=ue.getPointByClient({x:H.clientX,y:H.clientY}),xt={nodes:[],edges:[]};e$(qe.values()).forEach((function(Ft){Ft.BaseType===ei.NODE&&xt.nodes.push(Ft.getData()),Ft.BaseType===ei.EDGE&&xt.edges.push(Ft.getData())})),Ve.emit(ur.SELECTION_CONTEXTMENU,{data:xt,e:H,position:Ot})}));var A=m.graphModel,N=A.gridSize,U=A.eventCenter;return _.stepDrag=new Te({onDragging:_.onDragging,step:N,eventType:"SELECTION",eventCenter:U}),_}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel,_=m.selectElements,A=m.transformModel;if(!(_.size<=1)){var N=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER,H=Number.MIN_SAFE_INTEGER,oe=Number.MIN_SAFE_INTEGER;_.forEach((function(qe){var Ot={x:0,y:0,x1:0,y1:0};qe.BaseType===ei.NODE&&(Ot=(function(xt){var Ft=xt.x,hn=xt.y,Hn=xt.width,zn=xt.height;return{x:Ft-Hn/2,y:hn-zn/2,x1:Ft+Hn/2,y1:hn+zn/2}})(qe)),qe.BaseType===ei.EDGE&&(Ot=QB(qe)),N=Math.min(N,Ot.x),U=Math.min(U,Ot.y),H=Math.max(H,Ot.x1),oe=Math.max(oe,Ot.y1)}));var ue=TN(A.CanvasPointToHtmlPoint([N,U]),2);N=ue[0],U=ue[1];var Ce=TN(A.CanvasPointToHtmlPoint([H,oe]),2);H=Ce[0],oe=Ce[1];var Ve={left:"".concat(N-10,"px"),top:"".concat(U-10,"px"),width:"".concat(H-N+20,"px"),height:"".concat(oe-U+20,"px")};return Object(re.g)("div",{className:"lf-multiple-select",style:Ve,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}}}])&&t$(u.prototype,d),y})(re.a),Qm(AN,"toolName","multipleSelect"),SN=MN))||SN;function o$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function i0(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var i$=(function(){function c(p){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),i0(this,"tools",void 0),i0(this,"components",void 0),i0(this,"toolMap",new Map),i0(this,"instance",void 0),this.instance=p,this.isDisabledTool(FO.toolName)||this.registerTool(FO.toolName,FO),this.isDisabledTool(VO.toolName)||this.registerTool(VO.toolName,VO);var y=p.graphModel;y.eventCenter.on("".concat(ur.GRAPH_TRANSFORM,",").concat(ur.NODE_CLICK,",").concat(ur.BLANK_CLICK," "),(function(){var m=y.textEditElement,_=y.editConfigModel,A=_.edgeTextEdit,N=_.nodeTextEdit;(A||N)&&m&&y.textEditElement.setElementState(Io.DEFAULT)}))}var u,d;return u=c,(d=[{key:"isDisabledTool",value:function(p){return this.instance.options.disabledTools.indexOf(p)!==-1}},{key:"registerTool",value:function(p,y){this.toolMap.set(p,y)}},{key:"getTools",value:function(){return Array.from(this.toolMap.values())}},{key:"getInstance",value:function(){return this.instance}}])&&o$(u.prototype,d),c})(),a$=r(173),l$=r.n(a$);function s$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function GO(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var NN=(function(){function c(p){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),GO(this,"mousetrap",void 0),GO(this,"options",void 0),GO(this,"target",void 0),p.keyboard||(p.keyboard={enabled:!1}),this.options=p;var y=p.lf;this.target=y.container,this.mousetrap=new l$.a(this.target),p.keyboard.enabled&&!y.options.isSilentMode&&this.enable(!0)}var u,d;return u=c,(d=[{key:"initShortcuts",value:function(){var p=this,y=this.options.keyboard.shortcuts;if(y)if(qo(y))y.forEach((function(N){var U=N.keys,H=N.callback,oe=N.action;return p.on(U,H,oe)}));else{var m=y.keys,_=y.callback,A=y.action;this.on(m,_,A)}}},{key:"on",value:function(p,y,m){this.mousetrap.bind(this.getKeys(p),y,m)}},{key:"disabled",get:function(){return this.options.keyboard.enabled!==!0}},{key:"off",value:function(p,y){this.mousetrap.unbind(this.getKeys(p),y)}},{key:"enable",value:function(p){(this.disabled||p)&&(this.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))}},{key:"disable",value:function(){this.disabled||(this.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}},{key:"getKeys",value:function(p){var y=this;return(Array.isArray(p)?p:[p]).map((function(m){return y.formatKey(m)}))}},{key:"formatKey",value:function(p){return p.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")}}])&&s$(u.prototype,d),c})(),u$=NN,Jf=null;function kN(c,u){return c.x+=u,c.y+=u,c.text&&(c.text.x+=u,c.text.y+=u),c}function PN(c,u){return c.startPoint&&(c.startPoint.x+=u,c.startPoint.y+=u),c.endPoint&&(c.endPoint.x+=u,c.endPoint.y+=u),c.pointsList&&c.pointsList.length>0&&c.pointsList.forEach((function(d){d.x+=u,d.y+=u})),c.text&&(c.text.x+=u,c.text.y+=u),c}var eg=40,WO=40;function zO(c){return zO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},zO(c)}function RN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Dy(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?RN(Object(d),!0).forEach((function(p){ua(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):RN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function DN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function ua(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var HO=Symbol("plugin register by Logicflow.use"),XO=(function(){function c(y){var m,_,A=this;(function(N,U){if(!(N instanceof U))throw new TypeError("Cannot call a class as a function")})(this,c),ua(this,"container",void 0),ua(this,"width",void 0),ua(this,"height",void 0),ua(this,"graphModel",void 0),ua(this,"history",void 0),ua(this,"viewMap",new Map),ua(this,"tool",void 0),ua(this,"keyboard",void 0),ua(this,"dnd",void 0),ua(this,"options",void 0),ua(this,"snaplineModel",void 0),ua(this,"components",[]),ua(this,"plugins",void 0),ua(this,"extension",{}),ua(this,"adapterIn",void 0),ua(this,"adapterOut",void 0),ua(this,"getView",(function(N){return A.viewMap.get(N)})),y=NT(y),this.options=y,this.container=this.initContainer(y.container),this.plugins=y.plugins,this.graphModel=new v5(Dy({},y)),this.tool=new i$(this),this.history=new qB(this.graphModel.eventCenter),this.dnd=new f6({lf:this}),this.keyboard=new u$({lf:this,keyboard:y.keyboard}),y.snapline!==!1&&(this.snaplineModel=new WC(this.graphModel),m=this.graphModel.eventCenter,_=this.snaplineModel,m.on("node:mousemove",(function(N){var U=N.data;_.setNodeSnapLine(U)})),m.on("node:mouseup",(function(){_.clearSnapline()}))),(function(N,U){var H=N.keyboard,oe=H.options.keyboard;H.on(["cmd + c","ctrl + c"],(function(){if(WO=eg,!oe.enabled||U.textEditElement)return!0;var ue=N.options.guards,Ce=U.getSelectElements(!1);return ue&&ue.beforeClone&&!ue.beforeClone(Ce)||Ce.nodes.length===0&&Ce.edges.length===0?(Jf=null,!0):((Jf=Ce).nodes.forEach((function(Ve){return kN(Ve,eg)})),Jf.edges.forEach((function(Ve){return PN(Ve,eg)})),!1)})),H.on(["cmd + v","ctrl + v"],(function(){if(!oe.enabled||U.textEditElement)return!0;if(Jf&&(Jf.nodes||Jf.edges)){N.clearSelectElements();var ue=N.addElements(Jf,WO);if(!ue)return!0;ue.nodes.forEach((function(Ce){return N.selectElementById(Ce.id,!0)})),ue.edges.forEach((function(Ce){return N.selectElementById(Ce.id,!0)})),Jf.nodes.forEach((function(Ce){return kN(Ce,eg)})),Jf.edges.forEach((function(Ce){return PN(Ce,eg)})),WO+=eg}return!1})),H.on(["cmd + z","ctrl + z"],(function(){return!oe.enabled||!!U.textEditElement||(N.undo(),!1)})),H.on(["cmd + y","ctrl + y"],(function(){return!oe.enabled||!!U.textEditElement||(N.redo(),!1)})),H.on(["backspace"],(function(){if(!oe.enabled||U.textEditElement)return!0;var ue=U.getSelectElements(!0);return N.clearSelectElements(),ue.edges.forEach((function(Ce){return N.deleteEdge(Ce.id)})),ue.nodes.forEach((function(Ce){return N.deleteNode(Ce.id)})),!1}))})(this,this.graphModel),this.keyboard.initShortcuts(),this.defaultRegister(),this.installPlugins(y.disabledPlugins)}var u,d,p;return u=c,d=[{key:"register",value:function(y,m){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(typeof y=="string"){var A={BaseEdge:Py,BaseEdgeModel:Kp,BaseNode:Yf,BaseNodeModel:Xf,RectNode:Fx,RectNodeModel:vx,CircleNode:Vx,CircleNodeModel:KE,PolygonNode:Xx,PolygonNodeModel:dx,TextNode:iO,TextNodeModel:_x,LineEdge:xO,LineEdgeModel:Od,DiamondNode:Zx,DiamondNodeModel:tx,PolylineEdge:TO,PolylineEdgeModel:Cl,BezierEdge:PO,BezierEdgeModel:WE,EllipseNode:nO,EllipseNodeModel:ix,HtmlNode:uO,HtmlNodeModel:Ex,h:re.g,type:y};this.viewMap.forEach((function(ue){var Ce=ue.extendKey;Ce&&(A[Ce]=ue)})),this.graphModel.modelMap.forEach((function(ue){var Ce=ue.extendKey;Ce&&(A[Ce]=ue)}));var N=m(A),U=N.view,H=N.model,oe=U;_&&!oe.isObervered&&(oe.isObervered=!0,oe=ae(oe)),this.setView(y,oe),this.graphModel.setModel(y,H)}else this.registerElement(y)}},{key:"registerElement",value:function(y){var m=y.view;y.isObserverView===!1||m.isObervered||(m.isObervered=!0,m=ae(m)),this.setView(y.type,m),this.graphModel.setModel(y.type,y.model)}},{key:"batchRegister",value:function(){var y=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach((function(_){y.registerElement(_)}))}},{key:"defaultRegister",value:function(){this.registerElement({view:Fx,model:vx,type:"rect"}),this.registerElement({type:"circle",view:Vx,model:KE}),this.registerElement({type:"polygon",view:Xx,model:dx}),this.registerElement({type:"line",view:xO,model:Od}),this.registerElement({type:"polyline",view:TO,model:Cl}),this.registerElement({type:"bezier",view:PO,model:WE}),this.registerElement({type:"text",view:iO,model:_x}),this.registerElement({type:"ellipse",view:nO,model:ix}),this.registerElement({type:"diamond",view:Zx,model:tx}),this.registerElement({type:"html",view:uO,model:Ex})}},{key:"selectElementById",value:function(y){var m=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.graphModel.selectElementById(y,m),!m&&_&&this.graphModel.toFront(y)}},{key:"focusOn",value:function(y){var m=this.graphModel.transformModel,_=y.coordinate,A=y.id;if(!_){var N=this.getNodeModelById(A);N&&(_=N.getData());var U=this.getEdgeModelById(A);U&&(_=U.textPosition)}var H=_,oe=H.x,ue=H.y;m.focusOn(oe,ue,this.graphModel.width,this.graphModel.height)}},{key:"setTheme",value:function(y){this.graphModel.setTheme(y)}},{key:"resize",value:function(y,m){this.graphModel.resize(y,m),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height}},{key:"setDefaultEdgeType",value:function(y){this.graphModel.setDefaultEdgeType(y)}},{key:"updateText",value:function(y,m){this.graphModel.updateText(y,m)}},{key:"deleteElement",value:function(y){var m,_,A,N=this.getModelById(y);return!!N&&(_=(A=(ua(m={},ei.NODE,this.deleteNode),ua(m,ei.EDGE,this.deleteEdge),m)[N.BaseType])===null||A===void 0?void 0:A.call(this,y))!==null&&_!==void 0&&_}},{key:"getModelById",value:function(y){return this.graphModel.getElement(y)}},{key:"getDataById",value:function(y){var m;return(m=this.graphModel.getElement(y))===null||m===void 0?void 0:m.getData()}},{key:"changeNodeType",value:function(y,m){this.graphModel.changeNodeType(y,m)}},{key:"changeEdgeType",value:function(y,m){this.graphModel.changeEdgeType(y,m)}},{key:"getNodeEdges",value:function(y){return this.graphModel.getNodeEdges(y)}},{key:"addNode",value:function(y){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,_=arguments.length>2?arguments[2]:void 0;return this.graphModel.addNode(y,m,_)}},{key:"deleteNode",value:function(y){var m=this.graphModel.getNodeModelById(y);if(!m)return!1;var _=m.getData(),A=this.options.guards,N=!A||!A.beforeDelete||A.beforeDelete(_);return N&&this.graphModel.deleteNode(y),N}},{key:"cloneNode",value:function(y){var m=this.graphModel.getNodeModelById(y).getData(),_=this.options.guards;if(!_||!_.beforeClone||_.beforeClone(m))return this.graphModel.cloneNode(y)}},{key:"changeNodeId",value:function(y,m){return this.graphModel.changeNodeId(y,m)}},{key:"getNodeModelById",value:function(y){return this.graphModel.getNodeModelById(y)}},{key:"getNodeDataById",value:function(y){var m;return(m=this.graphModel.getNodeModelById(y))===null||m===void 0?void 0:m.getData()}},{key:"addEdge",value:function(y){return this.graphModel.addEdge(y)}},{key:"deleteEdge",value:function(y){var m=this.options.guards,_=this.graphModel.edgesMap[y];if(!_)return!1;var A=_.model.getData(),N=!m||!m.beforeDelete||m.beforeDelete(A);return N&&this.graphModel.deleteEdgeById(y),N}},{key:"deleteEdgeByNodeId",value:function(y){var m=y.sourceNodeId,_=y.targetNodeId;m&&_?this.graphModel.deleteEdgeBySourceAndTarget(m,_):m?this.graphModel.deleteEdgeBySource(m):_&&this.graphModel.deleteEdgeByTarget(_)}},{key:"changeEdgeId",value:function(y,m){return this.graphModel.changeEdgeId(y,m)}},{key:"getEdgeModelById",value:function(y){var m;return(m=this.graphModel.edgesMap[y])===null||m===void 0?void 0:m.model}},{key:"getEdgeModels",value:function(y){var m=this.graphModel.edges,_=y.sourceNodeId,A=y.targetNodeId;if(_&&A){var N=[];return m.forEach((function(oe){oe.sourceNodeId===_&&oe.targetNodeId===A&&N.push(oe)})),N}if(_){var U=[];return m.forEach((function(oe){oe.sourceNodeId===_&&U.push(oe)})),U}if(A){var H=[];return m.forEach((function(oe){oe.targetNodeId===A&&H.push(oe)})),H}return[]}},{key:"getEdgeDataById",value:function(y){var m;return(m=this.getEdgeModelById(y))===null||m===void 0?void 0:m.getData()}},{key:"getNodeIncomingEdge",value:function(y){return this.graphModel.getNodeIncomingEdge(y)}},{key:"getNodeOutgoingEdge",value:function(y){return this.graphModel.getNodeOutgoingEdge(y)}},{key:"getNodeIncomingNode",value:function(y){return this.graphModel.getNodeIncomingNode(y)}},{key:"getNodeOutgoingNode",value:function(y){return this.graphModel.getNodeOutgoingNode(y)}},{key:"editText",value:function(y){this.graphModel.editText(y)}},{key:"setProperties",value:function(y,m){var _;(_=this.graphModel.getElement(y))===null||_===void 0||_.setProperties(ma(m))}},{key:"deleteProperty",value:function(y,m){var _;(_=this.graphModel.getElement(y))===null||_===void 0||_.deleteProperty(m)}},{key:"getProperties",value:function(y){var m;return(m=this.graphModel.getElement(y))===null||m===void 0?void 0:m.getProperties()}},{key:"toFront",value:function(y){this.graphModel.toFront(y)}},{key:"setElementZIndex",value:function(y,m){return this.graphModel.setElementZIndex(y,m)}},{key:"addElements",value:function(y){for(var m=this,_=y.nodes,A=y.edges,N={},U={nodes:[],edges:[]},H=0;H<_.length;H++){var oe=_[H],ue=oe.id,Ce=this.addNode(oe);if(!Ce)return;ue&&(N[ue]=Ce.id),U.nodes.push(Ce)}return A.forEach((function(Ve){var qe=Ve.sourceNodeId,Ot=Ve.targetNodeId;N[qe]&&(qe=N[qe]),N[Ot]&&(Ot=N[Ot]);var xt=m.graphModel.addEdge(Dy(Dy({},Ve),{},{sourceNodeId:qe,targetNodeId:Ot}));U.edges.push(xt)})),U}},{key:"getAreaElement",value:function(y,m){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],A=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],N=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return this.graphModel.getAreaElement(y,m,_,A,N).map((function(U){return U.getData()}))}},{key:"getSelectElements",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this.graphModel.getSelectElements(y)}},{key:"clearSelectElements",value:function(){this.graphModel.clearSelectElements()}},{key:"getGraphData",value:function(){var y=this.graphModel.modelToGraphData();if(this.adapterOut){for(var m=arguments.length,_=new Array(m),A=0;A<m;A++)_[A]=arguments[A];return this.adapterOut.apply(this,[y].concat(_))}return y}},{key:"getGraphRawData",value:function(){return this.graphModel.modelToGraphData()}},{key:"clearData",value:function(){this.graphModel.clearData()}},{key:"updateEditConfig",value:function(y){var m=this.graphModel,_=m.editConfigModel,A=m.transformModel;_.updateEditConfig(y),(y==null?void 0:y.stopMoveGraph)!==void 0&&A.updateTranslateLimits(y.stopMoveGraph),y!=null&&y.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0)}},{key:"getEditConfig",value:function(){return this.graphModel.editConfigModel.getConfig()}},{key:"getPointByClient",value:function(y,m){return this.graphModel.getPointByClient({x:y,y:m})}},{key:"undo",value:function(){if(this.history.undoAble()){var y=ma(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"redo",value:function(){if(this.history.redoAble()){var y=ma(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"zoom",value:function(y,m){return this.graphModel.transformModel.zoom(y,m)}},{key:"resetZoom",value:function(){this.graphModel.transformModel.resetZoom()}},{key:"setZoomMiniSize",value:function(y){this.graphModel.transformModel.setZoomMiniSize(y)}},{key:"setZoomMaxSize",value:function(y){this.graphModel.transformModel.setZoomMaxSize(y)}},{key:"getTransform",value:function(){var y=this.graphModel.transformModel;return{SCALE_X:y.SCALE_X,SCALE_Y:y.SCALE_Y,TRANSLATE_X:y.TRANSLATE_X,TRANSLATE_Y:y.TRANSLATE_Y}}},{key:"translate",value:function(y,m){this.graphModel.transformModel.translate(y,m)}},{key:"resetTranslate",value:function(){var y=this.graphModel.transformModel,m=y.TRANSLATE_X,_=y.TRANSLATE_Y;this.translate(-m,-_)}},{key:"translateCenter",value:function(){this.graphModel.translateCenter()}},{key:"fitView",value:function(y,m){m===void 0&&(m=y),this.graphModel.fitView(y,m)}},{key:"openEdgeAnimation",value:function(y){this.graphModel.openEdgeAnimation(y)}},{key:"closeEdgeAnimation",value:function(y){this.graphModel.closeEdgeAnimation(y)}},{key:"on",value:function(y,m){this.graphModel.eventCenter.on(y,m)}},{key:"off",value:function(y,m){this.graphModel.eventCenter.off(y,m)}},{key:"once",value:function(y,m){this.graphModel.eventCenter.once(y,m)}},{key:"emit",value:function(y,m){this.graphModel.eventCenter.emit(y,m)}},{key:"initContainer",value:function(y){var m=document.createElement("div");return m.style.position="relative",m.style.width="100%",m.style.height="100%",y.innerHTML="",y.appendChild(m),m}},{key:"installPlugins",value:function(){var y,m=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=(y=this.plugins)!==null&&y!==void 0?y:c.extensions;A.forEach((function(N){var U=null,H=null;N[HO]?(U=N.extension,H=N.props):U=N;var oe=U.pluginName||U.name;_.indexOf(oe)===-1&&m.installPlugin(U,H)}))}},{key:"installPlugin",value:function(y,m){if(zO(y)==="object"){var _=y.install,A=y.render;return _&&_.call(y,this,c),A&&this.components.push(A.bind(y)),void(this.extension[y.pluginName]=y)}var N=y,U=new N({lf:this,LogicFlow:c,options:this.options.pluginsOptions,props:m});U.render&&this.components.push(U.render.bind(U)),this.extension[N.pluginName]=U}},{key:"updateAttributes",value:function(y,m){this.graphModel.updateAttributes(y,m)}},{key:"createFakerNode",value:function(y){var m=this.graphModel.modelMap.get(y.type);if(m){var _=new m(Dy(Dy({},y),{},{virtual:!0}),this.graphModel);return this.graphModel.setFakerNode(_),_}}},{key:"removeFakerNode",value:function(){this.graphModel.removeFakerNode()}},{key:"setNodeSnapLine",value:function(y){this.snaplineModel&&this.snaplineModel.setNodeSnapLine(y)}},{key:"removeNodeSnapLine",value:function(){this.snaplineModel&&this.snaplineModel.clearSnapline()}},{key:"setView",value:function(y,m){this.viewMap.set(y,m)}},{key:"renderRawData",value:function(y){this.graphModel.graphDataToModel(ma(y)),this.options.history!==!1&&this.history.watch(this.graphModel),Object(re.j)(Object(re.g)(c6,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(ur.GRAPH_RENDERED,this.graphModel.modelToGraphData())}},{key:"render",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.adapterIn&&(y=this.adapterIn(y)),this.renderRawData(y)}}],p=[{key:"use",value:function(y,m){var _,A,N=y.pluginName;N||(N=y.name);var U=(_=this.extensions.get(N))===null||_===void 0?void 0:_.extension;U&&U.destroy&&U.destroy(),this.extensions.set(N,(ua(A={},HO,HO),ua(A,"extension",y),ua(A,"props",m),A))}}],d&&DN(u.prototype,d),p&&DN(u,p),c})();function Fc(c){return ae(c)}ua(XO,"extensions",new Map),o.default=XO}])}))})(I0,I0.exports)),I0.exports}var Hu=$ne();const e8=Z_(Hu);let eE=!1;const Th=Rh({});function t8(e,t,n,o,r,i,a){i||(i=(s,l)=>({nodeModel:s,graph:l})),a||(a=(s,l)=>({getNode:()=>s,getGraph:()=>l})),eE&&(Th[e]=o9(_r({render:()=>Dg(i9,{to:n},[Dg(t,i(o,r))]),provide:()=>a(o,r)})))}function n8(e){eE&&delete Th[e]}function Une(e){Object.keys(Th).forEach(t=>{t.startsWith(e)&&delete Th[t]})}function Vne(){Object.keys(Th).forEach(e=>{delete Th[e]})}function d1(){return eE}function Gne(){return eE=!0,_r({props:{flowId:{type:String,required:!0}},setup(e){return()=>{const t=[];return Object.keys(Th).forEach(n=>{t.push(Th[n])}),Dg(Ir,{},t.map(n=>Dg(n)))}}})}class ai extends GI.view{constructor(n,o){super(n);hl(this,"isMounted");hl(this,"r");hl(this,"component");hl(this,"app");hl(this,"root");hl(this,"VueNode");hl(this,"up_node_field_dict");this.component=o,this.isMounted=!1,n.model.clear_next_node_field=this.clear_next_node_field.bind(this),n.model.get_up_node_field_dict=this.get_up_node_field_dict.bind(this),n.model.get_node_field_list=this.get_node_field_list.bind(this),n.model.get_up_node_field_list=this.get_up_node_field_list.bind(this),n.model.properties.noRender?delete n.model.properties.noRender:n.model.properties.stepName=this.getNodeName(n.graphModel.nodes.filter(r=>r.id!==n.model.id),n.model.properties.stepName),n.model.properties.config=this.getConfig(n),n.model.properties.height&&(n.model.height=n.model.properties.height)}getConfig(n){return w9[n.model.type].properties.config}getNodeName(n,o){let r=0,i=o;for(;;){if(r>0&&(i=o+r),!n.some(a=>a.properties.stepName===i.trim()))return i;r++}}get_node_field_list(){var o,r,i,a,s,l,f,h;const n=[];return this.props.model.type&&this.props.model.type==="start-node"&&(n.push({value:"global",label:Pt("views.applicationWorkflow.variable.global"),type:"global",children:((r=(o=this.props.model.properties)==null?void 0:o.config)==null?void 0:r.globalFields)||[]}),n.push({value:"chat",label:Pt("views.applicationWorkflow.variable.chat"),type:"chat",children:((a=(i=this.props.model.properties)==null?void 0:i.config)==null?void 0:a.chatFields)||[]})),n.push({value:this.props.model.id,icon:(l=(s=this.props.model.properties)==null?void 0:s.node_data)==null?void 0:l.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((h=(f=this.props.model.properties)==null?void 0:f.config)==null?void 0:h.fields)||[]}),n}get_up_node_field_dict(n,o){if(!this.up_node_field_dict||!o){const r=this.props.graphModel.getNodeIncomingNode(this.props.model.id);this.up_node_field_dict=r.filter(i=>i.id!="start-node"&&i.id!="loop-start-node").map(i=>i.get_up_node_field_dict(!0,o)).reduce((i,a)=>({...i,...a}),{})}return n?{...this.up_node_field_dict,[this.props.model.id]:this.get_node_field_list()}:this.up_node_field_dict?this.up_node_field_dict:{}}get_up_node_field_list(n,o){const r=Object.values(this.get_up_node_field_dict(n,o)).reduce((s,l)=>[...s,...l],[]),i=this.props.graphModel.getNodeModelById("start-node")||this.props.graphModel.getNodeModelById("loop-start-node");return[...i?i.get_node_field_list():[],...r]}clear_next_node_field(n){this.props.graphModel.getNodeOutgoingNode(this.props.model.id).forEach(r=>{r.clear_next_node_field(!0)}),n&&(this.up_node_field_dict=void 0)}getAnchorShape(n){const{x:o,y:r,type:i}=n;let a=!1;return i=="left"?a=this.props.graphModel.edges.some(s=>s.targetAnchorId==n.id):a=this.props.graphModel.edges.some(s=>s.sourceAnchorId==n.id),Hu.h("foreignObject",{...n,x:o-10,y:r-12,width:30,height:30},[Hu.h("div",{style:{zindex:0},onClick:()=>{i=="right"&&this.props.model.openNodeMenu(n)},dangerouslySetInnerHTML:{__html:a?`<svg width="100%" height="100%" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g filter="url(#filter0_d_5119_232585)">
|
||
<path d="M20.9998 29.8333C28.0875 29.8333 33.8332 24.0876 33.8332 17C33.8332 9.91231 28.0875 4.16663 20.9998 4.16663C13.9122 4.16663 8.1665 9.91231 8.1665 17C8.1665 24.0876 13.9122 29.8333 20.9998 29.8333Z" fill="white"/>
|
||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9998 27.5C26.7988 27.5 31.4998 22.799 31.4998 17C31.4998 11.201 26.7988 6.49996 20.9998 6.49996C15.2008 6.49996 10.4998 11.201 10.4998 17C10.4998 22.799 15.2008 27.5 20.9998 27.5ZM33.8332 17C33.8332 24.0876 28.0875 29.8333 20.9998 29.8333C13.9122 29.8333 8.1665 24.0876 8.1665 17C8.1665 9.91231 13.9122 4.16663 20.9998 4.16663C28.0875 4.16663 33.8332 9.91231 33.8332 17Z" fill="#3370FF"/>
|
||
</g>
|
||
<defs>
|
||
<filter id="filter0_d_5119_232585" x="-1" y="-1" width="44" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||
<feOffset dy="4"/>
|
||
<feGaussianBlur stdDeviation="4"/>
|
||
<feComposite in2="hardAlpha" operator="out"/>
|
||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.1 0"/>
|
||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5119_232585"/>
|
||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5119_232585" result="shape"/>
|
||
</filter>
|
||
</defs>
|
||
</svg>
|
||
`:`<svg width="100%" height="100%" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g filter="url(#filter0_d_5199_166905)">
|
||
<path d="M20.9998 29.8333C28.0875 29.8333 33.8332 24.0876 33.8332 17C33.8332 9.91231 28.0875 4.16663 20.9998 4.16663C13.9122 4.16663 8.1665 9.91231 8.1665 17C8.1665 24.0876 13.9122 29.8333 20.9998 29.8333Z" fill="#3370FF"/>
|
||
<path d="M19.8332 11.75C19.8332 11.4278 20.0943 11.1666 20.4165 11.1666H21.5832C21.9053 11.1666 22.1665 11.4278 22.1665 11.75V15.8333H26.2498C26.572 15.8333 26.8332 16.0945 26.8332 16.4166V17.5833C26.8332 17.9055 26.572 18.1666 26.2498 18.1666H22.1665V22.25C22.1665 22.5721 21.9053 22.8333 21.5832 22.8333H20.4165C20.0943 22.8333 19.8332 22.5721 19.8332 22.25V18.1666H15.7498C15.4277 18.1666 15.1665 17.9055 15.1665 17.5833V16.4166C15.1665 16.0945 15.4277 15.8333 15.7498 15.8333H19.8332V11.75Z" fill="white"/>
|
||
</g>
|
||
<defs>
|
||
<filter id="filter0_d_5199_166905" x="-1" y="-1" width="44" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||
<feOffset dy="4"/>
|
||
<feGaussianBlur stdDeviation="4"/>
|
||
<feComposite in2="hardAlpha" operator="out"/>
|
||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.1 0"/>
|
||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5199_166905"/>
|
||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5199_166905" result="shape"/>
|
||
</filter>
|
||
</defs>
|
||
</svg>`}})])}setHtml(n){if(this.isMounted)this.r&&this.r.component&&(this.r.component.props.properties=this.props.model.getProperties());else{this.isMounted=!0;const o=document.createElement("div");n.appendChild(o),this.renderVueComponent(o)}}componentWillUnmount(){super.componentWillUnmount(),this.unmount()}getComponentContainer(){return this.root}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}renderVueComponent(n){var i;this.unmountVueComponent(),this.root=n;const{model:o,graphModel:r}=this.props;if(n)if(d1())t8(this.targetId(),this.component,n,o,r,void 0,this.props.graphModel.get_provide);else{this.r=Dg(this.component,{properties:this.props.model.properties,nodeModel:this.props.model}),this.app=Lj({render(){return this.r},provide(){return{getNode:()=>o,getGraph:()=>r,workflowMode:nc.Application}}}),this.app.use(a9,{locale:l9}),this.app.use(s9),this.app.use(u9),this.app.use(jj);for(const[a,s]of Object.entries(c9))this.app.component(a,s);(i=this.app)==null||i.mount(n)}}unmountVueComponent(){return this.app&&(this.app.unmount(),this.app=null),this.root&&(this.root.innerHTML=""),this.root}unmount(){d1()&&n8(this.targetId()),this.unmountVueComponent()}}class li extends GI.model{refreshDeges(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}set_position(t){const{x:n,y:o}=t;n&&(this.x=n),o&&(this.y=o),this.refreshDeges()}getResizeOutlineStyle(){const t=super.getResizeOutlineStyle();return t.stroke="none",t}getControlPointStyle(){const t=super.getControlPointStyle();return t.stroke="none",t.fill="none",t}getNodeStyle(){return{overflow:"visible"}}getOutlineStyle(){const t=super.getOutlineStyle();return t.stroke="none",t.hover&&(t.hover.stroke="none"),t}getAnchorStyle(t){const n=super.getAnchorStyle(t);return t.type==="left"?(n.fill="red",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transpanrent"),n.className="lf-hide-default"):n.fill="green",n}setHeight(t){const n=this.height,o=t+100;this.height=o,this.properties.height=o,this.move(0,(o-n)/2),this.outgoing.edges.forEach(r=>{r.updatePathByAnchor()}),this.incoming.edges.forEach(r=>{r.updatePathByAnchor()})}get_width(){var t;return((t=this.properties)==null?void 0:t.width)||340}setAttributes(){const{t}=jj.global;this.width=this.get_width();const n=(r,i)=>{const a=this.graphModel.getNodeIncomingNode(r);for(const s in a){const l=a[s];if(l.id===i)return!0;if(n(l.id,i))return!0}return!1},o={message:t("views.applicationWorkflow.tip.onlyRight"),validate:(r,i,a)=>a.type==="right"};this.sourceRules.push({message:t("views.applicationWorkflow.tip.notRecyclable"),validate:(r,i,a,s)=>i.id==r.id?!1:!this.graphModel.getNodeIncomingEdge(i.id).find(h=>h.targetAnchorId==s.id&&h.sourceAnchorId==a.id)&&!n(r.id,i.id)}),this.sourceRules.push(o),this.targetRules.push({message:t("views.applicationWorkflow.tip.onlyLeft"),validate:(r,i,a,s)=>s.type==="left"})}getDefaultAnchor(){const{id:t,x:n,y:o,width:r}=this,i=this.properties.showNode===void 0?!0:this.properties.showNode,a=[];return this.type&&this.type!==kr.Base.toString()&&([kr.Start.toString(),kr.LoopStartNode.toString()].includes(this.type)||a.push({x:n-r/2+10,y:i?o:o-15,id:`${t}_left`,edgeAddable:!1,type:"left"}),a.push({x:n+r/2-10,y:i?o:o-15,id:`${t}_right`,type:"right"})),a}}let Wne=class extends ai{constructor(t){super(t,Gq)}};const zne={type:"ai-chat-node",model:li,view:Wne},r8=Object.freeze(Object.defineProperty({__proto__:null,default:zne},Symbol.toStringTag,{value:"Module"})),Hne={class:"title-decoration-1 mb-8"},Xne={class:"flex align-center"},Yne={class:"mr-4"},qne=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ja(),n=hr(()=>t.path.includes("resource-management")?"systemManage":"workspace"),o={question_reference_address:["start-node","question"],api_input_field_list:[],user_input_field_list:[],document_list:["start-node","document"],image_list:["start-node","image"],audio_list:["start-node","audio"],video_list:["start-node","video"]},r=He(),i=hr({get:()=>(l.nodeModel.properties.node_data||Me.set(l.nodeModel.properties,"node_data",o),l.nodeModel.properties.node_data),set:h=>{Me.set(l.nodeModel.properties,"node_data",h)}});function a(h,v){const b=`${h}_list`;v?l.nodeModel.properties.node_data[b]||Me.set(l.nodeModel.properties.node_data,b,[]):delete l.nodeModel.properties.node_data[b]}const s=()=>{if(!l.nodeModel.properties.node_data.application_id){Me.set(l.nodeModel.properties,"status",500);return}oi({type:"application",systemType:n.value}).getApplicationDetail(l.nodeModel.properties.node_data.application_id).then(h=>{const v=Me.cloneDeep(l.nodeModel.properties.node_data.api_input_field_list),b=Me.cloneDeep(l.nodeModel.properties.node_data.user_input_field_list);if(j2(h.data.type)){const E=h.data.work_flow.nodes[0].properties.node_data,O=Me.cloneDeep(h.data.work_flow.nodes[0].properties.api_input_field_list),w=Me.cloneDeep(h.data.work_flow.nodes[0].properties.user_input_field_list),S=(O||[]).map(D=>{const P=v==null?void 0:v.find(B=>B.variable==D.variable);return P?{...D,value:P.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});Me.set(l.nodeModel.properties.node_data,"api_input_field_list",S);const M=(w||[]).map(D=>{const P=b==null?void 0:b.find(B=>B.field==D.field);return P?{...D,value:P.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});Me.set(l.nodeModel.properties.node_data,"user_input_field_list",M);const T=E.file_upload_enable,$=E.file_upload_setting;T?(a("document",$.document),a("image",$.image),a("audio",$.audio),a("video",$.video)):["document_list","image_list","audio_list","video_list"].forEach(D=>{delete l.nodeModel.properties.node_data[D]}),Me.set(l.nodeModel.properties,"status",h.data.id?200:500)}}).catch(h=>{console.log(h),Me.set(l.nodeModel.properties,"status",500)})},l=e,f=()=>{var h;return(h=r.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:l.nodeModel,errMessage:v}))};return bo(()=>{s(),Me.set(l.nodeModel,"validate",f)}),(h,v)=>{const b=ne("el-form-item"),E=ne("AppIcon"),O=ne("el-tooltip"),w=ne("el-switch"),S=ne("el-form"),M=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",Hne,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),k(M,{shadow:"never",class:"card-never"},{default:j(()=>[k(S,{onSubmit:v[7]||(v[7]=An(()=>{},["prevent"])),model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"applicationNodeFormRef",ref:r},{default:j(()=>[k(b,{label:h.$t("views.applicationWorkflow.nodes.startNode.question"),prop:"question_reference_address",rules:{message:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(Wo,{ref_key:"applicationNodeFormRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.question_reference_address,"onUpdate:modelValue":v[0]||(v[0]=T=>i.value.question_reference_address=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),i.value.hasOwnProperty("document_list")||"document_list"in i.value?(Ne(),bt(b,{key:0,label:h.$t("views.problem.relateParagraph.selectDocument"),prop:"document_list",rules:{message:h.$t("views.chatLog.documentPlaceholder"),trigger:"blur",required:!1}},{default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.chatLog.documentPlaceholder"),modelValue:i.value.document_list,"onUpdate:modelValue":v[1]||(v[1]=T=>i.value.document_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("image_list")||"image_list"in i.value?(Ne(),bt(b,{key:1,label:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),prop:"image_list",rules:{message:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"blur",required:!1}},{default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:i.value.image_list,"onUpdate:modelValue":v[2]||(v[2]=T=>i.value.image_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("audio_list")||"audio_list"in i.value?(Ne(),bt(b,{key:2,label:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),trigger:"blur",required:!1}},{default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:i.value.audio_list,"onUpdate:modelValue":v[3]||(v[3]=T=>i.value.audio_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("video_list")||"video_list"in i.value?(Ne(),bt(b,{key:3,label:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.label"),prop:"video_list",rules:{message:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),trigger:"blur",required:!1}},{default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),modelValue:i.value.video_list,"onUpdate:modelValue":v[4]||(v[4]=T=>i.value.video_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),(Ne(!0),mn(Ir,null,No(i.value.api_input_field_list,(T,$)=>(Ne(),mn("div",{key:"api-input-"+$},[k(b,{label:T.variable,prop:"api_input_field_list."+$+".value",rules:[{required:T.is_required,message:`${h.$t("common.inputPlaceholder")}${T.variable}`,trigger:"blur"}]},{default:j(()=>[k(Wo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.api_input_field_list[$].value,"onUpdate:modelValue":D=>i.value.api_input_field_list[$].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),(Ne(!0),mn(Ir,null,No(i.value.user_input_field_list,(T,$)=>(Ne(),mn("div",{key:"user-input-"+$},[k(b,{label:T.label,prop:"user_input_field_list."+$+".value",rules:[{required:T.required,message:`${h.$t("common.inputPlaceholder")}${T.label}`,trigger:"blur"}]},{default:j(()=>[k(Wo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.user_input_field_list[$].value,"onUpdate:modelValue":D=>i.value.user_input_field_list[$].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),k(b,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[6]||(v[6]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Xne,[ee("div",Yne,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(O,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(w,{size:"small",modelValue:i.value.is_result,"onUpdate:modelValue":v[5]||(v[5]=T=>i.value.is_result=T)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Kne extends ai{constructor(t){super(t,qne)}}const Zne={type:"application-node",model:li,view:Kne},o8=Object.freeze(Object.defineProperty({__proto__:null,default:Zne},Symbol.toStringTag,{value:"Module"}));/**!
|
||
* Sortable 1.15.6
|
||
* @author RubaXa <trash@rubaxa.org>
|
||
* @author owenm <owen23355@gmail.com>
|
||
* @license MIT
|
||
*/function NR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(o){Jne(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function tw(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tw=function(t){return typeof t}:tw=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tw(e)}function Jne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function up(){return up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},up.apply(this,arguments)}function Qne(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function ere(e,t){if(e==null)return{};var n=Qne(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var tre="1.15.6";function ap(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var hp=ap(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ab=ap(/Edge/i),kR=ap(/firefox/i),m_=ap(/safari/i)&&!ap(/chrome/i)&&!ap(/android/i),LM=ap(/iP(ad|od|hone)/i),i8=ap(/chrome/i)&&ap(/android/i),a8={capture:!1,passive:!1};function Vo(e,t,n){e.addEventListener(t,n,!hp&&a8)}function Bo(e,t,n){e.removeEventListener(t,n,!hp&&a8)}function f1(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function l8(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function zc(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&f1(e,t):f1(e,t))||o&&e===n)return e;if(e===n)break}while(e=l8(e))}return null}var PR=/\s+/g;function vu(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(PR," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(PR," ")}}function ro(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function Ag(e,t){var n="";if(typeof e=="string")n=e;else do{var o=ro(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function s8(e,t,n){if(e){var o=e.getElementsByTagName(t),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function Hd(){var e=document.scrollingElement;return e||document.documentElement}function Ya(e,t,n,o,r){if(!(!e.getBoundingClientRect&&e!==window)){var i,a,s,l,f,h,v;if(e!==window&&e.parentNode&&e!==Hd()?(i=e.getBoundingClientRect(),a=i.top,s=i.left,l=i.bottom,f=i.right,h=i.height,v=i.width):(a=0,s=0,l=window.innerHeight,f=window.innerWidth,h=window.innerHeight,v=window.innerWidth),(t||n)&&e!==window&&(r=r||e.parentNode,!hp))do if(r&&r.getBoundingClientRect&&(ro(r,"transform")!=="none"||n&&ro(r,"position")!=="static")){var b=r.getBoundingClientRect();a-=b.top+parseInt(ro(r,"border-top-width")),s-=b.left+parseInt(ro(r,"border-left-width")),l=a+i.height,f=s+i.width;break}while(r=r.parentNode);if(o&&e!==window){var E=Ag(r||e),O=E&&E.a,w=E&&E.d;E&&(a/=w,s/=O,v/=O,h/=w,l=a+h,f=s+v)}return{top:a,left:s,bottom:l,right:f,width:v,height:h}}}function RR(e,t,n){for(var o=_h(e,!0),r=Ya(e)[t];o;){var i=Ya(o)[n],a=void 0;if(a=r>=i,!a)return o;if(o===Hd())break;o=_h(o,!1)}return!1}function Xg(e,t,n,o){for(var r=0,i=0,a=e.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==Zr.ghost&&(o||a[i]!==Zr.dragged)&&zc(a[i],n.draggable,e,!1)){if(r===t)return a[i];r++}i++}return null}function IM(e,t){for(var n=e.lastElementChild;n&&(n===Zr.ghost||ro(n,"display")==="none"||t&&!f1(n,t));)n=n.previousElementSibling;return n||null}function zu(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Zr.clone&&(!t||f1(e,t))&&n++;return n}function DR(e){var t=0,n=0,o=Hd();if(e)do{var r=Ag(e),i=r.a,a=r.d;t+=e.scrollLeft*i,n+=e.scrollTop*a}while(e!==o&&(e=e.parentNode));return[t,n]}function nre(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function _h(e,t){if(!e||!e.getBoundingClientRect)return Hd();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=ro(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Hd();if(o||t)return n;o=!0}}while(n=n.parentNode);return Hd()}function rre(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function ES(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var g_;function u8(e,t){return function(){if(!g_){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),g_=setTimeout(function(){g_=void 0},t)}}}function ore(){clearTimeout(g_),g_=void 0}function c8(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function d8(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function f8(e,t,n){var o={};return Array.from(e.children).forEach(function(r){var i,a,s,l;if(!(!zc(r,t.draggable,e,!1)||r.animated||r===n)){var f=Ya(r);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:1/0,f.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,f.top),o.right=Math.max((s=o.right)!==null&&s!==void 0?s:-1/0,f.right),o.bottom=Math.max((l=o.bottom)!==null&&l!==void 0?l:-1/0,f.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var zs="Sortable"+new Date().getTime();function ire(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(ro(r,"display")==="none"||r===Zr.ghost)){e.push({target:r,rect:Ya(r)});var i=Yd({},e[e.length-1].rect);if(r.thisAnimationDuration){var a=Ag(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(nre(e,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var i=!1,a=0;e.forEach(function(s){var l=0,f=s.target,h=f.fromRect,v=Ya(f),b=f.prevFromRect,E=f.prevToRect,O=s.rect,w=Ag(f,!0);w&&(v.top-=w.f,v.left-=w.e),f.toRect=v,f.thisAnimationDuration&&ES(b,v)&&!ES(h,v)&&(O.top-v.top)/(O.left-v.left)===(h.top-v.top)/(h.left-v.left)&&(l=lre(O,b,E,r.options)),ES(v,h)||(f.prevFromRect=h,f.prevToRect=v,l||(l=r.options.animation),r.animate(f,O,v,l)),l&&(i=!0,a=Math.max(a,l),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},l),f.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),e=[]},animate:function(o,r,i,a){if(a){ro(o,"transition",""),ro(o,"transform","");var s=Ag(this.el),l=s&&s.a,f=s&&s.d,h=(r.left-i.left)/(l||1),v=(r.top-i.top)/(f||1);o.animatingX=!!h,o.animatingY=!!v,ro(o,"transform","translate3d("+h+"px,"+v+"px,0)"),this.forRepaintDummy=are(o),ro(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),ro(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){ro(o,"transition",""),ro(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function are(e){return e.offsetWidth}function lre(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var sg=[],xS={initializeByDefault:!0},lb={mount:function(t){for(var n in xS)xS.hasOwnProperty(n)&&!(n in t)&&(t[n]=xS[n]);sg.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),sg.push(t)},pluginEvent:function(t,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=t+"Global";sg.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][i]&&n[a.pluginName][i](Yd({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][t]&&n[a.pluginName][t](Yd({sortable:n},o)))})},initializePlugins:function(t,n,o,r){sg.forEach(function(s){var l=s.pluginName;if(!(!t.options[l]&&!s.initializeByDefault)){var f=new s(t,n,t.options);f.sortable=t,f.options=t.options,t[l]=f,up(o,f.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var a=this.modifyOption(t,i,t.options[i]);typeof a<"u"&&(t.options[i]=a)}},getEventProperties:function(t,n){var o={};return sg.forEach(function(r){typeof r.eventProperties=="function"&&up(o,r.eventProperties.call(n[r.pluginName],t))}),o},modifyOption:function(t,n,o){var r;return sg.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(r=i.optionListeners[n].call(t[i.pluginName],o))}),r}};function sre(e){var t=e.sortable,n=e.rootEl,o=e.name,r=e.targetEl,i=e.cloneEl,a=e.toEl,s=e.fromEl,l=e.oldIndex,f=e.newIndex,h=e.oldDraggableIndex,v=e.newDraggableIndex,b=e.originalEvent,E=e.putSortable,O=e.extraEventProperties;if(t=t||n&&n[zs],!!t){var w,S=t.options,M="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!hp&&!ab?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||n,w.from=s||n,w.item=r||n,w.clone=i,w.oldIndex=l,w.newIndex=f,w.oldDraggableIndex=h,w.newDraggableIndex=v,w.originalEvent=b,w.pullMode=E?E.lastPutMode:void 0;var T=Yd(Yd({},O),lb.getEventProperties(o,t));for(var $ in T)w[$]=T[$];n&&n.dispatchEvent(w),S[M]&&S[M].call(t,w)}}var ure=["evt"],Gs=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=ere(o,ure);lb.pluginEvent.bind(Zr)(t,n,Yd({dragEl:Xn,parentEl:Aa,ghostEl:po,rootEl:ca,nextEl:Dv,lastDownEl:nw,cloneEl:_a,cloneHidden:vh,dragStarted:Yy,putSortable:Dl,activeSortable:Zr.active,originalEvent:r,oldIndex:xg,oldDraggableIndex:y_,newIndex:mu,newDraggableIndex:hh,hideGhostForTarget:m8,unhideGhostForTarget:g8,cloneNowHidden:function(){vh=!0},cloneNowShown:function(){vh=!1},dispatchSortableEvent:function(s){_s({sortable:n,name:s,originalEvent:r})}},i))};function _s(e){sre(Yd({putSortable:Dl,cloneEl:_a,targetEl:Xn,rootEl:ca,oldIndex:xg,oldDraggableIndex:y_,newIndex:mu,newDraggableIndex:hh},e))}var Xn,Aa,po,ca,Dv,nw,_a,vh,xg,mu,y_,hh,F0,Dl,hg=!1,p1=!1,h1=[],kv,Vc,OS,SS,jR,LR,Yy,ug,__,b_=!1,B0=!1,rw,ql,AS=[],m2=!1,v1=[],tE=typeof document<"u",$0=LM,IR=ab||hp?"cssFloat":"float",cre=tE&&!i8&&!LM&&"draggable"in document.createElement("div"),p8=(function(){if(tE){if(hp)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),h8=function(t,n){var o=ro(t),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=Xg(t,0,n),a=Xg(t,1,n),s=i&&ro(i),l=a&&ro(a),f=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ya(i).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ya(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var v=s.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===v)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||f>=r&&o[IR]==="none"||a&&o[IR]==="none"&&f+h>r)?"vertical":"horizontal"},dre=function(t,n,o){var r=o?t.left:t.top,i=o?t.right:t.bottom,a=o?t.width:t.height,s=o?n.left:n.top,l=o?n.right:n.bottom,f=o?n.width:n.height;return r===s||i===l||r+a/2===s+f/2},fre=function(t,n){var o;return h1.some(function(r){var i=r[zs].options.emptyInsertThreshold;if(!(!i||IM(r))){var a=Ya(r),s=t>=a.left-i&&t<=a.right+i,l=n>=a.top-i&&n<=a.bottom+i;if(s&&l)return o=r}}),o},v8=function(t){function n(i,a){return function(s,l,f,h){var v=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(i==null&&(a||v))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return n(i(s,l,f,h),a)(s,l,f,h);var b=(a?s:l).options.group.name;return i===!0||typeof i=="string"&&i===b||i.join&&i.indexOf(b)>-1}}var o={},r=t.group;(!r||tw(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=n(r.pull,!0),o.checkPut=n(r.put),o.revertClone=r.revertClone,t.group=o},m8=function(){!p8&&po&&ro(po,"display","none")},g8=function(){!p8&&po&&ro(po,"display","")};tE&&!i8&&document.addEventListener("click",function(e){if(p1)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),p1=!1,!1},!0);var Pv=function(t){if(Xn){t=t.touches?t.touches[0]:t;var n=fre(t.clientX,t.clientY);if(n){var o={};for(var r in t)t.hasOwnProperty(r)&&(o[r]=t[r]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[zs]._onDragOver(o)}}},pre=function(t){Xn&&Xn.parentNode[zs]._isOutsideThisEl(t.target)};function Zr(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=up({},t),e[zs]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return h8(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,s){a.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Zr.supportPointer!==!1&&"PointerEvent"in window&&(!m_||LM),emptyInsertThreshold:5};lb.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);v8(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:cre,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Vo(e,"pointerdown",this._onTapStart):(Vo(e,"mousedown",this._onTapStart),Vo(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Vo(e,"dragover",this),Vo(e,"dragenter",this)),h1.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),up(this,ire())}Zr.prototype={constructor:Zr,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ug=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,Xn):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,r=this.options,i=r.preventOnFilter,a=t.type,s=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(s||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=r.filter;if(wre(o),!Xn&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||r.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&m_&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=zc(l,r.draggable,o,!1),!(l&&l.animated)&&nw!==l)){if(xg=zu(l),y_=zu(l,r.draggable),typeof h=="function"){if(h.call(this,t,l,this)){_s({sortable:n,rootEl:f,name:"filter",targetEl:l,toEl:o,fromEl:o}),Gs("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(v){if(v=zc(f,v.trim(),o,!1),v)return _s({sortable:n,rootEl:v,name:"filter",targetEl:l,fromEl:o,toEl:o}),Gs("filter",n,{evt:t}),!0}),h)){i&&t.preventDefault();return}r.handle&&!zc(f,r.handle,o,!1)||this._prepareDragStart(t,s,l)}}},_prepareDragStart:function(t,n,o){var r=this,i=r.el,a=r.options,s=i.ownerDocument,l;if(o&&!Xn&&o.parentNode===i){var f=Ya(o);if(ca=i,Xn=o,Aa=Xn.parentNode,Dv=Xn.nextSibling,nw=o,F0=a.group,Zr.dragged=Xn,kv={target:Xn,clientX:(n||t).clientX,clientY:(n||t).clientY},jR=kv.clientX-f.left,LR=kv.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,Xn.style["will-change"]="all",l=function(){if(Gs("delayEnded",r,{evt:t}),Zr.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!kR&&r.nativeDraggable&&(Xn.draggable=!0),r._triggerDragStart(t,n),_s({sortable:r,name:"choose",originalEvent:t}),vu(Xn,a.chosenClass,!0)},a.ignore.split(",").forEach(function(h){s8(Xn,h.trim(),MS)}),Vo(s,"dragover",Pv),Vo(s,"mousemove",Pv),Vo(s,"touchmove",Pv),a.supportPointer?(Vo(s,"pointerup",r._onDrop),!this.nativeDraggable&&Vo(s,"pointercancel",r._onDrop)):(Vo(s,"mouseup",r._onDrop),Vo(s,"touchend",r._onDrop),Vo(s,"touchcancel",r._onDrop)),kR&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Xn.draggable=!0),Gs("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ab||hp))){if(Zr.eventCanceled){this._onDrop();return}a.supportPointer?(Vo(s,"pointerup",r._disableDelayedDrag),Vo(s,"pointercancel",r._disableDelayedDrag)):(Vo(s,"mouseup",r._disableDelayedDrag),Vo(s,"touchend",r._disableDelayedDrag),Vo(s,"touchcancel",r._disableDelayedDrag)),Vo(s,"mousemove",r._delayedDragTouchMoveHandler),Vo(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&Vo(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Xn&&MS(Xn),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Bo(t,"mouseup",this._disableDelayedDrag),Bo(t,"touchend",this._disableDelayedDrag),Bo(t,"touchcancel",this._disableDelayedDrag),Bo(t,"pointerup",this._disableDelayedDrag),Bo(t,"pointercancel",this._disableDelayedDrag),Bo(t,"mousemove",this._delayedDragTouchMoveHandler),Bo(t,"touchmove",this._delayedDragTouchMoveHandler),Bo(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Vo(document,"pointermove",this._onTouchMove):n?Vo(document,"touchmove",this._onTouchMove):Vo(document,"mousemove",this._onTouchMove):(Vo(Xn,"dragend",this),Vo(ca,"dragstart",this._onDragStart));try{document.selection?ow(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(hg=!1,ca&&Xn){Gs("dragStarted",this,{evt:n}),this.nativeDraggable&&Vo(document,"dragover",pre);var o=this.options;!t&&vu(Xn,o.dragClass,!1),vu(Xn,o.ghostClass,!0),Zr.active=this,t&&this._appendGhost(),_s({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Vc){this._lastX=Vc.clientX,this._lastY=Vc.clientY,m8();for(var t=document.elementFromPoint(Vc.clientX,Vc.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Vc.clientX,Vc.clientY),t!==n);)n=t;if(Xn.parentNode[zs]._isOutsideThisEl(t),n)do{if(n[zs]){var o=void 0;if(o=n[zs]._onDragOver({clientX:Vc.clientX,clientY:Vc.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=l8(n));g8()}},_onTouchMove:function(t){if(kv){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=t.touches?t.touches[0]:t,a=po&&Ag(po,!0),s=po&&a&&a.a,l=po&&a&&a.d,f=$0&&ql&&DR(ql),h=(i.clientX-kv.clientX+r.x)/(s||1)+(f?f[0]-AS[0]:0)/(s||1),v=(i.clientY-kv.clientY+r.y)/(l||1)+(f?f[1]-AS[1]:0)/(l||1);if(!Zr.active&&!hg){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(po){a?(a.e+=h-(OS||0),a.f+=v-(SS||0)):a={a:1,b:0,c:0,d:1,e:h,f:v};var b="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ro(po,"webkitTransform",b),ro(po,"mozTransform",b),ro(po,"msTransform",b),ro(po,"transform",b),OS=h,SS=v,Vc=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!po){var t=this.options.fallbackOnBody?document.body:ca,n=Ya(Xn,!0,$0,!0,t),o=this.options;if($0){for(ql=t;ro(ql,"position")==="static"&&ro(ql,"transform")==="none"&&ql!==document;)ql=ql.parentNode;ql!==document.body&&ql!==document.documentElement?(ql===document&&(ql=Hd()),n.top+=ql.scrollTop,n.left+=ql.scrollLeft):ql=Hd(),AS=DR(ql)}po=Xn.cloneNode(!0),vu(po,o.ghostClass,!1),vu(po,o.fallbackClass,!0),vu(po,o.dragClass,!0),ro(po,"transition",""),ro(po,"transform",""),ro(po,"box-sizing","border-box"),ro(po,"margin",0),ro(po,"top",n.top),ro(po,"left",n.left),ro(po,"width",n.width),ro(po,"height",n.height),ro(po,"opacity","0.8"),ro(po,"position",$0?"absolute":"fixed"),ro(po,"zIndex","100000"),ro(po,"pointerEvents","none"),Zr.ghost=po,t.appendChild(po),ro(po,"transform-origin",jR/parseInt(po.style.width)*100+"% "+LR/parseInt(po.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,r=t.dataTransfer,i=o.options;if(Gs("dragStart",this,{evt:t}),Zr.eventCanceled){this._onDrop();return}Gs("setupClone",this),Zr.eventCanceled||(_a=d8(Xn),_a.removeAttribute("id"),_a.draggable=!1,_a.style["will-change"]="",this._hideClone(),vu(_a,this.options.chosenClass,!1),Zr.clone=_a),o.cloneId=ow(function(){Gs("clone",o),!Zr.eventCanceled&&(o.options.removeCloneOnHide||ca.insertBefore(_a,Xn),o._hideClone(),_s({sortable:o,name:"clone"}))}),!n&&vu(Xn,i.dragClass,!0),n?(p1=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Bo(document,"mouseup",o._onDrop),Bo(document,"touchend",o._onDrop),Bo(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,Xn)),Vo(document,"drop",o),ro(Xn,"transform","translateZ(0)")),hg=!0,o._dragStartId=ow(o._dragStarted.bind(o,n,t)),Vo(document,"selectstart",o),Yy=!0,window.getSelection().removeAllRanges(),m_&&ro(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,r,i,a,s=this.options,l=s.group,f=Zr.active,h=F0===l,v=s.sort,b=Dl||f,E,O=this,w=!1;if(m2)return;function S(Ae,Pe){Gs(Ae,O,Yd({evt:t,isOwner:h,axis:E?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:v,fromSortable:b,target:o,completed:T,onMove:function(ze,Ye){return U0(ca,n,Xn,r,ze,Ya(ze),t,Ye)},changed:$},Pe))}function M(){S("dragOverAnimationCapture"),O.captureAnimationState(),O!==b&&b.captureAnimationState()}function T(Ae){return S("dragOverCompleted",{insertion:Ae}),Ae&&(h?f._hideClone():f._showClone(O),O!==b&&(vu(Xn,Dl?Dl.options.ghostClass:f.options.ghostClass,!1),vu(Xn,s.ghostClass,!0)),Dl!==O&&O!==Zr.active?Dl=O:O===Zr.active&&Dl&&(Dl=null),b===O&&(O._ignoreWhileAnimating=o),O.animateAll(function(){S("dragOverAnimationComplete"),O._ignoreWhileAnimating=null}),O!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(o===Xn&&!Xn.animated||o===n&&!o.animated)&&(ug=null),!s.dragoverBubble&&!t.rootEl&&o!==document&&(Xn.parentNode[zs]._isOutsideThisEl(t.target),!Ae&&Pv(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),w=!0}function $(){mu=zu(Xn),hh=zu(Xn,s.draggable),_s({sortable:O,name:"change",toEl:n,newIndex:mu,newDraggableIndex:hh,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=zc(o,s.draggable,n,!0),S("dragOver"),Zr.eventCanceled)return w;if(Xn.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||O._ignoreWhileAnimating===o)return T(!1);if(p1=!1,f&&!s.disabled&&(h?v||(a=Aa!==ca):Dl===this||(this.lastPutMode=F0.checkPull(this,f,Xn,t))&&l.checkPut(this,f,Xn,t))){if(E=this._getDirection(t,o)==="vertical",r=Ya(Xn),S("dragOverValid"),Zr.eventCanceled)return w;if(a)return Aa=ca,M(),this._hideClone(),S("revert"),Zr.eventCanceled||(Dv?ca.insertBefore(Xn,Dv):ca.appendChild(Xn)),T(!0);var D=IM(n,s.draggable);if(!D||gre(t,E,this)&&!D.animated){if(D===Xn)return T(!1);if(D&&n===t.target&&(o=D),o&&(i=Ya(o)),U0(ca,n,Xn,r,o,i,t,!!o)!==!1)return M(),D&&D.nextSibling?n.insertBefore(Xn,D.nextSibling):n.appendChild(Xn),Aa=n,$(),T(!0)}else if(D&&mre(t,E,this)){var P=Xg(n,0,s,!0);if(P===Xn)return T(!1);if(o=P,i=Ya(o),U0(ca,n,Xn,r,o,i,t,!1)!==!1)return M(),n.insertBefore(Xn,P),Aa=n,$(),T(!0)}else if(o.parentNode===n){i=Ya(o);var B=0,F,I=Xn.parentNode!==n,V=!dre(Xn.animated&&Xn.toRect||r,o.animated&&o.toRect||i,E),z=E?"top":"left",q=RR(o,"top","top")||RR(Xn,"top","top"),X=q?q.scrollTop:void 0;ug!==o&&(F=i[z],b_=!1,B0=!V&&s.invertSwap||I),B=yre(t,o,i,E,V?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,B0,ug===o);var G;if(B!==0){var Q=zu(Xn);do Q-=B,G=Aa.children[Q];while(G&&(ro(G,"display")==="none"||G===po))}if(B===0||G===o)return T(!1);ug=o,__=B;var J=o.nextElementSibling,ie=!1;ie=B===1;var Se=U0(ca,n,Xn,r,o,i,t,ie);if(Se!==!1)return(Se===1||Se===-1)&&(ie=Se===1),m2=!0,setTimeout(vre,30),M(),ie&&!J?n.appendChild(Xn):o.parentNode.insertBefore(Xn,ie?J:o),q&&c8(q,0,X-q.scrollTop),Aa=Xn.parentNode,F!==void 0&&!B0&&(rw=Math.abs(F-Ya(o)[z])),$(),T(!0)}if(n.contains(Xn))return T(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Bo(document,"mousemove",this._onTouchMove),Bo(document,"touchmove",this._onTouchMove),Bo(document,"pointermove",this._onTouchMove),Bo(document,"dragover",Pv),Bo(document,"mousemove",Pv),Bo(document,"touchmove",Pv)},_offUpEvents:function(){var t=this.el.ownerDocument;Bo(t,"mouseup",this._onDrop),Bo(t,"touchend",this._onDrop),Bo(t,"pointerup",this._onDrop),Bo(t,"pointercancel",this._onDrop),Bo(t,"touchcancel",this._onDrop),Bo(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(mu=zu(Xn),hh=zu(Xn,o.draggable),Gs("drop",this,{evt:t}),Aa=Xn&&Xn.parentNode,mu=zu(Xn),hh=zu(Xn,o.draggable),Zr.eventCanceled){this._nulling();return}hg=!1,B0=!1,b_=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),g2(this.cloneId),g2(this._dragStartId),this.nativeDraggable&&(Bo(document,"drop",this),Bo(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),m_&&ro(document.body,"user-select",""),ro(Xn,"transform",""),t&&(Yy&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),po&&po.parentNode&&po.parentNode.removeChild(po),(ca===Aa||Dl&&Dl.lastPutMode!=="clone")&&_a&&_a.parentNode&&_a.parentNode.removeChild(_a),Xn&&(this.nativeDraggable&&Bo(Xn,"dragend",this),MS(Xn),Xn.style["will-change"]="",Yy&&!hg&&vu(Xn,Dl?Dl.options.ghostClass:this.options.ghostClass,!1),vu(Xn,this.options.chosenClass,!1),_s({sortable:this,name:"unchoose",toEl:Aa,newIndex:null,newDraggableIndex:null,originalEvent:t}),ca!==Aa?(mu>=0&&(_s({rootEl:Aa,name:"add",toEl:Aa,fromEl:ca,originalEvent:t}),_s({sortable:this,name:"remove",toEl:Aa,originalEvent:t}),_s({rootEl:Aa,name:"sort",toEl:Aa,fromEl:ca,originalEvent:t}),_s({sortable:this,name:"sort",toEl:Aa,originalEvent:t})),Dl&&Dl.save()):mu!==xg&&mu>=0&&(_s({sortable:this,name:"update",toEl:Aa,originalEvent:t}),_s({sortable:this,name:"sort",toEl:Aa,originalEvent:t})),Zr.active&&((mu==null||mu===-1)&&(mu=xg,hh=y_),_s({sortable:this,name:"end",toEl:Aa,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Gs("nulling",this),ca=Xn=Aa=po=Dv=_a=nw=vh=kv=Vc=Yy=mu=hh=xg=y_=ug=__=Dl=F0=Zr.dragged=Zr.ghost=Zr.clone=Zr.active=null,v1.forEach(function(t){t.checked=!0}),v1.length=OS=SS=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Xn&&(this._onDragOver(t),hre(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,r=0,i=o.length,a=this.options;r<i;r++)n=o[r],zc(n,a.draggable,this.el,!1)&&t.push(n.getAttribute(a.dataIdAttr)||bre(n));return t},sort:function(t,n){var o={},r=this.el;this.toArray().forEach(function(i,a){var s=r.children[a];zc(s,this.options.draggable,r,!1)&&(o[i]=s)},this),n&&this.captureAnimationState(),t.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return zc(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var r=lb.modifyOption(this,t,n);typeof r<"u"?o[t]=r:o[t]=n,t==="group"&&v8(o)},destroy:function(){Gs("destroy",this);var t=this.el;t[zs]=null,Bo(t,"mousedown",this._onTapStart),Bo(t,"touchstart",this._onTapStart),Bo(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Bo(t,"dragover",this),Bo(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),h1.splice(h1.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!vh){if(Gs("hideClone",this),Zr.eventCanceled)return;ro(_a,"display","none"),this.options.removeCloneOnHide&&_a.parentNode&&_a.parentNode.removeChild(_a),vh=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(vh){if(Gs("showClone",this),Zr.eventCanceled)return;Xn.parentNode==ca&&!this.options.group.revertClone?ca.insertBefore(_a,Xn):Dv?ca.insertBefore(_a,Dv):ca.appendChild(_a),this.options.group.revertClone&&this.animate(Xn,_a),ro(_a,"display",""),vh=!1}}};function hre(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function U0(e,t,n,o,r,i,a,s){var l,f=e[zs],h=f.options.onMove,v;return window.CustomEvent&&!hp&&!ab?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=r||t,l.relatedRect=i||Ya(t),l.willInsertAfter=s,l.originalEvent=a,e.dispatchEvent(l),h&&(v=h.call(f,l,a)),v}function MS(e){e.draggable=!1}function vre(){m2=!1}function mre(e,t,n){var o=Ya(Xg(n.el,0,n.options,!0)),r=f8(n.el,n.options,po),i=10;return t?e.clientX<r.left-i||e.clientY<o.top&&e.clientX<o.right:e.clientY<r.top-i||e.clientY<o.bottom&&e.clientX<o.left}function gre(e,t,n){var o=Ya(IM(n.el,n.options.draggable)),r=f8(n.el,n.options,po),i=10;return t?e.clientX>r.right+i||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>r.bottom+i||e.clientX>o.right&&e.clientY>o.top}function yre(e,t,n,o,r,i,a,s){var l=o?e.clientY:e.clientX,f=o?n.height:n.width,h=o?n.top:n.left,v=o?n.bottom:n.right,b=!1;if(!a){if(s&&rw<f*r){if(!b_&&(__===1?l>h+f*i/2:l<v-f*i/2)&&(b_=!0),b_)b=!0;else if(__===1?l<h+rw:l>v-rw)return-__}else if(l>h+f*(1-r)/2&&l<v-f*(1-r)/2)return _re(t)}return b=b||a,b&&(l<h+f*i/2||l>v-f*i/2)?l>h+f/2?1:-1:0}function _re(e){return zu(Xn)<zu(e)?1:-1}function bre(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function wre(e){v1.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&v1.push(o)}}function ow(e){return setTimeout(e,0)}function g2(e){return clearTimeout(e)}tE&&Vo(document,"touchmove",function(e){(Zr.active||hg)&&e.cancelable&&e.preventDefault()});Zr.utils={on:Vo,off:Bo,css:ro,find:s8,is:function(t,n){return!!zc(t,n,t,!1)},extend:rre,throttle:u8,closest:zc,toggleClass:vu,clone:d8,index:zu,nextTick:ow,cancelNextTick:g2,detectDirection:h8,getChild:Xg,expando:zs};Zr.get=function(e){return e[zs]};Zr.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(Zr.utils=Yd(Yd({},Zr.utils),o.utils)),lb.mount(o)})};Zr.create=function(e,t){return new Zr(e,t)};Zr.version=tre;var Xa=[],qy,y2,_2=!1,TS,CS,m1,Ky;function Ere(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Vo(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Vo(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Vo(document,"touchmove",this._handleFallbackAutoScroll):Vo(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Bo(document,"dragover",this._handleAutoScroll):(Bo(document,"pointermove",this._handleFallbackAutoScroll),Bo(document,"touchmove",this._handleFallbackAutoScroll),Bo(document,"mousemove",this._handleFallbackAutoScroll)),FR(),iw(),ore()},nulling:function(){m1=y2=qy=_2=Ky=TS=CS=null,Xa.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var r=this,i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,s=document.elementFromPoint(i,a);if(m1=n,o||this.options.forceAutoScrollFallback||ab||hp||m_){NS(n,this.options,s,o);var l=_h(s,!0);_2&&(!Ky||i!==TS||a!==CS)&&(Ky&&FR(),Ky=setInterval(function(){var f=_h(document.elementFromPoint(i,a),!0);f!==l&&(l=f,iw()),NS(n,r.options,f,o)},10),TS=i,CS=a)}else{if(!this.options.bubbleScroll||_h(s,!0)===Hd()){iw();return}NS(n,this.options,_h(s,!1),!1)}}},up(e,{pluginName:"scroll",initializeByDefault:!0})}function iw(){Xa.forEach(function(e){clearInterval(e.pid)}),Xa=[]}function FR(){clearInterval(Ky)}var NS=u8(function(e,t,n,o){if(t.scroll){var r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,s=t.scrollSpeed,l=Hd(),f=!1,h;y2!==n&&(y2=n,iw(),qy=t.scroll,h=t.scrollFn,qy===!0&&(qy=_h(n,!0)));var v=0,b=qy;do{var E=b,O=Ya(E),w=O.top,S=O.bottom,M=O.left,T=O.right,$=O.width,D=O.height,P=void 0,B=void 0,F=E.scrollWidth,I=E.scrollHeight,V=ro(E),z=E.scrollLeft,q=E.scrollTop;E===l?(P=$<F&&(V.overflowX==="auto"||V.overflowX==="scroll"||V.overflowX==="visible"),B=D<I&&(V.overflowY==="auto"||V.overflowY==="scroll"||V.overflowY==="visible")):(P=$<F&&(V.overflowX==="auto"||V.overflowX==="scroll"),B=D<I&&(V.overflowY==="auto"||V.overflowY==="scroll"));var X=P&&(Math.abs(T-r)<=a&&z+$<F)-(Math.abs(M-r)<=a&&!!z),G=B&&(Math.abs(S-i)<=a&&q+D<I)-(Math.abs(w-i)<=a&&!!q);if(!Xa[v])for(var Q=0;Q<=v;Q++)Xa[Q]||(Xa[Q]={});(Xa[v].vx!=X||Xa[v].vy!=G||Xa[v].el!==E)&&(Xa[v].el=E,Xa[v].vx=X,Xa[v].vy=G,clearInterval(Xa[v].pid),(X!=0||G!=0)&&(f=!0,Xa[v].pid=setInterval((function(){o&&this.layer===0&&Zr.active._onTouchMove(m1);var J=Xa[this.layer].vy?Xa[this.layer].vy*s:0,ie=Xa[this.layer].vx?Xa[this.layer].vx*s:0;typeof h=="function"&&h.call(Zr.dragged.parentNode[zs],ie,J,e,m1,Xa[this.layer].el)!=="continue"||c8(Xa[this.layer].el,ie,J)}).bind({layer:v}),24))),v++}while(t.bubbleScroll&&b!==l&&(b=_h(b,!1)));_2=f}},30),y8=function(t){var n=t.originalEvent,o=t.putSortable,r=t.dragEl,i=t.activeSortable,a=t.dispatchSortableEvent,s=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var f=o||i;s();var h=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,v=document.elementFromPoint(h.clientX,h.clientY);l(),f&&!f.el.contains(v)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function FM(){}FM.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=Xg(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:y8};up(FM,{pluginName:"revertOnSpill"});function BM(){}BM.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,r=o||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:y8};up(BM,{pluginName:"removeOnSpill"});Zr.mount(new Ere);Zr.mount(BM,FM);const xre={class:"dialog-footer"},Ore=_r({__name:"ApiFieldFormDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He({name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""}),l=Rh({name:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],variable:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),f=He(!1);K_(f,E=>{E||(s.value={name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""},a.value=!1)});const h=E=>{E&&(s.value=Me.cloneDeep(E),a.value=!0),f.value=!0},v=()=>{f.value=!1,a.value=!1},b=async E=>{E&&await E.validate(O=>{O&&o("refresh",s.value)})};return t({open:h,close:v}),(E,O)=>{const w=ne("el-input"),S=ne("el-form-item"),M=ne("el-switch"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?E.$t("common.param.editParam"):E.$t("common.param.addParam"),modelValue:f.value,"onUpdate:modelValue":O[10]||(O[10]=P=>f.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":v,"append-to-body":""},{footer:j(()=>[ee("span",xre,[k($,{onClick:O[8]||(O[8]=An(P=>f.value=!1,["prevent"]))},{default:j(()=>[ft(_e(E.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:O[9]||(O[9]=P=>b(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?E.$t("common.save"):E.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:l,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[k(S,{label:E.$t("dynamicsForm.paramForm.field.label"),prop:"variable"},{default:j(()=>[k(w,{modelValue:s.value.variable,"onUpdate:modelValue":O[0]||(O[0]=P=>s.value.variable=P),placeholder:E.$t("dynamicsForm.paramForm.field.placeholder"),maxlength:"64","show-word-limit":"",onBlur:O[1]||(O[1]=P=>s.value.variable=s.value.variable.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(S,{label:E.$t("common.desc")},{default:j(()=>[k(w,{modelValue:s.value.desc,"onUpdate:modelValue":O[2]||(O[2]=P=>s.value.desc=P),placeholder:E.$t("common.descPlaceholder"),onBlur:O[3]||(O[3]=P=>s.value.name=s.value.name.trim()),maxlength:"64","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(S,{label:E.$t("dynamicsForm.paramForm.required.label"),onClick:O[5]||(O[5]=An(()=>{},["prevent"]))},{default:j(()=>[k(M,{size:"small",modelValue:s.value.is_required,"onUpdate:modelValue":O[4]||(O[4]=P=>s.value.is_required=P)},null,8,["modelValue"])]),_:1},8,["label"]),k(S,{label:E.$t("dynamicsForm.default.label"),prop:"default_value",rules:{required:s.value.is_required,message:E.$t("dynamicsForm.default.placeholder"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:s.value.default_value,"onUpdate:modelValue":O[6]||(O[6]=P=>s.value.default_value=P),placeholder:E.$t("dynamicsForm.default.placeholder"),onBlur:O[7]||(O[7]=P=>s.value.name=s.value.name.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),Sre={class:"flex-between mb-16"},Are={class:"lighter"},Mre=["title"],Tre=["title"],Cre=["title"],Nre={class:"mr-4"},kre=_r({__name:"ApiInputFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(null),r=He(),i=He([]);function a(h,v){typeof v<"u"&&(o.value=v),r.value.open(h)}function s(h){i.value.splice(h,1),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function l(h){for(let b=0;b<i.value.length;b++)if(i.value[b].variable===h.variable&&o.value!==b){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}const v=t.nodeModel.properties.user_input_field_list;for(let b=0;b<v.length;b++)if(v[b].field===h.variable){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}o.value!==null?i.value.splice(o.value,1,h):i.value.push(h),o.value=null,r.value.close(),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function f(){if(!n.value)return;const v=n.value.$el.querySelector(".api-input-field-table .el-table__body-wrapper tbody");v&&Zr.create(v,{animation:150,ghostClass:"ghost-row",onEnd:b=>{if(b.oldIndex===void 0||b.newIndex===void 0)return;const E=Me.cloneDeep([...i.value]),[O]=E.splice(b.oldIndex,1);E.splice(b.newIndex,0,O),i.value=E,t.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return bo(()=>{t.nodeModel.properties.api_input_field_list?i.value.push(...t.nodeModel.properties.api_input_field_list):t.nodeModel.properties.input_field_list&&t.nodeModel.properties.input_field_list.filter(h=>h.assignment_method==="api_input").forEach(h=>{i.value.push(h)}),Me.set(t.nodeModel.properties,"api_input_field_list",i),f()}),(h,v)=>{var T;const b=ne("AppIcon"),E=ne("el-button"),O=ne("el-table-column"),w=ne("el-switch"),S=ne("el-tooltip"),M=ne("el-table");return Ne(),mn(Ir,null,[ee("div",Sre,[ee("h5",Are,_e(h.$t("views.model.modelForm.title.apiParamPassing")),1),k(E,{link:"",type:"primary",onClick:v[0]||(v[0]=$=>a())},{default:j(()=>[k(b,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(h.$t("common.add")),1)]),_:1})]),((T=t.nodeModel.properties.api_input_field_list)==null?void 0:T.length)>0?(Ne(),bt(M,{key:0,data:t.nodeModel.properties.api_input_field_list,class:"mb-16 api-input-field-table",ref_key:"tableRef",ref:n,"row-key":"variable"},{default:j(()=>[k(O,{prop:"variable",label:h.$t("dynamicsForm.paramForm.field.label")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.variable},_e($.variable),9,Mre)]),_:1},8,["label"]),k(O,{prop:"desc",label:h.$t("common.desc")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.desc},_e($.desc),9,Tre)]),_:1},8,["label"]),k(O,{prop:"default_value",label:h.$t("dynamicsForm.default.label")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.default_value},_e($.default_value),9,Cre)]),_:1},8,["label"]),k(O,{label:h.$t("common.required")},{default:j(({row:$})=>[ee("div",{onClick:v[1]||(v[1]=An(()=>{},["stop"]))},[k(w,{disabled:"",size:"small",modelValue:$.is_required,"onUpdate:modelValue":D=>$.is_required=D},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(O,{label:h.$t("common.operation"),align:"left",width:"90"},{default:j(({row:$,$index:D})=>[ee("span",Nre,[k(S,{effect:"dark",content:h.$t("common.modify"),placement:"top"},{default:j(()=>[k(E,{type:"primary",text:"",onClick:An(P=>a($,D),["stop"])},{default:j(()=>[k(b,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(S,{effect:"dark",content:h.$t("common.delete"),placement:"top"},{default:j(()=>[k(E,{type:"primary",text:"",onClick:P=>s(D)},{default:j(()=>[k(b,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(Ore,{ref_key:"ApiFieldFormDialogRef",ref:r,onRefresh:l},null,512)],64)}}}),Pre={class:"dialog-footer"},Rre=_r({__name:"UserFieldFormDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(),l=(S,M)=>S.every(T=>d9.get(M,T,void 0)!==void 0),f=hr(()=>{if(s.value){const S=s.value;switch(S.type){case"input":return l(["field","input_type","label","required","attrs"],s.value)?s.value:{attrs:S.attrs||{maxlength:200,minlength:0},field:S.field||S.variable,input_type:"TextInput",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required};case"select":return l(["field","input_type","label","required","option_list"],s.value)?s.value:{attrs:S.attrs||{},field:S.field||S.variable,input_type:"SingleSelect",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required,option_list:S.option_list?S.option_list:S.optionList.map(M=>({key:M,value:M}))};case"date":return l(["field","input_type","label","required","attrs.format","attrs.value-format","attrs.type"],s.value)?s.value:{field:S.field||S.variable,input_type:"DatePicker",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required,attrs:{format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",type:"datetime"}};default:return s.value}}else return{input_type:"TextInput",required:!1,attrs:{maxlength:200,minlength:0},show_default_value:!0}}),h=He(null),v=He([{label:Pt("dynamicsForm.input_type_list.TextInput"),value:"TextInputConstructor"},{label:Pt("dynamicsForm.input_type_list.PasswordInput"),value:"PasswordInputConstructor"},{label:Pt("dynamicsForm.input_type_list.SingleSelect"),value:"SingleSelectConstructor"},{label:Pt("dynamicsForm.input_type_list.MultiSelect"),value:"MultiSelectConstructor"},{label:Pt("dynamicsForm.input_type_list.RadioCard"),value:"RadioCardConstructor"},{label:Pt("dynamicsForm.input_type_list.DatePicker"),value:"DatePickerConstructor"},{label:Pt("dynamicsForm.input_type_list.SwitchInput"),value:"SwitchInputConstructor"}]),b=He(!1),E=(S,M)=>{b.value=!0,S?(a.value=!0,s.value=Me.cloneDeep(S),h.value=M):s.value=null},O=()=>{b.value=!1,a.value=!1,h.value=null,s.value=null},w=async()=>{const S=r.value;S&&await S.validate().then(()=>{o("refresh",S==null?void 0:S.getData(),h.value),a.value=!1,s.value=null,h.value=null})};return t({open:E,close:O}),(S,M)=>{const T=ne("el-button"),$=ne("el-dialog");return Ne(),bt($,{title:a.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:b.value,"onUpdate:modelValue":M[2]||(M[2]=D=>b.value=D),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":O,"append-to-body":""},{footer:j(()=>[ee("span",Pre,[k(T,{onClick:An(O,["prevent"])},{default:j(()=>[ft(_e(S.$t("common.cancel")),1)]),_:1}),k(T,{type:"primary",onClick:M[1]||(M[1]=D=>w()),loading:i.value},{default:j(()=>[ft(_e(a.value?S.$t("common.save"):S.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(I2,{modelValue:f.value,"onUpdate:modelValue":M[0]||(M[0]=D=>f.value=D),"label-position":"top","require-asterisk-position":"right",input_type_list:v.value,ref_key:"DynamicsFormConstructorRef",ref:r},null,8,["modelValue","input_type_list"])]),_:1},8,["title","modelValue"])}}}),Dre={class:"dialog-footer"},jre=_r({__name:"UserInputTitleDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He({title:Pt("chat.userInput")}),s=Rh({title:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}]}),l=He(!1),f=b=>{b&&(a.value=Me.cloneDeep(b)),l.value=!0},h=()=>{l.value=!1},v=async b=>{b&&await b.validate(E=>{E&&o("refresh",a.value)})};return t({open:f,close:h}),(b,E)=>{const O=ne("el-input"),w=ne("el-form-item"),S=ne("el-form"),M=ne("el-button"),T=ne("el-dialog");return Ne(),bt(T,{title:b.$t("common.setting"),modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=$=>l.value=$),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",Dre,[k(M,{onClick:E[3]||(E[3]=An($=>l.value=!1,["prevent"]))},{default:j(()=>[ft(_e(b.$t("common.cancel")),1)]),_:1}),k(M,{type:"primary",onClick:E[4]||(E[4]=$=>v(r.value)),loading:i.value},{default:j(()=>[ft(_e(b.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(S,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:s,model:a.value,"require-asterisk-position":"right",onSubmit:E[2]||(E[2]=An(()=>{},["prevent"]))},{default:j(()=>[k(w,{label:b.$t("common.title"),prop:"title"},{default:j(()=>[k(O,{modelValue:a.value.title,"onUpdate:modelValue":E[0]||(E[0]=$=>a.value.title=$),maxlength:"64","show-word-limit":"",onBlur:E[1]||(E[1]=$=>a.value.title=a.value.title.trim())},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),Lre={class:"flex-between mb-16"},Ire=["title"],Fre={class:"ml-4"},Bre=["title"],$re={key:0},Ure=["title"],Vre={key:1},Gre=["title"],Wre=["title"],zre={class:"mr-4"},Hre=_r({__name:"UserInputFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(),r=He(),i=He([]),a=He({title:Pt("chat.userInput")});function s(O,w){o.value.open(O,w)}function l(){r.value.open(a.value)}function f(O){i.value.splice(O,1),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),E()}function h(O,w){for(let M=0;M<i.value.length;M++)if(i.value[M].field===O.field&&w!==M){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}const S=t.nodeModel.properties.api_input_field_list;for(let M=0;M<S.length;M++)if(S[M].variable===O.field){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}w!==null?i.value.splice(w,1,O):i.value.push(O),o.value.close(),t.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),E()}function v(O){a.value=O,r.value.close()}const b=O=>{var w;if(O.input_type==="PasswordInput")return"******";if(O.default_value){const S=(w=O.option_list)==null?void 0:w.filter(M=>O.default_value.indexOf(M.value)>-1).map(M=>M.label).join(",");return S||O.default_value}if(O.default_value!==void 0)return O.default_value};function E(){if(!n.value)return;const w=n.value.$el.querySelector(".el-table__body-wrapper tbody");w&&Zr.create(w,{animation:150,ghostClass:"ghost-row",onEnd:S=>{if(S.oldIndex===void 0||S.newIndex===void 0)return;const M=Me.cloneDeep([...i.value]),[T]=M.splice(S.oldIndex,1);M.splice(S.newIndex,0,T),i.value=M,t.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return bo(()=>{t.nodeModel.properties.user_input_field_list?i.value.push(...t.nodeModel.properties.user_input_field_list):t.nodeModel.properties.input_field_list&&t.nodeModel.properties.input_field_list.filter(O=>O.assignment_method==="user_input").forEach(O=>{i.value.push(O)}),i.value.forEach((O,w)=>{switch(O.label=O.label||O.name,O.field=O.field||O.variable,O.required=O.required||O.is_required,O.type){case"input":O.input_type="TextInput";break;case"select":O.input_type="SingleSelect";break;case"date":O.input_type="DatePicker";break}}),Me.set(t.nodeModel.properties,"user_input_field_list",i),t.nodeModel.properties.user_input_config&&(a.value=t.nodeModel.properties.user_input_config),Me.set(t.nodeModel.properties,"user_input_config",a),E()}),(O,w)=>{var F;const S=ne("AppIcon"),M=ne("el-button"),T=ne("el-table-column"),$=ne("el-tag"),D=ne("el-switch"),P=ne("el-tooltip"),B=ne("el-table");return Ne(),mn(Ir,null,[ee("div",Lre,[ee("h5",{class:"break-all ellipsis lighter",style:{"max-width":"80%"},title:a.value.title},_e(a.value.title),9,Ire),ee("div",null,[k(M,{type:"primary",link:"",onClick:l},{default:j(()=>[k(S,{iconName:"app-setting"})]),_:1}),ee("span",Fre,[k(M,{link:"",type:"primary",onClick:w[0]||(w[0]=I=>s())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})])])]),((F=t.nodeModel.properties.user_input_field_list)==null?void 0:F.length)>0?(Ne(),bt(B,{key:0,data:t.nodeModel.properties.user_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(T,{prop:"field",label:O.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:I})=>[ee("span",{title:I.field,class:"ellipsis-1"},_e(I.field),9,Bre)]),_:1},8,["label"]),k(T,{prop:"label",label:O.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:I})=>[I.label&&I.label.input_type==="TooltipLabel"?(Ne(),mn("span",$re,[ee("span",{title:I.label.label,class:"ellipsis-1"},_e(I.label.label),9,Ure)])):(Ne(),mn("span",Vre,[ee("span",{title:I.label,class:"ellipsis-1"},_e(I.label),9,Gre)]))]),_:1},8,["label"]),k(T,{label:O.$t("dynamicsForm.paramForm.input_type.label"),width:"95"},{default:j(({row:I})=>[I.input_type==="TextInput"?(Ne(),bt($,{key:0,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.TextInput")),1)]),_:1})):Bn("",!0),I.input_type==="PasswordInput"?(Ne(),bt($,{key:1,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.PasswordInput")),1)]),_:1})):Bn("",!0),I.input_type==="Slider"?(Ne(),bt($,{key:2,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.Slider")),1)]),_:1})):Bn("",!0),I.input_type==="SwitchInput"?(Ne(),bt($,{key:3,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SwitchInput")),1)]),_:1})):Bn("",!0),I.input_type==="SingleSelect"?(Ne(),bt($,{key:4,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SingleSelect")),1)]),_:1})):Bn("",!0),I.input_type==="MultiSelect"?(Ne(),bt($,{key:5,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.MultiSelect")),1)]),_:1})):Bn("",!0),I.input_type==="RadioCard"?(Ne(),bt($,{key:6,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.RadioCard")),1)]),_:1})):Bn("",!0),I.input_type==="DatePicker"?(Ne(),bt($,{key:7,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.DatePicker")),1)]),_:1})):Bn("",!0)]),_:1},8,["label"]),k(T,{prop:"default_value",label:O.$t("dynamicsForm.default.label")},{default:j(({row:I})=>[ee("span",{title:I.default_value,class:"ellipsis-1"},_e(b(I)),9,Wre)]),_:1},8,["label"]),k(T,{label:O.$t("common.required")},{default:j(({row:I})=>[ee("div",{onClick:w[1]||(w[1]=An(()=>{},["stop"]))},[k(D,{disabled:"",size:"small",modelValue:I.required,"onUpdate:modelValue":V=>I.required=V},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(T,{label:O.$t("common.operation"),align:"left",width:"90"},{default:j(({row:I,$index:V})=>[ee("span",zre,[k(P,{effect:"dark",content:O.$t("common.modify"),placement:"top"},{default:j(()=>[k(M,{type:"primary",text:"",onClick:An(z=>s(I,V),["stop"])},{default:j(()=>[k(S,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(P,{effect:"dark",content:O.$t("common.delete"),placement:"top"},{default:j(()=>[k(M,{type:"primary",text:"",onClick:z=>f(V)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(Rre,{ref_key:"UserFieldFormDialogRef",ref:o,onRefresh:h},null,512),k(jre,{ref_key:"UserInputTitleDialogRef",ref:r,onRefresh:v},null,512)],64)}}}),Xre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.8146C19.9934%202%2020.1647%202.07183%2020.29%202.19934L26.4756%208.49255C26.5982%208.61722%2026.6668%208.78505%2026.6668%208.95987V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%233370FF'/%3e%3cpath%20d='M20%202.02637C20.1089%202.05793%2020.2089%202.11704%2020.2899%202.19936L26.4755%208.49256C26.5261%208.54408%2026.5675%208.60297%2026.5987%208.66668H21.5135C20.6776%208.66668%2020%207.98906%2020%207.15317V2.02637Z'%20fill='%232B5FD9'/%3e%3cpath%20d='M10.7636%2013.5757H20.8727C20.9932%2013.5757%2021.0909%2013.6734%2021.0909%2013.7939V14.8121C21.0909%2014.9326%2020.9932%2015.0303%2020.8727%2015.0303H10.7636C10.6431%2015.0303%2010.5454%2014.9326%2010.5454%2014.8121V13.7939C10.5454%2013.6734%2010.6431%2013.5757%2010.7636%2013.5757ZM10.7636%2017.9394H20.8727C20.9932%2017.9394%2021.0909%2018.0371%2021.0909%2018.1576V19.1757C21.0909%2019.2962%2020.9932%2019.3939%2020.8727%2019.3939H10.7636C10.6431%2019.3939%2010.5454%2019.2962%2010.5454%2019.1757V18.1576C10.5454%2018.0371%2010.6431%2017.9394%2010.7636%2017.9394ZM10.7636%2022.303H16.1454C16.2659%2022.303%2016.3636%2022.4007%2016.3636%2022.5212V23.5394C16.3636%2023.6599%2016.2659%2023.7576%2016.1454%2023.7576H10.7636C10.6431%2023.7576%2010.5454%2023.6599%2010.5454%2023.5394V22.5212C10.5454%2022.4007%2010.6431%2022.303%2010.7636%2022.303Z'%20fill='white'/%3e%3c/svg%3e",Yre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.724C19.9008%202%2020.0704%202.07024%2020.1954%202.19526L26.4716%208.47141C26.5966%208.59643%2026.6668%208.766%2026.6668%208.94281V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%2314C0FF'/%3e%3cpath%20d='M20%202.05988C20.072%202.09264%2020.1383%202.13825%2020.1953%202.19526L26.4714%208.4714C26.5284%208.52841%2026.574%208.59467%2026.6068%208.66666H21.3333C20.597%208.66666%2020%208.06971%2020%207.33333V2.05988Z'%20fill='%2311A3D9'/%3e%3cpath%20d='M11.3335%2016C12.4381%2016%2013.3335%2015.1046%2013.3335%2014C13.3335%2012.8954%2012.4381%2012%2011.3335%2012C10.2289%2012%209.3335%2012.8954%209.3335%2014C9.3335%2015.1046%2010.2289%2016%2011.3335%2016Z'%20fill='white'/%3e%3cpath%20d='M22.2785%2014.9317C22.4218%2014.7884%2022.6668%2014.8899%2022.6668%2015.0925V24.0645C22.6668%2024.1901%2022.565%2024.2919%2022.4394%2024.2919H13.4674L13.4587%2024.2918H9.56142C9.35877%2024.2918%209.25728%2024.0468%209.40058%2023.9035L14.366%2018.938C14.4549%2018.8492%2014.5989%2018.8492%2014.6877%2018.938L16.48%2020.7302L22.2785%2014.9317Z'%20fill='white'/%3e%3c/svg%3e",qre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.724C19.9008%202%2020.0704%202.07024%2020.1954%202.19526L26.4716%208.47141C26.5966%208.59643%2026.6668%208.766%2026.6668%208.94281V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%233370FF'/%3e%3cpath%20d='M20%202.05994C20.072%202.0927%2020.1383%202.13831%2020.1953%202.19532L26.4714%208.47146C26.5284%208.52847%2026.574%208.59473%2026.6068%208.66672H21.3333C20.597%208.66672%2020%208.06977%2020%207.33339V2.05994Z'%20fill='%232B5FD9'/%3e%3cpath%20d='M19.976%2012.8794C20.254%2012.9447%2020.4595%2013.1796%2020.4872%2013.4638L20.6106%2014.7297C20.6546%2015.1805%2020.2459%2015.5429%2019.8037%2015.4455L16.7344%2014.7691C16.5577%2014.7302%2016.3944%2014.8747%2016.4116%2015.0548L17.1297%2022.5884C17.1297%2022.7046%2017.1151%2022.7812%2017.0891%2022.8249C17.0254%2024.3752%2015.7484%2025.6124%2014.1825%2025.6124C12.5759%2025.6124%2011.2734%2024.31%2011.2734%2022.7033C11.2734%2021.0967%2012.5759%2019.7942%2014.1825%2019.7942C14.8467%2019.7942%2015.4589%2020.0168%2015.9485%2020.3914L15.274%2012.6749C15.2345%2012.2228%2015.6485%2011.8642%2016.0904%2011.9678L19.976%2012.8794Z'%20fill='white'/%3e%3c/svg%3e",Kre="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202.5C4%201.94772%204.44772%201.5%205%201.5H14.7929C14.9255%201.5%2015.0527%201.55268%2015.1464%201.64645L19.8536%206.35355C19.9473%206.44732%2020%206.5745%2020%206.70711V21.5C20%2022.0523%2019.5523%2022.5%2019%2022.5H5C4.44772%2022.5%204%2022.0523%204%2021.5V2.5Z'%20fill='%2334C724'/%3e%3cpath%20d='M15%201.54492C15.054%201.56949%2015.1037%201.6037%2015.1464%201.64646L19.8536%206.35357C19.8963%206.39632%2019.9305%206.44602%2019.9551%206.50001H16C15.4477%206.50001%2015%206.0523%2015%205.50001V1.54492Z'%20fill='%232CA91F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%2011.5C7.5%2011.2239%207.72386%2011%208%2011H13.3971C13.6733%2011%2013.8971%2011.2239%2013.8971%2011.5V12.1723L15.8207%2011.4333C15.9744%2011.3742%2016.1474%2011.3946%2016.2831%2011.4879C16.4189%2011.5812%2016.5%2011.7353%2016.5%2011.9V16.3C16.5%2016.4647%2016.4189%2016.6188%2016.2831%2016.7121C16.1474%2016.8054%2015.9744%2016.8258%2015.8207%2016.7667L13.8971%2016.0277V16.7C13.8971%2016.9761%2013.6733%2017.2%2013.3971%2017.2H8C7.72386%2017.2%207.5%2016.9761%207.5%2016.7V11.5ZM9.25%2013.5C9.66421%2013.5%2010%2013.1642%2010%2012.75C10%2012.3358%209.66421%2012%209.25%2012C8.83579%2012%208.5%2012.3358%208.5%2012.75C8.5%2013.1642%208.83579%2013.5%209.25%2013.5Z'%20fill='white'/%3e%3c/svg%3e",Zre="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202.5C4%201.94772%204.44772%201.5%205%201.5H14.7929C14.9255%201.5%2015.0527%201.55268%2015.1464%201.64645L19.8536%206.35355C19.9473%206.44732%2020%206.5745%2020%206.70711V21.5C20%2022.0523%2019.5523%2022.5%2019%2022.5H5C4.44772%2022.5%204%2022.0523%204%2021.5V2.5Z'%20fill='%238F959E'/%3e%3cpath%20d='M15%201.54492C15.054%201.56949%2015.1037%201.6037%2015.1464%201.64646L19.8536%206.35357C19.8963%206.39632%2019.9305%206.44602%2019.9551%206.50001H16C15.4477%206.50001%2015%206.0523%2015%205.50001V1.54492Z'%20fill='%23646A73'/%3e%3cpath%20d='M14.288%209.86441C13.7422%209.34739%2013.026%209.09082%2012.1353%209.09082C11.1347%209.09082%2010.3505%209.41162%209.78235%2010.065C9.30108%2010.6265%209.04179%2011.1646%209.00471%2012.013C9.00384%2012.033%209.00309%2012.0697%209.00247%2012.1122C9.00043%2012.2508%209.11287%2012.3635%209.25147%2012.3635H9.84253C9.98%2012.3635%2010.0914%2012.2525%2010.0936%2012.1151C10.0943%2012.0737%2010.0951%2012.038%2010.0961%2012.0189C10.1251%2011.4328%2010.278%2011.1262%2010.5508%2010.7851C10.8953%2010.3259%2011.4006%2010.0999%2012.0943%2010.0999C12.7134%2010.0999%2013.1776%2010.2578%2013.4979%2010.5782C13.8033%2010.8963%2013.9625%2011.3294%2013.9625%2011.8726C13.9625%2012.2435%2013.8281%2012.5967%2013.5549%2012.948C13.4678%2013.0568%2013.3425%2013.1862%2012.9388%2013.5899C12.3012%2014.1474%2011.9073%2014.601%2011.6993%2015.0468C11.5282%2015.3888%2011.441%2015.7775%2011.441%2016.1954V16.4772C11.441%2016.6153%2011.5529%2016.7272%2011.691%2016.7272H12.2956C12.4336%2016.7272%2012.5456%2016.6153%2012.5456%2016.4772V16.1954C12.5456%2015.8413%2012.6327%2015.5237%2012.8133%2015.2141C12.9486%2014.9841%2013.1223%2014.8038%2013.4251%2014.5389C14.0321%2013.9897%2014.3689%2013.6625%2014.5198%2013.4705C14.8821%2012.9923%2015.0671%2012.4446%2015.0671%2011.8454C15.0671%2011.0185%2014.8075%2010.355%2014.288%209.86441ZM11.7046%2017.8181C11.5666%2017.8181%2011.4546%2017.93%2011.4546%2018.0681V18.659C11.4546%2018.7971%2011.5666%2018.909%2011.7046%2018.909H12.2956C12.4336%2018.909%2012.5456%2018.7971%2012.5456%2018.659V18.0681C12.5456%2017.93%2012.4336%2017.8181%2012.2956%2017.8181H11.7046Z'%20fill='white'/%3e%3c/svg%3e",Jre={class:"p-8"},Qre={class:"flex-between"},eoe={class:"flex align-center"},toe={class:"line-height-22 mt-4"},noe={class:"flex-between"},roe={class:"flex align-center"},ooe={class:"line-height-22 mt-4"},ioe={class:"flex-between"},aoe={class:"flex align-center"},loe={class:"line-height-22 mt-4"},soe={class:"flex-between"},uoe={class:"flex align-center"},coe={class:"line-height-22 mt-4"},doe={class:"flex-between"},foe={class:"flex align-center"},poe={class:"line-height-22 mt-4"},hoe={class:"dialog-footer"},voe=_r({__name:"FileUploadSettingDialog",props:{nodeModel:{}},emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=e,i=He(!1),a=He(!1),s=He(""),l=He(!1),f=He(),h=He(),v=["TXT","MD","DOCX","HTML","CSV","XLSX","XLS","PDF"],b=["JPG","JPEG","PNG","GIF"],E=["MP3","WAV","OGG","ACC","M4A"],O=["MP4","AVI","MKV","MOV","FLV","WMV"],w=He({maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["PPT","DOC"]});function S(B){i.value=!0,xh(()=>{w.value={...w.value,...B}})}function M(){i.value=!1}const T=B=>{w.value.otherExtensions=w.value.otherExtensions.filter(F=>F!==B)},$=()=>{a.value=!0,xh(()=>{h.value.input.focus()})},D=()=>{if(s.value){if(s.value=s.value.toUpperCase(),w.value.otherExtensions.includes(s.value)||v.includes(s.value)||b.includes(s.value)||E.includes(s.value)){a.value=!1,s.value="",p9(Pt("common.fileUpload.existingExtensionsTip"));return}w.value.otherExtensions.push(s.value)}a.value=!1,s.value=""};async function P(){const B=f.value;B&&await B.validate().then(()=>{const F=Me.cloneDeep(w.value);o("refresh",F),r.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig"),i.value=!1})}return t({open:S}),(B,F)=>{const I=ne("el-slider"),V=ne("el-form-item"),z=ne("el-text"),q=ne("el-checkbox"),X=ne("el-card"),G=ne("el-tag"),Q=ne("el-input"),J=ne("el-button"),ie=ne("el-space"),Se=ne("el-form"),Ae=ne("el-scrollbar"),Pe=ne("el-dialog");return Ne(),bt(Pe,{title:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.title"),modelValue:i.value,"onUpdate:modelValue":F[19]||(F[19]=De=>i.value=De),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":M,"append-to-body":"",width:"800","align-center":"",class:"scrollbar-dialog"},{footer:j(()=>[ee("span",hoe,[k(J,{onClick:An(M,["prevent"])},{default:j(()=>[ft(_e(B.$t("common.cancel")),1)]),_:1}),k(J,{type:"primary",onClick:F[18]||(F[18]=De=>P()),loading:l.value},{default:j(()=>[ft(_e(B.$t("common.confirm")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(Ae,{"max-height":"550"},{default:j(()=>[ee("div",Jre,[k(Se,{"label-position":"top",ref_key:"fieldFormRef",ref:f,model:w.value,"require-asterisk-position":"right"},{default:j(()=>[k(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles")},{default:j(()=>[k(I,{modelValue:w.value.maxFiles,"onUpdate:modelValue":F[0]||(F[0]=De=>w.value.maxFiles=De),"show-input":"","show-input-controls":!1,min:1,max:100},null,8,["modelValue"])]),_:1},8,["label"]),k(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit")},{default:j(()=>[k(I,{modelValue:w.value.fileLimit,"onUpdate:modelValue":F[1]||(F[1]=De=>w.value.fileLimit=De),"show-input":"","show-input-controls":!1,min:1,max:1e3},null,8,["modelValue"])]),_:1},8,["label"]),k(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label")},{default:j(()=>[k(X,{shadow:"hover",class:Ws(["card-checkbox cursor w-full mb-8",w.value.document?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[4]||(F[4]=An(De=>w.value.document=!w.value.document,["stop"]))},{default:j(()=>[ee("div",Qre,[ee("div",eoe,[F[20]||(F[20]=ee("img",{class:"mr-12",src:Xre,alt:""},null,-1)),ee("div",null,[ee("p",toe,[ft(_e(B.$t("common.fileUpload.document"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText")),1)]),_:1})]),ee("p",null,_e(v.join("、")),1)])]),k(q,{modelValue:w.value.document,"onUpdate:modelValue":F[2]||(F[2]=De=>w.value.document=De),onChange:F[3]||(F[3]=De=>w.value.document=!w.value.document)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Ws(["card-checkbox cursor w-full mb-8",w.value.image?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[7]||(F[7]=An(De=>w.value.image=!w.value.image,["stop"]))},{default:j(()=>[ee("div",noe,[ee("div",roe,[F[21]||(F[21]=ee("img",{class:"mr-12",src:Yre,alt:""},null,-1)),ee("div",null,[ee("p",ooe,[ft(_e(B.$t("common.fileUpload.image"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText")),1)]),_:1})]),ee("p",null,_e(b.join("、")),1)])]),k(q,{modelValue:w.value.image,"onUpdate:modelValue":F[5]||(F[5]=De=>w.value.image=De),onChange:F[6]||(F[6]=De=>w.value.image=!w.value.image)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Ws(["card-checkbox cursor w-full mb-8",w.value.audio?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[10]||(F[10]=An(De=>w.value.audio=!w.value.audio,["stop"]))},{default:j(()=>[ee("div",ioe,[ee("div",aoe,[F[22]||(F[22]=ee("img",{class:"mr-12",src:qre,alt:""},null,-1)),ee("div",null,[ee("p",loe,[ft(_e(B.$t("common.fileUpload.audio"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText")),1)]),_:1})]),ee("p",null,_e(E.join("、")),1)])]),k(q,{modelValue:w.value.audio,"onUpdate:modelValue":F[8]||(F[8]=De=>w.value.audio=De),onChange:F[9]||(F[9]=De=>w.value.audio=!w.value.audio)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Ws(["card-checkbox cursor w-full mb-8",w.value.video?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[13]||(F[13]=An(De=>w.value.video=!w.value.video,["stop"]))},{default:j(()=>[ee("div",soe,[ee("div",uoe,[F[23]||(F[23]=ee("img",{class:"mr-12",width:"32",src:Kre,alt:""},null,-1)),ee("div",null,[ee("p",coe,[ft(_e(B.$t("common.fileUpload.video"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText")),1)]),_:1})]),ee("p",null,_e(O.join("、")),1)])]),k(q,{modelValue:w.value.video,"onUpdate:modelValue":F[11]||(F[11]=De=>w.value.video=De),onChange:F[12]||(F[12]=De=>w.value.video=!w.value.video)},null,8,["modelValue"])])]),_:1},8,["class"]),k(X,{shadow:"hover",class:Ws(["card-checkbox cursor w-full mb-8",w.value.other?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[17]||(F[17]=An(De=>w.value.other=!w.value.other,["stop"]))},{default:j(()=>[ee("div",doe,[ee("div",foe,[F[24]||(F[24]=ee("img",{class:"mr-12",width:32,src:Zre,alt:""},null,-1)),ee("div",null,[ee("p",poe,[ft(_e(B.$t("common.fileUpload.other"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText")),1)]),_:1})]),k(ie,{wrap:"",size:2,class:"mt-4"},{default:j(()=>[(Ne(!0),mn(Ir,null,No(w.value.otherExtensions,De=>(Ne(),bt(G,{key:De,closable:"","disable-transitions":!1,onClose:ze=>T(De),type:"info",class:"mr-4",effect:"plain",style:{"--el-tag-border-radius":"4px","--el-tag-border-color":"var(--el-border-color)"}},{default:j(()=>[ft(_e(De),1)]),_:2},1032,["onClose"]))),128)),a.value?(Ne(),bt(Q,{key:0,ref_key:"InputRef",ref:h,modelValue:s.value,"onUpdate:modelValue":F[14]||(F[14]=De=>s.value=De),size:"small",onKeyup:f9(D,["enter"]),onBlur:D},null,8,["modelValue"])):(Ne(),bt(J,{key:1,class:"button-new-tag",size:"small",onClick:An($,["stop"])},{default:j(()=>[ft(" + "+_e(B.$t("common.fileUpload.addExtensions")),1)]),_:1}))]),_:1})])]),k(q,{modelValue:w.value.other,"onUpdate:modelValue":F[15]||(F[15]=De=>w.value.other=De),onChange:F[16]||(F[16]=De=>w.value.other=!w.value.other)},null,8,["modelValue"])])]),_:1},8,["class"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1})]),_:1},8,["title","modelValue"])}}}),moe={class:"dialog-footer"},goe=_r({__name:"ChatFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return t({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",moe,[k($,{onClick:An(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),yoe={class:"flex-between mb-16"},_oe={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},boe={class:"ml-4"},woe=["title"],Eoe=["title"],xoe={class:"mr-4"},Ooe=_r({__name:"ChatFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1),t.nodeModel.graphModel.eventCenter.emit("chatFieldList")}function s(l,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===l.field&&f!==h){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close(),t.nodeModel.graphModel.eventCenter.emit("chatFieldList")}return bo(()=>{t.nodeModel.properties.chat_input_field_list&&(r.value=Me.cloneDeep(t.nodeModel.properties.chat_input_field_list)),Me.set(t.nodeModel.properties,"chat_input_field_list",r)}),(l,f)=>{var w;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",yoe,[ee("h5",_oe,_e(l.$t("views.applicationWorkflow.variable.chat")),1),ee("div",null,[ee("span",boe,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(l.$t("common.add")),1)]),_:1})])])]),((w=t.nodeModel.properties.chat_input_field_list)==null?void 0:w.length)>0?(Ne(),bt(O,{key:0,data:t.nodeModel.properties.chat_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(b,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,woe)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",null,[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,Eoe)])]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",xoe,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:An(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(goe,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),Soe={class:"flex-between"},Aoe={class:"flex align-center"},Moe={class:"mr-4"},Toe={class:"flex-between"},Coe={class:"mr-4"},Noe={class:"flex"},koe={class:"flex-between"},Poe={class:"mr-4"},Roe={class:"flex"},Doe={class:"w-full"},joe={class:"flex-between w-full"},Loe=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(null),l=He(),f=He(),h=He(),v=He(),b={name:"",desc:"",prologue:Pt("views.application.form.defaultPrologue")},E=G=>G.ctrlKey===!0?(G.preventDefault(),!0):(G.stopPropagation(),!0);function O(G){Me.set(i.nodeModel.properties.node_data,"prologue",G)}const w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:G=>{Me.set(i.nodeModel.properties,"node_data",G)}}),S=He(),M=()=>{var G;return w.value.tts_model_enable&&!w.value.tts_model_id&&w.value.tts_type==="TTS"?Promise.reject({node:i.nodeModel,errMessage:Pt("views.application.form.voicePlay.requiredMessage")}):w.value.stt_model_enable&&!w.value.stt_model_id?Promise.reject({node:i.nodeModel,errMessage:Pt("views.application.form.voiceInput.requiredMessage")}):(G=S.value)==null?void 0:G.validate().catch(Q=>Promise.reject({node:i.nodeModel,errMessage:Q}))},T=t();function $(){var Q;const G=r.value==="systemManage"?{model_type:"STT",workspace_id:(Q=T.value)==null?void 0:Q.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList(G).then(J=>{a.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function D(){var Q;const G=r.value==="systemManage"?{model_type:"TTS",workspace_id:(Q=T.value)==null?void 0:Q.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(G).then(J=>{s.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function P(){xh(()=>{var G;w.value.tts_model_id?(G=l.value)==null||G.reset_default(w.value.tts_model_id,o):V({})})}function B(){w.value.tts_model_enable||(w.value.tts_model_id="",w.value.tts_type="BROWSER")}function F(){w.value.stt_model_enable||(w.value.stt_model_id="")}const I=()=>{var Q;const G=w.value.tts_model_id;if(!G){Oh(Pt("views.application.form.voicePlay.requiredMessage"));return}(Q=l.value)==null||Q.open(G,o,w.value.tts_model_params_setting)},V=G=>{w.value.tts_model_params_setting=G},z=()=>{const G={maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["ppt","doc"]};w.value.file_upload_enable&&(w.value.file_upload_setting=w.value.file_upload_setting||G),i.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig")},q=()=>{var G;(G=v.value)==null||G.open(w.value.file_upload_setting)},X=G=>{w.value.file_upload_setting=G};return bo(()=>{Me.set(i.nodeModel,"validate",M),i.nodeModel.properties.node_data.tts_type||Me.set(i.nodeModel.properties.node_data,"tts_type","BROWSER"),D(),$()}),(G,Q)=>{const J=ne("el-input"),ie=ne("el-form-item"),Se=ne("MdEditorMagnify"),Ae=ne("AppIcon"),Pe=ne("el-tooltip"),De=ne("el-button"),ze=ne("el-switch"),Ye=ne("el-checkbox"),Be=ne("ModelSelect"),Je=ne("el-radio"),gt=ne("el-radio-group"),le=ne("Operation"),Ze=ne("el-icon"),pe=ne("el-form");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(pe,{onSubmit:Q[13]||(Q[13]=An(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right",class:"mb-24","label-width":"auto",ref_key:"baseNodeFormRef",ref:S},{default:j(()=>[k(ie,{label:G.$t("views.applicationWorkflow.nodes.baseNode.appName.label"),prop:"name",rules:{message:Gn(Pt)("views.application.form.appName.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(J,{modelValue:w.value.name,"onUpdate:modelValue":Q[0]||(Q[0]=se=>w.value.name=se),maxlength:"64",placeholder:Gn(Pt)("views.application.form.appName.placeholder"),"show-word-limit":"",onBlur:Q[1]||(Q[1]=se=>{var we;return w.value.name=(we=w.value.name)==null?void 0:we.trim()})},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(ie,{label:G.$t("views.applicationWorkflow.nodes.baseNode.appDescription.label")},{default:j(()=>[k(J,{modelValue:w.value.desc,"onUpdate:modelValue":Q[2]||(Q[2]=se=>w.value.desc=se),placeholder:G.$t("views.application.form.appDescription.placeholder"),rows:3,type:"textarea",maxlength:"256","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(ie,{label:G.$t("views.application.form.prologue")},{default:j(()=>[k(Se,{onWheel:E,title:G.$t("views.application.form.prologue"),modelValue:w.value.prologue,"onUpdate:modelValue":Q[3]||(Q[3]=se=>w.value.prologue=se),style:{height:"150px"},onSubmitDialog:O},null,8,["title","modelValue"])]),_:1},8,["label"]),k(ie,null,{label:j(()=>[ee("div",Soe,[ee("div",Aoe,[ee("span",Moe,_e(G.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.label")),1),k(Pe,{effect:"dark",content:G.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.tooltip"),placement:"right"},{default:j(()=>[k(Ae,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])]),ee("div",null,[w.value.file_upload_enable?(Ne(),bt(De,{key:0,type:"primary",link:"",onClick:q,class:"mr-4"},{default:j(()=>[k(Ae,{iconName:"app-setting",class:"mr-4"})]),_:1})):Bn("",!0),k(ze,{size:"small",modelValue:w.value.file_upload_enable,"onUpdate:modelValue":Q[4]||(Q[4]=se=>w.value.file_upload_enable=se),onChange:z},null,8,["modelValue"])])])]),_:1}),k(Hre,{ref_key:"UserInputFieldTableFef",ref:f,"node-model":e.nodeModel},null,8,["node-model"]),k(kre,{ref_key:"ApiInputFieldTableFef",ref:h,"node-model":e.nodeModel},null,8,["node-model"]),k(Ooe,{ref:"ChatFieldTeble","node-model":e.nodeModel},null,8,["node-model"]),k(ie,null,{label:j(()=>[ee("div",Toe,[ee("span",Coe,_e(G.$t("views.application.form.voiceInput.label")),1),ee("div",Noe,[w.value.stt_model_enable?(Ne(),bt(Ye,{key:0,modelValue:w.value.stt_autosend,"onUpdate:modelValue":Q[5]||(Q[5]=se=>w.value.stt_autosend=se)},{default:j(()=>[ft(_e(G.$t("views.application.form.voiceInput.autoSend")),1)]),_:1},8,["modelValue"])):Bn("",!0),k(ze,{class:"ml-8",size:"small",modelValue:w.value.stt_model_enable,"onUpdate:modelValue":Q[6]||(Q[6]=se=>w.value.stt_model_enable=se),onChange:F},null,8,["modelValue"])])])]),default:j(()=>[Ql(k(Be,{onWheel:E,modelValue:w.value.stt_model_id,"onUpdate:modelValue":Q[7]||(Q[7]=se=>w.value.stt_model_id=se),placeholder:G.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"]),[[Eh,w.value.stt_model_enable]])]),_:1}),k(ie,null,{label:j(()=>[ee("div",koe,[ee("span",Poe,_e(G.$t("views.application.form.voicePlay.label")),1),ee("div",Roe,[w.value.tts_model_enable?(Ne(),bt(Ye,{key:0,modelValue:w.value.tts_autoplay,"onUpdate:modelValue":Q[8]||(Q[8]=se=>w.value.tts_autoplay=se)},{default:j(()=>[ft(_e(G.$t("views.application.form.voicePlay.autoPlay")),1)]),_:1},8,["modelValue"])):Bn("",!0),k(ze,{class:"ml-8",size:"small",modelValue:w.value.tts_model_enable,"onUpdate:modelValue":Q[9]||(Q[9]=se=>w.value.tts_model_enable=se),onChange:B},null,8,["modelValue"])])])]),default:j(()=>[ee("div",Doe,[Ql(k(gt,{modelValue:w.value.tts_type,"onUpdate:modelValue":Q[10]||(Q[10]=se=>w.value.tts_type=se)},{default:j(()=>[k(Je,{label:G.$t("views.application.form.voicePlay.browser"),value:"BROWSER"},null,8,["label"]),k(Je,{label:G.$t("views.application.form.voicePlay.tts"),value:"TTS"},null,8,["label"])]),_:1},8,["modelValue"]),[[Eh,w.value.tts_model_enable]])]),ee("div",joe,[w.value.tts_type==="TTS"&&w.value.tts_model_enable?(Ne(),bt(Be,{key:0,onWheel:E,modelValue:w.value.tts_model_id,"onUpdate:modelValue":Q[11]||(Q[11]=se=>w.value.tts_model_id=se),placeholder:G.$t("views.application.form.voicePlay.placeholder"),options:s.value,onChange:Q[12]||(Q[12]=se=>P()),showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])):Bn("",!0),w.value.tts_type==="TTS"&&w.value.tts_model_enable?(Ne(),bt(De,{key:1,onClick:I,disabled:!w.value.tts_model_id,class:"ml-8"},{default:j(()=>[k(Ze,null,{default:j(()=>[k(Ze,null,{default:j(()=>[k(le)]),_:1})]),_:1})]),_:1},8,["disabled"])):Bn("",!0)])]),_:1})]),_:1},8,["model"]),k(Fj,{ref_key:"TTSModeParamSettingDialogRef",ref:l,onRefresh:V},null,512),k(voe,{ref_key:"FileUploadSettingDialogRef",ref:v,"node-model":e.nodeModel,onRefresh:X},null,8,["node-model"])]),_:1},8,["nodeModel"])}}}),Ioe=Ph(Loe,[["__scopeId","data-v-940d4dcd"]]);class Foe extends ai{constructor(t){super(t,Ioe)}}class Boe extends li{constructor(t,n){super(t,n)}get_width(){return 600}}const $oe={type:"base-node",model:Boe,view:Foe},_8=Object.freeze(Object.defineProperty({__proto__:null,default:$oe},Symbol.toStringTag,{value:"Module"})),Uoe={class:"handle flex-between lighter"},Voe={class:"flex align-center"},Goe={key:0,class:"info"},Woe={key:0,class:"mt-8"},zoe=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={branch:[{conditions:[{field:[],compare:"",value:""}],id:yu(),type:"IF",condition:"and"},{conditions:[],id:yu(),type:"ELSE",condition:"and"}]},o=w=>w.ctrlKey===!0?(w.preventDefault(),!0):(w.stopPropagation(),!0),r=(w,S,M)=>{const $=Me.cloneDeep(t.nodeModel.properties.branch_condition_list?t.nodeModel.properties.branch_condition_list:[]).map(D=>D.id===S.id?{...D,height:w.height,index:M}:D);Me.set(t.nodeModel.properties,"branch_condition_list",$),v(t.nodeModel.properties.node_data.branch,!0)},i=hr({get:()=>(t.nodeModel.properties.node_data||(Me.set(t.nodeModel.properties,"node_data",n),v(n.branch,!0)),t.nodeModel.properties.node_data),set:w=>{Me.set(t.nodeModel.properties,"node_data",w)}}),a=He(),s=He(),l=()=>{var S;const w=[(S=a.value)==null?void 0:S.validate(),...s.value.map(M=>M.validate())];return Promise.all(w).catch(M=>Promise.reject({node:t.nodeModel,errMessage:M}))};function f(w){const{oldIndex:S,newIndex:M}=w;if(S===void 0||M===void 0)return;const T=Me.cloneDeep(t.nodeModel.properties.node_data.branch);if(S===T.length-1||M===T.length-1)return;const $={...T[S],type:T[M].type,id:T[M].id},D={...T[M],type:T[S].type,id:T[S].id};T[M]=$,T[S]=D,Me.set(t.nodeModel.properties.node_data,"branch",T)}function h(){const w=Me.cloneDeep(t.nodeModel.properties.node_data.branch),S={conditions:[{field:[],compare:"",value:""}],type:"ELSE IF "+(w.length-1),id:yu(),condition:"and"};w.splice(w.length-1,0,S),v(w,!0),Me.set(t.nodeModel.properties.node_data,"branch",w)}function v(w,S){const M=Me.cloneDeep(t.nodeModel.properties.branch_condition_list?t.nodeModel.properties.branch_condition_list:[]),T=w.map(($,D)=>{const P=M.find(B=>B.id===$.id);if(P)return{index:D,height:P.height,id:$.id};if(S)return{index:D,height:12,id:$.id}}).filter($=>$);Me.set(t.nodeModel.properties,"branch_condition_list",T),t.nodeModel.refreshBranch()}function b(w){const S=Me.cloneDeep(t.nodeModel.properties.node_data.branch);S[w].conditions.push({field:[],compare:"",value:""}),Me.set(t.nodeModel.properties.node_data,"branch",S)}function E(w,S){const M=Me.cloneDeep(t.nodeModel.properties.node_data.branch);if(M[w].conditions.splice(S,1),M[w].conditions.length===0){const $=M.splice(w,1).map(D=>t.nodeModel.id+"_"+D.id+"_right");t.nodeModel.graphModel.eventCenter.emit("delete_edge",t.nodeModel.outgoing.edges.filter(D=>$.includes(D.sourceAnchorId)).map(D=>D.id)),v(M,!1),M.forEach((D,P)=>{D.type==="ELSE IF "+(P+1)&&(D.type="ELSE IF "+P)})}Me.set(t.nodeModel.properties.node_data,"branch",M)}function O(w,S,M){if(["is_null","is_not_null","is_true","is_not_true"].includes(w)){const T=Me.cloneDeep(t.nodeModel.properties.node_data.branch);T[S].conditions[M].value=1,Me.set(t.nodeModel.properties.node_data,"branch",T)}}return bo(()=>{Me.set(t.nodeModel,"validate",l)}),(w,S)=>{const M=ne("el-option"),T=ne("el-select"),$=ne("el-form-item"),D=ne("el-col"),P=ne("el-input"),B=ne("AppIcon"),F=ne("el-button"),I=ne("el-row"),V=ne("el-card"),z=ne("el-form"),q=Rg("resize");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(z,{model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ConditionNodeFormRef",ref:a,onSubmit:S[0]||(S[0]=An(()=>{},["prevent"]))},{default:j(()=>[k(Gn(Xj),{ref:"el",modelValue:i.value.branch,disabled:i.value.branch.length===2,handle:".handle",animation:150,ghostClass:"ghost",onEnd:f},{default:j(()=>[(Ne(!0),mn(Ir,null,No(i.value.branch,(X,G)=>Ql((Ne(),bt(V,{key:X.id,shadow:"never",class:Ws(["drag-card card-never mb-8",{"no-drag":G===i.value.branch.length-1||i.value.branch.length===2}]),style:{"--el-card-padding":"12px"}},{default:j(()=>[ee("div",Uoe,[ee("span",Voe,[S[1]||(S[1]=ee("img",{src:Yj,alt:"",height:"15",class:"handle-img mr-4"},null,-1)),ft(" "+_e(X.type),1)]),X.conditions.length>1?(Ne(),mn("div",Goe,[ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(T,{teleported:!1,modelValue:X.condition,"onUpdate:modelValue":Q=>X.condition=Q,size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(M,{label:w.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(M,{label:w.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"]),ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),G!==i.value.branch.length-1?(Ne(),mn("div",Woe,[(Ne(!0),mn(Ir,null,No(X.conditions,(Q,J)=>(Ne(),bt(I,{key:J,gutter:8},{default:j(()=>[k(D,{span:11},{default:j(()=>[k($,{prop:"branch."+G+".conditions."+J+".field",rules:{type:"array",required:!0,message:w.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Wo,{ref_for:!0,ref_key:"nodeCascaderRef",ref:s,nodeModel:e.nodeModel,class:"w-full",placeholder:w.$t("views.applicationWorkflow.variable.placeholder"),modelValue:Q.field,"onUpdate:modelValue":ie=>Q.field=ie},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(D,{span:6},{default:j(()=>[k($,{prop:"branch."+G+".conditions."+J+".compare",rules:{required:!0,message:w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(T,{onWheel:o,teleported:!1,modelValue:Q.compare,"onUpdate:modelValue":ie=>Q.compare=ie,placeholder:w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:"",onChange:ie=>O(ie,G,J)},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Gn($2),(ie,Se)=>(Ne(),bt(M,{key:Se,label:ie.label,value:ie.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(D,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(Q.compare)?Bn("",!0):(Ne(),bt($,{key:0,prop:"branch."+G+".conditions."+J+".value",rules:{required:!0,message:w.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(P,{modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:w.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(D,{span:1},{default:j(()=>[k(F,{disabled:i.value.branch.length===2&&X.conditions.length===1,link:"",type:"info",class:"mt-4",onClick:ie=>E(G,J)},{default:j(()=>[k(B,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024))),128))])):Bn("",!0),G!==i.value.branch.length-1?(Ne(),bt(F,{key:1,link:"",type:"primary",onClick:Q=>b(G)},{default:j(()=>[k(B,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1},8,["onClick"])):Bn("",!0)]),_:2},1032,["class"])),[[q,Q=>r(Q,X,G)]])),128))]),_:1},8,["modelValue","disabled"]),k(F,{link:"",type:"primary",onClick:h},{default:j(()=>[k(B,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("views.applicationWorkflow.nodes.conditionNode.addBranch")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Hoe extends ai{constructor(t){super(t,zoe)}}const Xoe=(e,t)=>e.filter((n,o)=>o<t).map(n=>n.height+8).reduce((n,o)=>n+o,0);class Yoe extends li{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:o,width:r,height:i,properties:{branch_condition_list:a}}=this;this.height===void 0&&(this.height=200);const s=this.properties.showNode===void 0?!0:this.properties.showNode,l=[];l.push({x:n-r/2+10,y:s?o:o-15,id:`${t}_left`,edgeAddable:!1,type:"left"});const f=Array.isArray(a)?a:[];if(f.length>0)for(let h=0;h<f.length;h++){const v=f[h],b=Xoe(f,h);l.push({x:n+r/2-10,y:s?o-i/2+75+b+(v.height||0)/2:o-15,id:`${t}_${v.id}_right`,type:"right"})}return l}}const qoe={type:"condition-node",model:Yoe,view:Hoe},b8=Object.freeze(Object.defineProperty({__proto__:null,default:qoe},Symbol.toStringTag,{value:"Module"})),Koe={class:"title-decoration-1 mb-8"},Zoe=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={document_list:["start-node","document"]},o=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:r=>{Me.set(t.nodeModel.properties,"node_data",r)}});return(r,i)=>{const a=ne("el-form-item"),s=ne("el-form"),l=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",Koe,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),k(l,{shadow:"never",class:"card-never"},{default:j(()=>[k(s,{onSubmit:i[1]||(i[1]=An(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto"},{default:j(()=>[k(a,{label:r.$t("views.problem.relateParagraph.selectDocument"),rules:{type:"array",required:!0,message:r.$t("views.chatLog.documentPlaceholder"),trigger:"change"}},{default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:r.$t("views.chatLog.documentPlaceholder"),modelValue:o.value.document_list,"onUpdate:modelValue":i[0]||(i[0]=f=>o.value.document_list=f)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});let Joe=class extends ai{constructor(t){super(t,Zoe)}};const Qoe={type:"document-extract-node",model:li,view:Joe},w8=Object.freeze(Object.defineProperty({__proto__:null,default:Qoe},Symbol.toStringTag,{value:"Module"})),eie={class:"dialog-footer"},tie=_r({__name:"AddFormCollect",props:{title:{default:Pt("common.param.addParam")},addFormField:{}},emits:["submit"],setup(e,{expose:t,emit:n}){const o=e,r=He(!1),i=He(),a=He({}),s=He(!1),l=()=>{r.value=!0},f=()=>{r.value=!1,a.value={}},h=()=>{var v;(v=i.value)==null||v.validate().then(()=>{var b;o.addFormField((b=i.value)==null?void 0:b.getData()),f()})};return t({close:f,open:l}),(v,b)=>{const E=ne("el-button"),O=ne("el-dialog");return Ne(),bt(O,{title:e.title,modelValue:r.value,"onUpdate:modelValue":b[3]||(b[3]=w=>r.value=w),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":f,"append-to-body":""},{footer:j(()=>[ee("span",eie,[k(E,{onClick:b[1]||(b[1]=An(w=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),k(E,{type:"primary",onClick:b[2]||(b[2]=w=>h()),loading:s.value},{default:j(()=>[ft(_e(v.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[b[4]||(b[4]=ft("l ",-1)),k(I2,{modelValue:a.value,"onUpdate:modelValue":b[0]||(b[0]=w=>a.value=w),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),nie={class:"dialog-footer"},rie=_r({__name:"EditFormCollect",props:{title:{default:Pt("common.param.editParam")},editFormField:{}},emits:["submit"],setup(e,{expose:t,emit:n}){const o=e,r=He(!1),i=He(),a=He({}),s=He(0),l=He(!1),f=(b,E)=>{r.value=!0,a.value=b,s.value=E},h=()=>{r.value=!1,a.value={}},v=()=>{var b;(b=i.value)==null||b.validate().then(()=>{var E;o.editFormField((E=i.value)==null?void 0:E.getData(),s.value),h()})};return t({close:h,open:f}),(b,E)=>{const O=ne("el-button"),w=ne("el-dialog");return Ne(),bt(w,{title:e.title,modelValue:r.value,"onUpdate:modelValue":E[3]||(E[3]=S=>r.value=S),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",nie,[k(O,{onClick:E[1]||(E[1]=An(S=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(b.$t("common.cancel")),1)]),_:1}),k(O,{type:"primary",onClick:E[2]||(E[2]=S=>v()),loading:l.value},{default:j(()=>[ft(_e(b.$t("common.modify")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(I2,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=S=>a.value=S),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),oie={class:"title-decoration-1 mb-8"},iie={class:"flex align-center"},aie={class:"mr-4"},lie={class:"flex-between"},sie={class:"lighter"},uie=["title"],cie={key:0},die=["title"],fie={key:1},pie=["title"],hie=["title"],vie={class:"mr-4"},mie=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e;O_("getModel",()=>t.nodeModel);const n=He(),o=He(),r=(T,$)=>{const D=E.value.form_field_list.map((P,B)=>$===B?Me.cloneDeep(T):Me.cloneDeep(P));E.value.form_field_list=D,a()},i=T=>{if(E.value.form_field_list.some($=>$.field===T.field)){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+T.field);return}E.value.form_field_list=Me.cloneDeep([...E.value.form_field_list,T]),a()},a=()=>{const T=[{label:Pt("views.applicationWorkflow.nodes.formNode.formAllContent"),value:"form_data"},...E.value.form_field_list.map($=>({value:$.field,label:typeof $.label=="string"?$.label:$.label.label}))];Me.set(t.nodeModel.properties.config,"fields",T),t.nodeModel.clear_next_node_field(!1),M()},s=He(),l=He(),f=()=>{var T;(T=s.value)==null||T.open()},h=(T,$)=>{var D;(D=l.value)==null||D.open(Me.cloneDeep(T),$)},v=T=>{E.value.form_field_list=E.value.form_field_list.filter($=>$.field!==T.field),a()},b=He({is_result:!0,form_content_format:`${Pt("views.applicationWorkflow.nodes.formNode.form_content_format1")}
|
||
{{form}}
|
||
${Pt("views.applicationWorkflow.nodes.formNode.form_content_format2")}`,form_field_list:[]}),E=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",b.value),t.nodeModel.properties.node_data),set:T=>{Me.set(t.nodeModel.properties,"node_data",T)}}),O=T=>{var $;if(T.default_value){const D=($=T.option_list)==null?void 0:$.filter(P=>T.default_value.indexOf(P.value)>-1).map(P=>P.label).join(",");return D||T.default_value}if(T.default_value!==void 0)return T.default_value},w=()=>{var T;return(T=n.value)==null?void 0:T.validate()};function S(T){Me.set(t.nodeModel.properties.node_data,"form_content_format",T)}function M(){if(!o.value)return;const $=o.value.$el.querySelector(".el-table__body-wrapper tbody");$&&Zr.create($,{animation:150,ghostClass:"ghost-row",onEnd:D=>{if(D.oldIndex===void 0||D.newIndex===void 0)return;const P=Me.cloneDeep([...E.value.form_field_list]),[B]=P.splice(D.oldIndex,1);P.splice(D.newIndex,0,B),E.value.form_field_list=P,a()}})}return bo(()=>{Me.set(t.nodeModel,"validate",w),a(),t.nodeModel.graphModel.eventCenter.emit("refresh_incoming_node_field")}),(T,$)=>{const D=ne("AppIcon"),P=ne("el-tooltip"),B=ne("MdEditorMagnify"),F=ne("el-form-item"),I=ne("el-button"),V=ne("el-table-column"),z=ne("el-tag"),q=ne("el-switch"),X=ne("el-table"),G=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",oie,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(G,{onSubmit:$[4]||($[4]=An(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"formNodeFormRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:T.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),prop:"form_content_format",rules:{required:!0,message:T.$t("views.applicationWorkflow.nodes.formNode.formContent.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",iie,[ee("div",aie,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.formNode.formContent.label")),1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(P,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(T.$t("views.applicationWorkflow.nodes.formNode.formContent.tooltip",{form:"{ form }"})),1)]),default:j(()=>[k(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(B,{title:T.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),modelValue:E.value.form_content_format,"onUpdate:modelValue":$[0]||($[0]=J=>E.value.form_content_format=J),style:{height:"150px"},onSubmitDialog:S},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(F,{label:T.$t("views.applicationWorkflow.nodes.formNode.formSetting"),onClick:$[3]||($[3]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",lie,[ee("h5",sie,_e(T.$t("views.applicationWorkflow.nodes.formNode.formSetting")),1),k(I,{link:"",type:"primary",onClick:$[1]||($[1]=J=>f())},{default:j(()=>[k(D,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(T.$t("common.add")),1)]),_:1})])]),default:j(()=>[E.value.form_field_list.length>0?(Ne(),bt(X,{key:0,class:"border",data:E.value.form_field_list,ref_key:"tableRef",ref:o,"row-key":"field"},{default:j(()=>[k(V,{prop:"field",label:T.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:J})=>[ee("span",{title:J.field,class:"ellipsis-1"},_e(J.field),9,uie)]),_:1},8,["label"]),k(V,{prop:"label",label:T.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:J})=>[J.label&&J.label.input_type==="TooltipLabel"?(Ne(),mn("span",cie,[ee("span",{title:J.label.label,class:"ellipsis-1"},_e(J.label.label),9,die)])):(Ne(),mn("span",fie,[ee("span",{title:J.label,class:"ellipsis-1"},_e(J.label),9,pie)]))]),_:1},8,["label"]),k(V,{label:T.$t("dynamicsForm.paramForm.input_type.label"),width:"110px"},{default:j(({row:J})=>[k(z,{type:"info",class:"info-tag"},{default:j(()=>{var ie;return[ft(_e((ie=Gn(h9).find(Se=>Se.value===J.input_type))==null?void 0:ie.label),1)]}),_:2},1024)]),_:1},8,["label"]),k(V,{prop:"default_value",label:T.$t("dynamicsForm.default.label")},{default:j(({row:J})=>[ee("span",{title:J.default_value,class:"ellipsis-1"},_e(O(J)),9,hie)]),_:1},8,["label"]),k(V,{label:T.$t("common.required"),width:"55"},{default:j(({row:J})=>[ee("div",{onClick:$[2]||($[2]=An(()=>{},["stop"]))},[k(q,{disabled:"",size:"small",modelValue:J.required,"onUpdate:modelValue":ie=>J.required=ie},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(V,{label:T.$t("common.operation"),align:"left",width:"80"},{default:j(({row:J,$index:ie})=>[ee("span",vie,[k(P,{effect:"dark",content:T.$t("common.modify"),placement:"top"},{default:j(()=>[k(I,{type:"primary",text:"",onClick:An(Se=>h(J,ie),["stop"])},{default:j(()=>[k(D,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(P,{effect:"dark",content:T.$t("common.delete"),placement:"top"},{default:j(()=>[k(I,{type:"primary",text:"",onClick:Se=>v(J)},{default:j(()=>[k(D,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(tie,{ref_key:"addFormCollectRef",ref:s,addFormField:i},null,512),k(rie,{ref_key:"editFormCollectRef",ref:l,editFormField:r},null,512)]),_:1},8,["nodeModel"])}}});class gie extends ai{constructor(t){super(t,mie)}getConfig(t){return t.model.properties.config}}const yie={type:"form-node",model:li,view:gie},E8=Object.freeze(Object.defineProperty({__proto__:null,default:yie},Symbol.toStringTag,{value:"Module"})),_ie={class:"title-decoration-1 mb-8"},bie={class:"flex-between w-full"},wie={class:"flex align-center"},Eie={class:"mr-4"},xie={class:"flex align-center"},Oie={class:"mr-4"},Sie={class:"flex align-center"},Aie={class:"mr-4"},Mie=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(),l=He(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,image_list:["start-node","image"]},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=t();function w(){var B;const P=r.value==="systemManage"?{model_type:"TTI",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTI"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var B;P&&((B=s.value)==null||B.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function $(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function D(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return bo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),q=ne("el-tooltip"),X=ne("MdEditorMagnify"),G=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",_ie,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:B[6]||(B[6]=An(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",bie,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label")),1),B[7]||(B[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{disabled:!E.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:S,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>E.value.model_id=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),options:a.value,showFooter:"",onFocus:w,"model-type":"TTI"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",wie,[ee("div",Eie,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",xie,[ee("div",Oie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[5]||(B[5]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Sie,[ee("div",Aie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(G,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[4]||(B[4]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});let Tie=class extends ai{constructor(t){super(t,Mie)}};const Cie={type:"image-generate-node",model:li,view:Tie},x8=Object.freeze(Object.defineProperty({__proto__:null,default:Cie},Symbol.toStringTag,{value:"Module"})),Nie={class:"title-decoration-1 mb-8"},kie={class:"flex-between w-full"},Pie={class:"flex align-center"},Rie={class:"mr-4"},Die={class:"flex align-center"},jie={class:"mr-4"},Lie={class:"flex align-center"},Iie={class:"mr-4"},Fie=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(),l=He(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,first_frame_url:["start-node","image"],last_frame_url:[]},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=t();function w(){var B;const P=r.value==="systemManage"?{model_type:"ITV",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"ITV"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var B;P&&((B=s.value)==null||B.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function $(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function D(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return bo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),q=ne("el-tooltip"),X=ne("MdEditorMagnify"),G=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",Nie,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:B[8]||(B[8]=An(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",kie,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label")),1),B[9]||(B[9]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{disabled:!E.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:S,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>E.value.model_id=ie),onFocus:w,placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"ITV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Pie,[ee("div",Rie,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label")),1),B[10]||(B[10]=ee("span",{class:"color-danger"},"*",-1))])]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Die,[ee("div",jie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label"),rules:{type:"array",required:!0,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label")),1),B[11]||(B[11]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),modelValue:E.value.first_frame_url,"onUpdate:modelValue":B[4]||(B[4]=ie=>E.value.first_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label"),rules:{type:"array",required:!1,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label")),1)]),default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),clearable:"",modelValue:E.value.last_frame_url,"onUpdate:modelValue":B[5]||(B[5]=ie=>E.value.last_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[7]||(B[7]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Lie,[ee("div",Iie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(G,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[6]||(B[6]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});class Bie extends ai{constructor(t){super(t,Fie)}}const $ie={type:"image-to-video-node",model:li,view:Bie},O8=Object.freeze(Object.defineProperty({__proto__:null,default:$ie},Symbol.toStringTag,{value:"Module"})),Uie={class:"title-decoration-1 mb-8"},Vie={class:"flex-between w-full"},Gie={class:"flex-between"},Wie={class:"flex align-center"},zie={class:"flex align-center"},Hie={class:"mr-4"},Xie={class:"flex-between"},Yie={class:"flex align-center"},qie={class:"mr-4"},Kie=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(),l=He(),f=He(),h=()=>{var I;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(I=l.value)==null?void 0:I.validate()]).catch(V=>Promise.reject({node:i.nodeModel,errMessage:V}))},v=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),E={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,image_list:["start-node","image"]},O=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",E),i.nodeModel.properties.node_data),set:I=>{Me.set(i.nodeModel.properties,"node_data",I)}}),w=t();function S(){var V;const I=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=w.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(I).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(I){Me.set(i.nodeModel.properties.node_data,"system",I)}function T(I){Me.set(i.nodeModel.properties.node_data,"prompt",I)}const $=I=>{var V;I&&((V=s.value)==null||V.open(I,o,O.value.model_params_setting))};function D(I){Me.set(i.nodeModel.properties.node_data,"model_params_setting",I)}const P=He(),B=I=>{var V;I&&((V=P.value)==null||V.open(I,o))},F=I=>{Me.set(i.nodeModel.properties.node_data,"system",I)};return bo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(I,V)=>{const z=ne("AppIcon"),q=ne("el-button"),X=ne("ModelSelect"),G=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("MdEditorMagnify"),ie=ne("el-option"),Se=ne("el-select"),Ae=ne("el-input-number"),Pe=ne("el-switch"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",Uie,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),k(ze,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:V[10]||(V[10]=An(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(G,{label:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Vie,[ee("div",null,[ee("span",null,[ft(_e(Gn(Pt)("views.applicationWorkflow.nodes.imageUnderstandNode.model.label")),1),V[11]||(V[11]=ee("span",{class:"color-danger"},"*",-1))])]),k(q,{disabled:!O.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=Ye=>$(O.value.model_id)),onRefreshForm:D},{default:j(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(X,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=Ye=>O.value.model_id=Ye),placeholder:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(G,null,{label:j(()=>[ee("div",Gie,[ee("div",Wie,[ee("span",null,_e(I.$t("views.application.form.roleSettings.label")),1),k(Q,{effect:"dark",content:I.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(q,{type:"primary",link:"",onClick:V[2]||(V[2]=Ye=>B(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(J,{title:I.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":V[3]||(V[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Gn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Gn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(G,{label:I.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:I.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",zie,[ee("div",Hie,[ee("span",null,[ft(_e(I.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=ee("span",{class:"color-danger"},"*",-1))])]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(J,{onWheel:v,title:I.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:T,placeholder:`${Gn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Gn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(G,null,{label:j(()=>[ee("div",Xie,[ee("div",null,_e(I.$t("views.application.form.historyRecord.label")),1),k(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[k(ie,{label:I.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(ie,{label:I.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[6]=Ye=>O.value.dialogue_number=Ye),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(G,{label:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label")),1),V[13]||(V[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:f,nodeModel:e.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:O.value.image_list,"onUpdate:modelValue":V[7]||(V[7]=Ye=>O.value.image_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(G,{label:I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:V[9]||(V[9]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Yie,[ee("div",qie,[ee("span",null,_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Pe,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:D},null,512),k(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:P},null,512)]),_:1},8,["node-model"])}}});let Zie=class extends ai{constructor(t){super(t,Kie)}};const Jie={type:"image-understand-node",model:li,view:Zie},S8=Object.freeze(Object.defineProperty({__proto__:null,default:Jie},Symbol.toStringTag,{value:"Module"})),Qie={class:"title-decoration-1 mb-8"},eae={class:"flex-between"},tae={class:"flex-between"},nae={class:"flex-between"},rae=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=He(),a=He();function s(){const B=Me.cloneDeep(S.nodeModel.properties.node_data.branch),F={id:yu(),content:"",isOther:!1};B.splice(B.length-1,0,F),f(B,!0),Me.set(S.nodeModel.properties.node_data,"branch",B),S.nodeModel.refreshBranch()}function l(B){var G;const F=Me.cloneDeep(S.nodeModel.properties.node_data.branch),I=F.find(Q=>Q.id===B);if(!I||I.isOther||F.filter(Q=>!Q.isOther).length<=1)return;const z=`${S.nodeModel.id}_${B}_right`,q=(((G=S.nodeModel.outgoing)==null?void 0:G.edges)||[]).filter(Q=>Q.sourceAnchorId===z).map(Q=>Q.id);q.length>0&&S.nodeModel.graphModel.eventCenter.emit("delete_edge",q);const X=F.filter(Q=>Q.id!==B);Me.set(S.nodeModel.properties.node_data,"branch",X),f(X,!1)}function f(B,F){const I=Me.cloneDeep(S.nodeModel.properties.branch_condition_list?S.nodeModel.properties.branch_condition_list:[]),V=B.map((z,q)=>{const X=I.find(G=>G.id===z.id);if(X)return{index:q,height:X.height,id:z.id};if(F)return{index:q,height:12,id:z.id}}).filter(z=>z);Me.set(S.nodeModel.properties,"branch_condition_list",V),S.nodeModel.refreshBranch()}const h=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),v=B=>{var F;B?(F=a.value)==null||F.reset_default(B,o):E({})},b={model_id:"",branch:[{id:yu(),content:"",isOther:!1},{id:yu(),content:Pt("views.applicationWorkflow.nodes.intentNode.other"),isOther:!0}],dialogue_number:1,content_list:[]};function E(B){Me.set(S.nodeModel.properties.node_data,"model_params_setting",B)}const O=B=>{var F;B&&((F=a.value)==null||F.open(B,o,w.value.model_params_setting))},w=hr({get:()=>(S.nodeModel.properties.node_data||(Me.set(S.nodeModel.properties,"node_data",b),f(b.branch,!0)),S.nodeModel.properties.node_data),set:B=>{Me.set(S.nodeModel.properties,"node_data",B)}}),S=e,M=He(),T=He(null),$=()=>{var B;return Promise.all([i.value?i.value.validate():Promise.resolve(""),(B=M.value)==null?void 0:B.validate()]).then(()=>{if(w.value.branch.length!=new Set(w.value.branch.map(F=>F.content)).size)throw Pt("views.applicationWorkflow.nodes.intentNode.error2")}).catch(F=>Promise.reject({node:S.nodeModel,errMessage:F}))},D=t();function P(){var F;const B=r.value==="systemManage"?{model_type:"LLM",workspace_id:(F=D.value)==null?void 0:F.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(B).then(I=>{T.value=Me.groupBy(I==null?void 0:I.data,"provider")})}return bo(()=>{var B;P(),typeof((B=S.nodeModel.properties.node_data)==null?void 0:B.is_result)>"u"&&Qd(S.nodeModel)&&Me.set(S.nodeModel.properties.node_data,"is_result",!0),Me.set(S.nodeModel,"validate",$)}),(B,F)=>{const I=ne("AppIcon"),V=ne("el-button"),z=ne("ModelSelect"),q=ne("el-form-item"),X=ne("el-input-number"),G=ne("el-input"),Q=ne("el-col"),J=ne("el-row"),ie=ne("el-form"),Se=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",Qie,_e(B.$t("views.applicationWorkflow.nodeSetting")),1),k(Se,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(ie,{onSubmit:F[4]||(F[4]=An(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"IntentClassifyNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[k(q,{label:B.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:B.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",eae,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.application.form.aiModel.label")),1),F[5]||(F[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(V,{type:"primary",link:"",disabled:!w.value.model_id,onClick:F[0]||(F[0]=Ae=>O(w.value.model_id)),onRefreshForm:E},{default:j(()=>[k(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(z,{onChange:v,onWheel:h,teleported:!1,modelValue:w.value.model_id,"onUpdate:modelValue":F[1]||(F[1]=Ae=>w.value.model_id=Ae),placeholder:B.$t("views.application.form.aiModel.placeholder"),options:T.value,onSubmitModel:P,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(q,{prop:"content_list",label:B.$t("views.applicationWorkflow.nodes.intentNode.input.label"),rules:{message:B.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",tae,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.intentNode.input.label")),1),F[6]||(F[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:i,nodeModel:e.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:w.value.content_list,"onUpdate:modelValue":F[2]||(F[2]=Ae=>w.value.content_list=Ae)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(q,{label:B.$t("views.application.form.historyRecord.label")},{default:j(()=>[k(X,{modelValue:w.value.dialogue_number,"onUpdate:modelValue":F[3]||(F[3]=Ae=>w.value.dialogue_number=Ae),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(q,null,{label:j(()=>[ee("div",nae,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.intentNode.classify.label")),1),F[7]||(F[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(V,{onClick:s,type:"primary",size:"large",link:""},{default:j(()=>[k(I,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[ee("div",null,[(Ne(!0),mn(Ir,null,No(w.value.branch,(Ae,Pe)=>(Ne(),mn("div",{key:Ae.id,class:"mb-8"},[k(q,{prop:`branch.${Pe}.content`,rules:{message:B.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder"),trigger:"change",required:!0}},{default:j(()=>[k(J,{gutter:12,align:"middle"},{default:j(()=>[k(Q,{span:21},{default:j(()=>[k(G,{modelValue:Ae.content,"onUpdate:modelValue":De=>Ae.content=De,style:{width:"210px"},disabled:Ae.isOther,placeholder:B.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])]),_:2},1024),k(Q,{span:3},{default:j(()=>[Ae.isOther?Bn("",!0):(Ne(),bt(V,{key:0,link:"",size:"large",disabled:w.value.branch.filter(De=>!De.isOther).length<=1,onClick:De=>l(Ae.id)},{default:j(()=>[k(I,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"]))]),_:2},1024)]),_:2},1024)]),_:2},1032,["prop","rules"])]))),128))])]),_:1})]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:a,onRefresh:E},null,512)]),_:1},8,["nodeModel"])}}});class oae extends ai{constructor(t){super(t,rae)}}class iae extends li{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:o,width:r,height:i,properties:{branch_condition_list:a}}=this;this.height===void 0&&(this.height=200);const s=this.properties.showNode===void 0?!0:this.properties.showNode,l=[];l.push({x:n-r/2+10,y:s?o:o-15,id:`${t}_left`,edgeAddable:!1,type:"left"});const f=Array.isArray(a)?a:[];if(f.length>0)for(let v=0;v<f.length;v++){const b=f[v];l.push({x:n+r/2-10,y:s?o-i/2+397+v*41.36:o-15,id:`${t}_${b.id}_right`,type:"right"}),console.log(o-i/2+397+100/2)}return l}}const aae={type:"intent-node",model:iae,view:oae},A8=Object.freeze(Object.defineProperty({__proto__:null,default:aae},Symbol.toStringTag,{value:"Module"})),lae={class:"handle flex-between lighter mb-8"},sae={key:0,class:"info"},uae=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={condition_list:[],condition:"and"},o=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),r=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:f=>{Me.set(t.nodeModel.properties,"node_data",f)}}),i=()=>{var h;const f=Me.cloneDeep(((h=r.value)==null?void 0:h.condition_list)||[]);f.push({field:[],compare:"",value:""}),Me.set(t.nodeModel.properties.node_data,"condition_list",f)},a=f=>{var v;const h=Me.cloneDeep(((v=r.value)==null?void 0:v.condition_list)||[]);h.splice(f,1),Me.set(t.nodeModel.properties.node_data,"condition_list",h)},s=He(),l=()=>{var h;const f=[(h=s.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:t.nodeModel,errMessage:v}))};return bo(()=>{Me.set(t.nodeModel,"validate",l)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),E=ne("el-form-item"),O=ne("el-col"),w=ne("el-input"),S=ne("AppIcon"),M=ne("el-button"),T=ne("el-row"),$=ne("el-form"),D=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k($,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:s,onSubmit:h[1]||(h[1]=An(()=>{},["prevent"]))},{default:j(()=>[ee("div",lae,[r.value.condition_list.length>1?(Ne(),mn("div",sae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(b,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=P=>r.value.condition=P),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(v,{label:f.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),(Ne(!0),mn(Ir,null,No(r.value.condition_list,(P,B)=>(Ne(),bt(T,{key:B,gutter:8},{default:j(()=>[k(O,{span:11},{default:j(()=>[k(E,{prop:"condition_list."+B+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Wo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:P.field,"onUpdate:modelValue":F=>P.field=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[k(E,{prop:"condition_list."+B+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(b,{onWheel:o,teleported:!1,modelValue:P.compare,"onUpdate:modelValue":F=>P.compare=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Gn($2),(F,I)=>(Ne(),bt(v,{key:I,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(P.compare)?Bn("",!0):(Ne(),bt(E,{key:0,prop:"condition_list."+B+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:P.value,"onUpdate:modelValue":F=>P.value=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(O,{span:1},{default:j(()=>[k(M,{link:"",type:"info",class:"mt-4",onClick:F=>a(B)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(M,{link:"",type:"primary",onClick:h[2]||(h[2]=P=>i())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class cae extends ai{constructor(t){super(t,uae)}}const dae={type:"loop-break-node",model:li,view:cae},M8=Object.freeze(Object.defineProperty({__proto__:null,default:dae},Symbol.toStringTag,{value:"Module"})),fae={class:"handle flex-between lighter mb-8"},pae={key:0,class:"info"},hae=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={condition_list:[],condition:"and"},o=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),r=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:f=>{Me.set(t.nodeModel.properties,"node_data",f)}}),i=()=>{var h;const f=Me.cloneDeep(((h=r.value)==null?void 0:h.condition_list)||[]);f.push({field:[],compare:"",value:""}),Me.set(t.nodeModel.properties.node_data,"condition_list",f)},a=f=>{var v;const h=Me.cloneDeep(((v=r.value)==null?void 0:v.condition_list)||[]);h.splice(f,1),Me.set(t.nodeModel.properties.node_data,"condition_list",h)},s=He(),l=()=>{var h;const f=[(h=s.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:t.nodeModel,errMessage:v}))};return bo(()=>{Me.set(t.nodeModel,"validate",l)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),E=ne("el-form-item"),O=ne("el-col"),w=ne("el-input"),S=ne("AppIcon"),M=ne("el-button"),T=ne("el-row"),$=ne("el-form"),D=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k($,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:s,onSubmit:h[1]||(h[1]=An(()=>{},["prevent"]))},{default:j(()=>[ee("div",fae,[r.value.condition_list.length>1?(Ne(),mn("div",pae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(b,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=P=>r.value.condition=P),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(v,{label:f.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),(Ne(!0),mn(Ir,null,No(r.value.condition_list,(P,B)=>(Ne(),bt(T,{key:B,gutter:8},{default:j(()=>[k(O,{span:11},{default:j(()=>[k(E,{prop:"condition_list."+B+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Wo,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:P.field,"onUpdate:modelValue":F=>P.field=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[k(E,{prop:"condition_list."+B+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(b,{onWheel:o,teleported:!1,modelValue:P.compare,"onUpdate:modelValue":F=>P.compare=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Gn($2),(F,I)=>(Ne(),bt(v,{key:I,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(P.compare)?Bn("",!0):(Ne(),bt(E,{key:0,prop:"condition_list."+B+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:P.value,"onUpdate:modelValue":F=>P.value=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(O,{span:1},{default:j(()=>[k(M,{link:"",type:"info",class:"mt-4",onClick:F=>a(B)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(M,{link:"",type:"primary",onClick:h[2]||(h[2]=P=>i())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class vae extends ai{constructor(t){super(t,hae)}}const mae={type:"loop-continue-node",model:li,view:vae},T8=Object.freeze(Object.defineProperty({__proto__:null,default:mae},Symbol.toStringTag,{value:"Module"})),gae=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={loop_type:"ARRAY",array:[],number:1},o=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:h=>{Me.set(t.nodeModel.properties,"node_data",h)}}),r=hr(()=>t.nodeModel.properties.showNode!==void 0?t.nodeModel.properties.showNode:(Me.set(t.nodeModel.properties,"showNode",!0),!0));K_(r,()=>{r.value?Me.throttle(f,1e3)():Me.throttle(l,1e3)()});const i=He(),a=He(),s=()=>{var h;return Promise.all([a.value?a.value.validate():Promise.resolve(""),(h=i.value)==null?void 0:h.validate()]).catch(v=>Promise.reject({node:t.nodeModel,errMessage:v}))},l=()=>{const v=t.nodeModel.graphModel.getNodeOutgoingNode(t.nodeModel.id).find(b=>b.type==c0.type);v&&(v.set_loop_body(),t.nodeModel.graphModel.deleteNode(v.id))},f=()=>{if(!t.nodeModel.graphModel.getNodeOutgoingNode(t.nodeModel.id).some(v=>v.type==c0.type)){let v={nodes:[E9],edges:[]},b=t.nodeModel.x,E=t.nodeModel.y+350;t.nodeModel.properties.node_data.loop_body&&(v=t.nodeModel.properties.node_data.loop_body),t.nodeModel.properties.node_data.loop&&(b=t.nodeModel.properties.node_data.loop.x,E=t.nodeModel.properties.node_data.loop.y);const O=t.nodeModel.graphModel.addNode({type:c0.type,properties:{...c0.properties,workflow:v,loop_node_id:t.nodeModel.id},x:b,y:E});t.nodeModel.graphModel.addEdge({type:"loop-edge",sourceNodeId:t.nodeModel.id,sourceAnchorId:t.nodeModel.id+"_children",targetNodeId:O.id,virtual:!0})}};return bo(()=>{var h;typeof((h=t.nodeModel.properties.node_data)==null?void 0:h.is_result)>"u"&&Qd(t.nodeModel)&&Me.set(t.nodeModel.properties.node_data,"is_result",!0),Me.set(t.nodeModel,"validate",s),t.nodeModel.virtual||f()}),(h,v)=>{const b=ne("el-option"),E=ne("el-select"),O=ne("el-form-item"),w=ne("el-input-number"),S=ne("el-form"),M=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(M,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(S,{onSubmit:v[6]||(v[6]=An(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:i},{default:j(()=>[k(O,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.label"),onClick:v[1]||(v[1]=An(()=>{},["prevent"])),prop:"loop_type",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.requiredMessage"),trigger:"change",required:!0}},{default:j(()=>[k(E,{modelValue:o.value.loop_type,"onUpdate:modelValue":v[0]||(v[0]=T=>o.value.loop_type=T),type:"small"},{default:j(()=>[k(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.arrayLoop"),value:"ARRAY"},null,8,["label"]),k(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.numberLoop"),value:"NUMBER"},null,8,["label"]),k(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.infiniteLoop"),value:"LOOP"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),o.value.loop_type=="ARRAY"?(Ne(),bt(O,{key:0,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.label"),onClick:v[3]||(v[3]=An(()=>{},["prevent"])),prop:"array",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:a,nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.placeholder"),modelValue:o.value.array,"onUpdate:modelValue":v[2]||(v[2]=T=>o.value.array=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):o.value.loop_type=="NUMBER"?(Ne(),bt(O,{key:1,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.label"),onClick:v[5]||(v[5]=An(()=>{},["prevent"])),prop:"number",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(w,{modelValue:o.value.number,"onUpdate:modelValue":v[4]||(v[4]=T=>o.value.number=T),min:1},null,8,["modelValue"])]),_:1},8,["label","rules"])):Bn("",!0)]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class yae extends ai{constructor(t){const n=t.model.properties.config;super(t,gae),t.model.properties.config=n}}class _ae extends li{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:o,width:r,height:i}=this,a=this.properties.showNode===void 0?!0:this.properties.showNode,s=[];return this.type&&this.type!==kr.Base.toString()&&(this.type!==kr.Start.toString()&&s.push({x:n-r/2+10,y:a?o:o-15,id:`${t}_left`,edgeAddable:!1,type:"left"}),s.push({x:n+r/2-10,y:a?o:o-15,id:`${t}_right`,type:"right"})),s.push({x:n,y:o+i/2-25,id:`${t}_children`,type:"children"}),s}}const bae={type:"loop-node",model:_ae,view:yae},C8=Object.freeze(Object.defineProperty({__proto__:null,default:bae},Symbol.toStringTag,{value:"Module"})),wae={class:"dialog-footer"},Eae=_r({__name:"LoopFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return t({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",wae,[k($,{onClick:An(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),xae={class:"flex-between mb-16"},Oae={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},Sae={class:"ml-4"},Aae=["title"],Mae=["title"],Tae={class:"mr-4"},Cae=_r({__name:"LoopFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1)}function s(l,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===l.field&&f!==h){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close()}return bo(()=>{t.nodeModel.properties.loop_input_field_list&&(r.value=Me.cloneDeep(t.nodeModel.properties.loop_input_field_list)),Me.set(t.nodeModel.properties,"loop_input_field_list",r)}),(l,f)=>{var w;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",xae,[ee("h5",Oae,_e(l.$t("views.applicationWorkflow.variable.loop")),1),ee("div",null,[ee("span",Sae,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(l.$t("common.add")),1)]),_:1})])])]),((w=t.nodeModel.properties.loop_input_field_list)==null?void 0:w.length)>0?(Ne(),bt(O,{key:0,data:t.nodeModel.properties.loop_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(b,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,Aae)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",null,[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,Mae)])]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",Tae,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:An(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(Eae,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),Nae={class:"title-decoration-1 mb-8"},kae={class:"title-decoration-1 mb-8"},Pae={class:"break-all"},Rae=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=hr(()=>(t.nodeModel.properties.loop_input_field_list?t.nodeModel.properties.loop_input_field_list:[]).map(r=>r.label&&r.label.input_type==="TooltipLabel"?{label:r.label.label,value:r.field||r.variable}:{label:r.label||r.name,value:r.field||r.variable}));K_(n,()=>{t.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))});const o=He(!1);return bo(()=>{t.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))}),(r,i)=>{const a=ne("AppIcon"),s=ne("el-button"),l=ne("el-tooltip");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>{var f;return[ee("h5",Nae,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),k(Cae,{nodeModel:e.nodeModel},null,8,["nodeModel"]),(f=n.value)!=null&&f.length?(Ne(),mn(Ir,{key:0},[ee("h5",kae,_e(r.$t("views.applicationWorkflow.variable.loop")),1),(Ne(!0),mn(Ir,null,No(n.value||[],(h,v)=>(Ne(),mn("div",{key:v,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:i[0]||(i[0]=b=>o.value=!0),onMouseleave:i[1]||(i[1]=b=>o.value=!1)},[ee("span",Pae,_e(h.label)+" "+_e("{"+h.value+"}"),1),o.value===!0?(Ne(),bt(l,{key:0,effect:"dark",content:r.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(s,{link:"",onClick:b=>Gn(x_)(`{{loop.${h.value}}}`),style:{padding:"0"}},{default:j(()=>[k(a,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128))],64)):Bn("",!0)]}),_:1},8,["nodeModel"])}}});class Dae extends ai{constructor(t){super(t,Rae)}get_node_field_list(){var n,o,r,i;const t=[];return this.props.model.type&&this.props.model.type==="loop-start-node"&&t.push({value:"loop",label:Pt("views.applicationWorkflow.variable.loop"),type:"loop",children:(Array.isArray(this.props.model.properties.loop_input_field_list)?this.props.model.properties.loop_input_field_list:[]).map(a=>a.label&&a.label.input_type==="TooltipLabel"?{label:a.label.label,value:a.field||a.variable}:{label:a.label||a.name,value:a.field||a.variable})||[]}),t.push({value:this.props.model.id,icon:(o=(n=this.props.model.properties)==null?void 0:n.node_data)==null?void 0:o.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((i=(r=this.props.model.properties)==null?void 0:r.config)==null?void 0:i.fields)||[]}),t}}const jae={type:"loop-start-node",model:li,view:Dae},N8=Object.freeze(Object.defineProperty({__proto__:null,default:jae},Symbol.toStringTag,{value:"Module"})),Lae={class:"dialog-footer"},Iae=_r({__name:"McpServerInputDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(!1),i=He(!1),a=He(),s=He({}),l=He([]);function f(v){r.value=!0,l.value=v}const h=async v=>{v&&await v.validate(b=>{b&&(o("refresh",s.value),r.value=!1)})};return t({open:f}),(v,b)=>{const E=ne("el-input"),O=ne("el-form-item"),w=ne("el-form"),S=ne("el-button"),M=ne("el-dialog");return Ne(),bt(M,{width:"600",title:"设置变量",modelValue:r.value,"onUpdate:modelValue":b[2]||(b[2]=T=>r.value=T),"close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0},{footer:j(()=>[ee("span",Lae,[k(S,{onClick:b[0]||(b[0]=An(T=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),k(S,{type:"primary",onClick:b[1]||(b[1]=T=>h(a.value)),loading:i.value},{default:j(()=>[ft(_e(v.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(w,{"label-position":"top",ref_key:"formRef",ref:a,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[(Ne(!0),mn(Ir,null,No(l.value,T=>(Ne(),bt(O,{label:T,key:T,prop:T,rules:{required:!0,message:v.$t("dynamicsForm.tip.requiredMessage"),trigger:"blur"}},{default:j(()=>[k(E,{modelValue:s.value[T],"onUpdate:modelValue":$=>s.value[T]=$},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"]))),128))]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),Fae={class:"title-decoration-1 mb-8"},Bae={class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},$ae={class:"flex-between"},Uae={class:"flex align-center"},Vae=["src"],Gae={class:"flex-between"},Wae={class:"ml-4"},zae={class:"title-decoration-1 mb-8"},Hae={key:0,class:"p-8-12"},Xae={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Yae={class:"flex-between"},qae={key:1},Kae={key:2,class:"color-danger"},Zae={key:0,class:"p-8-12"},Jae={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Qae={class:"flex-between"},ele={key:1},tle={key:2,class:"color-danger"},nle=`{
|
||
"math": {
|
||
"url": "your_server",
|
||
"transport": "sse"
|
||
}
|
||
}`,rle=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=ja(),{params:{id:o}}=n,i=ml("getApplicationDetail")(),a=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=He(),l=He(!1),f=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),h={mcp_tool:"",mcp_tools:[],mcp_servers:"",mcp_server:"",mcp_source:"referencing",mcp_tool_id:"",tool_params:{},tool_form_field:[],params_nested:""},v=He([]);function b(I){Me.set(t.nodeModel.properties.node_data,"mcp_servers",I)}async function E(){const I=await oi({type:"tool",systemType:a.value}).getToolById(D.value.mcp_tool_id,l);D.value.mcp_servers=I.data.code}function O(){if(D.value.mcp_source==="referencing"&&!D.value.mcp_tool_id){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="referencing"&&D.value.mcp_tool_id&&!v.value.find(I=>I.id===D.value.mcp_tool_id)){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="custom"&&!D.value.mcp_servers){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}try{JSON.parse(D.value.mcp_servers);const I=M(D.value.mcp_servers);if(I.length>0){S.value.open(I);return}}catch{Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}w(D.value.mcp_servers)}function w(I){oi({type:"application",systemType:a.value}).getMcpTools(o,I,l).then(V=>{var z;D.value.mcp_tools=V.data,Oh(Pt("views.applicationWorkflow.nodes.mcpNode.getToolsSuccess")),D.value.mcp_server=(z=D.value.mcp_tools.find(q=>q.name===D.value.mcp_tool))==null?void 0:z.server})}const S=He();function M(I){const V=/\{\{\s*([a-zA-Z_][\w.]*)\s*\}\}/g,z=new Set,q=X=>{if(typeof X=="string"){let G;for(;(G=V.exec(X))!==null;)z.add(G[1])}else Array.isArray(X)?X.forEach(q):X&&typeof X=="object"&&Object.values(X).forEach(q)};if(typeof I=="string")try{q(JSON.parse(I))}catch{q(I)}else q(I);return[...z]}function T(I){let V=D.value.mcp_servers;for(const z in I)V=V.replace(`{{${z}}}`,I[z]);w(V)}function $(){var V,z,q,X,G,Q;D.value.mcp_server=(V=D.value.mcp_tools.find(J=>J.name===D.value.mcp_tool))==null?void 0:V.server;const I=(z=D.value.mcp_tools.find(J=>J.name===D.value.mcp_tool))==null?void 0:z.args_schema;D.value.tool_form_field=[];for(const J in I==null?void 0:I.properties){const ie=I==null?void 0:I.properties[J].properties;if(ie){D.value.params_nested=J;for(const Se in ie){let Ae="TextInput";ie[Se].type==="string"?Ae="TextInput":ie[Se].type==="number"?Ae="NumberInput":ie[Se].type==="boolean"?Ae="SwitchInput":(ie[Se].type==="array"||ie[Se].type==="object")&&(Ae="JsonInput"),D.value.tool_form_field.push({field:Se,label:{input_type:"TooltipLabel",label:Se,attrs:{tooltip:ie[Se].description},props_info:{}},input_type:Ae,source:"referencing",required:((q=I.properties[J].required)==null?void 0:q.indexOf(Se))!==-1,props_info:{rules:[{required:((X=I.properties[J].required)==null?void 0:X.indexOf(Se))!==-1,message:Pt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}else{D.value.params_nested="";let Se="TextInput";I.properties[J].type==="string"?Se="TextInput":I.properties[J].type==="number"?Se="NumberInput":I.properties[J].type==="boolean"?Se="SwitchInput":(I.properties[J].type==="array"||I.properties[J].type==="object")&&(Se="JsonInput"),D.value.tool_form_field.push({field:J,label:{input_type:"TooltipLabel",label:J,attrs:{tooltip:I.properties[J].description},props_info:{}},input_type:Se,source:"referencing",required:((G=I.required)==null?void 0:G.indexOf(J))!==-1,props_info:{rules:[{required:((Q=I.required)==null?void 0:Q.indexOf(J))!==-1,message:Pt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}D.value.params_nested?D.value.tool_params={[D.value.params_nested]:{}}:D.value.tool_params={}}const D=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",h),t.nodeModel.properties.node_data),set:I=>{Me.set(t.nodeModel.properties,"node_data",I)}}),P=He(),B=async()=>{if(s.value){const I=D.value.tool_form_field.filter(V=>V.required).map(V=>V.label.label);if(I.length>0){for(const V of I)if(D.value.params_nested){if(!D.value.tool_params[D.value.params_nested][V])return Promise.reject({node:t.nodeModel,errMessage:V+Pt("dynamicsForm.tip.requiredMessage")})}else if(!D.value.tool_params[V])return Promise.reject({node:t.nodeModel,errMessage:V+Pt("dynamicsForm.tip.requiredMessage")})}}if(P.value){const I=Me.cloneDeep(D.value);if(!I.mcp_servers)return Promise.reject({node:t.nodeModel,errMessage:Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip")});if(!I.mcp_tool)return Promise.reject({node:t.nodeModel,errMessage:Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip")})}};function F(){var V;const I=a.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(V=i.value)==null?void 0:V.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:a.value}).getAllToolList(I,l).then(z=>{v.value=[...z.data.shared_tools,...z.data.tools].filter(q=>q.is_active)})}return bo(()=>{var I;typeof((I=t.nodeModel.properties.node_data)==null?void 0:I.is_result)>"u"&&Qd(t.nodeModel)&&Me.set(t.nodeModel.properties.node_data,"is_result",!0),t.nodeModel.properties.node_data.mcp_servers&&!t.nodeModel.properties.node_data.mcp_source&&Me.set(t.nodeModel.properties.node_data,"mcp_source","custom"),F(),Me.set(t.nodeModel,"validate",B)}),(I,V)=>{const z=ne("el-option"),q=ne("el-select"),X=ne("MdEditorMagnify"),G=ne("el-avatar"),Q=ne("ToolIcon"),J=ne("el-tag"),ie=ne("el-form-item"),Se=ne("AppIcon"),Ae=ne("el-button"),Pe=ne("el-tooltip"),De=ne("el-form"),ze=ne("el-text"),Ye=ne("el-input"),Be=ne("el-input-number"),Je=ne("el-switch"),gt=Rg("loading");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",Fae,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",Bae,[k(De,{onSubmit:V[5]||(V[5]=An(()=>{},["prevent"])),model:D.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:P,"hide-required-asterisk":""},{default:j(()=>[k(ie,{label:"MCP Server Config"},{label:j(()=>[ee("div",$ae,[V[8]||(V[8]=ee("div",null,[ft(" MCP Server Config "),ee("span",{class:"color-danger"},"*")],-1)),k(q,{teleported:!1,modelValue:D.value.mcp_source,"onUpdate:modelValue":V[0]||(V[0]=le=>D.value.mcp_source=le),size:"small",style:{width:"85px"}},{default:j(()=>[k(z,{label:I.$t("views.applicationWorkflow.nodes.mcpNode.reference"),value:"referencing"},null,8,["label"]),k(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[D.value.mcp_source==="custom"?(Ne(),bt(X,{key:0,onWheel:f,title:"MCP Server Config",modelValue:D.value.mcp_servers,"onUpdate:modelValue":V[1]||(V[1]=le=>D.value.mcp_servers=le),style:{height:"150px"},onSubmitDialog:b,placeholder:nle},null,8,["modelValue"])):(Ne(),bt(q,{key:1,modelValue:D.value.mcp_tool_id,"onUpdate:modelValue":V[2]||(V[2]=le=>D.value.mcp_tool_id=le),filterable:"",onChange:E},{default:j(()=>[(Ne(!0),mn(Ir,null,No(v.value,le=>(Ne(),bt(z,{key:le.id,label:le.name,value:le.id},{default:j(()=>[ee("div",Uae,[le!=null&&le.icon?(Ne(),bt(G,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>[ee("img",{src:Gn(mh)(le==null?void 0:le.icon),alt:""},null,8,Vae)]),_:2},1024)):(Ne(),bt(Q,{key:1,size:20,type:le==null?void 0:le.tool_type,class:"mr-8"},null,8,["type"])),ee("span",null,_e(le.name),1),le.scope==="SHARED"?(Ne(),bt(J,{key:2,type:"info",class:"info-tag ml-8"},{default:j(()=>[ft(_e(Gn(Pt)("views.shared.title")),1)]),_:1})):Bn("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))]),_:1}),k(ie,null,{label:j(()=>[ee("div",Gae,[ee("span",null,_e(I.$t("views.tool.title")),1),k(Ae,{type:"primary",link:"",onClick:V[3]||(V[3]=le=>O())},{default:j(()=>[k(Se,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(I.$t("views.applicationWorkflow.nodes.mcpNode.getTool")),1)]),_:1})])]),default:j(()=>[k(q,{modelValue:D.value.mcp_tool,"onUpdate:modelValue":V[4]||(V[4]=le=>D.value.mcp_tool=le),onChange:$,filterable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.mcp_tools,le=>(Ne(),bt(z,{key:le.value,label:le.name,value:le.name,class:"flex align-center"},{default:j(()=>[k(Pe,{effect:"dark",content:le.description,placement:"top-start","popper-class":"max-w-350"},{default:j(()=>[k(Se,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"]),ee("span",Wae,_e(le.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),ee("h5",zae,_e(I.$t("views.applicationWorkflow.nodes.mcpNode.toolParam")),1),D.value.tool_params[D.value.params_nested]?(Ne(),mn(Ir,{key:0},[D.value.mcp_tool?(Ne(),mn("div",Xae,[D.value.mcp_tool?Ql((Ne(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:s,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[6]||(V[6]=An(()=>{},["prevent"]))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.tool_form_field,le=>(Ne(),bt(ie,{key:le.field,required:le.required},{label:j(()=>[ee("div",Yae,[ee("div",null,[le.label.attrs.tooltip?(Ne(),bt($N,{key:0,label:le.label,tooltip:le.label.attrs.tooltip},null,8,["label","tooltip"])):(Ne(),mn("span",qae,_e(le.label.label),1)),le.required?(Ne(),mn("span",Kae,"*")):Bn("",!0)]),k(q,{teleported:!1,modelValue:le.source,"onUpdate:modelValue":Ze=>le.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=""},{default:j(()=>[k(z,{label:I.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[le.source==="custom"&&le.input_type==="TextInput"?(Ne(),bt(Ye,{key:0,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="NumberInput"?(Ne(),bt(Be,{key:1,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="SwitchInput"?(Ne(),bt(Je,{key:2,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="JsonInput"?(Ne(),bt(Ye,{key:3,modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):Bn("",!0),le.source==="referencing"?(Ne(),bt(Wo,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:e.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[D.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][le.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):Bn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[gt,l.value]]):Bn("",!0)])):(Ne(),mn("div",Hae,[k(ze,{type:"info"},{default:j(()=>[ft(_e(I.$t("common.noData")),1)]),_:1})]))],64)):(Ne(),mn(Ir,{key:1},[D.value.mcp_tool?(Ne(),mn("div",Jae,[D.value.mcp_tool?Ql((Ne(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:s,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[7]||(V[7]=An(()=>{},["prevent"]))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.tool_form_field,le=>(Ne(),bt(ie,{key:le.field,required:le.required},{label:j(()=>[ee("div",Qae,[ee("div",null,[le.label.attrs.tooltip?(Ne(),bt($N,{key:0,label:le.label,tooltip:le.label.attrs.tooltip},null,8,["label","tooltip"])):(Ne(),mn("span",ele,_e(le.label.label),1)),le.required?(Ne(),mn("span",tle,"*")):Bn("",!0)]),k(q,{teleported:!1,modelValue:le.source,"onUpdate:modelValue":Ze=>le.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>D.value.tool_params[le.label.label]=""},{default:j(()=>[k(z,{label:I.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[le.source==="custom"&&le.input_type==="TextInput"?(Ne(),bt(Ye,{key:0,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="NumberInput"?(Ne(),bt(Be,{key:1,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="SwitchInput"?(Ne(),bt(Je,{key:2,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="JsonInput"?(Ne(),bt(Ye,{key:3,modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):Bn("",!0),le.source==="referencing"?(Ne(),bt(Wo,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:e.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[le.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):Bn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[gt,l.value]]):Bn("",!0)])):(Ne(),mn("div",Zae,[k(ze,{type:"info"},{default:j(()=>[ft(_e(I.$t("common.noData")),1)]),_:1})]))],64)),k(Iae,{ref_key:"mcpServerInputDialogRef",ref:S,onRefresh:T},null,512)]),_:1},8,["nodeModel"])}}});class ole extends ai{constructor(t){super(t,rle)}}const ile={type:"mcp-node",model:li,view:ole},k8=Object.freeze(Object.defineProperty({__proto__:null,default:ile},Symbol.toStringTag,{value:"Module"})),ale={class:"dialog-footer"},lle=_r({__name:"ParametersFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"object",label:"Object"},{value:"boolean",label:"Boolean"},{value:"array",label:"Array"}],i=He(),a=He(!1),s=He(!1),l=He(null),f=He({field:"",label:"",parameter_type:"",desc:""}),h=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),v=He(!1),b=(w,S)=>{w&&(f.value=Me.cloneDeep(w),s.value=!0,l.value=S),v.value=!0},E=()=>{v.value=!1,s.value=!1,l.value=null,f.value={field:"",label:""}},O=async w=>{w&&await w.validate(S=>{S&&o("refresh",f.value,l.value)})};return t({open:b,close:E}),(w,S)=>{const M=ne("el-input"),T=ne("el-form-item"),$=ne("el-option"),D=ne("el-select"),P=ne("el-form"),B=ne("el-button"),F=ne("el-dialog");return Ne(),bt(F,{title:s.value?w.$t("common.param.editParam"):w.$t("common.param.addParam"),modelValue:v.value,"onUpdate:modelValue":S[5]||(S[5]=I=>v.value=I),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":E,"append-to-body":""},{footer:j(()=>[ee("span",ale,[k(B,{onClick:An(E,["prevent"])},{default:j(()=>[ft(_e(w.$t("common.cancel")),1)]),_:1}),k(B,{type:"primary",onClick:S[4]||(S[4]=I=>O(i.value)),loading:a.value},{default:j(()=>[ft(_e(w.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(P,{"label-position":"top",ref_key:"fieldFormRef",ref:i,rules:h,model:f.value,"require-asterisk-position":"right"},{default:j(()=>[k(T,{label:w.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:h.field},{default:j(()=>[k(M,{modelValue:f.value.field,"onUpdate:modelValue":S[0]||(S[0]=I=>f.value.field=I),maxlength:64,placeholder:w.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:h.label},{default:j(()=>[k(M,{modelValue:f.value.label,"onUpdate:modelValue":S[1]||(S[1]=I=>f.value.label=I),maxlength:64,"show-word-limit":"",placeholder:w.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),required:!0,prop:"parameter_type",rules:h.label},{default:j(()=>[k(D,{modelValue:f.value.parameter_type,"onUpdate:modelValue":S[2]||(S[2]=I=>f.value.parameter_type=I),placeholder:w.$t("common.selectPlaceholder")+w.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),style:{width:"100%"}},{default:j(()=>[(Ne(),mn(Ir,null,No(r,I=>k($,{key:I.value,label:I.label,value:I.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("common.desc"),prop:"desc"},{default:j(()=>[k(M,{modelValue:f.value.desc,"onUpdate:modelValue":S[3]||(S[3]=I=>f.value.desc=I),style:{width:"100%"},rows:2,type:"textarea",placeholder:w.$t("common.descPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),sle={class:"flex-between w-full"},ule={class:"break-all lighter"},cle={class:"ml-4",style:{"margin-top":"-4px"}},dle=["title"],fle=["title"],ple={class:"mr-4"},hle=_r({__name:"ParametersFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1);const f=[{label:Pt("common.result"),value:"result"},...r.value.map(h=>({label:h.label,value:h.field}))];Me.set(t.nodeModel.properties.config,"fields",f),t.nodeModel.clear_next_node_field(!1)}function s(l,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===l.field&&f!==v){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close();const h=[{label:Pt("common.result"),value:"result"},...r.value.map(v=>({label:v.label,value:v.field}))];Me.set(t.nodeModel.properties.config,"fields",h),t.nodeModel.clear_next_node_field(!1)}return bo(()=>{t.nodeModel.properties.node_data.variable_list&&(r.value=Me.cloneDeep(t.nodeModel.properties.node_data.variable_list)),Me.set(t.nodeModel.properties.node_data,"variable_list",r);const l=[{label:Pt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(t.nodeModel.properties.config,"fields",l)}),(l,f)=>{var S;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tag"),O=ne("el-tooltip"),w=ne("el-table");return Ne(),mn(Ir,null,[ee("div",sle,[ee("h5",ule,[ft(_e(l.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",cle,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=M=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"})]),_:1})])]),((S=t.nodeModel.properties.node_data.variable_list)==null?void 0:S.length)>0?(Ne(),bt(w,{key:0,data:t.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:j(()=>[k(b,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"90"},{default:j(({row:M})=>[ee("span",{title:M.field,class:"ellipsis-1"},_e(M.field),9,dle)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:M})=>[ee("span",null,[ee("span",{title:M.label,class:"ellipsis-1"},_e(M.label),9,fle)])]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType")},{default:j(({row:M})=>[k(E,{type:"info",class:"info-tag"},{default:j(()=>[ft(_e(M.parameter_type),1)]),_:2},1024)]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"80"},{default:j(({row:M,$index:T})=>[ee("span",ple,[k(O,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:An($=>i(M,T),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(O,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:$=>a(T)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(lle,{ref_key:"ParametersFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),vle={class:"title-decoration-1 mb-8"},mle={class:"flex-between w-full"},gle={class:"flex-between"},yle=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=e,o=He(),r=ja(),{params:{id:i}}=r,a=T=>{var $;T&&(($=o.value)==null||$.open(T,i,O.value.model_params_setting))};function s(T){Me.set(n.nodeModel.properties.node_data,"model_params_setting",T)}const l=t(),f=He(null),h=T=>T.ctrlKey===!0?(T.preventDefault(),!0):(T.stopPropagation(),!0),v=hr(()=>r.path.includes("resource-management")?"systemManage":"workspace");function b(){var $;const T=v.value==="systemManage"?{model_type:"LLM",workspace_id:($=l.value)==null?void 0:$.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:v.value}).getSelectModelList(T).then(D=>{f.value=Me.groupBy(D==null?void 0:D.data,"provider")})}const E={input_variable:[],model_params_setting:{},model_id:"",variable_list:[]},O=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",E),n.nodeModel.properties.node_data),set:T=>{Me.set(n.nodeModel.properties,"node_data",T)}}),w=T=>{var $;T?($=o.value)==null||$.reset_default(T,i):s({})},S=He(),M=async()=>S.value.validate().catch(T=>Promise.reject({node:n.nodeModel,errMessage:T}));return bo(()=>{b(),Me.set(n.nodeModel,"validate",M)}),(T,$)=>{const D=ne("AppIcon"),P=ne("el-button"),B=ne("ModelSelect"),F=ne("el-form-item"),I=ne("el-form"),V=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",vle,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(V,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(I,{onSubmit:$[3]||($[3]=An(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:T.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:T.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",mle,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.application.form.aiModel.label")),1),$[4]||($[4]=ee("span",{class:"color-danger ml-4"},"*",-1))])]),k(P,{disabled:!O.value.model_id,type:"primary",link:"",onClick:$[0]||($[0]=z=>a(O.value.model_id)),onRefreshForm:s},{default:j(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(B,{onChange:w,onWheel:h,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":$[1]||($[1]=z=>O.value.model_id=z),placeholder:T.$t("views.application.form.aiModel.placeholder"),options:f.value,onSubmitModel:b,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(F,{prop:"input_variable",rules:{message:T.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",gle,[ee("div",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.variable.placeholder"),modelValue:O.value.input_variable,"onUpdate:modelValue":$[2]||($[2]=z=>O.value.input_variable=z)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(F,{prop:"variable_list",rules:{message:T.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(hle,{ref:"ParametersFieldTableRef","node-model":e.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:o,onRefresh:s},null,512)]),_:1},8,["nodeModel"])}}});class _le extends ai{constructor(t){super(t,yle)}getConfig(t){return t.model.properties.config}}const ble={type:"parameter-extraction-node",model:li,view:_le},P8=Object.freeze(Object.defineProperty({__proto__:null,default:ble},Symbol.toStringTag,{value:"Module"})),wle={class:"title-decoration-1 mb-8"},Ele={class:"flex-between"},xle={class:"flex-between"},Ole={class:"flex align-center"},Sle={class:"flex align-center"},Ale={class:"mr-4"},Mle={class:"flex align-center"},Tle={class:"mr-4"},Cle=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=He(),a=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),s=P=>{var B;P?(B=i.value)==null||B.reset_default(P,o):b({})};function l(P){Me.set(w.nodeModel.properties.node_data,"prompt",P)}function f(P){Me.set(w.nodeModel.properties.node_data,"system",P)}const h=`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,v={model_id:"",system:Pt("views.applicationWorkflow.nodes.questionNode.systemDefault"),prompt:h,dialogue_number:1,is_result:!1};function b(P){Me.set(w.nodeModel.properties.node_data,"model_params_setting",P)}const E=P=>{var B;P&&((B=i.value)==null||B.open(P,o,O.value.model_params_setting))},O=hr({get:()=>(w.nodeModel.properties.node_data||Me.set(w.nodeModel.properties,"node_data",v),w.nodeModel.properties.node_data),set:P=>{Me.set(w.nodeModel.properties,"node_data",P)}}),w=e,S=He(),M=He(null),T=()=>{var P;return(P=S.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:w.nodeModel,errMessage:B}))},$=t();function D(){var B;const P=r.value==="systemManage"?{model_type:"LLM",workspace_id:(B=$.value)==null?void 0:B.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{M.value=Me.groupBy(F==null?void 0:F.data,"provider")})}return bo(()=>{var P;D(),typeof((P=w.nodeModel.properties.node_data)==null?void 0:P.is_result)>"u"&&Qd(w.nodeModel)&&Me.set(w.nodeModel.properties.node_data,"is_result",!0),Me.set(w.nodeModel,"validate",T)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),q=ne("el-tooltip"),X=ne("MdEditorMagnify"),G=ne("el-input-number"),Q=ne("el-switch"),J=ne("el-form"),ie=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",wle,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(ie,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(J,{onSubmit:B[7]||(B[7]=An(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"questionNodeFormRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Ele,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.application.form.aiModel.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{type:"primary",link:"",disabled:!O.value.model_id,onClick:B[0]||(B[0]=Se=>E(O.value.model_id)),onRefreshForm:b},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:s,onWheel:a,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=Se=>O.value.model_id=Se),placeholder:P.$t("views.application.form.aiModel.placeholder"),options:M.value,onSubmitModel:D,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,null,{label:j(()=>[ee("div",xle,[ee("div",Ole,[ee("span",null,_e(P.$t("views.application.form.roleSettings.label")),1),k(q,{effect:"dark",content:P.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])])]),default:j(()=>[k(X,{title:P.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":B[2]||(B[2]=Se=>O.value.system=Se),style:{height:"100px"},onSubmitDialog:f,placeholder:`${Gn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Gn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(z,{label:P.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("views.application.form.prompt.tooltip"),trigger:"blur"}},{label:j(()=>[ee("div",Sle,[ee("div",Ale,[ee("span",null,[ft(_e(P.$t("views.application.form.prompt.label")),1),B[9]||(B[9]=ee("span",{class:"color-danger"},"*",-1))])]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:a,title:P.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":B[3]||(B[3]=Se=>O.value.prompt=Se),style:{height:"150px"},onSubmitDialog:l,placeholder:`${Gn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Gn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.application.form.historyRecord.label")},{default:j(()=>[k(G,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":B[4]||(B[4]=Se=>O.value.dialogue_number=Se),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[6]||(B[6]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Mle,[ee("div",Tle,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Q,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":B[5]||(B[5]=Se=>O.value.is_result=Se)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:i,onRefresh:b},null,512)]),_:1},8,["nodeModel"])}}});class Nle extends ai{constructor(t){super(t,Cle)}}const kle={type:"question-node",model:li,view:Nle},R8=Object.freeze(Object.defineProperty({__proto__:null,default:kle},Symbol.toStringTag,{value:"Module"})),Ple={class:"flex-between"},Rle={class:"flex align-center"},Dle={class:"mr-4"},jle=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),o={reply_type:"content",content:"",fields:[],is_result:!0},r=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",o),t.nodeModel.properties.node_data),set:f=>{Me.set(t.nodeModel.properties,"node_data",f)}});function i(f){Me.set(t.nodeModel.properties.node_data,"content",f)}const a=He(),s=He(),l=()=>{var f;return Promise.all([s.value?s.value.validate():Promise.resolve(""),(f=a.value)==null?void 0:f.validate()]).catch(h=>Promise.reject({node:t.nodeModel,errMessage:h}))};return bo(()=>{var f;typeof((f=t.nodeModel.properties.node_data)==null?void 0:f.is_result)>"u"&&Qd(t.nodeModel)&&Me.set(t.nodeModel.properties.node_data,"is_result",!0),Me.set(t.nodeModel,"validate",l)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),E=ne("MdEditorMagnify"),O=ne("el-form-item"),w=ne("AppIcon"),S=ne("el-tooltip"),M=ne("el-switch"),T=ne("el-form"),$=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k($,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(T,{onSubmit:h[5]||(h[5]=An(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:a},{default:j(()=>[k(O,{label:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")},{label:j(()=>[ee("div",Ple,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")),1),k(b,{teleported:!1,modelValue:r.value.reply_type,"onUpdate:modelValue":h[0]||(h[0]=D=>r.value.reply_type=D),size:"small",style:{width:"85px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(v,{label:f.$t("common.custom"),value:"content"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[r.value.reply_type==="content"?(Ne(),bt(E,{key:0,onWheel:n,title:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent"),modelValue:r.value.content,"onUpdate:modelValue":h[1]||(h[1]=D=>r.value.content=D),style:{height:"150px"},onSubmitDialog:i},null,8,["title","modelValue"])):(Ne(),bt(Wo,{key:1,ref_key:"nodeCascaderRef",ref:s,nodeModel:e.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.fields,"onUpdate:modelValue":h[2]||(h[2]=D=>r.value.fields=D)},null,8,["nodeModel","placeholder","modelValue"]))]),_:1},8,["label"]),k(O,{label:f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:h[4]||(h[4]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Rle,[ee("div",Dle,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(S,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(w,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(M,{size:"small",modelValue:r.value.is_result,"onUpdate:modelValue":h[3]||(h[3]=D=>r.value.is_result=D)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Lle extends ai{constructor(t){super(t,jle)}}const Ile={type:"reply-node",model:li,view:Lle},D8=Object.freeze(Object.defineProperty({__proto__:null,default:Ile},Symbol.toStringTag,{value:"Module"})),Fle={class:"flex align-center"},Ble={class:"mr-4"},$le={class:"dialog-footer"},Ule=_r({__name:"ParamSettingDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He({top_n:3,similarity:0,max_paragraph_char_number:5e3}),a=He(!1),s=He(!1);K_(a,h=>{h||(i.value={top_n:3,similarity:0,max_paragraph_char_number:5e3})});const l=h=>{i.value={...i.value,...Me.cloneDeep(h)},a.value=!0},f=()=>{var h;(h=r==null?void 0:r.value)==null||h.validate((v,b)=>{v&&(o("refresh",Me.cloneDeep(i.value)),a.value=!1)})};return t({open:l}),(h,v)=>{const b=ne("AppIcon"),E=ne("el-tooltip"),O=ne("el-input-number"),w=ne("el-form-item"),S=ne("el-col"),M=ne("el-row"),T=ne("el-slider"),$=ne("el-form"),D=ne("el-button"),P=ne("el-dialog");return Ne(),bt(P,{"align-center":"",title:h.$t("common.paramSetting"),class:"param-dialog",modelValue:a.value,"onUpdate:modelValue":v[5]||(v[5]=B=>a.value=B),style:{width:"550px"},"append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:j(()=>[ee("span",$le,[k(D,{onClick:v[3]||(v[3]=An(B=>a.value=!1,["prevent"]))},{default:j(()=>[ft(_e(h.$t("common.cancel")),1)]),_:1}),k(D,{type:"primary",onClick:v[4]||(v[4]=B=>f()),loading:s.value},{default:j(()=>[ft(_e(h.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k($,{"label-position":"top",ref_key:"paramFormRef",ref:r,model:i.value},{default:j(()=>[k(M,{gutter:12},{default:j(()=>[k(S,{span:12},{default:j(()=>[k(w,null,{label:j(()=>[ee("div",Fle,[ee("span",Ble,"Score "+_e(h.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1),k(E,{effect:"dark",content:h.$t("views.applicationWorkflow.nodes.rerankerNode.ScoreTooltip"),placement:"right"},{default:j(()=>[k(b,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[k(O,{modelValue:i.value.similarity,"onUpdate:modelValue":v[0]||(v[0]=B=>i.value.similarity=B),min:0,max:i.value.search_mode==="blend"?2:1,precision:3,step:.1,"value-on-clear":0,"controls-position":"right",class:"w-full"},null,8,["modelValue","max"])]),_:1})]),_:1}),k(S,{span:12},{default:j(()=>[k(w,{label:h.$t("views.application.dialog.topReferences")},{default:j(()=>[k(O,{modelValue:i.value.top_n,"onUpdate:modelValue":v[1]||(v[1]=B=>i.value.top_n=B),min:1,max:1e4,"value-on-clear":1,"controls-position":"right",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),k(w,{label:h.$t("views.application.dialog.maxCharacters")},{default:j(()=>[k(T,{modelValue:i.value.max_paragraph_char_number,"onUpdate:modelValue":v[2]||(v[2]=B=>i.value.max_paragraph_char_number=B),"show-input":"","show-input-controls":!1,min:500,max:1e5,class:"custom-slider"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}}),Vle={class:"flex-between"},Gle={class:"flex-between"},Wle={class:"w-full"},zle={class:"flex-between"},Hle={class:"flex-between"},Xle=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(),s={reranker_reference_list:[[]],reranker_model_id:"",question_reference_address:[],reranker_setting:{top_n:3,similarity:0,max_paragraph_char_number:5e3},show_knowledge:!1},l=He(null),f=()=>{var D;(D=a.value)==null||D.open(b.value.reranker_setting)},h=D=>{const P=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);P.splice(D,1),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",P)},v=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.stopPropagation(),!0),b=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",s),i.nodeModel.properties.node_data),set:D=>{Me.set(i.nodeModel.properties,"node_data",D)}});function E(D){Me.set(i.nodeModel.properties.node_data,"reranker_setting",D)}const O=t();function w(){var P;const D=r.value==="systemManage"?{model_type:"RERANKER",workspace_id:(P=O.value)==null?void 0:P.workspace_id}:{model_type:"RERANKER"};oi({type:"model",systemType:r.value}).getSelectModelList(D).then(B=>{l.value=Me.groupBy(B==null?void 0:B.data,"provider")})}const S=()=>{const D=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);D.push([]),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",D)},M=He(),T=He(),$=()=>{var D;return Promise.all([T.value?T.value.validate():Promise.resolve(""),(D=M.value)==null?void 0:D.validate()]).catch(P=>Promise.reject({node:i.nodeModel,errMessage:P}))};return bo(()=>{w(),b.value.show_knowledge=b.value.show_knowledge?b.value.show_knowledge:!1,Me.set(i.nodeModel,"validate",$)}),(D,P)=>{const B=ne("AppIcon"),F=ne("el-button"),I=ne("el-form-item"),V=ne("el-col"),z=ne("el-row"),q=ne("ModelSelect"),X=ne("el-switch"),G=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(G,{onSubmit:P[4]||(P[4]=An(()=>{},["prevent"])),model:b.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"rerankerNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label"),prop:"reranker_reference_list",rules:{type:"array",message:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Vle,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label")),1),P[5]||(P[5]=ee("span",{class:"color-danger"},"*",-1))]),k(F,{onClick:S,link:"",type:"primary"},{default:j(()=>[k(B,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[(Ne(!0),mn(Ir,null,No(b.value.reranker_reference_list,(J,ie)=>(Ne(),bt(z,{gutter:8,style:{"margin-bottom":"8px"},key:ie,class:"w-full"},{default:j(()=>[k(V,{span:22},{default:j(()=>[k(I,{prop:"reranker_reference_list."+ie,rules:{type:"array",required:!0,message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[(Ne(),bt(Wo,{key:ie,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),modelValue:b.value.reranker_reference_list[ie],"onUpdate:modelValue":Se=>b.value.reranker_reference_list[ie]=Se},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules"])]),_:2},1024),k(V,{span:2},{default:j(()=>[k(F,{link:"",type:"info",onClick:Se=>h(ie)},{default:j(()=>[k(B,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["label","rules"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",Gle,[ee("span",null,_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(F,{type:"primary",link:"",onClick:f},{default:j(()=>[k(B,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",Wle,[k(z,null,{default:j(()=>[k(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(" Score "+_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1)]),_:1}),k(V,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=b.value.reranker_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),k(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(D.$t("chat.KnowledgeSource.referenceParagraph"))+" Top",1)]),_:1}),k(V,{span:12,class:"lighter"},{default:j(()=>[ft(_e(b.value.reranker_setting.top_n),1)]),_:1}),k(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.max_paragraph_char_number")),1)]),_:1}),k(V,{span:12,class:"lighter"},{default:j(()=>[ft(_e(b.value.reranker_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),prop:"question_reference_address",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",zle,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label")),1),P[6]||(P[6]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:T,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),modelValue:b.value.question_reference_address,"onUpdate:modelValue":P[0]||(P[0]=J=>b.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label"),prop:"reranker_model_id",rules:{required:!0,message:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Hle,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label")),1),P[7]||(P[7]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(q,{onWheel:v,teleported:!1,modelValue:b.value.reranker_model_id,"onUpdate:modelValue":P[1]||(P[1]=J=>b.value.reranker_model_id=J),placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),options:l.value,onSubmitModel:w,showFooter:"","model-type":"RERANKER"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"),prop:"show_knowledge",required:"",onClick:P[3]||(P[3]=An(()=>{},["prevent"]))},{default:j(()=>[k(X,{size:"small",modelValue:b.value.show_knowledge,"onUpdate:modelValue":P[2]||(P[2]=J=>b.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Ule,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:E},null,512)]),_:1},8,["nodeModel"])}}}),Yle=Ph(Xle,[["__scopeId","data-v-298ea2ea"]]);class qle extends ai{constructor(t){super(t,Yle)}}const Kle={type:"reranker-node",model:li,view:qle},j8=Object.freeze(Object.defineProperty({__proto__:null,default:Kle},Symbol.toStringTag,{value:"Module"})),Zle={class:"title-decoration-1 mb-8"},Jle={class:"flex-between"},Qle={key:0,class:"w-full"},ese={class:"flex align-center",style:{"line-height":"20px"}},tse=["title"],nse={key:1,class:"w-full"},rse={class:"flex-between"},ose={class:"flex align-center"},ise={class:"flex align-center"},ase={class:"w-full"},lse={key:1},sse={class:"flex align-center mb-8"},use=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ja(),n=e,o=He(),r=He(),i=[{value:"contain",label:Pt("views.applicationWorkflow.compare.contain")},{value:"not_contain",label:Pt("views.applicationWorkflow.compare.not_contain")},{value:"eq",label:Pt("views.applicationWorkflow.compare.eq")}],a=hr(()=>t.path.includes("shared")?"systemShare":t.path.includes("resource-management")?"systemManage":t.path.includes("share/")?"workspaceShare":"workspace"),s={knowledge_id_list:[],search_scope_type:"custom",search_scope_source:"knowledge",search_scope_reference:[],search_mode:"auto",question_reference:[],search_condition_type:"AND",search_condition_list:[],knowledge_tags:[]},l=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",s),n.nodeModel.properties.node_data),set:D=>{Me.set(n.nodeModel.properties,"node_data",D)}}),f=He(),h=He(),v=He([]),b=He(!1);function E(D){const P=n.nodeModel.properties.node_data.knowledge_id_list.filter(B=>B!==D);Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",P)}function O(D){Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",D.map(P=>P.id)),Me.set(n.nodeModel.properties.node_data,"knowledge_list",D),v.value=D}function w(){h.value&&h.value.open(l.value.knowledge_id_list)}function S(){const D=Me.cloneDeep(l.value.search_condition_list);D.push({key:"",compare:"contain",value:""}),Me.set(l.value,"search_condition_list",D)}function M(D){const P=Me.cloneDeep(l.value.search_condition_list);P.splice(D,1),Me.set(l.value,"search_condition_list",P)}function T(D){if(D.length===0){Me.set(l.value,"knowledge_tags",[]);return}oi({type:"knowledge",systemType:a.value}).getAllTags({knowledge_ids:D},{}).then(P=>{Me.set(l.value,"knowledge_tags",P.data)})}const $=()=>{var D,P,B;return Promise.all([(D=o.value)==null?void 0:D.validate(),(P=r.value)==null?void 0:P.validate(),(B=f.value)==null?void 0:B.validate()]).catch(F=>Promise.reject({node:n.nodeModel,errMessage:F}))};return bo(()=>{v.value=n.nodeModel.properties.node_data.knowledge_list,Me.set(n.nodeModel,"validate",$)}),(D,P)=>{const B=ne("el-button"),F=ne("el-option"),I=ne("el-select"),V=ne("el-text"),z=ne("KnowledgeIcon"),q=ne("Close"),X=ne("el-icon"),G=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("el-radio"),ie=ne("el-radio-group"),Se=ne("el-col"),Ae=ne("el-input"),Pe=ne("el-row"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",Zle,_e(D.$t("views.applicationWorkflow.nodeSetting")),1),k(ze,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:P[8]||(P[8]=An(()=>{},["prevent"])),model:l.value,"label-position":"top","hide-required-asterisk":"","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:f},{default:j(()=>[k(G,null,{label:j(()=>[ee("div",Jle,[ee("span",null,_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[l.value.search_scope_type==="custom"?(Ne(),bt(B,{key:0,type:"primary",link:"",onClick:w},{default:j(()=>[k(Lv,{iconName:"app-add-outlined"})]),_:1})):Bn("",!0),k(I,{teleported:!1,size:"small",modelValue:l.value.search_scope_type,"onUpdate:modelValue":P[0]||(P[0]=Ye=>l.value.search_scope_type=Ye),style:{width:"85px"}},{default:j(()=>[k(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(F,{label:D.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var Ye;return[l.value.search_scope_type==="custom"?(Ne(),mn("div",Qle,[((Ye=l.value.knowledge_id_list)==null?void 0:Ye.length)===0?(Ne(),bt(V,{key:0,type:"info"},{default:j(()=>[ft(_e(D.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Ne(!0),mn(Ir,{key:1},No(l.value.knowledge_id_list,(Be,Je)=>{var gt,le,Ze;return Ne(),mn("div",{key:Je,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",ese,[k(z,{type:(gt=Gn(bs)(v.value,Be,"id"))==null?void 0:gt.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(le=Gn(bs)(v.value,Be,"id"))==null?void 0:le.name},_e((Ze=Gn(bs)(v.value,Be,"id"))==null?void 0:Ze.name),9,tse)]),k(B,{text:"",onClick:pe=>E(Be)},{default:j(()=>[k(X,null,{default:j(()=>[k(q)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Ne(),mn("div",nse,[k(G,{prop:"search_scope_reference",rules:{message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",rse,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),P[9]||(P[9]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[k(I,{teleported:!1,size:"small",modelValue:l.value.search_scope_source,"onUpdate:modelValue":P[1]||(P[1]=Be=>l.value.search_scope_source=Be),style:{width:"95px"},onChange:P[2]||(P[2]=Be=>l.value.search_scope_reference=[])},{default:j(()=>[k(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:o,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.variable.placeholder"),modelValue:l.value.search_scope_reference,"onUpdate:modelValue":P[3]||(P[3]=Be=>l.value.search_scope_reference=Be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(G,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.searchSetting")},{default:j(()=>[k(ie,{modelValue:l.value.search_mode,"onUpdate:modelValue":P[4]||(P[4]=Ye=>l.value.search_mode=Ye)},{default:j(()=>[k(J,{value:"auto"},{default:j(()=>[ee("span",ose,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.auto"))+" ",1),k(Q,{content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.autoTooltip"),placement:"top"},{default:j(()=>[k(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1}),l.value.search_scope_type==="custom"?(Ne(),bt(J,{key:0,value:"custom"},{default:j(()=>[ee("span",ise,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"))+" ",1),k(Q,{c:"",content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.customTooltip"),placement:"top"},{default:j(()=>[k(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1})):Bn("",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"]),ee("div",ase,[l.value.search_mode==="auto"?(Ne(),bt(G,{key:0,prop:"question_reference",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),P[10]||(P[10]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef2",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:l.value.question_reference,"onUpdate:modelValue":P[5]||(P[5]=Ye=>l.value.question_reference=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])):(Ne(),mn("div",lse,[ee("div",sse,[k(V,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1)]),_:1}),k(I,{modelValue:l.value.search_condition_type,"onUpdate:modelValue":P[6]||(P[6]=Ye=>l.value.search_condition_type=Ye),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(F,{label:D.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(F,{label:D.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),k(V,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)]),_:1})]),(Ne(!0),mn(Ir,null,No(l.value.search_condition_list,(Ye,Be)=>(Ne(),mn("div",{key:Be},[k(Pe,{gutter:8,class:"mb-8"},{default:j(()=>[k(Se,{span:8},{default:j(()=>[k(I,{modelValue:Ye.key,"onUpdate:modelValue":Je=>Ye.key=Je,filterable:"",onFocus:P[7]||(P[7]=Je=>T(l.value.knowledge_id_list))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(l.value.knowledge_tags,Je=>(Ne(),bt(F,{key:Je,label:Je.key,value:Je.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(Se,{span:7},{default:j(()=>[k(I,{modelValue:Ye.compare,"onUpdate:modelValue":Je=>Ye.compare=Je},{default:j(()=>[(Ne(),mn(Ir,null,No(i,Je=>k(F,{key:Je.value,value:Je.value,label:Je.label},null,8,["value","label"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(Se,{span:8},{default:j(()=>[k(Ae,{modelValue:Ye.value,"onUpdate:modelValue":Je=>Ye.value=Je,placeholder:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),k(Se,{span:1},{default:j(()=>[k(B,{link:"",onClick:Je=>M(Be),type:"info",class:"mt-4"},{default:j(()=>[k(Lv,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]))),128)),k(B,{link:"",type:"primary",onClick:S,class:"mt-8"},{default:j(()=>[k(Lv,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(D.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]))])]),_:1},8,["model"])]),_:1}),k(Bj,{ref_key:"AddKnowledgeDialogRef",ref:h,onAddData:O,data:v.value,loading:b.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class cse extends ai{constructor(t){super(t,use)}}const dse={type:"search-document-node",model:li,view:cse},L8=Object.freeze(Object.defineProperty({__proto__:null,default:dse},Symbol.toStringTag,{value:"Module"})),fse={class:"title-decoration-1 mb-8"},pse={class:"flex-between"},hse={key:0,class:"w-full"},vse={class:"flex align-center",style:{"line-height":"20px"}},mse=["title"],gse={key:1,class:"w-full"},yse={class:"flex-between"},_se={class:"flex-between"},bse={class:"w-full"},wse={class:"flex-between"},Ese={class:"flex-between"},xse=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=He(),o={knowledge_id_list:[],knowledge_setting:{top_n:3,similarity:.6,max_paragraph_char_number:5e3,search_mode:"embedding"},question_reference_address:[],show_knowledge:!1,search_scope_type:"custom",search_scope_source:"knowledge",search_scope_reference:[]},r=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",o),t.nodeModel.properties.node_data),set:S=>{Me.set(t.nodeModel.properties,"node_data",S)}}),i=He(),a=He(),s=He(),l=He([]),f=He(!1);function h(S){Me.set(t.nodeModel.properties.node_data,"knowledge_setting",S.knowledge_setting)}const v=()=>{var S;(S=a.value)==null||S.open(r.value,"WORK_FLOW")};function b(S){const M=t.nodeModel.properties.node_data.knowledge_id_list.filter(T=>T!==S);Me.set(t.nodeModel.properties.node_data,"knowledge_id_list",M)}function E(S){Me.set(t.nodeModel.properties.node_data,"knowledge_id_list",S.map(M=>M.id)),Me.set(t.nodeModel.properties.node_data,"knowledge_list",S),l.value=S}function O(){s.value&&s.value.open(r.value.knowledge_id_list)}const w=()=>{var S;return Promise.all([n.value.validate(),(S=i.value)==null?void 0:S.validate()]).catch(M=>Promise.reject({node:t.nodeModel,errMessage:M}))};return bo(()=>{l.value=t.nodeModel.properties.node_data.knowledge_list,r.value.show_knowledge=r.value.show_knowledge?r.value.show_knowledge:!1,r.value.search_scope_type=r.value.search_scope_type?r.value.search_scope_type:"custom",r.value.search_scope_source=r.value.search_scope_source?r.value.search_scope_source:"knowledge",r.value.knowledge_id_list=r.value.knowledge_id_list?r.value.knowledge_id_list:[],Me.set(t.nodeModel,"validate",w)}),(S,M)=>{const T=ne("el-button"),$=ne("el-option"),D=ne("el-select"),P=ne("el-text"),B=ne("KnowledgeIcon"),F=ne("Close"),I=ne("el-icon"),V=ne("el-form-item"),z=ne("el-col"),q=ne("el-row"),X=ne("el-switch"),G=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",fse,_e(S.$t("views.applicationWorkflow.nodeSetting")),1),k(Q,{shadow:"never",class:"card-never"},{default:j(()=>[k(G,{onSubmit:M[7]||(M[7]=An(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:i,"hide-required-asterisk":""},{default:j(()=>[k(V,null,{label:j(()=>[ee("div",pse,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[r.value.search_scope_type==="custom"?(Ne(),bt(T,{key:0,type:"primary",link:"",onClick:O},{default:j(()=>[k(Lv,{iconName:"app-add-outlined"})]),_:1})):Bn("",!0),k(D,{teleported:!1,size:"small",modelValue:r.value.search_scope_type,"onUpdate:modelValue":M[0]||(M[0]=J=>r.value.search_scope_type=J),style:{width:"85px"}},{default:j(()=>[k($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k($,{label:S.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var J;return[r.value.search_scope_type==="custom"?(Ne(),mn("div",hse,[((J=r.value.knowledge_id_list)==null?void 0:J.length)===0?(Ne(),bt(P,{key:0,type:"info"},{default:j(()=>[ft(_e(S.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Ne(!0),mn(Ir,{key:1},No(r.value.knowledge_id_list,(ie,Se)=>{var Ae,Pe,De;return Ne(),mn("div",{key:Se,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",vse,[k(B,{type:(Ae=Gn(bs)(l.value,ie,"id"))==null?void 0:Ae.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(Pe=Gn(bs)(l.value,ie,"id"))==null?void 0:Pe.name},_e((De=Gn(bs)(l.value,ie,"id"))==null?void 0:De.name),9,mse)]),k(T,{text:"",onClick:ze=>b(ie)},{default:j(()=>[k(I,null,{default:j(()=>[k(F)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Ne(),mn("div",gse,[k(V,{prop:"search_scope_reference",rules:{message:S.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",yse,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),M[8]||(M[8]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[k(D,{teleported:!1,size:"small",modelValue:r.value.search_scope_source,"onUpdate:modelValue":M[1]||(M[1]=ie=>r.value.search_scope_source=ie),style:{width:"95px"},onChange:M[2]||(M[2]=ie=>r.value.search_scope_reference=[])},{default:j(()=>[k($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:n,nodeModel:e.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.variable.placeholder"),modelValue:r.value.search_scope_reference,"onUpdate:modelValue":M[3]||(M[3]=ie=>r.value.search_scope_reference=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(V,{label:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",_se,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(T,{type:"primary",link:"",onClick:v},{default:j(()=>[k(Lv,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",bse,[k(q,null,{default:j(()=>[k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.selectSearchMode")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(S.$t(Gn(v9)[r.value.knowledge_setting.search_mode])),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.similarityThreshold")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=r.value.knowledge_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.topReferences")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.top_n),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.maxCharacters")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(V,{prop:"question_reference_address",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",wse,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),M[9]||(M[9]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:n,nodeModel:e.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.question_reference_address,"onUpdate:modelValue":M[4]||(M[4]=J=>r.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(V,{prop:"show_knowledge",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.requiredMessage"),trigger:"blur",required:!0},onClick:M[6]||(M[6]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Ese,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"))+" ",1),M[10]||(M[10]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(X,{size:"small",modelValue:r.value.show_knowledge,"onUpdate:modelValue":M[5]||(M[5]=J=>r.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(A9,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:h},null,512),k(Bj,{ref_key:"AddknowledgeDialogRef",ref:s,onAddData:E,data:l.value,loading:f.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class Ose extends ai{constructor(t){super(t,xse)}}const Sse={type:"search-knowledge-node",model:li,view:Ose},I8=Object.freeze(Object.defineProperty({__proto__:null,default:Sse},Symbol.toStringTag,{value:"Module"})),Ase={class:"title-decoration-1 mb-8"},Mse={class:"flex-between w-full"},Tse={class:"flex-between w-full"},Cse={class:"flex align-center"},Nse={class:"mr-4"},kse=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(),l=He(),f=He(),h=()=>{var $;return Promise.all([f.value?f.value.validate():Promise.resolve(""),($=l.value)==null?void 0:$.validate()]).catch(D=>Promise.reject({node:i.nodeModel,errMessage:D}))},v=$=>$.ctrlKey===!0?($.preventDefault(),!0):($.stopPropagation(),!0),b={stt_model_id:"",is_result:!0,audio_list:[],model_params_setting:{}},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:$=>{Me.set(i.nodeModel.properties,"node_data",$)}}),O=()=>{var D;const $=E.value.stt_model_id;if(!$){Oh(Pt("views.application.form.voiceInput.requiredMessage"));return}(D=s.value)==null||D.open($,o,E.value.model_params_setting)},w=$=>{Me.set(i.nodeModel.properties.node_data,"model_params_setting",$)};function S($){var D;$?(D=s.value)==null||D.reset_default($,o):w({})}const M=t();function T(){var D;const $=r.value==="systemManage"?{model_type:"STT",workspace_id:(D=M.value)==null?void 0:D.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList($).then(P=>{a.value=Me.groupBy(P==null?void 0:P.data,"provider")})}return bo(()=>{T(),Me.set(i.nodeModel,"validate",h)}),($,D)=>{const P=ne("AppIcon"),B=ne("el-button"),F=ne("ModelSelect"),I=ne("el-form-item"),V=ne("el-tooltip"),z=ne("el-switch"),q=ne("el-form"),X=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",Ase,_e($.$t("views.applicationWorkflow.nodeSetting")),1),k(X,{shadow:"never",class:"card-never"},{default:j(()=>[k(q,{onSubmit:D[4]||(D[4]=An(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:$.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label"),prop:"stt_model_id",rules:{required:!0,message:$.$t("views.application.form.voiceInput.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Mse,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label")),1),D[5]||(D[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(B,{type:"primary",link:"",onClick:O,disabled:!E.value.stt_model_id,class:"mr-4"},{default:j(()=>[k(P,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(F,{onWheel:v,teleported:!1,onChange:S,modelValue:E.value.stt_model_id,"onUpdate:modelValue":D[0]||(D[0]=G=>E.value.stt_model_id=G),placeholder:$.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(I,{label:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Tse,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label")),1),D[6]||(D[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:f,nodeModel:e.nodeModel,class:"w-full",placeholder:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:E.value.audio_list,"onUpdate:modelValue":D[1]||(D[1]=G=>E.value.audio_list=G)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(I,{label:$.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:D[3]||(D[3]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Cse,[ee("div",Nse,[ee("span",null,_e($.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(V,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(P,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(z,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":D[2]||(D[2]=G=>E.value.is_result=G)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(M9,{ref_key:"STTModeParamSettingDialogRef",ref:s,onRefresh:w},null,512)]),_:1},8,["node-model"])}}});class Pse extends ai{constructor(t){super(t,kse)}}const Rse={type:"speech-to-text-node",model:li,view:Pse},F8=Object.freeze(Object.defineProperty({__proto__:null,default:Rse},Symbol.toStringTag,{value:"Module"})),Dse={class:"title-decoration-1 mb-8"},jse={class:"break-all"},Lse={class:"title-decoration-1 mb-8"},Ise={class:"break-all"},Fse=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=He(!1),o=[{label:Pt("views.applicationWorkflow.nodes.startNode.currentTime"),value:"time"},{label:Pt("views.application.form.historyRecord.label"),value:"history_context"},{label:Pt("chat.chatId"),value:"chat_id"},{label:Pt("chat.chatUserId"),value:"chat_user_id"},{label:Pt("chat.chatUserType"),value:"chat_user_type"},{label:Pt("views.chatUser.title"),value:"chat_user"}],r=()=>{const l=t.nodeModel.graphModel.nodes.filter(h=>h.id==="base-node").map(h=>Me.cloneDeep(h.properties.user_input_field_list)).reduce((h,v)=>[...h,...v],[]).map(h=>h.label&&h.label.input_type==="TooltipLabel"?{label:h.label.label,value:h.field||h.variable}:{label:h.label||h.name,value:h.field||h.variable}),f=t.nodeModel.graphModel.nodes.filter(h=>h.id==="base-node").map(h=>Me.cloneDeep(h.properties.api_input_field_list)).reduce((h,v)=>[...h,...v],[]).map(h=>({label:h.name||h.variable,value:h.variable}));return[...l,...f]},i=()=>{const l=r();Me.set(t.nodeModel.properties.config,"globalFields",[...o,...l])},a=()=>{const l=t.nodeModel.graphModel.nodes.filter(f=>f.id==="base-node").map(f=>Me.cloneDeep(f.properties.chat_input_field_list)).reduce((f,h)=>[...f,...h],[]).map(f=>({label:f.label,value:f.field}));Me.set(t.nodeModel.properties.config,"chatFields",l)};t.nodeModel.graphModel.eventCenter.on("refreshFieldList",i),t.nodeModel.graphModel.eventCenter.on("chatFieldList",a);const s=()=>{let l=Me.cloneDeep(t.nodeModel.properties.config.fields);const f=t.nodeModel.graphModel.nodes.filter(v=>v.id==="base-node").filter(v=>v.properties.node_data.file_upload_enable).map(v=>Me.cloneDeep(v.properties.node_data.file_upload_setting)).filter(v=>v);if(l=l.filter(v=>v.value!=="image"&&v.value!=="document"&&v.value!=="audio"&&v.value!=="video"&&v.value!=="other"),f.length===0){Me.set(t.nodeModel.properties.config,"fields",l);return}const h=[];f[0].document&&h.push({label:Pt("common.fileUpload.document"),value:"document"}),f[0].image&&h.push({label:Pt("common.fileUpload.image"),value:"image"}),f[0].audio&&h.push({label:Pt("common.fileUpload.audio"),value:"audio"}),f[0].video&&h.push({label:Pt("common.fileUpload.video"),value:"video"}),f[0].other&&h.push({label:Pt("common.fileUpload.other"),value:"other"}),Me.set(t.nodeModel.properties.config,"fields",[...l,...h])};return t.nodeModel.graphModel.eventCenter.on("refreshFileUploadConfig",s),bo(()=>{a(),i(),s()}),(l,f)=>{const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-tooltip");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>{var E;return[ee("h5",Dse,_e(l.$t("views.applicationWorkflow.variable.global")),1),(Ne(!0),mn(Ir,null,No(e.nodeModel.properties.config.globalFields,(O,w)=>(Ne(),mn("div",{key:w,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:f[0]||(f[0]=S=>n.value=!0),onMouseleave:f[1]||(f[1]=S=>n.value=!1)},[ee("span",jse,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Ne(),bt(b,{key:0,effect:"dark",content:l.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(v,{link:"",onClick:S=>Gn(x_)(`{{global.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[k(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128)),(E=e.nodeModel.properties.config.chatFields)!=null&&E.length?(Ne(),mn(Ir,{key:0},[ee("h5",Lse,_e(l.$t("views.applicationWorkflow.variable.chat")),1),(Ne(!0),mn(Ir,null,No(e.nodeModel.properties.config.chatFields||[],(O,w)=>(Ne(),mn("div",{key:w,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:f[2]||(f[2]=S=>n.value=!0),onMouseleave:f[3]||(f[3]=S=>n.value=!1)},[ee("span",Ise,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Ne(),bt(b,{key:0,effect:"dark",content:l.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(v,{link:"",onClick:S=>Gn(x_)(`{{chat.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[k(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128))],64)):Bn("",!0)]}),_:1},8,["nodeModel"])}}});class Bse extends ai{constructor(t){super(t,Fse)}}const $se={type:"start-node",model:li,view:Bse},B8=Object.freeze(Object.defineProperty({__proto__:null,default:$se},Symbol.toStringTag,{value:"Module"})),Use={class:"title-decoration-1 mb-8"},Vse={class:"flex-between w-full"},Gse={class:"flex-between w-full"},Wse={class:"flex align-center"},zse={class:"mr-4"},Hse=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(),s=He(null),l=He(),f=He(),h=()=>{var T;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(T=l.value)==null?void 0:T.validate()]).catch($=>Promise.reject({node:i.nodeModel,errMessage:$}))},v=T=>T.ctrlKey===!0?(T.preventDefault(),!0):(T.stopPropagation(),!0),b={tts_model_id:"",is_result:!0,content_list:[],model_params_setting:{}},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:T=>{Me.set(i.nodeModel.properties,"node_data",T)}}),O=t();function w(){var $;const T=r.value==="systemManage"?{model_type:"TTS",workspace_id:($=O.value)==null?void 0:$.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(T).then(D=>{s.value=Me.groupBy(D==null?void 0:D.data,"provider")})}const S=()=>{var $;const T=E.value.tts_model_id;if(!T){Oh(Pt("views.application.form.voicePlay.requiredMessage"));return}($=a.value)==null||$.open(T,o,E.value.model_params_setting)},M=T=>{E.value.model_params_setting=T};return bo(()=>{w(),Me.set(i.nodeModel,"validate",h)}),(T,$)=>{const D=ne("AppIcon"),P=ne("el-button"),B=ne("ModelSelect"),F=ne("el-form-item"),I=ne("el-tooltip"),V=ne("el-switch"),z=ne("el-form"),q=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",Use,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(q,{shadow:"never",class:"card-never"},{default:j(()=>[k(z,{onSubmit:$[4]||($[4]=An(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label"),prop:"tts_model_id",rules:{required:!0,message:T.$t("views.application.form.voicePlay.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Vse,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label")),1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(P,{type:"primary",link:"",onClick:S,disabled:!E.value.tts_model_id,class:"mr-4"},{default:j(()=>[k(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(B,{onWheel:v,teleported:!1,modelValue:E.value.tts_model_id,"onUpdate:modelValue":$[0]||($[0]=X=>E.value.tts_model_id=X),placeholder:T.$t("views.application.form.voicePlay.placeholder"),options:s.value,showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(F,{prop:"content_list",label:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),rules:{message:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Gse,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label")),1),$[6]||($[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:f,nodeModel:e.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:E.value.content_list,"onUpdate:modelValue":$[1]||($[1]=X=>E.value.content_list=X)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(F,{label:T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[3]||($[3]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Wse,[ee("div",zse,[ee("span",null,_e(T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(I,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(V,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":$[2]||($[2]=X=>E.value.is_result=X)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Fj,{ref_key:"TTSModeParamSettingDialogRef",ref:a,onRefresh:M},null,512)]),_:1},8,["node-model"])}}});class Xse extends ai{constructor(t){super(t,Hse)}}const Yse={type:"text-to-speech-node",model:li,view:Xse},$8=Object.freeze(Object.defineProperty({__proto__:null,default:Yse},Symbol.toStringTag,{value:"Module"})),qse={class:"title-decoration-1 mb-8"},Kse={class:"flex-between w-full"},Zse={class:"flex align-center"},Jse={class:"mr-4"},Qse={class:"flex align-center"},eue={class:"mr-4"},tue={class:"flex align-center"},nue={class:"mr-4"},rue=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(),l=He(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null},E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=t();function w(){var B;const P=r.value==="systemManage"?{model_type:"TTV",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTV"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var B;P&&((B=s.value)==null||B.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function $(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function D(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return bo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),q=ne("el-tooltip"),X=ne("MdEditorMagnify"),G=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",qse,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:B[6]||(B[6]=An(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Kse,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label")),1),B[7]||(B[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(I,{disabled:!E.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(V,{onChange:S,onWheel:h,onFocus:w,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>E.value.model_id=ie),placeholder:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"TTV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Zse,[ee("div",Jse,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Qse,[ee("div",eue,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[5]||(B[5]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",tue,[ee("div",nue,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(G,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[4]||(B[4]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});class oue extends ai{constructor(t){super(t,rue)}}const iue={type:"text-to-video-node",model:li,view:oue},U8=Object.freeze(Object.defineProperty({__proto__:null,default:iue},Symbol.toStringTag,{value:"Module"})),aue={class:"title-decoration-1 mb-16"},lue={class:"lighter mb-8"},sue={key:0},uue={class:"flex-between"},cue={class:"flex align-center"},due={class:"mr-4"},fue={key:1,class:"color-danger"},pue={class:"flex align-center"},hue={class:"mr-4"},vue=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=ja(),o=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),r=He(),i={input_field_list:[],is_result:!1},a=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",i),t.nodeModel.properties.node_data),set:h=>{Me.set(t.nodeModel.properties,"node_data",h)}}),s=He(),l=()=>{var h;return(h=s.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:t.nodeModel,errMessage:v}))},f=()=>{if(!t.nodeModel.properties.node_data.tool_lib_id){Me.set(t.nodeModel.properties,"status",500);return}oi({type:"tool",systemType:o.value}).getToolById(t.nodeModel.properties.node_data.tool_lib_id).then(h=>{const v=t.nodeModel.properties.node_data.input_field_list,b=h.data.input_field_list.map(E=>{const O=v.find(w=>w.name==E.name);return O&&O.source==E.source?{...E,value:JSON.parse(JSON.stringify(O.value))}:{...E,value:E.source=="reference"?[]:""}});Me.set(t.nodeModel.properties.node_data,"input_field_list",b),Me.set(t.nodeModel.properties,"status",h.data.is_active?200:500)}).catch(()=>{Me.set(t.nodeModel.properties,"status",500)})};return bo(()=>{var h;typeof((h=t.nodeModel.properties.node_data)==null?void 0:h.is_result)>"u"&&Qd(t.nodeModel)&&Me.set(t.nodeModel.properties.node_data,"is_result",!0),f(),Me.set(t.nodeModel,"validate",l)}),(h,v)=>{const b=ne("auto-tooltip"),E=ne("AppIcon"),O=ne("el-tooltip"),w=ne("el-tag"),S=ne("el-input"),M=ne("el-form-item"),T=ne("el-text"),$=ne("el-card"),D=ne("el-switch"),P=ne("el-form");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",aue,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),ee("h5",lue,_e(h.$t("common.param.inputParam")),1),k(P,{onSubmit:v[2]||(v[2]=An(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:s,model:a.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k($,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var B;return[((B=a.value.input_field_list)==null?void 0:B.length)>0?(Ne(),mn("div",sue,[(Ne(!0),mn(Ir,null,No(a.value.input_field_list,(F,I)=>(Ne(),bt(M,{key:F.name,label:F.name,prop:"input_field_list."+I+".value",rules:{required:F.is_required,message:F.source==="reference"?h.$t("views.tool.form.param.selectPlaceholder"):h.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",uue,[ee("div",cue,[ee("div",due,[k(b,{content:F.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(F.name),1)]),_:2},1032,["content"])]),F.desc?(Ne(),bt(O,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.desc),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):Bn("",!0),F.is_required?(Ne(),mn("span",fue,"*")):Bn("",!0),k(w,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(F.type),1)]),_:2},1024)])])]),default:j(()=>[F.source==="reference"?(Ne(),bt(Wo,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:h.$t("views.tool.form.param.selectPlaceholder"),modelValue:F.value,"onUpdate:modelValue":V=>F.value=V},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Ne(),bt(S,{key:1,modelValue:F.value,"onUpdate:modelValue":V=>F.value=V,placeholder:h.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Ne(),bt(T,{key:1,type:"info"},{default:j(()=>[ft(_e(h.$t("common.noData")),1)]),_:1}))]}),_:1}),k(M,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[1]||(v[1]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",pue,[ee("div",hue,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(O,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(D,{size:"small",modelValue:a.value.is_result,"onUpdate:modelValue":v[0]||(v[0]=B=>a.value.is_result=B)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class mue extends ai{constructor(t){super(t,vue)}}const gue={type:"tool-lib-node",model:li,view:mue},V8=Object.freeze(Object.defineProperty({__proto__:null,default:gue},Symbol.toStringTag,{value:"Module"})),yue={class:"title-decoration-1 mb-16"},_ue={class:"flex-between"},bue={class:"lighter mb-8"},wue={key:0},Eue={class:"flex-between"},xue={class:"flex align-center"},Oue={class:"mr-4"},Sue={key:1,class:"color-danger"},Aue={class:"lighter mb-8"},Mue={key:0,class:"mb-8"},Tue={class:"flex align-center"},Cue={class:"mr-4"},Nue=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=w=>w.ctrlKey===!0?(w.preventDefault(),!0):(w.stopPropagation(),!0),o=He(),r=He(),i={code:"",input_field_list:[],is_result:!1},a=He(null),s=He(!1),l=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",i),t.nodeModel.properties.node_data),set:w=>{Me.set(t.nodeModel.properties,"node_data",w)}}),f=He(),h=()=>{var w;return(w=f.value)==null?void 0:w.validate().catch(S=>Promise.reject({node:t.nodeModel,errMessage:S}))};function v(w){Me.set(t.nodeModel.properties.node_data,"code",w)}function b(w,S){typeof S<"u"&&(a.value=S),o.value.open(w)}function E(w){const S=Me.cloneDeep(t.nodeModel.properties.node_data.input_field_list);S.splice(w,1),Me.set(t.nodeModel.properties.node_data,"input_field_list",S)}function O(w){const S=Me.cloneDeep(t.nodeModel.properties.node_data.input_field_list),M={...w,value:w.source==="reference"?[]:""};a.value!==null?S.splice(a.value,1,M):S.push(M),Me.set(t.nodeModel.properties.node_data,"input_field_list",S),a.value=null}return bo(()=>{var w;typeof((w=t.nodeModel.properties.node_data)==null?void 0:w.is_result)>"u"&&Qd(t.nodeModel)&&Me.set(t.nodeModel.properties.node_data,"is_result",!0),Me.set(t.nodeModel,"validate",h),setTimeout(()=>{s.value=!0},100)}),(w,S)=>{const M=ne("AppIcon"),T=ne("el-button"),$=ne("auto-tooltip"),D=ne("el-tooltip"),P=ne("el-tag"),B=ne("el-input"),F=ne("el-form-item"),I=ne("el-text"),V=ne("el-card"),z=ne("CodemirrorEditor"),q=ne("el-switch"),X=ne("el-form");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",yue,_e(w.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",_ue,[ee("h5",bue,_e(w.$t("common.param.inputParam")),1),k(T,{link:"",type:"primary",onClick:S[0]||(S[0]=G=>b())},{default:j(()=>[k(M,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("common.add")),1)]),_:1})]),k(X,{onSubmit:S[4]||(S[4]=An(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:f,model:l.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(V,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var G;return[((G=l.value.input_field_list)==null?void 0:G.length)>0?(Ne(),mn("div",wue,[(Ne(!0),mn(Ir,null,No(l.value.input_field_list,(Q,J)=>(Ne(),bt(F,{key:J,label:Q.name,prop:"input_field_list."+J+".value",rules:{required:Q.is_required,message:Q.source==="reference"?w.$t("views.tool.form.param.selectPlaceholder"):w.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",Eue,[ee("div",xue,[ee("div",Oue,[k($,{content:Q.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(Q.name),1)]),_:2},1032,["content"])]),Q.desc?(Ne(),bt(D,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Q.desc),1)]),default:j(()=>[k(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):Bn("",!0),Q.is_required?(Ne(),mn("span",Sue,"*")):Bn("",!0),k(P,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(Q.type),1)]),_:2},1024)]),ee("div",null,[k(T,{text:"",onClick:An(ie=>b(Q,J),["stop"])},{default:j(()=>[k(M,{iconName:"app-edit"})]),_:1},8,["onClick"]),k(T,{text:"",onClick:ie=>E(J),style:{"margin-left":"4px !important"}},{default:j(()=>[k(M,{iconName:"app-delete"})]),_:1},8,["onClick"])])])]),default:j(()=>[Q.source==="reference"?(Ne(),bt(Wo,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:e.nodeModel,class:"w-full",placeholder:w.$t("views.tool.form.param.selectPlaceholder"),modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,width:100},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Ne(),bt(B,{key:1,modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:w.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Ne(),bt(I,{key:1,type:"info"},{default:j(()=>[ft(_e(w.$t("common.noData")),1)]),_:1}))]}),_:1}),ee("h5",Aue,_e(w.$t("views.tool.form.param.code")),1),s.value?(Ne(),mn("div",Mue,[k(z,{title:w.$t("views.tool.form.param.code"),modelValue:l.value.code,"onUpdate:modelValue":S[1]||(S[1]=G=>l.value.code=G),onWheel:n,style:{height:"130px !important"},onSubmitDialog:v},null,8,["title","modelValue"])])):Bn("",!0),k(F,{label:w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:S[3]||(S[3]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",Tue,[ee("div",Cue,[ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(D,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(q,{size:"small",modelValue:l.value.is_result,"onUpdate:modelValue":S[2]||(S[2]=G=>l.value.is_result=G)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"]),k(l7,{ref_key:"FieldFormDialogRef",ref:o,onRefresh:O},null,512)]),_:1},8,["nodeModel"])}}});class kue extends ai{constructor(t){super(t,Nue)}}const Pue={type:"tool-node",model:li,view:kue},G8=Object.freeze(Object.defineProperty({__proto__:null,default:Pue},Symbol.toStringTag,{value:"Module"})),Rue={class:"dialog-footer"},Due=_r({__name:"GroupFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:Pt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return t({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableAggregationNode.editGroup"):O.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",Rue,[k($,{onClick:An(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("common.variable"),prop:"field"},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),prop:"label"},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),jue={class:"title-decoration-1 mb-8"},Lue={class:"flex-between"},Iue={class:"flex-between mb-12"},Fue=["title"],Bue={class:"flex align-center",style:{"margin-right":"-3px"}},$ue=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(),r=He(),i={strategy:"first_non_null",group_list:[{id:yu(),label:"Group1",field:"Group1",variable_list:[{v_id:yu(),variable:[]}]}]},a=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",i),t.nodeModel.properties.node_data),set:M=>{Me.set(t.nodeModel.properties,"node_data",M)}}),s=He([]);function l(M,T){let $=null;M&&T!==void 0&&($={field:M.field,label:M.label}),r.value.open($,T)}function f(M,T){for(let D=0;D<s.value.length;D++)if(s.value[D].field===M.field&&T!==D){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+M.field);return}[void 0,null].includes(T)?(s.value.push(M),O(M)):(s.value.splice(T,1,M),h(M,T)),r.value.close();const $=[...s.value.map(D=>({label:D.label,value:D.field}))];Me.set(t.nodeModel.properties.config,"fields",$)}const h=(M,T)=>{const $=Me.cloneDeep(a.value.group_list);$[T].field=M.field,$[T].label=M.label,a.value.group_list=$},v=M=>{const T=Me.cloneDeep(a.value.group_list);T.splice(M,1),a.value.group_list=T,s.value.splice(M,1);const $=T.map(D=>({label:D.label,value:D.field}));Me.set(t.nodeModel.properties.config,"fields",$)},b=M=>{const T=Me.cloneDeep(a.value.group_list);T[M].variable_list.push({v_id:yu(),variable:[]}),a.value.group_list=T},E=(M,T)=>{const $=Me.cloneDeep(a.value.group_list);$[M].variable_list.splice(T,1),a.value.group_list=$},O=M=>{const T=Me.cloneDeep(a.value.group_list);T.push({id:yu(),field:M.field,label:M.label,variable_list:[{v_id:yu(),variable:[]}]}),a.value.group_list=T},w=async()=>{var T;const M=[...o.value.map($=>$.validate()),(T=n.value)==null?void 0:T.validate()];return Promise.all(M).catch($=>Promise.reject({node:t.nodeModel,errMessage:$}))};function S(M,T){const{oldIndex:$,newIndex:D}=M;if($===void 0||D===void 0)return;const P=Me.cloneDeep(t.nodeModel.properties.node_data.group_list[T].variable_list),B={...P[$]},F={...P[D]};P[D]=B,P[$]=F,Me.set(t.nodeModel.properties.node_data.group_list[T],"variable_list",P)}return bo(()=>{var T;typeof((T=t.nodeModel.properties.node_data)==null?void 0:T.is_result)>"u"&&Qd(t.nodeModel)&&Me.set(t.nodeModel.properties.node_data,"is_result",!0),Me.set(t.nodeModel,"validate",w),t.nodeModel.properties.node_data.group_list&&(s.value=a.value.group_list.map($=>({label:$.label,field:$.field})));const M=a.value.group_list.map($=>({label:$.label,value:$.field}));Me.set(t.nodeModel.properties.config,"fields",M)}),(M,T)=>{const $=ne("el-option"),D=ne("el-select"),P=ne("el-form-item"),B=ne("EditPen"),F=ne("el-icon"),I=ne("el-button"),V=ne("AppIcon"),z=ne("el-col"),q=ne("el-row"),X=ne("el-card"),G=ne("el-form");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",jue,_e(M.$t("views.applicationWorkflow.nodeSetting")),1),k(G,{onSubmit:T[2]||(T[2]=An(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableAggregationRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[k(P,{label:M.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"),rules:{required:!0,trigger:"change"}},{label:j(()=>[ee("div",Lue,[ee("div",null,[ee("span",null,[ft(_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"))+" ",1),T[3]||(T[3]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(D,{modelValue:a.value.strategy,"onUpdate:modelValue":T[0]||(T[0]=Q=>a.value.strategy=Q)},{default:j(()=>[k($,{label:Gn(Pt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder"),value:"first_non_null"},null,8,["label"]),k($,{label:Gn(Pt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder1"),value:"variable_to_json"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label"]),(Ne(!0),mn(Ir,null,No(a.value.group_list,(Q,J)=>(Ne(),mn("div",{key:Q.id,class:"mb-8"},[k(X,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[ee("div",Iue,[ee("span",{class:"ellipsis",title:Q.label},_e(Q.label),9,Fue),ee("div",Bue,[k(I,{onClick:ie=>l(Q,J),link:""},{default:j(()=>[k(F,null,{default:j(()=>[k(B)]),_:1})]),_:1},8,["onClick"]),k(I,{onClick:ie=>v(J),link:"",disabled:a.value.group_list.length<=1},{default:j(()=>[k(V,{iconName:"app-delete"})]),_:1},8,["onClick","disabled"])])]),k(Gn(Xj),{ref_for:!0,ref:"el",modelValue:Q.variable_list,disabled:Q.variable_list.length===1,handle:".handle",animation:150,ghostClass:"ghost",onEnd:ie=>S(ie,J)},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Q.variable_list,(ie,Se)=>(Ne(),mn("div",{key:ie.v_id,class:"drag-card"},[k(q,{class:"handle"},{default:j(()=>[k(z,{span:22,class:"flex"},{default:j(()=>[T[4]||(T[4]=ee("img",{src:Yj,alt:"",height:"15",class:"mr-4 mt-8"},null,-1)),k(P,{prop:`group_list.${J}.variable_list.${Se}.variable`,rules:{type:"array",required:!0,message:M.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Wo,{ref_for:!0,ref_key:"nodeCascaderRef",ref:o,nodeModel:e.nodeModel,style:{width:"200px"},placeholder:M.$t("views.applicationWorkflow.variable.placeholder"),modelValue:ie.variable,"onUpdate:modelValue":Ae=>ie.variable=Ae},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(z,{span:2},{default:j(()=>[k(I,{link:"",class:"mt-4 ml-4",disabled:Q.variable_list.length<=1,onClick:Ae=>E(J,Se)},{default:j(()=>[k(V,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024)]))),128))]),_:2},1032,["modelValue","disabled","onEnd"]),k(I,{onClick:ie=>b(J),type:"primary",size:"large",link:""},{default:j(()=>[k(V,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("common.add")),1)]),_:1},8,["onClick"])]),_:2},1024)]))),128)),k(I,{onClick:T[1]||(T[1]=Q=>l()),type:"primary",size:"large",link:""},{default:j(()=>[k(V,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup")),1)]),_:1})]),_:1},8,["model"]),k(Due,{ref_key:"GroupFieldDialogRef",ref:r,onRefresh:f},null,512)]),_:1},8,["nodeModel"])}}});class Uue extends ai{constructor(t){super(t,$ue)}getConfig(t){return t.model.properties.config}}const Vue={type:"variable-aggregation-node",model:li,view:Uue},W8=Object.freeze(Object.defineProperty({__proto__:null,default:Vue},Symbol.toStringTag,{value:"Module"})),Gue={class:"flex-between"},Wue={class:"flex-between mb-8"},zue={class:"lighter"},Hue={key:0,class:"flex w-full"},Xue=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("workflowMode"),n=e,o=["string","num","json","bool"],r=O=>O.ctrlKey===!0?(O.preventDefault(),!0):(O.stopPropagation(),!0),i={variable_list:[{id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""}]};He(1);const a=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",i),n.nodeModel.properties.node_data),set:O=>{Me.set(n.nodeModel.properties,"node_data",O)}}),s=He(),l=He(),f=He(),h=async()=>{var w;let O=[(w=s.value)==null?void 0:w.validate(),...l.value.map(S=>S.validate())];return f.value&&(O=[...O,...l.value.map(S=>S.validate())]),Promise.all(O).catch(S=>Promise.reject({node:n.nodeModel,errMessage:S}))};function v(){const O=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list),w={id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""};O.push(w),Me.set(n.nodeModel.properties.node_data,"variable_list",O)}function b(O){const w=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list);w.splice(O,1),Me.set(n.nodeModel.properties.node_data,"variable_list",w)}function E(O){(t==nc.ApplicationLoop?[...n.nodeModel.graphModel.nodes,...n.nodeModel.graphModel.get_parent_nodes()]:n.nodeModel.graphModel.nodes).map(w=>{w.id==="start-node"&&(w.properties.config.globalFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)}),w.properties.config.chatFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)})),w.id==="loop-start-node"&&w.properties.loop_input_field_list.forEach(S=>{S.field===O.fields[1]&&(O.name=S.label)})})}return bo(()=>{var O;typeof((O=n.nodeModel.properties.node_data)==null?void 0:O.is_result)>"u"&&Qd(n.nodeModel)&&Me.set(n.nodeModel.properties.node_data,"is_result",!0),Me.set(n.nodeModel,"validate",h)}),(O,w)=>{const S=ne("AppIcon"),M=ne("el-button"),T=ne("el-form-item"),$=ne("el-option"),D=ne("el-select"),P=ne("el-input"),B=ne("el-input-number"),F=ne("CodemirrorEditor"),I=ne("el-card"),V=ne("el-form");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[k(V,{onSubmit:w[0]||(w[0]=An(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(a.value.variable_list,(z,q)=>(Ne(),bt(I,{key:z.id,shadow:"never",class:"card-never mb-8",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(T,null,{label:j(()=>[ee("div",Gue,[ee("div",null,[ft(_e(O.$t("common.variable"))+" ",1),w[1]||(w[1]=ee("span",{class:"color-danger"},"*",-1))]),a.value.variable_list.length>1?(Ne(),bt(M,{key:0,text:"",onClick:X=>b(q)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])):Bn("",!0)])]),default:j(()=>[k(Wo,{ref_for:!0,ref_key:"nodeCascaderRef",ref:l,nodeModel:e.nodeModel,class:"w-full",placeholder:O.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.fields,"onUpdate:modelValue":X=>z.fields=X,global:!0,onChange:X=>E(z)},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),ee("div",Wue,[ee("span",zue,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableAssignNode.assign")),1),w[2]||(w[2]=ee("span",{class:"color-danger"},"*",-1))]),k(D,{teleported:!1,modelValue:z.source,"onUpdate:modelValue":X=>z.source=X,size:"small",style:{width:"85px"}},{default:j(()=>[k($,{label:O.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k($,{label:O.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"])]),z.source==="custom"?(Ne(),mn("div",Hue,[k(D,{modelValue:z.type,"onUpdate:modelValue":X=>z.type=X,style:{"max-width":"85px"},class:"mr-8",onChange:X=>{X==="bool"?a.value.variable_list[q].value=!0:a.value.variable_list[q].value=null}},{default:j(()=>[(Ne(),mn(Ir,null,No(o,X=>k($,{key:X,label:X,value:X},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),z.type==="string"?(Ne(),bt(T,{key:0,prop:"variable_list."+q+".value",rules:{message:Gn(Pt)("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(P,{modelValue:z.value,"onUpdate:modelValue":X=>z.value=X,placeholder:O.$t("common.inputPlaceholder"),"show-word-limit":"",clearable:"",onWheel:r},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])):z.type==="num"?(Ne(),bt(T,{key:1,prop:"variable_list."+q+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(B,{modelValue:z.value,"onUpdate:modelValue":X=>z.value=X},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):z.type==="json"?(Ne(),bt(T,{key:2,class:"w-full",prop:"variable_list."+q+".value",rules:[{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0},{validator:(X,G,Q)=>{try{JSON.parse(G),Q()}catch{Q(new Error("Invalid JSON format"))}},trigger:"blur"}]},{default:j(()=>[k(F,{title:"JSON",modelValue:z.value,"onUpdate:modelValue":X=>z.value=X,style:{height:"100px",width:"155px"},onSubmitDialog:X=>a.value.variable_list[q].value=X},null,8,["modelValue","onUpdate:modelValue","onSubmitDialog"])]),_:2},1032,["prop","rules"])):z.type==="bool"?(Ne(),bt(T,{key:3,prop:"variable_list."+q+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(D,{modelValue:z.value,"onUpdate:modelValue":X=>z.value=X,style:{width:"155px"}},{default:j(()=>[k($,{label:"true",value:!0}),k($,{label:"false",value:!1})]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):Bn("",!0)])):(Ne(),bt(T,{key:1},{default:j(()=>[k(Wo,{ref_for:!0,ref_key:"nodeCascaderRef2",ref:f,nodeModel:e.nodeModel,class:"w-full",placeholder:O.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.reference,"onUpdate:modelValue":X=>z.reference=X},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1024))]),_:2},1024))),128)),k(M,{link:"",type:"primary",onClick:v},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Yue extends ai{constructor(t){super(t,Xue)}}const que={type:"variable-assign-node",model:li,view:Yue},z8=Object.freeze(Object.defineProperty({__proto__:null,default:que},Symbol.toStringTag,{value:"Module"})),Kue={class:"flex align-center"},Zue={class:"mr-4"},Jue={class:"flex align-center"},Que={class:"mr-4"},ece={class:"flex align-center"},tce={class:"mr-4"},nce={class:"dialog-footer"},rce=_r({__name:"VariableFieldDialog",emits:["refresh"],setup(e,{expose:t,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),s=He(null),l=He({field:"",label:"",expression:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:Pt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}],expression:[{required:!0,message:Pt("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder"),trigger:"blur"}]}),h=He(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},b=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return t({open:v,close:b}),(O,w)=>{const S=ne("el-input"),M=ne("el-form-item"),T=ne("AppIcon"),$=ne("el-tooltip"),D=ne("el-form"),P=ne("el-button"),B=ne("el-dialog");return Ne(),bt(B,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableSplittingNode.editVariables"):O.$t("views.applicationWorkflow.nodes.variableSplittingNode.addVariables"),modelValue:h.value,"onUpdate:modelValue":w[4]||(w[4]=F=>h.value=F),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",nce,[k(P,{onClick:An(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(P,{type:"primary",onClick:w[3]||(w[3]=F=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(D,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(M,{prop:"field"},{label:j(()=>[ee("div",Kue,[ee("span",Zue,_e(O.$t("common.variable")),1),w[5]||(w[5]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=F=>l.value.field=F),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1}),k(M,{prop:"label"},{label:j(()=>[ee("div",Jue,[ee("span",Que,_e(O.$t("dynamicsForm.paramForm.name.label")),1),w[6]||(w[6]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=F=>l.value.label=F),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1}),k(M,{prop:"expression"},{label:j(()=>[ee("div",ece,[ee("span",tce,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.label"))+" ",1),w[7]||(w[7]=ee("span",{class:"color-danger"},"*",-1))]),k($,{effect:"dark",content:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.tooltip"),placement:"right"},{default:j(()=>[k(T,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[k(S,{modelValue:l.value.expression,"onUpdate:modelValue":w[2]||(w[2]=F=>l.value.expression=F),maxlength:64,"show-word-limit":"",placeholder:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),oce={class:"flex-between w-full"},ice={class:"break-all lighter"},ace={class:"ml-4",style:{"margin-top":"-4px"}},lce=["title"],sce=["title"],uce={class:"mr-4"},cce=_r({__name:"VariableFieldTable",props:{nodeModel:{}},setup(e){const t=e,n=He(),o=He(),r=He([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1);const f=[{label:Pt("common.result"),value:"result"},...r.value.map(h=>({label:h.label,value:h.field}))];Me.set(t.nodeModel.properties.config,"fields",f),t.nodeModel.clear_next_node_field(!1)}function s(l,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===l.field&&f!==v){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close();const h=[{label:Pt("common.result"),value:"result"},...r.value.map(v=>({label:v.label,value:v.field}))];Me.set(t.nodeModel.properties.config,"fields",h),t.nodeModel.clear_next_node_field(!1)}return bo(()=>{t.nodeModel.properties.node_data.variable_list&&(r.value=Me.cloneDeep(t.nodeModel.properties.node_data.variable_list)),Me.set(t.nodeModel.properties.node_data,"variable_list",r);const l=[{label:Pt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(t.nodeModel.properties.config,"fields",l)}),(l,f)=>{var w;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),E=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",oce,[ee("h5",ice,[ft(_e(l.$t("views.applicationWorkflow.nodes.variableSplittingNode.splitVariables"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",ace,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined"})]),_:1})])]),((w=t.nodeModel.properties.node_data.variable_list)==null?void 0:w.length)>0?(Ne(),bt(O,{key:0,data:t.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:j(()=>[k(b,{prop:"field",label:l.$t("common.variable"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,lce)]),_:1},8,["label"]),k(b,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,sce)]),_:1},8,["label"]),k(b,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",uce,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:An(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),k(rce,{ref_key:"VariableFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),dce={class:"title-decoration-1 mb-8"},fce={class:"flex-between"},pce=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=e,n={input_variable:[],variable_list:[]},o=hr({get:()=>(t.nodeModel.properties.node_data||Me.set(t.nodeModel.properties,"node_data",n),t.nodeModel.properties.node_data),set:a=>{Me.set(t.nodeModel.properties,"node_data",a)}}),r=He(),i=async()=>r.value.validate().catch(a=>Promise.reject({node:t.nodeModel,errMessage:a}));return bo(()=>{Me.set(t.nodeModel,"validate",i)}),(a,s)=>{const l=ne("el-form-item"),f=ne("el-form"),h=ne("el-card");return Ne(),bt(hi,{nodeModel:e.nodeModel},{default:j(()=>[ee("h5",dce,_e(a.$t("views.applicationWorkflow.nodeSetting")),1),k(h,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(f,{onSubmit:s[1]||(s[1]=An(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:r,"hide-required-asterisk":""},{default:j(()=>[k(l,{prop:"input_variable",rules:{message:a.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",fce,[ee("div",null,[ft(_e(a.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),s[2]||(s[2]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Wo,{ref:"nodeCascaderRef",nodeModel:e.nodeModel,class:"w-full",placeholder:a.$t("views.applicationWorkflow.variable.placeholder"),modelValue:o.value.input_variable,"onUpdate:modelValue":s[0]||(s[0]=v=>o.value.input_variable=v)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(l,{prop:"variable_list",rules:{message:a.$t("views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(cce,{ref:"VariableFieldTableRef","node-model":e.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class hce extends ai{constructor(t){super(t,pce)}getConfig(t){return t.model.properties.config}}const vce={type:"variable-splitting-node",model:li,view:hce},H8=Object.freeze(Object.defineProperty({__proto__:null,default:vce},Symbol.toStringTag,{value:"Module"})),mce={class:"title-decoration-1 mb-8"},gce={class:"flex-between w-full"},yce={class:"flex-between"},_ce={class:"flex align-center"},bce={class:"flex align-center"},wce={class:"mr-4"},Ece={class:"flex-between"},xce={class:"flex align-center"},Oce={class:"mr-4"},Sce=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=ml("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(null),s=He(),l=He(),f=He(),h=()=>{var I;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(I=l.value)==null?void 0:I.validate()]).catch(V=>Promise.reject({node:i.nodeModel,errMessage:V}))},v=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),E={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,video_list:["start-node","video"]},O=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",E),i.nodeModel.properties.node_data),set:I=>{Me.set(i.nodeModel.properties,"node_data",I)}}),w=t();function S(){var V;const I=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=w.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(I).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(I){Me.set(i.nodeModel.properties.node_data,"system",I)}function T(I){Me.set(i.nodeModel.properties.node_data,"prompt",I)}const $=I=>{var V;I&&((V=s.value)==null||V.open(I,o,O.value.model_params_setting))},D=He(),P=I=>{var V;I&&((V=D.value)==null||V.open(I,o))},B=I=>{Me.set(i.nodeModel.properties.node_data,"system",I)};function F(I){Me.set(i.nodeModel.properties.node_data,"model_params_setting",I)}return bo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(I,V)=>{const z=ne("AppIcon"),q=ne("el-button"),X=ne("ModelSelect"),G=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("MdEditorMagnify"),ie=ne("el-option"),Se=ne("el-select"),Ae=ne("el-input-number"),Pe=ne("el-switch"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{"node-model":e.nodeModel},{default:j(()=>[ee("h5",mce,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),k(ze,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:V[10]||(V[10]=An(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(G,{label:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",gce,[ee("div",null,[ee("span",null,[ft(_e(Gn(Pt)("views.applicationWorkflow.nodes.videoUnderstandNode.model.label")),1),V[11]||(V[11]=ee("span",{class:"color-danger"},"*",-1))])]),k(q,{disabled:!O.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=Ye=>$(O.value.model_id)),onRefreshForm:F},{default:j(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(X,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=Ye=>O.value.model_id=Ye),placeholder:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(G,null,{label:j(()=>[ee("div",yce,[ee("div",_ce,[ee("span",null,_e(I.$t("views.application.form.roleSettings.label")),1),k(Q,{effect:"dark",content:I.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(q,{type:"primary",link:"",onClick:V[2]||(V[2]=Ye=>P(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(J,{title:I.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":V[3]||(V[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Gn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Gn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(G,{label:I.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:I.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",bce,[ee("div",wce,[ee("span",null,[ft(_e(I.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=ee("span",{class:"color-danger"},"*",-1))])]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(J,{onWheel:v,title:I.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:T,placeholder:`${Gn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Gn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(G,null,{label:j(()=>[ee("div",Ece,[ee("div",null,_e(I.$t("views.application.form.historyRecord.label")),1),k(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[k(ie,{label:I.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(ie,{label:I.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[6]=Ye=>O.value.dialogue_number=Ye),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(G,{label:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label"),rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label")),1),V[13]||(V[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Wo,{ref_key:"nodeCascaderRef",ref:f,nodeModel:e.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),modelValue:O.value.video_list,"onUpdate:modelValue":V[7]||(V[7]=Ye=>O.value.video_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(G,{label:I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:V[9]||(V[9]=An(()=>{},["prevent"]))},{label:j(()=>[ee("div",xce,[ee("div",Oce,[ee("span",null,_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Pe,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(dp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:F},null,512),k(U2,{onReplace:B,ref_key:"GeneratePromptDialogRef",ref:D},null,512)]),_:1},8,["node-model"])}}});class Ace extends ai{constructor(t){super(t,Sce)}}const Mce={type:"video-understand-node",model:li,view:Ace},X8=Object.freeze(Object.defineProperty({__proto__:null,default:Mce},Symbol.toStringTag,{value:"Module"})),BR=_r({__name:"CustomLine",props:{model:{}},setup(e){const t=e,n=()=>{t.model.graphModel.deleteEdgeById(t.model.id)};return(o,r)=>Ql((Ne(),mn("div",{class:"custom-edge cursor",onMouseup:r[0]||(r[0]=An(()=>{},["stop"])),onClick:r[1]||(r[1]=An(()=>{},["stop"]))},[(Ne(),mn("svg",{onClick:n,width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...r[2]||(r[2]=[ee("path",{d:"M12 23.0001C5.925 23.0001 1 18.0751 1 12.0001C1 5.92512 5.925 1.00012 12 1.00012C18.075 1.00012 23 5.92512 23 12.0001C23 18.0751 18.075 23.0001 12 23.0001Z",fill:"#3370FF"},null,-1),ee("path",{d:"M9.02524 7.61124L12.0002 10.5862L14.9752 7.61124C15.069 7.5175 15.1962 7.46484 15.3287 7.46484C15.4613 7.46484 15.5885 7.5175 15.6822 7.61124L16.3892 8.31824C16.483 8.412 16.5356 8.53915 16.5356 8.67174C16.5356 8.80432 16.483 8.93147 16.3892 9.02524L13.4142 12.0002L16.3892 14.9752C16.483 15.069 16.5356 15.1962 16.5356 15.3287C16.5356 15.4613 16.483 15.5885 16.3892 15.6822L15.6822 16.3892C15.5885 16.483 15.4613 16.5356 15.3287 16.5356C15.1962 16.5356 15.069 16.483 14.9752 16.3892L12.0002 13.4142L9.02524 16.3892C8.93147 16.483 8.80432 16.5356 8.67174 16.5356C8.53916 16.5356 8.412 16.483 8.31824 16.3892L7.61124 15.6822C7.5175 15.5885 7.46484 15.4613 7.46484 15.3287C7.46484 15.1962 7.5175 15.069 7.61124 14.9752L10.5862 12.0002L7.61124 9.02524C7.5175 8.93147 7.46484 8.80432 7.46484 8.67174C7.46484 8.53915 7.5175 8.412 7.61124 8.31824L8.31824 7.61124C8.412 7.5175 8.53916 7.46484 8.67174 7.46484C8.80432 7.46484 8.93147 7.5175 9.02524 7.61124Z",fill:"white"},null,-1)])]))],544)),[[Eh,t.model.isHovered]])}});function Tce(e,t){const n=e.getBoundingClientRect();return t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom}const Cce=32,Nce=32;class kce extends Hu.BezierEdge{constructor(){super();hl(this,"isMounted");hl(this,"customLineApp");hl(this,"root");this.isMounted=!1,this.handleMouseUp=n=>{this.props.graphModel.clearSelectElements(),this.props.model.isSelected=!0;const o=n.target.parentNode.parentNode.querySelector(".lf-custom-edge-wrapper");Tce(o,n)&&this.props.model.graphModel.deleteEdgeById(this.props.model.id)}}renderVueComponent(n){var r;this.unmountVueComponent(),this.root=n;const{graphModel:o}=this.props;n&&(d1()?t8(this.targetId(),BR,n,this.props.model,o,(i,a)=>({model:i,graph:a})):(this.customLineApp=Lj({render:()=>Dg(BR,{model:this.props.model})}),(r=this.customLineApp)==null||r.mount(n)))}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}componentWillUnmount(){super.componentWillUnmount&&super.componentWillUnmount(),d1()&&n8(this.targetId()),this.unmountVueComponent()}unmountVueComponent(){return this.customLineApp&&(this.customLineApp.unmount(),this.customLineApp=null),this.root&&(this.root.innerHTML=""),this.root}getEdge(){const{model:n}=this.props,o=n.id,{customWidth:r=Cce,customHeight:i=Nce}=n.getProperties(),{startPoint:a,endPoint:s,path:l,isAnimation:f,arrowConfig:h}=n,v=n.getEdgeAnimationStyle(),{strokeDasharray:b,stroke:E,strokeDashoffset:O,animationName:w,animationDuration:S,animationIterationCount:M,animationTimingFunction:T,animationDirection:$}=v,D={x:(a.x+s.x-r)/2,y:(a.y+s.y-i)/2,width:r,height:i},P=n.getEdgeStyle(),B={width:r,height:i};return setTimeout(()=>{const F=document.getElementById(o);F&&!this.isMounted&&(this.isMounted=!0,this.renderVueComponent(F))},0),delete P.stroke,Hu.h("g",{},[Hu.h("style",{type:"text/css"},".lf-edge{stroke:#afafaf}.lf-edge:hover{stroke: #3370FF;}"),Hu.h("path",{d:l,...P,...h,...f?{strokeDasharray:b,stroke:E,style:{strokeDashoffset:O,animationName:w,animationDuration:S,animationIterationCount:M,animationTimingFunction:T,animationDirection:$}}:{}}),Hu.h("foreignObject",{...D,y:D.y+5,x:D.x+5,style:{}},[Hu.h("div",{id:o,style:{...B},className:"lf-custom-edge-wrapper"})])])}}let Pce=class extends Hu.BezierEdgeModel{getArrowStyle(){const t=super.getArrowStyle();return t.offset=1,t.verticalLength=0,t}getEdgeStyle(){const t=super.getEdgeStyle();return t.strokeWidth=2,t.stroke="#BBBFC4",t.offset=0,t}getData(){const t=super.getData();return t&&(t.sourceAnchorId=this.sourceAnchorId,t.targetAnchorId=this.targetAnchorId),t}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(i=>i.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(i=>i.id===this.targetAnchorId);if(n&&r){const i={x:n.x,y:n.y};this.updateStartPoint(i);const a={x:r.x,y:r.y};this.updateEndPoint(a)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}};const Y8={type:"app-edge",view:kce,model:Pce};class Rce{constructor(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=()=>{}}layout(t){return this.init(t),this.execute(!0)}init(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]}execute(t){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(t){t&&Object.assign(this,t)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}}const Dce=e=>typeof e=="string",$R=Array.isArray,g1=e=>typeof e=="number",q8=e=>e!==null&&typeof e=="object",y1=e=>{if(e===null)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){const t=[];return e.forEach(n=>{t.push(n)}),t.map(n=>y1(n))}if(typeof e=="object"&&Object.keys(e).length){const t=Object.assign({},e);return Object.keys(t).forEach(n=>{t[n]=y1(t[n])}),t}return e},cg=(e,t)=>{const n=e[t];return q8(n)?n.cell:n},UR=(e,t,n)=>{let o;return n?o=n:g1(e)?o=()=>e:o=()=>t,o},jce=(e,t)=>{if(e!=="next"&&e!=="prev")return t},VR=e=>{e.prev.next=e.next,e.next.prev=e.prev,delete e.next,delete e.prev};let Lce=class{constructor(){const t={};t.prev=t,t.next=t.prev,this.shortcut=t}dequeue(){const t=this.shortcut,n=t.prev;if(n&&n!==t)return VR(n),n}enqueue(t){const n=this.shortcut;t.prev&&t.next&&VR(t),t.next=n.next,n.next.prev=t,n.next=t,t.prev=n}toString(){const t=[],n=this.shortcut;let o=n.prev;for(;o!==n;)t.push(JSON.stringify(o,jce)),o=o==null?void 0:o.prev;return`[${t.join(", ")}]`}};var Mg;(function(e){e.DEFAULT_EDGE_NAME="\0",e.GRAPH_NODE="\0",e.EDGE_KEY_DELIM=""})(Mg||(Mg={}));function GR(e,t){var n=e.get(t)||0;e.set(t,n+1)}function WR(e,t){var n=e.get(t);n!==void 0&&(n=n-1,n>0?e.set(t,n):e.delete(t))}function K8(e,t,n,o){var r=String(t),i=String(n);if(!e&&r>i){var a=r;r=i,i=a}return r+Mg.EDGE_KEY_DELIM+i+Mg.EDGE_KEY_DELIM+(o===void 0?Mg.DEFAULT_EDGE_NAME:o)}function zR(e,t,n,o){var r=String(t),i=String(n),a={v:t,w:n};if(!e&&r>i){var s=a.v;a.v=a.w,a.w=s}return o!==void 0&&(a.name=o),a}function kS(e,t){return K8(e,t.v,t.w,t.name)}function HR(e){return typeof e=="function"}var Ice=function(t){return t.nodes().map(function(n){var o=t.node(n),r=t.parent(n),i={id:n,value:o,parent:r};return i.value===void 0&&delete i.value,i.parent===void 0&&delete i.parent,i})},Fce=function(t){return t.edges().map(function(n){var o=t.edge(n),r={v:n.v,w:n.w,value:o,name:n.name};return r.name===void 0&&delete r.name,r.value===void 0&&delete r.value,r})},Bce=function(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Ice(t),edges:Fce(t),value:t.graph()};return n.value===void 0&&delete n.value,n},$ce=function(t){var n=new sb(t.options);return t.value!==void 0&&n.setGraph(t.value),t.nodes.forEach(function(o){n.setNode(o.id,o.value),o.parent&&n.setParent(o.id,o.parent)}),t.edges.forEach(function(o){n.setEdge(o.v,o.w,o.value,o.name)}),n};function XR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function YR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XR(Object(n),!0).forEach(function(o){Uce(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XR(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Uce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gce(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Wce(e,t,n){return t&&Gce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var zce={compound:!1,multigraph:!1,directed:!0},sb=(function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vce(this,e),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=Mg.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return t.directed},this.isMultigraph=function(){return t.multigraph},this.isCompound=function(){return t.compound},this.setGraph=function(r){return t.label=r,t},this.graph=function(){return t.label},this.setDefaultNodeLabel=function(r){return HR(r)?t.defaultNodeLabelFn=r:t.defaultNodeLabelFn=function(){return r},t},this.nodeCount=function(){return t.nodeCountNum},this.node=function(r){return t.nodesLabelMap.get(r)},this.nodes=function(){return Array.from(t.nodesLabelMap.keys())},this.sources=function(){return t.nodes().filter(function(r){var i;return!(!((i=t.inEdgesMap.get(r))===null||i===void 0)&&i.size)})},this.sinks=function(){return t.nodes().filter(function(r){var i;return!(!((i=t.outEdgesMap.get(r))===null||i===void 0)&&i.size)})},this.setNodes=function(r,i){return r.map(function(a){return t.setNode(a,i)}),t},this.hasNode=function(r){return t.nodesLabelMap.has(r)},this.checkCompound=function(){if(!t.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(r){if(t.isCompound()){var i,a=(i=t.parentMap)===null||i===void 0?void 0:i.get(r);if(a!==t.GRAPH_NODE)return a}},this.removeFromParentsChildList=function(r){var i=t.parentMap.get(r);t.childrenMap.get(i).delete(r)},this.setParent=function(r,i){var a,s;t.checkCompound();for(var l=i===void 0?t.GRAPH_NODE:i,f=t.parent(l);f;){if(r===f)throw new Error("Setting "+i+" as parent of "+r+" would create a cycle");f=t.parent(f)}i&&t.setNode(i),t.setNode(r),t.removeFromParentsChildList(r),(a=t.parentMap)===null||a===void 0||a.set(r,l);var h=t.childrenMap.get(l);return h.set(r,!0),(s=t.childrenMap)===null||s===void 0||s.set(l,h),t},this.children=function(r){var i=r===void 0?t.GRAPH_NODE:r;if(t.isCompound()){var a,s=(a=t.childrenMap)===null||a===void 0?void 0:a.get(i);return s?Array.from(s.keys()):void 0}if(i===t.GRAPH_NODE)return t.nodes();if(r&&t.hasNode(r))return[]},this.predecessors=function(r){var i=t.predecessorsMap.get(r);return i?Array.from(i.keys()):void 0},this.successors=function(r){var i=t.successorsMap.get(r);return i?Array.from(i.keys()):void 0},this.neighbors=function(r){var i;if(t.hasNode(r))return Array.from(new Set((i=t.predecessors(r))===null||i===void 0?void 0:i.concat(t.successors(r))))},this.isLeaf=function(r){var i;if(t.isDirected()){var a;return!(!((a=t.successors(r))===null||a===void 0)&&a.length)}return!(!((i=t.neighbors(r))===null||i===void 0)&&i.length)},this.filterNodes=function(r){var i=t.directed,a=t.multigraph,s=t.compound,l=new e({directed:i,multigraph:a,compound:s});if(l.setGraph(t.graph()),t.nodes().forEach(function(h){r(h)&&l.setNode(h,t.node(h))}),t.edges().forEach(function(h){l.hasNode(h.v)&&l.hasNode(h.w)&&l.setEdgeObj(h,t.edge(h))}),s){var f=function(v){for(var b=t.parent(v);b!==void 0&&!l.hasNode(b);)b=t.parent(b);return b};l.nodes().forEach(function(h){l.setParent(h,f(h))})}return l},this.setDefaultEdgeLabel=function(r){return HR(r)?t.defaultEdgeLabelFn=r:t.defaultEdgeLabelFn=function(){return r},t},this.edgeCount=function(){return t.edgeCountNum},this.setEdgeObj=function(r,i){return t.setEdge(r.v,r.w,i,r.name)},this.setPath=function(r,i){return r.reduce(function(a,s){return t.setEdge(a,s,i),s}),t},this.edgeFromArgs=function(r,i,a){return t.edge({v:r,w:i,name:a})},this.edge=function(r){return t.edgesLabelsMap.get(kS(t.isDirected(),r))},this.hasEdge=function(r,i,a){return t.edgesLabelsMap.has(kS(t.isDirected(),{v:r,w:i,name:a}))},this.removeEdgeObj=function(r){var i=r.v,a=r.w,s=r.name;return t.removeEdge(i,a,s)},this.edges=function(){return Array.from(t.edgesMap.values())},this.inEdges=function(r,i){var a=t.inEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(s){return!i||s.v===i})},this.outEdges=function(r,i){var a=t.outEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(s){return!i||s.w===i})},this.nodeEdges=function(r,i){var a;if(t.hasNode(r))return(a=t.inEdges(r,i))===null||a===void 0?void 0:a.concat(t.outEdges(r,i))},this.toJSON=function(){return Bce(t)},this.nodeInDegree=function(r){var i=t.inEdgesMap.get(r);return i?i.size:0},this.nodeOutDegree=function(r){var i=t.outEdgesMap.get(r);return i?i.size:0},this.nodeDegree=function(r){return t.nodeInDegree(r)+t.nodeOutDegree(r)},this.source=function(r){return r.v},this.target=function(r){return r.w};var o=YR(YR({},zce),n);this.compound=o.compound,this.directed=o.directed,this.multigraph=o.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return Wce(e,[{key:"setNode",value:function(n,o){var r=this.nodesLabelMap,i=this.defaultNodeLabelFn,a=this.isCompound,s=this.parentMap,l=this.childrenMap,f=this.inEdgesMap,h=this.outEdgesMap,v=this.predecessorsMap,b=this.successorsMap;if(r.has(n))return o!==void 0&&r.set(n,o),this;if(r.set(n,o||i(n)),a()){var E;s==null||s.set(n,this.GRAPH_NODE),l==null||l.set(n,new Map),l!=null&&l.has(this.GRAPH_NODE)||l==null||l.set(this.GRAPH_NODE,new Map),l==null||(E=l.get(this.GRAPH_NODE))===null||E===void 0||E.set(n,!0)}return[f,h,v,b].forEach(function(O){return O.set(n,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(n){var o=this;if(this.hasNode(n)){var r=function(S){o.removeEdge(S.v,S.w,S.name)},i=this.inEdgesMap,a=this.outEdgesMap,s=this.predecessorsMap,l=this.successorsMap,f=this.nodesLabelMap;if(this.isCompound()){var h,v,b;this.removeFromParentsChildList(n),(h=this.parentMap)===null||h===void 0||h.delete(n),(v=this.children(n))===null||v===void 0||v.forEach(function(w){return o.setParent(w)}),(b=this.childrenMap)===null||b===void 0||b.delete(n)}var E=i.get(n),O=a.get(n);Array.from(E.values()).forEach(function(w){return r(w)}),Array.from(O.values()).forEach(function(w){return r(w)}),f.delete(n),i.delete(n),a.delete(n),s.delete(n),l.delete(n),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(n,o,r,i){var a,s,l=zR(this.isDirected(),n,o,i),f=kS(this.isDirected(),l),h=l.v,v=l.w;if(this.edgesLabelsMap.has(f))return this.edgesLabelsMap.set(f,r),this;if(i!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(v),this.edgesLabelsMap.set(f,r||this.defaultEdgeLabelFn(h,v,i)),Object.freeze(l),this.edgesMap.set(f,l);var b=this.predecessorsMap.get(v),E=this.successorsMap.get(h);return GR(b,h),GR(E,v),(a=this.inEdgesMap.get(v))===null||a===void 0||a.set(f,l),(s=this.outEdgesMap.get(h))===null||s===void 0||s.set(f,l),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(n,o,r){var i=K8(this.isDirected(),n,o,r),a=this.edgesMap.get(i);if(a){var s=zR(this.isDirected(),n,o,r),l=s.v,f=s.w;this.edgesLabelsMap.delete(i),this.edgesMap.delete(i);var h=this.predecessorsMap.get(f),v=this.successorsMap.get(l);WR(h,l),WR(v,f),this.inEdgesMap.get(f).delete(i),this.outEdgesMap.get(l).delete(i),this.edgeCountNum-=1}return this}}]),e})();sb.fromJSON=$ce;var Hce=function e(t,n,o,r,i,a){r.includes(n)||(r.push(n),o||a.push(n),i(n).forEach(function(s){return e(t,s,o,r,i,a)}),o&&a.push(n))},$M=function(t,n,o){var r=Array.isArray(n)?n:[n],i=function(f){return t.isDirected()?t.successors(f):t.neighbors(f)},a=[],s=[];return r.forEach(function(l){if(t.hasNode(l))Hce(t,l,o==="post",s,i,a);else throw new Error("Graph does not have node: "+l)}),a},Xce=function(t,n){return $M(t,n,"post")},Yce=function(t,n){return $M(t,n,"pre")};const qce=Object.freeze(Object.defineProperty({__proto__:null,dfs:$M,postorder:Xce,preorder:Yce},Symbol.toStringTag,{value:"Module"}));class Kce extends Lce{}class Zce extends sb{}const Jce=()=>1,Qce=(e,t)=>{var n;if(e.nodeCount()<=1)return[];const o=tde(e,t||Jce);return(n=ede(o.graph,o.buckets,o.zeroIdx).map(i=>e.outEdges(i.v,i.w)))===null||n===void 0?void 0:n.flat()},ede=(e,t,n)=>{let o=[];const r=t[t.length-1],i=t[0];let a;for(;e.nodeCount();){for(;a=i.dequeue();)PS(e,t,n,a);for(;a=r.dequeue();)PS(e,t,n,a);if(e.nodeCount()){for(let s=t.length-2;s>0;--s)if(a=t[s].dequeue(),a){o=o.concat(PS(e,t,n,a,!0));break}}}return o},PS=(e,t,n,o,r)=>{var i,a;const s=[];return(i=e.inEdges(o.v))===null||i===void 0||i.forEach(l=>{const f=e.edge(l),h=e.node(l.v);r&&s.push({v:l.v,w:l.w,in:0,out:0}),h.out===void 0&&(h.out=0),h.out-=f,b2(t,n,h)}),(a=e.outEdges(o.v))===null||a===void 0||a.forEach(l=>{const f=e.edge(l),h=l.w,v=e.node(h);v.in===void 0&&(v.in=0),v.in-=f,b2(t,n,v)}),e.removeNode(o.v),r?s:void 0},tde=(e,t)=>{const n=new Zce;let o=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{const f=n.edge(l)||0,h=(t==null?void 0:t(l))||1,v=f+h;n.setEdge(l.v,l.w,v),r=Math.max(r,n.node(l.v).out+=h),o=Math.max(o,n.node(l.w).in+=h)});const i=[],a=r+o+3;for(let l=0;l<a;l++)i.push(new Kce);const s=o+1;return n.nodes().forEach(l=>{b2(i,s,n.node(l))}),{buckets:i,zeroIdx:s,graph:n}},b2=(e,t,n)=>{n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)},nde=e=>{const t=o=>r=>{var i;return((i=o.edge(r))===null||i===void 0?void 0:i.weight)||1},n=e.graph().acyclicer==="greedy"?Qce(e,t(e)):rde(e);n==null||n.forEach(o=>{const r=e.edge(o);e.removeEdgeObj(o),r.forwardName=o.name,r.reversed=!0,e.setEdge(o.w,o.v,r,`rev-${Math.random()}`)})},rde=e=>{const t=[],n={},o={},r=i=>{var a;o[i]||(o[i]=!0,n[i]=!0,(a=e.outEdges(i))===null||a===void 0||a.forEach(s=>{n[s.w]?t.push(s):r(s.w)}),delete n[i])};return e.nodes().forEach(r),t},ode=e=>{e.edges().forEach(t=>{const n=e.edge(t);if(n.reversed){e.removeEdgeObj(t);const o=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,o)}})},qR={run:nde,undo:ode};class cp extends sb{}const ide=(e,t)=>Number(e)-Number(t),uy=(e,t,n,o)=>{let r;do r=`${o}${Math.random()}`;while(e.hasNode(r));return n.dummy=t,e.setNode(r,n),r},ade=e=>{const t=new cp().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{const o=t.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:o.weight+r.weight,minlen:Math.max(o.minlen,r.minlen)})}),t},Z8=e=>{const t=new cp({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{var o;!((o=e.children(n))===null||o===void 0)&&o.length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdgeObj(n,e.edge(n))}),t},lde=(e,t)=>e==null?void 0:e.reduce((n,o,r)=>(n[o]=t[r],n),{}),KR=(e,t)=>{const n=Number(e.x),o=Number(e.y),r=Number(t.x)-n,i=Number(t.y)-o;let a=Number(e.width)/2,s=Number(e.height)/2;if(!r&&!i)return{x:0,y:0};let l,f;return Math.abs(i)*a>Math.abs(r)*s?(i<0&&(s=-s),l=s*r/i,f=s):(r<0&&(a=-a),l=a,f=a*i/r),{x:n+l,y:o+f}},U_=e=>{const t=[],n=J8(e)+1;for(let o=0;o<n;o++)t.push([]);e.nodes().forEach(o=>{const r=e.node(o);if(!r)return;const i=r.rank;i!==void 0&&t[i]&&t[i].push(o)});for(let o=0;o<n;o++)t[o]=t[o].sort((r,i)=>{var a,s;return ide((a=e.node(r))===null||a===void 0?void 0:a.order,(s=e.node(i))===null||s===void 0?void 0:s.order)});return t},sde=e=>{const t=e.nodes().filter(o=>{var r;return((r=e.node(o))===null||r===void 0?void 0:r.rank)!==void 0}).map(o=>e.node(o).rank),n=Math.min(...t);e.nodes().forEach(o=>{const r=e.node(o);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)})},ude=e=>{const t=e.nodes(),n=t.filter(s=>{var l;return((l=e.node(s))===null||l===void 0?void 0:l.rank)!==void 0}).map(s=>e.node(s).rank),o=Math.min(...n),r=[];t.forEach(s=>{var l;const f=(((l=e.node(s))===null||l===void 0?void 0:l.rank)||0)-o;r[f]||(r[f]=[]),r[f].push(s)});let i=0;const a=e.graph().nodeRankFactor||0;for(let s=0;s<r.length;s++){const l=r[s];l===void 0?s%a!==0&&(i-=1):i&&(l==null||l.forEach(f=>{const h=e.node(f);h&&(h.rank=h.rank||0,h.rank+=i)}))}},ZR=(e,t,n,o)=>{const r={width:0,height:0};return g1(n)&&g1(o)&&(r.rank=n,r.order=o),uy(e,"border",r,t)},J8=e=>{let t;return e.nodes().forEach(n=>{var o;const r=(o=e.node(n))===null||o===void 0?void 0:o.rank;r!==void 0&&(t===void 0||r>t)&&(t=r)}),t||(t=0),t},cde=(e,t)=>{const n={lhs:[],rhs:[]};return e==null||e.forEach(o=>{t(o)?n.lhs.push(o):n.rhs.push(o)}),n},Q8=(e,t)=>{const n=Date.now();try{return t()}finally{console.log(`${e} time: ${Date.now()-n}ms`)}},e4=(e,t)=>t(),UM=(e,t)=>e.reduce((n,o)=>{const r=t(n),i=t(o);return r>i?o:n}),dde=e=>{e.graph().dummyChains=[],e.edges().forEach(t=>fde(e,t))},fde=(e,t)=>{let n=t.v,o=e.node(n).rank;const r=t.w,i=e.node(r).rank,a=t.name,s=e.edge(t),l=s.labelRank;if(i===o+1)return;e.removeEdgeObj(t);const f=e.graph();let h,v,b;for(b=0,++o;o<i;++b,++o)s.points=[],v={edgeLabel:s,width:0,height:0,edgeObj:t,rank:o},h=uy(e,"edge",v,"_d"),o===l&&(v.width=s.width,v.height=s.height,v.dummy="edge-label",v.labelpos=s.labelpos),e.setEdge(n,h,{weight:s.weight},a),b===0&&(f.dummyChains||(f.dummyChains=[]),f.dummyChains.push(h)),n=h;e.setEdge(n,r,{weight:s.weight},a)},pde=e=>{var t;(t=e.graph().dummyChains)===null||t===void 0||t.forEach(n=>{let o=e.node(n);const r=o.edgeLabel;let i;o.edgeObj&&e.setEdgeObj(o.edgeObj,r);let a=n;for(;o.dummy;)i=e.successors(a)[0],e.removeNode(a),r.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(r.x=o.x,r.y=o.y,r.width=o.width,r.height=o.height),a=i,o=e.node(a)})},JR={run:dde,undo:pde},t4=e=>{var t;const n={},o=r=>{var i;const a=e.node(r);if(!a)return 0;if(n[r])return a.rank;n[r]=!0;let s;return(i=e.outEdges(r))===null||i===void 0||i.forEach(l=>{const f=o(l.w),h=e.edge(l).minlen,v=f-h;v&&(s===void 0||v<s)&&(s=v)}),s||(s=0),a.rank=s,s};(t=e.sources())===null||t===void 0||t.forEach(r=>o(r))},hde=e=>{var t;const n={};let o;const r=s=>{var l;const f=e.node(s);if(!f)return 0;if(n[s])return f.rank;n[s]=!0;let h;return(l=e.outEdges(s))===null||l===void 0||l.forEach(v=>{const b=r(v.w),E=e.edge(v).minlen,O=b-E;O&&(h===void 0||O<h)&&(h=O)}),h||(h=0),(o===void 0||h<o)&&(o=h),f.rank=h,h};(t=e.sources())===null||t===void 0||t.forEach(s=>{e.node(s)&&r(s)}),o===void 0&&(o=0);const i={},a=(s,l)=>{var f;const h=e.node(s),v=isNaN(h.layer)?l:h.layer;(h.rank===void 0||h.rank<v)&&(h.rank=v),!i[s]&&(i[s]=!0,(f=e.outEdges(s))===null||f===void 0||f.map(b=>{a(b.w,v+e.edge(b).minlen)}))};e.nodes().forEach(s=>{const l=e.node(s);l&&(isNaN(l.layer)?l.rank-=o:a(s,l.layer))})},Ch=(e,t)=>e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen,vde=e=>{const t=new cp({directed:!1}),n=e.nodes()[0],o=e.nodeCount();t.setNode(n,{});let r,i;for(;mde(t,e)<o;)r=n4(t,e),i=t.hasNode(r.v)?Ch(e,r):-Ch(e,r),r4(t,e,i);return t},mde=(e,t)=>{const n=o=>{t.nodeEdges(o).forEach(r=>{const i=r.v,a=o===i?r.w:i;!e.hasNode(a)&&!Ch(t,r)&&(e.setNode(a,{}),e.setEdge(o,a,{}),n(a))})};return e.nodes().forEach(n),e.nodeCount()},gde=e=>{const t=new cp({directed:!1}),n=e.nodes()[0],o=e.nodes().filter(a=>!!e.node(a)).length;t.setNode(n,{});let r,i;for(;yde(t,e)<o;)r=n4(t,e),i=t.hasNode(r.v)?Ch(e,r):-Ch(e,r),r4(t,e,i);return t},yde=(e,t)=>{const n=o=>{var r;(r=t.nodeEdges(o))===null||r===void 0||r.forEach(i=>{const a=i.v,s=o===a?i.w:a;!e.hasNode(s)&&(t.node(s).layer!==void 0||!Ch(t,i))&&(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))})};return e.nodes().forEach(n),e.nodeCount()},n4=(e,t)=>UM(t.edges(),n=>e.hasNode(n.v)!==e.hasNode(n.w)?Ch(t,n):1/0),r4=(e,t,n)=>{e.nodes().forEach(o=>{t.node(o).rank||(t.node(o).rank=0),t.node(o).rank+=n})},{preorder:_de,postorder:bde}=qce,wde=e=>{const t=ade(e);t4(t);const n=vde(t);i4(n),o4(n,t);let o,r;for(;o=Ode(n);)r=Sde(n,t,o),Ade(n,t,o,r)},o4=(e,t)=>{let n=bde(e,e.nodes());n=n==null?void 0:n.slice(0,(n==null?void 0:n.length)-1),n==null||n.forEach(o=>{Ede(e,t,o)})},Ede=(e,t,n)=>{const r=e.node(n).parent;e.edgeFromArgs(n,r).cutvalue=xde(e,t,n)},xde=(e,t,n)=>{var o;const i=e.node(n).parent;let a=!0,s=t.edgeFromArgs(n,i),l=0;return s||(a=!1,s=t.edgeFromArgs(i,n)),l=s.weight,(o=t.nodeEdges(n))===null||o===void 0||o.forEach(f=>{const h=f.v===n,v=h?f.w:f.v;if(v!==i){const b=h===a,E=t.edge(f).weight;if(l+=b?E:-E,Tde(e,n,v)){const O=e.edgeFromArgs(n,v).cutvalue;l+=b?-O:O}}}),l},i4=(e,t=e.nodes()[0])=>{a4(e,{},1,t)},a4=(e,t,n,o,r)=>{var i;const a=n;let s=n;const l=e.node(o);return t[o]=!0,(i=e.neighbors(o))===null||i===void 0||i.forEach(f=>{t[f]||(s=a4(e,t,s,f,o))}),l.low=a,l.lim=s++,r?l.parent=r:delete l.parent,s},Ode=e=>e.edges().find(t=>e.edge(t).cutvalue<0),Sde=(e,t,n)=>{let o=n.v,r=n.w;t.hasEdge(o,r)||(o=n.w,r=n.v);const i=e.node(o),a=e.node(r);let s=i,l=!1;i.lim>a.lim&&(s=a,l=!0);const f=t.edges().filter(h=>l===QR(e,e.node(h.v),s)&&l!==QR(e,e.node(h.w),s));return UM(f,h=>Ch(t,h))},Ade=(e,t,n,o)=>{const r=n.v,i=n.w;e.removeEdge(r,i),e.setEdge(o.v,o.w,{}),i4(e),o4(e,t),Mde(e,t)},Mde=(e,t)=>{const n=e.nodes().find(r=>{var i;return!(!((i=t.node(r))===null||i===void 0)&&i.parent)});let o=_de(e,n);o=o==null?void 0:o.slice(1),o==null||o.forEach(r=>{const i=e.node(r).parent;let a=t.edgeFromArgs(r,i),s=!1;a||(a=t.edgeFromArgs(i,r),s=!0),t.node(r).rank=t.node(i).rank+(s?a.minlen:-a.minlen)})},Tde=(e,t,n)=>e.hasEdge(t,n),QR=(e,t,n)=>n.low<=t.lim&&t.lim<=n.lim,Cde=e=>{switch(e.graph().ranker){case"network-simplex":kde(e);break;case"tight-tree":eD(e);break;case"longest-path":Nde(e);break;default:eD(e)}},Nde=t4,eD=e=>{hde(e),gde(e)},kde=e=>{wde(e)},Pde=e=>{var t;const n={};let o=0;const r=i=>{var a;const s=o;(a=e.children(i))===null||a===void 0||a.forEach(r),n[i]={low:s,lim:o++}};return(t=e.children())===null||t===void 0||t.forEach(r),n},Rde=(e,t,n,o)=>{const r=[],i=[],a=Math.min(t[n].low,t[o].low),s=Math.max(t[n].lim,t[o].lim);let l,f;l=n;do l=e.parent(l),r.push(l);while(l&&(t[l].low>a||s>t[l].lim));for(f=l,l=o;l&&l!==f;)i.push(l),l=e.parent(l);return{lca:f,path:r.concat(i.reverse())}},Dde=e=>{var t;const n=Pde(e);(t=e.graph().dummyChains)===null||t===void 0||t.forEach(o=>{var r,i;let a=o,s=e.node(a);const l=s.edgeObj;if(!l)return;const f=Rde(e,n,l.v,l.w),h=f.path,v=f.lca;let b=0,E=h[b],O=!0;for(;a!==l.w;){if(s=e.node(a),O){for(;E!==v&&((r=e.node(E))===null||r===void 0?void 0:r.maxRank)<s.rank;)b++,E=h[b];E===v&&(O=!1)}if(!O){for(;b<h.length-1&&((i=e.node(h[b+1]))===null||i===void 0?void 0:i.minRank)<=s.rank;)b++;E=h[b]}e.setParent(a,E),a=e.successors(a)[0]}})},jde=e=>{var t;const n=uy(e,"root",{},"_root"),o=Lde(e);let r=Math.max(...Object.values(o));Math.abs(r)===1/0&&(r=1);const i=r-1,a=2*i+1;e.graph().nestingRoot=n,e.edges().forEach(l=>{e.edge(l).minlen*=a});const s=Ide(e)+1;(t=e.children())===null||t===void 0||t.forEach(l=>{l4(e,n,a,s,i,o,l)}),e.graph().nodeRankFactor=a},l4=(e,t,n,o,r,i,a)=>{const s=e.children(a);if(!(s!=null&&s.length)){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}const l=ZR(e,"_bt"),f=ZR(e,"_bb"),h=e.node(a);e.setParent(l,a),h.borderTop=l,e.setParent(f,a),h.borderBottom=f,s==null||s.forEach(v=>{l4(e,t,n,o,r,i,v);const b=e.node(v),E=b.borderTop?b.borderTop:v,O=b.borderBottom?b.borderBottom:v,w=b.borderTop?o:2*o,S=E!==O?1:r-i[a]+1;e.setEdge(l,E,{minlen:S,weight:w,nestingEdge:!0}),e.setEdge(O,f,{minlen:S,weight:w,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,l,{weight:0,minlen:r+i[a]})},Lde=e=>{var t;const n={},o=(r,i)=>{const a=e.children(r);a==null||a.forEach(s=>o(s,i+1)),n[r]=i};return(t=e.children())===null||t===void 0||t.forEach(r=>o(r,1)),n},Ide=e=>{let t=0;return e.edges().forEach(n=>{t+=e.edge(n).weight}),t},Fde=e=>{const t=e.graph();t.nestingRoot&&e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdgeObj(n)})},tD={run:jde,cleanup:Fde},Bde=e=>{var t;const n=o=>{const r=e.children(o),i=e.node(o);if(r!=null&&r.length&&r.forEach(a=>n(a)),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(let a=i.minRank,s=i.maxRank+1;a<s;a+=1)nD(e,"borderLeft","_bl",o,i,a),nD(e,"borderRight","_br",o,i,a)}};(t=e.children())===null||t===void 0||t.forEach(o=>n(o))},nD=(e,t,n,o,r,i)=>{const a={rank:i,borderType:t,width:0,height:0},s=r[t][i-1],l=uy(e,"border",a,n);r[t][i]=l,e.setParent(l,o),s&&e.setEdge(s,l,{weight:1})},$de=e=>{var t;const n=(t=e.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&s4(e)},Ude=e=>{var t;const n=(t=e.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&Vde(e),(n==="lr"||n==="rl")&&(Gde(e),s4(e))},s4=e=>{e.nodes().forEach(t=>{rD(e.node(t))}),e.edges().forEach(t=>{rD(e.edge(t))})},rD=e=>{const t=e.width;e.width=e.height,e.height=t},Vde=e=>{e.nodes().forEach(t=>{RS(e.node(t))}),e.edges().forEach(t=>{var n;const o=e.edge(t);(n=o.points)===null||n===void 0||n.forEach(r=>RS(r)),o.hasOwnProperty("y")&&RS(o)})},RS=e=>{e!=null&&e.y&&(e.y=-e.y)},Gde=e=>{e.nodes().forEach(t=>{DS(e.node(t))}),e.edges().forEach(t=>{var n;const o=e.edge(t);(n=o.points)===null||n===void 0||n.forEach(r=>DS(r)),o.hasOwnProperty("x")&&DS(o)})},DS=e=>{const t=e.x;e.x=e.y,e.y=t},oD={adjust:$de,undo:Ude};function Wde(e){return Array.isArray(e)}function w2(e){if(!Array.isArray(e))return-1/0;var t=e.length;if(!t)return-1/0;for(var n=e[0],o=1;o<t;o++)n=Math.max(n,e[o]);return n}const iD=(function(e){if(Wde(e))return e.reduce(function(t,n){return Math.min(t,n)},e[0])}),aD=e=>{const t={},n=e.nodes().filter(h=>{var v;return!(!((v=e.children(h))===null||v===void 0)&&v.length)}),o=n.map(h=>e.node(h).rank),r=w2(o),i=[];for(let h=0;h<r+1;h++)i.push([]);const a=h=>{var v;if(t.hasOwnProperty(h))return;t[h]=!0;const b=e.node(h);isNaN(b.rank)||i[b.rank].push(h),(v=e.successors(h))===null||v===void 0||v.forEach(E=>a(E))},s=n.sort((h,v)=>e.node(h).rank-e.node(v).rank),f=s.filter(h=>e.node(h).fixorder!==void 0).sort((h,v)=>e.node(h).fixorder-e.node(v).fixorder);return f==null||f.forEach(h=>{isNaN(e.node(h).rank)||i[e.node(h).rank].push(h),t[h]=!0}),s==null||s.forEach(a),i},zde=(e,t,n)=>{const o=lde(n,n.map((h,v)=>v)),i=t.map(h=>{var v;const b=(v=e.outEdges(h))===null||v===void 0?void 0:v.map(E=>({pos:o[E.w]||0,weight:e.edge(E).weight}));return b==null?void 0:b.sort((E,O)=>E.pos-O.pos)}).flat().filter(h=>h!==void 0);let a=1;for(;a<n.length;)a<<=1;const s=2*a-1;a-=1;const l=Array(s).fill(0,0,s);let f=0;return i==null||i.forEach(h=>{if(h){let v=h.pos+a;l[v]+=h.weight;let b=0;for(;v>0;)v%2&&(b+=l[v+1]),v=v-1>>1,l[v]+=h.weight;f+=h.weight*b}}),f},lD=(e,t)=>{let n=0;for(let o=1;o<(t==null?void 0:t.length);o+=1)n+=zde(e,t[o-1],t[o]);return n},Hde=(e,t,n)=>{const o=Xde(e),r=new cp({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>e.node(i));return e.nodes().forEach(i=>{var a;const s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(r.setNode(i),r.setParent(i,l||o),(a=e[n](i))===null||a===void 0||a.forEach(f=>{const h=f.v===i?f.w:f.v,v=r.edgeFromArgs(h,i),b=v!==void 0?v.weight:0;r.setEdge(h,i,{weight:e.edge(f).weight+b})}),s.hasOwnProperty("minRank")&&r.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),r},Xde=e=>{let t;for(;e.hasNode(t=`_root${Math.random()}`););return t},Yde=(e,t,n)=>{const o={};let r;n==null||n.forEach(i=>{let a=e.parent(i),s,l;for(;a;){if(s=e.parent(a),s?(l=o[s],o[s]=a):(l=r,r=a),l&&l!==a){t.setEdge(l,a);return}a=s}})},qde=(e,t)=>t.map(n=>{const o=e.inEdges(n);if(!(o!=null&&o.length))return{v:n};{const r={sum:0,weight:0};return o==null||o.forEach(i=>{const a=e.edge(i),s=e.node(i.v);r.sum+=a.weight*s.order,r.weight+=a.weight}),{v:n,barycenter:r.sum/r.weight,weight:r.weight}}}),Kde=(e,t)=>{var n,o,r;const i={};e==null||e.forEach((s,l)=>{i[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};const f=i[s.v];s.barycenter!==void 0&&(f.barycenter=s.barycenter,f.weight=s.weight)}),(n=t.edges())===null||n===void 0||n.forEach(s=>{const l=i[s.v],f=i[s.w];l!==void 0&&f!==void 0&&(f.indegree++,l.out.push(i[s.w]))});const a=(r=(o=Object.values(i)).filter)===null||r===void 0?void 0:r.call(o,s=>!s.indegree);return Zde(a)},Zde=e=>{var t,n;const o=[],r=l=>f=>{f.merged||(f.barycenter===void 0||l.barycenter===void 0||f.barycenter>=l.barycenter)&&Jde(l,f)},i=l=>f=>{f.in.push(l),--f.indegree===0&&e.push(f)};for(;e!=null&&e.length;){const l=e.pop();o.push(l),(t=l.in.reverse())===null||t===void 0||t.forEach(f=>r(l)(f)),(n=l.out)===null||n===void 0||n.forEach(f=>i(l)(f))}const a=o.filter(l=>!l.merged),s=["vs","i","barycenter","weight"];return a.map(l=>{const f={};return s==null||s.forEach(h=>{l[h]!==void 0&&(f[h]=l[h])}),f})},Jde=(e,t)=>{var n;let o=0,r=0;e.weight&&(o+=e.barycenter*e.weight,r+=e.weight),t.weight&&(o+=t.barycenter*t.weight,r+=t.weight),e.vs=(n=t.vs)===null||n===void 0?void 0:n.concat(e.vs),e.barycenter=o/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0},Qde=(e,t,n,o)=>{const r=cde(e,b=>{const E=b.hasOwnProperty("fixorder")&&!isNaN(b.fixorder);return o?!E&&b.hasOwnProperty("barycenter"):E||b.hasOwnProperty("barycenter")}),i=r.lhs,a=r.rhs.sort((b,E)=>-b.i- -E.i),s=[];let l=0,f=0,h=0;i==null||i.sort(efe(!!t,!!n)),h=sD(s,a,h),i==null||i.forEach(b=>{var E;h+=(E=b.vs)===null||E===void 0?void 0:E.length,s.push(b.vs),l+=b.barycenter*b.weight,f+=b.weight,h=sD(s,a,h)});const v={vs:s.flat()};return f&&(v.barycenter=l/f,v.weight=f),v},sD=(e,t,n)=>{let o=n,r;for(;t.length&&(r=t[t.length-1]).i<=o;)t.pop(),e==null||e.push(r.vs),o++;return o},efe=(e,t)=>(n,o)=>{if(n.fixorder!==void 0&&o.fixorder!==void 0)return n.fixorder-o.fixorder;if(n.barycenter<o.barycenter)return-1;if(n.barycenter>o.barycenter)return 1;if(t&&n.order!==void 0&&o.order!==void 0){if(n.order<o.order)return-1;if(n.order>o.order)return 1}return e?o.i-n.i:n.i-o.i},u4=(e,t,n,o,r,i)=>{var a,s,l,f;let h=e.children(t);const v=e.node(t),b=v?v.borderLeft:void 0,E=v?v.borderRight:void 0,O={};b&&(h=h==null?void 0:h.filter(T=>T!==b&&T!==E));const w=qde(e,h||[]);w==null||w.forEach(T=>{var $;if(!(($=e.children(T.v))===null||$===void 0)&&$.length){const D=u4(e,T.v,n,o,i);O[T.v]=D,D.hasOwnProperty("barycenter")&&nfe(T,D)}});const S=Kde(w,n);tfe(S,O),(a=S.filter(T=>T.vs.length>0))===null||a===void 0||a.forEach(T=>{const $=e.node(T.vs[0]);$&&(T.fixorder=$.fixorder,T.order=$.order)});const M=Qde(S,o,r,i);if(b&&(M.vs=[b,M.vs,E].flat(),!((s=e.predecessors(b))===null||s===void 0)&&s.length)){const T=e.node(((l=e.predecessors(b))===null||l===void 0?void 0:l[0])||""),$=e.node(((f=e.predecessors(E))===null||f===void 0?void 0:f[0])||"");M.hasOwnProperty("barycenter")||(M.barycenter=0,M.weight=0),M.barycenter=(M.barycenter*M.weight+T.order+$.order)/(M.weight+2),M.weight+=2}return M},tfe=(e,t)=>{e==null||e.forEach(n=>{var o;const r=(o=n.vs)===null||o===void 0?void 0:o.map(i=>t[i]?t[i].vs:i);n.vs=r.flat()})},nfe=(e,t)=>{e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)},rfe=(e,t)=>{const n=J8(e),o=[],r=[];for(let h=1;h<n+1;h++)o.push(h);for(let h=n-1;h>-1;h--)r.push(h);const i=uD(e,o,"inEdges"),a=uD(e,r,"outEdges");let s=aD(e);jS(e,s);let l=Number.POSITIVE_INFINITY,f;for(let h=0,v=0;v<4;++h,++v){cD(h%2?i:a,h%4>=2,!1,t),s=U_(e);const b=lD(e,s);b<l&&(v=0,f=y1(s),l=b)}s=aD(e),jS(e,s);for(let h=0,v=0;v<4;++h,++v){cD(h%2?i:a,h%4>=2,!0,t),s=U_(e);const b=lD(e,s);b<l&&(v=0,f=y1(s),l=b)}jS(e,f)},uD=(e,t,n)=>t.map(o=>Hde(e,o,n)),cD=(e,t,n,o)=>{const r=new cp;e==null||e.forEach(i=>{var a;const s=i.graph().root,l=u4(i,s,r,t,n,o);for(let f=0;f<((a=l.vs)===null||a===void 0?void 0:a.length);f++){const h=i.node(l.vs[f]);h&&(h.order=f)}Yde(i,r,l.vs)})},jS=(e,t)=>{t==null||t.forEach(n=>{n==null||n.forEach((o,r)=>{e.node(o).order=r})})};class ofe extends sb{}const ife=(e,t)=>{const n={},o=(r,i)=>{let a=0,s=0;const l=r.length,f=i==null?void 0:i[(i==null?void 0:i.length)-1];return i==null||i.forEach((h,v)=>{var b;const E=lfe(e,h),O=E?e.node(E).order:l;(E||h===f)&&((b=i.slice(s,v+1))===null||b===void 0||b.forEach(w=>{var S;(S=e.predecessors(w))===null||S===void 0||S.forEach(M=>{var T;const $=e.node(M),D=$.order;(D<a||O<D)&&!($.dummy&&(!((T=e.node(w))===null||T===void 0)&&T.dummy))&&c4(n,M,w)})}),s=v+1,a=O)}),i};return t!=null&&t.length&&t.reduce(o),n},afe=(e,t)=>{const n={};function o(s,l,f,h,v){var b,E;let O;for(let w=l;w<f;w++)O=s[w],!((b=e.node(O))===null||b===void 0)&&b.dummy&&((E=e.predecessors(O))===null||E===void 0||E.forEach(S=>{const M=e.node(S);M.dummy&&(M.order<h||M.order>v)&&c4(n,S,O)}))}function r(s){return JSON.stringify(s.slice(1))}function i(s,l){const f=r(s);l.get(f)||(o(...s),l.set(f,!0))}const a=(s,l)=>{let f=-1,h,v=0;const b=new Map;return l==null||l.forEach((E,O)=>{var w;if(((w=e.node(E))===null||w===void 0?void 0:w.dummy)==="border"){const S=e.predecessors(E)||[];S.length&&(h=e.node(S[0]).order,i([l,v,O,f,h],b),v=O,f=h)}i([l,v,l.length,h,s.length],b)}),l};return t!=null&&t.length&&t.reduce(a),n},lfe=(e,t)=>{var n,o;if(!((n=e.node(t))===null||n===void 0)&&n.dummy)return(o=e.predecessors(t))===null||o===void 0?void 0:o.find(r=>e.node(r).dummy)},c4=(e,t,n)=>{let o=t,r=n;if(o>r){const a=o;o=r,r=a}let i=e[o];i||(e[o]=i={}),i[r]=!0},sfe=(e,t,n)=>{let o=t,r=n;if(o>r){const i=t;o=r,r=i}return!!e[o]},ufe=(e,t,n,o)=>{const r={},i={},a={};return t==null||t.forEach(s=>{s==null||s.forEach((l,f)=>{r[l]=l,i[l]=l,a[l]=f})}),t==null||t.forEach(s=>{let l=-1;s==null||s.forEach(f=>{let h=o(f);if(h.length){h=h.sort((b,E)=>a[b]-a[E]);const v=(h.length-1)/2;for(let b=Math.floor(v),E=Math.ceil(v);b<=E;++b){const O=h[b];i[f]===f&&l<a[O]&&!sfe(n,f,O)&&(i[O]=f,i[f]=r[f]=r[O],l=a[O])}}})}),{root:r,align:i}},cfe=(e,t,n,o,r)=>{var i;const a={},s=dfe(e,t,n,r),l=r?"borderLeft":"borderRight",f=(b,E)=>{let O=s.nodes(),w=O.pop();const S={};for(;w;)S[w]?b(w):(S[w]=!0,O.push(w),O=O.concat(E(w))),w=O.pop()},h=b=>{a[b]=(s.inEdges(b)||[]).reduce((E,O)=>Math.max(E,(a[O.v]||0)+s.edge(O)),0)},v=b=>{const E=(s.outEdges(b)||[]).reduce((w,S)=>Math.min(w,(a[S.w]||0)-s.edge(S)),Number.POSITIVE_INFINITY),O=e.node(b);E!==Number.POSITIVE_INFINITY&&O.borderType!==l&&(a[b]=Math.max(a[b],E))};return f(h,s.predecessors.bind(s)),f(v,s.successors.bind(s)),(i=Object.values(o))===null||i===void 0||i.forEach(b=>{a[b]=a[n[b]]}),a},dfe=(e,t,n,o)=>{const r=new ofe,i=e.graph(),a=vfe(i.nodesep,i.edgesep,o);return t==null||t.forEach(s=>{let l;s==null||s.forEach(f=>{const h=n[f];if(r.setNode(h),l){const v=n[l],b=r.edgeFromArgs(v,h);r.setEdge(v,h,Math.max(a(e,f,l),b||0))}l=f})}),r},ffe=(e,t)=>UM(Object.values(t),n=>{var o;let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return(o=Object.keys(n))===null||o===void 0||o.forEach(a=>{const s=n[a],l=mfe(e,a)/2;r=Math.max(s+l,r),i=Math.min(s-l,i)}),r-i});function pfe(e,t){const n=Object.values(t),o=iD(n),r=w2(n);["u","d"].forEach(i=>{["l","r"].forEach(a=>{const s=i+a,l=e[s];let f;if(l===t)return;const h=Object.values(l);f=a==="l"?o-iD(h):r-w2(h),f&&(e[s]={},Object.keys(l).forEach(v=>{e[s][v]=l[v]+f}))})})}const hfe=(e,t)=>{const n={};return Object.keys(e.ul).forEach(o=>{if(t)n[o]=e[t.toLowerCase()][o];else{const r=Object.values(e).map(i=>i[o]);n[o]=(r[0]+r[1])/2}}),n},vfe=(e,t,n)=>(o,r,i)=>{const a=o.node(r),s=o.node(i);let l=0,f;if(l+=a.width/2,a.hasOwnProperty("labelpos"))switch((a.labelpos||"").toLowerCase()){case"l":f=-a.width/2;break;case"r":f=a.width/2;break}if(f&&(l+=n?f:-f),f=0,l+=(a.dummy?t:e)/2,l+=(s.dummy?t:e)/2,l+=s.width/2,s.labelpos)switch((s.labelpos||"").toLowerCase()){case"l":f=s.width/2;break;case"r":f=-s.width/2;break}return f&&(l+=n?f:-f),f=0,l},mfe=(e,t)=>e.node(t).width||0,gfe=e=>{const t=U_(e),n=e.graph().ranksep;let o=0;t==null||t.forEach(r=>{const i=r.map(s=>e.node(s).height),a=Math.max(...i,0);r==null||r.forEach(s=>{e.node(s).y=o+a/2}),o+=a+n})},yfe=e=>{const t=U_(e),n=Object.assign(ife(e,t),afe(e,t)),o={};let r=[];["u","d"].forEach(a=>{r=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(s=>{s==="r"&&(r=r.map(v=>Object.values(v).reverse()));const l=(a==="u"?e.predecessors:e.successors).bind(e),f=ufe(e,r,n,l),h=cfe(e,r,f.root,f.align,s==="r");s==="r"&&Object.keys(h).forEach(v=>h[v]=-h[v]),o[a+s]=h})});const i=ffe(e,o);return i&&pfe(o,i),hfe(o,e.graph().align)},_fe=e=>{var t;const n=Z8(e);gfe(n);const o=yfe(n);(t=Object.keys(o))===null||t===void 0||t.forEach(r=>{n.node(r).x=o[r]})},bfe=(e,t)=>{const o=e.nodes().filter(a=>{var s;return!(!((s=e.children(a))===null||s===void 0)&&s.length)}).map(a=>e.node(a).rank),r=Math.max(...o),i=[];for(let a=0;a<r+1;a++)i[a]=[];t==null||t.forEach(a=>{const s=e.node(a);!s||s!=null&&s.dummy||isNaN(s.rank)||(s.fixorder=i[s.rank].length,i[s.rank].push(a))})},wfe=(e,t)=>{const n=t&&t.debugTiming?Q8:e4;n("layout",()=>{t&&!t.keepNodeOrder&&t.prevGraph&&n(" inheritOrder",()=>{xfe(e,t.prevGraph)});const o=n(" buildLayoutGraph",()=>kfe(e));t&&t.edgeLabelSpace===!1||n(" makeSpaceForEdgeLabels",()=>{Pfe(o)});try{n(" runLayout",()=>{Efe(o,n,t)})}catch(r){if(r.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
|
||
`,r);return}throw r}n(" updateInputGraph",()=>{Ofe(e,o)})})},Efe=(e,t,n)=>{t(" removeSelfEdges",()=>{Ufe(e)}),t(" acyclic",()=>{qR.run(e)}),t(" nestingGraph.run",()=>{tD.run(e)}),t(" rank",()=>{Cde(Z8(e))}),t(" injectEdgeLabelProxies",()=>{Rfe(e)}),t(" removeEmptyRanks",()=>{ude(e)}),t(" nestingGraph.cleanup",()=>{tD.cleanup(e)}),t(" normalizeRanks",()=>{sde(e)}),t(" assignRankMinMax",()=>{Dfe(e)}),t(" removeEdgeLabelProxies",()=>{jfe(e)}),t(" normalize.run",()=>{JR.run(e)}),t(" parentDummyChains",()=>{Dde(e)}),t(" addBorderSegments",()=>{Bde(e)}),n&&n.keepNodeOrder&&t(" initDataOrder",()=>{bfe(e,n.nodeOrder)}),t(" order",()=>{rfe(e,n==null?void 0:n.keepNodeOrder)}),t(" insertSelfEdges",()=>{Vfe(e)}),t(" adjustCoordinateSystem",()=>{oD.adjust(e)}),t(" position",()=>{_fe(e)}),t(" positionSelfEdges",()=>{Gfe(e)}),t(" removeBorderNodes",()=>{$fe(e)}),t(" normalize.undo",()=>{JR.undo(e)}),t(" fixupEdgeLabelCoords",()=>{Ffe(e)}),t(" undoCoordinateSystem",()=>{oD.undo(e)}),t(" translateGraph",()=>{Lfe(e)}),t(" assignNodeIntersects",()=>{Ife(e)}),t(" reversePoints",()=>{Bfe(e)}),t(" acyclic.undo",()=>{qR.undo(e)})},xfe=(e,t)=>{e.nodes().forEach(n=>{const o=e.node(n),r=t.node(n);r!==void 0?(o.fixorder=r._order,delete r._order):delete o.fixorder})},Ofe=(e,t)=>{e.nodes().forEach(n=>{var o;const r=e.node(n);if(r){const i=t.node(n);r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,!((o=t.children(n))===null||o===void 0)&&o.length&&(r.width=i.width,r.height=i.height)}}),e.edges().forEach(n=>{const o=e.edge(n),r=t.edge(n);o.points=r?r.points:[],r&&r.hasOwnProperty("x")&&(o.x=r.x,o.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height},Sfe=["nodesep","edgesep","ranksep","marginx","marginy"],Afe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},LS=["acyclicer","ranker","rankdir","align"],Mfe=["width","height","layer","fixorder"],Tfe={width:0,height:0},Cfe=["minlen","weight","width","height","labeloffset"],Nfe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},IS=["labelpos"],kfe=e=>{const t=new cp({multigraph:!0,compound:!0}),n=BS(e.graph()),o={};return LS==null||LS.forEach(r=>{n[r]!==void 0&&(o[r]=n[r])}),t.setGraph(Object.assign({},Afe,FS(n,Sfe),o)),e.nodes().forEach(r=>{const i=BS(e.node(r)),a=Object.assign(Object.assign({},Tfe),i),s=FS(a,Mfe);t.setNode(r,s),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{const i=BS(e.edge(r)),a={};IS==null||IS.forEach(s=>{i[s]!==void 0&&(a[s]=i[s])}),t.setEdgeObj(r,Object.assign({},Nfe,FS(i,Cfe),a))}),t},Pfe=e=>{const t=e.graph();t.ranksep||(t.ranksep=0),t.ranksep/=2,e.nodes().forEach(n=>{const o=e.node(n);isNaN(o.layer)||o.layer||(o.layer=0)}),e.edges().forEach(n=>{var o;const r=e.edge(n);r.minlen*=2,((o=r.labelpos)===null||o===void 0?void 0:o.toLowerCase())!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})},Rfe=e=>{e.edges().forEach(t=>{const n=e.edge(t);if(n.width&&n.height){const o=e.node(t.v),r=e.node(t.w),i={e:t,rank:(r.rank-o.rank)/2+o.rank};uy(e,"edge-proxy",i,"_ep")}})},Dfe=e=>{let t=0;e.nodes().forEach(n=>{var o,r;const i=e.node(n);i.borderTop&&(i.minRank=(o=e.node(i.borderTop))===null||o===void 0?void 0:o.rank,i.maxRank=(r=e.node(i.borderBottom))===null||r===void 0?void 0:r.rank,t=Math.max(t,i.maxRank||-1/0))}),e.graph().maxRank=t},jfe=e=>{e.nodes().forEach(t=>{const n=e.node(t);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})},Lfe=e=>{let t,n=0,o,r=0;const i=e.graph(),a=i.marginx||0,s=i.marginy||0,l=f=>{if(!f)return;const h=f.x,v=f.y,b=f.width,E=f.height;!isNaN(h)&&!isNaN(b)&&(t===void 0&&(t=h-b/2),t=Math.min(t,h-b/2),n=Math.max(n,h+b/2)),!isNaN(v)&&!isNaN(E)&&(o===void 0&&(o=v-E/2),o=Math.min(o,v-E/2),r=Math.max(r,v+E/2))};e.nodes().forEach(f=>{l(e.node(f))}),e.edges().forEach(f=>{const h=e.edge(f);h!=null&&h.hasOwnProperty("x")&&l(h)}),t-=a,o-=s,e.nodes().forEach(f=>{const h=e.node(f);h&&(h.x-=t,h.y-=o)}),e.edges().forEach(f=>{var h;const v=e.edge(f);(h=v.points)===null||h===void 0||h.forEach(b=>{b.x-=t,b.y-=o}),v.hasOwnProperty("x")&&(v.x-=t),v.hasOwnProperty("y")&&(v.y-=o)}),i.width=n-t+a,i.height=r-o+s},Ife=e=>{e.edges().forEach(t=>{const n=e.edge(t),o=e.node(t.v),r=e.node(t.w);let i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=r,a=o),n.points.unshift(KR(o,i)),n.points.push(KR(r,a))})},Ffe=e=>{e.edges().forEach(t=>{const n=e.edge(t);if(n!=null&&n.hasOwnProperty("x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})},Bfe=e=>{e.edges().forEach(t=>{var n;const o=e.edge(t);o.reversed&&((n=o.points)===null||n===void 0||n.reverse())})},$fe=e=>{e.nodes().forEach(t=>{var n,o,r;if(!((n=e.children(t))===null||n===void 0)&&n.length){const i=e.node(t),a=e.node(i.borderTop),s=e.node(i.borderBottom),l=e.node(i.borderLeft[((o=i.borderLeft)===null||o===void 0?void 0:o.length)-1]),f=e.node(i.borderRight[((r=i.borderRight)===null||r===void 0?void 0:r.length)-1]);i.width=Math.abs((f==null?void 0:f.x)-(l==null?void 0:l.x))||10,i.height=Math.abs((s==null?void 0:s.y)-(a==null?void 0:a.y))||10,i.x=((l==null?void 0:l.x)||0)+i.width/2,i.y=((a==null?void 0:a.y)||0)+i.height/2}}),e.nodes().forEach(t=>{var n;((n=e.node(t))===null||n===void 0?void 0:n.dummy)==="border"&&e.removeNode(t)})},Ufe=e=>{e.edges().forEach(t=>{if(t.v===t.w){const n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdgeObj(t)}})},Vfe=e=>{const t=U_(e);t==null||t.forEach(n=>{let o=0;n==null||n.forEach((r,i)=>{var a;const s=e.node(r);s.order=i+o,(a=s.selfEdges)===null||a===void 0||a.forEach(l=>{uy(e,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:i+ ++o,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})},Gfe=e=>{e.nodes().forEach(t=>{const n=e.node(t);if(n.dummy==="selfedge"){const o=e.node(n.e.v),r=o.x+o.width/2,i=o.y,a=n.x-r,s=o.height/2;e.setEdgeObj(n.e,n.label),e.removeNode(t),n.label.points=[{x:r+2*a/3,y:i-s},{x:r+5*a/6,y:i-s},{y:i,x:r+a},{x:r+5*a/6,y:i+s},{x:r+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})},FS=(e,t)=>{const n={};return t==null||t.forEach(o=>{e[o]!==void 0&&(n[o]=+e[o])}),n},BS=(e={})=>{const t={};return Object.keys(e).forEach(n=>{t[n.toLowerCase()]=e[n]}),t},Wfe={layout:wfe,util:{time:Q8,notime:e4}};class zfe extends Rce{constructor(t){super(),this.rankdir="TB",this.nodesep=50,this.ranksep=50,this.controlPoints=!1,this.sortByCombo=!1,this.edgeLabelSpace=!0,this.radial=!1,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.layoutNode=n=>{const o=this,{nodes:r}=o,i=r.find(a=>a.id===n);return i?i.layout!==!1:!0},this.updateCfg(t)}getDefaultCfg(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}}execute(){var t,n,o,r;const i=this,{nodes:a,nodeSize:s,rankdir:l,combos:f,begin:h,radial:v,comboEdges:b=[],vedges:E=[]}=i;if(!a)return;const O=i.edges||[],w=new cp({multigraph:!0,compound:!0});i.nodeMap={};const S={};a.forEach(X=>{i.nodeMap[X.id]=X,X.comboId&&(S[X.comboId]=S[X.comboId]||[],S[X.comboId].push(X.id))});let M=[];const T={};!((t=i.nodeOrder)===null||t===void 0)&&t.length?(i.nodeOrder.forEach(X=>{T[X]=!0,M.push(i.nodeMap[X])}),a.forEach(X=>{T[X.id]||M.push(X)})):M=a;let $;s?$R(s)?$=()=>s:$=()=>[s,s]:$=X=>X.size?$R(X.size)?X.size:q8(X.size)?[X.size.width||40,X.size.height||40]:[X.size,X.size]:[40,40];const D=UR(i.ranksep,50,i.ranksepFunc),P=UR(i.nodesep,50,i.nodesepFunc);let B=P,F=D;(l==="LR"||l==="RL")&&(B=D,F=P),w.setDefaultEdgeLabel(()=>({})),w.setGraph(i);const I={};this.sortByCombo&&f&&f.forEach(X=>{if(I[X.id]=X,X.collapsed){const G=$(X),Q=F(X),J=B(X),ie=G[0]+2*J,Se=G[1]+2*Q;w.setNode(X.id,{width:ie,height:Se})}X.parentId&&(I[X.parentId]||w.setNode(X.parentId,{}),w.setParent(X.id,X.parentId))}),M.filter(X=>X.layout!==!1).forEach(X=>{const G=$(X),Q=F(X),J=B(X),ie=G[0]+2*J,Se=G[1]+2*Q,Ae=X.layer;g1(Ae)?w.setNode(X.id,{width:ie,height:Se,layer:Ae}):w.setNode(X.id,{width:ie,height:Se}),this.sortByCombo&&X.comboId&&(I[X.comboId]||(I[X.comboId]={id:X.comboId},w.setNode(X.comboId,{})),w.setParent(X.id,X.comboId))}),O.forEach(X=>{const G=cg(X,"source"),Q=cg(X,"target");this.layoutNode(G)&&this.layoutNode(Q)&&w.setEdge(G,Q,{weight:X.weight||1})}),(n=b==null?void 0:b.concat(E||[]))===null||n===void 0||n.forEach(X=>{var G,Q;const{source:J,target:ie}=X,Se=!((G=I[J])===null||G===void 0)&&G.collapsed?[J]:S[J]||[J],Ae=!((Q=I[ie])===null||Q===void 0)&&Q.collapsed?[ie]:S[ie]||[ie];Se.forEach(Pe=>{Ae.forEach(De=>{w.setEdge(Pe,De,{weight:X.weight||1})})})});let V;!((o=i.preset)===null||o===void 0)&&o.nodes&&(V=new cp({multigraph:!0,compound:!0}),i.preset.nodes.forEach(X=>{V==null||V.setNode(X.id,X)})),Wfe.layout(w,{prevGraph:V,edgeLabelSpace:i.edgeLabelSpace,keepNodeOrder:!!i.nodeOrder,nodeOrder:i.nodeOrder});const z=[0,0];if(h){let X=1/0,G=1/0;w.nodes().forEach(Q=>{const J=w.node(Q);X>J.x&&(X=J.x),G>J.y&&(G=J.y)}),w.edges().forEach(Q=>{var J;(J=w.edge(Q).points)===null||J===void 0||J.forEach(Se=>{X>Se.x&&(X=Se.x),G>Se.y&&(G=Se.y)})}),z[0]=h[0]-X,z[1]=h[1]-G}const q=l==="LR"||l==="RL";if(v){const{focusNode:X,ranksep:G,getRadialPos:Q}=this,J=Dce(X)?X:X==null?void 0:X.id,ie=J?(r=w.node(J))===null||r===void 0?void 0:r._rank:0,Se=[],Ae=q?"y":"x",Pe=q?"height":"width";let De=1/0,ze=-1/0;w.nodes().forEach(se=>{const we=w.node(se);if(!i.nodeMap[se])return;const $e=P(i.nodeMap[se]);if(ie===0)Se[we._rank]||(Se[we._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[we._rank].nodes.push(se),Se[we._rank].totalWidth+=$e*2+we[Pe],Se[we._rank].maxSize<Math.max(we.width,we.height)&&(Se[we._rank].maxSize=Math.max(we.width,we.height));else{const Lt=we._rank-ie;if(Lt===0)Se[Lt]||(Se[Lt]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[Lt].nodes.push(se),Se[Lt].totalWidth+=$e*2+we[Pe],Se[Lt].maxSize<Math.max(we.width,we.height)&&(Se[Lt].maxSize=Math.max(we.width,we.height));else{const Jt=Math.abs(Lt);Se[Jt]||(Se[Jt]={left:[],right:[],totalWidth:0,maxSize:-1/0}),Se[Jt].totalWidth+=$e*2+we[Pe],Se[Jt].maxSize<Math.max(we.width,we.height)&&(Se[Jt].maxSize=Math.max(we.width,we.height)),Lt<0?Se[Jt].left.push(se):Se[Jt].right.push(se)}}const rt=we[Ae]-we[Pe]/2-$e,pt=we[Ae]+we[Pe]/2+$e;rt<De&&(De=rt),pt>ze&&(ze=pt)});let Ye=G||50;const Be={},Je=(ze-De)/.9,gt=[(De+ze-Je)*.5,(De+ze+Je)*.5],le=(se,we,$e=-1/0,rt=[0,1])=>{let pt=$e;return se.forEach(Lt=>{const Jt=w.node(Lt);Be[Lt]=we;const{x:en,y:zt}=Q(Jt[Ae],gt,Je,we,rt);if(!i.nodeMap[Lt])return;i.nodeMap[Lt].x=en+z[0],i.nodeMap[Lt].y=zt+z[1],i.nodeMap[Lt]._order=Jt._order;const it=D(i.nodeMap[Lt]);pt<it&&(pt=it)}),pt};let Ze=!0;const pe=0;Se.forEach(se=>{var we,$e,rt,pt,Lt,Jt,en;if(!(!((we=se==null?void 0:se.nodes)===null||we===void 0)&&we.length)&&!(!(($e=se==null?void 0:se.left)===null||$e===void 0)&&$e.length)&&!(!((rt=se==null?void 0:se.right)===null||rt===void 0)&&rt.length))return;if(Ze&&se.nodes.length===1){const it=se.nodes[0];if(!i.nodeMap[it])return;i.nodeMap[it].x=z[0],i.nodeMap[it].y=z[1],Be[se.nodes[0]]=0,Ye=D(i.nodeMap[it]),Ze=!1;return}Ye=Math.max(Ye,se.totalWidth/(2*Math.PI));let zt=-1/0;if(ie===0||!((pt=se.nodes)===null||pt===void 0)&&pt.length)zt=le(se.nodes,Ye,zt,[0,1]);else{const it=((Lt=se.left)===null||Lt===void 0?void 0:Lt.length)/(((Jt=se.left)===null||Jt===void 0?void 0:Jt.length)+((en=se.right)===null||en===void 0?void 0:en.length));zt=le(se.left,Ye,zt,[0,it]),zt=le(se.right,Ye,zt,[it+.05,1])}Ye+=zt,Ze=!1,pe-se.maxSize}),w.edges().forEach(se=>{var we,$e,rt;const pt=w.edge(se),Lt=O.findIndex(Jt=>{const en=cg(Jt,"source"),zt=cg(Jt,"target");return en===se.v&&zt===se.w});if(!(Lt<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[Lt].type!=="loop"){const Jt=Ae==="x"?"y":"x",en=(we=pt==null?void 0:pt.points)===null||we===void 0?void 0:we.slice(1,pt.points.length-1),zt=[],it=($e=w.node(se.v))===null||$e===void 0?void 0:$e[Jt],ae=it-((rt=w.node(se.w))===null||rt===void 0?void 0:rt[Jt]),re=Be[se.v],je=re-Be[se.w];en==null||en.forEach(vt=>{const Y=(vt[Jt]-it)/ae*je+re,kt=Q(vt[Ae],gt,Je,Y);zt.push({x:kt.x+z[0],y:kt.y+z[1]})}),O[Lt].controlPoints=zt}})}else{const X=new Set,Q=l==="BT"||l==="RL"?(Ae,Pe)=>Pe-Ae:(Ae,Pe)=>Ae-Pe;w.nodes().forEach(Ae=>{const Pe=w.node(Ae);if(!Pe)return;let De=this.nodeMap[Ae];De||(De=f==null?void 0:f.find(ze=>ze.id===Ae)),De&&(De.x=Pe.x+z[0],De.y=Pe.y+z[1],De._order=Pe._order,X.add(q?De.x:De.y))});const J=Array.from(X).sort(Q),ie=q?(Ae,Pe)=>Ae.x!==Pe.x:(Ae,Pe)=>Ae.y!==Pe.y,Se=q?(Ae,Pe,De)=>{const ze=Math.max(Pe.y,De.y),Ye=Math.min(Pe.y,De.y);return Ae.filter(Be=>Be.y<=ze&&Be.y>=Ye)}:(Ae,Pe,De)=>{const ze=Math.max(Pe.x,De.x),Ye=Math.min(Pe.x,De.x);return Ae.filter(Be=>Be.x<=ze&&Be.x>=Ye)};w.edges().forEach(Ae=>{var Pe;const De=w.edge(Ae),ze=O.findIndex(Ye=>{const Be=cg(Ye,"source"),Je=cg(Ye,"target");return Be===Ae.v&&Je===Ae.w});if(!(ze<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[ze].type!=="loop"){(Pe=De==null?void 0:De.points)===null||Pe===void 0||Pe.forEach(Je=>{Je.x+=z[0],Je.y+=z[1]});const Ye=i.nodeMap[Ae.v],Be=i.nodeMap[Ae.w];O[ze].controlPoints=Hfe(De==null?void 0:De.points,Ye,Be,J,q,ie,Se)}})}return i.onLayoutEnd&&i.onLayoutEnd(),{nodes:a,edges:O}}getRadialPos(t,n,o,r,i=[0,1]){let a=(t-n[0])/o;a=a*(i[1]-i[0])+i[0];const s=a*2*Math.PI;return{x:Math.cos(s)*r,y:Math.sin(s)*r}}getType(){return"dagre"}}const Hfe=(e,t,n,o,r,i,a)=>{let s=(e==null?void 0:e.slice(1,e.length-1))||[];if(t&&n){let{x:l,y:f}=t,{x:h,y:v}=n;if(r&&(l=t.y,f=t.x,h=n.y,v=n.x),v!==f&&l!==h){const b=o.indexOf(f),E=o[b+1];if(E){const S=s[0],M=r?{x:(f+E)/2,y:(S==null?void 0:S.y)||h}:{x:(S==null?void 0:S.x)||h,y:(f+E)/2};(!S||i(S,M))&&s.unshift(M)}const O=o.indexOf(v),w=Math.abs(O-b);if(w===1)s=a(s,t,n),s.length||s.push(r?{x:(f+v)/2,y:l}:{x:l,y:(f+v)/2});else if(w>1){const S=o[O-1];if(S){const M=s[s.length-1],T=r?{x:(v+S)/2,y:(M==null?void 0:M.y)||h}:{x:(M==null?void 0:M.x)||l,y:(v+S)/2};(!M||i(M,T))&&s.push(T)}}}}return s};var dD,fD,pD,hD;(function(e){e[e.META=0]="META",e[e.NODE=1]="NODE",e[e.BRIDGE=2]="BRIDGE"})(dD||(dD={})),(function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE",e[e.UNSPECIFIED=2]="UNSPECIFIED"})(fD||(fD={})),(function(e){e[e.META=0]="META",e[e.CORE=1]="CORE",e[e.BRIDGE=2]="BRIDGE"})(pD||(pD={})),(function(e){e[e.META=0]="META",e[e.OP=1]="OP",e[e.SERIES=2]="SERIES"})(hD||(hD={}));var V0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VM(e,t){return e(t={exports:{}},t.exports),t.exports}var Xfe=function(){this.__data__=[],this.size=0},cy=function(e,t){return e===t||e!=e&&t!=t},nE=function(e,t){for(var n=e.length;n--;)if(cy(e[n][0],t))return n;return-1},Yfe=Array.prototype.splice,qfe=function(e){var t=this.__data__,n=nE(t,e);return!(n<0)&&(n==t.length-1?t.pop():Yfe.call(t,n,1),--this.size,!0)},Kfe=function(e){var t=this.__data__,n=nE(t,e);return n<0?void 0:t[n][1]},Zfe=function(e){return nE(this.__data__,e)>-1},Jfe=function(e,t){var n=this.__data__,o=nE(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function vg(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}vg.prototype.clear=Xfe,vg.prototype.delete=qfe,vg.prototype.get=Kfe,vg.prototype.has=Zfe,vg.prototype.set=Jfe;var rE=vg,Qfe=function(){this.__data__=new rE,this.size=0},epe=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},tpe=function(e){return this.__data__.get(e)},npe=function(e){return this.__data__.has(e)},d4=typeof V0=="object"&&V0&&V0.Object===Object&&V0,rpe=typeof self=="object"&&self&&self.Object===Object&&self,od=d4||rpe||Function("return this")(),ic=od.Symbol,f4=Object.prototype,ope=f4.hasOwnProperty,ipe=f4.toString,$y=ic?ic.toStringTag:void 0,ape=function(e){var t=ope.call(e,$y),n=e[$y];try{e[$y]=void 0;var o=!0}catch{}var r=ipe.call(e);return o&&(t?e[$y]=n:delete e[$y]),r},lpe=Object.prototype.toString,spe=function(e){return lpe.call(e)},vD=ic?ic.toStringTag:void 0,Bh=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":vD&&vD in Object(e)?ape(e):spe(e)},Xs=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},mD,ub=function(e){if(!Xs(e))return!1;var t=Bh(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},$S=od["__core-js_shared__"],gD=(mD=/[^.]+$/.exec($S&&$S.keys&&$S.keys.IE_PROTO||""))?"Symbol(src)_1."+mD:"",upe=function(e){return!!gD&&gD in e},cpe=Function.prototype.toString,sm=function(e){if(e!=null){try{return cpe.call(e)}catch{}try{return e+""}catch{}}return""},dpe=/^\[object .+?Constructor\]$/,fpe=Function.prototype,ppe=Object.prototype,hpe=fpe.toString,vpe=ppe.hasOwnProperty,mpe=RegExp("^"+hpe.call(vpe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gpe=function(e){return!(!Xs(e)||upe(e))&&(ub(e)?mpe:dpe).test(sm(e))},ype=function(e,t){return e==null?void 0:e[t]},um=function(e,t){var n=ype(e,t);return gpe(n)?n:void 0},V_=um(od,"Map"),G_=um(Object,"create"),_pe=function(){this.__data__=G_?G_(null):{},this.size=0},bpe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wpe=Object.prototype.hasOwnProperty,Epe=function(e){var t=this.__data__;if(G_){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return wpe.call(t,e)?t[e]:void 0},xpe=Object.prototype.hasOwnProperty,Ope=function(e){var t=this.__data__;return G_?t[e]!==void 0:xpe.call(t,e)},Spe=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=G_&&t===void 0?"__lodash_hash_undefined__":t,this};function mg(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}mg.prototype.clear=_pe,mg.prototype.delete=bpe,mg.prototype.get=Epe,mg.prototype.has=Ope,mg.prototype.set=Spe;var yD=mg,Ape=function(){this.size=0,this.__data__={hash:new yD,map:new(V_||rE),string:new yD}},Mpe=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},oE=function(e,t){var n=e.__data__;return Mpe(t)?n[typeof t=="string"?"string":"hash"]:n.map},Tpe=function(e){var t=oE(this,e).delete(e);return this.size-=t?1:0,t},Cpe=function(e){return oE(this,e).get(e)},Npe=function(e){return oE(this,e).has(e)},kpe=function(e,t){var n=oE(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};function gg(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}gg.prototype.clear=Ape,gg.prototype.delete=Tpe,gg.prototype.get=Cpe,gg.prototype.has=Npe,gg.prototype.set=kpe;var iE=gg,Ppe=function(e,t){var n=this.__data__;if(n instanceof rE){var o=n.__data__;if(!V_||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new iE(o)}return n.set(e,t),this.size=n.size,this};function yg(e){var t=this.__data__=new rE(e);this.size=t.size}yg.prototype.clear=Qfe,yg.prototype.delete=epe,yg.prototype.get=tpe,yg.prototype.has=npe,yg.prototype.set=Ppe;var Tg=yg,GM=function(e,t){for(var n=-1,o=e==null?0:e.length;++n<o&&t(e[n],n,e)!==!1;);return e},_1=(function(){try{var e=um(Object,"defineProperty");return e({},"",{}),e}catch{}})(),aE=function(e,t,n){t=="__proto__"&&_1?_1(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Rpe=Object.prototype.hasOwnProperty,lE=function(e,t,n){var o=e[t];Rpe.call(e,t)&&cy(o,n)&&(n!==void 0||t in e)||aE(e,t,n)},cb=function(e,t,n,o){var r=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=void 0;l===void 0&&(l=e[s]),r?aE(n,s,l):lE(n,s,l)}return n},Dpe=function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o},nd=function(e){return e!=null&&typeof e=="object"},_D=function(e){return nd(e)&&Bh(e)=="[object Arguments]"},p4=Object.prototype,jpe=p4.hasOwnProperty,Lpe=p4.propertyIsEnumerable,Yg=_D((function(){return arguments})())?_D:function(e){return nd(e)&&jpe.call(e,"callee")&&!Lpe.call(e,"callee")},Ma=Array.isArray,Ipe=function(){return!1},Jv=VM((function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n?od.Buffer:void 0,i=(r?r.isBuffer:void 0)||Ipe;e.exports=i})),Fpe=/^(?:0|[1-9]\d*)$/,sE=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&Fpe.test(e))&&e>-1&&e%1==0&&e<t},WM=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},ea={};ea["[object Float32Array]"]=ea["[object Float64Array]"]=ea["[object Int8Array]"]=ea["[object Int16Array]"]=ea["[object Int32Array]"]=ea["[object Uint8Array]"]=ea["[object Uint8ClampedArray]"]=ea["[object Uint16Array]"]=ea["[object Uint32Array]"]=!0,ea["[object Arguments]"]=ea["[object Array]"]=ea["[object ArrayBuffer]"]=ea["[object Boolean]"]=ea["[object DataView]"]=ea["[object Date]"]=ea["[object Error]"]=ea["[object Function]"]=ea["[object Map]"]=ea["[object Number]"]=ea["[object Object]"]=ea["[object RegExp]"]=ea["[object Set]"]=ea["[object String]"]=ea["[object WeakMap]"]=!1;var Bpe=function(e){return nd(e)&&WM(e.length)&&!!ea[Bh(e)]},uE=function(e){return function(t){return e(t)}},qg=VM((function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n&&d4.process,i=(function(){try{var a=o&&o.require&&o.require("util").types;return a||r&&r.binding&&r.binding("util")}catch{}})();e.exports=i})),bD=qg&&qg.isTypedArray,db=bD?uE(bD):Bpe,$pe=Object.prototype.hasOwnProperty,h4=function(e,t){var n=Ma(e),o=!n&&Yg(e),r=!n&&!o&&Jv(e),i=!n&&!o&&!r&&db(e),a=n||o||r||i,s=a?Dpe(e.length,String):[],l=s.length;for(var f in e)!t&&!$pe.call(e,f)||a&&(f=="length"||r&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||sE(f,l))||s.push(f);return s},Upe=Object.prototype,cE=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||Upe)},v4=function(e,t){return function(n){return e(t(n))}},Vpe=v4(Object.keys,Object),Gpe=Object.prototype.hasOwnProperty,zM=function(e){if(!cE(e))return Vpe(e);var t=[];for(var n in Object(e))Gpe.call(e,n)&&n!="constructor"&&t.push(n);return t},vp=function(e){return e!=null&&WM(e.length)&&!ub(e)},$h=function(e){return vp(e)?h4(e):zM(e)},Wpe=function(e,t){return e&&cb(t,$h(t),e)},zpe=function(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t},Hpe=Object.prototype.hasOwnProperty,Xpe=function(e){if(!Xs(e))return zpe(e);var t=cE(e),n=[];for(var o in e)(o!="constructor"||!t&&Hpe.call(e,o))&&n.push(o);return n},cm=function(e){return vp(e)?h4(e,!0):Xpe(e)},Ype=function(e,t){return e&&cb(t,cm(t),e)},m4=VM((function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n?od.Buffer:void 0,i=r?r.allocUnsafe:void 0;e.exports=function(a,s){if(s)return a.slice();var l=a.length,f=i?i(l):new a.constructor(l);return a.copy(f),f}})),g4=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t},y4=function(e,t){for(var n=-1,o=e==null?0:e.length,r=0,i=[];++n<o;){var a=e[n];t(a,n,e)&&(i[r++]=a)}return i},_4=function(){return[]},qpe=Object.prototype.propertyIsEnumerable,wD=Object.getOwnPropertySymbols,HM=wD?function(e){return e==null?[]:(e=Object(e),y4(wD(e),(function(t){return qpe.call(e,t)})))}:_4,Kpe=function(e,t){return cb(e,HM(e),t)},XM=function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e},dE=v4(Object.getPrototypeOf,Object),b4=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)XM(t,HM(e)),e=dE(e);return t}:_4,Zpe=function(e,t){return cb(e,b4(e),t)},w4=function(e,t,n){var o=t(e);return Ma(e)?o:XM(o,n(e))},E2=function(e){return w4(e,$h,HM)},Jpe=function(e){return w4(e,cm,b4)},x2=um(od,"DataView"),O2=um(od,"Promise"),Cg=um(od,"Set"),S2=um(od,"WeakMap"),Qpe=sm(x2),ehe=sm(V_),the=sm(O2),nhe=sm(Cg),rhe=sm(S2),jv=Bh;(x2&&jv(new x2(new ArrayBuffer(1)))!="[object DataView]"||V_&&jv(new V_)!="[object Map]"||O2&&jv(O2.resolve())!="[object Promise]"||Cg&&jv(new Cg)!="[object Set]"||S2&&jv(new S2)!="[object WeakMap]")&&(jv=function(e){var t=Bh(e),n=t=="[object Object]"?e.constructor:void 0,o=n?sm(n):"";if(o)switch(o){case Qpe:return"[object DataView]";case ehe:return"[object Map]";case the:return"[object Promise]";case nhe:return"[object Set]";case rhe:return"[object WeakMap]"}return t});var Qv=jv,ohe=Object.prototype.hasOwnProperty,ihe=function(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ohe.call(e,"index")&&(n.index=e.index,n.input=e.input),n},b1=od.Uint8Array,YM=function(e){var t=new e.constructor(e.byteLength);return new b1(t).set(new b1(e)),t},ahe=function(e,t){var n=t?YM(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},lhe=/\w*$/,she=function(e){var t=new e.constructor(e.source,lhe.exec(e));return t.lastIndex=e.lastIndex,t},ED=ic?ic.prototype:void 0,xD=ED?ED.valueOf:void 0,uhe=function(e){return xD?Object(xD.call(e)):{}},E4=function(e,t){var n=t?YM(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},che=function(e,t,n){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return YM(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return ahe(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return E4(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return she(e);case"[object Set]":return new o;case"[object Symbol]":return uhe(e)}},OD=Object.create,x4=(function(){function e(){}return function(t){if(!Xs(t))return{};if(OD)return OD(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),O4=function(e){return typeof e.constructor!="function"||cE(e)?{}:x4(dE(e))},dhe=function(e){return nd(e)&&Qv(e)=="[object Map]"},SD=qg&&qg.isMap,fhe=SD?uE(SD):dhe,phe=function(e){return nd(e)&&Qv(e)=="[object Set]"},AD=qg&&qg.isSet,hhe=AD?uE(AD):phe,Hi={};Hi["[object Arguments]"]=Hi["[object Array]"]=Hi["[object ArrayBuffer]"]=Hi["[object DataView]"]=Hi["[object Boolean]"]=Hi["[object Date]"]=Hi["[object Float32Array]"]=Hi["[object Float64Array]"]=Hi["[object Int8Array]"]=Hi["[object Int16Array]"]=Hi["[object Int32Array]"]=Hi["[object Map]"]=Hi["[object Number]"]=Hi["[object Object]"]=Hi["[object RegExp]"]=Hi["[object Set]"]=Hi["[object String]"]=Hi["[object Symbol]"]=Hi["[object Uint8Array]"]=Hi["[object Uint8ClampedArray]"]=Hi["[object Uint16Array]"]=Hi["[object Uint32Array]"]=!0,Hi["[object Error]"]=Hi["[object Function]"]=Hi["[object WeakMap]"]=!1;var S4=function e(t,n,o,r,i,a){var s,l=1&n,f=2&n,h=4&n;if(s!==void 0)return s;if(!Xs(t))return t;var v=Ma(t);if(v){if(s=ihe(t),!l)return g4(t,s)}else{var b=Qv(t),E=b=="[object Function]"||b=="[object GeneratorFunction]";if(Jv(t))return m4(t,l);if(b=="[object Object]"||b=="[object Arguments]"||E&&!i){if(s=f||E?{}:O4(t),!l)return f?Zpe(t,Ype(s,t)):Kpe(t,Wpe(s,t))}else{if(!Hi[b])return i?t:{};s=che(t,b,l)}}a||(a=new Tg);var O=a.get(t);if(O)return O;a.set(t,s),hhe(t)?t.forEach((function(S){s.add(e(S,n,o,S,t,a))})):fhe(t)&&t.forEach((function(S,M){s.set(M,e(S,n,o,M,t,a))}));var w=v?void 0:(h?f?Jpe:E2:f?cm:$h)(t);return GM(w||t,(function(S,M){w&&(S=t[M=S]),lE(s,M,e(S,n,o,M,t,a))})),s},vhe=function(e){return S4(e,4)},qM=function(e){return function(){return e}},KM=(function(e){return function(t,n,o){for(var r=-1,i=Object(t),a=o(t),s=a.length;s--;){var l=a[++r];if(n(i[l],l,i)===!1)break}return t}})(),ZM=function(e,t){return e&&KM(e,t,$h)},fE=(function(e,t){return function(n,o){if(n==null)return n;if(!vp(n))return e(n,o);for(var r=n.length,i=-1,a=Object(n);++i<r&&o(a[i],i,a)!==!1;);return n}})(ZM),dm=function(e){return e},A4=function(e){return typeof e=="function"?e:dm},M4=function(e,t){return(Ma(e)?GM:fE)(e,A4(t))},T4=M4,mhe=function(e,t){var n=[];return fE(e,(function(o,r,i){t(o,r,i)&&n.push(o)})),n},ghe=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},yhe=function(e){return this.__data__.has(e)};function aw(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new iE;++t<n;)this.add(e[t])}aw.prototype.add=aw.prototype.push=ghe,aw.prototype.has=yhe;var C4=aw,_he=function(e,t){for(var n=-1,o=e==null?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1},N4=function(e,t){return e.has(t)},k4=function(e,t,n,o,r,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var f=i.get(e),h=i.get(t);if(f&&h)return f==t&&h==e;var v=-1,b=!0,E=2&n?new C4:void 0;for(i.set(e,t),i.set(t,e);++v<s;){var O=e[v],w=t[v];if(o)var S=a?o(w,O,v,t,e,i):o(O,w,v,e,t,i);if(S!==void 0){if(S)continue;b=!1;break}if(E){if(!_he(t,(function(M,T){if(!N4(E,T)&&(O===M||r(O,M,n,o,i)))return E.push(T)}))){b=!1;break}}else if(O!==w&&!r(O,w,n,o,i)){b=!1;break}}return i.delete(e),i.delete(t),b},bhe=function(e){var t=-1,n=Array(e.size);return e.forEach((function(o,r){n[++t]=[r,o]})),n},JM=function(e){var t=-1,n=Array(e.size);return e.forEach((function(o){n[++t]=o})),n},MD=ic?ic.prototype:void 0,US=MD?MD.valueOf:void 0,whe=function(e,t,n,o,r,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new b1(e),new b1(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return cy(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=bhe;case"[object Set]":var l=1&o;if(s||(s=JM),e.size!=t.size&&!l)return!1;var f=a.get(e);if(f)return f==t;o|=2,a.set(e,t);var h=k4(s(e),s(t),o,r,i,a);return a.delete(e),h;case"[object Symbol]":if(US)return US.call(e)==US.call(t)}return!1},Ehe=Object.prototype.hasOwnProperty,xhe=function(e,t,n,o,r,i){var a=1&n,s=E2(e),l=s.length;if(l!=E2(t).length&&!a)return!1;for(var f=l;f--;){var h=s[f];if(!(a?h in t:Ehe.call(t,h)))return!1}var v=i.get(e),b=i.get(t);if(v&&b)return v==t&&b==e;var E=!0;i.set(e,t),i.set(t,e);for(var O=a;++f<l;){var w=e[h=s[f]],S=t[h];if(o)var M=a?o(S,w,h,t,e,i):o(w,S,h,e,t,i);if(!(M===void 0?w===S||r(w,S,n,o,i):M)){E=!1;break}O||(O=h=="constructor")}if(E&&!O){var T=e.constructor,$=t.constructor;T==$||!("constructor"in e)||!("constructor"in t)||typeof T=="function"&&T instanceof T&&typeof $=="function"&&$ instanceof $||(E=!1)}return i.delete(e),i.delete(t),E},TD=Object.prototype.hasOwnProperty,Ohe=function(e,t,n,o,r,i){var a=Ma(e),s=Ma(t),l=a?"[object Array]":Qv(e),f=s?"[object Array]":Qv(t),h=(l=l=="[object Arguments]"?"[object Object]":l)=="[object Object]",v=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",b=l==f;if(b&&Jv(e)){if(!Jv(t))return!1;a=!0,h=!1}if(b&&!h)return i||(i=new Tg),a||db(e)?k4(e,t,n,o,r,i):whe(e,t,l,n,o,r,i);if(!(1&n)){var E=h&&TD.call(e,"__wrapped__"),O=v&&TD.call(t,"__wrapped__");if(E||O){var w=E?e.value():e,S=O?t.value():t;return i||(i=new Tg),r(w,S,n,o,i)}}return!!b&&(i||(i=new Tg),xhe(e,t,n,o,r,i))},P4=function e(t,n,o,r,i){return t===n||(t==null||n==null||!nd(t)&&!nd(n)?t!=t&&n!=n:Ohe(t,n,o,r,e,i))},She=function(e,t,n,o){var r=n.length,i=r;if(e==null)return!i;for(e=Object(e);r--;){var a=n[r];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){var s=(a=n[r])[0],l=e[s],f=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var h=new Tg,v;if(!(v===void 0?P4(f,l,3,o,h):v))return!1}}return!0},R4=function(e){return e==e&&!Xs(e)},Ahe=function(e){for(var t=$h(e),n=t.length;n--;){var o=t[n],r=e[o];t[n]=[o,r,R4(r)]}return t},D4=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},Mhe=function(e){var t=Ahe(e);return t.length==1&&t[0][2]?D4(t[0][0],t[0][1]):function(n){return n===e||She(n,e,t)}},em=function(e){return typeof e=="symbol"||nd(e)&&Bh(e)=="[object Symbol]"},The=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Che=/^\w*$/,QM=function(e,t){if(Ma(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!em(e))||Che.test(e)||!The.test(e)||t!=null&&e in Object(t)};function eT(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=e.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(eT.Cache||iE),n}eT.Cache=iE;var Nhe=eT,khe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Phe=/\\(\\)?/g,Rhe=(function(e){var t=Nhe(e,(function(o){return n.size===500&&n.clear(),o})),n=t.cache;return t})((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(khe,(function(n,o,r,i){t.push(r?i.replace(Phe,"$1"):o||n)})),t})),Ng=function(e,t){for(var n=-1,o=e==null?0:e.length,r=Array(o);++n<o;)r[n]=t(e[n],n,e);return r},CD=ic?ic.prototype:void 0,ND=CD?CD.toString:void 0,Dhe=function e(t){if(typeof t=="string")return t;if(Ma(t))return Ng(t,e)+"";if(em(t))return ND?ND.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},j4=function(e){return e==null?"":Dhe(e)},pE=function(e,t){return Ma(e)?e:QM(e,t)?[e]:Rhe(j4(e))},fb=function(e){if(typeof e=="string"||em(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},hE=function(e,t){for(var n=0,o=(t=pE(t,e)).length;e!=null&&n<o;)e=e[fb(t[n++])];return n&&n==o?e:void 0},jhe=function(e,t,n){var o=e==null?void 0:hE(e,t);return o===void 0?n:o},Lhe=function(e,t){return e!=null&&t in Object(e)},L4=function(e,t,n){for(var o=-1,r=(t=pE(t,e)).length,i=!1;++o<r;){var a=fb(t[o]);if(!(i=e!=null&&n(e,a)))break;e=e[a]}return i||++o!=r?i:!!(r=e==null?0:e.length)&&WM(r)&&sE(a,r)&&(Ma(e)||Yg(e))},I4=function(e,t){return e!=null&&L4(e,t,Lhe)},Ihe=function(e,t){return QM(e)&&R4(t)?D4(fb(e),t):function(n){var o=jhe(n,e);return o===void 0&&o===t?I4(n,e):P4(t,o,3)}},F4=function(e){return function(t){return t==null?void 0:t[e]}},Fhe=function(e){return function(t){return hE(t,e)}},Bhe=function(e){return QM(e)?F4(fb(e)):Fhe(e)},mp=function(e){return typeof e=="function"?e:e==null?dm:typeof e=="object"?Ma(e)?Ihe(e[0],e[1]):Mhe(e):Bhe(e)},B4=function(e,t){return(Ma(e)?y4:mhe)(e,mp(t))},$he=Object.prototype.hasOwnProperty,Uhe=function(e,t){return e!=null&&$he.call(e,t)},$4=function(e,t){return e!=null&&L4(e,t,Uhe)},Vhe=Object.prototype.hasOwnProperty,Ghe=function(e){if(e==null)return!0;if(vp(e)&&(Ma(e)||typeof e=="string"||typeof e.splice=="function"||Jv(e)||db(e)||Yg(e)))return!e.length;var t=Qv(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(cE(e))return!zM(e).length;for(var n in e)if(Vhe.call(e,n))return!1;return!0},U4=function(e){return e===void 0},V4=function(e,t){var n=-1,o=vp(e)?Array(e.length):[];return fE(e,(function(r,i,a){o[++n]=t(r,i,a)})),o},G4=function(e,t){return(Ma(e)?Ng:V4)(e,mp(t))},Whe=function(e,t,n,o){var r=-1,i=e==null?0:e.length;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n},zhe=function(e,t,n,o,r){return r(e,(function(i,a,s){n=o?(o=!1,i):t(n,i,a,s)})),n},W4=function(e,t,n){var o=Ma(e)?Whe:zhe,r=arguments.length<3;return o(e,mp(t),n,r,fE)},Hhe=function(e){return typeof e=="string"||!Ma(e)&&nd(e)&&Bh(e)=="[object String]"},Xhe=F4("length"),Yhe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),qhe=function(e){return Yhe.test(e)},Khe="[\\ud800-\\udfff]",A2="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",M2="\\ud83c[\\udffb-\\udfff]",z4="[^\\ud800-\\udfff]",H4="(?:\\ud83c[\\udde6-\\uddff]){2}",X4="[\\ud800-\\udbff][\\udc00-\\udfff]",kD="(?:"+A2+"|"+M2+")?",Zhe="[\\ufe0e\\ufe0f]?"+kD+("(?:\\u200d(?:"+[z4,H4,X4].join("|")+")[\\ufe0e\\ufe0f]?"+kD+")*"),Jhe="(?:"+[z4+A2+"?",A2,H4,X4,Khe].join("|")+")",PD=RegExp(M2+"(?="+M2+")|"+Jhe+Zhe,"g"),Qhe=function(e){for(var t=PD.lastIndex=0;PD.test(e);)++t;return t},eve=function(e){return qhe(e)?Qhe(e):Xhe(e)},tve=function(e){if(e==null)return 0;if(vp(e))return Hhe(e)?eve(e):e.length;var t=Qv(e);return t=="[object Map]"||t=="[object Set]"?e.size:zM(e).length},nve=function(e,t,n){var o=Ma(e),r=o||Jv(e)||db(e);if(t=mp(t),n==null){var i=e&&e.constructor;n=r?o?new i:[]:Xs(e)&&ub(i)?x4(dE(e)):{}}return(r?GM:ZM)(e,(function(a,s,l){return t(n,a,s,l)})),n},RD=ic?ic.isConcatSpreadable:void 0,rve=function(e){return Ma(e)||Yg(e)||!!(RD&&e&&e[RD])},tT=function(t,n,o,r,i){var a=-1,s=t.length;for(o||(o=rve),i||(i=[]);++a<s;){var l=t[a];o(l)?XM(i,l):r||(i[i.length]=l)}return i},ove=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},DD=Math.max,Y4=function(e,t,n){return t=DD(t===void 0?e.length-1:t,0),function(){for(var o=arguments,r=-1,i=DD(o.length-t,0),a=Array(i);++r<i;)a[r]=o[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=o[r];return s[t]=n(a),ove(e,this,s)}},ive=_1?function(e,t){return _1(e,"toString",{configurable:!0,enumerable:!1,value:qM(t),writable:!0})}:dm,ave=Date.now,q4=(function(e){var t=0,n=0;return function(){var o=ave(),r=16-(o-n);if(n=o,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}})(ive),vE=function(e,t){return q4(Y4(e,t,dm),e+"")},K4=function(e,t,n,o){for(var r=e.length,i=n+-1;++i<r;)if(t(e[i],i,e))return i;return-1},lve=function(e){return e!=e},sve=function(e,t,n){for(var o=n-1,r=e.length;++o<r;)if(e[o]===t)return o;return-1},uve=function(e,t,n){return t==t?sve(e,t,n):K4(e,lve,n)},cve=function(e,t){return!!(e!=null&&e.length)&&uve(e,t,0)>-1},dve=function(){},fve=Cg&&1/JM(new Cg([,-0]))[1]==1/0?function(e){return new Cg(e)}:dve,pve=function(e,t,n){var o=-1,r=cve,i=e.length,a=!0,s=[],l=s;if(i>=200){var f=fve(e);if(f)return JM(f);a=!1,r=N4,l=new C4}else l=s;e:for(;++o<i;){var h=e[o],v=h;if(h=h!==0?h:0,a&&v==v){for(var b=l.length;b--;)if(l[b]===v)continue e;s.push(h)}else r(l,v,n)||(l!==s&&l.push(v),s.push(h))}return s},Z4=function(e){return nd(e)&&vp(e)},hve=vE((function(e){return pve(tT(e,1,Z4,!0))})),vve=function(e,t){return Ng(t,(function(n){return e[n]}))},w1,J4=function(e){return e==null?[]:vve(e,$h(e))};try{w1={clone:vhe,constant:qM,each:T4,filter:B4,has:$4,isArray:Ma,isEmpty:Ghe,isFunction:ub,isUndefined:U4,keys:$h,map:G4,reduce:W4,size:tve,transform:nve,union:hve,values:J4}}catch{}w1||(w1=window._);var tr=w1,nT=Po;function Po(e){this._isDirected=!tr.has(e,"directed")||e.directed,this._isMultigraph=!!tr.has(e,"multigraph")&&e.multigraph,this._isCompound=!!tr.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=tr.constant(void 0),this._defaultEdgeLabelFn=tr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function jD(e,t){e[t]?e[t]++:e[t]=1}function LD(e,t){--e[t]||delete e[t]}function Zy(e,t,n,o){var r=""+t,i=""+n;if(!e&&r>i){var a=r;r=i,i=a}return r+""+i+""+(tr.isUndefined(o)?"\0":o)}function mve(e,t,n,o){var r=""+t,i=""+n;if(!e&&r>i){var a=r;r=i,i=a}var s={v:r,w:i};return o&&(s.name=o),s}function VS(e,t){return Zy(e,t.v,t.w,t.name)}Po.prototype._nodeCount=0,Po.prototype._edgeCount=0,Po.prototype.isDirected=function(){return this._isDirected},Po.prototype.isMultigraph=function(){return this._isMultigraph},Po.prototype.isCompound=function(){return this._isCompound},Po.prototype.setGraph=function(e){return this._label=e,this},Po.prototype.graph=function(){return this._label},Po.prototype.setDefaultNodeLabel=function(e){return tr.isFunction(e)||(e=tr.constant(e)),this._defaultNodeLabelFn=e,this},Po.prototype.nodeCount=function(){return this._nodeCount},Po.prototype.nodes=function(){return tr.keys(this._nodes)},Po.prototype.sources=function(){var e=this;return tr.filter(this.nodes(),(function(t){return tr.isEmpty(e._in[t])}))},Po.prototype.sinks=function(){var e=this;return tr.filter(this.nodes(),(function(t){return tr.isEmpty(e._out[t])}))},Po.prototype.setNodes=function(e,t){var n=arguments,o=this;return tr.each(e,(function(r){n.length>1?o.setNode(r,t):o.setNode(r)})),this},Po.prototype.setNode=function(e,t){return tr.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},Po.prototype.node=function(e){return this._nodes[e]},Po.prototype.hasNode=function(e){return tr.has(this._nodes,e)},Po.prototype.removeNode=function(e){var t=this;if(tr.has(this._nodes,e)){var n=function(o){t.removeEdge(t._edgeObjs[o])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],tr.each(this.children(e),(function(o){t.setParent(o)})),delete this._children[e]),tr.each(tr.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],tr.each(tr.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},Po.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(tr.isUndefined(t))t="\0";else{for(var n=t+="";!tr.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},Po.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},Po.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!=="\0")return t}},Po.prototype.children=function(e){if(tr.isUndefined(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return tr.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}},Po.prototype.predecessors=function(e){var t=this._preds[e];if(t)return tr.keys(t)},Po.prototype.successors=function(e){var t=this._sucs[e];if(t)return tr.keys(t)},Po.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return tr.union(t,this.successors(e))},Po.prototype.isLeaf=function(e){return(this.isDirected()?this.successors(e):this.neighbors(e)).length===0},Po.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;tr.each(this._nodes,(function(i,a){e(a)&&t.setNode(a,i)})),tr.each(this._edgeObjs,(function(i){t.hasNode(i.v)&&t.hasNode(i.w)&&t.setEdge(i,n.edge(i))}));var o={};function r(i){var a=n.parent(i);return a===void 0||t.hasNode(a)?(o[i]=a,a):a in o?o[a]:r(a)}return this._isCompound&&tr.each(t.nodes(),(function(i){t.setParent(i,r(i))})),t},Po.prototype.setDefaultEdgeLabel=function(e){return tr.isFunction(e)||(e=tr.constant(e)),this._defaultEdgeLabelFn=e,this},Po.prototype.edgeCount=function(){return this._edgeCount},Po.prototype.edges=function(){return tr.values(this._edgeObjs)},Po.prototype.setPath=function(e,t){var n=this,o=arguments;return tr.reduce(e,(function(r,i){return o.length>1?n.setEdge(r,i,t):n.setEdge(r,i),i})),this},Po.prototype.setEdge=function(){var e,t,n,o,r=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(e=i.v,t=i.w,n=i.name,arguments.length===2&&(o=arguments[1],r=!0)):(e=i,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,tr.isUndefined(n)||(n=""+n);var a=Zy(this._isDirected,e,t,n);if(tr.has(this._edgeLabels,a))return r&&(this._edgeLabels[a]=o),this;if(!tr.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[a]=r?o:this._defaultEdgeLabelFn(e,t,n);var s=mve(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[a]=s,jD(this._preds[t],e),jD(this._sucs[e],t),this._in[t][a]=s,this._out[e][a]=s,this._edgeCount++,this},Po.prototype.edge=function(e,t,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,e,t,n);return this._edgeLabels[o]},Po.prototype.hasEdge=function(e,t,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,e,t,n);return tr.has(this._edgeLabels,o)},Po.prototype.removeEdge=function(e,t,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,e,t,n),r=this._edgeObjs[o];return r&&(e=r.v,t=r.w,delete this._edgeLabels[o],delete this._edgeObjs[o],LD(this._preds[t],e),LD(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this},Po.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=tr.values(n);return t?tr.filter(o,(function(r){return r.v===t})):o}},Po.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=tr.values(n);return t?tr.filter(o,(function(r){return r.w===t})):o}},Po.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))};var ID={Graph:nT,version:"2.1.8"},gve={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:yve(e),edges:_ve(e)};return tr.isUndefined(e.graph())||(t.value=tr.clone(e.graph())),t},read:function(e){var t=new nT(e.options).setGraph(e.value);return tr.each(e.nodes,(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)})),tr.each(e.edges,(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),t}};function yve(e){return tr.map(e.nodes(),(function(t){var n=e.node(t),o=e.parent(t),r={v:t};return tr.isUndefined(n)||(r.value=n),tr.isUndefined(o)||(r.parent=o),r}))}function _ve(e){return tr.map(e.edges(),(function(t){var n=e.edge(t),o={v:t.v,w:t.w};return tr.isUndefined(t.name)||(o.name=t.name),tr.isUndefined(n)||(o.value=n),o}))}var bve=function(e){var t,n={},o=[];function r(i){tr.has(n,i)||(n[i]=!0,t.push(i),tr.each(e.successors(i),r),tr.each(e.predecessors(i),r))}return tr.each(e.nodes(),(function(i){t=[],r(i),t.length&&o.push(t)})),o},Q4=Wu;function Wu(){this._arr=[],this._keyIndices={}}Wu.prototype.size=function(){return this._arr.length},Wu.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},Wu.prototype.has=function(e){return tr.has(this._keyIndices,e)},Wu.prototype.priority=function(e){var t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority},Wu.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Wu.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!tr.has(n,e)){var o=this._arr,r=o.length;return n[e]=r,o.push({key:e,priority:t}),this._decrease(r),!0}return!1},Wu.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},Wu.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},Wu.prototype._heapify=function(e){var t=this._arr,n=2*e,o=n+1,r=e;n<t.length&&(r=t[n].priority<t[r].priority?n:r,o<t.length&&(r=t[o].priority<t[r].priority?o:r),r!==e&&(this._swap(e,r),this._heapify(r)))},Wu.prototype._decrease=function(e){for(var t,n=this._arr,o=n[e].priority;e!==0&&!(n[t=e>>1].priority<o);)this._swap(e,t),e=t},Wu.prototype._swap=function(e,t){var n=this._arr,o=this._keyIndices,r=n[e],i=n[t];n[e]=i,n[t]=r,o[i.key]=e,o[r.key]=t};var e5=function(e,t,n,o){return(function(r,i,a,s){var l,f,h={},v=new Q4,b=function(E){var O=E.v!==l?E.v:E.w,w=h[O],S=a(E),M=f.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+E+" Weight: "+S);M<w.distance&&(w.distance=M,w.predecessor=l,v.decrease(O,M))};for(r.nodes().forEach((function(E){var O=E===i?0:Number.POSITIVE_INFINITY;h[E]={distance:O},v.add(E,O)}));v.size()>0&&(l=v.removeMin(),(f=h[l]).distance!==Number.POSITIVE_INFINITY);)s(l).forEach(b);return h})(e,String(t),n||wve,o||function(r){return e.outEdges(r)})},wve=tr.constant(1),Eve=function(e,t,n){return tr.transform(e.nodes(),(function(o,r){o[r]=e5(e,r,t,n)}),{})},t5=function(e){var t=0,n=[],o={},r=[];function i(a){var s=o[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach((function(h){tr.has(o,h)?o[h].onStack&&(s.lowlink=Math.min(s.lowlink,o[h].index)):(i(h),s.lowlink=Math.min(s.lowlink,o[h].lowlink))})),s.lowlink===s.index){var l,f=[];do l=n.pop(),o[l].onStack=!1,f.push(l);while(a!==l);r.push(f)}}return e.nodes().forEach((function(a){tr.has(o,a)||i(a)})),r},xve=function(e){return tr.filter(t5(e),(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])}))},Ove=function(e,t,n){return(function(o,r,i){var a={},s=o.nodes();return s.forEach((function(l){a[l]={},a[l][l]={distance:0},s.forEach((function(f){l!==f&&(a[l][f]={distance:Number.POSITIVE_INFINITY})})),i(l).forEach((function(f){var h=f.v===l?f.w:f.v,v=r(f);a[l][h]={distance:v,predecessor:l}}))})),s.forEach((function(l){var f=a[l];s.forEach((function(h){var v=a[h];s.forEach((function(b){var E=v[l],O=f[b],w=v[b],S=E.distance+O.distance;S<w.distance&&(w.distance=S,w.predecessor=O.predecessor)}))}))})),a})(e,t||Sve,n||function(o){return e.outEdges(o)})},Sve=tr.constant(1),GS=n5;function n5(e){var t={},n={},o=[];if(tr.each(e.sinks(),(function r(i){if(tr.has(n,i))throw new E1;tr.has(t,i)||(n[i]=!0,t[i]=!0,tr.each(e.predecessors(i),r),delete n[i],o.push(i))})),tr.size(t)!==e.nodeCount())throw new E1;return o}function E1(){}n5.CycleException=E1,E1.prototype=new Error;var FD=function(e,t,n){tr.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),r=[],i={};return tr.each(t,(function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);r5(e,a,n==="post",i,o,r)})),r};function r5(e,t,n,o,r,i){tr.has(o,t)||(o[t]=!0,n||i.push(t),tr.each(r(t),(function(a){r5(e,a,n,o,r,i)})),n&&i.push(t))}var x1,Ave={Graph:ID.Graph,json:gve,alg:{components:bve,dijkstra:e5,dijkstraAll:Eve,findCycles:xve,floydWarshall:Ove,isAcyclic:function(e){try{GS(e)}catch(t){if(t instanceof GS.CycleException)return!1;throw t}return!0},postorder:function(e,t){return FD(e,t,"post")},preorder:function(e,t){return FD(e,t,"pre")},prim:function(e,t){var n,o=new nT,r={},i=new Q4;function a(l){var f=l.v===n?l.w:l.v,h=i.priority(f);if(h!==void 0){var v=t(l);v<h&&(r[f]=n,i.decrease(f,v))}}if(e.nodeCount()===0)return o;tr.each(e.nodes(),(function(l){i.add(l,Number.POSITIVE_INFINITY),o.setNode(l)})),i.decrease(e.nodes()[0],0);for(var s=!1;i.size()>0;){if(n=i.removeMin(),tr.has(r,n))o.setEdge(n,r[n]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(n).forEach(a)}return o},tarjan:t5,topsort:GS},version:ID.version};try{x1=Ave}catch{}x1||(x1=window.graphlib);var nf=x1,Mve=function(e){return S4(e,5)},W_=function(e,t,n){if(!Xs(n))return!1;var o=typeof t;return!!(o=="number"?vp(n)&&sE(t,n.length):o=="string"&&t in n)&&cy(n[t],e)},o5=Object.prototype,Tve=o5.hasOwnProperty,Cve=vE((function(e,t){e=Object(e);var n=-1,o=t.length,r=o>2?t[2]:void 0;for(r&&W_(t[0],t[1],r)&&(o=1);++n<o;)for(var i=t[n],a=cm(i),s=-1,l=a.length;++s<l;){var f=a[s],h=e[f];(h===void 0||cy(h,o5[f])&&!Tve.call(e,f))&&(e[f]=i[f])}return e})),Nve=function(e){return function(t,n,o){var r=Object(t);if(!vp(t)){var i=mp(n);t=$h(t),n=function(s){return i(r[s],s,r)}}var a=e(t,n,o);return a>-1?r[i?t[a]:a]:void 0}},kve=/^\s+|\s+$/g,Pve=/^[-+]0x[0-9a-f]+$/i,Rve=/^0b[01]+$/i,Dve=/^0o[0-7]+$/i,jve=parseInt,Lve=function(e){if(typeof e=="number")return e;if(em(e))return NaN;if(Xs(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xs(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(kve,"");var n=Rve.test(e);return n||Dve.test(e)?jve(e.slice(2),n?2:8):Pve.test(e)?NaN:+e},lw=function(e){return e?(e=Lve(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},Ive=function(e){var t=lw(e),n=t%1;return t==t?n?t-n:t:0},Fve=Math.max,Bve=Nve((function(e,t,n){var o=e==null?0:e.length;if(!o)return-1;var r=n==null?0:Ive(n);return r<0&&(r=Fve(o+r,0)),K4(e,mp(t),r)})),i5=function(e){return e!=null&&e.length?tT(e):[]},$ve=function(e,t){return e==null?e:KM(e,A4(t),cm)},Uve=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0},Vve=function(e,t){var n={};return t=mp(t),ZM(e,(function(o,r,i){aE(n,r,t(o,r,i))})),n},rT=function(e,t,n){for(var o=-1,r=e.length;++o<r;){var i=e[o],a=t(i);if(a!=null&&(s===void 0?a==a&&!em(a):n(a,s)))var s=a,l=i}return l},Gve=function(e,t){return e>t},Wve=function(e){return e&&e.length?rT(e,dm,Gve):void 0},T2=function(e,t,n){(n!==void 0&&!cy(e[t],n)||n===void 0&&!(t in e))&&aE(e,t,n)},zve=Function.prototype,Hve=Object.prototype,a5=zve.toString,Xve=Hve.hasOwnProperty,Yve=a5.call(Object),qve=function(e){if(!nd(e)||Bh(e)!="[object Object]")return!1;var t=dE(e);if(t===null)return!0;var n=Xve.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&a5.call(n)==Yve},BD=function(e,t){if((t!=="constructor"||typeof e[t]!="function")&&t!="__proto__")return e[t]},Kve=function(e){return cb(e,cm(e))},Zve=function(e,t,n,o,r,i,a){var s=BD(e,n),l=BD(t,n),f=a.get(l);if(f)T2(e,n,f);else{var h=void 0,v=h===void 0;if(v){var b=Ma(l),E=!b&&Jv(l),O=!b&&!E&&db(l);h=l,b||E||O?Ma(s)?h=s:Z4(s)?h=g4(s):E?(v=!1,h=m4(l,!0)):O?(v=!1,h=E4(l,!0)):h=[]:qve(l)||Yg(l)?(h=s,Yg(s)?h=Kve(s):Xs(s)&&!ub(s)||(h=O4(l))):v=!1}v&&(a.set(l,h),r(h,l,o,i,a),a.delete(l)),T2(e,n,h)}},Jve=function e(t,n,o,r,i){t!==n&&KM(n,(function(a,s){if(i||(i=new Tg),Xs(a))Zve(t,n,s,o,e,r,i);else{var l=void 0;l===void 0&&(l=a),T2(t,s,l)}}),cm)},Qve=(function(e){return vE((function(t,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(r--,i):void 0,a&&W_(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),t=Object(t);++o<r;){var s=n[o];s&&e(t,s,o,i)}return t}))})((function(e,t,n){Jve(e,t,n)})),l5=function(e,t){return e<t},eme=function(e){return e&&e.length?rT(e,dm,l5):void 0},tme=function(e,t){return e&&e.length?rT(e,mp(t),l5):void 0},nme=function(){return od.Date.now()},rme=function(e,t,n,o){if(!Xs(e))return e;for(var r=-1,i=(t=pE(t,e)).length,a=i-1,s=e;s!=null&&++r<i;){var l=fb(t[r]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(r!=a){var h=s[l];(f=void 0)==void 0&&(f=Xs(h)?h:sE(t[r+1])?[]:{})}lE(s,l,f),s=s[l]}return e},ome=function(e,t,n){for(var o=-1,r=t.length,i={};++o<r;){var a=t[o],s=hE(e,a);n(s,a)&&rme(i,pE(a,e),s)}return i},ime=function(e,t){return ome(e,t,(function(n,o){return I4(e,o)}))},ame=(function(e){return q4(Y4(e,void 0,i5),e+"")})((function(e,t){return e==null?{}:ime(e,t)})),lme=Math.ceil,sme=Math.max,ume=function(e,t,n,o){for(var r=-1,i=sme(lme((t-e)/(n||1)),0),a=Array(i);i--;)a[++r]=e,e+=n;return a},cme=(function(e){return function(t,n,o){return o&&typeof o!="number"&&W_(t,n,o)&&(n=o=void 0),t=lw(t),n===void 0?(n=t,t=0):n=lw(n),o=o===void 0?t<n?1:-1:lw(o),ume(t,n,o)}})(),dme=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},fme=function(e,t){if(e!==t){var n=e!==void 0,o=e===null,r=e==e,i=em(e),a=t!==void 0,s=t===null,l=t==t,f=em(t);if(!s&&!f&&!i&&e>t||i&&a&&l&&!s&&!f||o&&a&&l||!n&&l||!r)return 1;if(!o&&!i&&!f&&e<t||f&&n&&r&&!o&&!i||s&&n&&r||!a&&r||!l)return-1}return 0},pme=function(e,t,n){for(var o=-1,r=e.criteria,i=t.criteria,a=r.length,s=n.length;++o<a;){var l=fme(r[o],i[o]);if(l)return o>=s?l:l*(n[o]=="desc"?-1:1)}return e.index-t.index},hme=function(e,t,n){t=t.length?Ng(t,(function(i){return Ma(i)?function(a){return hE(a,i.length===1?i[0]:i)}:i})):[dm];var o=-1;t=Ng(t,uE(mp));var r=V4(e,(function(i,a,s){return{criteria:Ng(t,(function(l){return l(i)})),index:++o,value:i}}));return dme(r,(function(i,a){return pme(i,a,n)}))},vme=vE((function(e,t){if(e==null)return[];var n=t.length;return n>1&&W_(e,t[0],t[1])?t=[]:n>2&&W_(t[0],t[1],t[2])&&(t=[t[0]]),hme(e,tT(t),[])})),mme=0,gme=function(e){var t=++mme;return j4(e)+t},yme=function(e,t,n){for(var o=-1,r=e.length,i=t.length,a={};++o<r;){var s=o<i?t[o]:void 0;n(a,e[o],s)}return a},O1,_me=function(e,t){return yme(e||[],t||[],lE)};try{O1={cloneDeep:Mve,constant:qM,defaults:Cve,each:T4,filter:B4,find:Bve,flatten:i5,forEach:M4,forIn:$ve,has:$4,isUndefined:U4,last:Uve,map:G4,mapValues:Vve,max:Wve,merge:Qve,min:eme,minBy:tme,now:nme,pick:ame,range:cme,reduce:W4,sortBy:vme,uniqueId:gme,values:J4,zipObject:_me}}catch{}O1||(O1=window._);var bme=O1;nf.Graph;bme.constant(1);nf.Graph;nf.Graph;nf.alg.preorder;nf.alg.postorder;nf.Graph;nf.Graph;nf.Graph;nf.Graph;nf.Graph;var WS,$D;function wme(){if($D)return WS;$D=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return WS=t,WS}var zS,UD;function Eme(){if(UD)return zS;UD=1;var e=F2(),t=wme(),n=B2(),o="[object Arguments]",r="[object Array]",i="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",h="[object Number]",v="[object Object]",b="[object RegExp]",E="[object Set]",O="[object String]",w="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",T="[object Float32Array]",$="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",I="[object Uint8ClampedArray]",V="[object Uint16Array]",z="[object Uint32Array]",q={};q[T]=q[$]=q[D]=q[P]=q[B]=q[F]=q[I]=q[V]=q[z]=!0,q[o]=q[r]=q[S]=q[i]=q[M]=q[a]=q[s]=q[l]=q[f]=q[h]=q[v]=q[b]=q[E]=q[O]=q[w]=!1;function X(G){return n(G)&&t(G.length)&&!!q[e(G)]}return zS=X,zS}var HS,VD;function xme(){if(VD)return HS;VD=1;function e(t){return function(n){return t(n)}}return HS=e,HS}var Jy={exports:{}};Jy.exports;var GD;function Ome(){return GD||(GD=1,(function(e,t){var n=m9(),o=t&&!t.nodeType&&t,r=o&&!0&&e&&!e.nodeType&&e,i=r&&r.exports===o,a=i&&n.process,s=(function(){try{var l=r&&r.require&&r.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}})();e.exports=s})(Jy,Jy.exports)),Jy.exports}var XS,WD;function Sme(){if(WD)return XS;WD=1;var e=Eme(),t=xme(),n=Ome(),o=n&&n.isTypedArray,r=o?t(o):e;return XS=r,XS}Sme();var YS,zD;function Ame(){if(zD)return YS;zD=1;var e=F2(),t=B2(),n="[object Number]";function o(r){return typeof r=="number"||t(r)&&e(r)==n}return YS=o,YS}Ame();var qS={exports:{}},KS={exports:{}},HD;function s5(){return HD||(HD=1,(function(e){function t(n,o){this.v=n,this.k=o}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(KS)),KS.exports}var ZS={exports:{}},JS={exports:{}},XD;function u5(){return XD||(XD=1,(function(e){function t(n,o,r,i){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}e.exports=t=function(l,f,h,v){function b(E,O){t(l,E,function(w){return this._invoke(E,O,w)})}f?a?a(l,f,{value:h,enumerable:!v,configurable:!v,writable:!v}):l[f]=h:(b("next",0),b("throw",1),b("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,o,r,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(JS)),JS.exports}var YD;function c5(){return YD||(YD=1,(function(e){var t=u5();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var o,r,i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function l(S,M,T,$){var D=M&&M.prototype instanceof h?M:h,P=Object.create(D.prototype);return t(P,"_invoke",(function(B,F,I){var V,z,q,X=0,G=I||[],Q=!1,J={p:0,n:0,v:o,a:ie,f:ie.bind(o,4),d:function(Ae,Pe){return V=Ae,z=0,q=o,J.n=Pe,f}};function ie(Se,Ae){for(z=Se,q=Ae,r=0;!Q&&X&&!Pe&&r<G.length;r++){var Pe,De=G[r],ze=J.p,Ye=De[2];Se>3?(Pe=Ye===Ae)&&(q=De[(z=De[4])?5:(z=3,3)],De[4]=De[5]=o):De[0]<=ze&&((Pe=Se<2&&ze<De[1])?(z=0,J.v=Ae,J.n=De[1]):ze<Ye&&(Pe=Se<3||De[0]>Ae||Ae>Ye)&&(De[4]=Se,De[5]=Ae,J.n=Ye,z=0))}if(Pe||Se>1)return f;throw Q=!0,Ae}return function(Se,Ae,Pe){if(X>1)throw TypeError("Generator is already running");for(Q&&Ae===1&&ie(Ae,Pe),z=Ae,q=Pe;(r=z<2?o:q)||!Q;){V||(z?z<3?(z>1&&(J.n=-1),ie(z,q)):J.n=q:J.v=q);try{if(X=2,V){if(z||(Se="next"),r=V[Se]){if(!(r=r.call(V,q)))throw TypeError("iterator result is not an object");if(!r.done)return r;q=r.value,z<2&&(z=0)}else z===1&&(r=V.return)&&r.call(V),z<2&&(q=TypeError("The iterator does not provide a '"+Se+"' method"),z=1);V=o}else if((r=(Q=J.n<0)?q:B.call(F,J))!==f)break}catch(De){V=o,z=1,q=De}finally{X=1}}return{value:r,done:Q}}})(S,T,$),!0),P}var f={};function h(){}function v(){}function b(){}r=Object.getPrototypeOf;var E=[][a]?r(r([][a]())):(t(r={},a,function(){return this}),r),O=b.prototype=h.prototype=Object.create(E);function w(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,b):(S.__proto__=b,t(S,s,"GeneratorFunction")),S.prototype=Object.create(O),S}return v.prototype=b,t(O,"constructor",b),t(b,"constructor",v),v.displayName="GeneratorFunction",t(b,s,"GeneratorFunction"),t(O),t(O,s,"Generator"),t(O,a,function(){return this}),t(O,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:l,m:w}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ZS)),ZS.exports}var QS={exports:{}},eA={exports:{}},tA={exports:{}},qD;function d5(){return qD||(qD=1,(function(e){var t=s5(),n=u5();function o(r,i){function a(l,f,h,v){try{var b=r[l](f),E=b.value;return E instanceof t?i.resolve(E.v).then(function(O){a("next",O,h,v)},function(O){a("throw",O,h,v)}):i.resolve(E).then(function(O){b.value=O,h(b)},function(O){return a("throw",O,h,v)})}catch(O){v(O)}}var s;this.next||(n(o.prototype),n(o.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(l,f,h){function v(){return new i(function(b,E){a(l,h,b,E)})}return s=s?s.then(v,v):v()},!0)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(tA)),tA.exports}var KD;function f5(){return KD||(KD=1,(function(e){var t=c5(),n=d5();function o(r,i,a,s,l){return new n(t().w(r,i,a,s),l||Promise)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(eA)),eA.exports}var ZD;function Mme(){return ZD||(ZD=1,(function(e){var t=f5();function n(o,r,i,a,s){var l=t(o,r,i,a,s);return l.next().then(function(f){return f.done?f.value:l.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(QS)),QS.exports}var nA={exports:{}},JD;function Tme(){return JD||(JD=1,(function(e){function t(n){var o=Object(n),r=[];for(var i in o)r.unshift(i);return function a(){for(;r.length;)if((i=r.pop())in o)return a.value=i,a.done=!1,a;return a.done=!0,a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(nA)),nA.exports}var rA={exports:{}},oA={exports:{}},QD;function Cme(){return QD||(QD=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(oA)),oA.exports}var ej;function Nme(){return ej||(ej=1,(function(e){var t=Cme().default;function n(o){if(o!=null){var r=o[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length))return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}throw new TypeError(t(o)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(rA)),rA.exports}var tj;function kme(){return tj||(tj=1,(function(e){var t=s5(),n=c5(),o=Mme(),r=f5(),i=d5(),a=Tme(),s=Nme();function l(){var f=n(),h=f.m(l),v=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function b(w){var S=typeof w=="function"&&w.constructor;return!!S&&(S===v||(S.displayName||S.name)==="GeneratorFunction")}var E={throw:1,return:2,break:3,continue:3};function O(w){var S,M;return function(T){S||(S={stop:function(){return M(T.a,2)},catch:function(){return T.v},abrupt:function(D,P){return M(T.a,E[D],P)},delegateYield:function(D,P,B){return S.resultName=P,M(T.d,s(D),B)},finish:function(D){return M(T.f,D)}},M=function(D,P,B){T.p=S.prev,T.n=S.next;try{return D(P,B)}finally{S.next=T.n}}),S.resultName&&(S[S.resultName]=T.v,S.resultName=void 0),S.sent=T.v,S.next=T.n;try{return w.call(this,S)}finally{T.p=S.prev,T.n=S.next}}}return(e.exports=l=function(){return{wrap:function(M,T,$,D){return f.w(O(M),T,$,D&&D.reverse())},isGeneratorFunction:b,mark:f.m,awrap:function(M,T){return new t(M,T)},AsyncIterator:i,async:function(M,T,$,D,P){return(b(T)?r:o)(O(M),T,$,D,P)},keys:a,values:s}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports})(qS)),qS.exports}var iA,nj;function Pme(){if(nj)return iA;nj=1;var e=kme()();iA=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return iA}Pme();var jn;(function(e){e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.CULL_FACE=2884]="CULL_FACE",e[e.BLEND=3042]="BLEND",e[e.DITHER=3024]="DITHER",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.TEXTURE1=33985]="TEXTURE1",e[e.TEXTURE2=33986]="TEXTURE2",e[e.TEXTURE3=33987]="TEXTURE3",e[e.TEXTURE4=33988]="TEXTURE4",e[e.TEXTURE5=33989]="TEXTURE5",e[e.TEXTURE6=33990]="TEXTURE6",e[e.TEXTURE7=33991]="TEXTURE7",e[e.TEXTURE8=33992]="TEXTURE8",e[e.TEXTURE9=33993]="TEXTURE9",e[e.TEXTURE10=33994]="TEXTURE10",e[e.TEXTURE11=33995]="TEXTURE11",e[e.TEXTURE12=33996]="TEXTURE12",e[e.TEXTURE13=33997]="TEXTURE13",e[e.TEXTURE14=33998]="TEXTURE14",e[e.TEXTURE15=33999]="TEXTURE15",e[e.TEXTURE16=34e3]="TEXTURE16",e[e.TEXTURE17=34001]="TEXTURE17",e[e.TEXTURE18=34002]="TEXTURE18",e[e.TEXTURE19=34003]="TEXTURE19",e[e.TEXTURE20=34004]="TEXTURE20",e[e.TEXTURE21=34005]="TEXTURE21",e[e.TEXTURE22=34006]="TEXTURE22",e[e.TEXTURE23=34007]="TEXTURE23",e[e.TEXTURE24=34008]="TEXTURE24",e[e.TEXTURE25=34009]="TEXTURE25",e[e.TEXTURE26=34010]="TEXTURE26",e[e.TEXTURE27=34011]="TEXTURE27",e[e.TEXTURE28=34012]="TEXTURE28",e[e.TEXTURE29=34013]="TEXTURE29",e[e.TEXTURE30=34014]="TEXTURE30",e[e.TEXTURE31=34015]="TEXTURE31",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.COPY_SRC=1]="COPY_SRC",e[e.COPY_DST=2]="COPY_DST",e[e.SAMPLED=4]="SAMPLED",e[e.STORAGE=8]="STORAGE",e[e.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(jn||(jn={}));var rj;(function(e){e.Void="Void",e.Boolean="Boolean",e.Float="Float",e.Uint32="Uint32",e.Int32="Int32",e.Vector="Vector",e.Vector2Float="vec2<f32>",e.Vector3Float="vec3<f32>",e.Vector4Float="vec4<f32>",e.Vector2Boolean="vec2<bool>",e.Vector3Boolean="vec3<bool>",e.Vector4Boolean="vec4<bool>",e.Vector2Uint="vec2<u32>",e.Vector3Uint="vec3<u32>",e.Vector4Uint="vec4<u32>",e.Vector2Int="vec2<i32>",e.Vector3Int="vec3<i32>",e.Vector4Int="vec4<i32>",e.Matrix="Matrix",e.Matrix3x3Float="mat3x3<f32>",e.Matrix4x4Float="mat4x4<i32>",e.Struct="Struct",e.FloatArray="Float[]",e.Vector4FloatArray="vec4<f32>[]"})(rj||(rj={}));var oj;(function(e){e.Program="Program",e.Identifier="Identifier",e.VariableDeclaration="VariableDeclaration",e.BlockStatement="BlockStatement",e.ReturnStatement="ReturnStatement",e.FunctionDeclaration="FunctionDeclaration",e.VariableDeclarator="VariableDeclarator",e.AssignmentExpression="AssignmentExpression",e.LogicalExpression="LogicalExpression",e.BinaryExpression="BinaryExpression",e.ArrayExpression="ArrayExpression",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.FunctionExpression="FunctionExpression",e.MemberExpression="MemberExpression",e.ConditionalExpression="ConditionalExpression",e.ExpressionStatement="ExpressionStatement",e.CallExpression="CallExpression",e.NumThreadStatement="NumThreadStatement",e.StorageStatement="StorageStatement",e.DoWhileStatement="DoWhileStatement",e.WhileStatement="WhileStatement",e.ForStatement="ForStatement",e.BreakStatement="BreakStatement",e.ContinueStatement="ContinueStatement",e.IfStatement="IfStatement",e.ImportedFunctionStatement="ImportedFunctionStatement"})(oj||(oj={}));var ij;(function(e){e.Input="Input",e.Output="Output",e.Uniform="Uniform",e.Workgroup="Workgroup",e.UniformConstant="UniformConstant",e.Image="Image",e.StorageBuffer="StorageBuffer",e.Private="Private",e.Function="Function"})(ij||(ij={}));var aj;(function(e){e.GLSL100="GLSL100",e.GLSL450="GLSL450",e.WGSL="WGSL"})(aj||(aj={}));var sw={exports:{}},Rme=sw.exports,lj;function Dme(){return lj||(lj=1,(function(e,t){(function(n,o){e.exports=o()})(Rme,(function(){var n=function(K){return K instanceof Uint8Array||K instanceof Uint16Array||K instanceof Uint32Array||K instanceof Int8Array||K instanceof Int16Array||K instanceof Int32Array||K instanceof Float32Array||K instanceof Float64Array||K instanceof Uint8ClampedArray},o=function(K,me){for(var Ie=Object.keys(me),wt=0;wt<Ie.length;++wt)K[Ie[wt]]=me[Ie[wt]];return K},r=`
|
||
`;function i(K){return typeof atob<"u"?atob(K):"base64:"+K}function a(K){var me=new Error("(regl) "+K);throw console.error(me),me}function s(K,me){K||a(me)}function l(K){return K?": "+K:""}function f(K,me,Ie){K in me||a("unknown parameter ("+K+")"+l(Ie)+". possible values: "+Object.keys(me).join())}function h(K,me){n(K)||a("invalid parameter type"+l(me)+". must be a typed array")}function v(K,me){switch(me){case"number":return typeof K=="number";case"object":return typeof K=="object";case"string":return typeof K=="string";case"boolean":return typeof K=="boolean";case"function":return typeof K=="function";case"undefined":return typeof K>"u";case"symbol":return typeof K=="symbol"}}function b(K,me,Ie){v(K,me)||a("invalid parameter type"+l(Ie)+". expected "+me+", got "+typeof K)}function E(K,me){K>=0&&(K|0)===K||a("invalid parameter type, ("+K+")"+l(me)+". must be a nonnegative integer")}function O(K,me,Ie){me.indexOf(K)<0&&a("invalid value"+l(Ie)+". must be one of: "+me)}var w=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function S(K){Object.keys(K).forEach(function(me){w.indexOf(me)<0&&a('invalid regl constructor argument "'+me+'". must be one of '+w)})}function M(K,me){for(K=K+"";K.length<me;)K=" "+K;return K}function T(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function $(K,me){this.number=K,this.line=me,this.errors=[]}function D(K,me,Ie){this.file=K,this.line=me,this.message=Ie}function P(){var K=new Error,me=(K.stack||K).toString(),Ie=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(me);if(Ie)return Ie[1];var wt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(me);return wt?wt[1]:"unknown"}function B(){var K=new Error,me=(K.stack||K).toString(),Ie=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(me);if(Ie)return Ie[1];var wt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(me);return wt?wt[1]:"unknown"}function F(K,me){var Ie=K.split(`
|
||
`),wt=1,Dt=0,yt={unknown:new T,0:new T};yt.unknown.name=yt[0].name=me||P(),yt.unknown.lines.push(new $(0,""));for(var Nt=0;Nt<Ie.length;++Nt){var tn=Ie[Nt],sn=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(tn);if(sn)switch(sn[1]){case"line":var nn=/(\d+)(\s+\d+)?/.exec(sn[2]);nn&&(wt=nn[1]|0,nn[2]&&(Dt=nn[2]|0,Dt in yt||(yt[Dt]=new T)));break;case"define":var Mt=/SHADER_NAME(_B64)?\s+(.*)$/.exec(sn[2]);Mt&&(yt[Dt].name=Mt[1]?i(Mt[2]):Mt[2]);break}yt[Dt].lines.push(new $(wt++,tn))}return Object.keys(yt).forEach(function(bn){var pn=yt[bn];pn.lines.forEach(function(rn){pn.index[rn.number]=rn})}),yt}function I(K){var me=[];return K.split(`
|
||
`).forEach(function(Ie){if(!(Ie.length<5)){var wt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Ie);wt?me.push(new D(wt[1]|0,wt[2]|0,wt[3].trim())):Ie.length>0&&me.push(new D("unknown",0,Ie))}}),me}function V(K,me){me.forEach(function(Ie){var wt=K[Ie.file];if(wt){var Dt=wt.index[Ie.line];if(Dt){Dt.errors.push(Ie),wt.hasErrors=!0;return}}K.unknown.hasErrors=!0,K.unknown.lines[0].errors.push(Ie)})}function z(K,me,Ie,wt,Dt){if(!K.getShaderParameter(me,K.COMPILE_STATUS)){var yt=K.getShaderInfoLog(me),Nt=wt===K.FRAGMENT_SHADER?"fragment":"vertex";Se(Ie,"string",Nt+" shader source must be a string",Dt);var tn=F(Ie,Dt),sn=I(yt);V(tn,sn),Object.keys(tn).forEach(function(nn){var Mt=tn[nn];if(!Mt.hasErrors)return;var bn=[""],pn=[""];function rn(Gt,st){bn.push(Gt),pn.push(st||"")}rn("file number "+nn+": "+Mt.name+`
|
||
`,"color:red;text-decoration:underline;font-weight:bold"),Mt.lines.forEach(function(Gt){if(Gt.errors.length>0){rn(M(Gt.number,4)+"| ","background-color:yellow; font-weight:bold"),rn(Gt.line+r,"color:red; background-color:yellow; font-weight:bold");var st=0;Gt.errors.forEach(function(St){var ln=St.message,Sn=/^\s*'(.*)'\s*:\s*(.*)$/.exec(ln);if(Sn){var Xt=Sn[1];switch(ln=Sn[2],Xt){case"assign":Xt="=";break}st=Math.max(Gt.line.indexOf(Xt,st),0)}else st=0;rn(M("| ",6)),rn(M("^^^",st+3)+r,"font-weight:bold"),rn(M("| ",6)),rn(ln+r,"font-weight:bold")}),rn(M("| ",6)+r)}else rn(M(Gt.number,4)+"| "),rn(Gt.line+r,"color:red")}),typeof document<"u"&&!window.chrome?(pn[0]=bn.join("%c"),console.log.apply(console,pn)):console.log(bn.join(""))}),s.raise("Error compiling "+Nt+" shader, "+tn[0].name)}}function q(K,me,Ie,wt,Dt){if(!K.getProgramParameter(me,K.LINK_STATUS)){var yt=K.getProgramInfoLog(me),Nt=F(Ie,Dt),tn=F(wt,Dt),sn='Error linking program with vertex shader, "'+tn[0].name+'", and fragment shader "'+Nt[0].name+'"';typeof document<"u"?console.log("%c"+sn+r+"%c"+yt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(sn+r+yt),s.raise(sn)}}function X(K){K._commandRef=P()}function G(K,me,Ie,wt){X(K);function Dt(sn){return sn?wt.id(sn):0}K._fragId=Dt(K.static.frag),K._vertId=Dt(K.static.vert);function yt(sn,nn){Object.keys(nn).forEach(function(Mt){sn[wt.id(Mt)]=!0})}var Nt=K._uniformSet={};yt(Nt,me.static),yt(Nt,me.dynamic);var tn=K._attributeSet={};yt(tn,Ie.static),yt(tn,Ie.dynamic),K._hasCount="count"in K.static||"count"in K.dynamic||"elements"in K.static||"elements"in K.dynamic}function Q(K,me){var Ie=B();a(K+" in command "+(me||P())+(Ie==="unknown"?"":" called from "+Ie))}function J(K,me,Ie){K||Q(me,Ie||P())}function ie(K,me,Ie,wt){K in me||Q("unknown parameter ("+K+")"+l(Ie)+". possible values: "+Object.keys(me).join(),wt||P())}function Se(K,me,Ie,wt){v(K,me)||Q("invalid parameter type"+l(Ie)+". expected "+me+", got "+typeof K,wt||P())}function Ae(K){K()}function Pe(K,me,Ie){K.texture?O(K.texture._texture.internalformat,me,"unsupported texture format for attachment"):O(K.renderbuffer._renderbuffer.format,Ie,"unsupported renderbuffer format for attachment")}var De=33071,ze=9728,Ye=9984,Be=9985,Je=9986,gt=9987,le=5120,Ze=5121,pe=5122,se=5123,we=5124,$e=5125,rt=5126,pt=32819,Lt=32820,Jt=33635,en=34042,zt=36193,it={};it[le]=it[Ze]=1,it[pe]=it[se]=it[zt]=it[Jt]=it[pt]=it[Lt]=2,it[we]=it[$e]=it[rt]=it[en]=4;function ae(K,me){return K===Lt||K===pt||K===Jt?2:K===en?4:it[K]*me}function re(K){return!(K&K-1)&&!!K}function je(K,me,Ie){var wt,Dt=me.width,yt=me.height,Nt=me.channels;s(Dt>0&&Dt<=Ie.maxTextureSize&&yt>0&&yt<=Ie.maxTextureSize,"invalid texture shape"),(K.wrapS!==De||K.wrapT!==De)&&s(re(Dt)&&re(yt),"incompatible wrap mode for texture, both width and height must be power of 2"),me.mipmask===1?Dt!==1&&yt!==1&&s(K.minFilter!==Ye&&K.minFilter!==Je&&K.minFilter!==Be&&K.minFilter!==gt,"min filter requires mipmap"):(s(re(Dt)&&re(yt),"texture must be a square power of 2 to support mipmapping"),s(me.mipmask===(Dt<<1)-1,"missing or incomplete mipmap data")),me.type===rt&&(Ie.extensions.indexOf("oes_texture_float_linear")<0&&s(K.minFilter===ze&&K.magFilter===ze,"filter not supported, must enable oes_texture_float_linear"),s(!K.genMipmaps,"mipmap generation not supported with float textures"));var tn=me.images;for(wt=0;wt<16;++wt)if(tn[wt]){var sn=Dt>>wt,nn=yt>>wt;s(me.mipmask&1<<wt,"missing mipmap data");var Mt=tn[wt];if(s(Mt.width===sn&&Mt.height===nn,"invalid shape for mip images"),s(Mt.format===me.format&&Mt.internalformat===me.internalformat&&Mt.type===me.type,"incompatible type for mip image"),!Mt.compressed)if(Mt.data){var bn=Math.ceil(ae(Mt.type,Nt)*sn/Mt.unpackAlignment)*Mt.unpackAlignment;s(Mt.data.byteLength===bn*nn,"invalid data for image, buffer size is inconsistent with image format")}else Mt.element||Mt.copy}else K.genMipmaps||s((me.mipmask&1<<wt)===0,"extra mipmap data");me.compressed&&s(!K.genMipmaps,"mipmap generation for compressed images not supported")}function vt(K,me,Ie,wt){var Dt=K.width,yt=K.height,Nt=K.channels;s(Dt>0&&Dt<=wt.maxTextureSize&&yt>0&&yt<=wt.maxTextureSize,"invalid texture shape"),s(Dt===yt,"cube map must be square"),s(me.wrapS===De&&me.wrapT===De,"wrap mode not supported by cube map");for(var tn=0;tn<Ie.length;++tn){var sn=Ie[tn];s(sn.width===Dt&&sn.height===yt,"inconsistent cube map face shape"),me.genMipmaps&&(s(!sn.compressed,"can not generate mipmap for compressed textures"),s(sn.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var nn=sn.images,Mt=0;Mt<16;++Mt){var bn=nn[Mt];if(bn){var pn=Dt>>Mt,rn=yt>>Mt;s(sn.mipmask&1<<Mt,"missing mipmap data"),s(bn.width===pn&&bn.height===rn,"invalid shape for mip images"),s(bn.format===K.format&&bn.internalformat===K.internalformat&&bn.type===K.type,"incompatible type for mip image"),bn.compressed||(bn.data?s(bn.data.byteLength===pn*rn*Math.max(ae(bn.type,Nt),bn.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):bn.element||bn.copy)}}}}var Y=o(s,{optional:Ae,raise:a,commandRaise:Q,command:J,parameter:f,commandParameter:ie,constructor:S,type:b,commandType:Se,isTypedArray:h,nni:E,oneOf:O,shaderError:z,linkError:q,callSite:B,saveCommandRef:X,saveDrawInfo:G,framebufferFormat:Pe,guessCommand:P,texture2D:je,textureCube:vt}),kt=0,Rt=0,Wt=5,Pn=6;function qt(K,me){this.id=kt++,this.type=K,this.data=me}function xn(K){return K.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ke(K){if(K.length===0)return[];var me=K.charAt(0),Ie=K.charAt(K.length-1);if(K.length>1&&me===Ie&&(me==='"'||me==="'"))return['"'+xn(K.substr(1,K.length-2))+'"'];var wt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(K);if(wt)return ke(K.substr(0,wt.index)).concat(ke(wt[1])).concat(ke(K.substr(wt.index+wt[0].length)));var Dt=K.split(".");if(Dt.length===1)return['"'+xn(K)+'"'];for(var yt=[],Nt=0;Nt<Dt.length;++Nt)yt=yt.concat(ke(Dt[Nt]));return yt}function Ke(K){return"["+ke(K).join("][")+"]"}function Le(K,me){return new qt(K,Ke(me+""))}function dt(K){return typeof K=="function"&&!K._reglType||K instanceof qt}function At(K,me){if(typeof K=="function")return new qt(Rt,K);if(typeof K=="number"||typeof K=="boolean")return new qt(Wt,K);if(Array.isArray(K))return new qt(Pn,K.map((Ie,wt)=>At(Ie,me+"["+wt+"]")));if(K instanceof qt)return K;Y(!1,"invalid option type in uniform "+me)}var Tt={DynamicVariable:qt,define:Le,isDynamic:dt,unbox:At,accessor:Ke},wn={next:typeof requestAnimationFrame=="function"?function(K){return requestAnimationFrame(K)}:function(K){return setTimeout(K,16)},cancel:typeof cancelAnimationFrame=="function"?function(K){return cancelAnimationFrame(K)}:clearTimeout},Zn=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function ao(){var K={"":0},me=[""];return{id:function(Ie){var wt=K[Ie];return wt||(wt=K[Ie]=me.length,me.push(Ie),wt)},str:function(Ie){return me[Ie]}}}function Lo(K,me,Ie){var wt=document.createElement("canvas");o(wt.style,{border:0,margin:0,padding:0,top:0,left:0}),K.appendChild(wt),K===document.body&&(wt.style.position="absolute",o(K.style,{margin:0,padding:0}));function Dt(){var tn=window.innerWidth,sn=window.innerHeight;if(K!==document.body){var nn=K.getBoundingClientRect();tn=nn.right-nn.left,sn=nn.bottom-nn.top}wt.width=Ie*tn,wt.height=Ie*sn,o(wt.style,{width:tn+"px",height:sn+"px"})}var yt;K!==document.body&&typeof ResizeObserver=="function"?(yt=new ResizeObserver(function(){setTimeout(Dt)}),yt.observe(K)):window.addEventListener("resize",Dt,!1);function Nt(){yt?yt.disconnect():window.removeEventListener("resize",Dt),K.removeChild(wt)}return Dt(),{canvas:wt,onDestroy:Nt}}function yo(K,me){function Ie(wt){try{return K.getContext(wt,me)}catch{return null}}return Ie("webgl")||Ie("experimental-webgl")||Ie("webgl-experimental")}function ho(K){return typeof K.nodeName=="string"&&typeof K.appendChild=="function"&&typeof K.getBoundingClientRect=="function"}function Nn(K){return typeof K.drawArrays=="function"||typeof K.drawElements=="function"}function qn(K){return typeof K=="string"?K.split():(Y(Array.isArray(K),"invalid extension array"),K)}function rr(K){return typeof K=="string"?(Y(typeof document<"u","not supported outside of DOM"),document.querySelector(K)):K}function ut(K){var me=K||{},Ie,wt,Dt,yt,Nt={},tn=[],sn=[],nn=typeof window>"u"?1:window.devicePixelRatio,Mt=!1,bn=function(Gt){Gt&&Y.raise(Gt)},pn=function(){};if(typeof me=="string"?(Y(typeof document<"u","selector queries only supported in DOM enviroments"),Ie=document.querySelector(me),Y(Ie,"invalid query string for element")):typeof me=="object"?ho(me)?Ie=me:Nn(me)?(yt=me,Dt=yt.canvas):(Y.constructor(me),"gl"in me?yt=me.gl:"canvas"in me?Dt=rr(me.canvas):"container"in me&&(wt=rr(me.container)),"attributes"in me&&(Nt=me.attributes,Y.type(Nt,"object","invalid context attributes")),"extensions"in me&&(tn=qn(me.extensions)),"optionalExtensions"in me&&(sn=qn(me.optionalExtensions)),"onDone"in me&&(Y.type(me.onDone,"function","invalid or missing onDone callback"),bn=me.onDone),"profile"in me&&(Mt=!!me.profile),"pixelRatio"in me&&(nn=+me.pixelRatio,Y(nn>0,"invalid pixel ratio"))):Y.raise("invalid arguments to regl"),Ie&&(Ie.nodeName.toLowerCase()==="canvas"?Dt=Ie:wt=Ie),!yt){if(!Dt){Y(typeof document<"u","must manually specify webgl context outside of DOM environments");var rn=Lo(wt||document.body,bn,nn);if(!rn)return null;Dt=rn.canvas,pn=rn.onDestroy}Nt.premultipliedAlpha===void 0&&(Nt.premultipliedAlpha=!0),yt=yo(Dt,Nt)}return yt?{gl:yt,canvas:Dt,container:wt,extensions:tn,optionalExtensions:sn,pixelRatio:nn,profile:Mt,onDone:bn,onDestroy:pn}:(pn(),bn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function vn(K,me){var Ie={};function wt(Nt){Y.type(Nt,"string","extension name must be string");var tn=Nt.toLowerCase(),sn;try{sn=Ie[tn]=K.getExtension(tn)}catch{}return!!sn}for(var Dt=0;Dt<me.extensions.length;++Dt){var yt=me.extensions[Dt];if(!wt(yt))return me.onDestroy(),me.onDone('"'+yt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return me.optionalExtensions.forEach(wt),{extensions:Ie,restore:function(){Object.keys(Ie).forEach(function(Nt){if(Ie[Nt]&&!wt(Nt))throw new Error("(regl): error restoring extension "+Nt)})}}}function In(K,me){for(var Ie=Array(K),wt=0;wt<K;++wt)Ie[wt]=me(wt);return Ie}var sr=5120,wo=5121,oo=5122,ta=5123,Ca=5124,Yi=5125,fa=5126;function Ka(K){for(var me=16;me<=1<<28;me*=16)if(K<=me)return me;return 0}function On(K){var me,Ie;return me=(K>65535)<<4,K>>>=me,Ie=(K>255)<<3,K>>>=Ie,me|=Ie,Ie=(K>15)<<2,K>>>=Ie,me|=Ie,Ie=(K>3)<<1,K>>>=Ie,me|=Ie,me|K>>1}function Ts(){var K=In(8,function(){return[]});function me(yt){var Nt=Ka(yt),tn=K[On(Nt)>>2];return tn.length>0?tn.pop():new ArrayBuffer(Nt)}function Ie(yt){K[On(yt.byteLength)>>2].push(yt)}function wt(yt,Nt){var tn=null;switch(yt){case sr:tn=new Int8Array(me(Nt),0,Nt);break;case wo:tn=new Uint8Array(me(Nt),0,Nt);break;case oo:tn=new Int16Array(me(2*Nt),0,Nt);break;case ta:tn=new Uint16Array(me(2*Nt),0,Nt);break;case Ca:tn=new Int32Array(me(4*Nt),0,Nt);break;case Yi:tn=new Uint32Array(me(4*Nt),0,Nt);break;case fa:tn=new Float32Array(me(4*Nt),0,Nt);break;default:return null}return tn.length!==Nt?tn.subarray(0,Nt):tn}function Dt(yt){Ie(yt.buffer)}return{alloc:me,free:Ie,allocType:wt,freeType:Dt}}var Oo=Ts();Oo.zero=Ts();var es=3408,Ui=3410,gr=3411,gl=3412,pa=3413,qi=3414,Na=3415,al=33901,yl=33902,Cs=3379,_l=3386,ts=34921,ve=36347,mt=36348,cn=35661,Kn=35660,br=34930,so=36349,si=34076,ye=34024,ht=7936,fn=7937,Rn=7938,Cn=35724,nr=34047,Mn=36063,or=34852,lr=3553,qr=34067,na=34069,vi=33984,bl=6408,Vi=5126,Ns=5121,Fl=36160,Ro=36053,La=36064,id=16384,_u=function(K,me){var Ie=1;me.ext_texture_filter_anisotropic&&(Ie=K.getParameter(nr));var wt=1,Dt=1;me.webgl_draw_buffers&&(wt=K.getParameter(or),Dt=K.getParameter(Mn));var yt=!!me.oes_texture_float;if(yt){var Nt=K.createTexture();K.bindTexture(lr,Nt),K.texImage2D(lr,0,bl,1,1,0,bl,Vi,null);var tn=K.createFramebuffer();if(K.bindFramebuffer(Fl,tn),K.framebufferTexture2D(Fl,La,lr,Nt,0),K.bindTexture(lr,null),K.checkFramebufferStatus(Fl)!==Ro)yt=!1;else{K.viewport(0,0,1,1),K.clearColor(1,0,0,1),K.clear(id);var sn=Oo.allocType(Vi,4);K.readPixels(0,0,1,1,bl,Vi,sn),K.getError()?yt=!1:(K.deleteFramebuffer(tn),K.deleteTexture(Nt),yt=sn[0]===1),Oo.freeType(sn)}}var nn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Mt=!0;if(!nn){var bn=K.createTexture(),pn=Oo.allocType(Ns,36);K.activeTexture(vi),K.bindTexture(qr,bn),K.texImage2D(na,0,bl,3,3,0,bl,Ns,pn),Oo.freeType(pn),K.bindTexture(qr,null),K.deleteTexture(bn),Mt=!K.getError()}return{colorBits:[K.getParameter(Ui),K.getParameter(gr),K.getParameter(gl),K.getParameter(pa)],depthBits:K.getParameter(qi),stencilBits:K.getParameter(Na),subpixelBits:K.getParameter(es),extensions:Object.keys(me).filter(function(rn){return!!me[rn]}),maxAnisotropic:Ie,maxDrawbuffers:wt,maxColorAttachments:Dt,pointSizeDims:K.getParameter(al),lineWidthDims:K.getParameter(yl),maxViewportDims:K.getParameter(_l),maxCombinedTextureUnits:K.getParameter(cn),maxCubeMapSize:K.getParameter(si),maxRenderbufferSize:K.getParameter(ye),maxTextureUnits:K.getParameter(br),maxTextureSize:K.getParameter(Cs),maxAttributes:K.getParameter(ts),maxVertexUniforms:K.getParameter(ve),maxVertexTextureUnits:K.getParameter(Kn),maxVaryingVectors:K.getParameter(mt),maxFragmentUniforms:K.getParameter(so),glsl:K.getParameter(Cn),renderer:K.getParameter(fn),vendor:K.getParameter(ht),version:K.getParameter(Rn),readFloat:yt,npotTextureCube:Mt}};function Ia(K){return!!K&&typeof K=="object"&&Array.isArray(K.shape)&&Array.isArray(K.stride)&&typeof K.offset=="number"&&K.shape.length===K.stride.length&&(Array.isArray(K.data)||n(K.data))}var ra=function(K){return Object.keys(K).map(function(me){return K[me]})},wl={shape:Ba,flatten:yp};function qo(K,me,Ie){for(var wt=0;wt<me;++wt)Ie[wt]=K[wt]}function Uh(K,me,Ie,wt){for(var Dt=0,yt=0;yt<me;++yt)for(var Nt=K[yt],tn=0;tn<Ie;++tn)wt[Dt++]=Nt[tn]}function Fa(K,me,Ie,wt,Dt,yt){for(var Nt=yt,tn=0;tn<me;++tn)for(var sn=K[tn],nn=0;nn<Ie;++nn)for(var Mt=sn[nn],bn=0;bn<wt;++bn)Dt[Nt++]=Mt[bn]}function gp(K,me,Ie,wt,Dt){for(var yt=1,Nt=Ie+1;Nt<me.length;++Nt)yt*=me[Nt];var tn=me[Ie];if(me.length-Ie===4){var sn=me[Ie+1],nn=me[Ie+2],Mt=me[Ie+3];for(Nt=0;Nt<tn;++Nt)Fa(K[Nt],sn,nn,Mt,wt,Dt),Dt+=yt}else for(Nt=0;Nt<tn;++Nt)gp(K[Nt],me,Ie+1,wt,Dt),Dt+=yt}function yp(K,me,Ie,wt){var Dt=1;if(me.length)for(var yt=0;yt<me.length;++yt)Dt*=me[yt];else Dt=0;var Nt=wt||Oo.allocType(Ie,Dt);switch(me.length){case 0:break;case 1:qo(K,me[0],Nt);break;case 2:Uh(K,me[0],me[1],Nt);break;case 3:Fa(K,me[0],me[1],me[2],Nt,0);break;default:gp(K,me,0,Nt,0)}return Nt}function Ba(K){for(var me=[],Ie=K;Ie.length;Ie=Ie[0])me.push(Ie.length);return me}var Za={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},rf=5120,Mo=5122,oa=5124,ad=5121,_p=5123,of=5125,ld=5126,ns=5126,$a={int8:rf,int16:Mo,int32:oa,uint8:ad,uint16:_p,uint32:of,float:ld,float32:ns},bu=35048,Ja=35040,El={dynamic:bu,stream:Ja,static:35044},vo=wl.flatten,Ua=wl.shape,Bl=35044,ha=35040,wu=5121,Ks=5126,$l=[];$l[5120]=1,$l[5122]=2,$l[5124]=4,$l[5121]=1,$l[5123]=2,$l[5125]=4,$l[5126]=4;function ui(K){return Za[Object.prototype.toString.call(K)]|0}function lc(K,me){for(var Ie=0;Ie<me.length;++Ie)K[Ie]=me[Ie]}function rs(K,me,Ie,wt,Dt,yt,Nt){for(var tn=0,sn=0;sn<Ie;++sn)for(var nn=0;nn<wt;++nn)K[tn++]=me[Dt*sn+yt*nn+Nt]}function xl(K,me,Ie,wt){var Dt=0,yt={};function Nt(st){this.id=Dt++,this.buffer=K.createBuffer(),this.type=st,this.usage=Bl,this.byteLength=0,this.dimension=1,this.dtype=wu,this.persistentData=null,Ie.profile&&(this.stats={size:0})}Nt.prototype.bind=function(){K.bindBuffer(this.type,this.buffer)},Nt.prototype.destroy=function(){pn(this)};var tn=[];function sn(st,St){var ln=tn.pop();return ln||(ln=new Nt(st)),ln.bind(),bn(ln,St,ha,0,1,!1),ln}function nn(st){tn.push(st)}function Mt(st,St,ln){st.byteLength=St.byteLength,K.bufferData(st.type,St,ln)}function bn(st,St,ln,Sn,Xt,kn){var Kt;if(st.usage=ln,Array.isArray(St)){if(st.dtype=Sn||Ks,St.length>0){var yn;if(Array.isArray(St[0])){Kt=Ua(St);for(var Yt=1,En=1;En<Kt.length;++En)Yt*=Kt[En];st.dimension=Yt,yn=vo(St,Kt,st.dtype),Mt(st,yn,ln),kn?st.persistentData=yn:Oo.freeType(yn)}else if(typeof St[0]=="number"){st.dimension=Xt;var ar=Oo.allocType(st.dtype,St.length);lc(ar,St),Mt(st,ar,ln),kn?st.persistentData=ar:Oo.freeType(ar)}else n(St[0])?(st.dimension=St[0].length,st.dtype=Sn||ui(St[0])||Ks,yn=vo(St,[St.length,St[0].length],st.dtype),Mt(st,yn,ln),kn?st.persistentData=yn:Oo.freeType(yn)):Y.raise("invalid buffer data")}}else if(n(St))st.dtype=Sn||ui(St),st.dimension=Xt,Mt(st,St,ln),kn&&(st.persistentData=new Uint8Array(new Uint8Array(St.buffer)));else if(Ia(St)){Kt=St.shape;var xr=St.stride,on=St.offset,Zt=0,Ht=0,fr=0,Dr=0;Kt.length===1?(Zt=Kt[0],Ht=1,fr=xr[0],Dr=0):Kt.length===2?(Zt=Kt[0],Ht=Kt[1],fr=xr[0],Dr=xr[1]):Y.raise("invalid shape"),st.dtype=Sn||ui(St.data)||Ks,st.dimension=Ht;var Un=Oo.allocType(st.dtype,Zt*Ht);rs(Un,St.data,Zt,Ht,fr,Dr,on),Mt(st,Un,ln),kn?st.persistentData=Un:Oo.freeType(Un)}else St instanceof ArrayBuffer?(st.dtype=wu,st.dimension=Xt,Mt(st,St,ln),kn&&(st.persistentData=new Uint8Array(new Uint8Array(St)))):Y.raise("invalid buffer data")}function pn(st){me.bufferCount--,wt(st);var St=st.buffer;Y(St,"buffer must not be deleted already"),K.deleteBuffer(St),st.buffer=null,delete yt[st.id]}function rn(st,St,ln,Sn){me.bufferCount++;var Xt=new Nt(St);yt[Xt.id]=Xt;function kn(Yt){var En=Bl,ar=null,xr=0,on=0,Zt=1;return Array.isArray(Yt)||n(Yt)||Ia(Yt)||Yt instanceof ArrayBuffer?ar=Yt:typeof Yt=="number"?xr=Yt|0:Yt&&(Y.type(Yt,"object","buffer arguments must be an object, a number or an array"),"data"in Yt&&(Y(ar===null||Array.isArray(ar)||n(ar)||Ia(ar),"invalid data for buffer"),ar=Yt.data),"usage"in Yt&&(Y.parameter(Yt.usage,El,"invalid buffer usage"),En=El[Yt.usage]),"type"in Yt&&(Y.parameter(Yt.type,$a,"invalid buffer type"),on=$a[Yt.type]),"dimension"in Yt&&(Y.type(Yt.dimension,"number","invalid dimension"),Zt=Yt.dimension|0),"length"in Yt&&(Y.nni(xr,"buffer length must be a nonnegative integer"),xr=Yt.length|0)),Xt.bind(),ar?bn(Xt,ar,En,on,Zt,Sn):(xr&&K.bufferData(Xt.type,xr,En),Xt.dtype=on||wu,Xt.usage=En,Xt.dimension=Zt,Xt.byteLength=xr),Ie.profile&&(Xt.stats.size=Xt.byteLength*$l[Xt.dtype]),kn}function Kt(Yt,En){Y(En+Yt.byteLength<=Xt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Yt.byteLength+" starting from offset "+En+" to a buffer of size "+Xt.byteLength),K.bufferSubData(Xt.type,En,Yt)}function yn(Yt,En){var ar=(En||0)|0,xr;if(Xt.bind(),n(Yt)||Yt instanceof ArrayBuffer)Kt(Yt,ar);else if(Array.isArray(Yt)){if(Yt.length>0)if(typeof Yt[0]=="number"){var on=Oo.allocType(Xt.dtype,Yt.length);lc(on,Yt),Kt(on,ar),Oo.freeType(on)}else if(Array.isArray(Yt[0])||n(Yt[0])){xr=Ua(Yt);var Zt=vo(Yt,xr,Xt.dtype);Kt(Zt,ar),Oo.freeType(Zt)}else Y.raise("invalid buffer data")}else if(Ia(Yt)){xr=Yt.shape;var Ht=Yt.stride,fr=0,Dr=0,Un=0,$r=0;xr.length===1?(fr=xr[0],Dr=1,Un=Ht[0],$r=0):xr.length===2?(fr=xr[0],Dr=xr[1],Un=Ht[0],$r=Ht[1]):Y.raise("invalid shape");var Or=Array.isArray(Yt.data)?Xt.dtype:ui(Yt.data),Fr=Oo.allocType(Or,fr*Dr);rs(Fr,Yt.data,fr,Dr,Un,$r,Yt.offset),Kt(Fr,ar),Oo.freeType(Fr)}else Y.raise("invalid data for buffer subdata");return kn}return ln||kn(st),kn._reglType="buffer",kn._buffer=Xt,kn.subdata=yn,Ie.profile&&(kn.stats=Xt.stats),kn.destroy=function(){pn(Xt)},kn}function Gt(){ra(yt).forEach(function(st){st.buffer=K.createBuffer(),K.bindBuffer(st.type,st.buffer),K.bufferData(st.type,st.persistentData||st.byteLength,st.usage)})}return Ie.profile&&(me.getTotalBufferSize=function(){var st=0;return Object.keys(yt).forEach(function(St){st+=yt[St].stats.size}),st}),{create:rn,createStream:sn,destroyStream:nn,clear:function(){ra(yt).forEach(pn),tn.forEach(pn)},getBuffer:function(st){return st&&st._buffer instanceof Nt?st._buffer:null},restore:Gt,_initBuffer:bn}}var af=0,Vh=0,lf=1,Gi=1,sc=4,os=4,Ki={points:af,point:Vh,lines:lf,line:Gi,triangles:sc,triangle:os,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},sf=0,ll=1,Ol=4,sd=5120,Va=5121,Qa=5122,ia=5123,sl=5124,ka=5125,Ct=34963,un=35040,dn=35044;function Wn(K,me,Ie,wt){var Dt={},yt=0,Nt={uint8:Va,uint16:ia};me.oes_element_index_uint&&(Nt.uint32=ka);function tn(Gt){this.id=yt++,Dt[this.id]=this,this.buffer=Gt,this.primType=Ol,this.vertCount=0,this.type=0}tn.prototype.bind=function(){this.buffer.bind()};var sn=[];function nn(Gt){var st=sn.pop();return st||(st=new tn(Ie.create(null,Ct,!0,!1)._buffer)),bn(st,Gt,un,-1,-1,0,0),st}function Mt(Gt){sn.push(Gt)}function bn(Gt,st,St,ln,Sn,Xt,kn){Gt.buffer.bind();var Kt;if(st){var yn=kn;!kn&&(!n(st)||Ia(st)&&!n(st.data))&&(yn=me.oes_element_index_uint?ka:ia),Ie._initBuffer(Gt.buffer,st,St,yn,3)}else K.bufferData(Ct,Xt,St),Gt.buffer.dtype=Kt||Va,Gt.buffer.usage=St,Gt.buffer.dimension=3,Gt.buffer.byteLength=Xt;if(Kt=kn,!kn){switch(Gt.buffer.dtype){case Va:case sd:Kt=Va;break;case ia:case Qa:Kt=ia;break;case ka:case sl:Kt=ka;break;default:Y.raise("unsupported type for element array")}Gt.buffer.dtype=Kt}Gt.type=Kt,Y(Kt!==ka||!!me.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Yt=Sn;Yt<0&&(Yt=Gt.buffer.byteLength,Kt===ia?Yt>>=1:Kt===ka&&(Yt>>=2)),Gt.vertCount=Yt;var En=ln;if(ln<0){En=Ol;var ar=Gt.buffer.dimension;ar===1&&(En=sf),ar===2&&(En=ll),ar===3&&(En=Ol)}Gt.primType=En}function pn(Gt){wt.elementsCount--,Y(Gt.buffer!==null,"must not double destroy elements"),delete Dt[Gt.id],Gt.buffer.destroy(),Gt.buffer=null}function rn(Gt,st){var St=Ie.create(null,Ct,!0),ln=new tn(St._buffer);wt.elementsCount++;function Sn(Xt){if(!Xt)St(),ln.primType=Ol,ln.vertCount=0,ln.type=Va;else if(typeof Xt=="number")St(Xt),ln.primType=Ol,ln.vertCount=Xt|0,ln.type=Va;else{var kn=null,Kt=dn,yn=-1,Yt=-1,En=0,ar=0;Array.isArray(Xt)||n(Xt)||Ia(Xt)?kn=Xt:(Y.type(Xt,"object","invalid arguments for elements"),"data"in Xt&&(kn=Xt.data,Y(Array.isArray(kn)||n(kn)||Ia(kn),"invalid data for element buffer")),"usage"in Xt&&(Y.parameter(Xt.usage,El,"invalid element buffer usage"),Kt=El[Xt.usage]),"primitive"in Xt&&(Y.parameter(Xt.primitive,Ki,"invalid element buffer primitive"),yn=Ki[Xt.primitive]),"count"in Xt&&(Y(typeof Xt.count=="number"&&Xt.count>=0,"invalid vertex count for elements"),Yt=Xt.count|0),"type"in Xt&&(Y.parameter(Xt.type,Nt,"invalid buffer type"),ar=Nt[Xt.type]),"length"in Xt?En=Xt.length|0:(En=Yt,ar===ia||ar===Qa?En*=2:(ar===ka||ar===sl)&&(En*=4))),bn(ln,kn,Kt,yn,Yt,En,ar)}return Sn}return Sn(Gt),Sn._reglType="elements",Sn._elements=ln,Sn.subdata=function(Xt,kn){return St.subdata(Xt,kn),Sn},Sn.destroy=function(){pn(ln)},Sn}return{create:rn,createStream:nn,destroyStream:Mt,getElements:function(Gt){return typeof Gt=="function"&&Gt._elements instanceof tn?Gt._elements:null},clear:function(){ra(Dt).forEach(pn)}}}var Gr=new Float32Array(1),mo=new Uint32Array(Gr.buffer),ci=5123;function R(K){for(var me=Oo.allocType(ci,K.length),Ie=0;Ie<K.length;++Ie)if(isNaN(K[Ie]))me[Ie]=65535;else if(K[Ie]===1/0)me[Ie]=31744;else if(K[Ie]===-1/0)me[Ie]=64512;else{Gr[0]=K[Ie];var wt=mo[0],Dt=wt>>>31<<15,yt=(wt<<1>>>24)-127,Nt=wt>>13&1023;if(yt<-24)me[Ie]=Dt;else if(yt<-14){var tn=-14-yt;me[Ie]=Dt+(Nt+1024>>tn)}else yt>15?me[Ie]=Dt+31744:me[Ie]=Dt+(yt+15<<10)+Nt}return me}function L(K){return Array.isArray(K)||n(K)}var Z=function(K){return!(K&K-1)&&!!K},fe=34467,Re=3553,lt=34067,It=34069,_n=6408,Jn=6406,no=6407,$n=6409,Do=6410,Kr=32854,So=32855,ul=36194,wi=32819,el=32820,ks=33635,Ps=34042,Zs=6402,Eu=34041,is=35904,xu=35906,Zi=36193,Js=33776,Rs=33777,as=33778,ls=33779,uc=35986,fm=35987,pm=34798,Gh=35840,uf=35841,cc=35842,bp=35843,hm=36196,dc=5121,cf=5123,wp=5125,ji=5126,Ga=10242,Ep=10243,xp=10497,ud=33071,dy=33648,cd=10240,dd=10241,df=9728,fc=9729,Ou=9984,fd=9985,ff=9986,Su=9987,fy=33170,pf=4352,py=4353,hy=4354,vm=34046,Op=3317,Pa=37440,mm=37441,he=37443,pc=37444,Qs=33984,Ul=[Ou,ff,fd,Su],go=[0,$n,Do,no,_n],ba={};ba[$n]=ba[Jn]=ba[Zs]=1,ba[Eu]=ba[Do]=2,ba[no]=ba[is]=3,ba[_n]=ba[xu]=4;function To(K){return"[object "+K+"]"}var ss=To("HTMLCanvasElement"),eu=To("OffscreenCanvas"),Sl=To("CanvasRenderingContext2D"),Sp=To("ImageBitmap"),Ap=To("HTMLImageElement"),Wh=To("HTMLVideoElement"),gm=Object.keys(Za).concat([ss,eu,Sl,Sp,Ap,Wh]),tu=[];tu[dc]=1,tu[ji]=4,tu[Zi]=2,tu[cf]=2,tu[wp]=4;var Li=[];Li[Kr]=2,Li[So]=2,Li[ul]=2,Li[Eu]=4,Li[Js]=.5,Li[Rs]=.5,Li[as]=1,Li[ls]=1,Li[uc]=.5,Li[fm]=1,Li[pm]=1,Li[Gh]=.5,Li[uf]=.25,Li[cc]=.5,Li[bp]=.25,Li[hm]=.5;function pd(K){return Array.isArray(K)&&(K.length===0||typeof K[0]=="number")}function zh(K){if(!Array.isArray(K))return!1;var me=K.length;return!(me===0||!L(K[0]))}function nu(K){return Object.prototype.toString.call(K)}function us(K){return nu(K)===ss}function hf(K){return nu(K)===eu}function Au(K){return nu(K)===Sl}function Al(K){return nu(K)===Sp}function Hh(K){return nu(K)===Ap}function Xh(K){return nu(K)===Wh}function cs(K){if(!K)return!1;var me=nu(K);return gm.indexOf(me)>=0?!0:pd(K)||zh(K)||Ia(K)}function mi(K){return Za[Object.prototype.toString.call(K)]|0}function ym(K,me){var Ie=me.length;switch(K.type){case dc:case cf:case wp:case ji:var wt=Oo.allocType(K.type,Ie);wt.set(me),K.data=wt;break;case Zi:K.data=R(me);break;default:Y.raise("unsupported texture type, must specify a typed array")}}function Yh(K,me){return Oo.allocType(K.type===Zi?ji:K.type,me)}function Ii(K,me){K.type===Zi?(K.data=R(me),Oo.freeType(me)):K.data=me}function Io(K,me,Ie,wt,Dt,yt){for(var Nt=K.width,tn=K.height,sn=K.channels,nn=Nt*tn*sn,Mt=Yh(K,nn),bn=0,pn=0;pn<tn;++pn)for(var rn=0;rn<Nt;++rn)for(var Gt=0;Gt<sn;++Gt)Mt[bn++]=me[Ie*rn+wt*pn+Dt*Gt+yt];Ii(K,Mt)}function Ji(K,me,Ie,wt,Dt,yt){var Nt;if(typeof Li[K]<"u"?Nt=Li[K]:Nt=ba[K]*tu[me],yt&&(Nt*=6),Dt){for(var tn=0,sn=Ie;sn>=1;)tn+=Nt*sn*sn,sn/=2;return tn}else return Nt*Ie*wt}function lo(K,me,Ie,wt,Dt,yt,Nt){var tn={"don't care":pf,"dont care":pf,nice:hy,fast:py},sn={repeat:xp,clamp:ud,mirror:dy},nn={nearest:df,linear:fc},Mt=o({mipmap:Su,"nearest mipmap nearest":Ou,"linear mipmap nearest":fd,"nearest mipmap linear":ff,"linear mipmap linear":Su},nn),bn={none:0,browser:pc},pn={uint8:dc,rgba4:wi,rgb565:ks,"rgb5 a1":el},rn={alpha:Jn,luminance:$n,"luminance alpha":Do,rgb:no,rgba:_n,rgba4:Kr,"rgb5 a1":So,rgb565:ul},Gt={};me.ext_srgb&&(rn.srgb=is,rn.srgba=xu),me.oes_texture_float&&(pn.float32=pn.float=ji),me.oes_texture_half_float&&(pn.float16=pn["half float"]=Zi),me.webgl_depth_texture&&(o(rn,{depth:Zs,"depth stencil":Eu}),o(pn,{uint16:cf,uint32:wp,"depth stencil":Ps})),me.webgl_compressed_texture_s3tc&&o(Gt,{"rgb s3tc dxt1":Js,"rgba s3tc dxt1":Rs,"rgba s3tc dxt3":as,"rgba s3tc dxt5":ls}),me.webgl_compressed_texture_atc&&o(Gt,{"rgb atc":uc,"rgba atc explicit alpha":fm,"rgba atc interpolated alpha":pm}),me.webgl_compressed_texture_pvrtc&&o(Gt,{"rgb pvrtc 4bppv1":Gh,"rgb pvrtc 2bppv1":uf,"rgba pvrtc 4bppv1":cc,"rgba pvrtc 2bppv1":bp}),me.webgl_compressed_texture_etc1&&(Gt["rgb etc1"]=hm);var st=Array.prototype.slice.call(K.getParameter(fe));Object.keys(Gt).forEach(function(Te){var Et=Gt[Te];st.indexOf(Et)>=0&&(rn[Te]=Et)});var St=Object.keys(rn);Ie.textureFormats=St;var ln=[];Object.keys(rn).forEach(function(Te){var Et=rn[Te];ln[Et]=Te});var Sn=[];Object.keys(pn).forEach(function(Te){var Et=pn[Te];Sn[Et]=Te});var Xt=[];Object.keys(nn).forEach(function(Te){var Et=nn[Te];Xt[Et]=Te});var kn=[];Object.keys(Mt).forEach(function(Te){var Et=Mt[Te];kn[Et]=Te});var Kt=[];Object.keys(sn).forEach(function(Te){var Et=sn[Te];Kt[Et]=Te});var yn=St.reduce(function(Te,Et){var _t=rn[Et];return _t===$n||_t===Jn||_t===$n||_t===Do||_t===Zs||_t===Eu||me.ext_srgb&&(_t===is||_t===xu)?Te[_t]=_t:_t===So||Et.indexOf("rgba")>=0?Te[_t]=_n:Te[_t]=no,Te},{});function Yt(){this.internalformat=_n,this.format=_n,this.type=dc,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=pc,this.width=0,this.height=0,this.channels=0}function En(Te,Et){Te.internalformat=Et.internalformat,Te.format=Et.format,Te.type=Et.type,Te.compressed=Et.compressed,Te.premultiplyAlpha=Et.premultiplyAlpha,Te.flipY=Et.flipY,Te.unpackAlignment=Et.unpackAlignment,Te.colorSpace=Et.colorSpace,Te.width=Et.width,Te.height=Et.height,Te.channels=Et.channels}function ar(Te,Et){if(!(typeof Et!="object"||!Et)){if("premultiplyAlpha"in Et&&(Y.type(Et.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Te.premultiplyAlpha=Et.premultiplyAlpha),"flipY"in Et&&(Y.type(Et.flipY,"boolean","invalid texture flip"),Te.flipY=Et.flipY),"alignment"in Et&&(Y.oneOf(Et.alignment,[1,2,4,8],"invalid texture unpack alignment"),Te.unpackAlignment=Et.alignment),"colorSpace"in Et&&(Y.parameter(Et.colorSpace,bn,"invalid colorSpace"),Te.colorSpace=bn[Et.colorSpace]),"type"in Et){var _t=Et.type;Y(me.oes_texture_float||!(_t==="float"||_t==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),Y(me.oes_texture_half_float||!(_t==="half float"||_t==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Y(me.webgl_depth_texture||!(_t==="uint16"||_t==="uint32"||_t==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Y.parameter(_t,pn,"invalid texture type"),Te.type=pn[_t]}var Ln=Te.width,Wr=Te.height,xe=Te.channels,de=!1;"shape"in Et?(Y(Array.isArray(Et.shape)&&Et.shape.length>=2,"shape must be an array"),Ln=Et.shape[0],Wr=Et.shape[1],Et.shape.length===3&&(xe=Et.shape[2],Y(xe>0&&xe<=4,"invalid number of channels"),de=!0),Y(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid width"),Y(Wr>=0&&Wr<=Ie.maxTextureSize,"invalid height")):("radius"in Et&&(Ln=Wr=Et.radius,Y(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid radius")),"width"in Et&&(Ln=Et.width,Y(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid width")),"height"in Et&&(Wr=Et.height,Y(Wr>=0&&Wr<=Ie.maxTextureSize,"invalid height")),"channels"in Et&&(xe=Et.channels,Y(xe>0&&xe<=4,"invalid number of channels"),de=!0)),Te.width=Ln|0,Te.height=Wr|0,Te.channels=xe|0;var Ge=!1;if("format"in Et){var tt=Et.format;Y(me.webgl_depth_texture||!(tt==="depth"||tt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Y.parameter(tt,rn,"invalid texture format");var ct=Te.internalformat=rn[tt];Te.format=yn[ct],tt in pn&&("type"in Et||(Te.type=pn[tt])),tt in Gt&&(Te.compressed=!0),Ge=!0}!de&&Ge?Te.channels=ba[Te.format]:de&&!Ge?Te.channels!==go[Te.format]&&(Te.format=Te.internalformat=go[Te.channels]):Ge&&de&&Y(Te.channels===ba[Te.format],"number of channels inconsistent with specified format")}}function xr(Te){K.pixelStorei(Pa,Te.flipY),K.pixelStorei(mm,Te.premultiplyAlpha),K.pixelStorei(he,Te.colorSpace),K.pixelStorei(Op,Te.unpackAlignment)}function on(){Yt.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Zt(Te,Et){var _t=null;if(cs(Et)?_t=Et:Et&&(Y.type(Et,"object","invalid pixel data type"),ar(Te,Et),"x"in Et&&(Te.xOffset=Et.x|0),"y"in Et&&(Te.yOffset=Et.y|0),cs(Et.data)&&(_t=Et.data)),Y(!Te.compressed||_t instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Et.copy){Y(!_t,"can not specify copy and data field for the same texture");var Ln=Dt.viewportWidth,Wr=Dt.viewportHeight;Te.width=Te.width||Ln-Te.xOffset,Te.height=Te.height||Wr-Te.yOffset,Te.needsCopy=!0,Y(Te.xOffset>=0&&Te.xOffset<Ln&&Te.yOffset>=0&&Te.yOffset<Wr&&Te.width>0&&Te.width<=Ln&&Te.height>0&&Te.height<=Wr,"copy texture read out of bounds")}else if(!_t)Te.width=Te.width||1,Te.height=Te.height||1,Te.channels=Te.channels||4;else if(n(_t))Te.channels=Te.channels||4,Te.data=_t,!("type"in Et)&&Te.type===dc&&(Te.type=mi(_t));else if(pd(_t))Te.channels=Te.channels||4,ym(Te,_t),Te.alignment=1,Te.needsFree=!0;else if(Ia(_t)){var xe=_t.data;!Array.isArray(xe)&&Te.type===dc&&(Te.type=mi(xe));var de=_t.shape,Ge=_t.stride,tt,ct,Xe,We,Qe,Ee;de.length===3?(Xe=de[2],Ee=Ge[2]):(Y(de.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Xe=1,Ee=1),tt=de[0],ct=de[1],We=Ge[0],Qe=Ge[1],Te.alignment=1,Te.width=tt,Te.height=ct,Te.channels=Xe,Te.format=Te.internalformat=go[Xe],Te.needsFree=!0,Io(Te,xe,We,Qe,Ee,_t.offset)}else if(us(_t)||hf(_t)||Au(_t))us(_t)||hf(_t)?Te.element=_t:Te.element=_t.canvas,Te.width=Te.element.width,Te.height=Te.element.height,Te.channels=4;else if(Al(_t))Te.element=_t,Te.width=_t.width,Te.height=_t.height,Te.channels=4;else if(Hh(_t))Te.element=_t,Te.width=_t.naturalWidth,Te.height=_t.naturalHeight,Te.channels=4;else if(Xh(_t))Te.element=_t,Te.width=_t.videoWidth,Te.height=_t.videoHeight,Te.channels=4;else if(zh(_t)){var Ue=Te.width||_t[0].length,be=Te.height||_t.length,nt=Te.channels;L(_t[0][0])?nt=nt||_t[0][0].length:nt=nt||1;for(var ot=wl.shape(_t),g=1,x=0;x<ot.length;++x)g*=ot[x];var C=Yh(Te,g);wl.flatten(_t,ot,"",C),Ii(Te,C),Te.alignment=1,Te.width=Ue,Te.height=be,Te.channels=nt,Te.format=Te.internalformat=go[nt],Te.needsFree=!0}Te.type===ji?Y(Ie.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Te.type===Zi&&Y(Ie.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Ht(Te,Et,_t){var Ln=Te.element,Wr=Te.data,xe=Te.internalformat,de=Te.format,Ge=Te.type,tt=Te.width,ct=Te.height;xr(Te),Ln?K.texImage2D(Et,_t,de,de,Ge,Ln):Te.compressed?K.compressedTexImage2D(Et,_t,xe,tt,ct,0,Wr):Te.needsCopy?(wt(),K.copyTexImage2D(Et,_t,de,Te.xOffset,Te.yOffset,tt,ct,0)):K.texImage2D(Et,_t,de,tt,ct,0,de,Ge,Wr||null)}function fr(Te,Et,_t,Ln,Wr){var xe=Te.element,de=Te.data,Ge=Te.internalformat,tt=Te.format,ct=Te.type,Xe=Te.width,We=Te.height;xr(Te),xe?K.texSubImage2D(Et,Wr,_t,Ln,tt,ct,xe):Te.compressed?K.compressedTexSubImage2D(Et,Wr,_t,Ln,Ge,Xe,We,de):Te.needsCopy?(wt(),K.copyTexSubImage2D(Et,Wr,_t,Ln,Te.xOffset,Te.yOffset,Xe,We)):K.texSubImage2D(Et,Wr,_t,Ln,Xe,We,tt,ct,de)}var Dr=[];function Un(){return Dr.pop()||new on}function $r(Te){Te.needsFree&&Oo.freeType(Te.data),on.call(Te),Dr.push(Te)}function Or(){Yt.call(this),this.genMipmaps=!1,this.mipmapHint=pf,this.mipmask=0,this.images=Array(16)}function Fr(Te,Et,_t){var Ln=Te.images[0]=Un();Te.mipmask=1,Ln.width=Te.width=Et,Ln.height=Te.height=_t,Ln.channels=Te.channels=4}function Qr(Te,Et){var _t=null;if(cs(Et))_t=Te.images[0]=Un(),En(_t,Te),Zt(_t,Et),Te.mipmask=1;else if(ar(Te,Et),Array.isArray(Et.mipmap))for(var Ln=Et.mipmap,Wr=0;Wr<Ln.length;++Wr)_t=Te.images[Wr]=Un(),En(_t,Te),_t.width>>=Wr,_t.height>>=Wr,Zt(_t,Ln[Wr]),Te.mipmask|=1<<Wr;else _t=Te.images[0]=Un(),En(_t,Te),Zt(_t,Et),Te.mipmask=1;En(Te,Te.images[0]),Te.compressed&&(Te.internalformat===Js||Te.internalformat===Rs||Te.internalformat===as||Te.internalformat===ls)&&Y(Te.width%4===0&&Te.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function ki(Te,Et){for(var _t=Te.images,Ln=0;Ln<_t.length;++Ln){if(!_t[Ln])return;Ht(_t[Ln],Et,Ln)}}var Si=[];function jr(){var Te=Si.pop()||new Or;Yt.call(Te),Te.mipmask=0;for(var Et=0;Et<16;++Et)Te.images[Et]=null;return Te}function Wi(Te){for(var Et=Te.images,_t=0;_t<Et.length;++_t)Et[_t]&&$r(Et[_t]),Et[_t]=null;Si.push(Te)}function Ko(){this.minFilter=df,this.magFilter=df,this.wrapS=ud,this.wrapT=ud,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=pf}function Pi(Te,Et){if("min"in Et){var _t=Et.min;Y.parameter(_t,Mt),Te.minFilter=Mt[_t],Ul.indexOf(Te.minFilter)>=0&&!("faces"in Et)&&(Te.genMipmaps=!0)}if("mag"in Et){var Ln=Et.mag;Y.parameter(Ln,nn),Te.magFilter=nn[Ln]}var Wr=Te.wrapS,xe=Te.wrapT;if("wrap"in Et){var de=Et.wrap;typeof de=="string"?(Y.parameter(de,sn),Wr=xe=sn[de]):Array.isArray(de)&&(Y.parameter(de[0],sn),Y.parameter(de[1],sn),Wr=sn[de[0]],xe=sn[de[1]])}else{if("wrapS"in Et){var Ge=Et.wrapS;Y.parameter(Ge,sn),Wr=sn[Ge]}if("wrapT"in Et){var tt=Et.wrapT;Y.parameter(tt,sn),xe=sn[tt]}}if(Te.wrapS=Wr,Te.wrapT=xe,"anisotropic"in Et){var ct=Et.anisotropic;Y(typeof ct=="number"&&ct>=1&&ct<=Ie.maxAnisotropic,"aniso samples must be between 1 and "),Te.anisotropic=Et.anisotropic}if("mipmap"in Et){var Xe=!1;switch(typeof Et.mipmap){case"string":Y.parameter(Et.mipmap,tn,"invalid mipmap hint"),Te.mipmapHint=tn[Et.mipmap],Te.genMipmaps=!0,Xe=!0;break;case"boolean":Xe=Te.genMipmaps=Et.mipmap;break;case"object":Y(Array.isArray(Et.mipmap),"invalid mipmap type"),Te.genMipmaps=!1,Xe=!0;break;default:Y.raise("invalid mipmap type")}Xe&&!("min"in Et)&&(Te.minFilter=Ou)}}function $i(Te,Et){K.texParameteri(Et,dd,Te.minFilter),K.texParameteri(Et,cd,Te.magFilter),K.texParameteri(Et,Ga,Te.wrapS),K.texParameteri(Et,Ep,Te.wrapT),me.ext_texture_filter_anisotropic&&K.texParameteri(Et,vm,Te.anisotropic),Te.genMipmaps&&(K.hint(fy,Te.mipmapHint),K.generateMipmap(Et))}var Qi=0,la={},zi=Ie.maxTextureUnits,di=Array(zi).map(function(){return null});function Cr(Te){Yt.call(this),this.mipmask=0,this.internalformat=_n,this.id=Qi++,this.refCount=1,this.target=Te,this.texture=K.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ko,Nt.profile&&(this.stats={size:0})}function sa(Te){K.activeTexture(Qs),K.bindTexture(Te.target,Te.texture)}function co(){var Te=di[0];Te?K.bindTexture(Te.target,Te.texture):K.bindTexture(Re,null)}function cr(Te){var Et=Te.texture;Y(Et,"must not double destroy texture");var _t=Te.unit,Ln=Te.target;_t>=0&&(K.activeTexture(Qs+_t),K.bindTexture(Ln,null),di[_t]=null),K.deleteTexture(Et),Te.texture=null,Te.params=null,Te.pixels=null,Te.refCount=0,delete la[Te.id],yt.textureCount--}o(Cr.prototype,{bind:function(){var Te=this;Te.bindCount+=1;var Et=Te.unit;if(Et<0){for(var _t=0;_t<zi;++_t){var Ln=di[_t];if(Ln){if(Ln.bindCount>0)continue;Ln.unit=-1}di[_t]=Te,Et=_t;break}Et>=zi&&Y.raise("insufficient number of texture units"),Nt.profile&&yt.maxTextureUnits<Et+1&&(yt.maxTextureUnits=Et+1),Te.unit=Et,K.activeTexture(Qs+Et),K.bindTexture(Te.target,Te.texture)}return Et},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&cr(this)}});function Xr(Te,Et){var _t=new Cr(Re);la[_t.id]=_t,yt.textureCount++;function Ln(de,Ge){var tt=_t.texInfo;Ko.call(tt);var ct=jr();return typeof de=="number"?typeof Ge=="number"?Fr(ct,de|0,Ge|0):Fr(ct,de|0,de|0):de?(Y.type(de,"object","invalid arguments to regl.texture"),Pi(tt,de),Qr(ct,de)):Fr(ct,1,1),tt.genMipmaps&&(ct.mipmask=(ct.width<<1)-1),_t.mipmask=ct.mipmask,En(_t,ct),Y.texture2D(tt,ct,Ie),_t.internalformat=ct.internalformat,Ln.width=ct.width,Ln.height=ct.height,sa(_t),ki(ct,Re),$i(tt,Re),co(),Wi(ct),Nt.profile&&(_t.stats.size=Ji(_t.internalformat,_t.type,ct.width,ct.height,tt.genMipmaps,!1)),Ln.format=ln[_t.internalformat],Ln.type=Sn[_t.type],Ln.mag=Xt[tt.magFilter],Ln.min=kn[tt.minFilter],Ln.wrapS=Kt[tt.wrapS],Ln.wrapT=Kt[tt.wrapT],Ln}function Wr(de,Ge,tt,ct){Y(!!de,"must specify image data");var Xe=Ge|0,We=tt|0,Qe=ct|0,Ee=Un();return En(Ee,_t),Ee.width=0,Ee.height=0,Zt(Ee,de),Ee.width=Ee.width||(_t.width>>Qe)-Xe,Ee.height=Ee.height||(_t.height>>Qe)-We,Y(_t.type===Ee.type&&_t.format===Ee.format&&_t.internalformat===Ee.internalformat,"incompatible format for texture.subimage"),Y(Xe>=0&&We>=0&&Xe+Ee.width<=_t.width&&We+Ee.height<=_t.height,"texture.subimage write out of bounds"),Y(_t.mipmask&1<<Qe,"missing mipmap data"),Y(Ee.data||Ee.element||Ee.needsCopy,"missing image data"),sa(_t),fr(Ee,Re,Xe,We,Qe),co(),$r(Ee),Ln}function xe(de,Ge){var tt=de|0,ct=Ge|0||tt;if(tt===_t.width&&ct===_t.height)return Ln;Ln.width=_t.width=tt,Ln.height=_t.height=ct,sa(_t);for(var Xe=0;_t.mipmask>>Xe;++Xe){var We=tt>>Xe,Qe=ct>>Xe;if(!We||!Qe)break;K.texImage2D(Re,Xe,_t.format,We,Qe,0,_t.format,_t.type,null)}return co(),Nt.profile&&(_t.stats.size=Ji(_t.internalformat,_t.type,tt,ct,!1,!1)),Ln}return Ln(Te,Et),Ln.subimage=Wr,Ln.resize=xe,Ln._reglType="texture2d",Ln._texture=_t,Nt.profile&&(Ln.stats=_t.stats),Ln.destroy=function(){_t.decRef()},Ln}function Nr(Te,Et,_t,Ln,Wr,xe){var de=new Cr(lt);la[de.id]=de,yt.cubeCount++;var Ge=new Array(6);function tt(We,Qe,Ee,Ue,be,nt){var ot,g=de.texInfo;for(Ko.call(g),ot=0;ot<6;++ot)Ge[ot]=jr();if(typeof We=="number"||!We){var x=We|0||1;for(ot=0;ot<6;++ot)Fr(Ge[ot],x,x)}else if(typeof We=="object")if(Qe)Qr(Ge[0],We),Qr(Ge[1],Qe),Qr(Ge[2],Ee),Qr(Ge[3],Ue),Qr(Ge[4],be),Qr(Ge[5],nt);else if(Pi(g,We),ar(de,We),"faces"in We){var C=We.faces;for(Y(Array.isArray(C)&&C.length===6,"cube faces must be a length 6 array"),ot=0;ot<6;++ot)Y(typeof C[ot]=="object"&&!!C[ot],"invalid input for cube map face"),En(Ge[ot],de),Qr(Ge[ot],C[ot])}else for(ot=0;ot<6;++ot)Qr(Ge[ot],We);else Y.raise("invalid arguments to cube map");for(En(de,Ge[0]),Ie.npotTextureCube||Y(Z(de.width)&&Z(de.height),"your browser does not support non power or two texture dimensions"),g.genMipmaps?de.mipmask=(Ge[0].width<<1)-1:de.mipmask=Ge[0].mipmask,Y.textureCube(de,g,Ge,Ie),de.internalformat=Ge[0].internalformat,tt.width=Ge[0].width,tt.height=Ge[0].height,sa(de),ot=0;ot<6;++ot)ki(Ge[ot],It+ot);for($i(g,lt),co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,g.genMipmaps,!0)),tt.format=ln[de.internalformat],tt.type=Sn[de.type],tt.mag=Xt[g.magFilter],tt.min=kn[g.minFilter],tt.wrapS=Kt[g.wrapS],tt.wrapT=Kt[g.wrapT],ot=0;ot<6;++ot)Wi(Ge[ot]);return tt}function ct(We,Qe,Ee,Ue,be){Y(!!Qe,"must specify image data"),Y(typeof We=="number"&&We===(We|0)&&We>=0&&We<6,"invalid face");var nt=Ee|0,ot=Ue|0,g=be|0,x=Un();return En(x,de),x.width=0,x.height=0,Zt(x,Qe),x.width=x.width||(de.width>>g)-nt,x.height=x.height||(de.height>>g)-ot,Y(de.type===x.type&&de.format===x.format&&de.internalformat===x.internalformat,"incompatible format for texture.subimage"),Y(nt>=0&&ot>=0&&nt+x.width<=de.width&&ot+x.height<=de.height,"texture.subimage write out of bounds"),Y(de.mipmask&1<<g,"missing mipmap data"),Y(x.data||x.element||x.needsCopy,"missing image data"),sa(de),fr(x,It+We,nt,ot,g),co(),$r(x),tt}function Xe(We){var Qe=We|0;if(Qe!==de.width){tt.width=de.width=Qe,tt.height=de.height=Qe,sa(de);for(var Ee=0;Ee<6;++Ee)for(var Ue=0;de.mipmask>>Ue;++Ue)K.texImage2D(It+Ee,Ue,de.format,Qe>>Ue,Qe>>Ue,0,de.format,de.type,null);return co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,!1,!0)),tt}}return tt(Te,Et,_t,Ln,Wr,xe),tt.subimage=ct,tt.resize=Xe,tt._reglType="textureCube",tt._texture=de,Nt.profile&&(tt.stats=de.stats),tt.destroy=function(){de.decRef()},tt}function fi(){for(var Te=0;Te<zi;++Te)K.activeTexture(Qs+Te),K.bindTexture(Re,null),di[Te]=null;ra(la).forEach(cr),yt.cubeCount=0,yt.textureCount=0}Nt.profile&&(yt.getTotalTextureSize=function(){var Te=0;return Object.keys(la).forEach(function(Et){Te+=la[Et].stats.size}),Te});function $s(){for(var Te=0;Te<zi;++Te){var Et=di[Te];Et&&(Et.bindCount=0,Et.unit=-1,di[Te]=null)}ra(la).forEach(function(_t){_t.texture=K.createTexture(),K.bindTexture(_t.target,_t.texture);for(var Ln=0;Ln<32;++Ln)if((_t.mipmask&1<<Ln)!==0)if(_t.target===Re)K.texImage2D(Re,Ln,_t.internalformat,_t.width>>Ln,_t.height>>Ln,0,_t.internalformat,_t.type,null);else for(var Wr=0;Wr<6;++Wr)K.texImage2D(It+Wr,Ln,_t.internalformat,_t.width>>Ln,_t.height>>Ln,0,_t.internalformat,_t.type,null);$i(_t.texInfo,_t.target)})}function yi(){for(var Te=0;Te<zi;++Te){var Et=di[Te];Et&&(Et.bindCount=0,Et.unit=-1,di[Te]=null),K.activeTexture(Qs+Te),K.bindTexture(Re,null),K.bindTexture(lt,null)}}return{create2D:Xr,createCube:Nr,clear:fi,getTexture:function(Te){return null},restore:$s,refresh:yi}}var ei=36161,ur=32854,ti=32855,vf=36194,Ds=33189,Mp=36168,Ei=34041,Mi=35907,qh=34836,Kh=34842,mf=34843,Wa=[];Wa[ur]=2,Wa[ti]=2,Wa[vf]=2,Wa[Ds]=2,Wa[Mp]=1,Wa[Ei]=4,Wa[Mi]=4,Wa[qh]=16,Wa[Kh]=8,Wa[mf]=6;function Tp(K,me,Ie){return Wa[K]*me*Ie}var hd=function(K,me,Ie,wt,Dt){var yt={rgba4:ur,rgb565:vf,"rgb5 a1":ti,depth:Ds,stencil:Mp,"depth stencil":Ei};me.ext_srgb&&(yt.srgba=Mi),me.ext_color_buffer_half_float&&(yt.rgba16f=Kh,yt.rgb16f=mf),me.webgl_color_buffer_float&&(yt.rgba32f=qh);var Nt=[];Object.keys(yt).forEach(function(rn){var Gt=yt[rn];Nt[Gt]=rn});var tn=0,sn={};function nn(rn){this.id=tn++,this.refCount=1,this.renderbuffer=rn,this.format=ur,this.width=0,this.height=0,Dt.profile&&(this.stats={size:0})}nn.prototype.decRef=function(){--this.refCount<=0&&Mt(this)};function Mt(rn){var Gt=rn.renderbuffer;Y(Gt,"must not double destroy renderbuffer"),K.bindRenderbuffer(ei,null),K.deleteRenderbuffer(Gt),rn.renderbuffer=null,rn.refCount=0,delete sn[rn.id],wt.renderbufferCount--}function bn(rn,Gt){var st=new nn(K.createRenderbuffer());sn[st.id]=st,wt.renderbufferCount++;function St(Sn,Xt){var kn=0,Kt=0,yn=ur;if(typeof Sn=="object"&&Sn){var Yt=Sn;if("shape"in Yt){var En=Yt.shape;Y(Array.isArray(En)&&En.length>=2,"invalid renderbuffer shape"),kn=En[0]|0,Kt=En[1]|0}else"radius"in Yt&&(kn=Kt=Yt.radius|0),"width"in Yt&&(kn=Yt.width|0),"height"in Yt&&(Kt=Yt.height|0);"format"in Yt&&(Y.parameter(Yt.format,yt,"invalid renderbuffer format"),yn=yt[Yt.format])}else typeof Sn=="number"?(kn=Sn|0,typeof Xt=="number"?Kt=Xt|0:Kt=kn):Sn?Y.raise("invalid arguments to renderbuffer constructor"):kn=Kt=1;if(Y(kn>0&&Kt>0&&kn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),!(kn===st.width&&Kt===st.height&&yn===st.format))return St.width=st.width=kn,St.height=st.height=Kt,st.format=yn,K.bindRenderbuffer(ei,st.renderbuffer),K.renderbufferStorage(ei,yn,kn,Kt),Y(K.getError()===0,"invalid render buffer format"),Dt.profile&&(st.stats.size=Tp(st.format,st.width,st.height)),St.format=Nt[st.format],St}function ln(Sn,Xt){var kn=Sn|0,Kt=Xt|0||kn;return kn===st.width&&Kt===st.height||(Y(kn>0&&Kt>0&&kn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),St.width=st.width=kn,St.height=st.height=Kt,K.bindRenderbuffer(ei,st.renderbuffer),K.renderbufferStorage(ei,st.format,kn,Kt),Y(K.getError()===0,"invalid render buffer format"),Dt.profile&&(st.stats.size=Tp(st.format,st.width,st.height))),St}return St(rn,Gt),St.resize=ln,St._reglType="renderbuffer",St._renderbuffer=st,Dt.profile&&(St.stats=st.stats),St.destroy=function(){st.decRef()},St}Dt.profile&&(wt.getTotalRenderbufferSize=function(){var rn=0;return Object.keys(sn).forEach(function(Gt){rn+=sn[Gt].stats.size}),rn});function pn(){ra(sn).forEach(function(rn){rn.renderbuffer=K.createRenderbuffer(),K.bindRenderbuffer(ei,rn.renderbuffer),K.renderbufferStorage(ei,rn.format,rn.width,rn.height)}),K.bindRenderbuffer(ei,null)}return{create:bn,clear:function(){ra(sn).forEach(Mt)},restore:pn}},Vl=36160,Mu=36161,ru=3553,Gl=34069,_m=36064,js=36096,Ml=36128,Zh=33306,Jh=36053,Cp=36054,bm=36055,wm=36057,Em=36061,Np=36193,Qh=5121,ev=5126,gf=6407,uo=6408,vy=6402,tv=[gf,uo],hc=[];hc[uo]=4,hc[gf]=3;var yf=[];yf[Qh]=1,yf[ev]=4,yf[Np]=2;var my=32854,xm=32855,Tl=36194,gy=33189,_f=36168,kp=34041,nv=35907,Om=34836,cl=34842,Tu=34843,Pp=[my,xm,Tl,nv,cl,Tu,Om],vc={};vc[Jh]="complete",vc[Cp]="incomplete attachment",vc[wm]="incomplete dimensions",vc[bm]="incomplete, missing attachment",vc[Em]="unsupported";function Rp(K,me,Ie,wt,Dt,yt){var Nt={cur:null,next:null,dirty:!1,setFBO:null},tn=["rgba"],sn=["rgba4","rgb565","rgb5 a1"];me.ext_srgb&&sn.push("srgba"),me.ext_color_buffer_half_float&&sn.push("rgba16f","rgb16f"),me.webgl_color_buffer_float&&sn.push("rgba32f");var nn=["uint8"];me.oes_texture_half_float&&nn.push("half float","float16"),me.oes_texture_float&&nn.push("float","float32");function Mt(on,Zt,Ht){this.target=on,this.texture=Zt,this.renderbuffer=Ht;var fr=0,Dr=0;Zt?(fr=Zt.width,Dr=Zt.height):Ht&&(fr=Ht.width,Dr=Ht.height),this.width=fr,this.height=Dr}function bn(on){on&&(on.texture&&on.texture._texture.decRef(),on.renderbuffer&&on.renderbuffer._renderbuffer.decRef())}function pn(on,Zt,Ht){if(on)if(on.texture){var fr=on.texture._texture,Dr=Math.max(1,fr.width),Un=Math.max(1,fr.height);Y(Dr===Zt&&Un===Ht,"inconsistent width/height for supplied texture"),fr.refCount+=1}else{var $r=on.renderbuffer._renderbuffer;Y($r.width===Zt&&$r.height===Ht,"inconsistent width/height for renderbuffer"),$r.refCount+=1}}function rn(on,Zt){Zt&&(Zt.texture?K.framebufferTexture2D(Vl,on,Zt.target,Zt.texture._texture.texture,0):K.framebufferRenderbuffer(Vl,on,Mu,Zt.renderbuffer._renderbuffer.renderbuffer))}function Gt(on){var Zt=ru,Ht=null,fr=null,Dr=on;typeof on=="object"&&(Dr=on.data,"target"in on&&(Zt=on.target|0)),Y.type(Dr,"function","invalid attachment data");var Un=Dr._reglType;return Un==="texture2d"?(Ht=Dr,Y(Zt===ru)):Un==="textureCube"?(Ht=Dr,Y(Zt>=Gl&&Zt<Gl+6,"invalid cube map target")):Un==="renderbuffer"?(fr=Dr,Zt=Mu):Y.raise("invalid regl object for attachment"),new Mt(Zt,Ht,fr)}function st(on,Zt,Ht,fr,Dr){if(Ht){var Un=wt.create2D({width:on,height:Zt,format:fr,type:Dr});return Un._texture.refCount=0,new Mt(ru,Un,null)}else{var $r=Dt.create({width:on,height:Zt,format:fr});return $r._renderbuffer.refCount=0,new Mt(Mu,null,$r)}}function St(on){return on&&(on.texture||on.renderbuffer)}function ln(on,Zt,Ht){on&&(on.texture?on.texture.resize(Zt,Ht):on.renderbuffer&&on.renderbuffer.resize(Zt,Ht),on.width=Zt,on.height=Ht)}var Sn=0,Xt={};function kn(){this.id=Sn++,Xt[this.id]=this,this.framebuffer=K.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Kt(on){on.colorAttachments.forEach(bn),bn(on.depthAttachment),bn(on.stencilAttachment),bn(on.depthStencilAttachment)}function yn(on){var Zt=on.framebuffer;Y(Zt,"must not double destroy framebuffer"),K.deleteFramebuffer(Zt),on.framebuffer=null,yt.framebufferCount--,delete Xt[on.id]}function Yt(on){var Zt;K.bindFramebuffer(Vl,on.framebuffer);var Ht=on.colorAttachments;for(Zt=0;Zt<Ht.length;++Zt)rn(_m+Zt,Ht[Zt]);for(Zt=Ht.length;Zt<Ie.maxColorAttachments;++Zt)K.framebufferTexture2D(Vl,_m+Zt,ru,null,0);K.framebufferTexture2D(Vl,Zh,ru,null,0),K.framebufferTexture2D(Vl,js,ru,null,0),K.framebufferTexture2D(Vl,Ml,ru,null,0),rn(js,on.depthAttachment),rn(Ml,on.stencilAttachment),rn(Zh,on.depthStencilAttachment);var fr=K.checkFramebufferStatus(Vl);!K.isContextLost()&&fr!==Jh&&Y.raise("framebuffer configuration not supported, status = "+vc[fr]),K.bindFramebuffer(Vl,Nt.next?Nt.next.framebuffer:null),Nt.cur=Nt.next,K.getError()}function En(on,Zt){var Ht=new kn;yt.framebufferCount++;function fr(Un,$r){var Or;Y(Nt.next!==Ht,"can not update framebuffer which is currently in use");var Fr=0,Qr=0,ki=!0,Si=!0,jr=null,Wi=!0,Ko="rgba",Pi="uint8",$i=1,Qi=null,la=null,zi=null,di=!1;if(typeof Un=="number")Fr=Un|0,Qr=$r|0||Fr;else if(!Un)Fr=Qr=1;else{Y.type(Un,"object","invalid arguments for framebuffer");var Cr=Un;if("shape"in Cr){var sa=Cr.shape;Y(Array.isArray(sa)&&sa.length>=2,"invalid shape for framebuffer"),Fr=sa[0],Qr=sa[1]}else"radius"in Cr&&(Fr=Qr=Cr.radius),"width"in Cr&&(Fr=Cr.width),"height"in Cr&&(Qr=Cr.height);("color"in Cr||"colors"in Cr)&&(jr=Cr.color||Cr.colors,Array.isArray(jr)&&Y(jr.length===1||me.webgl_draw_buffers,"multiple render targets not supported")),jr||("colorCount"in Cr&&($i=Cr.colorCount|0,Y($i>0,"invalid color buffer count")),"colorTexture"in Cr&&(Wi=!!Cr.colorTexture,Ko="rgba4"),"colorType"in Cr&&(Pi=Cr.colorType,Wi?(Y(me.oes_texture_float||!(Pi==="float"||Pi==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Y(me.oes_texture_half_float||!(Pi==="half float"||Pi==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):Pi==="half float"||Pi==="float16"?(Y(me.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Ko="rgba16f"):(Pi==="float"||Pi==="float32")&&(Y(me.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Ko="rgba32f"),Y.oneOf(Pi,nn,"invalid color type")),"colorFormat"in Cr&&(Ko=Cr.colorFormat,tn.indexOf(Ko)>=0?Wi=!0:sn.indexOf(Ko)>=0?Wi=!1:Wi?Y.oneOf(Cr.colorFormat,tn,"invalid color format for texture"):Y.oneOf(Cr.colorFormat,sn,"invalid color format for renderbuffer"))),("depthTexture"in Cr||"depthStencilTexture"in Cr)&&(di=!!(Cr.depthTexture||Cr.depthStencilTexture),Y(!di||me.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Cr&&(typeof Cr.depth=="boolean"?ki=Cr.depth:(Qi=Cr.depth,Si=!1)),"stencil"in Cr&&(typeof Cr.stencil=="boolean"?Si=Cr.stencil:(la=Cr.stencil,ki=!1)),"depthStencil"in Cr&&(typeof Cr.depthStencil=="boolean"?ki=Si=Cr.depthStencil:(zi=Cr.depthStencil,ki=!1,Si=!1))}var co=null,cr=null,Xr=null,Nr=null;if(Array.isArray(jr))co=jr.map(Gt);else if(jr)co=[Gt(jr)];else for(co=new Array($i),Or=0;Or<$i;++Or)co[Or]=st(Fr,Qr,Wi,Ko,Pi);Y(me.webgl_draw_buffers||co.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),Y(co.length<=Ie.maxColorAttachments,"too many color attachments, not supported"),Fr=Fr||co[0].width,Qr=Qr||co[0].height,Qi?cr=Gt(Qi):ki&&!Si&&(cr=st(Fr,Qr,di,"depth","uint32")),la?Xr=Gt(la):Si&&!ki&&(Xr=st(Fr,Qr,!1,"stencil","uint8")),zi?Nr=Gt(zi):!Qi&&!la&&Si&&ki&&(Nr=st(Fr,Qr,di,"depth stencil","depth stencil")),Y(!!Qi+!!la+!!zi<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var fi=null;for(Or=0;Or<co.length;++Or)if(pn(co[Or],Fr,Qr),Y(!co[Or]||co[Or].texture&&tv.indexOf(co[Or].texture._texture.format)>=0||co[Or].renderbuffer&&Pp.indexOf(co[Or].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Or+" is invalid"),co[Or]&&co[Or].texture){var $s=hc[co[Or].texture._texture.format]*yf[co[Or].texture._texture.type];fi===null?fi=$s:Y(fi===$s,"all color attachments much have the same number of bits per pixel.")}return pn(cr,Fr,Qr),Y(!cr||cr.texture&&cr.texture._texture.format===vy||cr.renderbuffer&&cr.renderbuffer._renderbuffer.format===gy,"invalid depth attachment for framebuffer object"),pn(Xr,Fr,Qr),Y(!Xr||Xr.renderbuffer&&Xr.renderbuffer._renderbuffer.format===_f,"invalid stencil attachment for framebuffer object"),pn(Nr,Fr,Qr),Y(!Nr||Nr.texture&&Nr.texture._texture.format===kp||Nr.renderbuffer&&Nr.renderbuffer._renderbuffer.format===kp,"invalid depth-stencil attachment for framebuffer object"),Kt(Ht),Ht.width=Fr,Ht.height=Qr,Ht.colorAttachments=co,Ht.depthAttachment=cr,Ht.stencilAttachment=Xr,Ht.depthStencilAttachment=Nr,fr.color=co.map(St),fr.depth=St(cr),fr.stencil=St(Xr),fr.depthStencil=St(Nr),fr.width=Ht.width,fr.height=Ht.height,Yt(Ht),fr}function Dr(Un,$r){Y(Nt.next!==Ht,"can not resize a framebuffer which is currently in use");var Or=Math.max(Un|0,1),Fr=Math.max($r|0||Or,1);if(Or===Ht.width&&Fr===Ht.height)return fr;for(var Qr=Ht.colorAttachments,ki=0;ki<Qr.length;++ki)ln(Qr[ki],Or,Fr);return ln(Ht.depthAttachment,Or,Fr),ln(Ht.stencilAttachment,Or,Fr),ln(Ht.depthStencilAttachment,Or,Fr),Ht.width=fr.width=Or,Ht.height=fr.height=Fr,Yt(Ht),fr}return fr(on,Zt),o(fr,{resize:Dr,_reglType:"framebuffer",_framebuffer:Ht,destroy:function(){yn(Ht),Kt(Ht)},use:function(Un){Nt.setFBO({framebuffer:fr},Un)}})}function ar(on){var Zt=Array(6);function Ht(Dr){var Un;Y(Zt.indexOf(Nt.next)<0,"can not update framebuffer which is currently in use");var $r={color:null},Or=0,Fr=null,Qr="rgba",ki="uint8",Si=1;if(typeof Dr=="number")Or=Dr|0;else if(!Dr)Or=1;else{Y.type(Dr,"object","invalid arguments for framebuffer");var jr=Dr;if("shape"in jr){var Wi=jr.shape;Y(Array.isArray(Wi)&&Wi.length>=2,"invalid shape for framebuffer"),Y(Wi[0]===Wi[1],"cube framebuffer must be square"),Or=Wi[0]}else"radius"in jr&&(Or=jr.radius|0),"width"in jr?(Or=jr.width|0,"height"in jr&&Y(jr.height===Or,"must be square")):"height"in jr&&(Or=jr.height|0);("color"in jr||"colors"in jr)&&(Fr=jr.color||jr.colors,Array.isArray(Fr)&&Y(Fr.length===1||me.webgl_draw_buffers,"multiple render targets not supported")),Fr||("colorCount"in jr&&(Si=jr.colorCount|0,Y(Si>0,"invalid color buffer count")),"colorType"in jr&&(Y.oneOf(jr.colorType,nn,"invalid color type"),ki=jr.colorType),"colorFormat"in jr&&(Qr=jr.colorFormat,Y.oneOf(jr.colorFormat,tn,"invalid color format for texture"))),"depth"in jr&&($r.depth=jr.depth),"stencil"in jr&&($r.stencil=jr.stencil),"depthStencil"in jr&&($r.depthStencil=jr.depthStencil)}var Ko;if(Fr)if(Array.isArray(Fr))for(Ko=[],Un=0;Un<Fr.length;++Un)Ko[Un]=Fr[Un];else Ko=[Fr];else{Ko=Array(Si);var Pi={radius:Or,format:Qr,type:ki};for(Un=0;Un<Si;++Un)Ko[Un]=wt.createCube(Pi)}for($r.color=Array(Ko.length),Un=0;Un<Ko.length;++Un){var $i=Ko[Un];Y(typeof $i=="function"&&$i._reglType==="textureCube","invalid cube map"),Or=Or||$i.width,Y($i.width===Or&&$i.height===Or,"invalid cube map shape"),$r.color[Un]={target:Gl,data:Ko[Un]}}for(Un=0;Un<6;++Un){for(var Qi=0;Qi<Ko.length;++Qi)$r.color[Qi].target=Gl+Un;Un>0&&($r.depth=Zt[0].depth,$r.stencil=Zt[0].stencil,$r.depthStencil=Zt[0].depthStencil),Zt[Un]?Zt[Un]($r):Zt[Un]=En($r)}return o(Ht,{width:Or,height:Or,color:Ko})}function fr(Dr){var Un,$r=Dr|0;if(Y($r>0&&$r<=Ie.maxCubeMapSize,"invalid radius for cube fbo"),$r===Ht.width)return Ht;var Or=Ht.color;for(Un=0;Un<Or.length;++Un)Or[Un].resize($r);for(Un=0;Un<6;++Un)Zt[Un].resize($r);return Ht.width=Ht.height=$r,Ht}return Ht(on),o(Ht,{faces:Zt,resize:fr,_reglType:"framebufferCube",destroy:function(){Zt.forEach(function(Dr){Dr.destroy()})}})}function xr(){Nt.cur=null,Nt.next=null,Nt.dirty=!0,ra(Xt).forEach(function(on){on.framebuffer=K.createFramebuffer(),Yt(on)})}return o(Nt,{getFramebuffer:function(on){if(typeof on=="function"&&on._reglType==="framebuffer"){var Zt=on._framebuffer;if(Zt instanceof kn)return Zt}return null},create:En,createCube:ar,clear:function(){ra(Xt).forEach(yn)},restore:xr})}var rv=5126,Dp=34962;function bf(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=rv,this.offset=0,this.stride=0,this.divisor=0}function jp(K,me,Ie,wt,Dt){for(var yt=Ie.maxAttributes,Nt=new Array(yt),tn=0;tn<yt;++tn)Nt[tn]=new bf;var sn=0,nn={},Mt={Record:bf,scope:{},state:Nt,currentVAO:null,targetVAO:null,restore:pn()?Xt:function(){},createVAO:kn,getVAO:Gt,destroyBuffer:bn,setVAO:pn()?st:St,clear:pn()?ln:function(){}};function bn(Kt){for(var yn=0;yn<Nt.length;++yn){var Yt=Nt[yn];Yt.buffer===Kt&&(K.disableVertexAttribArray(yn),Yt.buffer=null)}}function pn(){return me.oes_vertex_array_object}function rn(){return me.angle_instanced_arrays}function Gt(Kt){return typeof Kt=="function"&&Kt._vao?Kt._vao:null}function st(Kt){if(Kt!==Mt.currentVAO){var yn=pn();Kt?yn.bindVertexArrayOES(Kt.vao):yn.bindVertexArrayOES(null),Mt.currentVAO=Kt}}function St(Kt){if(Kt!==Mt.currentVAO){if(Kt)Kt.bindAttrs();else for(var yn=rn(),Yt=0;Yt<Nt.length;++Yt){var En=Nt[Yt];En.buffer?(K.enableVertexAttribArray(Yt),K.vertexAttribPointer(Yt,En.size,En.type,En.normalized,En.stride,En.offfset),yn&&En.divisor&&yn.vertexAttribDivisorANGLE(Yt,En.divisor)):(K.disableVertexAttribArray(Yt),K.vertexAttrib4f(Yt,En.x,En.y,En.z,En.w))}Mt.currentVAO=Kt}}function ln(){ra(nn).forEach(function(Kt){Kt.destroy()})}function Sn(){this.id=++sn,this.attributes=[];var Kt=pn();Kt?this.vao=Kt.createVertexArrayOES():this.vao=null,nn[this.id]=this,this.buffers=[]}Sn.prototype.bindAttrs=function(){for(var Kt=rn(),yn=this.attributes,Yt=0;Yt<yn.length;++Yt){var En=yn[Yt];En.buffer?(K.enableVertexAttribArray(Yt),K.bindBuffer(Dp,En.buffer.buffer),K.vertexAttribPointer(Yt,En.size,En.type,En.normalized,En.stride,En.offset),Kt&&En.divisor&&Kt.vertexAttribDivisorANGLE(Yt,En.divisor)):(K.disableVertexAttribArray(Yt),K.vertexAttrib4f(Yt,En.x,En.y,En.z,En.w))}for(var ar=yn.length;ar<yt;++ar)K.disableVertexAttribArray(ar)},Sn.prototype.refresh=function(){var Kt=pn();Kt&&(Kt.bindVertexArrayOES(this.vao),this.bindAttrs(),Mt.currentVAO=this)},Sn.prototype.destroy=function(){if(this.vao){var Kt=pn();this===Mt.currentVAO&&(Mt.currentVAO=null,Kt.bindVertexArrayOES(null)),Kt.deleteVertexArrayOES(this.vao),this.vao=null}nn[this.id]&&(delete nn[this.id],wt.vaoCount-=1)};function Xt(){var Kt=pn();Kt&&ra(nn).forEach(function(yn){yn.refresh()})}function kn(Kt){var yn=new Sn;wt.vaoCount+=1;function Yt(En){Y(Array.isArray(En),"arguments to vertex array constructor must be an array"),Y(En.length<yt,"too many attributes"),Y(En.length>0,"must specify at least one attribute");var ar={},xr=yn.attributes;xr.length=En.length;for(var on=0;on<En.length;++on){var Zt=En[on],Ht=xr[on]=new bf,fr=Zt.data||Zt;if(Array.isArray(fr)||n(fr)||Ia(fr)){var Dr;yn.buffers[on]&&(Dr=yn.buffers[on],n(fr)&&Dr._buffer.byteLength>=fr.byteLength?Dr.subdata(fr):(Dr.destroy(),yn.buffers[on]=null)),yn.buffers[on]||(Dr=yn.buffers[on]=Dt.create(Zt,Dp,!1,!0)),Ht.buffer=Dt.getBuffer(Dr),Ht.size=Ht.buffer.dimension|0,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1,ar[on]=1}else Dt.getBuffer(Zt)?(Ht.buffer=Dt.getBuffer(Zt),Ht.size=Ht.buffer.dimension|0,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1):Dt.getBuffer(Zt.buffer)?(Ht.buffer=Dt.getBuffer(Zt.buffer),Ht.size=(+Zt.size||Ht.buffer.dimension)|0,Ht.normalized=!!Zt.normalized||!1,"type"in Zt?(Y.parameter(Zt.type,$a,"invalid buffer type"),Ht.type=$a[Zt.type]):Ht.type=Ht.buffer.dtype,Ht.offset=(Zt.offset||0)|0,Ht.stride=(Zt.stride||0)|0,Ht.divisor=(Zt.divisor||0)|0,Ht.state=1,Y(Ht.size>=1&&Ht.size<=4,"size must be between 1 and 4"),Y(Ht.offset>=0,"invalid offset"),Y(Ht.stride>=0&&Ht.stride<=255,"stride must be between 0 and 255"),Y(Ht.divisor>=0,"divisor must be positive"),Y(!Ht.divisor||!!me.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Zt?(Y(on>0,"first attribute must not be a constant"),Ht.x=+Zt.x||0,Ht.y=+Zt.y||0,Ht.z=+Zt.z||0,Ht.w=+Zt.w||0,Ht.state=2):Y(!1,"invalid attribute spec for location "+on)}for(var Un=0;Un<yn.buffers.length;++Un)!ar[Un]&&yn.buffers[Un]&&(yn.buffers[Un].destroy(),yn.buffers[Un]=null);return yn.refresh(),Yt}return Yt.destroy=function(){for(var En=0;En<yn.buffers.length;++En)yn.buffers[En]&&yn.buffers[En].destroy();yn.buffers.length=0,yn.destroy()},Yt._vao=yn,Yt._reglType="vao",Yt(Kt)}return Mt}var Lp=35632,jo=35633,yy=35718,Uo=35721;function Ip(K,me,Ie,wt){var Dt={},yt={};function Nt(st,St,ln,Sn){this.name=st,this.id=St,this.location=ln,this.info=Sn}function tn(st,St){for(var ln=0;ln<st.length;++ln)if(st[ln].id===St.id){st[ln].location=St.location;return}st.push(St)}function sn(st,St,ln){var Sn=st===Lp?Dt:yt,Xt=Sn[St];if(!Xt){var kn=me.str(St);Xt=K.createShader(st),K.shaderSource(Xt,kn),K.compileShader(Xt),Y.shaderError(K,Xt,kn,st,ln),Sn[St]=Xt}return Xt}var nn={},Mt=[],bn=0;function pn(st,St){this.id=bn++,this.fragId=st,this.vertId=St,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,wt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function rn(st,St,ln){var Sn,Xt,kn=sn(Lp,st.fragId),Kt=sn(jo,st.vertId),yn=st.program=K.createProgram();if(K.attachShader(yn,kn),K.attachShader(yn,Kt),ln)for(Sn=0;Sn<ln.length;++Sn){var Yt=ln[Sn];K.bindAttribLocation(yn,Yt[0],Yt[1])}K.linkProgram(yn),Y.linkError(K,yn,me.str(st.fragId),me.str(st.vertId),St);var En=K.getProgramParameter(yn,yy);wt.profile&&(st.stats.uniformsCount=En);var ar=st.uniforms;for(Sn=0;Sn<En;++Sn)if(Xt=K.getActiveUniform(yn,Sn),Xt)if(Xt.size>1)for(var xr=0;xr<Xt.size;++xr){var on=Xt.name.replace("[0]","["+xr+"]");tn(ar,new Nt(on,me.id(on),K.getUniformLocation(yn,on),Xt))}else tn(ar,new Nt(Xt.name,me.id(Xt.name),K.getUniformLocation(yn,Xt.name),Xt));var Zt=K.getProgramParameter(yn,Uo);wt.profile&&(st.stats.attributesCount=Zt);var Ht=st.attributes;for(Sn=0;Sn<Zt;++Sn)Xt=K.getActiveAttrib(yn,Sn),Xt&&tn(Ht,new Nt(Xt.name,me.id(Xt.name),K.getAttribLocation(yn,Xt.name),Xt))}wt.profile&&(Ie.getMaxUniformsCount=function(){var st=0;return Mt.forEach(function(St){St.stats.uniformsCount>st&&(st=St.stats.uniformsCount)}),st},Ie.getMaxAttributesCount=function(){var st=0;return Mt.forEach(function(St){St.stats.attributesCount>st&&(st=St.stats.attributesCount)}),st});function Gt(){Dt={},yt={};for(var st=0;st<Mt.length;++st)rn(Mt[st],null,Mt[st].attributes.map(function(St){return[St.location,St.name]}))}return{clear:function(){var st=K.deleteShader.bind(K);ra(Dt).forEach(st),Dt={},ra(yt).forEach(st),yt={},Mt.forEach(function(St){K.deleteProgram(St.program)}),Mt.length=0,nn={},Ie.shaderCount=0},program:function(st,St,ln,Sn){Y.command(st>=0,"missing vertex shader",ln),Y.command(St>=0,"missing fragment shader",ln);var Xt=nn[St];Xt||(Xt=nn[St]={});var kn=Xt[st];if(kn&&(kn.refCount++,!Sn))return kn;var Kt=new pn(St,st);return Ie.shaderCount++,rn(Kt,ln,Sn),kn||(Xt[st]=Kt),Mt.push(Kt),o(Kt,{destroy:function(){if(Kt.refCount--,Kt.refCount<=0){K.deleteProgram(Kt.program);var yn=Mt.indexOf(Kt);Mt.splice(yn,1),Ie.shaderCount--}Xt[Kt.vertId].refCount<=0&&(K.deleteShader(yt[Kt.vertId]),delete yt[Kt.vertId],delete nn[Kt.fragId][Kt.vertId]),Object.keys(nn[Kt.fragId]).length||(K.deleteShader(Dt[Kt.fragId]),delete Dt[Kt.fragId],delete nn[Kt.fragId])}})},restore:Gt,shader:sn,frag:-1,vert:-1}}var Sm=6408,mc=5121,Am=3333,vd=5126;function Mm(K,me,Ie,wt,Dt,yt,Nt){function tn(Mt){var bn;me.next===null?(Y(Dt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),bn=mc):(Y(me.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),bn=me.next.colorAttachments[0].texture._texture.type,yt.oes_texture_float?(Y(bn===mc||bn===vd,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),bn===vd&&Y(Nt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):Y(bn===mc,"Reading from a framebuffer is only allowed for the type 'uint8'"));var pn=0,rn=0,Gt=wt.framebufferWidth,st=wt.framebufferHeight,St=null;n(Mt)?St=Mt:Mt&&(Y.type(Mt,"object","invalid arguments to regl.read()"),pn=Mt.x|0,rn=Mt.y|0,Y(pn>=0&&pn<wt.framebufferWidth,"invalid x offset for regl.read"),Y(rn>=0&&rn<wt.framebufferHeight,"invalid y offset for regl.read"),Gt=(Mt.width||wt.framebufferWidth-pn)|0,st=(Mt.height||wt.framebufferHeight-rn)|0,St=Mt.data||null),St&&(bn===mc?Y(St instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):bn===vd&&Y(St instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),Y(Gt>0&&Gt+pn<=wt.framebufferWidth,"invalid width for read pixels"),Y(st>0&&st+rn<=wt.framebufferHeight,"invalid height for read pixels"),Ie();var ln=Gt*st*4;return St||(bn===mc?St=new Uint8Array(ln):bn===vd&&(St=St||new Float32Array(ln))),Y.isTypedArray(St,"data buffer for regl.read() must be a typedarray"),Y(St.byteLength>=ln,"data buffer for regl.read() too small"),K.pixelStorei(Am,4),K.readPixels(pn,rn,Gt,st,Sm,bn,St),St}function sn(Mt){var bn;return me.setFBO({framebuffer:Mt.framebuffer},function(){bn=tn(Mt)}),bn}function nn(Mt){return!Mt||!("framebuffer"in Mt)?tn(Mt):sn(Mt)}return nn}function gc(K){return Array.prototype.slice.call(K)}function va(K){return gc(K).join("")}function ds(){var K=0,me=[],Ie=[];function wt(bn){for(var pn=0;pn<Ie.length;++pn)if(Ie[pn]===bn)return me[pn];var rn="g"+K++;return me.push(rn),Ie.push(bn),rn}function Dt(){var bn=[];function pn(){bn.push.apply(bn,gc(arguments))}var rn=[];function Gt(){var st="v"+K++;return rn.push(st),arguments.length>0&&(bn.push(st,"="),bn.push.apply(bn,gc(arguments)),bn.push(";")),st}return o(pn,{def:Gt,toString:function(){return va([rn.length>0?"var "+rn.join(",")+";":"",va(bn)])}})}function yt(){var bn=Dt(),pn=Dt(),rn=bn.toString,Gt=pn.toString;function st(St,ln){pn(St,ln,"=",bn.def(St,ln),";")}return o(function(){bn.apply(bn,gc(arguments))},{def:bn.def,entry:bn,exit:pn,save:st,set:function(St,ln,Sn){st(St,ln),bn(St,ln,"=",Sn,";")},toString:function(){return rn()+Gt()}})}function Nt(){var bn=va(arguments),pn=yt(),rn=yt(),Gt=pn.toString,st=rn.toString;return o(pn,{then:function(){return pn.apply(pn,gc(arguments)),this},else:function(){return rn.apply(rn,gc(arguments)),this},toString:function(){var St=st();return St&&(St="else{"+St+"}"),va(["if(",bn,"){",Gt(),"}",St])}})}var tn=Dt(),sn={};function nn(bn,pn){var rn=[];function Gt(){var Xt="a"+rn.length;return rn.push(Xt),Xt}pn=pn||0;for(var st=0;st<pn;++st)Gt();var St=yt(),ln=St.toString,Sn=sn[bn]=o(St,{arg:Gt,toString:function(){return va(["function(",rn.join(),"){",ln(),"}"])}});return Sn}function Mt(){var bn=['"use strict";',tn,"return {"];Object.keys(sn).forEach(function(Gt){bn.push('"',Gt,'":',sn[Gt].toString(),",")}),bn.push("}");var pn=va(bn).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),rn=Function.apply(null,me.concat(pn));return rn.apply(null,Ie)}return{global:tn,link:wt,block:Dt,proc:nn,scope:yt,cond:Nt,compile:Mt}}var ou="xyzw".split(""),yc=5121,_c=1,bc=2,Fp=0,iu=1,wc=2,Bp=3,fs=4,wf=5,Ef=6,md="dither",gd="blend.enable",yd="blend.color",$p="blend.equation",_d="blend.func",ov="depth.enable",Up="depth.func",Tm="depth.range",iv="depth.mask",ps="colorMask",av="cull.enable",lv="cull.face",sv="frontFace",bd="lineWidth",Ls="polygonOffset.enable",xf="polygonOffset.offset",Vp="sample.alpha",Gp="sample.enable",Cu="sample.coverage",Nu="stencil.enable",Rr="stencil.mask",wd="stencil.func",Of="stencil.opFront",hs="stencil.opBack",aa="scissor.enable",Ec="scissor.box",Ti="viewport",ku="profile",tl="framebuffer",Sf="vert",Ra="frag",Fi="elements",Is="primitive",Fs="count",Wp="offset",Qt="instances",xc="vao",Af="Width",Mf="Height",Pu=tl+Af,Oc=tl+Mf,zp=Ti+Af,uv=Ti+Mf,Sc="drawingBuffer",Tf=Sc+Af,Hp=Sc+Mf,cv=[_d,$p,wd,Of,hs,Cu,Ti,Ec,xf],Bs=34962,dv=34963,vs=35632,Ru=35633,Xp=3553,Cm=34067,Nm=2884,km=3042,fv=3024,Yp=2960,Cf=2929,Pm=3089,ms=32823,Du=32926,_y=32928,gi=5126,Nf=35664,Ac=35665,kf=35666,Ed=5124,Pf=35667,Rf=35668,Df=35669,Mc=35670,au=35671,ma=35672,qp=35673,jf=35674,Tc=35675,xd=35676,wa=35678,xi=35680,Lf=4,za=1028,wr=1029,Kp=2304,If=2305,Zp=32775,pv=32776,Rm=519,ju=7680,Dm=0,Cc=1,jm=32774,hv=513,Ff=36160,Lm=36064,Wl={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},lu=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Lu={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vv={frag:vs,vert:Ru},Od={cw:Kp,ccw:If};function su(K){return Array.isArray(K)||n(K)||Ia(K)}function Bf(K){return K.sort(function(me,Ie){return me===Ti?-1:Ie===Ti?1:me<Ie?-1:1})}function Ha(K,me,Ie,wt){this.thisDep=K,this.contextDep=me,this.propDep=Ie,this.append=wt}function gs(K){return K&&!(K.thisDep||K.contextDep||K.propDep)}function Ci(K){return new Ha(!1,!1,!1,K)}function dl(K,me){var Ie=K.type;if(Ie===Fp){var wt=K.data.length;return new Ha(!0,wt>=1,wt>=2,me)}else if(Ie===fs){var Dt=K.data;return new Ha(Dt.thisDep,Dt.contextDep,Dt.propDep,me)}else{if(Ie===wf)return new Ha(!1,!1,!1,me);if(Ie===Ef){for(var yt=!1,Nt=!1,tn=!1,sn=0;sn<K.data.length;++sn){var nn=K.data[sn];if(nn.type===iu)tn=!0;else if(nn.type===wc)Nt=!0;else if(nn.type===Bp)yt=!0;else if(nn.type===Fp){yt=!0;var Mt=nn.data;Mt>=1&&(Nt=!0),Mt>=2&&(tn=!0)}else nn.type===fs&&(yt=yt||nn.data.thisDep,Nt=Nt||nn.data.contextDep,tn=tn||nn.data.propDep)}return new Ha(yt,Nt,tn,me)}else return new Ha(Ie===Bp,Ie===wc,Ie===iu,me)}}var zl=new Ha(!1,!1,!1,function(){});function by(K,me,Ie,wt,Dt,yt,Nt,tn,sn,nn,Mt,bn,pn,rn,Gt){var st=nn.Record,St={add:32774,subtract:32778,"reverse subtract":32779};Ie.ext_blend_minmax&&(St.min=Zp,St.max=pv);var ln=Ie.angle_instanced_arrays,Sn=Ie.webgl_draw_buffers,Xt={dirty:!0,profile:Gt.profile},kn={},Kt=[],yn={},Yt={};function En(xe){return xe.replace(".","_")}function ar(xe,de,Ge){var tt=En(xe);Kt.push(xe),kn[tt]=Xt[tt]=!!Ge,yn[tt]=de}function xr(xe,de,Ge){var tt=En(xe);Kt.push(xe),Array.isArray(Ge)?(Xt[tt]=Ge.slice(),kn[tt]=Ge.slice()):Xt[tt]=kn[tt]=Ge,Yt[tt]=de}ar(md,fv),ar(gd,km),xr(yd,"blendColor",[0,0,0,0]),xr($p,"blendEquationSeparate",[jm,jm]),xr(_d,"blendFuncSeparate",[Cc,Dm,Cc,Dm]),ar(ov,Cf,!0),xr(Up,"depthFunc",hv),xr(Tm,"depthRange",[0,1]),xr(iv,"depthMask",!0),xr(ps,ps,[!0,!0,!0,!0]),ar(av,Nm),xr(lv,"cullFace",wr),xr(sv,sv,If),xr(bd,bd,1),ar(Ls,ms),xr(xf,"polygonOffset",[0,0]),ar(Vp,Du),ar(Gp,_y),xr(Cu,"sampleCoverage",[1,!1]),ar(Nu,Yp),xr(Rr,"stencilMask",-1),xr(wd,"stencilFunc",[Rm,0,-1]),xr(Of,"stencilOpSeparate",[za,ju,ju,ju]),xr(hs,"stencilOpSeparate",[wr,ju,ju,ju]),ar(aa,Pm),xr(Ec,"scissor",[0,0,K.drawingBufferWidth,K.drawingBufferHeight]),xr(Ti,Ti,[0,0,K.drawingBufferWidth,K.drawingBufferHeight]);var on={gl:K,context:pn,strings:me,next:kn,current:Xt,draw:bn,elements:yt,buffer:Dt,shader:Mt,attributes:nn.state,vao:nn,uniforms:sn,framebuffer:tn,extensions:Ie,timer:rn,isBufferArgs:su},Zt={primTypes:Ki,compareFuncs:Lu,blendFuncs:Wl,blendEquations:St,stencilOps:Er,glTypes:$a,orientationType:Od};Y.optional(function(){on.isArrayLike=L}),Sn&&(Zt.backBuffer=[wr],Zt.drawBuffer=In(wt.maxDrawbuffers,function(xe){return xe===0?[0]:In(xe,function(de){return Lm+de})}));var Ht=0;function fr(){var xe=ds(),de=xe.link,Ge=xe.global;xe.id=Ht++,xe.batchId="0";var tt=de(on),ct=xe.shared={props:"a0"};Object.keys(on).forEach(function(Ue){ct[Ue]=Ge.def(tt,".",Ue)}),Y.optional(function(){xe.CHECK=de(Y),xe.commandStr=Y.guessCommand(),xe.command=de(xe.commandStr),xe.assert=function(Ue,be,nt){Ue("if(!(",be,"))",this.CHECK,".commandRaise(",de(nt),",",this.command,");")},Zt.invalidBlendCombinations=lu});var Xe=xe.next={},We=xe.current={};Object.keys(Yt).forEach(function(Ue){Array.isArray(Xt[Ue])&&(Xe[Ue]=Ge.def(ct.next,".",Ue),We[Ue]=Ge.def(ct.current,".",Ue))});var Qe=xe.constants={};Object.keys(Zt).forEach(function(Ue){Qe[Ue]=Ge.def(JSON.stringify(Zt[Ue]))}),xe.invoke=function(Ue,be){switch(be.type){case Fp:var nt=["this",ct.context,ct.props,xe.batchId];return Ue.def(de(be.data),".call(",nt.slice(0,Math.max(be.data.length+1,4)),")");case iu:return Ue.def(ct.props,be.data);case wc:return Ue.def(ct.context,be.data);case Bp:return Ue.def("this",be.data);case fs:return be.data.append(xe,Ue),be.data.ref;case wf:return be.data.toString();case Ef:return be.data.map(function(ot){return xe.invoke(Ue,ot)})}},xe.attribCache={};var Ee={};return xe.scopeAttrib=function(Ue){var be=me.id(Ue);if(be in Ee)return Ee[be];var nt=nn.scope[be];nt||(nt=nn.scope[be]=new st);var ot=Ee[be]=de(nt);return ot},xe}function Dr(xe){var de=xe.static,Ge=xe.dynamic,tt;if(ku in de){var ct=!!de[ku];tt=Ci(function(We,Qe){return ct}),tt.enable=ct}else if(ku in Ge){var Xe=Ge[ku];tt=dl(Xe,function(We,Qe){return We.invoke(Qe,Xe)})}return tt}function Un(xe,de){var Ge=xe.static,tt=xe.dynamic;if(tl in Ge){var ct=Ge[tl];return ct?(ct=tn.getFramebuffer(ct),Y.command(ct,"invalid framebuffer object"),Ci(function(We,Qe){var Ee=We.link(ct),Ue=We.shared;Qe.set(Ue.framebuffer,".next",Ee);var be=Ue.context;return Qe.set(be,"."+Pu,Ee+".width"),Qe.set(be,"."+Oc,Ee+".height"),Ee})):Ci(function(We,Qe){var Ee=We.shared;Qe.set(Ee.framebuffer,".next","null");var Ue=Ee.context;return Qe.set(Ue,"."+Pu,Ue+"."+Tf),Qe.set(Ue,"."+Oc,Ue+"."+Hp),"null"})}else if(tl in tt){var Xe=tt[tl];return dl(Xe,function(We,Qe){var Ee=We.invoke(Qe,Xe),Ue=We.shared,be=Ue.framebuffer,nt=Qe.def(be,".getFramebuffer(",Ee,")");Y.optional(function(){We.assert(Qe,"!"+Ee+"||"+nt,"invalid framebuffer object")}),Qe.set(be,".next",nt);var ot=Ue.context;return Qe.set(ot,"."+Pu,nt+"?"+nt+".width:"+ot+"."+Tf),Qe.set(ot,"."+Oc,nt+"?"+nt+".height:"+ot+"."+Hp),nt})}else return null}function $r(xe,de,Ge){var tt=xe.static,ct=xe.dynamic;function Xe(Ee){if(Ee in tt){var Ue=tt[Ee];Y.commandType(Ue,"object","invalid "+Ee,Ge.commandStr);var be=!0,nt=Ue.x|0,ot=Ue.y|0,g,x;return"width"in Ue?(g=Ue.width|0,Y.command(g>=0,"invalid "+Ee,Ge.commandStr)):be=!1,"height"in Ue?(x=Ue.height|0,Y.command(x>=0,"invalid "+Ee,Ge.commandStr)):be=!1,new Ha(!be&&de&&de.thisDep,!be&&de&&de.contextDep,!be&&de&&de.propDep,function(te,ce){var Oe=te.shared.context,Fe=g;"width"in Ue||(Fe=ce.def(Oe,".",Pu,"-",nt));var et=x;return"height"in Ue||(et=ce.def(Oe,".",Oc,"-",ot)),[nt,ot,Fe,et]})}else if(Ee in ct){var C=ct[Ee],W=dl(C,function(te,ce){var Oe=te.invoke(ce,C);Y.optional(function(){te.assert(ce,Oe+"&&typeof "+Oe+'==="object"',"invalid "+Ee)});var Fe=te.shared.context,et=ce.def(Oe,".x|0"),jt=ce.def(Oe,".y|0"),Vt=ce.def('"width" in ',Oe,"?",Oe,".width|0:","(",Fe,".",Pu,"-",et,")"),gn=ce.def('"height" in ',Oe,"?",Oe,".height|0:","(",Fe,".",Oc,"-",jt,")");return Y.optional(function(){te.assert(ce,Vt+">=0&&"+gn+">=0","invalid "+Ee)}),[et,jt,Vt,gn]});return de&&(W.thisDep=W.thisDep||de.thisDep,W.contextDep=W.contextDep||de.contextDep,W.propDep=W.propDep||de.propDep),W}else return de?new Ha(de.thisDep,de.contextDep,de.propDep,function(te,ce){var Oe=te.shared.context;return[0,0,ce.def(Oe,".",Pu),ce.def(Oe,".",Oc)]}):null}var We=Xe(Ti);if(We){var Qe=We;We=new Ha(We.thisDep,We.contextDep,We.propDep,function(Ee,Ue){var be=Qe.append(Ee,Ue),nt=Ee.shared.context;return Ue.set(nt,"."+zp,be[2]),Ue.set(nt,"."+uv,be[3]),be})}return{viewport:We,scissor_box:Xe(Ec)}}function Or(xe,de){var Ge=xe.static,tt=typeof Ge[Ra]=="string"&&typeof Ge[Sf]=="string";if(tt){if(Object.keys(de.dynamic).length>0)return null;var ct=de.static,Xe=Object.keys(ct);if(Xe.length>0&&typeof ct[Xe[0]]=="number"){for(var We=[],Qe=0;Qe<Xe.length;++Qe)Y(typeof ct[Xe[Qe]]=="number","must specify all vertex attribute locations when using vaos"),We.push([ct[Xe[Qe]]|0,Xe[Qe]]);return We}}return null}function Fr(xe,de,Ge){var tt=xe.static,ct=xe.dynamic;function Xe(be){if(be in tt){var nt=me.id(tt[be]);Y.optional(function(){Mt.shader(vv[be],nt,Y.guessCommand())});var ot=Ci(function(){return nt});return ot.id=nt,ot}else if(be in ct){var g=ct[be];return dl(g,function(x,C){var W=x.invoke(C,g),te=C.def(x.shared.strings,".id(",W,")");return Y.optional(function(){C(x.shared.shader,".shader(",vv[be],",",te,",",x.command,");")}),te})}return null}var We=Xe(Ra),Qe=Xe(Sf),Ee=null,Ue;return gs(We)&&gs(Qe)?(Ee=Mt.program(Qe.id,We.id,null,Ge),Ue=Ci(function(be,nt){return be.link(Ee)})):Ue=new Ha(We&&We.thisDep||Qe&&Qe.thisDep,We&&We.contextDep||Qe&&Qe.contextDep,We&&We.propDep||Qe&&Qe.propDep,function(be,nt){var ot=be.shared.shader,g;We?g=We.append(be,nt):g=nt.def(ot,".",Ra);var x;Qe?x=Qe.append(be,nt):x=nt.def(ot,".",Sf);var C=ot+".program("+x+","+g;return Y.optional(function(){C+=","+be.command}),nt.def(C+")")}),{frag:We,vert:Qe,progVar:Ue,program:Ee}}function Qr(xe,de){var Ge=xe.static,tt=xe.dynamic;function ct(){if(Fi in Ge){var be=Ge[Fi];su(be)?be=yt.getElements(yt.create(be,!0)):be&&(be=yt.getElements(be),Y.command(be,"invalid elements",de.commandStr));var nt=Ci(function(g,x){if(be){var C=g.link(be);return g.ELEMENTS=C,C}return g.ELEMENTS=null,null});return nt.value=be,nt}else if(Fi in tt){var ot=tt[Fi];return dl(ot,function(g,x){var C=g.shared,W=C.isBufferArgs,te=C.elements,ce=g.invoke(x,ot),Oe=x.def("null"),Fe=x.def(W,"(",ce,")"),et=g.cond(Fe).then(Oe,"=",te,".createStream(",ce,");").else(Oe,"=",te,".getElements(",ce,");");return Y.optional(function(){g.assert(et.else,"!"+ce+"||"+Oe,"invalid elements")}),x.entry(et),x.exit(g.cond(Fe).then(te,".destroyStream(",Oe,");")),g.ELEMENTS=Oe,Oe})}return null}var Xe=ct();function We(){if(Is in Ge){var be=Ge[Is];return Y.commandParameter(be,Ki,"invalid primitve",de.commandStr),Ci(function(ot,g){return Ki[be]})}else if(Is in tt){var nt=tt[Is];return dl(nt,function(ot,g){var x=ot.constants.primTypes,C=ot.invoke(g,nt);return Y.optional(function(){ot.assert(g,C+" in "+x,"invalid primitive, must be one of "+Object.keys(Ki))}),g.def(x,"[",C,"]")})}else if(Xe)return gs(Xe)?Xe.value?Ci(function(ot,g){return g.def(ot.ELEMENTS,".primType")}):Ci(function(){return Lf}):new Ha(Xe.thisDep,Xe.contextDep,Xe.propDep,function(ot,g){var x=ot.ELEMENTS;return g.def(x,"?",x,".primType:",Lf)});return null}function Qe(be,nt){if(be in Ge){var ot=Ge[be]|0;return Y.command(!nt||ot>=0,"invalid "+be,de.commandStr),Ci(function(x,C){return nt&&(x.OFFSET=ot),ot})}else if(be in tt){var g=tt[be];return dl(g,function(x,C){var W=x.invoke(C,g);return nt&&(x.OFFSET=W,Y.optional(function(){x.assert(C,W+">=0","invalid "+be)})),W})}else if(nt&&Xe)return Ci(function(x,C){return x.OFFSET="0",0});return null}var Ee=Qe(Wp,!0);function Ue(){if(Fs in Ge){var be=Ge[Fs]|0;return Y.command(typeof be=="number"&&be>=0,"invalid vertex count",de.commandStr),Ci(function(){return be})}else if(Fs in tt){var nt=tt[Fs];return dl(nt,function(x,C){var W=x.invoke(C,nt);return Y.optional(function(){x.assert(C,"typeof "+W+'==="number"&&'+W+">=0&&"+W+"===("+W+"|0)","invalid vertex count")}),W})}else if(Xe)if(gs(Xe)){if(Xe)return Ee?new Ha(Ee.thisDep,Ee.contextDep,Ee.propDep,function(x,C){var W=C.def(x.ELEMENTS,".vertCount-",x.OFFSET);return Y.optional(function(){x.assert(C,W+">=0","invalid vertex offset/element buffer too small")}),W}):Ci(function(x,C){return C.def(x.ELEMENTS,".vertCount")});var ot=Ci(function(){return-1});return Y.optional(function(){ot.MISSING=!0}),ot}else{var g=new Ha(Xe.thisDep||Ee.thisDep,Xe.contextDep||Ee.contextDep,Xe.propDep||Ee.propDep,function(x,C){var W=x.ELEMENTS;return x.OFFSET?C.def(W,"?",W,".vertCount-",x.OFFSET,":-1"):C.def(W,"?",W,".vertCount:-1")});return Y.optional(function(){g.DYNAMIC=!0}),g}return null}return{elements:Xe,primitive:We(),count:Ue(),instances:Qe(Qt,!1),offset:Ee}}function ki(xe,de){var Ge=xe.static,tt=xe.dynamic,ct={};return Kt.forEach(function(Xe){var We=En(Xe);function Qe(Ee,Ue){if(Xe in Ge){var be=Ee(Ge[Xe]);ct[We]=Ci(function(){return be})}else if(Xe in tt){var nt=tt[Xe];ct[We]=dl(nt,function(ot,g){return Ue(ot,g,ot.invoke(g,nt))})}}switch(Xe){case av:case gd:case md:case Nu:case ov:case aa:case Ls:case Vp:case Gp:case iv:return Qe(function(Ee){return Y.commandType(Ee,"boolean",Xe,de.commandStr),Ee},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,"typeof "+be+'==="boolean"',"invalid flag "+Xe,Ee.commandStr)}),be});case Up:return Qe(function(Ee){return Y.commandParameter(Ee,Lu,"invalid "+Xe,de.commandStr),Lu[Ee]},function(Ee,Ue,be){var nt=Ee.constants.compareFuncs;return Y.optional(function(){Ee.assert(Ue,be+" in "+nt,"invalid "+Xe+", must be one of "+Object.keys(Lu))}),Ue.def(nt,"[",be,"]")});case Tm:return Qe(function(Ee){return Y.command(L(Ee)&&Ee.length===2&&typeof Ee[0]=="number"&&typeof Ee[1]=="number"&&Ee[0]<=Ee[1],"depth range is 2d array",de.commandStr),Ee},function(Ee,Ue,be){Y.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===2&&typeof "+be+'[0]==="number"&&typeof '+be+'[1]==="number"&&'+be+"[0]<="+be+"[1]","depth range must be a 2d array")});var nt=Ue.def("+",be,"[0]"),ot=Ue.def("+",be,"[1]");return[nt,ot]});case _d:return Qe(function(Ee){Y.commandType(Ee,"object","blend.func",de.commandStr);var Ue="srcRGB"in Ee?Ee.srcRGB:Ee.src,be="srcAlpha"in Ee?Ee.srcAlpha:Ee.src,nt="dstRGB"in Ee?Ee.dstRGB:Ee.dst,ot="dstAlpha"in Ee?Ee.dstAlpha:Ee.dst;return Y.commandParameter(Ue,Wl,We+".srcRGB",de.commandStr),Y.commandParameter(be,Wl,We+".srcAlpha",de.commandStr),Y.commandParameter(nt,Wl,We+".dstRGB",de.commandStr),Y.commandParameter(ot,Wl,We+".dstAlpha",de.commandStr),Y.command(lu.indexOf(Ue+", "+nt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Ue+", "+nt+")",de.commandStr),[Wl[Ue],Wl[nt],Wl[be],Wl[ot]]},function(Ee,Ue,be){var nt=Ee.constants.blendFuncs;Y.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid blend func, must be an object")});function ot(Oe,Fe){var et=Ue.def('"',Oe,Fe,'" in ',be,"?",be,".",Oe,Fe,":",be,".",Oe);return Y.optional(function(){Ee.assert(Ue,et+" in "+nt,"invalid "+Xe+"."+Oe+Fe+", must be one of "+Object.keys(Wl))}),et}var g=ot("src","RGB"),x=ot("dst","RGB");Y.optional(function(){var Oe=Ee.constants.invalidBlendCombinations;Ee.assert(Ue,Oe+".indexOf("+g+'+", "+'+x+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var C=Ue.def(nt,"[",g,"]"),W=Ue.def(nt,"[",ot("src","Alpha"),"]"),te=Ue.def(nt,"[",x,"]"),ce=Ue.def(nt,"[",ot("dst","Alpha"),"]");return[C,te,W,ce]});case $p:return Qe(function(Ee){if(typeof Ee=="string")return Y.commandParameter(Ee,St,"invalid "+Xe,de.commandStr),[St[Ee],St[Ee]];if(typeof Ee=="object")return Y.commandParameter(Ee.rgb,St,Xe+".rgb",de.commandStr),Y.commandParameter(Ee.alpha,St,Xe+".alpha",de.commandStr),[St[Ee.rgb],St[Ee.alpha]];Y.commandRaise("invalid blend.equation",de.commandStr)},function(Ee,Ue,be){var nt=Ee.constants.blendEquations,ot=Ue.def(),g=Ue.def(),x=Ee.cond("typeof ",be,'==="string"');return Y.optional(function(){function C(W,te,ce){Ee.assert(W,ce+" in "+nt,"invalid "+te+", must be one of "+Object.keys(St))}C(x.then,Xe,be),Ee.assert(x.else,be+"&&typeof "+be+'==="object"',"invalid "+Xe),C(x.else,Xe+".rgb",be+".rgb"),C(x.else,Xe+".alpha",be+".alpha")}),x.then(ot,"=",g,"=",nt,"[",be,"];"),x.else(ot,"=",nt,"[",be,".rgb];",g,"=",nt,"[",be,".alpha];"),Ue(x),[ot,g]});case yd:return Qe(function(Ee){return Y.command(L(Ee)&&Ee.length===4,"blend.color must be a 4d array",de.commandStr),In(4,function(Ue){return+Ee[Ue]})},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===4","blend.color must be a 4d array")}),In(4,function(nt){return Ue.def("+",be,"[",nt,"]")})});case Rr:return Qe(function(Ee){return Y.commandType(Ee,"number",We,de.commandStr),Ee|0},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,"typeof "+be+'==="number"',"invalid stencil.mask")}),Ue.def(be,"|0")});case wd:return Qe(function(Ee){Y.commandType(Ee,"object",We,de.commandStr);var Ue=Ee.cmp||"keep",be=Ee.ref||0,nt="mask"in Ee?Ee.mask:-1;return Y.commandParameter(Ue,Lu,Xe+".cmp",de.commandStr),Y.commandType(be,"number",Xe+".ref",de.commandStr),Y.commandType(nt,"number",Xe+".mask",de.commandStr),[Lu[Ue],be,nt]},function(Ee,Ue,be){var nt=Ee.constants.compareFuncs;Y.optional(function(){function C(){Ee.assert(Ue,Array.prototype.join.call(arguments,""),"invalid stencil.func")}C(be+"&&typeof ",be,'==="object"'),C('!("cmp" in ',be,")||(",be,".cmp in ",nt,")")});var ot=Ue.def('"cmp" in ',be,"?",nt,"[",be,".cmp]",":",ju),g=Ue.def(be,".ref|0"),x=Ue.def('"mask" in ',be,"?",be,".mask|0:-1");return[ot,g,x]});case Of:case hs:return Qe(function(Ee){Y.commandType(Ee,"object",We,de.commandStr);var Ue=Ee.fail||"keep",be=Ee.zfail||"keep",nt=Ee.zpass||"keep";return Y.commandParameter(Ue,Er,Xe+".fail",de.commandStr),Y.commandParameter(be,Er,Xe+".zfail",de.commandStr),Y.commandParameter(nt,Er,Xe+".zpass",de.commandStr),[Xe===hs?wr:za,Er[Ue],Er[be],Er[nt]]},function(Ee,Ue,be){var nt=Ee.constants.stencilOps;Y.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid "+Xe)});function ot(g){return Y.optional(function(){Ee.assert(Ue,'!("'+g+'" in '+be+")||("+be+"."+g+" in "+nt+")","invalid "+Xe+"."+g+", must be one of "+Object.keys(Er))}),Ue.def('"',g,'" in ',be,"?",nt,"[",be,".",g,"]:",ju)}return[Xe===hs?wr:za,ot("fail"),ot("zfail"),ot("zpass")]});case xf:return Qe(function(Ee){Y.commandType(Ee,"object",We,de.commandStr);var Ue=Ee.factor|0,be=Ee.units|0;return Y.commandType(Ue,"number",We+".factor",de.commandStr),Y.commandType(be,"number",We+".units",de.commandStr),[Ue,be]},function(Ee,Ue,be){Y.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid "+Xe)});var nt=Ue.def(be,".factor|0"),ot=Ue.def(be,".units|0");return[nt,ot]});case lv:return Qe(function(Ee){var Ue=0;return Ee==="front"?Ue=za:Ee==="back"&&(Ue=wr),Y.command(!!Ue,We,de.commandStr),Ue},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,be+'==="front"||'+be+'==="back"',"invalid cull.face")}),Ue.def(be,'==="front"?',za,":",wr)});case bd:return Qe(function(Ee){return Y.command(typeof Ee=="number"&&Ee>=wt.lineWidthDims[0]&&Ee<=wt.lineWidthDims[1],"invalid line width, must be a positive number between "+wt.lineWidthDims[0]+" and "+wt.lineWidthDims[1],de.commandStr),Ee},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,"typeof "+be+'==="number"&&'+be+">="+wt.lineWidthDims[0]+"&&"+be+"<="+wt.lineWidthDims[1],"invalid line width")}),be});case sv:return Qe(function(Ee){return Y.commandParameter(Ee,Od,We,de.commandStr),Od[Ee]},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,be+'==="cw"||'+be+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Ue.def(be+'==="cw"?'+Kp+":"+If)});case ps:return Qe(function(Ee){return Y.command(L(Ee)&&Ee.length===4,"color.mask must be length 4 array",de.commandStr),Ee.map(function(Ue){return!!Ue})},function(Ee,Ue,be){return Y.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===4","invalid color.mask")}),In(4,function(nt){return"!!"+be+"["+nt+"]"})});case Cu:return Qe(function(Ee){Y.command(typeof Ee=="object"&&Ee,We,de.commandStr);var Ue="value"in Ee?Ee.value:1,be=!!Ee.invert;return Y.command(typeof Ue=="number"&&Ue>=0&&Ue<=1,"sample.coverage.value must be a number between 0 and 1",de.commandStr),[Ue,be]},function(Ee,Ue,be){Y.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid sample.coverage")});var nt=Ue.def('"value" in ',be,"?+",be,".value:1"),ot=Ue.def("!!",be,".invert");return[nt,ot]})}}),ct}function Si(xe,de){var Ge=xe.static,tt=xe.dynamic,ct={};return Object.keys(Ge).forEach(function(Xe){var We=Ge[Xe],Qe;if(typeof We=="number"||typeof We=="boolean")Qe=Ci(function(){return We});else if(typeof We=="function"){var Ee=We._reglType;Ee==="texture2d"||Ee==="textureCube"?Qe=Ci(function(Ue){return Ue.link(We)}):Ee==="framebuffer"||Ee==="framebufferCube"?(Y.command(We.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Xe+'"',de.commandStr),Qe=Ci(function(Ue){return Ue.link(We.color[0])})):Y.commandRaise('invalid data for uniform "'+Xe+'"',de.commandStr)}else L(We)?Qe=Ci(function(Ue){var be=Ue.global.def("[",In(We.length,function(nt){return Y.command(typeof We[nt]=="number"||typeof We[nt]=="boolean","invalid uniform "+Xe,Ue.commandStr),We[nt]}),"]");return be}):Y.commandRaise('invalid or missing data for uniform "'+Xe+'"',de.commandStr);Qe.value=We,ct[Xe]=Qe}),Object.keys(tt).forEach(function(Xe){var We=tt[Xe];ct[Xe]=dl(We,function(Qe,Ee){return Qe.invoke(Ee,We)})}),ct}function jr(xe,de){var Ge=xe.static,tt=xe.dynamic,ct={};return Object.keys(Ge).forEach(function(Xe){var We=Ge[Xe],Qe=me.id(Xe),Ee=new st;if(su(We))Ee.state=_c,Ee.buffer=Dt.getBuffer(Dt.create(We,Bs,!1,!0)),Ee.type=0;else{var Ue=Dt.getBuffer(We);if(Ue)Ee.state=_c,Ee.buffer=Ue,Ee.type=0;else if(Y.command(typeof We=="object"&&We,"invalid data for attribute "+Xe,de.commandStr),"constant"in We){var be=We.constant;Ee.buffer="null",Ee.state=bc,typeof be=="number"?Ee.x=be:(Y.command(L(be)&&be.length>0&&be.length<=4,"invalid constant for attribute "+Xe,de.commandStr),ou.forEach(function(te,ce){ce<be.length&&(Ee[te]=be[ce])}))}else{su(We.buffer)?Ue=Dt.getBuffer(Dt.create(We.buffer,Bs,!1,!0)):Ue=Dt.getBuffer(We.buffer),Y.command(!!Ue,'missing buffer for attribute "'+Xe+'"',de.commandStr);var nt=We.offset|0;Y.command(nt>=0,'invalid offset for attribute "'+Xe+'"',de.commandStr);var ot=We.stride|0;Y.command(ot>=0&&ot<256,'invalid stride for attribute "'+Xe+'", must be integer betweeen [0, 255]',de.commandStr);var g=We.size|0;Y.command(!("size"in We)||g>0&&g<=4,'invalid size for attribute "'+Xe+'", must be 1,2,3,4',de.commandStr);var x=!!We.normalized,C=0;"type"in We&&(Y.commandParameter(We.type,$a,"invalid type for attribute "+Xe,de.commandStr),C=$a[We.type]);var W=We.divisor|0;"divisor"in We&&(Y.command(W===0||ln,'cannot specify divisor for attribute "'+Xe+'", instancing not supported',de.commandStr),Y.command(W>=0,'invalid divisor for attribute "'+Xe+'"',de.commandStr)),Y.optional(function(){var te=de.commandStr,ce=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(We).forEach(function(Oe){Y.command(ce.indexOf(Oe)>=0,'unknown parameter "'+Oe+'" for attribute pointer "'+Xe+'" (valid parameters are '+ce+")",te)})}),Ee.buffer=Ue,Ee.state=_c,Ee.size=g,Ee.normalized=x,Ee.type=C||Ue.dtype,Ee.offset=nt,Ee.stride=ot,Ee.divisor=W}}ct[Xe]=Ci(function(te,ce){var Oe=te.attribCache;if(Qe in Oe)return Oe[Qe];var Fe={isStream:!1};return Object.keys(Ee).forEach(function(et){Fe[et]=Ee[et]}),Ee.buffer&&(Fe.buffer=te.link(Ee.buffer),Fe.type=Fe.type||Fe.buffer+".dtype"),Oe[Qe]=Fe,Fe})}),Object.keys(tt).forEach(function(Xe){var We=tt[Xe];function Qe(Ee,Ue){var be=Ee.invoke(Ue,We),nt=Ee.shared,ot=Ee.constants,g=nt.isBufferArgs,x=nt.buffer;Y.optional(function(){Ee.assert(Ue,be+"&&(typeof "+be+'==="object"||typeof '+be+'==="function")&&('+g+"("+be+")||"+x+".getBuffer("+be+")||"+x+".getBuffer("+be+".buffer)||"+g+"("+be+'.buffer)||("constant" in '+be+"&&(typeof "+be+'.constant==="number"||'+nt.isArrayLike+"("+be+".constant))))",'invalid dynamic attribute "'+Xe+'"')});var C={isStream:Ue.def(!1)},W=new st;W.state=_c,Object.keys(W).forEach(function(Fe){C[Fe]=Ue.def(""+W[Fe])});var te=C.buffer,ce=C.type;Ue("if(",g,"(",be,")){",C.isStream,"=true;",te,"=",x,".createStream(",Bs,",",be,");",ce,"=",te,".dtype;","}else{",te,"=",x,".getBuffer(",be,");","if(",te,"){",ce,"=",te,".dtype;",'}else if("constant" in ',be,"){",C.state,"=",bc,";","if(typeof "+be+'.constant === "number"){',C[ou[0]],"=",be,".constant;",ou.slice(1).map(function(Fe){return C[Fe]}).join("="),"=0;","}else{",ou.map(function(Fe,et){return C[Fe]+"="+be+".constant.length>"+et+"?"+be+".constant["+et+"]:0;"}).join(""),"}}else{","if(",g,"(",be,".buffer)){",te,"=",x,".createStream(",Bs,",",be,".buffer);","}else{",te,"=",x,".getBuffer(",be,".buffer);","}",ce,'="type" in ',be,"?",ot.glTypes,"[",be,".type]:",te,".dtype;",C.normalized,"=!!",be,".normalized;");function Oe(Fe){Ue(C[Fe],"=",be,".",Fe,"|0;")}return Oe("size"),Oe("offset"),Oe("stride"),Oe("divisor"),Ue("}}"),Ue.exit("if(",C.isStream,"){",x,".destroyStream(",te,");","}"),C}ct[Xe]=dl(We,Qe)}),ct}function Wi(xe,de){var Ge=xe.static,tt=xe.dynamic;if(xc in Ge){var ct=Ge[xc];return ct!==null&&nn.getVAO(ct)===null&&(ct=nn.createVAO(ct)),Ci(function(We){return We.link(nn.getVAO(ct))})}else if(xc in tt){var Xe=tt[xc];return dl(Xe,function(We,Qe){var Ee=We.invoke(Qe,Xe);return Qe.def(We.shared.vao+".getVAO("+Ee+")")})}return null}function Ko(xe){var de=xe.static,Ge=xe.dynamic,tt={};return Object.keys(de).forEach(function(ct){var Xe=de[ct];tt[ct]=Ci(function(We,Qe){return typeof Xe=="number"||typeof Xe=="boolean"?""+Xe:We.link(Xe)})}),Object.keys(Ge).forEach(function(ct){var Xe=Ge[ct];tt[ct]=dl(Xe,function(We,Qe){return We.invoke(Qe,Xe)})}),tt}function Pi(xe,de,Ge,tt,ct){var Xe=xe.static,We=xe.dynamic;Y.optional(function(){var Oe=[tl,Sf,Ra,Fi,Is,Wp,Fs,Qt,ku,xc].concat(Kt);function Fe(et){Object.keys(et).forEach(function(jt){Y.command(Oe.indexOf(jt)>=0,'unknown parameter "'+jt+'"',ct.commandStr)})}Fe(Xe),Fe(We)});var Qe=Or(xe,de),Ee=Un(xe),Ue=$r(xe,Ee,ct),be=Qr(xe,ct),nt=ki(xe,ct),ot=Fr(xe,ct,Qe);function g(Oe){var Fe=Ue[Oe];Fe&&(nt[Oe]=Fe)}g(Ti),g(En(Ec));var x=Object.keys(nt).length>0,C={framebuffer:Ee,draw:be,shader:ot,state:nt,dirty:x,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=Dr(xe),C.uniforms=Si(Ge,ct),C.drawVAO=C.scopeVAO=Wi(xe),!C.drawVAO&&ot.program&&!Qe&&Ie.angle_instanced_arrays){var W=!0,te=ot.program.attributes.map(function(Oe){var Fe=de.static[Oe];return W=W&&!!Fe,Fe});if(W&&te.length>0){var ce=nn.getVAO(nn.createVAO(te));C.drawVAO=new Ha(null,null,null,function(Oe,Fe){return Oe.link(ce)}),C.useVAO=!0}}return Qe?C.useVAO=!0:C.attributes=jr(de,ct),C.context=Ko(tt),C}function $i(xe,de,Ge){var tt=xe.shared,ct=tt.context,Xe=xe.scope();Object.keys(Ge).forEach(function(We){de.save(ct,"."+We);var Qe=Ge[We],Ee=Qe.append(xe,de);Array.isArray(Ee)?Xe(ct,".",We,"=[",Ee.join(),"];"):Xe(ct,".",We,"=",Ee,";")}),de(Xe)}function Qi(xe,de,Ge,tt){var ct=xe.shared,Xe=ct.gl,We=ct.framebuffer,Qe;Sn&&(Qe=de.def(ct.extensions,".webgl_draw_buffers"));var Ee=xe.constants,Ue=Ee.drawBuffer,be=Ee.backBuffer,nt;Ge?nt=Ge.append(xe,de):nt=de.def(We,".next"),tt||de("if(",nt,"!==",We,".cur){"),de("if(",nt,"){",Xe,".bindFramebuffer(",Ff,",",nt,".framebuffer);"),Sn&&de(Qe,".drawBuffersWEBGL(",Ue,"[",nt,".colorAttachments.length]);"),de("}else{",Xe,".bindFramebuffer(",Ff,",null);"),Sn&&de(Qe,".drawBuffersWEBGL(",be,");"),de("}",We,".cur=",nt,";"),tt||de("}")}function la(xe,de,Ge){var tt=xe.shared,ct=tt.gl,Xe=xe.current,We=xe.next,Qe=tt.current,Ee=tt.next,Ue=xe.cond(Qe,".dirty");Kt.forEach(function(be){var nt=En(be);if(!(nt in Ge.state)){var ot,g;if(nt in We){ot=We[nt],g=Xe[nt];var x=In(Xt[nt].length,function(W){return Ue.def(ot,"[",W,"]")});Ue(xe.cond(x.map(function(W,te){return W+"!=="+g+"["+te+"]"}).join("||")).then(ct,".",Yt[nt],"(",x,");",x.map(function(W,te){return g+"["+te+"]="+W}).join(";"),";"))}else{ot=Ue.def(Ee,".",nt);var C=xe.cond(ot,"!==",Qe,".",nt);Ue(C),nt in yn?C(xe.cond(ot).then(ct,".enable(",yn[nt],");").else(ct,".disable(",yn[nt],");"),Qe,".",nt,"=",ot,";"):C(ct,".",Yt[nt],"(",ot,");",Qe,".",nt,"=",ot,";")}}}),Object.keys(Ge.state).length===0&&Ue(Qe,".dirty=false;"),de(Ue)}function zi(xe,de,Ge,tt){var ct=xe.shared,Xe=xe.current,We=ct.current,Qe=ct.gl;Bf(Object.keys(Ge)).forEach(function(Ee){var Ue=Ge[Ee];if(!(tt&&!tt(Ue))){var be=Ue.append(xe,de);if(yn[Ee]){var nt=yn[Ee];gs(Ue)?be?de(Qe,".enable(",nt,");"):de(Qe,".disable(",nt,");"):de(xe.cond(be).then(Qe,".enable(",nt,");").else(Qe,".disable(",nt,");")),de(We,".",Ee,"=",be,";")}else if(L(be)){var ot=Xe[Ee];de(Qe,".",Yt[Ee],"(",be,");",be.map(function(g,x){return ot+"["+x+"]="+g}).join(";"),";")}else de(Qe,".",Yt[Ee],"(",be,");",We,".",Ee,"=",be,";")}})}function di(xe,de){ln&&(xe.instancing=de.def(xe.shared.extensions,".angle_instanced_arrays"))}function Cr(xe,de,Ge,tt,ct){var Xe=xe.shared,We=xe.stats,Qe=Xe.current,Ee=Xe.timer,Ue=Ge.profile;function be(){return typeof performance>"u"?"Date.now()":"performance.now()"}var nt,ot;function g(Oe){nt=de.def(),Oe(nt,"=",be(),";"),typeof ct=="string"?Oe(We,".count+=",ct,";"):Oe(We,".count++;"),rn&&(tt?(ot=de.def(),Oe(ot,"=",Ee,".getNumPendingQueries();")):Oe(Ee,".beginQuery(",We,");"))}function x(Oe){Oe(We,".cpuTime+=",be(),"-",nt,";"),rn&&(tt?Oe(Ee,".pushScopeStats(",ot,",",Ee,".getNumPendingQueries(),",We,");"):Oe(Ee,".endQuery();"))}function C(Oe){var Fe=de.def(Qe,".profile");de(Qe,".profile=",Oe,";"),de.exit(Qe,".profile=",Fe,";")}var W;if(Ue){if(gs(Ue)){Ue.enable?(g(de),x(de.exit),C("true")):C("false");return}W=Ue.append(xe,de),C(W)}else W=de.def(Qe,".profile");var te=xe.block();g(te),de("if(",W,"){",te,"}");var ce=xe.block();x(ce),de.exit("if(",W,"){",ce,"}")}function sa(xe,de,Ge,tt,ct){var Xe=xe.shared;function We(Ee){switch(Ee){case Nf:case Pf:case au:return 2;case Ac:case Rf:case ma:return 3;case kf:case Df:case qp:return 4;default:return 1}}function Qe(Ee,Ue,be){var nt=Xe.gl,ot=de.def(Ee,".location"),g=de.def(Xe.attributes,"[",ot,"]"),x=be.state,C=be.buffer,W=[be.x,be.y,be.z,be.w],te=["buffer","normalized","offset","stride"];function ce(){de("if(!",g,".buffer){",nt,".enableVertexAttribArray(",ot,");}");var Fe=be.type,et;if(be.size?et=de.def(be.size,"||",Ue):et=Ue,de("if(",g,".type!==",Fe,"||",g,".size!==",et,"||",te.map(function(Vt){return g+"."+Vt+"!=="+be[Vt]}).join("||"),"){",nt,".bindBuffer(",Bs,",",C,".buffer);",nt,".vertexAttribPointer(",[ot,et,Fe,be.normalized,be.stride,be.offset],");",g,".type=",Fe,";",g,".size=",et,";",te.map(function(Vt){return g+"."+Vt+"="+be[Vt]+";"}).join(""),"}"),ln){var jt=be.divisor;de("if(",g,".divisor!==",jt,"){",xe.instancing,".vertexAttribDivisorANGLE(",[ot,jt],");",g,".divisor=",jt,";}")}}function Oe(){de("if(",g,".buffer){",nt,".disableVertexAttribArray(",ot,");",g,".buffer=null;","}if(",ou.map(function(Fe,et){return g+"."+Fe+"!=="+W[et]}).join("||"),"){",nt,".vertexAttrib4f(",ot,",",W,");",ou.map(function(Fe,et){return g+"."+Fe+"="+W[et]+";"}).join(""),"}")}x===_c?ce():x===bc?Oe():(de("if(",x,"===",_c,"){"),ce(),de("}else{"),Oe(),de("}"))}tt.forEach(function(Ee){var Ue=Ee.name,be=Ge.attributes[Ue],nt;if(be){if(!ct(be))return;nt=be.append(xe,de)}else{if(!ct(zl))return;var ot=xe.scopeAttrib(Ue);Y.optional(function(){xe.assert(de,ot+".state","missing attribute "+Ue)}),nt={},Object.keys(new st).forEach(function(g){nt[g]=de.def(ot,".",g)})}Qe(xe.link(Ee),We(Ee.info.type),nt)})}function co(xe,de,Ge,tt,ct){for(var Xe=xe.shared,We=Xe.gl,Qe,Ee=0;Ee<tt.length;++Ee){var Ue=tt[Ee],be=Ue.name,nt=Ue.info.type,ot=Ge.uniforms[be],g=xe.link(Ue),x=g+".location",C;if(ot){if(!ct(ot))continue;if(gs(ot)){var W=ot.value;if(Y.command(W!==null&&typeof W<"u",'missing uniform "'+be+'"',xe.commandStr),nt===wa||nt===xi){Y.command(typeof W=="function"&&(nt===wa&&(W._reglType==="texture2d"||W._reglType==="framebuffer")||nt===xi&&(W._reglType==="textureCube"||W._reglType==="framebufferCube")),"invalid texture for uniform "+be,xe.commandStr);var te=xe.link(W._texture||W.color[0]._texture);de(We,".uniform1i(",x,",",te+".bind());"),de.exit(te,".unbind();")}else if(nt===jf||nt===Tc||nt===xd){Y.optional(function(){Y.command(L(W),"invalid matrix for uniform "+be,xe.commandStr),Y.command(nt===jf&&W.length===4||nt===Tc&&W.length===9||nt===xd&&W.length===16,"invalid length for matrix uniform "+be,xe.commandStr)});var ce=xe.global.def("new Float32Array(["+Array.prototype.slice.call(W)+"])"),Oe=2;nt===Tc?Oe=3:nt===xd&&(Oe=4),de(We,".uniformMatrix",Oe,"fv(",x,",false,",ce,");")}else{switch(nt){case gi:Y.commandType(W,"number","uniform "+be,xe.commandStr),Qe="1f";break;case Nf:Y.command(L(W)&&W.length===2,"uniform "+be,xe.commandStr),Qe="2f";break;case Ac:Y.command(L(W)&&W.length===3,"uniform "+be,xe.commandStr),Qe="3f";break;case kf:Y.command(L(W)&&W.length===4,"uniform "+be,xe.commandStr),Qe="4f";break;case Mc:Y.commandType(W,"boolean","uniform "+be,xe.commandStr),Qe="1i";break;case Ed:Y.commandType(W,"number","uniform "+be,xe.commandStr),Qe="1i";break;case au:Y.command(L(W)&&W.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case Pf:Y.command(L(W)&&W.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case ma:Y.command(L(W)&&W.length===3,"uniform "+be,xe.commandStr),Qe="3i";break;case Rf:Y.command(L(W)&&W.length===3,"uniform "+be,xe.commandStr),Qe="3i";break;case qp:Y.command(L(W)&&W.length===4,"uniform "+be,xe.commandStr),Qe="4i";break;case Df:Y.command(L(W)&&W.length===4,"uniform "+be,xe.commandStr),Qe="4i";break}de(We,".uniform",Qe,"(",x,",",L(W)?Array.prototype.slice.call(W):W,");")}continue}else C=ot.append(xe,de)}else{if(!ct(zl))continue;C=de.def(Xe.uniforms,"[",me.id(be),"]")}nt===wa?(Y(!Array.isArray(C),"must specify a scalar prop for textures"),de("if(",C,"&&",C,'._reglType==="framebuffer"){',C,"=",C,".color[0];","}")):nt===xi&&(Y(!Array.isArray(C),"must specify a scalar prop for cube maps"),de("if(",C,"&&",C,'._reglType==="framebufferCube"){',C,"=",C,".color[0];","}")),Y.optional(function(){function gn(an,Tn){xe.assert(de,an,'bad data or missing for uniform "'+be+'". '+Tn)}function Yn(an){Y(!Array.isArray(C),"must not specify an array type for uniform"),gn("typeof "+C+'==="'+an+'"',"invalid type, expected "+an)}function Qn(an,Tn){Array.isArray(C)?Y(C.length===an,"must have length "+an):gn(Xe.isArrayLike+"("+C+")&&"+C+".length==="+an,"invalid vector, should have length "+an,xe.commandStr)}function Sr(an){Y(!Array.isArray(C),"must not specify a value type"),gn("typeof "+C+'==="function"&&'+C+'._reglType==="texture'+(an===Xp?"2d":"Cube")+'"',"invalid texture type",xe.commandStr)}switch(nt){case Ed:Yn("number");break;case Pf:Qn(2);break;case Rf:Qn(3);break;case Df:Qn(4);break;case gi:Yn("number");break;case Nf:Qn(2);break;case Ac:Qn(3);break;case kf:Qn(4);break;case Mc:Yn("boolean");break;case au:Qn(2);break;case ma:Qn(3);break;case qp:Qn(4);break;case jf:Qn(4);break;case Tc:Qn(9);break;case xd:Qn(16);break;case wa:Sr(Xp);break;case xi:Sr(Cm);break}});var Fe=1;switch(nt){case wa:case xi:var et=de.def(C,"._texture");de(We,".uniform1i(",x,",",et,".bind());"),de.exit(et,".unbind();");continue;case Ed:case Mc:Qe="1i";break;case Pf:case au:Qe="2i",Fe=2;break;case Rf:case ma:Qe="3i",Fe=3;break;case Df:case qp:Qe="4i",Fe=4;break;case gi:Qe="1f";break;case Nf:Qe="2f",Fe=2;break;case Ac:Qe="3f",Fe=3;break;case kf:Qe="4f",Fe=4;break;case jf:Qe="Matrix2fv";break;case Tc:Qe="Matrix3fv";break;case xd:Qe="Matrix4fv";break}if(de(We,".uniform",Qe,"(",x,","),Qe.charAt(0)==="M"){var jt=Math.pow(nt-jf+2,2),Vt=xe.global.def("new Float32Array(",jt,")");Array.isArray(C)?de("false,(",In(jt,function(gn){return Vt+"["+gn+"]="+C[gn]}),",",Vt,")"):de("false,(Array.isArray(",C,")||",C," instanceof Float32Array)?",C,":(",In(jt,function(gn){return Vt+"["+gn+"]="+C+"["+gn+"]"}),",",Vt,")")}else Fe>1?de(In(Fe,function(gn){return Array.isArray(C)?C[gn]:C+"["+gn+"]"})):(Y(!Array.isArray(C),"uniform value must not be an array"),de(C));de(");")}}function cr(xe,de,Ge,tt){var ct=xe.shared,Xe=ct.gl,We=ct.draw,Qe=tt.draw;function Ee(){var et=Qe.elements,jt,Vt=de;return et?((et.contextDep&&tt.contextDynamic||et.propDep)&&(Vt=Ge),jt=et.append(xe,Vt)):jt=Vt.def(We,".",Fi),jt&&Vt("if("+jt+")"+Xe+".bindBuffer("+dv+","+jt+".buffer.buffer);"),jt}function Ue(){var et=Qe.count,jt,Vt=de;return et?((et.contextDep&&tt.contextDynamic||et.propDep)&&(Vt=Ge),jt=et.append(xe,Vt),Y.optional(function(){et.MISSING&&xe.assert(de,"false","missing vertex count"),et.DYNAMIC&&xe.assert(Vt,jt+">=0","missing vertex count")})):(jt=Vt.def(We,".",Fs),Y.optional(function(){xe.assert(Vt,jt+">=0","missing vertex count")})),jt}var be=Ee();function nt(et){var jt=Qe[et];return jt?jt.contextDep&&tt.contextDynamic||jt.propDep?jt.append(xe,Ge):jt.append(xe,de):de.def(We,".",et)}var ot=nt(Is),g=nt(Wp),x=Ue();if(typeof x=="number"){if(x===0)return}else Ge("if(",x,"){"),Ge.exit("}");var C,W;ln&&(C=nt(Qt),W=xe.instancing);var te=be+".type",ce=Qe.elements&&gs(Qe.elements);function Oe(){function et(){Ge(W,".drawElementsInstancedANGLE(",[ot,x,te,g+"<<(("+te+"-"+yc+")>>1)",C],");")}function jt(){Ge(W,".drawArraysInstancedANGLE(",[ot,g,x,C],");")}be?ce?et():(Ge("if(",be,"){"),et(),Ge("}else{"),jt(),Ge("}")):jt()}function Fe(){function et(){Ge(Xe+".drawElements("+[ot,x,te,g+"<<(("+te+"-"+yc+")>>1)"]+");")}function jt(){Ge(Xe+".drawArrays("+[ot,g,x]+");")}be?ce?et():(Ge("if(",be,"){"),et(),Ge("}else{"),jt(),Ge("}")):jt()}ln&&(typeof C!="number"||C>=0)?typeof C=="string"?(Ge("if(",C,">0){"),Oe(),Ge("}else if(",C,"<0){"),Fe(),Ge("}")):Oe():Fe()}function Xr(xe,de,Ge,tt,ct){var Xe=fr(),We=Xe.proc("body",ct);return Y.optional(function(){Xe.commandStr=de.commandStr,Xe.command=Xe.link(de.commandStr)}),ln&&(Xe.instancing=We.def(Xe.shared.extensions,".angle_instanced_arrays")),xe(Xe,We,Ge,tt),Xe.compile().body}function Nr(xe,de,Ge,tt){di(xe,de),Ge.useVAO?Ge.drawVAO?de(xe.shared.vao,".setVAO(",Ge.drawVAO.append(xe,de),");"):de(xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"):(de(xe.shared.vao,".setVAO(null);"),sa(xe,de,Ge,tt.attributes,function(){return!0})),co(xe,de,Ge,tt.uniforms,function(){return!0}),cr(xe,de,de,Ge)}function fi(xe,de){var Ge=xe.proc("draw",1);di(xe,Ge),$i(xe,Ge,de.context),Qi(xe,Ge,de.framebuffer),la(xe,Ge,de),zi(xe,Ge,de.state),Cr(xe,Ge,de,!1,!0);var tt=de.shader.progVar.append(xe,Ge);if(Ge(xe.shared.gl,".useProgram(",tt,".program);"),de.shader.program)Nr(xe,Ge,de,de.shader.program);else{Ge(xe.shared.vao,".setVAO(null);");var ct=xe.global.def("{}"),Xe=Ge.def(tt,".id"),We=Ge.def(ct,"[",Xe,"]");Ge(xe.cond(We).then(We,".call(this,a0);").else(We,"=",ct,"[",Xe,"]=",xe.link(function(Qe){return Xr(Nr,xe,de,Qe,1)}),"(",tt,");",We,".call(this,a0);"))}Object.keys(de.state).length>0&&Ge(xe.shared.current,".dirty=true;")}function $s(xe,de,Ge,tt){xe.batchId="a1",di(xe,de);function ct(){return!0}sa(xe,de,Ge,tt.attributes,ct),co(xe,de,Ge,tt.uniforms,ct),cr(xe,de,de,Ge)}function yi(xe,de,Ge,tt){di(xe,de);var ct=Ge.contextDep,Xe=de.def(),We="a0",Qe="a1",Ee=de.def();xe.shared.props=Ee,xe.batchId=Xe;var Ue=xe.scope(),be=xe.scope();de(Ue.entry,"for(",Xe,"=0;",Xe,"<",Qe,";++",Xe,"){",Ee,"=",We,"[",Xe,"];",be,"}",Ue.exit);function nt(te){return te.contextDep&&ct||te.propDep}function ot(te){return!nt(te)}if(Ge.needsContext&&$i(xe,be,Ge.context),Ge.needsFramebuffer&&Qi(xe,be,Ge.framebuffer),zi(xe,be,Ge.state,nt),Ge.profile&&nt(Ge.profile)&&Cr(xe,be,Ge,!1,!0),tt)Ge.useVAO?Ge.drawVAO?nt(Ge.drawVAO)?be(xe.shared.vao,".setVAO(",Ge.drawVAO.append(xe,be),");"):Ue(xe.shared.vao,".setVAO(",Ge.drawVAO.append(xe,Ue),");"):Ue(xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"):(Ue(xe.shared.vao,".setVAO(null);"),sa(xe,Ue,Ge,tt.attributes,ot),sa(xe,be,Ge,tt.attributes,nt)),co(xe,Ue,Ge,tt.uniforms,ot),co(xe,be,Ge,tt.uniforms,nt),cr(xe,Ue,be,Ge);else{var g=xe.global.def("{}"),x=Ge.shader.progVar.append(xe,be),C=be.def(x,".id"),W=be.def(g,"[",C,"]");be(xe.shared.gl,".useProgram(",x,".program);","if(!",W,"){",W,"=",g,"[",C,"]=",xe.link(function(te){return Xr($s,xe,Ge,te,2)}),"(",x,");}",W,".call(this,a0[",Xe,"],",Xe,");")}}function Te(xe,de){var Ge=xe.proc("batch",2);xe.batchId="0",di(xe,Ge);var tt=!1,ct=!0;Object.keys(de.context).forEach(function(g){tt=tt||de.context[g].propDep}),tt||($i(xe,Ge,de.context),ct=!1);var Xe=de.framebuffer,We=!1;Xe?(Xe.propDep?tt=We=!0:Xe.contextDep&&tt&&(We=!0),We||Qi(xe,Ge,Xe)):Qi(xe,Ge,null),de.state.viewport&&de.state.viewport.propDep&&(tt=!0);function Qe(g){return g.contextDep&&tt||g.propDep}la(xe,Ge,de),zi(xe,Ge,de.state,function(g){return!Qe(g)}),(!de.profile||!Qe(de.profile))&&Cr(xe,Ge,de,!1,"a1"),de.contextDep=tt,de.needsContext=ct,de.needsFramebuffer=We;var Ee=de.shader.progVar;if(Ee.contextDep&&tt||Ee.propDep)yi(xe,Ge,de,null);else{var Ue=Ee.append(xe,Ge);if(Ge(xe.shared.gl,".useProgram(",Ue,".program);"),de.shader.program)yi(xe,Ge,de,de.shader.program);else{Ge(xe.shared.vao,".setVAO(null);");var be=xe.global.def("{}"),nt=Ge.def(Ue,".id"),ot=Ge.def(be,"[",nt,"]");Ge(xe.cond(ot).then(ot,".call(this,a0,a1);").else(ot,"=",be,"[",nt,"]=",xe.link(function(g){return Xr(yi,xe,de,g,2)}),"(",Ue,");",ot,".call(this,a0,a1);"))}}Object.keys(de.state).length>0&&Ge(xe.shared.current,".dirty=true;")}function Et(xe,de){var Ge=xe.proc("scope",3);xe.batchId="a2";var tt=xe.shared,ct=tt.current;$i(xe,Ge,de.context),de.framebuffer&&de.framebuffer.append(xe,Ge),Bf(Object.keys(de.state)).forEach(function(We){var Qe=de.state[We],Ee=Qe.append(xe,Ge);L(Ee)?Ee.forEach(function(Ue,be){Ge.set(xe.next[We],"["+be+"]",Ue)}):Ge.set(tt.next,"."+We,Ee)}),Cr(xe,Ge,de,!0,!0),[Fi,Wp,Fs,Qt,Is].forEach(function(We){var Qe=de.draw[We];Qe&&Ge.set(tt.draw,"."+We,""+Qe.append(xe,Ge))}),Object.keys(de.uniforms).forEach(function(We){var Qe=de.uniforms[We].append(xe,Ge);Array.isArray(Qe)&&(Qe="["+Qe.join()+"]"),Ge.set(tt.uniforms,"["+me.id(We)+"]",Qe)}),Object.keys(de.attributes).forEach(function(We){var Qe=de.attributes[We].append(xe,Ge),Ee=xe.scopeAttrib(We);Object.keys(new st).forEach(function(Ue){Ge.set(Ee,"."+Ue,Qe[Ue])})}),de.scopeVAO&&Ge.set(tt.vao,".targetVAO",de.scopeVAO.append(xe,Ge));function Xe(We){var Qe=de.shader[We];Qe&&Ge.set(tt.shader,"."+We,Qe.append(xe,Ge))}Xe(Sf),Xe(Ra),Object.keys(de.state).length>0&&(Ge(ct,".dirty=true;"),Ge.exit(ct,".dirty=true;")),Ge("a1(",xe.shared.context,",a0,",xe.batchId,");")}function _t(xe){if(!(typeof xe!="object"||L(xe))){for(var de=Object.keys(xe),Ge=0;Ge<de.length;++Ge)if(Tt.isDynamic(xe[de[Ge]]))return!0;return!1}}function Ln(xe,de,Ge){var tt=de.static[Ge];if(!tt||!_t(tt))return;var ct=xe.global,Xe=Object.keys(tt),We=!1,Qe=!1,Ee=!1,Ue=xe.global.def("{}");Xe.forEach(function(nt){var ot=tt[nt];if(Tt.isDynamic(ot)){typeof ot=="function"&&(ot=tt[nt]=Tt.unbox(ot));var g=dl(ot,null);We=We||g.thisDep,Ee=Ee||g.propDep,Qe=Qe||g.contextDep}else{switch(ct(Ue,".",nt,"="),typeof ot){case"number":ct(ot);break;case"string":ct('"',ot,'"');break;case"object":Array.isArray(ot)&&ct("[",ot.join(),"]");break;default:ct(xe.link(ot));break}ct(";")}});function be(nt,ot){Xe.forEach(function(g){var x=tt[g];if(Tt.isDynamic(x)){var C=nt.invoke(ot,x);ot(Ue,".",g,"=",C,";")}})}de.dynamic[Ge]=new Tt.DynamicVariable(fs,{thisDep:We,contextDep:Qe,propDep:Ee,ref:Ue,append:be}),delete de.static[Ge]}function Wr(xe,de,Ge,tt,ct){var Xe=fr();Xe.stats=Xe.link(ct),Object.keys(de.static).forEach(function(Qe){Ln(Xe,de,Qe)}),cv.forEach(function(Qe){Ln(Xe,xe,Qe)});var We=Pi(xe,de,Ge,tt,Xe);return fi(Xe,We),Et(Xe,We),Te(Xe,We),o(Xe.compile(),{destroy:function(){We.shader.program.destroy()}})}return{next:kn,current:Xt,procs:(function(){var xe=fr(),de=xe.proc("poll"),Ge=xe.proc("refresh"),tt=xe.block();de(tt),Ge(tt);var ct=xe.shared,Xe=ct.gl,We=ct.next,Qe=ct.current;tt(Qe,".dirty=false;"),Qi(xe,de),Qi(xe,Ge,null,!0);var Ee;ln&&(Ee=xe.link(ln)),Ie.oes_vertex_array_object&&Ge(xe.link(Ie.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var Ue=0;Ue<wt.maxAttributes;++Ue){var be=Ge.def(ct.attributes,"[",Ue,"]"),nt=xe.cond(be,".buffer");nt.then(Xe,".enableVertexAttribArray(",Ue,");",Xe,".bindBuffer(",Bs,",",be,".buffer.buffer);",Xe,".vertexAttribPointer(",Ue,",",be,".size,",be,".type,",be,".normalized,",be,".stride,",be,".offset);").else(Xe,".disableVertexAttribArray(",Ue,");",Xe,".vertexAttrib4f(",Ue,",",be,".x,",be,".y,",be,".z,",be,".w);",be,".buffer=null;"),Ge(nt),ln&&Ge(Ee,".vertexAttribDivisorANGLE(",Ue,",",be,".divisor);")}return Ge(xe.shared.vao,".currentVAO=null;",xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"),Object.keys(yn).forEach(function(ot){var g=yn[ot],x=tt.def(We,".",ot),C=xe.block();C("if(",x,"){",Xe,".enable(",g,")}else{",Xe,".disable(",g,")}",Qe,".",ot,"=",x,";"),Ge(C),de("if(",x,"!==",Qe,".",ot,"){",C,"}")}),Object.keys(Yt).forEach(function(ot){var g=Yt[ot],x=Xt[ot],C,W,te=xe.block();if(te(Xe,".",g,"("),L(x)){var ce=x.length;C=xe.global.def(We,".",ot),W=xe.global.def(Qe,".",ot),te(In(ce,function(Oe){return C+"["+Oe+"]"}),");",In(ce,function(Oe){return W+"["+Oe+"]="+C+"["+Oe+"];"}).join("")),de("if(",In(ce,function(Oe){return C+"["+Oe+"]!=="+W+"["+Oe+"]"}).join("||"),"){",te,"}")}else C=tt.def(We,".",ot),W=tt.def(Qe,".",ot),te(C,");",Qe,".",ot,"=",C,";"),de("if(",C,"!==",W,"){",te,"}");Ge(te)}),xe.compile()})(),compile:Wr}}function $f(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Nc=34918,Jr=34919,Im=35007,fl=function(K,me){if(!me.ext_disjoint_timer_query)return null;var Ie=[];function wt(){return Ie.pop()||me.ext_disjoint_timer_query.createQueryEXT()}function Dt(ln){Ie.push(ln)}var yt=[];function Nt(ln){var Sn=wt();me.ext_disjoint_timer_query.beginQueryEXT(Im,Sn),yt.push(Sn),rn(yt.length-1,yt.length,ln)}function tn(){me.ext_disjoint_timer_query.endQueryEXT(Im)}function sn(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var nn=[];function Mt(){return nn.pop()||new sn}function bn(ln){nn.push(ln)}var pn=[];function rn(ln,Sn,Xt){var kn=Mt();kn.startQueryIndex=ln,kn.endQueryIndex=Sn,kn.sum=0,kn.stats=Xt,pn.push(kn)}var Gt=[],st=[];function St(){var ln,Sn,Xt=yt.length;if(Xt!==0){st.length=Math.max(st.length,Xt+1),Gt.length=Math.max(Gt.length,Xt+1),Gt[0]=0,st[0]=0;var kn=0;for(ln=0,Sn=0;Sn<yt.length;++Sn){var Kt=yt[Sn];me.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Jr)?(kn+=me.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Nc),Dt(Kt)):yt[ln++]=Kt,Gt[Sn+1]=kn,st[Sn+1]=ln}for(yt.length=ln,ln=0,Sn=0;Sn<pn.length;++Sn){var yn=pn[Sn],Yt=yn.startQueryIndex,En=yn.endQueryIndex;yn.sum+=Gt[En]-Gt[Yt];var ar=st[Yt],xr=st[En];xr===ar?(yn.stats.gpuTime+=yn.sum/1e6,bn(yn)):(yn.startQueryIndex=ar,yn.endQueryIndex=xr,pn[ln++]=yn)}pn.length=ln}}return{beginQuery:Nt,endQuery:tn,pushScopeStats:rn,update:St,getNumPendingQueries:function(){return yt.length},clear:function(){Ie.push.apply(Ie,yt);for(var ln=0;ln<Ie.length;ln++)me.ext_disjoint_timer_query.deleteQueryEXT(Ie[ln]);yt.length=0,Ie.length=0},restore:function(){yt.length=0,Ie.length=0}}},Oi=16384,nl=256,mv=1024,Ea=34962,Cl="webglcontextlost",kc="webglcontextrestored",Uf=1,Ni=2,Bi=3;function Jp(K,me){for(var Ie=0;Ie<K.length;++Ie)if(K[Ie]===me)return Ie;return-1}function gv(K){var me=ut(K);if(!me)return null;var Ie=me.gl,wt=Ie.getContextAttributes(),Dt=Ie.isContextLost(),yt=vn(Ie,me);if(!yt)return null;var Nt=ao(),tn=$f(),sn=yt.extensions,nn=fl(Ie,sn),Mt=Zn(),bn=Ie.drawingBufferWidth,pn=Ie.drawingBufferHeight,rn={tick:0,time:0,viewportWidth:bn,viewportHeight:pn,framebufferWidth:bn,framebufferHeight:pn,drawingBufferWidth:bn,drawingBufferHeight:pn,pixelRatio:me.pixelRatio},Gt={},st={elements:null,primitive:4,count:-1,offset:0,instances:-1},St=_u(Ie,sn),ln=xl(Ie,tn,me,Xt),Sn=jp(Ie,sn,St,tn,ln);function Xt(cr){return Sn.destroyBuffer(cr)}var kn=Wn(Ie,sn,ln,tn),Kt=Ip(Ie,Nt,tn,me),yn=lo(Ie,sn,St,function(){ar.procs.poll()},rn,tn,me),Yt=hd(Ie,sn,St,tn,me),En=Rp(Ie,sn,St,yn,Yt,tn),ar=by(Ie,Nt,sn,St,ln,kn,yn,En,Gt,Sn,Kt,st,rn,nn,me),xr=Mm(Ie,En,ar.procs.poll,rn,wt,sn,St),on=ar.next,Zt=Ie.canvas,Ht=[],fr=[],Dr=[],Un=[me.onDestroy],$r=null;function Or(){if(Ht.length===0){nn&&nn.update(),$r=null;return}$r=wn.next(Or),zi();for(var cr=Ht.length-1;cr>=0;--cr){var Xr=Ht[cr];Xr&&Xr(rn,null,0)}Ie.flush(),nn&&nn.update()}function Fr(){!$r&&Ht.length>0&&($r=wn.next(Or))}function Qr(){$r&&(wn.cancel(Or),$r=null)}function ki(cr){cr.preventDefault(),Dt=!0,Qr(),fr.forEach(function(Xr){Xr()})}function Si(cr){Ie.getError(),Dt=!1,yt.restore(),Kt.restore(),ln.restore(),yn.restore(),Yt.restore(),En.restore(),Sn.restore(),nn&&nn.restore(),ar.procs.refresh(),Fr(),Dr.forEach(function(Xr){Xr()})}Zt&&(Zt.addEventListener(Cl,ki,!1),Zt.addEventListener(kc,Si,!1));function jr(){Ht.length=0,Qr(),Zt&&(Zt.removeEventListener(Cl,ki),Zt.removeEventListener(kc,Si)),Kt.clear(),En.clear(),Yt.clear(),yn.clear(),kn.clear(),ln.clear(),Sn.clear(),nn&&nn.clear(),Un.forEach(function(cr){cr()})}function Wi(cr){Y(!!cr,"invalid args to regl({...})"),Y.type(cr,"object","invalid args to regl({...})");function Xr(ct){var Xe=o({},ct);delete Xe.uniforms,delete Xe.attributes,delete Xe.context,delete Xe.vao,"stencil"in Xe&&Xe.stencil.op&&(Xe.stencil.opBack=Xe.stencil.opFront=Xe.stencil.op,delete Xe.stencil.op);function We(Qe){if(Qe in Xe){var Ee=Xe[Qe];delete Xe[Qe],Object.keys(Ee).forEach(function(Ue){Xe[Qe+"."+Ue]=Ee[Ue]})}}return We("blend"),We("depth"),We("cull"),We("stencil"),We("polygonOffset"),We("scissor"),We("sample"),"vao"in ct&&(Xe.vao=ct.vao),Xe}function Nr(ct,Xe){var We={},Qe={};return Object.keys(ct).forEach(function(Ee){var Ue=ct[Ee];if(Tt.isDynamic(Ue)){Qe[Ee]=Tt.unbox(Ue,Ee);return}else if(Xe&&Array.isArray(Ue)){for(var be=0;be<Ue.length;++be)if(Tt.isDynamic(Ue[be])){Qe[Ee]=Tt.unbox(Ue,Ee);return}}We[Ee]=Ue}),{dynamic:Qe,static:We}}var fi=Nr(cr.context||{},!0),$s=Nr(cr.uniforms||{},!0),yi=Nr(cr.attributes||{},!1),Te=Nr(Xr(cr),!1),Et={gpuTime:0,cpuTime:0,count:0},_t=ar.compile(Te,yi,$s,fi,Et),Ln=_t.draw,Wr=_t.batch,xe=_t.scope,de=[];function Ge(ct){for(;de.length<ct;)de.push(null);return de}function tt(ct,Xe){var We;if(Dt&&Y.raise("context lost"),typeof ct=="function")return xe.call(this,null,ct,0);if(typeof Xe=="function")if(typeof ct=="number")for(We=0;We<ct;++We)xe.call(this,null,Xe,We);else if(Array.isArray(ct))for(We=0;We<ct.length;++We)xe.call(this,ct[We],Xe,We);else return xe.call(this,ct,Xe,0);else if(typeof ct=="number"){if(ct>0)return Wr.call(this,Ge(ct|0),ct|0)}else if(Array.isArray(ct)){if(ct.length)return Wr.call(this,ct,ct.length)}else return Ln.call(this,ct)}return o(tt,{stats:Et,destroy:function(){_t.destroy()}})}var Ko=En.setFBO=Wi({framebuffer:Tt.define.call(null,Uf,"framebuffer")});function Pi(cr,Xr){var Nr=0;ar.procs.poll();var fi=Xr.color;fi&&(Ie.clearColor(+fi[0]||0,+fi[1]||0,+fi[2]||0,+fi[3]||0),Nr|=Oi),"depth"in Xr&&(Ie.clearDepth(+Xr.depth),Nr|=nl),"stencil"in Xr&&(Ie.clearStencil(Xr.stencil|0),Nr|=mv),Y(!!Nr,"called regl.clear with no buffer specified"),Ie.clear(Nr)}function $i(cr){if(Y(typeof cr=="object"&&cr,"regl.clear() takes an object as input"),"framebuffer"in cr)if(cr.framebuffer&&cr.framebuffer_reglType==="framebufferCube")for(var Xr=0;Xr<6;++Xr)Ko(o({framebuffer:cr.framebuffer.faces[Xr]},cr),Pi);else Ko(cr,Pi);else Pi(null,cr)}function Qi(cr){Y.type(cr,"function","regl.frame() callback must be a function"),Ht.push(cr);function Xr(){var Nr=Jp(Ht,cr);Y(Nr>=0,"cannot cancel a frame twice");function fi(){var $s=Jp(Ht,fi);Ht[$s]=Ht[Ht.length-1],Ht.length-=1,Ht.length<=0&&Qr()}Ht[Nr]=fi}return Fr(),{cancel:Xr}}function la(){var cr=on.viewport,Xr=on.scissor_box;cr[0]=cr[1]=Xr[0]=Xr[1]=0,rn.viewportWidth=rn.framebufferWidth=rn.drawingBufferWidth=cr[2]=Xr[2]=Ie.drawingBufferWidth,rn.viewportHeight=rn.framebufferHeight=rn.drawingBufferHeight=cr[3]=Xr[3]=Ie.drawingBufferHeight}function zi(){rn.tick+=1,rn.time=Cr(),la(),ar.procs.poll()}function di(){yn.refresh(),la(),ar.procs.refresh(),nn&&nn.update()}function Cr(){return(Zn()-Mt)/1e3}di();function sa(cr,Xr){Y.type(Xr,"function","listener callback must be a function");var Nr;switch(cr){case"frame":return Qi(Xr);case"lost":Nr=fr;break;case"restore":Nr=Dr;break;case"destroy":Nr=Un;break;default:Y.raise("invalid event, must be one of frame,lost,restore,destroy")}return Nr.push(Xr),{cancel:function(){for(var fi=0;fi<Nr.length;++fi)if(Nr[fi]===Xr){Nr[fi]=Nr[Nr.length-1],Nr.pop();return}}}}var co=o(Wi,{clear:$i,prop:Tt.define.bind(null,Uf),context:Tt.define.bind(null,Ni),this:Tt.define.bind(null,Bi),draw:Wi({}),buffer:function(cr){return ln.create(cr,Ea,!1,!1)},elements:function(cr){return kn.create(cr,!1)},texture:yn.create2D,cube:yn.createCube,renderbuffer:Yt.create,framebuffer:En.create,framebufferCube:En.createCube,vao:Sn.createVAO,attributes:wt,frame:Qi,on:sa,limits:St,hasExtension:function(cr){return St.extensions.indexOf(cr.toLowerCase())>=0},read:xr,destroy:jr,_gl:Ie,_refresh:di,poll:function(){zi(),nn&&nn.update()},now:Cr,stats:tn});return me.onDone(null,co),co}return gv}))})(sw)),sw.exports}Dme();var ep,Uy,tp,Gu,Vy,uh,Gy,G0,jd,Rv,Pl,Ld,Id,W0;ep={},Fn(ep,jn.POINTS,"points"),Fn(ep,jn.LINES,"lines"),Fn(ep,jn.LINE_LOOP,"line loop"),Fn(ep,jn.LINE_STRIP,"line strip"),Fn(ep,jn.TRIANGLES,"triangles"),Fn(ep,jn.TRIANGLE_FAN,"triangle fan"),Fn(ep,jn.TRIANGLE_STRIP,"triangle strip");Uy={},Fn(Uy,jn.STATIC_DRAW,"static"),Fn(Uy,jn.DYNAMIC_DRAW,"dynamic"),Fn(Uy,jn.STREAM_DRAW,"stream");tp={},Fn(tp,jn.BYTE,"int8"),Fn(tp,jn.UNSIGNED_INT,"int16"),Fn(tp,jn.INT,"int32"),Fn(tp,jn.UNSIGNED_BYTE,"uint8"),Fn(tp,jn.UNSIGNED_SHORT,"uint16"),Fn(tp,jn.UNSIGNED_INT,"uint32"),Fn(tp,jn.FLOAT,"float");Gu={},Fn(Gu,jn.ALPHA,"alpha"),Fn(Gu,jn.LUMINANCE,"luminance"),Fn(Gu,jn.LUMINANCE_ALPHA,"luminance alpha"),Fn(Gu,jn.RGB,"rgb"),Fn(Gu,jn.RGBA,"rgba"),Fn(Gu,jn.RGBA4,"rgba4"),Fn(Gu,jn.RGB5_A1,"rgb5 a1"),Fn(Gu,jn.RGB565,"rgb565"),Fn(Gu,jn.DEPTH_COMPONENT,"depth"),Fn(Gu,jn.DEPTH_STENCIL,"depth stencil");Vy={},Fn(Vy,jn.DONT_CARE,"dont care"),Fn(Vy,jn.NICEST,"nice"),Fn(Vy,jn.FASTEST,"fast");uh={},Fn(uh,jn.NEAREST,"nearest"),Fn(uh,jn.LINEAR,"linear"),Fn(uh,jn.LINEAR_MIPMAP_LINEAR,"mipmap"),Fn(uh,jn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Fn(uh,jn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Fn(uh,jn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest");Gy={},Fn(Gy,jn.REPEAT,"repeat"),Fn(Gy,jn.CLAMP_TO_EDGE,"clamp"),Fn(Gy,jn.MIRRORED_REPEAT,"mirror");G0={},Fn(G0,jn.NONE,"none"),Fn(G0,jn.BROWSER_DEFAULT_WEBGL,"browser");jd={},Fn(jd,jn.NEVER,"never"),Fn(jd,jn.ALWAYS,"always"),Fn(jd,jn.LESS,"less"),Fn(jd,jn.LEQUAL,"lequal"),Fn(jd,jn.GREATER,"greater"),Fn(jd,jn.GEQUAL,"gequal"),Fn(jd,jn.EQUAL,"equal"),Fn(jd,jn.NOTEQUAL,"notequal");Rv={},Fn(Rv,jn.FUNC_ADD,"add"),Fn(Rv,jn.MIN_EXT,"min"),Fn(Rv,jn.MAX_EXT,"max"),Fn(Rv,jn.FUNC_SUBTRACT,"subtract"),Fn(Rv,jn.FUNC_REVERSE_SUBTRACT,"reverse subtract");Pl={},Fn(Pl,jn.ZERO,"zero"),Fn(Pl,jn.ONE,"one"),Fn(Pl,jn.SRC_COLOR,"src color"),Fn(Pl,jn.ONE_MINUS_SRC_COLOR,"one minus src color"),Fn(Pl,jn.SRC_ALPHA,"src alpha"),Fn(Pl,jn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Fn(Pl,jn.DST_COLOR,"dst color"),Fn(Pl,jn.ONE_MINUS_DST_COLOR,"one minus dst color"),Fn(Pl,jn.DST_ALPHA,"dst alpha"),Fn(Pl,jn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Fn(Pl,jn.CONSTANT_COLOR,"constant color"),Fn(Pl,jn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Fn(Pl,jn.CONSTANT_ALPHA,"constant alpha"),Fn(Pl,jn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Fn(Pl,jn.SRC_ALPHA_SATURATE,"src alpha saturate");Ld={},Fn(Ld,jn.NEVER,"never"),Fn(Ld,jn.ALWAYS,"always"),Fn(Ld,jn.LESS,"less"),Fn(Ld,jn.LEQUAL,"lequal"),Fn(Ld,jn.GREATER,"greater"),Fn(Ld,jn.GEQUAL,"gequal"),Fn(Ld,jn.EQUAL,"equal"),Fn(Ld,jn.NOTEQUAL,"notequal");Id={},Fn(Id,jn.ZERO,"zero"),Fn(Id,jn.KEEP,"keep"),Fn(Id,jn.REPLACE,"replace"),Fn(Id,jn.INVERT,"invert"),Fn(Id,jn.INCR,"increment"),Fn(Id,jn.DECR,"decrement"),Fn(Id,jn.INCR_WRAP,"increment wrap"),Fn(Id,jn.DECR_WRAP,"decrement wrap");W0={},Fn(W0,jn.FRONT,"front"),Fn(W0,jn.BACK,"back");var aA,sj;function jme(){if(sj)return aA;sj=1;function e(t,n){return function(o){return t(n(o))}}return aA=e,aA}var lA,uj;function Lme(){if(uj)return lA;uj=1;var e=jme(),t=e(Object.getPrototypeOf,Object);return lA=t,lA}var sA,cj;function Ime(){if(cj)return sA;cj=1;var e=F2(),t=Lme(),n=B2(),o="[object Object]",r=Function.prototype,i=Object.prototype,a=r.toString,s=i.hasOwnProperty,l=a.call(Object);function f(h){if(!n(h)||e(h)!=o)return!1;var v=t(h);if(v===null)return!0;var b=s.call(v,"constructor")&&v.constructor;return typeof b=="function"&&b instanceof b&&a.call(b)==l}return sA=f,sA}Ime();class oT{constructor(){hl(this,"lf");hl(this,"option")}render(t){this.lf=t}layout(t={}){var f;const{nodes:n,edges:o,gridSize:r}=this.lf.graphModel;let i=40,a=40;r>20&&(i=r*2,a=r*2),this.option={type:"dagre",rankdir:"LR",align:"DR",nodesep:i,ranksep:a,begin:[120,120],...t},(f=new zfe(this.option).layout({nodes:n.map(h=>({id:h.id,size:{width:h.width,height:h.height},model:h})),edges:o.map(h=>({source:h.sourceNodeId,target:h.targetNodeId,model:h}))}).nodes)==null||f.forEach(h=>{const{model:v}=h;v.set_position({x:h.x,y:h.y})}),this.lf.fitView()}}hl(oT,"pluginName","dagre");let Fd=null;function dj(e,t){return e.x+=t,e.y+=t,e.text&&(e.text.x+=t,e.text.y+=t),e}function fj(e,t){return e.startPoint&&(e.startPoint.x+=t,e.startPoint.y+=t),e.endPoint&&(e.endPoint.x+=t,e.endPoint.y+=t),e.pointsList&&e.pointsList.length>0&&e.pointsList.forEach(n=>{n.x+=t,n.y+=t}),e.text&&(e.text.x+=t,e.text.y+=t),e}const dg=40;let z0=40;function p5(e,t){const{keyboard:n}=e,{options:{keyboard:o}}=n,r=()=>{var v,b;if(z0=dg,!(o!=null&&o.enabled)||t.textEditElement)return!0;const{guards:s}=e.options,l=t.getSelectElements(!1);if(!(s&&s.beforeClone?s.beforeClone(l):!0)||l.nodes.length===0&&l.edges.length===0)return Fd=null,!0;const h=l.nodes.filter(E=>E.type===kr.Start||E.type===kr.Base);if(h.length>0){Xi(((b=(v=h[0])==null?void 0:v.properties)==null?void 0:b.stepName)+Pt("views.applicationWorkflow.tip.cannotCopy"));return}return Fd=Me.cloneDeep(l),Fd.nodes.forEach(E=>dj(E,dg)),Fd.edges.forEach(E=>fj(E,dg)),Oh(Pt("views.applicationWorkflow.tip.copyError")),!1},i=()=>{if(!(o!=null&&o.enabled)||t.textEditElement)return!0;if(Fd&&(Fd.nodes||Fd.edges)){e.clearSelectElements();const s=e.addElements(Fd,z0);if(!s)return!0;s.nodes.forEach(l=>e.selectElementById(l.id,!0)),s.edges.forEach(l=>e.selectElementById(l.id,!0)),Fd.nodes.forEach(l=>dj(l,dg)),Fd.edges.forEach(l=>fj(l,dg)),z0=z0+dg}return!1},a=()=>{var f;const s=t.getSelectElements(!0);if(e.clearSelectElements(),s.nodes.length==0&&s.edges.length==0)return;if(s.edges.length>0&&s.nodes.length==0){s.edges.filter(h=>!["loop-edge"].includes(h.type||"")).forEach(h=>e.deleteEdge(h.id));return}const l=s.nodes.filter(h=>["start-node","base-node","loop-body-node","loop-start-node"].includes(h.type));if(l.length>0){Xi(`${(f=l[0].properties)==null?void 0:f.stepName}${Pt("views.applicationWorkflow.delete.deleteMessage")}`);return}return L2(Pt("common.tip"),Pt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:Pt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{if(!(o!=null&&o.enabled)||t.textEditElement)return!0;s.edges.forEach(h=>e.deleteEdge(h.id)),s.nodes.forEach(h=>{h.type==="loop-node"&&e.getNodeOutgoingNode(h.id).forEach(b=>{b.type==="loop-body-node"&&e.deleteNode(b.id)}),e.deleteNode(h.id)})}),!1};t.eventCenter.on("copy_node",r),n.on(["cmd + c","ctrl + c"],r),n.on(["cmd + v","ctrl + v"],i),n.on(["cmd + z","ctrl + z"],()=>{}),n.on(["cmd + y","ctrl + y"],()=>!(o!=null&&o.enabled)||t.textEditElement?!0:(e.redo(),!1)),n.on(["backspace"],a)}const Fme={class:"flex-between"},Bme={class:"flex align-center"},$me={class:"ellipsis-1 break-all"},Ume={class:"title-decoration-1 mb-8 mt-8"},Vme=["onMouseenter"],Gme={class:"break-all"},Wme={class:"dialog-footer"},zme=_r({__name:"LoopBodyContainer",props:{nodeModel:{}},setup(e){O_("workflowMode",nc.ApplicationLoop);const t=He(),n=He(!1),o=He({title:""}),r=hr({set:O=>{Me.set(h.nodeModel.properties,"showNode",O)},get:()=>h.nodeModel.properties.showNode!==void 0?h.nodeModel.properties.showNode:(Me.set(h.nodeModel.properties,"showNode",!0),!0)}),i=hr(()=>h.nodeModel.properties.status?h.nodeModel.properties.status:200),a=async O=>{O&&await O.validate(w=>{var S;w&&((S=h.nodeModel.graphModel.nodes)!=null&&S.some(M=>M.properties.stepName===o.value.title)?g9.error(Pt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(h.nodeModel.properties,"stepName",o.value.title),n.value=!1,O.resetFields()))})},s=()=>{h.nodeModel.graphModel.clearSelectElements(),Me.set(h.nodeModel,"isSelected",!0),Me.set(h.nodeModel,"isHovered",!0),h.nodeModel.graphModel.toFront(h.nodeModel.id)},l=He(null),f=He(600),h=e,v=hr(()=>{var O;return h.nodeModel.properties.config.fields?(O=h.nodeModel.properties.config.fields)==null?void 0:O.map(S=>({label:S.label,value:S.value,globeLabel:`{{${h.nodeModel.properties.stepName}.${S.value}}}`,globeValue:`{{context['${h.nodeModel.id}'].${S.value}}}`})):[]}),b=He(!1);function E(){if(b.value=!b.value,b.value){h.nodeModel.graphModel.transformModel.focusOn(h.nodeModel.x,h.nodeModel.y,h.nodeModel.width+window.innerWidth-h.nodeModel.width,h.nodeModel.height-30),f.value=(h.nodeModel.graphModel.height-100)/h.nodeModel.graphModel.transformModel.SCALE_Y;const O=window.innerWidth/h.nodeModel.graphModel.transformModel.SCALE_X;h.nodeModel.width=O,h.nodeModel.setHeight(f.value)}else{f.value=600;const O=1920;h.nodeModel.width=O,h.nodeModel.setHeight(f.value)}}return(O,w)=>{var V;const S=ne("AppIcon"),M=ne("el-button"),T=ne("el-alert"),$=ne("el-tooltip"),D=ne("el-collapse-transition"),P=ne("el-input"),B=ne("el-form-item"),F=ne("el-form"),I=ne("el-dialog");return Ne(),mn("div",{onMousedown:s,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Ws(["step-container app-card p-16",{isSelected:h.nodeModel.isSelected,error:i.value!==200}]),style:{overflow:"visible",background:"#fff"}},[ee("div",null,[ee("div",Fme,[ee("div",Bme,[(Ne(),bt(fw(Gn(pw)(`${e.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(V=e.nodeModel)==null?void 0:V.properties.node_data},null,8,["item"])),ee("h4",$me,_e(e.nodeModel.properties.stepName),1)]),k(M,{link:"",onClick:E},{default:j(()=>[k(S,{iconName:b.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1})]),k(D,null,{default:j(()=>[Ql(ee("div",{onMousedown:w[1]||(w[1]=An(()=>{},["stop"])),onKeydown:w[2]||(w[2]=An(()=>{},["stop"])),onClick:w[3]||(w[3]=An(()=>{},["stop"])),class:"mt-16"},[i.value!=200?(Ne(),bt(T,{key:0,class:"mb-16",title:h.nodeModel.type==="application-node"?O.$t("views.applicationWorkflow.tip.applicationNodeError"):O.$t("views.applicationWorkflow.tip.functionNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):Bn("",!0),ee("div",{style:Rj(`height:${f.value}px`)},[Dj(O.$slots,"default",{},void 0,!0)],4),v.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",Ume,_e(O.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(v.value,(z,q)=>(Ne(),mn("div",{key:q,class:"flex-between border-r-4 p-8-12 mb-8 layout-bg lighter",onMouseenter:X=>l.value=q,onMouseleave:w[0]||(w[0]=X=>l.value=null)},[ee("span",Gme,_e(z.label)+" "+_e("{"+z.value+"}"),1),l.value===q?(Ne(),bt($,{key:0,effect:"dark",content:O.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(M,{link:"",onClick:X=>Gn(x_)(z.globeLabel),style:{padding:"0"}},{default:j(()=>[k(S,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,Vme))),128))],64)):Bn("",!0)],544),[[Eh,r.value]])]),_:3})])],2),k(I,{title:O.$t("views.applicationWorkflow.nodeName"),modelValue:n.value,"onUpdate:modelValue":w[8]||(w[8]=z=>n.value=z),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:w[9]||(w[9]=An(()=>{},["prevent"]))},{footer:j(()=>[ee("span",Wme,[k(M,{onClick:w[6]||(w[6]=An(z=>n.value=!1,["prevent"]))},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(M,{type:"primary",onClick:w[7]||(w[7]=z=>a(t.value))},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1})])]),default:j(()=>[k(F,{"label-position":"top",ref_key:"titleFormRef",ref:t,model:o.value},{default:j(()=>[k(B,{prop:"title",rules:[{required:!0,message:O.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[k(P,{modelValue:o.value.title,"onUpdate:modelValue":w[4]||(w[4]=z=>o.value.title=z),onBlur:w[5]||(w[5]=z=>o.value.title=o.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),Hme=Ph(zme,[["__scopeId","data-v-cdf21a30"]]),Xme=[kr.AiChat,kr.Reply,kr.ToolLib,kr.ToolLibCustom,kr.ImageUnderstandNode,kr.Application,kr.SpeechToTextNode,kr.TextToSpeechNode,kr.ImageGenerateNode,kr.ImageToVideoGenerateNode,kr.TextToVideoGenerateNode,kr.ImageGenerateNode,kr.LoopBodyNode,kr.LoopNode,kr.LoopBreakNode,kr.VideoUnderstandNode,kr.VariableAssignNode],Yme=[kr.AiChat,kr.Reply,kr.ToolLib,kr.ToolLibCustom,kr.ImageUnderstandNode,kr.VideoUnderstandNode,kr.Application,kr.SpeechToTextNode,kr.TextToSpeechNode,kr.ImageGenerateNode,kr.ImageToVideoGenerateNode,kr.TextToVideoGenerateNode,kr.ImageGenerateNode,kr.LoopBodyNode,kr.LoopNode,kr.LoopBreakNode,kr.VariableAssignNode],pj={[nc.Application]:Xme,[nc.ApplicationLoop]:Yme};class C2{constructor(t,n){hl(this,"nodes");hl(this,"edges");hl(this,"workFlowNodes");hl(this,"workflowModel");this.nodes=t.nodes,this.edges=t.edges,this.workFlowNodes=[],this.workflowModel=n||nc.Application}is_valid_start_node(){const t=this.nodes.filter(n=>[kr.Start,kr.LoopStartNode].includes(n.id));if(t.length==0)throw Pt("views.applicationWorkflow.validate.startNodeRequired");if(t.length>1)throw Pt("views.applicationWorkflow.validate.startNodeOnly")}is_valid_base_node(){const t=this.nodes.filter(n=>n.id===kr.Base);if(t.length==0)throw Pt("views.applicationWorkflow.validate.baseNodeRequired");if(t.length>1)throw Pt("views.applicationWorkflow.validate.baseNodeOnly")}is_valid(){this.is_valid_start_node(),this.is_valid_base_node(),this.is_valid_work_flow(),this.is_valid_nodes()}is_loop_valid(){this.is_valid_start_node(),this.is_valid_work_flow(),this.is_valid_nodes()}get_start_node(){return this.nodes.filter(n=>[kr.Start,kr.LoopStartNode].includes(n.id))[0]}get_base_node(){return this.nodes.filter(n=>n.id===kr.Base)[0]}exist_break_node(){return this.nodes.some(t=>t.type===kr.LoopBreakNode)}_is_valid_work_flow(t){t||(t=this.get_start_node()),this.workFlowNodes.push(t),this.is_valid_node(t);const n=this.get_next_nodes(t);for(const o of n)this._is_valid_work_flow(o)}is_valid_work_flow(){this.workFlowNodes=[],this._is_valid_work_flow();const t=this.nodes.filter(n=>n.id!==kr.Start&&n.id!==kr.Base).filter(n=>!this.workFlowNodes.includes(n));if(t.length>0)throw`${Pt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${t.map(n=>n.properties.stepName).join(",")}`;this.workFlowNodes=[]}get_next_nodes(t){const o=this.edges.filter(i=>i.sourceNodeId==t.id).map(i=>this.nodes.filter(a=>a.id==i.targetNodeId)).reduce((i,a)=>[...i,...a],[]),r=pj[this.workflowModel];if(o.length==0&&!r.includes(t.type))throw Pt("views.applicationWorkflow.validate.noNextNode");return o}is_valid_nodes(){for(const t of this.nodes)if(t.type!==kr.Base&&t.type!==kr.Start&&t.type!==kr.LoopStartNode&&!this.edges.some(n=>n.targetNodeId===t.id))throw`${Pt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${t.properties.stepName}`}is_valid_node(t){if(t.properties.status&&t.properties.status===500)throw`${t.properties.stepName} ${Pt("views.applicationWorkflow.validate.nodeUnavailable")}`;if(t.type===kr.Condition){const n=t.properties.node_data.branch;for(const o of n){const r=`${t.id}_${o.id}_right`;if(this.edges.filter(a=>a.sourceAnchorId==r).length==0)throw`${t.properties.stepName} ${Pt("views.applicationWorkflow.validate.needConnect1")}${o.type}${Pt("views.applicationWorkflow.validate.needConnect2")}`}}else{const n=this.edges.filter(r=>r.sourceNodeId==t.id),o=pj[this.workflowModel];if(n.length==0&&!o.includes(t.type))throw`${t.properties.stepName} ${Pt("views.applicationWorkflow.validate.cannotEndNode")}`}if(t.properties.status&&t.properties.status!==200)throw`${t.properties.stepName} ${Pt("views.applicationWorkflow.validate.nodeUnavailable")}`}}const qme=_r({__name:"index",props:{nodeModel:{}},setup(e){const t=Object.assign({"/src/workflow/nodes/ai-chat-node/index.ts":r8,"/src/workflow/nodes/application-node/index.ts":o8,"/src/workflow/nodes/base-node/index.ts":_8,"/src/workflow/nodes/condition-node/index.ts":b8,"/src/workflow/nodes/document-extract-node/index.ts":w8,"/src/workflow/nodes/form-node/index.ts":E8,"/src/workflow/nodes/image-generate/index.ts":x8,"/src/workflow/nodes/image-to-video/index.ts":O8,"/src/workflow/nodes/image-understand/index.ts":S8,"/src/workflow/nodes/intent-classify-node/index.ts":A8,"/src/workflow/nodes/loop-body-node/index.ts":qj,"/src/workflow/nodes/loop-break-node/index.ts":M8,"/src/workflow/nodes/loop-continue-node/index.ts":T8,"/src/workflow/nodes/loop-node/index.ts":C8,"/src/workflow/nodes/loop-start-node/index.ts":N8,"/src/workflow/nodes/mcp-node/index.ts":k8,"/src/workflow/nodes/parameter-extraction-node/index.ts":P8,"/src/workflow/nodes/question-node/index.ts":R8,"/src/workflow/nodes/reply-node/index.ts":D8,"/src/workflow/nodes/reranker-node/index.ts":j8,"/src/workflow/nodes/search-document-node/index.ts":L8,"/src/workflow/nodes/search-knowledge-node/index.ts":I8,"/src/workflow/nodes/speech-to-text-node/index.ts":F8,"/src/workflow/nodes/start-node/index.ts":B8,"/src/workflow/nodes/text-to-speech-node/index.ts":$8,"/src/workflow/nodes/text-to-video/index.ts":U8,"/src/workflow/nodes/tool-lib-node/index.ts":V8,"/src/workflow/nodes/tool-node/index.ts":G8,"/src/workflow/nodes/variable-aggregation-node/index.ts":W8,"/src/workflow/nodes/variable-assign-node/index.ts":z8,"/src/workflow/nodes/variable-splitting/index.ts":H8,"/src/workflow/nodes/video-understand/index.ts":X8}),n=e,o=He(),r=()=>{const f=new C2(s.value.getGraphData(),nc.ApplicationLoop);return Promise.all(s.value.graphModel.nodes.map(h=>{var v;return(v=h==null?void 0:h.validate)==null?void 0:v.call(h)})).then(()=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);try{return f.is_loop_valid(),v.properties.node_data.loop_type=="LOOP"&&!f.exist_break_node()?Promise.reject({node:v,errMessage:Pt("views.applicationWorkflow.validate.loopNodeBreakNodeRequired")}):Promise.resolve({})}catch(b){return Promise.reject({node:v,errMessage:b})}}).catch(h=>{throw n.nodeModel.graphModel.selectNodeById(n.nodeModel.id),n.nodeModel.graphModel.transformModel.focusOn(n.nodeModel.x,n.nodeModel.y,n.nodeModel.width,n.nodeModel.height),h})},i=()=>{const f=n.nodeModel.properties.loop_node_id,h=n.nodeModel.graphModel.getNodeModelById(f);h.properties.node_data.loop={x:n.nodeModel.x,y:n.nodeModel.y},h.properties.node_data.loop_body=s.value.getGraphData()},a=f=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);v&&(v.properties.config.fields=f)},s=He(),l=f=>{const h=o.value;if(h){let v=function(b){let E=s.value.graphModel.transformModel.SCALE_X,O=s.value.graphModel.transformModel.SCALE_Y,w=s.value.graphModel.transformModel.TRANSLATE_X,S=s.value.graphModel.transformModel.TRANSLATE_Y;const[M,T]=b;return n.nodeModel.graphModel.transformModel,E*=n.nodeModel.graphModel.transformModel.SCALE_X,O*=n.nodeModel.graphModel.transformModel.SCALE_Y,w*=n.nodeModel.graphModel.transformModel.SCALE_X,S*=n.nodeModel.graphModel.transformModel.SCALE_Y,[(M-w)/E,(T-S)/O]};s.value=new e8({plugins:[oT],textEdit:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,background:{backgroundColor:"#f5f6f7"},grid:{size:10,type:"dot",config:{color:"#DEE0E3",thickness:1}},keyboard:{enabled:!0},isSilentMode:!1,container:h}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.graphModel.transformModel.HtmlPointToCanvasPoint=v.bind(s.value.graphModel.transformModel),p5(s.value,s.value.graphModel),s.value.graphModel.refresh_loop_fields=a,s.value.graphModel.get_parent_nodes=()=>n.nodeModel.graphModel.nodes,s.value.graphModel.get_up_node_field_list=n.nodeModel.get_up_node_field_list,s.value.batchRegister([...Object.keys(t).map(b=>t[b].default),Y8]),s.value.setDefaultEdgeType("app-edge"),s.value.render(f||{}),s.value.graphModel.eventCenter.on("delete_edge",b=>{b.forEach(E=>{s.value.deleteEdge(E)})}),s.value.graphModel.eventCenter.on("anchor:drop",b=>{b.nodeModel.clear_next_node_field(!1)}),s.value.graphModel.eventCenter.on("anchor:drop",b=>{b.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var b;(b=s.value)==null||b.fitView()},500)}};return bo(()=>{l(Me.cloneDeep(n.nodeModel.properties.workflow)),Me.set(n.nodeModel,"validate",r),Me.set(n.nodeModel,"set_loop_body",i)}),Ij(()=>{Une(s.value.graphModel.flowId),s.value=null}),(f,h)=>(Ne(),bt(Hme,{nodeModel:e.nodeModel},{default:j(()=>[ee("div",{ref_key:"containerRef",ref:o,onWheel:h[0]||(h[0]=An(()=>{},["stop"])),style:{height:"100%",width:"100%"}},null,544)]),_:1},8,["nodeModel"]))}});class Kme extends ai{constructor(t){super(t,qme)}getNodeName(){return Pt("views.applicationWorkflow.nodes.loopBodyNode.label")}get_up_node_field_list(t,n){const o=this.props.model.properties.loop_node_id;if(typeof o=="string"){const r=this.props.graphModel.getNodeModelById(o);if(r&&typeof r.get_up_node_field_list=="function")return r.get_up_node_field_list(t,n)}return[]}}class Zme extends li{refreshBranch(){this.incoming.edges.forEach(t=>{t.updatePathByAnchor()}),this.outgoing.edges.forEach(t=>{t.updatePathByAnchor()})}getDefaultAnchor(){const{id:t,x:n,y:o,width:r,height:i}=this;this.properties.showNode===void 0||this.properties.showNode;const a=[];return a.push({edgeAddable:!1,x:n,y:o-i/2+10,id:`${t}_children`,type:"children"}),a}setHeight(t){this.properties.height=t,this.outgoing.edges.forEach(n=>{n.updatePathByAnchor()}),this.incoming.edges.forEach(n=>{n.updatePathByAnchor()})}}const Jme={type:"loop-body-node",model:Zme,view:Kme};class Qme extends Hu.BezierEdgeModel{getArrowStyle(){const t=super.getArrowStyle();return t.offset=0,t.verticalLength=0,t}getEdgeStyle(){const t=super.getEdgeStyle();return t.strokeWidth=2,t.stroke="#BBBFC4",t.offset=0,t}getData(){const t=super.getData();return t&&(t.sourceAnchorId=this.sourceAnchorId,t.targetAnchorId=this.targetAnchorId),t}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(i=>i.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(i=>i.id===this.targetAnchorId);if(n&&r){const i={x:n.x,y:n.y-10};this.updateStartPoint(i);const a={x:r.x,y:r.y+3};this.updateEndPoint(a)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}}const ege={type:"loop-edge",view:Hu.BezierEdge,model:Qme},tge=_r({__name:"NodeControl",props:{lf:Object||String||null},setup(e){const t=e,n=He(!1);function o(){var h;(h=t.lf)==null||h.zoom(!0,[0,0])}function r(){var h;(h=t.lf)==null||h.zoom(!1,[0,0])}function i(){var h,v,b;(h=t.lf)==null||h.resetZoom(),(v=t.lf)==null||v.resetTranslate(),(b=t.lf)==null||b.fitView()}const a=()=>{var h;(h=t.lf)==null||h.extension.dagre.layout()},s=()=>{var h;(h=t.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!1})},l=()=>{var h;(h=t.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!0})},f=h=>{var b,E,O;const v=document.querySelector(".lf-drag-able");n.value=h,h?(v.style.cursor="default",(b=t.lf)==null||b.openSelectionSelect(),(E=t.lf)==null||E.extension.selectionSelect.setSelectionSense(!0,!1)):(v.style.cursor="pointer",(O=t.lf)==null||O.closeSelectionSelect())};return(h,v)=>{const b=ne("Position"),E=ne("el-icon"),O=ne("el-button"),w=ne("AppIcon"),S=ne("el-divider"),M=ne("ZoomOut"),T=ne("el-tooltip"),$=ne("ZoomIn"),D=ne("el-card");return Ne(),bt(D,{shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:j(()=>[k(O,{onClick:v[0]||(v[0]=P=>f(!0)),style:{border:"none",padding:"4px",height:"24px"},class:Ws({"is-drag-active":n.value})},{default:j(()=>[k(E,{size:16},{default:j(()=>[k(b)]),_:1})]),_:1},8,["class"]),k(O,{onClick:v[1]||(v[1]=P=>f(!1)),style:{border:"none",padding:"4px",height:"24px","margin-left":"8px"},class:Ws({"is-drag-active":!n.value})},{default:j(()=>[k(w,{iconName:"app-raisehand",size:16})]),_:1},8,["class"]),k(S,{direction:"vertical"}),k(O,{link:"",onClick:r,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomOut"),placement:"top"},{default:j(()=>[k(E,{size:16,title:h.$t("views.applicationWorkflow.control.zoomOut")},{default:j(()=>[k(M)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:o,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomIn"),placement:"top"},{default:j(()=>[k(E,{size:16,title:h.$t("views.applicationWorkflow.control.zoomIn")},{default:j(()=>[k($)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:i,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.fitView"),placement:"top"},{default:j(()=>[k(w,{iconName:"app-fitview",title:h.$t("views.applicationWorkflow.control.fitView")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{direction:"vertical"}),k(O,{link:"",onClick:s,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.retract"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-retract",title:h.$t("views.applicationWorkflow.control.retract")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:l,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.extend"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-extend",title:h.$t("views.applicationWorkflow.control.extend")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:a,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.beautify"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-beautify",title:h.$t("views.applicationWorkflow.control.beautify")},null,8,["title"])]),_:1},8,["content"])]),_:1})]),_:1})}}}),nge=Ph(tge,[["__scopeId","data-v-510558f4"]]),rge=_r({name:"WorkFlow"}),oge=_r({...rge,props:{data:Object||null},setup(e,{expose:t}){const n=Object.assign({"./nodes/ai-chat-node/index.ts":r8,"./nodes/application-node/index.ts":o8,"./nodes/base-node/index.ts":_8,"./nodes/condition-node/index.ts":b8,"./nodes/document-extract-node/index.ts":w8,"./nodes/form-node/index.ts":E8,"./nodes/image-generate/index.ts":x8,"./nodes/image-to-video/index.ts":O8,"./nodes/image-understand/index.ts":S8,"./nodes/intent-classify-node/index.ts":A8,"./nodes/loop-body-node/index.ts":qj,"./nodes/loop-break-node/index.ts":M8,"./nodes/loop-continue-node/index.ts":T8,"./nodes/loop-node/index.ts":C8,"./nodes/loop-start-node/index.ts":N8,"./nodes/mcp-node/index.ts":k8,"./nodes/parameter-extraction-node/index.ts":P8,"./nodes/question-node/index.ts":R8,"./nodes/reply-node/index.ts":D8,"./nodes/reranker-node/index.ts":j8,"./nodes/search-document-node/index.ts":L8,"./nodes/search-knowledge-node/index.ts":I8,"./nodes/speech-to-text-node/index.ts":F8,"./nodes/start-node/index.ts":B8,"./nodes/text-to-speech-node/index.ts":$8,"./nodes/text-to-video/index.ts":U8,"./nodes/tool-lib-node/index.ts":V8,"./nodes/tool-node/index.ts":G8,"./nodes/variable-aggregation-node/index.ts":W8,"./nodes/variable-assign-node/index.ts":z8,"./nodes/variable-splitting/index.ts":H8,"./nodes/video-understand/index.ts":X8}),o=ml("workflowMode")||nc.Application,r=ml("loopWorkflowMode")||nc.ApplicationLoop,i=Gne(),a=He(""),s=He();bo(()=>{f()}),Ij(()=>{Vne()});const l=w=>{s.value.render(w)},f=w=>{const S=document.querySelector("#container");S&&(s.value=new e8({plugins:[oT,kne],textEdit:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,background:{backgroundColor:"#f5f6f7"},grid:{size:10,type:"dot",config:{color:"#DEE0E3",thickness:1}},keyboard:{enabled:!0},isSilentMode:!1,container:S,stopMoveGraph:!1,stopZoomGraph:!1}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.on("graph:rendered",()=>{a.value=s.value.graphModel.flowId}),p5(s.value,s.value.graphModel),s.value.batchRegister([...Object.keys(n).map(M=>n[M].default),Y8,ege]),s.value.setDefaultEdgeType("app-edge"),s.value.render(w||{}),s.value.graphModel.get_provide=(M,T)=>({getNode:()=>M,getGraph:()=>T,workflowMode:o,loopWorkflowMode:r}),s.value.graphModel.eventCenter.on("delete_edge",M=>{M.forEach(T=>{s.value.deleteEdge(T)})}),s.value.graphModel.eventCenter.on("anchor:drop",M=>{M.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var M,T,$;((M=s.value.graphModel)==null?void 0:M.nodes.length)>1?(T=s.value)==null||T.fitView():($=s.value)==null||$.translateCenter()},500))};return t({onmousedown:w=>{w.type&&s.value.dnd.startDrag({type:w.type,properties:{...w.properties}}),w.callback&&w.callback(s.value)},validate:()=>Promise.all(s.value.graphModel.nodes.map(w=>{var S;return(S=w==null?void 0:w.validate)==null?void 0:S.call(w)})),getGraphData:()=>{const w=s.value.getGraphData();w.nodes.forEach(M=>{M.type==="loop-body-node"&&s.value.getNodeModelById(M.id).set_loop_body()});const S=s.value.getGraphData();return S.nodes=S.nodes.filter(M=>M.type!=="loop-body-node"),S.edges=w.edges.filter(M=>M.type!=="loop-edge"),S},addNode:w=>{s.value.clearSelectElements();const{virtualRectCenterPositionX:S,virtualRectCenterPositionY:M}=s.value.graphModel.getVirtualRectSize(),T=s.value.graphModel.addNode({type:w.type,properties:w.properties,x:S,y:M-s.value.graphModel.height/2});T.isSelected=!0,T.isHovered=!0,s.value.toFront(T.id)},clearGraphData:()=>s.value.clearData(),renderGraphData:f,render:l}),(w,S)=>(Ne(),mn(Ir,null,[S[0]||(S[0]=ee("div",{className:"workflow-app",id:"container"},null,-1)),s.value?(Ne(),bt(nge,{key:0,class:"workflow-control",lf:s.value},null,8,["lf"])):Bn("",!0),k(Gn(i),{"flow-id":a.value},null,8,["flow-id"])],64))}}),ige={class:"workflow-publish-history border-l white-bg"},age={class:"border-b p-16-24"},lge={class:"list-height pt-0"},sge={class:"p-8 pt-0"},uge={class:"flex-between"},cge={style:{"max-width":"80%"}},dge={class:"text-center"},fge=_r({__name:"PublishHistory",emits:["click","refreshVersion"],setup(e,{emit:t}){const n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(!1),s=He([]),l=He("");function f(S){l.value=S.id}function h(S){i("click",S)}function v(S){i("refreshVersion",S)}function b(S){S.writeStatus=!0}function E(S){S.writeStatus=!1}function O(S,M){if(S){const T={name:S};oi({type:"workflowVersion",systemType:r.value}).putWorkFlowVersion(o,M.id,T,a).then(()=>{Oh(Pt("common.modifySuccess")),M.writeStatus=!1,w()})}else Xi(Pt("views.applicationWorkflow.tip.nameMessage"))}function w(){oi({type:"workflowVersion",systemType:r.value}).getWorkFlowVersion(o,a).then(S=>{s.value=S.data})}return bo(()=>{w()}),(S,M)=>{const T=ne("ReadWrite"),$=ne("el-tag"),D=ne("UserFilled"),P=ne("el-icon"),B=ne("el-avatar"),F=ne("el-text"),I=ne("AppIcon"),V=ne("el-button"),z=ne("el-dropdown-item"),q=ne("RefreshLeft"),X=ne("el-dropdown-menu"),G=ne("el-dropdown"),Q=ne("common-list"),J=ne("el-scrollbar"),ie=Rg("loading");return Ne(),mn("div",ige,[ee("h4",age,_e(S.$t("views.applicationWorkflow.setting.releaseHistory")),1),ee("div",lge,[k(J,null,{default:j(()=>[ee("div",sge,[Ql((Ne(),bt(Q,{data:s.value,class:"mt-8",onClick:h,onMouseenter:f,onMouseleave:M[1]||(M[1]=Se=>l.value="")},{default:j(({row:Se,index:Ae})=>[ee("div",uge,[ee("div",cge,[ee("h5",{class:Ws([Ae===0?"primary":"","flex align-center"])},[k(T,{onChange:Pe=>O(Pe,Se),data:Se.name||Gn(dA)(Se.update_time),trigger:"manual",write:Se.writeStatus,onClose:Pe=>E(Se)},null,8,["onChange","data","write","onClose"]),Ae===0?(Ne(),bt($,{key:0,class:"default-tag ml-4"},{default:j(()=>[ft(_e(S.$t("views.applicationWorkflow.setting.latestRelease")),1)]),_:1})):Bn("",!0)],2),k(F,{type:"info",class:"color-secondary flex align-center mt-8"},{default:j(()=>[k(B,{size:20,class:"avatar-grey mr-4"},{default:j(()=>[k(P,null,{default:j(()=>[k(D)]),_:1})]),_:1}),ft(" "+_e(Se.publish_user_name),1)]),_:2},1024)]),Ql(ee("div",{onClick:M[0]||(M[0]=An(()=>{},["stop"]))},[k(G,{trigger:"click",teleported:!1},{dropdown:j(()=>[k(X,null,{default:j(()=>[k(z,{onClick:An(Pe=>b(Se),["stop"])},{default:j(()=>[k(I,{iconName:"app-edit",class:"color-secondary"}),ft(" "+_e(S.$t("common.edit")),1)]),_:1},8,["onClick"]),k(z,{onClick:Pe=>v(Se)},{default:j(()=>[k(P,{class:"color-secondary"},{default:j(()=>[k(q)]),_:1}),ft(" "+_e(S.$t("views.applicationWorkflow.setting.restoreCurrentVersion")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:j(()=>[k(V,{text:""},{default:j(()=>[k(I,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[Eh,l.value===Se.id]])])]),empty:j(()=>[ee("div",dge,[k(F,{type:"info"},{default:j(()=>[ft(_e(S.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data"])),[[ie,a.value]])])]),_:1})])])}}}),pge=Ph(fge,[["__scopeId","data-v-85be1165"]]),hge={class:"application-workflow"},vge={class:"header border-b flex-between p-12-24 white-bg"},mge={class:"flex align-center"},gge=["title"],yge={key:0},_ge={key:0},bge={key:1},wge=["href"],Ege={class:"ml-4"},xge={class:"flex-between"},Oge={class:"flex align-center"},Sge={class:"mr-12 ml-24 flex"},Age=["src"],Mge=["title"],Tge={class:"mr-16"},Cge={class:"scrollbar-height"},qge=_r({__name:"index",setup(e){O_("getApplicationDetail",()=>E),O_("workflowMode",nc.Application);const{theme:t}=kj(),n=y9(),o=ja(),{params:{id:r,from:i}}=o,a=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),s=hr(()=>Pj.application[a.value]),l=hr(()=>t.isDefaultTheme());let f;const h=He(),v=He(),b=He(!1),E=He(null),O=He(!1),w=He(!1),S=He(!1),M=He(""),T=He(!1),$=He(!1),D=He(!1),P=He({}),B=He(null),F=He([]),I=hr(()=>UN(F.value)?"?"+UN(F.value):""),V=hr(()=>{var $e;return`${window.location.origin}/chat/`+(($e=E.value)==null?void 0:$e.access_token)+I.value});function z(){JSON.stringify(B.value)!==JSON.stringify(Be())?L2(Pt("common.tip"),Pt("views.applicationWorkflow.tip.saveMessage"),{confirmButtonText:Pt("views.applicationWorkflow.setting.exitSave"),cancelButtonText:Pt("views.applicationWorkflow.setting.exit"),distinguishCancelAndClose:!0}).then(()=>{gt(!0,!0)}).catch($e=>{$e==="cancel"&&le()}):le()}function q(){D.value||($.value=!1,D.value=!1)}function X($e){$e&&Q($e),$.value=!1,D.value=!1}function G($e){D.value=!0,P.value=$e,Q($e),we()}function Q($e){var rt;$e.work_flow.nodes.map(pt=>{pt.properties.noRender=!0}),E.value.work_flow=$e.work_flow,M.value=$e==null?void 0:$e.update_time,(rt=h.value)==null||rt.clearGraphData(),xh(()=>{var pt;(pt=h.value)==null||pt.render($e.work_flow)})}function J(){Je(),T.value&&se(),$.value=!1,D.value=!1}function ie(){$.value=!0}function Se($e){$e?se():we(),localStorage.setItem("workflowAutoSave",$e.toString())}function Ae($e){O.value=!1}function Pe($e){O.value=!1}function De(){O.value=!1}const ze=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{const rt=Be(),pt=new C2(rt);try{pt.is_valid()}catch(Lt){Xi(Lt.toString());return}oi({type:"application",systemType:a.value}).putApplication(r,{work_flow:rt},b).then(()=>oi({type:"application",systemType:a.value}).publish(r,{},b)).then(Lt=>{var Jt,en;E.value.name=Lt.data.name,(en=(Jt=Lt.data.work_flow)==null?void 0:Jt.nodes)==null||en.filter(zt=>zt.id==="base-node").map(zt=>{F.value=zt.properties.api_input_field_list?zt.properties.api_input_field_list.map(it=>({name:it.variable,value:it.default_value})):zt.properties.input_field_list?zt.properties.input_field_list.filter(it=>it.assignment_method==="api_input").map(it=>({name:it.variable,value:it.default_value})):[]}),Oh(Pt("views.application.tip.publishSuccess"))}).catch(Lt=>{var zt,it,ae,re;const Jt=Lt.node,en=Lt.errMessage;if(typeof en=="string")Xi(((zt=Lt.node.properties)==null?void 0:zt.stepName)+` ${Pt("views.applicationWorkflow.node").toLowerCase()} `+en.toLowerCase());else{const je=Object.keys(en);Xi(((it=Jt.properties)==null?void 0:it.stepName)+` ${Pt("views.applicationWorkflow.node").toLowerCase()} `+((re=(ae=en[je[0]])==null?void 0:ae[0])==null?void 0:re.message.toLowerCase()))}})}).catch(rt=>{var Jt,en,zt,it;const pt=rt.node,Lt=rt.errMessage;if(typeof Lt=="string")Xi(((Jt=rt.node.properties)==null?void 0:Jt.stepName)+` ${Pt("views.applicationWorkflow.node")},`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${Pt("views.applicationWorkflow.node")},`+((it=(zt=Lt[ae[0]])==null?void 0:zt[0])==null?void 0:it.message))}})},Ye=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{var Lt;const rt=Be(),pt=new C2(rt);try{pt.is_valid(),E.value={...E.value,type:"WORK_FLOW",...(Lt=pt.get_base_node())==null?void 0:Lt.properties.node_data,work_flow:Be()},w.value=!0}catch(Jt){Xi(Jt.toString())}}).catch(rt=>{var Jt,en,zt,it;const pt=rt.node,Lt=rt.errMessage;if(typeof Lt=="string")Xi(((Jt=rt.node.properties)==null?void 0:Jt.stepName)+` ${Pt("views.applicationWorkflow.node")},`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${Pt("views.applicationWorkflow.node")},`+((it=(zt=Lt[ae[0]])==null?void 0:zt[0])==null?void 0:it.message))}})};function Be(){var $e;return($e=h.value)==null?void 0:$e.getGraphData()}function Je(){oi({type:"application",systemType:a.value}).getApplicationDetail(r).then($e=>{var rt,pt,Lt,Jt,en;(rt=$e.data)==null||rt.work_flow.nodes.map(zt=>{zt.properties.noRender=!0}),E.value=$e.data,E.value.stt_model_id=$e.data.stt_model,E.value.tts_model_id=$e.data.tts_model,E.value.tts_type=$e.data.tts_type,M.value=(pt=$e.data)==null?void 0:pt.update_time,(Jt=(Lt=E.value.work_flow)==null?void 0:Lt.nodes)==null||Jt.filter(zt=>zt.id==="base-node").map(zt=>{F.value=zt.properties.api_input_field_list?zt.properties.api_input_field_list.map(it=>({name:it.variable,value:it.default_value})):zt.properties.input_field_list?zt.properties.input_field_list.filter(it=>it.assignment_method==="api_input").map(it=>({name:it.variable,value:it.default_value})):[]}),oi({type:"application",systemType:a.value}).getAccessToken(r,b).then(zt=>{E.value={...E.value,...zt.data}}),(en=h.value)==null||en.clearGraphData(),xh(()=>{var zt;(zt=h.value)==null||zt.render(E.value.work_flow),B.value=Be()}),Qf([Vs.IS_EE,Vs.IS_PE],"OR")&&oi({type:"application",systemType:a.value}).getApplicationSetting(r).then(zt=>{E.value={...E.value,...zt.data}})})}function gt($e,rt){const pt={work_flow:Be()};b.value=rt||!1,oi({type:"application",systemType:a.value}).putApplication(r,pt).then(()=>{M.value=new Date,$e&&(B.value=Be(),Oh(Pt("common.saveSuccess")),rt&&le())}).catch(()=>{b.value=!1})}const le=()=>o.path.includes("workspace")?n.push({path:pe()}):n.push({path:Ze()}),Ze=()=>Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_OVERVIEW_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_ACCESS_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_CHAT_USER_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_CHAT_LOG_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/system/resource-management/application",pe=()=>Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Bc.WORKSPACE_MANAGE.getWorkspaceRole,Yl.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,Yl.APPLICATION_OVERVIEW_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"AND"),new sh([Bc.WORKSPACE_MANAGE.getWorkspaceRole],[Yl.APPLICATION_ACCESS_READ.getWorkspacePermissionWorkspaceManageRole],[Vs.IS_EE,Vs.IS_PE],"OR"),new sh([],[Yl.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"AND"),new sh([Bc.WORKSPACE_MANAGE.getWorkspaceRole],[Yl.APPLICATION_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole],[Vs.IS_EE,Vs.IS_PE],"OR"),new sh([],[Yl.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([new sh([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Yl.APPLICATION_CHAT_LOG_READ.getWorkspacePermissionWorkspaceManageRole,Yl.APPLICATION_CHAT_LOG_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/application",se=()=>{f=setInterval(()=>{gt()},6e4)},we=()=>{f&&clearInterval(f)};return bo(()=>{Je();const $e=localStorage.getItem("workflowAutoSave");T.value=$e==="true",T.value&&se()}),_9(()=>{var $e;we(),($e=h.value)==null||$e.clearGraphData()}),($e,rt)=>{var ke,Ke,Le;const pt=ne("back-button"),Lt=ne("el-text"),Jt=ne("el-button"),en=ne("el-divider"),zt=ne("Close"),it=ne("el-icon"),ae=ne("AppIcon"),re=ne("el-dropdown-item"),je=ne("el-switch"),vt=ne("el-dropdown-menu"),Y=ne("el-dropdown"),kt=ne("el-collapse-transition"),Rt=ne("el-avatar"),Wt=ne("LogoIcon"),Pn=ne("AiChat"),qt=Rg("click-outside"),xn=Rg("loading");return Ql((Ne(),mn("div",hge,[ee("div",vge,[ee("div",mge,[k(pt,{onClick:z}),ee("h4",{class:"ellipsis",style:{"max-width":"300px"},title:(ke=E.value)==null?void 0:ke.name},_e((Ke=E.value)==null?void 0:Ke.name),9,gge),$.value&&D.value?(Ne(),mn("div",yge,[k(Lt,{type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.previewVersion"))+" "+_e(P.value.name||Gn(dA)(P.value.update_time)),1)]),_:1})])):M.value?(Ne(),bt(Lt,{key:1,type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.saveTime"))+_e(Gn(dA)(M.value)),1)]),_:1})):Bn("",!0)]),$.value&&D.value?(Ne(),mn("div",_ge,[k(Jt,{type:"primary",class:"mr-8",onClick:rt[0]||(rt[0]=dt=>X())},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.setting.restoreVersion")),1)]),_:1}),k(en,{direction:"vertical"}),k(Jt,{text:"",onClick:J},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):(Ne(),mn("div",bge,[k(Jt,{onClick:rt[1]||(rt[1]=dt=>O.value=!O.value)},{default:j(()=>[k(ae,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.addComponent")),1)]),_:1}),s.value.debug(Gn(r))?(Ne(),bt(Jt,{key:0,onClick:Ye,disabled:w.value},{default:j(()=>[k(ae,{iconName:"app-debug-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.debug")),1)]),_:1},8,["disabled"])):Bn("",!0),s.value.edit(Gn(r))?(Ne(),bt(Jt,{key:1,onClick:rt[2]||(rt[2]=dt=>gt(!0))},{default:j(()=>[k(ae,{iconName:"app-save-outlined",class:"mr-4"}),ft(" "+_e($e.$t("common.save")),1)]),_:1})):Bn("",!0),s.value.edit(Gn(r))?(Ne(),bt(Jt,{key:2,type:"primary",onClick:ze},{default:j(()=>[ft(_e($e.$t("views.application.operation.publish")),1)]),_:1})):Bn("",!0),k(Y,{trigger:"click"},{dropdown:j(()=>[k(vt,null,{default:j(()=>[ee("a",{href:V.value,target:"_blank"},[k(re,null,{default:j(()=>[k(ae,{iconName:"app-create-chat",class:"color-secondary"}),ft(" "+_e($e.$t("views.application.operation.toChat")),1)]),_:1})],8,wge),k(re,{onClick:ie},{default:j(()=>[k(ae,{iconName:"app-history-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.releaseHistory")),1)]),_:1}),k(re,null,{default:j(()=>[k(ae,{iconName:"app-save-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.autoSave"))+" ",1),ee("div",Ege,[k(je,{size:"small",modelValue:T.value,"onUpdate:modelValue":rt[4]||(rt[4]=dt=>T.value=dt),onChange:Se},null,8,["modelValue"])])]),_:1})]),_:1})]),default:j(()=>[k(Jt,{text:"",onClick:rt[3]||(rt[3]=An(()=>{},["stop"])),class:"ml-8 mt-4"},{default:j(()=>[k(ae,{iconName:"app-more",class:"rotate-90"})]),_:1})]),_:1})]))]),k(kt,null,{default:j(()=>[Ql(k(g3,{show:O.value,id:Gn(r),onClickNodes:Ae,onOnmousedown:Pe,workflowRef:h.value},null,8,["show","id","workflowRef"]),[[qt,De]])]),_:1}),ee("div",{class:"workflow-main",ref_key:"workflowMainRef",ref:v},[E.value?(Ne(),bt(oge,{key:0,ref_key:"workflowRef",ref:h,data:(Le=E.value)==null?void 0:Le.work_flow},null,8,["data"])):Bn("",!0)],512),k(kt,null,{default:j(()=>{var dt,At,Tt;return[w.value?(Ne(),mn("div",{key:0,class:Ws(["workflow-debug-container",S.value?"enlarge":""])},[ee("div",{class:Ws(["workflow-debug-header",l.value?"":"custom-header"])},[ee("div",xge,[ee("div",Oge,[ee("div",Sge,[Gn(cA)((dt=E.value)==null?void 0:dt.icon)?(Ne(),bt(Rt,{key:0,shape:"square",size:32,style:{background:"none"}},{default:j(()=>{var wn;return[ee("img",{src:Gn(mh)((wn=E.value)==null?void 0:wn.icon),alt:""},null,8,Age)]}),_:1})):(Ne(),bt(Wt,{key:1,height:"32px"}))]),ee("h4",{class:"ellipsis",style:{"max-width":"270px"},title:(At=E.value)==null?void 0:At.name},_e(((Tt=E.value)==null?void 0:Tt.name)||$e.$t("views.application.form.appName.label")),9,Mge)]),ee("div",Tge,[k(Jt,{link:"",onClick:rt[5]||(rt[5]=wn=>S.value=!S.value)},{default:j(()=>[k(ae,{iconName:S.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1}),k(Jt,{link:"",onClick:rt[6]||(rt[6]=wn=>w.value=!1)},{default:j(()=>[k(it,{size:20,class:"color-secondary"},{default:j(()=>[k(zt)]),_:1})]),_:1})])])],2),ee("div",Cge,[k(Pn,{"application-details":E.value,type:"debug-ai-chat"},null,8,["application-details"])])],2)):Bn("",!0)]}),_:1}),$.value?Ql((Ne(),bt(pge,{key:0,onClick:G,onRefreshVersion:X},null,512)),[[qt,q]]):Bn("",!0)])),[[xn,b.value]])}}});export{qge as default};
|