vue-wiring-diagram 1.0.19 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,38 +3,38 @@
3
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
4
  //! license : MIT
5
5
  //! momentjs.com
6
- var md;function W(){return md.apply(null,arguments)}function c0(n){md=n}function qt(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Ds(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function we(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function xl(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;for(e in n)if(we(n,e))return!1;return!0}function bt(n){return n===void 0}function _n(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function hi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function yd(n,e){var t=[],s,r=n.length;for(s=0;s<r;++s)t.push(e(n[s],s));return t}function ss(n,e){for(var t in e)we(e,t)&&(n[t]=e[t]);return we(e,"toString")&&(n.toString=e.toString),we(e,"valueOf")&&(n.valueOf=e.valueOf),n}function pn(n,e,t,s){return Hd(n,e,t,s,!0).utc()}function u0(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function de(n){return n._pf==null&&(n._pf=u0()),n._pf}var vl;Array.prototype.some?vl=Array.prototype.some:vl=function(n){var e=Object(this),t=e.length>>>0,s;for(s=0;s<t;s++)if(s in e&&n.call(this,e[s],s,e))return!0;return!1};function Cl(n){var e=null,t=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(e=de(n),t=vl.call(e.parsedDateParts,function(r){return r!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),n._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=s;else return s;return n._isValid}function xo(n){var e=pn(NaN);return n!=null?ss(de(e),n):de(e).userInvalidated=!0,e}var bd=W.momentProperties=[],Sl=!1;function El(n,e){var t,s,r,i=bd.length;if(bt(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),bt(e._i)||(n._i=e._i),bt(e._f)||(n._f=e._f),bt(e._l)||(n._l=e._l),bt(e._strict)||(n._strict=e._strict),bt(e._tzm)||(n._tzm=e._tzm),bt(e._isUTC)||(n._isUTC=e._isUTC),bt(e._offset)||(n._offset=e._offset),bt(e._pf)||(n._pf=de(e)),bt(e._locale)||(n._locale=e._locale),i>0)for(t=0;t<i;t++)s=bd[t],r=e[s],bt(r)||(n[s]=r);return n}function fi(n){El(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Sl===!1&&(Sl=!0,W.updateOffset(this),Sl=!1)}function Jt(n){return n instanceof fi||n!=null&&n._isAMomentObject!=null}function wd(n){W.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function kt(n,e){var t=!0;return ss(function(){if(W.deprecationHandler!=null&&W.deprecationHandler(null,n),t){var s=[],r,i,o,a=arguments.length;for(i=0;i<a;i++){if(r="",typeof arguments[i]=="object"){r+=`
7
- [`+i+"] ";for(o in arguments[0])we(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];s.push(r)}wd(n+`
6
+ var Md;function W(){return Md.apply(null,arguments)}function v0(n){Md=n}function Xt(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Ts(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function xe(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ml(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;for(e in n)if(xe(n,e))return!1;return!0}function wt(n){return n===void 0}function kn(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function gi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Pd(n,e){var t=[],s,r=n.length;for(s=0;s<r;++s)t.push(e(n[s],s));return t}function ns(n,e){for(var t in e)xe(e,t)&&(n[t]=e[t]);return xe(e,"toString")&&(n.toString=e.toString),xe(e,"valueOf")&&(n.valueOf=e.valueOf),n}function mn(n,e,t,s){return eh(n,e,t,s,!0).utc()}function C0(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function de(n){return n._pf==null&&(n._pf=C0()),n._pf}var Pl;Array.prototype.some?Pl=Array.prototype.some:Pl=function(n){var e=Object(this),t=e.length>>>0,s;for(s=0;s<t;s++)if(s in e&&n.call(this,e[s],s,e))return!0;return!1};function Nl(n){var e=null,t=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(e=de(n),t=Pl.call(e.parsedDateParts,function(r){return r!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),n._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=s;else return s;return n._isValid}function So(n){var e=mn(NaN);return n!=null?ns(de(e),n):de(e).userInvalidated=!0,e}var Nd=W.momentProperties=[],Al=!1;function _l(n,e){var t,s,r,i=Nd.length;if(wt(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),wt(e._i)||(n._i=e._i),wt(e._f)||(n._f=e._f),wt(e._l)||(n._l=e._l),wt(e._strict)||(n._strict=e._strict),wt(e._tzm)||(n._tzm=e._tzm),wt(e._isUTC)||(n._isUTC=e._isUTC),wt(e._offset)||(n._offset=e._offset),wt(e._pf)||(n._pf=de(e)),wt(e._locale)||(n._locale=e._locale),i>0)for(t=0;t<i;t++)s=Nd[t],r=e[s],wt(r)||(n[s]=r);return n}function mi(n){_l(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Al===!1&&(Al=!0,W.updateOffset(this),Al=!1)}function Kt(n){return n instanceof mi||n!=null&&n._isAMomentObject!=null}function Ad(n){W.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function Vt(n,e){var t=!0;return ns(function(){if(W.deprecationHandler!=null&&W.deprecationHandler(null,n),t){var s=[],r,i,o,a=arguments.length;for(i=0;i<a;i++){if(r="",typeof arguments[i]=="object"){r+=`
7
+ [`+i+"] ";for(o in arguments[0])xe(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];s.push(r)}Ad(n+`
8
8
  Arguments: `+Array.prototype.slice.call(s).join("")+`
9
- `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var xd={};function vd(n,e){W.deprecationHandler!=null&&W.deprecationHandler(n,e),xd[n]||(wd(e),xd[n]=!0)}W.suppressDeprecationWarnings=!1,W.deprecationHandler=null;function gn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function d0(n){var e,t;for(t in n)we(n,t)&&(e=n[t],gn(e)?this[t]=e:this["_"+t]=e);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Ol(n,e){var t=ss({},n),s;for(s in e)we(e,s)&&(Ds(n[s])&&Ds(e[s])?(t[s]={},ss(t[s],n[s]),ss(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in n)we(n,s)&&!we(e,s)&&Ds(n[s])&&(t[s]=ss({},t[s]));return t}function Ml(n){n!=null&&this.set(n)}var Pl;Object.keys?Pl=Object.keys:Pl=function(n){var e,t=[];for(e in n)we(n,e)&&t.push(e);return t};var h0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function f0(n,e,t){var s=this._calendar[n]||this._calendar.sameElse;return gn(s)?s.call(e,t):s}function mn(n,e,t){var s=""+Math.abs(n),r=e-s.length,i=n>=0;return(i?t?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+s}var Al=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,vo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Nl={},rr={};function te(n,e,t,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(rr[n]=r),e&&(rr[e[0]]=function(){return mn(r.apply(this,arguments),e[1],e[2])}),t&&(rr[t]=function(){return this.localeData().ordinal(r.apply(this,arguments),n)})}function p0(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function g0(n){var e=n.match(Al),t,s;for(t=0,s=e.length;t<s;t++)rr[e[t]]?e[t]=rr[e[t]]:e[t]=p0(e[t]);return function(r){var i="",o;for(o=0;o<s;o++)i+=gn(e[o])?e[o].call(r,n):e[o];return i}}function Co(n,e){return n.isValid()?(e=Cd(e,n.localeData()),Nl[e]=Nl[e]||g0(e),Nl[e](n)):n.localeData().invalidDate()}function Cd(n,e){var t=5;function s(r){return e.longDateFormat(r)||r}for(vo.lastIndex=0;t>=0&&vo.test(n);)n=n.replace(vo,s),vo.lastIndex=0,t-=1;return n}var m0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function y0(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(Al).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var b0="Invalid date";function w0(){return this._invalidDate}var x0="%d",v0=/\d{1,2}/;function C0(n){return this._ordinal.replace("%d",n)}var S0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function E0(n,e,t,s){var r=this._relativeTime[t];return gn(r)?r(n,e,t,s):r.replace(/%d/i,n)}function O0(n,e){var t=this._relativeTime[n>0?"future":"past"];return gn(t)?t(e):t.replace(/%s/i,e)}var Sd={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Dt(n){return typeof n=="string"?Sd[n]||Sd[n.toLowerCase()]:void 0}function Tl(n){var e={},t,s;for(s in n)we(n,s)&&(t=Dt(s),t&&(e[t]=n[s]));return e}var M0={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function P0(n){var e=[],t;for(t in n)we(n,t)&&e.push({unit:t,priority:M0[t]});return e.sort(function(s,r){return s.priority-r.priority}),e}var Ed=/\d/,Pt=/\d\d/,Od=/\d{3}/,_l=/\d{4}/,So=/[+-]?\d{6}/,Me=/\d\d?/,Md=/\d\d\d\d?/,Pd=/\d\d\d\d\d\d?/,Eo=/\d{1,3}/,kl=/\d{1,4}/,Oo=/[+-]?\d{1,6}/,ir=/\d+/,Mo=/[+-]?\d+/,A0=/Z|[+-]\d\d:?\d\d/gi,Po=/Z|[+-]\d\d(?::?\d\d)?/gi,N0=/[+-]?\d+(\.\d{1,3})?/,pi=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,or=/^[1-9]\d?/,Dl=/^([1-9]\d|\d)/,Ao;Ao={};function X(n,e,t){Ao[n]=gn(e)?e:function(s,r){return s&&t?t:e}}function T0(n,e){return we(Ao,n)?Ao[n](e._strict,e._locale):new RegExp(_0(n))}function _0(n){return kn(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,r,i){return t||s||r||i}))}function kn(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Rt(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function ge(n){var e=+n,t=0;return e!==0&&isFinite(e)&&(t=Rt(e)),t}var Rl={};function Se(n,e){var t,s=e,r;for(typeof n=="string"&&(n=[n]),_n(e)&&(s=function(i,o){o[e]=ge(i)}),r=n.length,t=0;t<r;t++)Rl[n[t]]=s}function gi(n,e){Se(n,function(t,s,r,i){r._w=r._w||{},e(t,r._w,r,i)})}function k0(n,e,t){e!=null&&we(Rl,n)&&Rl[n](e,t._a,t,n)}function No(n){return n%4===0&&n%100!==0||n%400===0}var dt=0,Dn=1,yn=2,Ke=3,Xt=4,Rn=5,Rs=6,D0=7,R0=8;te("Y",0,0,function(){var n=this.year();return n<=9999?mn(n,4):"+"+n}),te(0,["YY",2],0,function(){return this.year()%100}),te(0,["YYYY",4],0,"year"),te(0,["YYYYY",5],0,"year"),te(0,["YYYYYY",6,!0],0,"year"),X("Y",Mo),X("YY",Me,Pt),X("YYYY",kl,_l),X("YYYYY",Oo,So),X("YYYYYY",Oo,So),Se(["YYYYY","YYYYYY"],dt),Se("YYYY",function(n,e){e[dt]=n.length===2?W.parseTwoDigitYear(n):ge(n)}),Se("YY",function(n,e){e[dt]=W.parseTwoDigitYear(n)}),Se("Y",function(n,e){e[dt]=parseInt(n,10)});function mi(n){return No(n)?366:365}W.parseTwoDigitYear=function(n){return ge(n)+(ge(n)>68?1900:2e3)};var Ad=ar("FullYear",!0);function L0(){return No(this.year())}function ar(n,e){return function(t){return t!=null?(Nd(this,n,t),W.updateOffset(this,e),this):yi(this,n)}}function yi(n,e){if(!n.isValid())return NaN;var t=n._d,s=n._isUTC;switch(e){case"Milliseconds":return s?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return s?t.getUTCSeconds():t.getSeconds();case"Minutes":return s?t.getUTCMinutes():t.getMinutes();case"Hours":return s?t.getUTCHours():t.getHours();case"Date":return s?t.getUTCDate():t.getDate();case"Day":return s?t.getUTCDay():t.getDay();case"Month":return s?t.getUTCMonth():t.getMonth();case"FullYear":return s?t.getUTCFullYear():t.getFullYear();default:return NaN}}function Nd(n,e,t){var s,r,i,o,a;if(!(!n.isValid()||isNaN(t))){switch(s=n._d,r=n._isUTC,e){case"Milliseconds":return void(r?s.setUTCMilliseconds(t):s.setMilliseconds(t));case"Seconds":return void(r?s.setUTCSeconds(t):s.setSeconds(t));case"Minutes":return void(r?s.setUTCMinutes(t):s.setMinutes(t));case"Hours":return void(r?s.setUTCHours(t):s.setHours(t));case"Date":return void(r?s.setUTCDate(t):s.setDate(t));case"FullYear":break;default:return}i=t,o=n.month(),a=n.date(),a=a===29&&o===1&&!No(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function I0(n){return n=Dt(n),gn(this[n])?this[n]():this}function V0(n,e){if(typeof n=="object"){n=Tl(n);var t=P0(n),s,r=t.length;for(s=0;s<r;s++)this[t[s].unit](n[t[s].unit])}else if(n=Dt(n),gn(this[n]))return this[n](e);return this}function B0(n,e){return(n%e+e)%e}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function Ll(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=B0(e,12);return n+=(e-t)/12,t===1?No(n)?29:28:31-t%7%2}te("M",["MM",2],"Mo",function(){return this.month()+1}),te("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),te("MMMM",0,0,function(n){return this.localeData().months(this,n)}),X("M",Me,or),X("MM",Me,Pt),X("MMM",function(n,e){return e.monthsShortRegex(n)}),X("MMMM",function(n,e){return e.monthsRegex(n)}),Se(["M","MM"],function(n,e){e[Dn]=ge(n)-1}),Se(["MMM","MMMM"],function(n,e,t,s){var r=t._locale.monthsParse(n,s,t._strict);r!=null?e[Dn]=r:de(t).invalidMonth=n});var j0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Td="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),_d=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,$0=pi,z0=pi;function F0(n,e){return n?qt(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||_d).test(e)?"format":"standalone"][n.month()]:qt(this._months)?this._months:this._months.standalone}function U0(n,e){return n?qt(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[_d.test(e)?"format":"standalone"][n.month()]:qt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function H0(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)i=pn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return t?e==="MMM"?(r=je.call(this._shortMonthsParse,o),r!==-1?r:null):(r=je.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=je.call(this._shortMonthsParse,o),r!==-1?r:(r=je.call(this._longMonthsParse,o),r!==-1?r:null)):(r=je.call(this._longMonthsParse,o),r!==-1?r:(r=je.call(this._shortMonthsParse,o),r!==-1?r:null))}function G0(n,e,t){var s,r,i;if(this._monthsParseExact)return H0.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=pn([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!t&&!this._monthsParse[s]&&(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[s].test(n))return s;if(t&&e==="MMM"&&this._shortMonthsParse[s].test(n))return s;if(!t&&this._monthsParse[s].test(n))return s}}function kd(n,e){if(!n.isValid())return n;if(typeof e=="string"){if(/^\d+$/.test(e))e=ge(e);else if(e=n.localeData().monthsParse(e),!_n(e))return n}var t=e,s=n.date();return s=s<29?s:Math.min(s,Ll(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,s):n._d.setMonth(t,s),n}function Dd(n){return n!=null?(kd(this,n),W.updateOffset(this,!0),this):yi(this,"Month")}function Y0(){return Ll(this.year(),this.month())}function W0(n){return this._monthsParseExact?(we(this,"_monthsRegex")||Rd.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(we(this,"_monthsShortRegex")||(this._monthsShortRegex=$0),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function q0(n){return this._monthsParseExact?(we(this,"_monthsRegex")||Rd.call(this),n?this._monthsStrictRegex:this._monthsRegex):(we(this,"_monthsRegex")||(this._monthsRegex=z0),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Rd(){function n(c,u){return u.length-c.length}var e=[],t=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=pn([2e3,r]),o=kn(this.monthsShort(i,"")),a=kn(this.months(i,"")),e.push(o),t.push(a),s.push(a),s.push(o);e.sort(n),t.sort(n),s.sort(n),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function J0(n,e,t,s,r,i,o){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,s,r,i,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,s,r,i,o),a}function bi(n){var e,t;return n<100&&n>=0?(t=Array.prototype.slice.call(arguments),t[0]=n+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(n)):e=new Date(Date.UTC.apply(null,arguments)),e}function To(n,e,t){var s=7+e-t,r=(7+bi(n,0,s).getUTCDay()-e)%7;return-r+s-1}function Ld(n,e,t,s,r){var i=(7+t-s)%7,o=To(n,s,r),a=1+7*(e-1)+i+o,c,u;return a<=0?(c=n-1,u=mi(c)+a):a>mi(n)?(c=n+1,u=a-mi(n)):(c=n,u=a),{year:c,dayOfYear:u}}function wi(n,e,t){var s=To(n.year(),e,t),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+Ln(o,e,t)):r>Ln(n.year(),e,t)?(i=r-Ln(n.year(),e,t),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function Ln(n,e,t){var s=To(n,e,t),r=To(n+1,e,t);return(mi(n)-s+r)/7}te("w",["ww",2],"wo","week"),te("W",["WW",2],"Wo","isoWeek"),X("w",Me,or),X("ww",Me,Pt),X("W",Me,or),X("WW",Me,Pt),gi(["w","ww","W","WW"],function(n,e,t,s){e[s.substr(0,1)]=ge(n)});function X0(n){return wi(n,this._week.dow,this._week.doy).week}var K0={dow:0,doy:6};function Z0(){return this._week.dow}function Q0(){return this._week.doy}function ew(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function tw(n){var e=wi(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}te("d",0,"do","day"),te("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),te("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),te("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),te("e",0,0,"weekday"),te("E",0,0,"isoWeekday"),X("d",Me),X("e",Me),X("E",Me),X("dd",function(n,e){return e.weekdaysMinRegex(n)}),X("ddd",function(n,e){return e.weekdaysShortRegex(n)}),X("dddd",function(n,e){return e.weekdaysRegex(n)}),gi(["dd","ddd","dddd"],function(n,e,t,s){var r=t._locale.weekdaysParse(n,s,t._strict);r!=null?e.d=r:de(t).invalidWeekday=n}),gi(["d","e","E"],function(n,e,t,s){e[s]=ge(n)});function nw(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function sw(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Il(n,e){return n.slice(e,7).concat(n.slice(0,e))}var rw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Id="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),iw="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ow=pi,aw=pi,lw=pi;function cw(n,e){var t=qt(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?Il(t,this._week.dow):n?t[n.day()]:t}function uw(n){return n===!0?Il(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function dw(n){return n===!0?Il(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function hw(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=pn([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(i,"").toLocaleLowerCase();return t?e==="dddd"?(r=je.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=je.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=je.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=je.call(this._weekdaysParse,o),r!==-1||(r=je.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=je.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=je.call(this._shortWeekdaysParse,o),r!==-1||(r=je.call(this._weekdaysParse,o),r!==-1)?r:(r=je.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=je.call(this._minWeekdaysParse,o),r!==-1||(r=je.call(this._weekdaysParse,o),r!==-1)?r:(r=je.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function fw(n,e,t){var s,r,i;if(this._weekdaysParseExact)return hw.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=pn([2e3,1]).day(s),t&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[s].test(n))return s;if(t&&e==="ddd"&&this._shortWeekdaysParse[s].test(n))return s;if(t&&e==="dd"&&this._minWeekdaysParse[s].test(n))return s;if(!t&&this._weekdaysParse[s].test(n))return s}}function pw(n){if(!this.isValid())return n!=null?this:NaN;var e=yi(this,"Day");return n!=null?(n=nw(n,this.localeData()),this.add(n-e,"d")):e}function gw(n){if(!this.isValid())return n!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return n==null?e:this.add(n-e,"d")}function mw(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=sw(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function yw(n){return this._weekdaysParseExact?(we(this,"_weekdaysRegex")||Vl.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(we(this,"_weekdaysRegex")||(this._weekdaysRegex=ow),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function bw(n){return this._weekdaysParseExact?(we(this,"_weekdaysRegex")||Vl.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(we(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=aw),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ww(n){return this._weekdaysParseExact?(we(this,"_weekdaysRegex")||Vl.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(we(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=lw),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vl(){function n(d,h){return h.length-d.length}var e=[],t=[],s=[],r=[],i,o,a,c,u;for(i=0;i<7;i++)o=pn([2e3,1]).day(i),a=kn(this.weekdaysMin(o,"")),c=kn(this.weekdaysShort(o,"")),u=kn(this.weekdays(o,"")),e.push(a),t.push(c),s.push(u),r.push(a),r.push(c),r.push(u);e.sort(n),t.sort(n),s.sort(n),r.sort(n),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Bl(){return this.hours()%12||12}function xw(){return this.hours()||24}te("H",["HH",2],0,"hour"),te("h",["hh",2],0,Bl),te("k",["kk",2],0,xw),te("hmm",0,0,function(){return""+Bl.apply(this)+mn(this.minutes(),2)}),te("hmmss",0,0,function(){return""+Bl.apply(this)+mn(this.minutes(),2)+mn(this.seconds(),2)}),te("Hmm",0,0,function(){return""+this.hours()+mn(this.minutes(),2)}),te("Hmmss",0,0,function(){return""+this.hours()+mn(this.minutes(),2)+mn(this.seconds(),2)});function Vd(n,e){te(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Vd("a",!0),Vd("A",!1);function Bd(n,e){return e._meridiemParse}X("a",Bd),X("A",Bd),X("H",Me,Dl),X("h",Me,or),X("k",Me,or),X("HH",Me,Pt),X("hh",Me,Pt),X("kk",Me,Pt),X("hmm",Md),X("hmmss",Pd),X("Hmm",Md),X("Hmmss",Pd),Se(["H","HH"],Ke),Se(["k","kk"],function(n,e,t){var s=ge(n);e[Ke]=s===24?0:s}),Se(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n}),Se(["h","hh"],function(n,e,t){e[Ke]=ge(n),de(t).bigHour=!0}),Se("hmm",function(n,e,t){var s=n.length-2;e[Ke]=ge(n.substr(0,s)),e[Xt]=ge(n.substr(s)),de(t).bigHour=!0}),Se("hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Ke]=ge(n.substr(0,s)),e[Xt]=ge(n.substr(s,2)),e[Rn]=ge(n.substr(r)),de(t).bigHour=!0}),Se("Hmm",function(n,e,t){var s=n.length-2;e[Ke]=ge(n.substr(0,s)),e[Xt]=ge(n.substr(s))}),Se("Hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Ke]=ge(n.substr(0,s)),e[Xt]=ge(n.substr(s,2)),e[Rn]=ge(n.substr(r))});function vw(n){return(n+"").toLowerCase().charAt(0)==="p"}var Cw=/[ap]\.?m?\.?/i,Sw=ar("Hours",!0);function Ew(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var jd={calendar:h0,longDateFormat:m0,invalidDate:b0,ordinal:x0,dayOfMonthOrdinalParse:v0,relativeTime:S0,months:j0,monthsShort:Td,week:K0,weekdays:rw,weekdaysMin:iw,weekdaysShort:Id,meridiemParse:Cw},ke={},xi={},vi;function Ow(n,e){var t,s=Math.min(n.length,e.length);for(t=0;t<s;t+=1)if(n[t]!==e[t])return t;return s}function $d(n){return n&&n.toLowerCase().replace("_","-")}function Mw(n){for(var e=0,t,s,r,i;e<n.length;){for(i=$d(n[e]).split("-"),t=i.length,s=$d(n[e+1]),s=s?s.split("-"):null;t>0;){if(r=_o(i.slice(0,t).join("-")),r)return r;if(s&&s.length>=t&&Ow(i,s)>=t-1)break;t--}e++}return vi}function Pw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function _o(n){var e=null,t;if(ke[n]===void 0&&typeof module<"u"&&module&&module.exports&&Pw(n))try{e=vi._abbr,t=require,t("./locale/"+n),rs(e)}catch{ke[n]=null}return ke[n]}function rs(n,e){var t;return n&&(bt(e)?t=In(n):t=jl(n,e),t?vi=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),vi._abbr}function jl(n,e){if(e!==null){var t,s=jd;if(e.abbr=n,ke[n]!=null)vd("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=ke[n]._config;else if(e.parentLocale!=null)if(ke[e.parentLocale]!=null)s=ke[e.parentLocale]._config;else if(t=_o(e.parentLocale),t!=null)s=t._config;else return xi[e.parentLocale]||(xi[e.parentLocale]=[]),xi[e.parentLocale].push({name:n,config:e}),null;return ke[n]=new Ml(Ol(s,e)),xi[n]&&xi[n].forEach(function(r){jl(r.name,r.config)}),rs(n),ke[n]}else return delete ke[n],null}function Aw(n,e){if(e!=null){var t,s,r=jd;ke[n]!=null&&ke[n].parentLocale!=null?ke[n].set(Ol(ke[n]._config,e)):(s=_o(n),s!=null&&(r=s._config),e=Ol(r,e),s==null&&(e.abbr=n),t=new Ml(e),t.parentLocale=ke[n],ke[n]=t),rs(n)}else ke[n]!=null&&(ke[n].parentLocale!=null?(ke[n]=ke[n].parentLocale,n===rs()&&rs(n)):ke[n]!=null&&delete ke[n]);return ke[n]}function In(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return vi;if(!qt(n)){if(e=_o(n),e)return e;n=[n]}return Mw(n)}function Nw(){return Pl(ke)}function $l(n){var e,t=n._a;return t&&de(n).overflow===-2&&(e=t[Dn]<0||t[Dn]>11?Dn:t[yn]<1||t[yn]>Ll(t[dt],t[Dn])?yn:t[Ke]<0||t[Ke]>24||t[Ke]===24&&(t[Xt]!==0||t[Rn]!==0||t[Rs]!==0)?Ke:t[Xt]<0||t[Xt]>59?Xt:t[Rn]<0||t[Rn]>59?Rn:t[Rs]<0||t[Rs]>999?Rs:-1,de(n)._overflowDayOfYear&&(e<dt||e>yn)&&(e=yn),de(n)._overflowWeeks&&e===-1&&(e=D0),de(n)._overflowWeekday&&e===-1&&(e=R0),de(n).overflow=e),n}var Tw=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_w=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kw=/Z|[+-]\d\d(?::?\d\d)?/,ko=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],zl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Dw=/^\/?Date\((-?\d+)/i,Rw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Lw={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function zd(n){var e,t,s=n._i,r=Tw.exec(s)||_w.exec(s),i,o,a,c,u=ko.length,d=zl.length;if(r){for(de(n).iso=!0,e=0,t=u;e<t;e++)if(ko[e][1].exec(r[1])){o=ko[e][0],i=ko[e][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(e=0,t=d;e<t;e++)if(zl[e][1].exec(r[3])){a=(r[2]||" ")+zl[e][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(kw.exec(r[4]))c="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(c||""),Ul(n)}else n._isValid=!1}function Iw(n,e,t,s,r,i){var o=[Vw(n),Td.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Vw(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Bw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function jw(n,e,t){if(n){var s=Id.indexOf(n),r=new Date(e[0],e[1],e[2]).getDay();if(s!==r)return de(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function $w(n,e,t){if(n)return Lw[n];if(e)return 0;var s=parseInt(t,10),r=s%100,i=(s-r)/100;return i*60+r}function Fd(n){var e=Rw.exec(Bw(n._i)),t;if(e){if(t=Iw(e[4],e[3],e[2],e[5],e[6],e[7]),!jw(e[1],t,n))return;n._a=t,n._tzm=$w(e[8],e[9],e[10]),n._d=bi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),de(n).rfc2822=!0}else n._isValid=!1}function zw(n){var e=Dw.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(zd(n),n._isValid===!1)delete n._isValid;else return;if(Fd(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:W.createFromInputFallback(n)}W.createFromInputFallback=kt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function lr(n,e,t){return n??e??t}function Fw(n){var e=new Date(W.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Fl(n){var e,t,s=[],r,i,o;if(!n._d){for(r=Fw(n),n._w&&n._a[yn]==null&&n._a[Dn]==null&&Uw(n),n._dayOfYear!=null&&(o=lr(n._a[dt],r[dt]),(n._dayOfYear>mi(o)||n._dayOfYear===0)&&(de(n)._overflowDayOfYear=!0),t=bi(o,0,n._dayOfYear),n._a[Dn]=t.getUTCMonth(),n._a[yn]=t.getUTCDate()),e=0;e<3&&n._a[e]==null;++e)n._a[e]=s[e]=r[e];for(;e<7;e++)n._a[e]=s[e]=n._a[e]==null?e===2?1:0:n._a[e];n._a[Ke]===24&&n._a[Xt]===0&&n._a[Rn]===0&&n._a[Rs]===0&&(n._nextDay=!0,n._a[Ke]=0),n._d=(n._useUTC?bi:J0).apply(null,s),i=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[Ke]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(de(n).weekdayMismatch=!0)}}function Uw(n){var e,t,s,r,i,o,a,c,u;e=n._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,o=4,t=lr(e.GG,n._a[dt],wi(Pe(),1,4).year),s=lr(e.W,1),r=lr(e.E,1),(r<1||r>7)&&(c=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=wi(Pe(),i,o),t=lr(e.gg,n._a[dt],u.year),s=lr(e.w,u.week),e.d!=null?(r=e.d,(r<0||r>6)&&(c=!0)):e.e!=null?(r=e.e+i,(e.e<0||e.e>6)&&(c=!0)):r=i),s<1||s>Ln(t,i,o)?de(n)._overflowWeeks=!0:c!=null?de(n)._overflowWeekday=!0:(a=Ld(t,s,r,i,o),n._a[dt]=a.year,n._dayOfYear=a.dayOfYear)}W.ISO_8601=function(){},W.RFC_2822=function(){};function Ul(n){if(n._f===W.ISO_8601){zd(n);return}if(n._f===W.RFC_2822){Fd(n);return}n._a=[],de(n).empty=!0;var e=""+n._i,t,s,r,i,o,a=e.length,c=0,u,d;for(r=Cd(n._f,n._locale).match(Al)||[],d=r.length,t=0;t<d;t++)i=r[t],s=(e.match(T0(i,n))||[])[0],s&&(o=e.substr(0,e.indexOf(s)),o.length>0&&de(n).unusedInput.push(o),e=e.slice(e.indexOf(s)+s.length),c+=s.length),rr[i]?(s?de(n).empty=!1:de(n).unusedTokens.push(i),k0(i,s,n)):n._strict&&!s&&de(n).unusedTokens.push(i);de(n).charsLeftOver=a-c,e.length>0&&de(n).unusedInput.push(e),n._a[Ke]<=12&&de(n).bigHour===!0&&n._a[Ke]>0&&(de(n).bigHour=void 0),de(n).parsedDateParts=n._a.slice(0),de(n).meridiem=n._meridiem,n._a[Ke]=Hw(n._locale,n._a[Ke],n._meridiem),u=de(n).era,u!==null&&(n._a[dt]=n._locale.erasConvertYear(u,n._a[dt])),Fl(n),$l(n)}function Hw(n,e,t){var s;return t==null?e:n.meridiemHour!=null?n.meridiemHour(e,t):(n.isPM!=null&&(s=n.isPM(t),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function Gw(n){var e,t,s,r,i,o,a=!1,c=n._f.length;if(c===0){de(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<c;r++)i=0,o=!1,e=El({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[r],Ul(e),Cl(e)&&(o=!0),i+=de(e).charsLeftOver,i+=de(e).unusedTokens.length*10,de(e).score=i,a?i<s&&(s=i,t=e):(s==null||i<s||o)&&(s=i,t=e,o&&(a=!0));ss(n,t||e)}function Yw(n){if(!n._d){var e=Tl(n._i),t=e.day===void 0?e.date:e.day;n._a=yd([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),Fl(n)}}function Ww(n){var e=new fi($l(Ud(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ud(n){var e=n._i,t=n._f;return n._locale=n._locale||In(n._l),e===null||t===void 0&&e===""?xo({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),Jt(e)?new fi($l(e)):(hi(e)?n._d=e:qt(t)?Gw(n):t?Ul(n):qw(n),Cl(n)||(n._d=null),n))}function qw(n){var e=n._i;bt(e)?n._d=new Date(W.now()):hi(e)?n._d=new Date(e.valueOf()):typeof e=="string"?zw(n):qt(e)?(n._a=yd(e.slice(0),function(t){return parseInt(t,10)}),Fl(n)):Ds(e)?Yw(n):_n(e)?n._d=new Date(e):W.createFromInputFallback(n)}function Hd(n,e,t,s,r){var i={};return(e===!0||e===!1)&&(s=e,e=void 0),(t===!0||t===!1)&&(s=t,t=void 0),(Ds(n)&&xl(n)||qt(n)&&n.length===0)&&(n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=t,i._i=n,i._f=e,i._strict=s,Ww(i)}function Pe(n,e,t,s){return Hd(n,e,t,s,!1)}var Jw=kt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Pe.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:xo()}),Xw=kt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Pe.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:xo()});function Gd(n,e){var t,s;if(e.length===1&&qt(e[0])&&(e=e[0]),!e.length)return Pe();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][n](t))&&(t=e[s]);return t}function Kw(){var n=[].slice.call(arguments,0);return Gd("isBefore",n)}function Zw(){var n=[].slice.call(arguments,0);return Gd("isAfter",n)}var Qw=function(){return Date.now?Date.now():+new Date},Ci=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ex(n){var e,t=!1,s,r=Ci.length;for(e in n)if(we(n,e)&&!(je.call(Ci,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(s=0;s<r;++s)if(n[Ci[s]]){if(t)return!1;parseFloat(n[Ci[s]])!==ge(n[Ci[s]])&&(t=!0)}return!0}function tx(){return this._isValid}function nx(){return Kt(NaN)}function Do(n){var e=Tl(n),t=e.year||0,s=e.quarter||0,r=e.month||0,i=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,c=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=ex(e),this._milliseconds=+d+u*1e3+c*6e4+a*1e3*60*60,this._days=+o+i*7,this._months=+r+s*3+t*12,this._data={},this._locale=In(),this._bubble()}function Ro(n){return n instanceof Do}function Hl(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function sx(n,e,t){var s=Math.min(n.length,e.length),r=Math.abs(n.length-e.length),i=0,o;for(o=0;o<s;o++)ge(n[o])!==ge(e[o])&&i++;return i+r}function Yd(n,e){te(n,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+mn(~~(t/60),2)+e+mn(~~t%60,2)})}Yd("Z",":"),Yd("ZZ",""),X("Z",Po),X("ZZ",Po),Se(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=Gl(Po,n)});var rx=/([\+\-]|\d\d)/gi;function Gl(n,e){var t=(e||"").match(n),s,r,i;return t===null?null:(s=t[t.length-1]||[],r=(s+"").match(rx)||["-",0,0],i=+(r[1]*60)+ge(r[2]),i===0?0:r[0]==="+"?i:-i)}function Yl(n,e){var t,s;return e._isUTC?(t=e.clone(),s=(Jt(n)||hi(n)?n.valueOf():Pe(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),W.updateOffset(t,!1),t):Pe(n).local()}function Wl(n){return-Math.round(n._d.getTimezoneOffset())}W.updateOffset=function(){};function ix(n,e,t){var s=this._offset||0,r;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=Gl(Po,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(r=Wl(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!e||this._changeInProgress?Xd(this,Kt(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,W.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Wl(this)}function ox(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function ax(n){return this.utcOffset(0,n)}function lx(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(Wl(this),"m")),this}function cx(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=Gl(A0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function ux(n){return this.isValid()?(n=n?Pe(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function dx(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function hx(){if(!bt(this._isDSTShifted))return this._isDSTShifted;var n={},e;return El(n,this),n=Ud(n),n._a?(e=n._isUTC?pn(n._a):Pe(n._a),this._isDSTShifted=this.isValid()&&sx(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function fx(){return this.isValid()?!this._isUTC:!1}function px(){return this.isValid()?this._isUTC:!1}function Wd(){return this.isValid()?this._isUTC&&this._offset===0:!1}var gx=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,mx=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Kt(n,e){var t=n,s=null,r,i,o;return Ro(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:_n(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(s=gx.exec(n))?(r=s[1]==="-"?-1:1,t={y:0,d:ge(s[yn])*r,h:ge(s[Ke])*r,m:ge(s[Xt])*r,s:ge(s[Rn])*r,ms:ge(Hl(s[Rs]*1e3))*r}):(s=mx.exec(n))?(r=s[1]==="-"?-1:1,t={y:Ls(s[2],r),M:Ls(s[3],r),w:Ls(s[4],r),d:Ls(s[5],r),h:Ls(s[6],r),m:Ls(s[7],r),s:Ls(s[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(o=yx(Pe(t.from),Pe(t.to)),t={},t.ms=o.milliseconds,t.M=o.months),i=new Do(t),Ro(n)&&we(n,"_locale")&&(i._locale=n._locale),Ro(n)&&we(n,"_isValid")&&(i._isValid=n._isValid),i}Kt.fn=Do.prototype,Kt.invalid=nx;function Ls(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function qd(n,e){var t={};return t.months=e.month()-n.month()+(e.year()-n.year())*12,n.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+n.clone().add(t.months,"M"),t}function yx(n,e){var t;return n.isValid()&&e.isValid()?(e=Yl(e,n),n.isBefore(e)?t=qd(n,e):(t=qd(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function Jd(n,e){return function(t,s){var r,i;return s!==null&&!isNaN(+s)&&(vd(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=t,t=s,s=i),r=Kt(t,s),Xd(this,r,n),this}}function Xd(n,e,t,s){var r=e._milliseconds,i=Hl(e._days),o=Hl(e._months);n.isValid()&&(s=s??!0,o&&kd(n,yi(n,"Month")+o*t),i&&Nd(n,"Date",yi(n,"Date")+i*t),r&&n._d.setTime(n._d.valueOf()+r*t),s&&W.updateOffset(n,i||o))}var bx=Jd(1,"add"),wx=Jd(-1,"subtract");function Kd(n){return typeof n=="string"||n instanceof String}function xx(n){return Jt(n)||hi(n)||Kd(n)||_n(n)||Cx(n)||vx(n)||n===null||n===void 0}function vx(n){var e=Ds(n)&&!xl(n),t=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,i,o=s.length;for(r=0;r<o;r+=1)i=s[r],t=t||we(n,i);return e&&t}function Cx(n){var e=qt(n),t=!1;return e&&(t=n.filter(function(s){return!_n(s)&&Kd(n)}).length===0),e&&t}function Sx(n){var e=Ds(n)&&!xl(n),t=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,i;for(r=0;r<s.length;r+=1)i=s[r],t=t||we(n,i);return e&&t}function Ex(n,e){var t=n.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function Ox(n,e){arguments.length===1&&(arguments[0]?xx(arguments[0])?(n=arguments[0],e=void 0):Sx(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||Pe(),s=Yl(t,this).startOf("day"),r=W.calendarFormat(this,s)||"sameElse",i=e&&(gn(e[r])?e[r].call(this,t):e[r]);return this.format(i||this.localeData().calendar(r,this,Pe(t)))}function Mx(){return new fi(this)}function Px(n,e){var t=Jt(n)?n:Pe(n);return this.isValid()&&t.isValid()?(e=Dt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function Ax(n,e){var t=Jt(n)?n:Pe(n);return this.isValid()&&t.isValid()?(e=Dt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function Nx(n,e,t,s){var r=Jt(n)?n:Pe(n),i=Jt(e)?e:Pe(e);return this.isValid()&&r.isValid()&&i.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(r,t):!this.isBefore(r,t))&&(s[1]===")"?this.isBefore(i,t):!this.isAfter(i,t))):!1}function Tx(n,e){var t=Jt(n)?n:Pe(n),s;return this.isValid()&&t.isValid()?(e=Dt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(s=t.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function _x(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function kx(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function Dx(n,e,t){var s,r,i;if(!this.isValid())return NaN;if(s=Yl(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,e=Dt(e),e){case"year":i=Lo(this,s)/12;break;case"month":i=Lo(this,s);break;case"quarter":i=Lo(this,s)/3;break;case"second":i=(this-s)/1e3;break;case"minute":i=(this-s)/6e4;break;case"hour":i=(this-s)/36e5;break;case"day":i=(this-s-r)/864e5;break;case"week":i=(this-s-r)/6048e5;break;default:i=this-s}return t?i:Rt(i)}function Lo(n,e){if(n.date()<e.date())return-Lo(e,n);var t=(e.year()-n.year())*12+(e.month()-n.month()),s=n.clone().add(t,"months"),r,i;return e-s<0?(r=n.clone().add(t-1,"months"),i=(e-s)/(s-r)):(r=n.clone().add(t+1,"months"),i=(e-s)/(r-s)),-(t+i)||0}W.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",W.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Rx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Lx(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?Co(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):gn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Co(t,"Z")):Co(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ix(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",e="",t,s,r,i;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+n+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(t+s+r+i)}function Vx(n){n||(n=this.isUtc()?W.defaultFormatUtc:W.defaultFormat);var e=Co(this,n);return this.localeData().postformat(e)}function Bx(n,e){return this.isValid()&&(Jt(n)&&n.isValid()||Pe(n).isValid())?Kt({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function jx(n){return this.from(Pe(),n)}function $x(n,e){return this.isValid()&&(Jt(n)&&n.isValid()||Pe(n).isValid())?Kt({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function zx(n){return this.to(Pe(),n)}function Zd(n){var e;return n===void 0?this._locale._abbr:(e=In(n),e!=null&&(this._locale=e),this)}var Qd=kt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function eh(){return this._locale}var Io=1e3,cr=60*Io,Vo=60*cr,th=(365*400+97)*24*Vo;function ur(n,e){return(n%e+e)%e}function nh(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-th:new Date(n,e,t).valueOf()}function sh(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-th:Date.UTC(n,e,t)}function Fx(n){var e,t;if(n=Dt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?sh:nh,n){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=ur(e+(this._isUTC?0:this.utcOffset()*cr),Vo);break;case"minute":e=this._d.valueOf(),e-=ur(e,cr);break;case"second":e=this._d.valueOf(),e-=ur(e,Io);break}return this._d.setTime(e),W.updateOffset(this,!0),this}function Ux(n){var e,t;if(n=Dt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?sh:nh,n){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Vo-ur(e+(this._isUTC?0:this.utcOffset()*cr),Vo)-1;break;case"minute":e=this._d.valueOf(),e+=cr-ur(e,cr)-1;break;case"second":e=this._d.valueOf(),e+=Io-ur(e,Io)-1;break}return this._d.setTime(e),W.updateOffset(this,!0),this}function Hx(){return this._d.valueOf()-(this._offset||0)*6e4}function Gx(){return Math.floor(this.valueOf()/1e3)}function Yx(){return new Date(this.valueOf())}function Wx(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function qx(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function Jx(){return this.isValid()?this.toISOString():null}function Xx(){return Cl(this)}function Kx(){return ss({},de(this))}function Zx(){return de(this).overflow}function Qx(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}te("N",0,0,"eraAbbr"),te("NN",0,0,"eraAbbr"),te("NNN",0,0,"eraAbbr"),te("NNNN",0,0,"eraName"),te("NNNNN",0,0,"eraNarrow"),te("y",["y",1],"yo","eraYear"),te("y",["yy",2],0,"eraYear"),te("y",["yyy",3],0,"eraYear"),te("y",["yyyy",4],0,"eraYear"),X("N",ql),X("NN",ql),X("NNN",ql),X("NNNN",u1),X("NNNNN",d1),Se(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,s){var r=t._locale.erasParse(n,s,t._strict);r?de(t).era=r:de(t).invalidEra=n}),X("y",ir),X("yy",ir),X("yyy",ir),X("yyyy",ir),X("yo",h1),Se(["y","yy","yyy","yyyy"],dt),Se(["yo"],function(n,e,t,s){var r;t._locale._eraYearOrdinalRegex&&(r=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[dt]=t._locale.eraYearOrdinalParse(n,r):e[dt]=parseInt(n,10)});function e1(n,e){var t,s,r,i=this._eras||In("en")._eras;for(t=0,s=i.length;t<s;++t){switch(typeof i[t].since){case"string":r=W(i[t].since).startOf("day"),i[t].since=r.valueOf();break}switch(typeof i[t].until){case"undefined":i[t].until=1/0;break;case"string":r=W(i[t].until).startOf("day").valueOf(),i[t].until=r.valueOf();break}}return i}function t1(n,e,t){var s,r,i=this.eras(),o,a,c;for(n=n.toUpperCase(),s=0,r=i.length;s<r;++s)if(o=i[s].name.toUpperCase(),a=i[s].abbr.toUpperCase(),c=i[s].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(a===n)return i[s];break;case"NNNN":if(o===n)return i[s];break;case"NNNNN":if(c===n)return i[s];break}else if([o,a,c].indexOf(n)>=0)return i[s]}function n1(n,e){var t=n.since<=n.until?1:-1;return e===void 0?W(n.since).year():W(n.since).year()+(e-n.offset)*t}function s1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].name;return""}function r1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].narrow;return""}function i1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].abbr;return""}function o1(){var n,e,t,s,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=r[n].since<=r[n].until?1:-1,s=this.clone().startOf("day").valueOf(),r[n].since<=s&&s<=r[n].until||r[n].until<=s&&s<=r[n].since)return(this.year()-W(r[n].since).year())*t+r[n].offset;return this.year()}function a1(n){return we(this,"_erasNameRegex")||Jl.call(this),n?this._erasNameRegex:this._erasRegex}function l1(n){return we(this,"_erasAbbrRegex")||Jl.call(this),n?this._erasAbbrRegex:this._erasRegex}function c1(n){return we(this,"_erasNarrowRegex")||Jl.call(this),n?this._erasNarrowRegex:this._erasRegex}function ql(n,e){return e.erasAbbrRegex(n)}function u1(n,e){return e.erasNameRegex(n)}function d1(n,e){return e.erasNarrowRegex(n)}function h1(n,e){return e._eraYearOrdinalRegex||ir}function Jl(){var n=[],e=[],t=[],s=[],r,i,o,a,c,u=this.eras();for(r=0,i=u.length;r<i;++r)o=kn(u[r].name),a=kn(u[r].abbr),c=kn(u[r].narrow),e.push(o),n.push(a),t.push(c),s.push(o),s.push(a),s.push(c);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}te(0,["gg",2],0,function(){return this.weekYear()%100}),te(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Bo(n,e){te(0,[n,n.length],0,e)}Bo("gggg","weekYear"),Bo("ggggg","weekYear"),Bo("GGGG","isoWeekYear"),Bo("GGGGG","isoWeekYear"),X("G",Mo),X("g",Mo),X("GG",Me,Pt),X("gg",Me,Pt),X("GGGG",kl,_l),X("gggg",kl,_l),X("GGGGG",Oo,So),X("ggggg",Oo,So),gi(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,s){e[s.substr(0,2)]=ge(n)}),gi(["gg","GG"],function(n,e,t,s){e[s]=W.parseTwoDigitYear(n)});function f1(n){return rh.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function p1(n){return rh.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function g1(){return Ln(this.year(),1,4)}function m1(){return Ln(this.isoWeekYear(),1,4)}function y1(){var n=this.localeData()._week;return Ln(this.year(),n.dow,n.doy)}function b1(){var n=this.localeData()._week;return Ln(this.weekYear(),n.dow,n.doy)}function rh(n,e,t,s,r){var i;return n==null?wi(this,s,r).year:(i=Ln(n,s,r),e>i&&(e=i),w1.call(this,n,e,t,s,r))}function w1(n,e,t,s,r){var i=Ld(n,e,t,s,r),o=bi(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}te("Q",0,"Qo","quarter"),X("Q",Ed),Se("Q",function(n,e){e[Dn]=(ge(n)-1)*3});function x1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}te("D",["DD",2],"Do","date"),X("D",Me,or),X("DD",Me,Pt),X("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Se(["D","DD"],yn),Se("Do",function(n,e){e[yn]=ge(n.match(Me)[0])});var ih=ar("Date",!0);te("DDD",["DDDD",3],"DDDo","dayOfYear"),X("DDD",Eo),X("DDDD",Od),Se(["DDD","DDDD"],function(n,e,t){t._dayOfYear=ge(n)});function v1(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}te("m",["mm",2],0,"minute"),X("m",Me,Dl),X("mm",Me,Pt),Se(["m","mm"],Xt);var C1=ar("Minutes",!1);te("s",["ss",2],0,"second"),X("s",Me,Dl),X("ss",Me,Pt),Se(["s","ss"],Rn);var S1=ar("Seconds",!1);te("S",0,0,function(){return~~(this.millisecond()/100)}),te(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),te(0,["SSS",3],0,"millisecond"),te(0,["SSSS",4],0,function(){return this.millisecond()*10}),te(0,["SSSSS",5],0,function(){return this.millisecond()*100}),te(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),te(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),te(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),te(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),X("S",Eo,Ed),X("SS",Eo,Pt),X("SSS",Eo,Od);var is,oh;for(is="SSSS";is.length<=9;is+="S")X(is,ir);function E1(n,e){e[Rs]=ge(("0."+n)*1e3)}for(is="S";is.length<=9;is+="S")Se(is,E1);oh=ar("Milliseconds",!1),te("z",0,0,"zoneAbbr"),te("zz",0,0,"zoneName");function O1(){return this._isUTC?"UTC":""}function M1(){return this._isUTC?"Coordinated Universal Time":""}var F=fi.prototype;F.add=bx,F.calendar=Ox,F.clone=Mx,F.diff=Dx,F.endOf=Ux,F.format=Vx,F.from=Bx,F.fromNow=jx,F.to=$x,F.toNow=zx,F.get=I0,F.invalidAt=Zx,F.isAfter=Px,F.isBefore=Ax,F.isBetween=Nx,F.isSame=Tx,F.isSameOrAfter=_x,F.isSameOrBefore=kx,F.isValid=Xx,F.lang=Qd,F.locale=Zd,F.localeData=eh,F.max=Xw,F.min=Jw,F.parsingFlags=Kx,F.set=V0,F.startOf=Fx,F.subtract=wx,F.toArray=Wx,F.toObject=qx,F.toDate=Yx,F.toISOString=Lx,F.inspect=Ix,typeof Symbol<"u"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=Jx,F.toString=Rx,F.unix=Gx,F.valueOf=Hx,F.creationData=Qx,F.eraName=s1,F.eraNarrow=r1,F.eraAbbr=i1,F.eraYear=o1,F.year=Ad,F.isLeapYear=L0,F.weekYear=f1,F.isoWeekYear=p1,F.quarter=F.quarters=x1,F.month=Dd,F.daysInMonth=Y0,F.week=F.weeks=ew,F.isoWeek=F.isoWeeks=tw,F.weeksInYear=y1,F.weeksInWeekYear=b1,F.isoWeeksInYear=g1,F.isoWeeksInISOWeekYear=m1,F.date=ih,F.day=F.days=pw,F.weekday=gw,F.isoWeekday=mw,F.dayOfYear=v1,F.hour=F.hours=Sw,F.minute=F.minutes=C1,F.second=F.seconds=S1,F.millisecond=F.milliseconds=oh,F.utcOffset=ix,F.utc=ax,F.local=lx,F.parseZone=cx,F.hasAlignedHourOffset=ux,F.isDST=dx,F.isLocal=fx,F.isUtcOffset=px,F.isUtc=Wd,F.isUTC=Wd,F.zoneAbbr=O1,F.zoneName=M1,F.dates=kt("dates accessor is deprecated. Use date instead.",ih),F.months=kt("months accessor is deprecated. Use month instead",Dd),F.years=kt("years accessor is deprecated. Use year instead",Ad),F.zone=kt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ox),F.isDSTShifted=kt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",hx);function P1(n){return Pe(n*1e3)}function A1(){return Pe.apply(null,arguments).parseZone()}function ah(n){return n}var xe=Ml.prototype;xe.calendar=f0,xe.longDateFormat=y0,xe.invalidDate=w0,xe.ordinal=C0,xe.preparse=ah,xe.postformat=ah,xe.relativeTime=E0,xe.pastFuture=O0,xe.set=d0,xe.eras=e1,xe.erasParse=t1,xe.erasConvertYear=n1,xe.erasAbbrRegex=l1,xe.erasNameRegex=a1,xe.erasNarrowRegex=c1,xe.months=F0,xe.monthsShort=U0,xe.monthsParse=G0,xe.monthsRegex=q0,xe.monthsShortRegex=W0,xe.week=X0,xe.firstDayOfYear=Q0,xe.firstDayOfWeek=Z0,xe.weekdays=cw,xe.weekdaysMin=dw,xe.weekdaysShort=uw,xe.weekdaysParse=fw,xe.weekdaysRegex=yw,xe.weekdaysShortRegex=bw,xe.weekdaysMinRegex=ww,xe.isPM=vw,xe.meridiem=Ew;function jo(n,e,t,s){var r=In(),i=pn().set(s,e);return r[t](i,n)}function lh(n,e,t){if(_n(n)&&(e=n,n=void 0),n=n||"",e!=null)return jo(n,e,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=jo(n,s,t,"month");return r}function Xl(n,e,t,s){typeof n=="boolean"?(_n(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,_n(e)&&(t=e,e=void 0),e=e||"");var r=In(),i=n?r._week.dow:0,o,a=[];if(t!=null)return jo(e,(t+i)%7,s,"day");for(o=0;o<7;o++)a[o]=jo(e,(o+i)%7,s,"day");return a}function N1(n,e){return lh(n,e,"months")}function T1(n,e){return lh(n,e,"monthsShort")}function _1(n,e,t){return Xl(n,e,t,"weekdays")}function k1(n,e,t){return Xl(n,e,t,"weekdaysShort")}function D1(n,e,t){return Xl(n,e,t,"weekdaysMin")}rs("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var e=n%10,t=ge(n%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return n+t}}),W.lang=kt("moment.lang is deprecated. Use moment.locale instead.",rs),W.langData=kt("moment.langData is deprecated. Use moment.localeData instead.",In);var Vn=Math.abs;function R1(){var n=this._data;return this._milliseconds=Vn(this._milliseconds),this._days=Vn(this._days),this._months=Vn(this._months),n.milliseconds=Vn(n.milliseconds),n.seconds=Vn(n.seconds),n.minutes=Vn(n.minutes),n.hours=Vn(n.hours),n.months=Vn(n.months),n.years=Vn(n.years),this}function ch(n,e,t,s){var r=Kt(e,t);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function L1(n,e){return ch(this,n,e,1)}function I1(n,e){return ch(this,n,e,-1)}function uh(n){return n<0?Math.floor(n):Math.ceil(n)}function V1(){var n=this._milliseconds,e=this._days,t=this._months,s=this._data,r,i,o,a,c;return n>=0&&e>=0&&t>=0||n<=0&&e<=0&&t<=0||(n+=uh(Kl(t)+e)*864e5,e=0,t=0),s.milliseconds=n%1e3,r=Rt(n/1e3),s.seconds=r%60,i=Rt(r/60),s.minutes=i%60,o=Rt(i/60),s.hours=o%24,e+=Rt(o/24),c=Rt(dh(e)),t+=c,e-=uh(Kl(c)),a=Rt(t/12),t%=12,s.days=e,s.months=t,s.years=a,this}function dh(n){return n*4800/146097}function Kl(n){return n*146097/4800}function B1(n){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(n=Dt(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+s/864e5,t=this._months+dh(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(Kl(this._months)),n){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+n)}}function Bn(n){return function(){return this.as(n)}}var hh=Bn("ms"),j1=Bn("s"),$1=Bn("m"),z1=Bn("h"),F1=Bn("d"),U1=Bn("w"),H1=Bn("M"),G1=Bn("Q"),Y1=Bn("y"),W1=hh;function q1(){return Kt(this)}function J1(n){return n=Dt(n),this.isValid()?this[n+"s"]():NaN}function Is(n){return function(){return this.isValid()?this._data[n]:NaN}}var X1=Is("milliseconds"),K1=Is("seconds"),Z1=Is("minutes"),Q1=Is("hours"),ev=Is("days"),tv=Is("months"),nv=Is("years");function sv(){return Rt(this.days()/7)}var jn=Math.round,dr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rv(n,e,t,s,r){return r.relativeTime(e||1,!!t,n,s)}function iv(n,e,t,s){var r=Kt(n).abs(),i=jn(r.as("s")),o=jn(r.as("m")),a=jn(r.as("h")),c=jn(r.as("d")),u=jn(r.as("M")),d=jn(r.as("w")),h=jn(r.as("y")),f=i<=t.ss&&["s",i]||i<t.s&&["ss",i]||o<=1&&["m"]||o<t.m&&["mm",o]||a<=1&&["h"]||a<t.h&&["hh",a]||c<=1&&["d"]||c<t.d&&["dd",c];return t.w!=null&&(f=f||d<=1&&["w"]||d<t.w&&["ww",d]),f=f||u<=1&&["M"]||u<t.M&&["MM",u]||h<=1&&["y"]||["yy",h],f[2]=e,f[3]=+n>0,f[4]=s,rv.apply(null,f)}function ov(n){return n===void 0?jn:typeof n=="function"?(jn=n,!0):!1}function av(n,e){return dr[n]===void 0?!1:e===void 0?dr[n]:(dr[n]=e,n==="s"&&(dr.ss=e-1),!0)}function lv(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=dr,r,i;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(s=Object.assign({},dr,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),r=this.localeData(),i=iv(this,!t,s,r),t&&(i=r.pastFuture(+this,i)),r.postformat(i)}var Zl=Math.abs;function hr(n){return(n>0)-(n<0)||+n}function $o(){if(!this.isValid())return this.localeData().invalidDate();var n=Zl(this._milliseconds)/1e3,e=Zl(this._days),t=Zl(this._months),s,r,i,o,a=this.asSeconds(),c,u,d,h;return a?(s=Rt(n/60),r=Rt(s/60),n%=60,s%=60,i=Rt(t/12),t%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=hr(this._months)!==hr(a)?"-":"",d=hr(this._days)!==hr(a)?"-":"",h=hr(this._milliseconds)!==hr(a)?"-":"",c+"P"+(i?u+i+"Y":"")+(t?u+t+"M":"")+(e?d+e+"D":"")+(r||s||n?"T":"")+(r?h+r+"H":"")+(s?h+s+"M":"")+(n?h+o+"S":"")):"P0D"}var be=Do.prototype;be.isValid=tx,be.abs=R1,be.add=L1,be.subtract=I1,be.as=B1,be.asMilliseconds=hh,be.asSeconds=j1,be.asMinutes=$1,be.asHours=z1,be.asDays=F1,be.asWeeks=U1,be.asMonths=H1,be.asQuarters=G1,be.asYears=Y1,be.valueOf=W1,be._bubble=V1,be.clone=q1,be.get=J1,be.milliseconds=X1,be.seconds=K1,be.minutes=Z1,be.hours=Q1,be.days=ev,be.weeks=sv,be.months=tv,be.years=nv,be.humanize=lv,be.toISOString=$o,be.toString=$o,be.toJSON=$o,be.locale=Zd,be.localeData=eh,be.toIsoString=kt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$o),be.lang=Qd,te("X",0,0,"unix"),te("x",0,0,"valueOf"),X("x",Mo),X("X",N0),Se("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)}),Se("x",function(n,e,t){t._d=new Date(ge(n))});//! moment.js
10
- W.version="2.30.1",c0(Pe),W.fn=F,W.min=Kw,W.max=Zw,W.now=Qw,W.utc=pn,W.unix=P1,W.months=N1,W.isDate=hi,W.locale=rs,W.invalid=xo,W.duration=Kt,W.isMoment=Jt,W.weekdays=_1,W.parseZone=A1,W.localeData=In,W.isDuration=Ro,W.monthsShort=T1,W.weekdaysMin=D1,W.defineLocale=jl,W.updateLocale=Aw,W.locales=Nw,W.weekdaysShort=k1,W.normalizeUnits=Dt,W.relativeTimeRounding=ov,W.relativeTimeThreshold=av,W.calendarFormat=Ex,W.prototype=F,W.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const cv='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',uv=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,fh=n=>Array.from(n.querySelectorAll(cv)).filter(e=>dv(e)&&uv(e)),dv=n=>{if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.disabled)return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return!(n.type==="hidden"||n.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},$n=(n,e,{checkForDefaultPrevented:t=!0}={})=>r=>{const i=n==null?void 0:n(r);if(t===!1||!i)return e==null?void 0:e(r)};var ph;const Ge=typeof window<"u",hv=n=>typeof n=="string",gh=()=>{},fv=Ge&&((ph=window==null?void 0:window.navigator)==null?void 0:ph.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Ql(n){return typeof n=="function"?n():l.unref(n)}function pv(n){return n}function zo(n){return l.getCurrentScope()?(l.onScopeDispose(n),!0):!1}function gv(n,e=!0){l.getCurrentInstance()?l.onMounted(n):e?n():l.nextTick(n)}function mv(n,e,t={}){const{immediate:s=!0}=t,r=l.ref(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,o()}function c(...u){o(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,n(...u)},Ql(e))}return s&&(r.value=!0,Ge&&c()),zo(a),{isPending:l.readonly(r),start:c,stop:a}}function os(n){var e;const t=Ql(n);return(e=t==null?void 0:t.$el)!=null?e:t}const ec=Ge?window:void 0;function zn(...n){let e,t,s,r;if(hv(n[0])||Array.isArray(n[0])?([t,s,r]=n,e=ec):[e,t,s,r]=n,!e)return gh;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},a=(d,h,f,p)=>(d.addEventListener(h,f,p),()=>d.removeEventListener(h,f,p)),c=l.watch(()=>[os(e),Ql(r)],([d,h])=>{o(),d&&i.push(...t.flatMap(f=>s.map(p=>a(d,f,p,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return zo(u),u}let mh=!1;function yv(n,e,t={}){const{window:s=ec,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return;fv&&!mh&&(mh=!0,Array.from(s.document.body.children).forEach(f=>f.addEventListener("click",gh)));let a=!0;const c=f=>r.some(p=>{if(typeof p=="string")return Array.from(s.document.querySelectorAll(p)).some(g=>g===f.target||f.composedPath().includes(g));{const g=os(p);return g&&(f.target===g||f.composedPath().includes(g))}}),d=[zn(s,"click",f=>{const p=os(n);if(!(!p||p===f.target||f.composedPath().includes(p))){if(f.detail===0&&(a=!c(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:i}),zn(s,"pointerdown",f=>{const p=os(n);p&&(a=!f.composedPath().includes(p)&&!c(f))},{passive:!0}),o&&zn(s,"blur",f=>{var p;const g=os(n);((p=s.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(g!=null&&g.contains(s.document.activeElement))&&e(f)})].filter(Boolean);return()=>d.forEach(f=>f())}function bv(n,e=!1){const t=l.ref(),s=()=>t.value=!!n();return s(),gv(s,e),t}const yh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},bh="__vueuse_ssr_handlers__";yh[bh]=yh[bh]||{};var wh=Object.getOwnPropertySymbols,wv=Object.prototype.hasOwnProperty,xv=Object.prototype.propertyIsEnumerable,vv=(n,e)=>{var t={};for(var s in n)wv.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&wh)for(var s of wh(n))e.indexOf(s)<0&&xv.call(n,s)&&(t[s]=n[s]);return t};function xh(n,e,t={}){const s=t,{window:r=ec}=s,i=vv(s,["window"]);let o;const a=bv(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},u=l.watch(()=>os(n),h=>{c(),a.value&&r&&h&&(o=new ResizeObserver(e),o.observe(h,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return zo(d),{isSupported:a,stop:d}}var vh;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(vh||(vh={}));var Cv=Object.defineProperty,Ch=Object.getOwnPropertySymbols,Sv=Object.prototype.hasOwnProperty,Ev=Object.prototype.propertyIsEnumerable,Sh=(n,e,t)=>e in n?Cv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ov=(n,e)=>{for(var t in e||(e={}))Sv.call(e,t)&&Sh(n,t,e[t]);if(Ch)for(var t of Ch(e))Ev.call(e,t)&&Sh(n,t,e[t]);return n};Ov({linear:pv},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Mv=()=>Ge&&/firefox/i.test(window.navigator.userAgent);/**
9
+ `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var _d={};function Td(n,e){W.deprecationHandler!=null&&W.deprecationHandler(n,e),_d[n]||(Ad(e),_d[n]=!0)}W.suppressDeprecationWarnings=!1,W.deprecationHandler=null;function yn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function S0(n){var e,t;for(t in n)xe(n,t)&&(e=n[t],yn(e)?this[t]=e:this["_"+t]=e);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Tl(n,e){var t=ns({},n),s;for(s in e)xe(e,s)&&(Ts(n[s])&&Ts(e[s])?(t[s]={},ns(t[s],n[s]),ns(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in n)xe(n,s)&&!xe(e,s)&&Ts(n[s])&&(t[s]=ns({},t[s]));return t}function kl(n){n!=null&&this.set(n)}var Vl;Object.keys?Vl=Object.keys:Vl=function(n){var e,t=[];for(e in n)xe(n,e)&&t.push(e);return t};var E0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function O0(n,e,t){var s=this._calendar[n]||this._calendar.sameElse;return yn(s)?s.call(e,t):s}function bn(n,e,t){var s=""+Math.abs(n),r=e-s.length,i=n>=0;return(i?t?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+s}var Dl=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Eo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Rl={},ir={};function ie(n,e,t,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(ir[n]=r),e&&(ir[e[0]]=function(){return bn(r.apply(this,arguments),e[1],e[2])}),t&&(ir[t]=function(){return this.localeData().ordinal(r.apply(this,arguments),n)})}function M0(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function P0(n){var e=n.match(Dl),t,s;for(t=0,s=e.length;t<s;t++)ir[e[t]]?e[t]=ir[e[t]]:e[t]=M0(e[t]);return function(r){var i="",o;for(o=0;o<s;o++)i+=yn(e[o])?e[o].call(r,n):e[o];return i}}function Oo(n,e){return n.isValid()?(e=kd(e,n.localeData()),Rl[e]=Rl[e]||P0(e),Rl[e](n)):n.localeData().invalidDate()}function kd(n,e){var t=5;function s(r){return e.longDateFormat(r)||r}for(Eo.lastIndex=0;t>=0&&Eo.test(n);)n=n.replace(Eo,s),Eo.lastIndex=0,t-=1;return n}var N0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function A0(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(Dl).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var _0="Invalid date";function T0(){return this._invalidDate}var k0="%d",V0=/\d{1,2}/;function D0(n){return this._ordinal.replace("%d",n)}var R0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function L0(n,e,t,s){var r=this._relativeTime[t];return yn(r)?r(n,e,t,s):r.replace(/%d/i,n)}function I0(n,e){var t=this._relativeTime[n>0?"future":"past"];return yn(t)?t(e):t.replace(/%s/i,e)}var Vd={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Dt(n){return typeof n=="string"?Vd[n]||Vd[n.toLowerCase()]:void 0}function Ll(n){var e={},t,s;for(s in n)xe(n,s)&&(t=Dt(s),t&&(e[t]=n[s]));return e}var B0={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function j0(n){var e=[],t;for(t in n)xe(n,t)&&e.push({unit:t,priority:B0[t]});return e.sort(function(s,r){return s.priority-r.priority}),e}var Dd=/\d/,Nt=/\d\d/,Rd=/\d{3}/,Il=/\d{4}/,Mo=/[+-]?\d{6}/,Pe=/\d\d?/,Ld=/\d\d\d\d?/,Id=/\d\d\d\d\d\d?/,Po=/\d{1,3}/,Bl=/\d{1,4}/,No=/[+-]?\d{1,6}/,or=/\d+/,Ao=/[+-]?\d+/,$0=/Z|[+-]\d\d:?\d\d/gi,_o=/Z|[+-]\d\d(?::?\d\d)?/gi,z0=/[+-]?\d+(\.\d{1,3})?/,yi=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ar=/^[1-9]\d?/,jl=/^([1-9]\d|\d)/,To;To={};function J(n,e,t){To[n]=yn(e)?e:function(s,r){return s&&t?t:e}}function F0(n,e){return xe(To,n)?To[n](e._strict,e._locale):new RegExp(U0(n))}function U0(n){return Vn(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,r,i){return t||s||r||i}))}function Vn(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Rt(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function me(n){var e=+n,t=0;return e!==0&&isFinite(e)&&(t=Rt(e)),t}var $l={};function Ee(n,e){var t,s=e,r;for(typeof n=="string"&&(n=[n]),kn(e)&&(s=function(i,o){o[e]=me(i)}),r=n.length,t=0;t<r;t++)$l[n[t]]=s}function bi(n,e){Ee(n,function(t,s,r,i){r._w=r._w||{},e(t,r._w,r,i)})}function H0(n,e,t){e!=null&&xe($l,n)&&$l[n](e,t._a,t,n)}function ko(n){return n%4===0&&n%100!==0||n%400===0}var dt=0,Dn=1,wn=2,Ke=3,Zt=4,Rn=5,ks=6,G0=7,W0=8;ie("Y",0,0,function(){var n=this.year();return n<=9999?bn(n,4):"+"+n}),ie(0,["YY",2],0,function(){return this.year()%100}),ie(0,["YYYY",4],0,"year"),ie(0,["YYYYY",5],0,"year"),ie(0,["YYYYYY",6,!0],0,"year"),J("Y",Ao),J("YY",Pe,Nt),J("YYYY",Bl,Il),J("YYYYY",No,Mo),J("YYYYYY",No,Mo),Ee(["YYYYY","YYYYYY"],dt),Ee("YYYY",function(n,e){e[dt]=n.length===2?W.parseTwoDigitYear(n):me(n)}),Ee("YY",function(n,e){e[dt]=W.parseTwoDigitYear(n)}),Ee("Y",function(n,e){e[dt]=parseInt(n,10)});function wi(n){return ko(n)?366:365}W.parseTwoDigitYear=function(n){return me(n)+(me(n)>68?1900:2e3)};var Bd=lr("FullYear",!0);function Y0(){return ko(this.year())}function lr(n,e){return function(t){return t!=null?(jd(this,n,t),W.updateOffset(this,e),this):xi(this,n)}}function xi(n,e){if(!n.isValid())return NaN;var t=n._d,s=n._isUTC;switch(e){case"Milliseconds":return s?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return s?t.getUTCSeconds():t.getSeconds();case"Minutes":return s?t.getUTCMinutes():t.getMinutes();case"Hours":return s?t.getUTCHours():t.getHours();case"Date":return s?t.getUTCDate():t.getDate();case"Day":return s?t.getUTCDay():t.getDay();case"Month":return s?t.getUTCMonth():t.getMonth();case"FullYear":return s?t.getUTCFullYear():t.getFullYear();default:return NaN}}function jd(n,e,t){var s,r,i,o,a;if(!(!n.isValid()||isNaN(t))){switch(s=n._d,r=n._isUTC,e){case"Milliseconds":return void(r?s.setUTCMilliseconds(t):s.setMilliseconds(t));case"Seconds":return void(r?s.setUTCSeconds(t):s.setSeconds(t));case"Minutes":return void(r?s.setUTCMinutes(t):s.setMinutes(t));case"Hours":return void(r?s.setUTCHours(t):s.setHours(t));case"Date":return void(r?s.setUTCDate(t):s.setDate(t));case"FullYear":break;default:return}i=t,o=n.month(),a=n.date(),a=a===29&&o===1&&!ko(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function q0(n){return n=Dt(n),yn(this[n])?this[n]():this}function J0(n,e){if(typeof n=="object"){n=Ll(n);var t=j0(n),s,r=t.length;for(s=0;s<r;s++)this[t[s].unit](n[t[s].unit])}else if(n=Dt(n),yn(this[n]))return this[n](e);return this}function X0(n,e){return(n%e+e)%e}var $e;Array.prototype.indexOf?$e=Array.prototype.indexOf:$e=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function zl(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=X0(e,12);return n+=(e-t)/12,t===1?ko(n)?29:28:31-t%7%2}ie("M",["MM",2],"Mo",function(){return this.month()+1}),ie("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),ie("MMMM",0,0,function(n){return this.localeData().months(this,n)}),J("M",Pe,ar),J("MM",Pe,Nt),J("MMM",function(n,e){return e.monthsShortRegex(n)}),J("MMMM",function(n,e){return e.monthsRegex(n)}),Ee(["M","MM"],function(n,e){e[Dn]=me(n)-1}),Ee(["MMM","MMMM"],function(n,e,t,s){var r=t._locale.monthsParse(n,s,t._strict);r!=null?e[Dn]=r:de(t).invalidMonth=n});var K0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),$d="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),zd=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Z0=yi,Q0=yi;function ew(n,e){return n?Xt(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||zd).test(e)?"format":"standalone"][n.month()]:Xt(this._months)?this._months:this._months.standalone}function tw(n,e){return n?Xt(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[zd.test(e)?"format":"standalone"][n.month()]:Xt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function nw(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)i=mn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return t?e==="MMM"?(r=$e.call(this._shortMonthsParse,o),r!==-1?r:null):(r=$e.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=$e.call(this._shortMonthsParse,o),r!==-1?r:(r=$e.call(this._longMonthsParse,o),r!==-1?r:null)):(r=$e.call(this._longMonthsParse,o),r!==-1?r:(r=$e.call(this._shortMonthsParse,o),r!==-1?r:null))}function sw(n,e,t){var s,r,i;if(this._monthsParseExact)return nw.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=mn([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!t&&!this._monthsParse[s]&&(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[s].test(n))return s;if(t&&e==="MMM"&&this._shortMonthsParse[s].test(n))return s;if(!t&&this._monthsParse[s].test(n))return s}}function Fd(n,e){if(!n.isValid())return n;if(typeof e=="string"){if(/^\d+$/.test(e))e=me(e);else if(e=n.localeData().monthsParse(e),!kn(e))return n}var t=e,s=n.date();return s=s<29?s:Math.min(s,zl(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,s):n._d.setMonth(t,s),n}function Ud(n){return n!=null?(Fd(this,n),W.updateOffset(this,!0),this):xi(this,"Month")}function rw(){return zl(this.year(),this.month())}function iw(n){return this._monthsParseExact?(xe(this,"_monthsRegex")||Hd.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(xe(this,"_monthsShortRegex")||(this._monthsShortRegex=Z0),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function ow(n){return this._monthsParseExact?(xe(this,"_monthsRegex")||Hd.call(this),n?this._monthsStrictRegex:this._monthsRegex):(xe(this,"_monthsRegex")||(this._monthsRegex=Q0),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Hd(){function n(c,u){return u.length-c.length}var e=[],t=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=mn([2e3,r]),o=Vn(this.monthsShort(i,"")),a=Vn(this.months(i,"")),e.push(o),t.push(a),s.push(a),s.push(o);e.sort(n),t.sort(n),s.sort(n),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function aw(n,e,t,s,r,i,o){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,s,r,i,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,s,r,i,o),a}function vi(n){var e,t;return n<100&&n>=0?(t=Array.prototype.slice.call(arguments),t[0]=n+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(n)):e=new Date(Date.UTC.apply(null,arguments)),e}function Vo(n,e,t){var s=7+e-t,r=(7+vi(n,0,s).getUTCDay()-e)%7;return-r+s-1}function Gd(n,e,t,s,r){var i=(7+t-s)%7,o=Vo(n,s,r),a=1+7*(e-1)+i+o,c,u;return a<=0?(c=n-1,u=wi(c)+a):a>wi(n)?(c=n+1,u=a-wi(n)):(c=n,u=a),{year:c,dayOfYear:u}}function Ci(n,e,t){var s=Vo(n.year(),e,t),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+Ln(o,e,t)):r>Ln(n.year(),e,t)?(i=r-Ln(n.year(),e,t),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function Ln(n,e,t){var s=Vo(n,e,t),r=Vo(n+1,e,t);return(wi(n)-s+r)/7}ie("w",["ww",2],"wo","week"),ie("W",["WW",2],"Wo","isoWeek"),J("w",Pe,ar),J("ww",Pe,Nt),J("W",Pe,ar),J("WW",Pe,Nt),bi(["w","ww","W","WW"],function(n,e,t,s){e[s.substr(0,1)]=me(n)});function lw(n){return Ci(n,this._week.dow,this._week.doy).week}var cw={dow:0,doy:6};function uw(){return this._week.dow}function dw(){return this._week.doy}function hw(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function fw(n){var e=Ci(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}ie("d",0,"do","day"),ie("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),ie("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),ie("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),ie("e",0,0,"weekday"),ie("E",0,0,"isoWeekday"),J("d",Pe),J("e",Pe),J("E",Pe),J("dd",function(n,e){return e.weekdaysMinRegex(n)}),J("ddd",function(n,e){return e.weekdaysShortRegex(n)}),J("dddd",function(n,e){return e.weekdaysRegex(n)}),bi(["dd","ddd","dddd"],function(n,e,t,s){var r=t._locale.weekdaysParse(n,s,t._strict);r!=null?e.d=r:de(t).invalidWeekday=n}),bi(["d","e","E"],function(n,e,t,s){e[s]=me(n)});function pw(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function gw(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Fl(n,e){return n.slice(e,7).concat(n.slice(0,e))}var mw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Wd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yw="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),bw=yi,ww=yi,xw=yi;function vw(n,e){var t=Xt(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?Fl(t,this._week.dow):n?t[n.day()]:t}function Cw(n){return n===!0?Fl(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function Sw(n){return n===!0?Fl(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function Ew(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=mn([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(i,"").toLocaleLowerCase();return t?e==="dddd"?(r=$e.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=$e.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=$e.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=$e.call(this._weekdaysParse,o),r!==-1||(r=$e.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=$e.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=$e.call(this._shortWeekdaysParse,o),r!==-1||(r=$e.call(this._weekdaysParse,o),r!==-1)?r:(r=$e.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=$e.call(this._minWeekdaysParse,o),r!==-1||(r=$e.call(this._weekdaysParse,o),r!==-1)?r:(r=$e.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function Ow(n,e,t){var s,r,i;if(this._weekdaysParseExact)return Ew.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=mn([2e3,1]).day(s),t&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[s].test(n))return s;if(t&&e==="ddd"&&this._shortWeekdaysParse[s].test(n))return s;if(t&&e==="dd"&&this._minWeekdaysParse[s].test(n))return s;if(!t&&this._weekdaysParse[s].test(n))return s}}function Mw(n){if(!this.isValid())return n!=null?this:NaN;var e=xi(this,"Day");return n!=null?(n=pw(n,this.localeData()),this.add(n-e,"d")):e}function Pw(n){if(!this.isValid())return n!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return n==null?e:this.add(n-e,"d")}function Nw(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=gw(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Aw(n){return this._weekdaysParseExact?(xe(this,"_weekdaysRegex")||Ul.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(xe(this,"_weekdaysRegex")||(this._weekdaysRegex=bw),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function _w(n){return this._weekdaysParseExact?(xe(this,"_weekdaysRegex")||Ul.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(xe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ww),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Tw(n){return this._weekdaysParseExact?(xe(this,"_weekdaysRegex")||Ul.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(xe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=xw),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ul(){function n(d,f){return f.length-d.length}var e=[],t=[],s=[],r=[],i,o,a,c,u;for(i=0;i<7;i++)o=mn([2e3,1]).day(i),a=Vn(this.weekdaysMin(o,"")),c=Vn(this.weekdaysShort(o,"")),u=Vn(this.weekdays(o,"")),e.push(a),t.push(c),s.push(u),r.push(a),r.push(c),r.push(u);e.sort(n),t.sort(n),s.sort(n),r.sort(n),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Hl(){return this.hours()%12||12}function kw(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,Hl),ie("k",["kk",2],0,kw),ie("hmm",0,0,function(){return""+Hl.apply(this)+bn(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+Hl.apply(this)+bn(this.minutes(),2)+bn(this.seconds(),2)}),ie("Hmm",0,0,function(){return""+this.hours()+bn(this.minutes(),2)}),ie("Hmmss",0,0,function(){return""+this.hours()+bn(this.minutes(),2)+bn(this.seconds(),2)});function Yd(n,e){ie(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Yd("a",!0),Yd("A",!1);function qd(n,e){return e._meridiemParse}J("a",qd),J("A",qd),J("H",Pe,jl),J("h",Pe,ar),J("k",Pe,ar),J("HH",Pe,Nt),J("hh",Pe,Nt),J("kk",Pe,Nt),J("hmm",Ld),J("hmmss",Id),J("Hmm",Ld),J("Hmmss",Id),Ee(["H","HH"],Ke),Ee(["k","kk"],function(n,e,t){var s=me(n);e[Ke]=s===24?0:s}),Ee(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n}),Ee(["h","hh"],function(n,e,t){e[Ke]=me(n),de(t).bigHour=!0}),Ee("hmm",function(n,e,t){var s=n.length-2;e[Ke]=me(n.substr(0,s)),e[Zt]=me(n.substr(s)),de(t).bigHour=!0}),Ee("hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Ke]=me(n.substr(0,s)),e[Zt]=me(n.substr(s,2)),e[Rn]=me(n.substr(r)),de(t).bigHour=!0}),Ee("Hmm",function(n,e,t){var s=n.length-2;e[Ke]=me(n.substr(0,s)),e[Zt]=me(n.substr(s))}),Ee("Hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Ke]=me(n.substr(0,s)),e[Zt]=me(n.substr(s,2)),e[Rn]=me(n.substr(r))});function Vw(n){return(n+"").toLowerCase().charAt(0)==="p"}var Dw=/[ap]\.?m?\.?/i,Rw=lr("Hours",!0);function Lw(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var Jd={calendar:E0,longDateFormat:N0,invalidDate:_0,ordinal:k0,dayOfMonthOrdinalParse:V0,relativeTime:R0,months:K0,monthsShort:$d,week:cw,weekdays:mw,weekdaysMin:yw,weekdaysShort:Wd,meridiemParse:Dw},Ve={},Si={},Ei;function Iw(n,e){var t,s=Math.min(n.length,e.length);for(t=0;t<s;t+=1)if(n[t]!==e[t])return t;return s}function Xd(n){return n&&n.toLowerCase().replace("_","-")}function Bw(n){for(var e=0,t,s,r,i;e<n.length;){for(i=Xd(n[e]).split("-"),t=i.length,s=Xd(n[e+1]),s=s?s.split("-"):null;t>0;){if(r=Do(i.slice(0,t).join("-")),r)return r;if(s&&s.length>=t&&Iw(i,s)>=t-1)break;t--}e++}return Ei}function jw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function Do(n){var e=null,t;if(Ve[n]===void 0&&typeof module<"u"&&module&&module.exports&&jw(n))try{e=Ei._abbr,t=require,t("./locale/"+n),ss(e)}catch{Ve[n]=null}return Ve[n]}function ss(n,e){var t;return n&&(wt(e)?t=In(n):t=Gl(n,e),t?Ei=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Ei._abbr}function Gl(n,e){if(e!==null){var t,s=Jd;if(e.abbr=n,Ve[n]!=null)Td("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=Ve[n]._config;else if(e.parentLocale!=null)if(Ve[e.parentLocale]!=null)s=Ve[e.parentLocale]._config;else if(t=Do(e.parentLocale),t!=null)s=t._config;else return Si[e.parentLocale]||(Si[e.parentLocale]=[]),Si[e.parentLocale].push({name:n,config:e}),null;return Ve[n]=new kl(Tl(s,e)),Si[n]&&Si[n].forEach(function(r){Gl(r.name,r.config)}),ss(n),Ve[n]}else return delete Ve[n],null}function $w(n,e){if(e!=null){var t,s,r=Jd;Ve[n]!=null&&Ve[n].parentLocale!=null?Ve[n].set(Tl(Ve[n]._config,e)):(s=Do(n),s!=null&&(r=s._config),e=Tl(r,e),s==null&&(e.abbr=n),t=new kl(e),t.parentLocale=Ve[n],Ve[n]=t),ss(n)}else Ve[n]!=null&&(Ve[n].parentLocale!=null?(Ve[n]=Ve[n].parentLocale,n===ss()&&ss(n)):Ve[n]!=null&&delete Ve[n]);return Ve[n]}function In(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Ei;if(!Xt(n)){if(e=Do(n),e)return e;n=[n]}return Bw(n)}function zw(){return Vl(Ve)}function Wl(n){var e,t=n._a;return t&&de(n).overflow===-2&&(e=t[Dn]<0||t[Dn]>11?Dn:t[wn]<1||t[wn]>zl(t[dt],t[Dn])?wn:t[Ke]<0||t[Ke]>24||t[Ke]===24&&(t[Zt]!==0||t[Rn]!==0||t[ks]!==0)?Ke:t[Zt]<0||t[Zt]>59?Zt:t[Rn]<0||t[Rn]>59?Rn:t[ks]<0||t[ks]>999?ks:-1,de(n)._overflowDayOfYear&&(e<dt||e>wn)&&(e=wn),de(n)._overflowWeeks&&e===-1&&(e=G0),de(n)._overflowWeekday&&e===-1&&(e=W0),de(n).overflow=e),n}var Fw=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Uw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Hw=/Z|[+-]\d\d(?::?\d\d)?/,Ro=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Yl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Gw=/^\/?Date\((-?\d+)/i,Ww=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Yw={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Kd(n){var e,t,s=n._i,r=Fw.exec(s)||Uw.exec(s),i,o,a,c,u=Ro.length,d=Yl.length;if(r){for(de(n).iso=!0,e=0,t=u;e<t;e++)if(Ro[e][1].exec(r[1])){o=Ro[e][0],i=Ro[e][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(e=0,t=d;e<t;e++)if(Yl[e][1].exec(r[3])){a=(r[2]||" ")+Yl[e][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(Hw.exec(r[4]))c="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(c||""),Jl(n)}else n._isValid=!1}function qw(n,e,t,s,r,i){var o=[Jw(n),$d.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Jw(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Xw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Kw(n,e,t){if(n){var s=Wd.indexOf(n),r=new Date(e[0],e[1],e[2]).getDay();if(s!==r)return de(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function Zw(n,e,t){if(n)return Yw[n];if(e)return 0;var s=parseInt(t,10),r=s%100,i=(s-r)/100;return i*60+r}function Zd(n){var e=Ww.exec(Xw(n._i)),t;if(e){if(t=qw(e[4],e[3],e[2],e[5],e[6],e[7]),!Kw(e[1],t,n))return;n._a=t,n._tzm=Zw(e[8],e[9],e[10]),n._d=vi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),de(n).rfc2822=!0}else n._isValid=!1}function Qw(n){var e=Gw.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(Kd(n),n._isValid===!1)delete n._isValid;else return;if(Zd(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:W.createFromInputFallback(n)}W.createFromInputFallback=Vt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function cr(n,e,t){return n??e??t}function ex(n){var e=new Date(W.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ql(n){var e,t,s=[],r,i,o;if(!n._d){for(r=ex(n),n._w&&n._a[wn]==null&&n._a[Dn]==null&&tx(n),n._dayOfYear!=null&&(o=cr(n._a[dt],r[dt]),(n._dayOfYear>wi(o)||n._dayOfYear===0)&&(de(n)._overflowDayOfYear=!0),t=vi(o,0,n._dayOfYear),n._a[Dn]=t.getUTCMonth(),n._a[wn]=t.getUTCDate()),e=0;e<3&&n._a[e]==null;++e)n._a[e]=s[e]=r[e];for(;e<7;e++)n._a[e]=s[e]=n._a[e]==null?e===2?1:0:n._a[e];n._a[Ke]===24&&n._a[Zt]===0&&n._a[Rn]===0&&n._a[ks]===0&&(n._nextDay=!0,n._a[Ke]=0),n._d=(n._useUTC?vi:aw).apply(null,s),i=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[Ke]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(de(n).weekdayMismatch=!0)}}function tx(n){var e,t,s,r,i,o,a,c,u;e=n._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,o=4,t=cr(e.GG,n._a[dt],Ci(Ne(),1,4).year),s=cr(e.W,1),r=cr(e.E,1),(r<1||r>7)&&(c=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=Ci(Ne(),i,o),t=cr(e.gg,n._a[dt],u.year),s=cr(e.w,u.week),e.d!=null?(r=e.d,(r<0||r>6)&&(c=!0)):e.e!=null?(r=e.e+i,(e.e<0||e.e>6)&&(c=!0)):r=i),s<1||s>Ln(t,i,o)?de(n)._overflowWeeks=!0:c!=null?de(n)._overflowWeekday=!0:(a=Gd(t,s,r,i,o),n._a[dt]=a.year,n._dayOfYear=a.dayOfYear)}W.ISO_8601=function(){},W.RFC_2822=function(){};function Jl(n){if(n._f===W.ISO_8601){Kd(n);return}if(n._f===W.RFC_2822){Zd(n);return}n._a=[],de(n).empty=!0;var e=""+n._i,t,s,r,i,o,a=e.length,c=0,u,d;for(r=kd(n._f,n._locale).match(Dl)||[],d=r.length,t=0;t<d;t++)i=r[t],s=(e.match(F0(i,n))||[])[0],s&&(o=e.substr(0,e.indexOf(s)),o.length>0&&de(n).unusedInput.push(o),e=e.slice(e.indexOf(s)+s.length),c+=s.length),ir[i]?(s?de(n).empty=!1:de(n).unusedTokens.push(i),H0(i,s,n)):n._strict&&!s&&de(n).unusedTokens.push(i);de(n).charsLeftOver=a-c,e.length>0&&de(n).unusedInput.push(e),n._a[Ke]<=12&&de(n).bigHour===!0&&n._a[Ke]>0&&(de(n).bigHour=void 0),de(n).parsedDateParts=n._a.slice(0),de(n).meridiem=n._meridiem,n._a[Ke]=nx(n._locale,n._a[Ke],n._meridiem),u=de(n).era,u!==null&&(n._a[dt]=n._locale.erasConvertYear(u,n._a[dt])),ql(n),Wl(n)}function nx(n,e,t){var s;return t==null?e:n.meridiemHour!=null?n.meridiemHour(e,t):(n.isPM!=null&&(s=n.isPM(t),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function sx(n){var e,t,s,r,i,o,a=!1,c=n._f.length;if(c===0){de(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<c;r++)i=0,o=!1,e=_l({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[r],Jl(e),Nl(e)&&(o=!0),i+=de(e).charsLeftOver,i+=de(e).unusedTokens.length*10,de(e).score=i,a?i<s&&(s=i,t=e):(s==null||i<s||o)&&(s=i,t=e,o&&(a=!0));ns(n,t||e)}function rx(n){if(!n._d){var e=Ll(n._i),t=e.day===void 0?e.date:e.day;n._a=Pd([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),ql(n)}}function ix(n){var e=new mi(Wl(Qd(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Qd(n){var e=n._i,t=n._f;return n._locale=n._locale||In(n._l),e===null||t===void 0&&e===""?So({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),Kt(e)?new mi(Wl(e)):(gi(e)?n._d=e:Xt(t)?sx(n):t?Jl(n):ox(n),Nl(n)||(n._d=null),n))}function ox(n){var e=n._i;wt(e)?n._d=new Date(W.now()):gi(e)?n._d=new Date(e.valueOf()):typeof e=="string"?Qw(n):Xt(e)?(n._a=Pd(e.slice(0),function(t){return parseInt(t,10)}),ql(n)):Ts(e)?rx(n):kn(e)?n._d=new Date(e):W.createFromInputFallback(n)}function eh(n,e,t,s,r){var i={};return(e===!0||e===!1)&&(s=e,e=void 0),(t===!0||t===!1)&&(s=t,t=void 0),(Ts(n)&&Ml(n)||Xt(n)&&n.length===0)&&(n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=t,i._i=n,i._f=e,i._strict=s,ix(i)}function Ne(n,e,t,s){return eh(n,e,t,s,!1)}var ax=Vt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Ne.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:So()}),lx=Vt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Ne.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:So()});function th(n,e){var t,s;if(e.length===1&&Xt(e[0])&&(e=e[0]),!e.length)return Ne();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][n](t))&&(t=e[s]);return t}function cx(){var n=[].slice.call(arguments,0);return th("isBefore",n)}function ux(){var n=[].slice.call(arguments,0);return th("isAfter",n)}var dx=function(){return Date.now?Date.now():+new Date},Oi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function hx(n){var e,t=!1,s,r=Oi.length;for(e in n)if(xe(n,e)&&!($e.call(Oi,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(s=0;s<r;++s)if(n[Oi[s]]){if(t)return!1;parseFloat(n[Oi[s]])!==me(n[Oi[s]])&&(t=!0)}return!0}function fx(){return this._isValid}function px(){return Qt(NaN)}function Lo(n){var e=Ll(n),t=e.year||0,s=e.quarter||0,r=e.month||0,i=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,c=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=hx(e),this._milliseconds=+d+u*1e3+c*6e4+a*1e3*60*60,this._days=+o+i*7,this._months=+r+s*3+t*12,this._data={},this._locale=In(),this._bubble()}function Io(n){return n instanceof Lo}function Xl(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function gx(n,e,t){var s=Math.min(n.length,e.length),r=Math.abs(n.length-e.length),i=0,o;for(o=0;o<s;o++)me(n[o])!==me(e[o])&&i++;return i+r}function nh(n,e){ie(n,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+bn(~~(t/60),2)+e+bn(~~t%60,2)})}nh("Z",":"),nh("ZZ",""),J("Z",_o),J("ZZ",_o),Ee(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=Kl(_o,n)});var mx=/([\+\-]|\d\d)/gi;function Kl(n,e){var t=(e||"").match(n),s,r,i;return t===null?null:(s=t[t.length-1]||[],r=(s+"").match(mx)||["-",0,0],i=+(r[1]*60)+me(r[2]),i===0?0:r[0]==="+"?i:-i)}function Zl(n,e){var t,s;return e._isUTC?(t=e.clone(),s=(Kt(n)||gi(n)?n.valueOf():Ne(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),W.updateOffset(t,!1),t):Ne(n).local()}function Ql(n){return-Math.round(n._d.getTimezoneOffset())}W.updateOffset=function(){};function yx(n,e,t){var s=this._offset||0,r;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=Kl(_o,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(r=Ql(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!e||this._changeInProgress?oh(this,Qt(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,W.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Ql(this)}function bx(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function wx(n){return this.utcOffset(0,n)}function xx(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(Ql(this),"m")),this}function vx(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=Kl($0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Cx(n){return this.isValid()?(n=n?Ne(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function Sx(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ex(){if(!wt(this._isDSTShifted))return this._isDSTShifted;var n={},e;return _l(n,this),n=Qd(n),n._a?(e=n._isUTC?mn(n._a):Ne(n._a),this._isDSTShifted=this.isValid()&&gx(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ox(){return this.isValid()?!this._isUTC:!1}function Mx(){return this.isValid()?this._isUTC:!1}function sh(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Px=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Nx=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Qt(n,e){var t=n,s=null,r,i,o;return Io(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:kn(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(s=Px.exec(n))?(r=s[1]==="-"?-1:1,t={y:0,d:me(s[wn])*r,h:me(s[Ke])*r,m:me(s[Zt])*r,s:me(s[Rn])*r,ms:me(Xl(s[ks]*1e3))*r}):(s=Nx.exec(n))?(r=s[1]==="-"?-1:1,t={y:Vs(s[2],r),M:Vs(s[3],r),w:Vs(s[4],r),d:Vs(s[5],r),h:Vs(s[6],r),m:Vs(s[7],r),s:Vs(s[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(o=Ax(Ne(t.from),Ne(t.to)),t={},t.ms=o.milliseconds,t.M=o.months),i=new Lo(t),Io(n)&&xe(n,"_locale")&&(i._locale=n._locale),Io(n)&&xe(n,"_isValid")&&(i._isValid=n._isValid),i}Qt.fn=Lo.prototype,Qt.invalid=px;function Vs(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function rh(n,e){var t={};return t.months=e.month()-n.month()+(e.year()-n.year())*12,n.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+n.clone().add(t.months,"M"),t}function Ax(n,e){var t;return n.isValid()&&e.isValid()?(e=Zl(e,n),n.isBefore(e)?t=rh(n,e):(t=rh(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function ih(n,e){return function(t,s){var r,i;return s!==null&&!isNaN(+s)&&(Td(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=t,t=s,s=i),r=Qt(t,s),oh(this,r,n),this}}function oh(n,e,t,s){var r=e._milliseconds,i=Xl(e._days),o=Xl(e._months);n.isValid()&&(s=s??!0,o&&Fd(n,xi(n,"Month")+o*t),i&&jd(n,"Date",xi(n,"Date")+i*t),r&&n._d.setTime(n._d.valueOf()+r*t),s&&W.updateOffset(n,i||o))}var _x=ih(1,"add"),Tx=ih(-1,"subtract");function ah(n){return typeof n=="string"||n instanceof String}function kx(n){return Kt(n)||gi(n)||ah(n)||kn(n)||Dx(n)||Vx(n)||n===null||n===void 0}function Vx(n){var e=Ts(n)&&!Ml(n),t=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,i,o=s.length;for(r=0;r<o;r+=1)i=s[r],t=t||xe(n,i);return e&&t}function Dx(n){var e=Xt(n),t=!1;return e&&(t=n.filter(function(s){return!kn(s)&&ah(n)}).length===0),e&&t}function Rx(n){var e=Ts(n)&&!Ml(n),t=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,i;for(r=0;r<s.length;r+=1)i=s[r],t=t||xe(n,i);return e&&t}function Lx(n,e){var t=n.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function Ix(n,e){arguments.length===1&&(arguments[0]?kx(arguments[0])?(n=arguments[0],e=void 0):Rx(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||Ne(),s=Zl(t,this).startOf("day"),r=W.calendarFormat(this,s)||"sameElse",i=e&&(yn(e[r])?e[r].call(this,t):e[r]);return this.format(i||this.localeData().calendar(r,this,Ne(t)))}function Bx(){return new mi(this)}function jx(n,e){var t=Kt(n)?n:Ne(n);return this.isValid()&&t.isValid()?(e=Dt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function $x(n,e){var t=Kt(n)?n:Ne(n);return this.isValid()&&t.isValid()?(e=Dt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function zx(n,e,t,s){var r=Kt(n)?n:Ne(n),i=Kt(e)?e:Ne(e);return this.isValid()&&r.isValid()&&i.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(r,t):!this.isBefore(r,t))&&(s[1]===")"?this.isBefore(i,t):!this.isAfter(i,t))):!1}function Fx(n,e){var t=Kt(n)?n:Ne(n),s;return this.isValid()&&t.isValid()?(e=Dt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(s=t.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function Ux(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function Hx(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function Gx(n,e,t){var s,r,i;if(!this.isValid())return NaN;if(s=Zl(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,e=Dt(e),e){case"year":i=Bo(this,s)/12;break;case"month":i=Bo(this,s);break;case"quarter":i=Bo(this,s)/3;break;case"second":i=(this-s)/1e3;break;case"minute":i=(this-s)/6e4;break;case"hour":i=(this-s)/36e5;break;case"day":i=(this-s-r)/864e5;break;case"week":i=(this-s-r)/6048e5;break;default:i=this-s}return t?i:Rt(i)}function Bo(n,e){if(n.date()<e.date())return-Bo(e,n);var t=(e.year()-n.year())*12+(e.month()-n.month()),s=n.clone().add(t,"months"),r,i;return e-s<0?(r=n.clone().add(t-1,"months"),i=(e-s)/(s-r)):(r=n.clone().add(t+1,"months"),i=(e-s)/(r-s)),-(t+i)||0}W.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",W.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Wx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Yx(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?Oo(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):yn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Oo(t,"Z")):Oo(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function qx(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",e="",t,s,r,i;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+n+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(t+s+r+i)}function Jx(n){n||(n=this.isUtc()?W.defaultFormatUtc:W.defaultFormat);var e=Oo(this,n);return this.localeData().postformat(e)}function Xx(n,e){return this.isValid()&&(Kt(n)&&n.isValid()||Ne(n).isValid())?Qt({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Kx(n){return this.from(Ne(),n)}function Zx(n,e){return this.isValid()&&(Kt(n)&&n.isValid()||Ne(n).isValid())?Qt({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qx(n){return this.to(Ne(),n)}function lh(n){var e;return n===void 0?this._locale._abbr:(e=In(n),e!=null&&(this._locale=e),this)}var ch=Vt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function uh(){return this._locale}var jo=1e3,ur=60*jo,$o=60*ur,dh=(365*400+97)*24*$o;function dr(n,e){return(n%e+e)%e}function hh(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-dh:new Date(n,e,t).valueOf()}function fh(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-dh:Date.UTC(n,e,t)}function e1(n){var e,t;if(n=Dt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?fh:hh,n){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=dr(e+(this._isUTC?0:this.utcOffset()*ur),$o);break;case"minute":e=this._d.valueOf(),e-=dr(e,ur);break;case"second":e=this._d.valueOf(),e-=dr(e,jo);break}return this._d.setTime(e),W.updateOffset(this,!0),this}function t1(n){var e,t;if(n=Dt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?fh:hh,n){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=$o-dr(e+(this._isUTC?0:this.utcOffset()*ur),$o)-1;break;case"minute":e=this._d.valueOf(),e+=ur-dr(e,ur)-1;break;case"second":e=this._d.valueOf(),e+=jo-dr(e,jo)-1;break}return this._d.setTime(e),W.updateOffset(this,!0),this}function n1(){return this._d.valueOf()-(this._offset||0)*6e4}function s1(){return Math.floor(this.valueOf()/1e3)}function r1(){return new Date(this.valueOf())}function i1(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function o1(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function a1(){return this.isValid()?this.toISOString():null}function l1(){return Nl(this)}function c1(){return ns({},de(this))}function u1(){return de(this).overflow}function d1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ie("N",0,0,"eraAbbr"),ie("NN",0,0,"eraAbbr"),ie("NNN",0,0,"eraAbbr"),ie("NNNN",0,0,"eraName"),ie("NNNNN",0,0,"eraNarrow"),ie("y",["y",1],"yo","eraYear"),ie("y",["yy",2],0,"eraYear"),ie("y",["yyy",3],0,"eraYear"),ie("y",["yyyy",4],0,"eraYear"),J("N",ec),J("NN",ec),J("NNN",ec),J("NNNN",C1),J("NNNNN",S1),Ee(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,s){var r=t._locale.erasParse(n,s,t._strict);r?de(t).era=r:de(t).invalidEra=n}),J("y",or),J("yy",or),J("yyy",or),J("yyyy",or),J("yo",E1),Ee(["y","yy","yyy","yyyy"],dt),Ee(["yo"],function(n,e,t,s){var r;t._locale._eraYearOrdinalRegex&&(r=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[dt]=t._locale.eraYearOrdinalParse(n,r):e[dt]=parseInt(n,10)});function h1(n,e){var t,s,r,i=this._eras||In("en")._eras;for(t=0,s=i.length;t<s;++t){switch(typeof i[t].since){case"string":r=W(i[t].since).startOf("day"),i[t].since=r.valueOf();break}switch(typeof i[t].until){case"undefined":i[t].until=1/0;break;case"string":r=W(i[t].until).startOf("day").valueOf(),i[t].until=r.valueOf();break}}return i}function f1(n,e,t){var s,r,i=this.eras(),o,a,c;for(n=n.toUpperCase(),s=0,r=i.length;s<r;++s)if(o=i[s].name.toUpperCase(),a=i[s].abbr.toUpperCase(),c=i[s].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(a===n)return i[s];break;case"NNNN":if(o===n)return i[s];break;case"NNNNN":if(c===n)return i[s];break}else if([o,a,c].indexOf(n)>=0)return i[s]}function p1(n,e){var t=n.since<=n.until?1:-1;return e===void 0?W(n.since).year():W(n.since).year()+(e-n.offset)*t}function g1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].name;return""}function m1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].narrow;return""}function y1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].abbr;return""}function b1(){var n,e,t,s,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=r[n].since<=r[n].until?1:-1,s=this.clone().startOf("day").valueOf(),r[n].since<=s&&s<=r[n].until||r[n].until<=s&&s<=r[n].since)return(this.year()-W(r[n].since).year())*t+r[n].offset;return this.year()}function w1(n){return xe(this,"_erasNameRegex")||tc.call(this),n?this._erasNameRegex:this._erasRegex}function x1(n){return xe(this,"_erasAbbrRegex")||tc.call(this),n?this._erasAbbrRegex:this._erasRegex}function v1(n){return xe(this,"_erasNarrowRegex")||tc.call(this),n?this._erasNarrowRegex:this._erasRegex}function ec(n,e){return e.erasAbbrRegex(n)}function C1(n,e){return e.erasNameRegex(n)}function S1(n,e){return e.erasNarrowRegex(n)}function E1(n,e){return e._eraYearOrdinalRegex||or}function tc(){var n=[],e=[],t=[],s=[],r,i,o,a,c,u=this.eras();for(r=0,i=u.length;r<i;++r)o=Vn(u[r].name),a=Vn(u[r].abbr),c=Vn(u[r].narrow),e.push(o),n.push(a),t.push(c),s.push(o),s.push(a),s.push(c);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}ie(0,["gg",2],0,function(){return this.weekYear()%100}),ie(0,["GG",2],0,function(){return this.isoWeekYear()%100});function zo(n,e){ie(0,[n,n.length],0,e)}zo("gggg","weekYear"),zo("ggggg","weekYear"),zo("GGGG","isoWeekYear"),zo("GGGGG","isoWeekYear"),J("G",Ao),J("g",Ao),J("GG",Pe,Nt),J("gg",Pe,Nt),J("GGGG",Bl,Il),J("gggg",Bl,Il),J("GGGGG",No,Mo),J("ggggg",No,Mo),bi(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,s){e[s.substr(0,2)]=me(n)}),bi(["gg","GG"],function(n,e,t,s){e[s]=W.parseTwoDigitYear(n)});function O1(n){return ph.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function M1(n){return ph.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function P1(){return Ln(this.year(),1,4)}function N1(){return Ln(this.isoWeekYear(),1,4)}function A1(){var n=this.localeData()._week;return Ln(this.year(),n.dow,n.doy)}function _1(){var n=this.localeData()._week;return Ln(this.weekYear(),n.dow,n.doy)}function ph(n,e,t,s,r){var i;return n==null?Ci(this,s,r).year:(i=Ln(n,s,r),e>i&&(e=i),T1.call(this,n,e,t,s,r))}function T1(n,e,t,s,r){var i=Gd(n,e,t,s,r),o=vi(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}ie("Q",0,"Qo","quarter"),J("Q",Dd),Ee("Q",function(n,e){e[Dn]=(me(n)-1)*3});function k1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}ie("D",["DD",2],"Do","date"),J("D",Pe,ar),J("DD",Pe,Nt),J("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Ee(["D","DD"],wn),Ee("Do",function(n,e){e[wn]=me(n.match(Pe)[0])});var gh=lr("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),J("DDD",Po),J("DDDD",Rd),Ee(["DDD","DDDD"],function(n,e,t){t._dayOfYear=me(n)});function V1(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}ie("m",["mm",2],0,"minute"),J("m",Pe,jl),J("mm",Pe,Nt),Ee(["m","mm"],Zt);var D1=lr("Minutes",!1);ie("s",["ss",2],0,"second"),J("s",Pe,jl),J("ss",Pe,Nt),Ee(["s","ss"],Rn);var R1=lr("Seconds",!1);ie("S",0,0,function(){return~~(this.millisecond()/100)}),ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ie(0,["SSS",3],0,"millisecond"),ie(0,["SSSS",4],0,function(){return this.millisecond()*10}),ie(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),J("S",Po,Dd),J("SS",Po,Nt),J("SSS",Po,Rd);var rs,mh;for(rs="SSSS";rs.length<=9;rs+="S")J(rs,or);function L1(n,e){e[ks]=me(("0."+n)*1e3)}for(rs="S";rs.length<=9;rs+="S")Ee(rs,L1);mh=lr("Milliseconds",!1),ie("z",0,0,"zoneAbbr"),ie("zz",0,0,"zoneName");function I1(){return this._isUTC?"UTC":""}function B1(){return this._isUTC?"Coordinated Universal Time":""}var z=mi.prototype;z.add=_x,z.calendar=Ix,z.clone=Bx,z.diff=Gx,z.endOf=t1,z.format=Jx,z.from=Xx,z.fromNow=Kx,z.to=Zx,z.toNow=Qx,z.get=q0,z.invalidAt=u1,z.isAfter=jx,z.isBefore=$x,z.isBetween=zx,z.isSame=Fx,z.isSameOrAfter=Ux,z.isSameOrBefore=Hx,z.isValid=l1,z.lang=ch,z.locale=lh,z.localeData=uh,z.max=lx,z.min=ax,z.parsingFlags=c1,z.set=J0,z.startOf=e1,z.subtract=Tx,z.toArray=i1,z.toObject=o1,z.toDate=r1,z.toISOString=Yx,z.inspect=qx,typeof Symbol<"u"&&Symbol.for!=null&&(z[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),z.toJSON=a1,z.toString=Wx,z.unix=s1,z.valueOf=n1,z.creationData=d1,z.eraName=g1,z.eraNarrow=m1,z.eraAbbr=y1,z.eraYear=b1,z.year=Bd,z.isLeapYear=Y0,z.weekYear=O1,z.isoWeekYear=M1,z.quarter=z.quarters=k1,z.month=Ud,z.daysInMonth=rw,z.week=z.weeks=hw,z.isoWeek=z.isoWeeks=fw,z.weeksInYear=A1,z.weeksInWeekYear=_1,z.isoWeeksInYear=P1,z.isoWeeksInISOWeekYear=N1,z.date=gh,z.day=z.days=Mw,z.weekday=Pw,z.isoWeekday=Nw,z.dayOfYear=V1,z.hour=z.hours=Rw,z.minute=z.minutes=D1,z.second=z.seconds=R1,z.millisecond=z.milliseconds=mh,z.utcOffset=yx,z.utc=wx,z.local=xx,z.parseZone=vx,z.hasAlignedHourOffset=Cx,z.isDST=Sx,z.isLocal=Ox,z.isUtcOffset=Mx,z.isUtc=sh,z.isUTC=sh,z.zoneAbbr=I1,z.zoneName=B1,z.dates=Vt("dates accessor is deprecated. Use date instead.",gh),z.months=Vt("months accessor is deprecated. Use month instead",Ud),z.years=Vt("years accessor is deprecated. Use year instead",Bd),z.zone=Vt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",bx),z.isDSTShifted=Vt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ex);function j1(n){return Ne(n*1e3)}function $1(){return Ne.apply(null,arguments).parseZone()}function yh(n){return n}var ve=kl.prototype;ve.calendar=O0,ve.longDateFormat=A0,ve.invalidDate=T0,ve.ordinal=D0,ve.preparse=yh,ve.postformat=yh,ve.relativeTime=L0,ve.pastFuture=I0,ve.set=S0,ve.eras=h1,ve.erasParse=f1,ve.erasConvertYear=p1,ve.erasAbbrRegex=x1,ve.erasNameRegex=w1,ve.erasNarrowRegex=v1,ve.months=ew,ve.monthsShort=tw,ve.monthsParse=sw,ve.monthsRegex=ow,ve.monthsShortRegex=iw,ve.week=lw,ve.firstDayOfYear=dw,ve.firstDayOfWeek=uw,ve.weekdays=vw,ve.weekdaysMin=Sw,ve.weekdaysShort=Cw,ve.weekdaysParse=Ow,ve.weekdaysRegex=Aw,ve.weekdaysShortRegex=_w,ve.weekdaysMinRegex=Tw,ve.isPM=Vw,ve.meridiem=Lw;function Fo(n,e,t,s){var r=In(),i=mn().set(s,e);return r[t](i,n)}function bh(n,e,t){if(kn(n)&&(e=n,n=void 0),n=n||"",e!=null)return Fo(n,e,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Fo(n,s,t,"month");return r}function nc(n,e,t,s){typeof n=="boolean"?(kn(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,kn(e)&&(t=e,e=void 0),e=e||"");var r=In(),i=n?r._week.dow:0,o,a=[];if(t!=null)return Fo(e,(t+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Fo(e,(o+i)%7,s,"day");return a}function z1(n,e){return bh(n,e,"months")}function F1(n,e){return bh(n,e,"monthsShort")}function U1(n,e,t){return nc(n,e,t,"weekdays")}function H1(n,e,t){return nc(n,e,t,"weekdaysShort")}function G1(n,e,t){return nc(n,e,t,"weekdaysMin")}ss("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var e=n%10,t=me(n%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return n+t}}),W.lang=Vt("moment.lang is deprecated. Use moment.locale instead.",ss),W.langData=Vt("moment.langData is deprecated. Use moment.localeData instead.",In);var Bn=Math.abs;function W1(){var n=this._data;return this._milliseconds=Bn(this._milliseconds),this._days=Bn(this._days),this._months=Bn(this._months),n.milliseconds=Bn(n.milliseconds),n.seconds=Bn(n.seconds),n.minutes=Bn(n.minutes),n.hours=Bn(n.hours),n.months=Bn(n.months),n.years=Bn(n.years),this}function wh(n,e,t,s){var r=Qt(e,t);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function Y1(n,e){return wh(this,n,e,1)}function q1(n,e){return wh(this,n,e,-1)}function xh(n){return n<0?Math.floor(n):Math.ceil(n)}function J1(){var n=this._milliseconds,e=this._days,t=this._months,s=this._data,r,i,o,a,c;return n>=0&&e>=0&&t>=0||n<=0&&e<=0&&t<=0||(n+=xh(sc(t)+e)*864e5,e=0,t=0),s.milliseconds=n%1e3,r=Rt(n/1e3),s.seconds=r%60,i=Rt(r/60),s.minutes=i%60,o=Rt(i/60),s.hours=o%24,e+=Rt(o/24),c=Rt(vh(e)),t+=c,e-=xh(sc(c)),a=Rt(t/12),t%=12,s.days=e,s.months=t,s.years=a,this}function vh(n){return n*4800/146097}function sc(n){return n*146097/4800}function X1(n){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(n=Dt(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+s/864e5,t=this._months+vh(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(sc(this._months)),n){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+n)}}function jn(n){return function(){return this.as(n)}}var Ch=jn("ms"),K1=jn("s"),Z1=jn("m"),Q1=jn("h"),ev=jn("d"),tv=jn("w"),nv=jn("M"),sv=jn("Q"),rv=jn("y"),iv=Ch;function ov(){return Qt(this)}function av(n){return n=Dt(n),this.isValid()?this[n+"s"]():NaN}function Ds(n){return function(){return this.isValid()?this._data[n]:NaN}}var lv=Ds("milliseconds"),cv=Ds("seconds"),uv=Ds("minutes"),dv=Ds("hours"),hv=Ds("days"),fv=Ds("months"),pv=Ds("years");function gv(){return Rt(this.days()/7)}var $n=Math.round,hr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function mv(n,e,t,s,r){return r.relativeTime(e||1,!!t,n,s)}function yv(n,e,t,s){var r=Qt(n).abs(),i=$n(r.as("s")),o=$n(r.as("m")),a=$n(r.as("h")),c=$n(r.as("d")),u=$n(r.as("M")),d=$n(r.as("w")),f=$n(r.as("y")),h=i<=t.ss&&["s",i]||i<t.s&&["ss",i]||o<=1&&["m"]||o<t.m&&["mm",o]||a<=1&&["h"]||a<t.h&&["hh",a]||c<=1&&["d"]||c<t.d&&["dd",c];return t.w!=null&&(h=h||d<=1&&["w"]||d<t.w&&["ww",d]),h=h||u<=1&&["M"]||u<t.M&&["MM",u]||f<=1&&["y"]||["yy",f],h[2]=e,h[3]=+n>0,h[4]=s,mv.apply(null,h)}function bv(n){return n===void 0?$n:typeof n=="function"?($n=n,!0):!1}function wv(n,e){return hr[n]===void 0?!1:e===void 0?hr[n]:(hr[n]=e,n==="s"&&(hr.ss=e-1),!0)}function xv(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=hr,r,i;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(s=Object.assign({},hr,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),r=this.localeData(),i=yv(this,!t,s,r),t&&(i=r.pastFuture(+this,i)),r.postformat(i)}var rc=Math.abs;function fr(n){return(n>0)-(n<0)||+n}function Uo(){if(!this.isValid())return this.localeData().invalidDate();var n=rc(this._milliseconds)/1e3,e=rc(this._days),t=rc(this._months),s,r,i,o,a=this.asSeconds(),c,u,d,f;return a?(s=Rt(n/60),r=Rt(s/60),n%=60,s%=60,i=Rt(t/12),t%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=fr(this._months)!==fr(a)?"-":"",d=fr(this._days)!==fr(a)?"-":"",f=fr(this._milliseconds)!==fr(a)?"-":"",c+"P"+(i?u+i+"Y":"")+(t?u+t+"M":"")+(e?d+e+"D":"")+(r||s||n?"T":"")+(r?f+r+"H":"")+(s?f+s+"M":"")+(n?f+o+"S":"")):"P0D"}var we=Lo.prototype;we.isValid=fx,we.abs=W1,we.add=Y1,we.subtract=q1,we.as=X1,we.asMilliseconds=Ch,we.asSeconds=K1,we.asMinutes=Z1,we.asHours=Q1,we.asDays=ev,we.asWeeks=tv,we.asMonths=nv,we.asQuarters=sv,we.asYears=rv,we.valueOf=iv,we._bubble=J1,we.clone=ov,we.get=av,we.milliseconds=lv,we.seconds=cv,we.minutes=uv,we.hours=dv,we.days=hv,we.weeks=gv,we.months=fv,we.years=pv,we.humanize=xv,we.toISOString=Uo,we.toString=Uo,we.toJSON=Uo,we.locale=lh,we.localeData=uh,we.toIsoString=Vt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Uo),we.lang=ch,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),J("x",Ao),J("X",z0),Ee("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)}),Ee("x",function(n,e,t){t._d=new Date(me(n))});//! moment.js
10
+ W.version="2.30.1",v0(Ne),W.fn=z,W.min=cx,W.max=ux,W.now=dx,W.utc=mn,W.unix=j1,W.months=z1,W.isDate=gi,W.locale=ss,W.invalid=So,W.duration=Qt,W.isMoment=Kt,W.weekdays=U1,W.parseZone=$1,W.localeData=In,W.isDuration=Io,W.monthsShort=F1,W.weekdaysMin=G1,W.defineLocale=Gl,W.updateLocale=$w,W.locales=zw,W.weekdaysShort=H1,W.normalizeUnits=Dt,W.relativeTimeRounding=bv,W.relativeTimeThreshold=wv,W.calendarFormat=Lx,W.prototype=z,W.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const vv='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Cv=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,Sh=n=>Array.from(n.querySelectorAll(vv)).filter(e=>Sv(e)&&Cv(e)),Sv=n=>{if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.disabled)return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return!(n.type==="hidden"||n.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},zn=(n,e,{checkForDefaultPrevented:t=!0}={})=>r=>{const i=n==null?void 0:n(r);if(t===!1||!i)return e==null?void 0:e(r)};var Eh;const Ge=typeof window<"u",Ev=n=>typeof n=="string",Oh=()=>{},Ov=Ge&&((Eh=window==null?void 0:window.navigator)==null?void 0:Eh.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function ic(n){return typeof n=="function"?n():l.unref(n)}function Mv(n){return n}function Ho(n){return l.getCurrentScope()?(l.onScopeDispose(n),!0):!1}function Pv(n,e=!0){l.getCurrentInstance()?l.onMounted(n):e?n():l.nextTick(n)}function Nv(n,e,t={}){const{immediate:s=!0}=t,r=l.ref(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,o()}function c(...u){o(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,n(...u)},ic(e))}return s&&(r.value=!0,Ge&&c()),Ho(a),{isPending:l.readonly(r),start:c,stop:a}}function is(n){var e;const t=ic(n);return(e=t==null?void 0:t.$el)!=null?e:t}const oc=Ge?window:void 0;function Fn(...n){let e,t,s,r;if(Ev(n[0])||Array.isArray(n[0])?([t,s,r]=n,e=oc):[e,t,s,r]=n,!e)return Oh;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},a=(d,f,h,p)=>(d.addEventListener(f,h,p),()=>d.removeEventListener(f,h,p)),c=l.watch(()=>[is(e),ic(r)],([d,f])=>{o(),d&&i.push(...t.flatMap(h=>s.map(p=>a(d,h,p,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return Ho(u),u}let Mh=!1;function Av(n,e,t={}){const{window:s=oc,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return;Ov&&!Mh&&(Mh=!0,Array.from(s.document.body.children).forEach(h=>h.addEventListener("click",Oh)));let a=!0;const c=h=>r.some(p=>{if(typeof p=="string")return Array.from(s.document.querySelectorAll(p)).some(g=>g===h.target||h.composedPath().includes(g));{const g=is(p);return g&&(h.target===g||h.composedPath().includes(g))}}),d=[Fn(s,"click",h=>{const p=is(n);if(!(!p||p===h.target||h.composedPath().includes(p))){if(h.detail===0&&(a=!c(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:i}),Fn(s,"pointerdown",h=>{const p=is(n);p&&(a=!h.composedPath().includes(p)&&!c(h))},{passive:!0}),o&&Fn(s,"blur",h=>{var p;const g=is(n);((p=s.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(g!=null&&g.contains(s.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function _v(n,e=!1){const t=l.ref(),s=()=>t.value=!!n();return s(),Pv(s,e),t}const Ph=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nh="__vueuse_ssr_handlers__";Ph[Nh]=Ph[Nh]||{};var Ah=Object.getOwnPropertySymbols,Tv=Object.prototype.hasOwnProperty,kv=Object.prototype.propertyIsEnumerable,Vv=(n,e)=>{var t={};for(var s in n)Tv.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&Ah)for(var s of Ah(n))e.indexOf(s)<0&&kv.call(n,s)&&(t[s]=n[s]);return t};function _h(n,e,t={}){const s=t,{window:r=oc}=s,i=Vv(s,["window"]);let o;const a=_v(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},u=l.watch(()=>is(n),f=>{c(),a.value&&r&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Ho(d),{isSupported:a,stop:d}}var Th;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(Th||(Th={}));var Dv=Object.defineProperty,kh=Object.getOwnPropertySymbols,Rv=Object.prototype.hasOwnProperty,Lv=Object.prototype.propertyIsEnumerable,Vh=(n,e,t)=>e in n?Dv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Iv=(n,e)=>{for(var t in e||(e={}))Rv.call(e,t)&&Vh(n,t,e[t]);if(kh)for(var t of kh(e))Lv.call(e,t)&&Vh(n,t,e[t]);return n};Iv({linear:Mv},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Bv=()=>Ge&&/firefox/i.test(window.navigator.userAgent);/**
11
11
  * @vue/shared v3.5.12
12
12
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
13
  * @license MIT
14
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const as=()=>{},Pv=Object.prototype.hasOwnProperty,Fo=(n,e)=>Pv.call(n,e),Av=Array.isArray,Lt=n=>typeof n=="function",Zt=n=>typeof n=="string",fr=n=>n!==null&&typeof n=="object",Nv=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Tv=/-(\w)/g,_v=Nv(n=>n.replace(Tv,(e,t)=>t?t.toUpperCase():""));var Eh=typeof global=="object"&&global&&global.Object===Object&&global,kv=typeof self=="object"&&self&&self.Object===Object&&self,Qt=Eh||kv||Function("return this")(),It=Qt.Symbol,Oh=Object.prototype,Dv=Oh.hasOwnProperty,Rv=Oh.toString,Si=It?It.toStringTag:void 0;function Lv(n){var e=Dv.call(n,Si),t=n[Si];try{n[Si]=void 0;var s=!0}catch{}var r=Rv.call(n);return s&&(e?n[Si]=t:delete n[Si]),r}var Iv=Object.prototype,Vv=Iv.toString;function Bv(n){return Vv.call(n)}var jv="[object Null]",$v="[object Undefined]",Mh=It?It.toStringTag:void 0;function ls(n){return n==null?n===void 0?$v:jv:Mh&&Mh in Object(n)?Lv(n):Bv(n)}function en(n){return n!=null&&typeof n=="object"}var zv="[object Symbol]";function bn(n){return typeof n=="symbol"||en(n)&&ls(n)==zv}function Uo(n,e){for(var t=-1,s=n==null?0:n.length,r=Array(s);++t<s;)r[t]=e(n[t],t,n);return r}var ht=Array.isArray,Fv=1/0,Ph=It?It.prototype:void 0,Ah=Ph?Ph.toString:void 0;function Nh(n){if(typeof n=="string")return n;if(ht(n))return Uo(n,Nh)+"";if(bn(n))return Ah?Ah.call(n):"";var e=n+"";return e=="0"&&1/n==-Fv?"-0":e}var Uv=/\s/;function Hv(n){for(var e=n.length;e--&&Uv.test(n.charAt(e)););return e}var Gv=/^\s+/;function Yv(n){return n&&n.slice(0,Hv(n)+1).replace(Gv,"")}function Ie(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Th=NaN,Wv=/^[-+]0x[0-9a-f]+$/i,qv=/^0b[01]+$/i,Jv=/^0o[0-7]+$/i,Xv=parseInt;function Ei(n){if(typeof n=="number")return n;if(bn(n))return Th;if(Ie(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ie(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Yv(n);var t=qv.test(n);return t||Jv.test(n)?Xv(n.slice(2),t?2:8):Wv.test(n)?Th:+n}function pr(n){return n}var Kv="[object AsyncFunction]",Zv="[object Function]",Qv="[object GeneratorFunction]",eC="[object Proxy]";function tc(n){if(!Ie(n))return!1;var e=ls(n);return e==Zv||e==Qv||e==Kv||e==eC}var nc=Qt["__core-js_shared__"],_h=function(){var n=/[^.]+$/.exec(nc&&nc.keys&&nc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function tC(n){return!!_h&&_h in n}var nC=Function.prototype,sC=nC.toString;function Vs(n){if(n!=null){try{return sC.call(n)}catch{}try{return n+""}catch{}}return""}var rC=/[\\^$.*+?()[\]{}|]/g,iC=/^\[object .+?Constructor\]$/,oC=Function.prototype,aC=Object.prototype,lC=oC.toString,cC=aC.hasOwnProperty,uC=RegExp("^"+lC.call(cC).replace(rC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dC(n){if(!Ie(n)||tC(n))return!1;var e=tc(n)?uC:iC;return e.test(Vs(n))}function hC(n,e){return n==null?void 0:n[e]}function Bs(n,e){var t=hC(n,e);return dC(t)?t:void 0}var sc=Bs(Qt,"WeakMap"),kh=Object.create,fC=function(){function n(){}return function(e){if(!Ie(e))return{};if(kh)return kh(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Dh(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function pC(){}function Rh(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var gC=800,mC=16,yC=Date.now;function bC(n){var e=0,t=0;return function(){var s=yC(),r=mC-(s-t);if(t=s,r>0){if(++e>=gC)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function wC(n){return function(){return n}}var Ho=function(){try{var n=Bs(Object,"defineProperty");return n({},"",{}),n}catch{}}(),xC=Ho?function(n,e){return Ho(n,"toString",{configurable:!0,enumerable:!1,value:wC(e),writable:!0})}:pr,Lh=bC(xC);function vC(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}function CC(n,e,t,s){for(var r=n.length,i=t+-1;++i<r;)if(e(n[i],i,n))return i;return-1}function SC(n){return n!==n}function EC(n,e,t){for(var s=t-1,r=n.length;++s<r;)if(n[s]===e)return s;return-1}function OC(n,e,t){return e===e?EC(n,e,t):CC(n,SC,t)}function Ih(n,e){var t=n==null?0:n.length;return!!t&&OC(n,e,0)>-1}var MC=9007199254740991,PC=/^(?:0|[1-9]\d*)$/;function Go(n,e){var t=typeof n;return e=e??MC,!!e&&(t=="number"||t!="symbol"&&PC.test(n))&&n>-1&&n%1==0&&n<e}function Yo(n,e,t){e=="__proto__"&&Ho?Ho(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function gr(n,e){return n===e||n!==n&&e!==e}var AC=Object.prototype,NC=AC.hasOwnProperty;function rc(n,e,t){var s=n[e];(!(NC.call(n,e)&&gr(s,t))||t===void 0&&!(e in n))&&Yo(n,e,t)}function Oi(n,e,t,s){var r=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],c=void 0;c===void 0&&(c=n[a]),r?Yo(t,a,c):rc(t,a,c)}return t}var Vh=Math.max;function Bh(n,e,t){return e=Vh(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Vh(s.length-e,0),o=Array(i);++r<i;)o[r]=s[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=s[r];return a[e]=t(o),Dh(n,this,a)}}function mr(n,e){return Lh(Bh(n,e,pr),n+"")}var TC=9007199254740991;function ic(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=TC}function js(n){return n!=null&&ic(n.length)&&!tc(n)}function Wo(n,e,t){if(!Ie(t))return!1;var s=typeof e;return(s=="number"?js(t)&&Go(e,t.length):s=="string"&&e in t)?gr(t[e],n):!1}function jh(n){return mr(function(e,t){var s=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&Wo(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++s<r;){var a=t[s];a&&n(e,a,s,i)}return e})}var _C=Object.prototype;function qo(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||_C;return n===t}function kC(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var DC="[object Arguments]";function $h(n){return en(n)&&ls(n)==DC}var zh=Object.prototype,RC=zh.hasOwnProperty,LC=zh.propertyIsEnumerable,yr=$h(function(){return arguments}())?$h:function(n){return en(n)&&RC.call(n,"callee")&&!LC.call(n,"callee")};function IC(){return!1}var Fh=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Uh=Fh&&typeof module=="object"&&module&&!module.nodeType&&module,VC=Uh&&Uh.exports===Fh,Hh=VC?Qt.Buffer:void 0,BC=Hh?Hh.isBuffer:void 0,br=BC||IC,jC="[object Arguments]",$C="[object Array]",zC="[object Boolean]",FC="[object Date]",UC="[object Error]",HC="[object Function]",GC="[object Map]",YC="[object Number]",WC="[object Object]",qC="[object RegExp]",JC="[object Set]",XC="[object String]",KC="[object WeakMap]",ZC="[object ArrayBuffer]",QC="[object DataView]",eS="[object Float32Array]",tS="[object Float64Array]",nS="[object Int8Array]",sS="[object Int16Array]",rS="[object Int32Array]",iS="[object Uint8Array]",oS="[object Uint8ClampedArray]",aS="[object Uint16Array]",lS="[object Uint32Array]",Ae={};Ae[eS]=Ae[tS]=Ae[nS]=Ae[sS]=Ae[rS]=Ae[iS]=Ae[oS]=Ae[aS]=Ae[lS]=!0,Ae[jC]=Ae[$C]=Ae[ZC]=Ae[zC]=Ae[QC]=Ae[FC]=Ae[UC]=Ae[HC]=Ae[GC]=Ae[YC]=Ae[WC]=Ae[qC]=Ae[JC]=Ae[XC]=Ae[KC]=!1;function cS(n){return en(n)&&ic(n.length)&&!!Ae[ls(n)]}function Jo(n){return function(e){return n(e)}}var Gh=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Mi=Gh&&typeof module=="object"&&module&&!module.nodeType&&module,uS=Mi&&Mi.exports===Gh,oc=uS&&Eh.process,wr=function(){try{var n=Mi&&Mi.require&&Mi.require("util").types;return n||oc&&oc.binding&&oc.binding("util")}catch{}}(),Yh=wr&&wr.isTypedArray,Xo=Yh?Jo(Yh):cS,dS=Object.prototype,hS=dS.hasOwnProperty;function Wh(n,e){var t=ht(n),s=!t&&yr(n),r=!t&&!s&&br(n),i=!t&&!s&&!r&&Xo(n),o=t||s||r||i,a=o?kC(n.length,String):[],c=a.length;for(var u in n)(e||hS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Go(u,c)))&&a.push(u);return a}function qh(n,e){return function(t){return n(e(t))}}var fS=qh(Object.keys,Object),pS=Object.prototype,gS=pS.hasOwnProperty;function Jh(n){if(!qo(n))return fS(n);var e=[];for(var t in Object(n))gS.call(n,t)&&t!="constructor"&&e.push(t);return e}function Pi(n){return js(n)?Wh(n):Jh(n)}function mS(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var yS=Object.prototype,bS=yS.hasOwnProperty;function wS(n){if(!Ie(n))return mS(n);var e=qo(n),t=[];for(var s in n)s=="constructor"&&(e||!bS.call(n,s))||t.push(s);return t}function xr(n){return js(n)?Wh(n,!0):wS(n)}var xS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vS=/^\w*$/;function ac(n,e){if(ht(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||bn(n)?!0:vS.test(n)||!xS.test(n)||e!=null&&n in Object(e)}var Ai=Bs(Object,"create");function CS(){this.__data__=Ai?Ai(null):{},this.size=0}function SS(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var ES="__lodash_hash_undefined__",OS=Object.prototype,MS=OS.hasOwnProperty;function PS(n){var e=this.__data__;if(Ai){var t=e[n];return t===ES?void 0:t}return MS.call(e,n)?e[n]:void 0}var AS=Object.prototype,NS=AS.hasOwnProperty;function TS(n){var e=this.__data__;return Ai?e[n]!==void 0:NS.call(e,n)}var _S="__lodash_hash_undefined__";function kS(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ai&&e===void 0?_S:e,this}function $s(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}$s.prototype.clear=CS,$s.prototype.delete=SS,$s.prototype.get=PS,$s.prototype.has=TS,$s.prototype.set=kS;function DS(){this.__data__=[],this.size=0}function Ko(n,e){for(var t=n.length;t--;)if(gr(n[t][0],e))return t;return-1}var RS=Array.prototype,LS=RS.splice;function IS(n){var e=this.__data__,t=Ko(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():LS.call(e,t,1),--this.size,!0}function VS(n){var e=this.__data__,t=Ko(e,n);return t<0?void 0:e[t][1]}function BS(n){return Ko(this.__data__,n)>-1}function jS(n,e){var t=this.__data__,s=Ko(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Fn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Fn.prototype.clear=DS,Fn.prototype.delete=IS,Fn.prototype.get=VS,Fn.prototype.has=BS,Fn.prototype.set=jS;var Ni=Bs(Qt,"Map");function $S(){this.size=0,this.__data__={hash:new $s,map:new(Ni||Fn),string:new $s}}function zS(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Zo(n,e){var t=n.__data__;return zS(e)?t[typeof e=="string"?"string":"hash"]:t.map}function FS(n){var e=Zo(this,n).delete(n);return this.size-=e?1:0,e}function US(n){return Zo(this,n).get(n)}function HS(n){return Zo(this,n).has(n)}function GS(n,e){var t=Zo(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function Un(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Un.prototype.clear=$S,Un.prototype.delete=FS,Un.prototype.get=US,Un.prototype.has=HS,Un.prototype.set=GS;var YS="Expected a function";function lc(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(YS);var t=function(){var s=arguments,r=e?e.apply(this,s):s[0],i=t.cache;if(i.has(r))return i.get(r);var o=n.apply(this,s);return t.cache=i.set(r,o)||i,o};return t.cache=new(lc.Cache||Un),t}lc.Cache=Un;var WS=500;function qS(n){var e=lc(n,function(s){return t.size===WS&&t.clear(),s}),t=e.cache;return e}var JS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XS=/\\(\\)?/g,KS=qS(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(JS,function(t,s,r,i){e.push(r?i.replace(XS,"$1"):s||t)}),e});function Ti(n){return n==null?"":Nh(n)}function Qo(n,e){return ht(n)?n:ac(n,e)?[n]:KS(Ti(n))}var ZS=1/0;function _i(n){if(typeof n=="string"||bn(n))return n;var e=n+"";return e=="0"&&1/n==-ZS?"-0":e}function ea(n,e){e=Qo(e,n);for(var t=0,s=e.length;n!=null&&t<s;)n=n[_i(e[t++])];return t&&t==s?n:void 0}function Xh(n,e,t){var s=n==null?void 0:ea(n,e);return s===void 0?t:s}function cc(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var Kh=It?It.isConcatSpreadable:void 0;function QS(n){return ht(n)||yr(n)||!!(Kh&&n&&n[Kh])}function ta(n,e,t,s,r){var i=-1,o=n.length;for(t||(t=QS),r||(r=[]);++i<o;){var a=n[i];t(a)?cc(r,a):s||(r[r.length]=a)}return r}function eE(n){var e=n==null?0:n.length;return e?ta(n):[]}function tE(n){return Lh(Bh(n,void 0,eE),n+"")}var uc=qh(Object.getPrototypeOf,Object),nE="[object Object]",sE=Function.prototype,rE=Object.prototype,Zh=sE.toString,iE=rE.hasOwnProperty,oE=Zh.call(Object);function wn(n){if(!en(n)||ls(n)!=nE)return!1;var e=uc(n);if(e===null)return!0;var t=iE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Zh.call(t)==oE}function aE(n,e,t){var s=-1,r=n.length;e<0&&(e=-e>r?0:r+e),t=t>r?r:t,t<0&&(t+=r),r=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(r);++s<r;)i[s]=n[s+e];return i}function lE(n,e,t){var s=n.length;return t=t===void 0?s:t,!e&&t>=s?n:aE(n,e,t)}var cE="\\ud800-\\udfff",uE="\\u0300-\\u036f",dE="\\ufe20-\\ufe2f",hE="\\u20d0-\\u20ff",fE=uE+dE+hE,pE="\\ufe0e\\ufe0f",gE="\\u200d",mE=RegExp("["+gE+cE+fE+pE+"]");function Qh(n){return mE.test(n)}function yE(n){return n.split("")}var ef="\\ud800-\\udfff",bE="\\u0300-\\u036f",wE="\\ufe20-\\ufe2f",xE="\\u20d0-\\u20ff",vE=bE+wE+xE,CE="\\ufe0e\\ufe0f",SE="["+ef+"]",dc="["+vE+"]",hc="\\ud83c[\\udffb-\\udfff]",EE="(?:"+dc+"|"+hc+")",tf="[^"+ef+"]",nf="(?:\\ud83c[\\udde6-\\uddff]){2}",sf="[\\ud800-\\udbff][\\udc00-\\udfff]",OE="\\u200d",rf=EE+"?",of="["+CE+"]?",ME="(?:"+OE+"(?:"+[tf,nf,sf].join("|")+")"+of+rf+")*",PE=of+rf+ME,AE="(?:"+[tf+dc+"?",dc,nf,sf,SE].join("|")+")",NE=RegExp(hc+"(?="+hc+")|"+AE+PE,"g");function TE(n){return n.match(NE)||[]}function _E(n){return Qh(n)?TE(n):yE(n)}function af(n){return function(e){e=Ti(e);var t=Qh(e)?_E(e):void 0,s=t?t[0]:e.charAt(0),r=t?lE(t,1).join(""):e.slice(1);return s[n]()+r}}var na=af("toUpperCase");function kE(n){return na(Ti(n).toLowerCase())}function DE(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;)t=e(t,n[r],r,n);return t}function RE(n){return function(e){return n==null?void 0:n[e]}}var LE={À:"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"},IE=RE(LE),VE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,BE="\\u0300-\\u036f",jE="\\ufe20-\\ufe2f",$E="\\u20d0-\\u20ff",zE=BE+jE+$E,FE="["+zE+"]",UE=RegExp(FE,"g");function HE(n){return n=Ti(n),n&&n.replace(VE,IE).replace(UE,"")}var GE=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function YE(n){return n.match(GE)||[]}var WE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function qE(n){return WE.test(n)}var lf="\\ud800-\\udfff",JE="\\u0300-\\u036f",XE="\\ufe20-\\ufe2f",KE="\\u20d0-\\u20ff",ZE=JE+XE+KE,cf="\\u2700-\\u27bf",uf="a-z\\xdf-\\xf6\\xf8-\\xff",QE="\\xac\\xb1\\xd7\\xf7",eO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tO="\\u2000-\\u206f",nO=" \\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",df="A-Z\\xc0-\\xd6\\xd8-\\xde",sO="\\ufe0e\\ufe0f",hf=QE+eO+tO+nO,ff="['’]",pf="["+hf+"]",rO="["+ZE+"]",gf="\\d+",iO="["+cf+"]",mf="["+uf+"]",yf="[^"+lf+hf+gf+cf+uf+df+"]",oO="\\ud83c[\\udffb-\\udfff]",aO="(?:"+rO+"|"+oO+")",lO="[^"+lf+"]",bf="(?:\\ud83c[\\udde6-\\uddff]){2}",wf="[\\ud800-\\udbff][\\udc00-\\udfff]",vr="["+df+"]",cO="\\u200d",xf="(?:"+mf+"|"+yf+")",uO="(?:"+vr+"|"+yf+")",vf="(?:"+ff+"(?:d|ll|m|re|s|t|ve))?",Cf="(?:"+ff+"(?:D|LL|M|RE|S|T|VE))?",Sf=aO+"?",Ef="["+sO+"]?",dO="(?:"+cO+"(?:"+[lO,bf,wf].join("|")+")"+Ef+Sf+")*",hO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pO=Ef+Sf+dO,gO="(?:"+[iO,bf,wf].join("|")+")"+pO,mO=RegExp([vr+"?"+mf+"+"+vf+"(?="+[pf,vr,"$"].join("|")+")",uO+"+"+Cf+"(?="+[pf,vr+xf,"$"].join("|")+")",vr+"?"+xf+"+"+vf,vr+"+"+Cf,fO,hO,gf,gO].join("|"),"g");function yO(n){return n.match(mO)||[]}function bO(n,e,t){return n=Ti(n),e=e,e===void 0?qE(n)?yO(n):YE(n):n.match(e)||[]}var wO="['’]",xO=RegExp(wO,"g");function Of(n){return function(e){return DE(bO(HE(e).replace(xO,"")),n,"")}}var sa=Of(function(n,e,t){return e=e.toLowerCase(),n+(t?kE(e):e)});function vO(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function wt(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Ei(t),t=t===t?t:0),e!==void 0&&(e=Ei(e),e=e===e?e:0),vO(Ei(n),e,t)}function CO(){this.__data__=new Fn,this.size=0}function SO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function EO(n){return this.__data__.get(n)}function OO(n){return this.__data__.has(n)}var MO=200;function PO(n,e){var t=this.__data__;if(t instanceof Fn){var s=t.__data__;if(!Ni||s.length<MO-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new Un(s)}return t.set(n,e),this.size=t.size,this}function tn(n){var e=this.__data__=new Fn(n);this.size=e.size}tn.prototype.clear=CO,tn.prototype.delete=SO,tn.prototype.get=EO,tn.prototype.has=OO,tn.prototype.set=PO;function AO(n,e){return n&&Oi(e,Pi(e),n)}function NO(n,e){return n&&Oi(e,xr(e),n)}var Mf=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Pf=Mf&&typeof module=="object"&&module&&!module.nodeType&&module,TO=Pf&&Pf.exports===Mf,Af=TO?Qt.Buffer:void 0,Nf=Af?Af.allocUnsafe:void 0;function Tf(n,e){if(e)return n.slice();var t=n.length,s=Nf?Nf(t):new n.constructor(t);return n.copy(s),s}function _O(n,e){for(var t=-1,s=n==null?0:n.length,r=0,i=[];++t<s;){var o=n[t];e(o,t,n)&&(i[r++]=o)}return i}function _f(){return[]}var kO=Object.prototype,DO=kO.propertyIsEnumerable,kf=Object.getOwnPropertySymbols,fc=kf?function(n){return n==null?[]:(n=Object(n),_O(kf(n),function(e){return DO.call(n,e)}))}:_f;function RO(n,e){return Oi(n,fc(n),e)}var LO=Object.getOwnPropertySymbols,Df=LO?function(n){for(var e=[];n;)cc(e,fc(n)),n=uc(n);return e}:_f;function IO(n,e){return Oi(n,Df(n),e)}function Rf(n,e,t){var s=e(n);return ht(n)?s:cc(s,t(n))}function pc(n){return Rf(n,Pi,fc)}function VO(n){return Rf(n,xr,Df)}var gc=Bs(Qt,"DataView"),mc=Bs(Qt,"Promise"),Cr=Bs(Qt,"Set"),Lf="[object Map]",BO="[object Object]",If="[object Promise]",Vf="[object Set]",Bf="[object WeakMap]",jf="[object DataView]",jO=Vs(gc),$O=Vs(Ni),zO=Vs(mc),FO=Vs(Cr),UO=Vs(sc),Vt=ls;(gc&&Vt(new gc(new ArrayBuffer(1)))!=jf||Ni&&Vt(new Ni)!=Lf||mc&&Vt(mc.resolve())!=If||Cr&&Vt(new Cr)!=Vf||sc&&Vt(new sc)!=Bf)&&(Vt=function(n){var e=ls(n),t=e==BO?n.constructor:void 0,s=t?Vs(t):"";if(s)switch(s){case jO:return jf;case $O:return Lf;case zO:return If;case FO:return Vf;case UO:return Bf}return e});var HO=Object.prototype,GO=HO.hasOwnProperty;function YO(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&GO.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ra=Qt.Uint8Array;function yc(n){var e=new n.constructor(n.byteLength);return new ra(e).set(new ra(n)),e}function WO(n,e){var t=e?yc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var qO=/\w*$/;function JO(n){var e=new n.constructor(n.source,qO.exec(n));return e.lastIndex=n.lastIndex,e}var $f=It?It.prototype:void 0,zf=$f?$f.valueOf:void 0;function XO(n){return zf?Object(zf.call(n)):{}}function Ff(n,e){var t=e?yc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var KO="[object Boolean]",ZO="[object Date]",QO="[object Map]",eM="[object Number]",tM="[object RegExp]",nM="[object Set]",sM="[object String]",rM="[object Symbol]",iM="[object ArrayBuffer]",oM="[object DataView]",aM="[object Float32Array]",lM="[object Float64Array]",cM="[object Int8Array]",uM="[object Int16Array]",dM="[object Int32Array]",hM="[object Uint8Array]",fM="[object Uint8ClampedArray]",pM="[object Uint16Array]",gM="[object Uint32Array]";function mM(n,e,t){var s=n.constructor;switch(e){case iM:return yc(n);case KO:case ZO:return new s(+n);case oM:return WO(n,t);case aM:case lM:case cM:case uM:case dM:case hM:case fM:case pM:case gM:return Ff(n,t);case QO:return new s;case eM:case sM:return new s(n);case tM:return JO(n);case nM:return new s;case rM:return XO(n)}}function Uf(n){return typeof n.constructor=="function"&&!qo(n)?fC(uc(n)):{}}var yM="[object Map]";function bM(n){return en(n)&&Vt(n)==yM}var Hf=wr&&wr.isMap,wM=Hf?Jo(Hf):bM,xM="[object Set]";function vM(n){return en(n)&&Vt(n)==xM}var Gf=wr&&wr.isSet,CM=Gf?Jo(Gf):vM,SM=1,EM=2,OM=4,Yf="[object Arguments]",MM="[object Array]",PM="[object Boolean]",AM="[object Date]",NM="[object Error]",Wf="[object Function]",TM="[object GeneratorFunction]",_M="[object Map]",kM="[object Number]",qf="[object Object]",DM="[object RegExp]",RM="[object Set]",LM="[object String]",IM="[object Symbol]",VM="[object WeakMap]",BM="[object ArrayBuffer]",jM="[object DataView]",$M="[object Float32Array]",zM="[object Float64Array]",FM="[object Int8Array]",UM="[object Int16Array]",HM="[object Int32Array]",GM="[object Uint8Array]",YM="[object Uint8ClampedArray]",WM="[object Uint16Array]",qM="[object Uint32Array]",Oe={};Oe[Yf]=Oe[MM]=Oe[BM]=Oe[jM]=Oe[PM]=Oe[AM]=Oe[$M]=Oe[zM]=Oe[FM]=Oe[UM]=Oe[HM]=Oe[_M]=Oe[kM]=Oe[qf]=Oe[DM]=Oe[RM]=Oe[LM]=Oe[IM]=Oe[GM]=Oe[YM]=Oe[WM]=Oe[qM]=!0,Oe[NM]=Oe[Wf]=Oe[VM]=!1;function ki(n,e,t,s,r,i){var o,a=e&SM,c=e&EM,u=e&OM;if(o!==void 0)return o;if(!Ie(n))return n;var d=ht(n);if(d){if(o=YO(n),!a)return Rh(n,o)}else{var h=Vt(n),f=h==Wf||h==TM;if(br(n))return Tf(n,a);if(h==qf||h==Yf||f&&!r){if(o=c||f?{}:Uf(n),!a)return c?IO(n,NO(o,n)):RO(n,AO(o,n))}else{if(!Oe[h])return r?n:{};o=mM(n,h,a)}}i||(i=new tn);var p=i.get(n);if(p)return p;i.set(n,o),CM(n)?n.forEach(function(y){o.add(ki(y,e,t,y,n,i))}):wM(n)&&n.forEach(function(y,b){o.set(b,ki(y,e,t,b,n,i))});var g=u?c?VO:pc:c?xr:Pi,m=d?void 0:g(n);return vC(m||n,function(y,b){m&&(b=y,y=n[b]),rc(o,b,ki(y,e,t,b,n,i))}),o}var JM=4;function bc(n){return ki(n,JM)}var XM=1,KM=4;function Ne(n){return ki(n,XM|KM)}var ZM="__lodash_hash_undefined__";function QM(n){return this.__data__.set(n,ZM),this}function e2(n){return this.__data__.has(n)}function Sr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Un;++e<t;)this.add(n[e])}Sr.prototype.add=Sr.prototype.push=QM,Sr.prototype.has=e2;function t2(n,e){for(var t=-1,s=n==null?0:n.length;++t<s;)if(e(n[t],t,n))return!0;return!1}function wc(n,e){return n.has(e)}var n2=1,s2=2;function Jf(n,e,t,s,r,i){var o=t&n2,a=n.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=i.get(n),d=i.get(e);if(u&&d)return u==e&&d==n;var h=-1,f=!0,p=t&s2?new Sr:void 0;for(i.set(n,e),i.set(e,n);++h<a;){var g=n[h],m=e[h];if(s)var y=o?s(m,g,h,e,n,i):s(g,m,h,n,e,i);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!t2(e,function(b,w){if(!wc(p,w)&&(g===b||r(g,b,t,s,i)))return p.push(w)})){f=!1;break}}else if(!(g===m||r(g,m,t,s,i))){f=!1;break}}return i.delete(n),i.delete(e),f}function r2(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function xc(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var i2=1,o2=2,a2="[object Boolean]",l2="[object Date]",c2="[object Error]",u2="[object Map]",d2="[object Number]",h2="[object RegExp]",f2="[object Set]",p2="[object String]",g2="[object Symbol]",m2="[object ArrayBuffer]",y2="[object DataView]",Xf=It?It.prototype:void 0,vc=Xf?Xf.valueOf:void 0;function b2(n,e,t,s,r,i,o){switch(t){case y2:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case m2:return!(n.byteLength!=e.byteLength||!i(new ra(n),new ra(e)));case a2:case l2:case d2:return gr(+n,+e);case c2:return n.name==e.name&&n.message==e.message;case h2:case p2:return n==e+"";case u2:var a=r2;case f2:var c=s&i2;if(a||(a=xc),n.size!=e.size&&!c)return!1;var u=o.get(n);if(u)return u==e;s|=o2,o.set(n,e);var d=Jf(a(n),a(e),s,r,i,o);return o.delete(n),d;case g2:if(vc)return vc.call(n)==vc.call(e)}return!1}var w2=1,x2=Object.prototype,v2=x2.hasOwnProperty;function C2(n,e,t,s,r,i){var o=t&w2,a=pc(n),c=a.length,u=pc(e),d=u.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var f=a[h];if(!(o?f in e:v2.call(e,f)))return!1}var p=i.get(n),g=i.get(e);if(p&&g)return p==e&&g==n;var m=!0;i.set(n,e),i.set(e,n);for(var y=o;++h<c;){f=a[h];var b=n[f],w=e[f];if(s)var x=o?s(w,b,f,e,n,i):s(b,w,f,n,e,i);if(!(x===void 0?b===w||r(b,w,t,s,i):x)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var v=n.constructor,S=e.constructor;v!=S&&"constructor"in n&&"constructor"in e&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(n),i.delete(e),m}var S2=1,Kf="[object Arguments]",Zf="[object Array]",ia="[object Object]",E2=Object.prototype,Qf=E2.hasOwnProperty;function O2(n,e,t,s,r,i){var o=ht(n),a=ht(e),c=o?Zf:Vt(n),u=a?Zf:Vt(e);c=c==Kf?ia:c,u=u==Kf?ia:u;var d=c==ia,h=u==ia,f=c==u;if(f&&br(n)){if(!br(e))return!1;o=!0,d=!1}if(f&&!d)return i||(i=new tn),o||Xo(n)?Jf(n,e,t,s,r,i):b2(n,e,c,t,s,r,i);if(!(t&S2)){var p=d&&Qf.call(n,"__wrapped__"),g=h&&Qf.call(e,"__wrapped__");if(p||g){var m=p?n.value():n,y=g?e.value():e;return i||(i=new tn),r(m,y,t,s,i)}}return f?(i||(i=new tn),C2(n,e,t,s,r,i)):!1}function oa(n,e,t,s,r){return n===e?!0:n==null||e==null||!en(n)&&!en(e)?n!==n&&e!==e:O2(n,e,t,s,oa,r)}var M2=1,P2=2;function A2(n,e,t,s){var r=t.length,i=r;if(n==null)return!i;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<i;){o=t[r];var a=o[0],c=n[a],u=o[1];if(o[2]){if(c===void 0&&!(a in n))return!1}else{var d=new tn,h;if(!(h===void 0?oa(u,c,M2|P2,s,d):h))return!1}}return!0}function ep(n){return n===n&&!Ie(n)}function N2(n){for(var e=Pi(n),t=e.length;t--;){var s=e[t],r=n[s];e[t]=[s,r,ep(r)]}return e}function tp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function T2(n){var e=N2(n);return e.length==1&&e[0][2]?tp(e[0][0],e[0][1]):function(t){return t===n||A2(t,n,e)}}function _2(n,e){return n!=null&&e in Object(n)}function np(n,e,t){e=Qo(e,n);for(var s=-1,r=e.length,i=!1;++s<r;){var o=_i(e[s]);if(!(i=n!=null&&t(n,o)))break;n=n[o]}return i||++s!=r?i:(r=n==null?0:n.length,!!r&&ic(r)&&Go(o,r)&&(ht(n)||yr(n)))}function sp(n,e){return n!=null&&np(n,e,_2)}var k2=1,D2=2;function R2(n,e){return ac(n)&&ep(e)?tp(_i(n),e):function(t){var s=Xh(t,n);return s===void 0&&s===e?sp(t,n):oa(e,s,k2|D2)}}function L2(n){return function(e){return e==null?void 0:e[n]}}function I2(n){return function(e){return ea(e,n)}}function V2(n){return ac(n)?L2(_i(n)):I2(n)}function Cc(n){return typeof n=="function"?n:n==null?pr:typeof n=="object"?ht(n)?R2(n[0],n[1]):T2(n):V2(n)}function B2(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;){var o=n[r];e(s,o,t(o),n)}return s}function j2(n){return function(e,t,s){for(var r=-1,i=Object(e),o=s(e),a=o.length;a--;){var c=o[++r];if(t(i[c],c,i)===!1)break}return e}}var rp=j2();function $2(n,e){return n&&rp(n,e,Pi)}function z2(n,e){return function(t,s){if(t==null)return t;if(!js(t))return n(t,s);for(var r=t.length,i=-1,o=Object(t);++i<r&&s(o[i],i,o)!==!1;);return t}}var ip=z2($2);function F2(n,e,t,s){return ip(n,function(r,i,o){e(s,r,t(r),o)}),s}function U2(n,e){return function(t,s){var r=ht(t)?B2:F2,i=e?e():{};return r(t,n,Cc(s),i)}}var Sc=function(){return Qt.Date.now()},H2="Expected a function",G2=Math.max,Y2=Math.min;function op(n,e,t){var s,r,i,o,a,c,u=0,d=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(H2);e=Ei(e)||0,Ie(t)&&(d=!!t.leading,h="maxWait"in t,i=h?G2(Ei(t.maxWait)||0,e):i,f="trailing"in t?!!t.trailing:f);function p(E){var C=s,M=r;return s=r=void 0,u=E,o=n.apply(M,C),o}function g(E){return u=E,a=setTimeout(b,e),d?p(E):o}function m(E){var C=E-c,M=E-u,N=e-C;return h?Y2(N,i-M):N}function y(E){var C=E-c,M=E-u;return c===void 0||C>=e||C<0||h&&M>=i}function b(){var E=Sc();if(y(E))return w(E);a=setTimeout(b,m(E))}function w(E){return a=void 0,f&&s?p(E):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=c=r=a=void 0}function v(){return a===void 0?o:w(Sc())}function S(){var E=Sc(),C=y(E);if(s=arguments,r=this,c=E,C){if(a===void 0)return g(c);if(h)return clearTimeout(a),a=setTimeout(b,e),p(c)}return a===void 0&&(a=setTimeout(b,e)),o}return S.cancel=x,S.flush=v,S}var ap=Object.prototype,W2=ap.hasOwnProperty,q2=mr(function(n,e){n=Object(n);var t=-1,s=e.length,r=s>2?e[2]:void 0;for(r&&Wo(e[0],e[1],r)&&(s=1);++t<s;)for(var i=e[t],o=xr(i),a=-1,c=o.length;++a<c;){var u=o[a],d=n[u];(d===void 0||gr(d,ap[u])&&!W2.call(n,u))&&(n[u]=i[u])}return n});function Ec(n,e,t){(t!==void 0&&!gr(n[e],t)||t===void 0&&!(e in n))&&Yo(n,e,t)}function aa(n){return en(n)&&js(n)}function Oc(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function J2(n){return Oi(n,xr(n))}function X2(n,e,t,s,r,i,o){var a=Oc(n,t),c=Oc(e,t),u=o.get(c);if(u){Ec(n,t,u);return}var d=i?i(a,c,t+"",n,e,o):void 0,h=d===void 0;if(h){var f=ht(c),p=!f&&br(c),g=!f&&!p&&Xo(c);d=c,f||p||g?ht(a)?d=a:aa(a)?d=Rh(a):p?(h=!1,d=Tf(c,!0)):g?(h=!1,d=Ff(c,!0)):d=[]:wn(c)||yr(c)?(d=a,yr(a)?d=J2(a):(!Ie(a)||tc(a))&&(d=Uf(c))):h=!1}h&&(o.set(c,d),r(d,c,s,i,o),o.delete(c)),Ec(n,t,d)}function la(n,e,t,s,r){n!==e&&rp(e,function(i,o){if(r||(r=new tn),Ie(i))X2(n,e,o,t,la,s,r);else{var a=s?s(Oc(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),Ec(n,o,a)}},xr)}function lp(n,e,t,s,r,i){return Ie(n)&&Ie(e)&&(i.set(e,n),la(n,e,void 0,lp,i),i.delete(e)),n}var K2=jh(function(n,e,t,s){la(n,e,t,s)}),cp=mr(function(n){return n.push(void 0,lp),Dh(K2,void 0,n)}),Z2=200;function Q2(n,e,t,s){var r=-1,i=Ih,o=!0,a=n.length,c=[],u=e.length;if(!a)return c;e.length>=Z2&&(i=wc,o=!1,e=new Sr(e));e:for(;++r<a;){var d=n[r],h=d;if(d=d!==0?d:0,o&&h===h){for(var f=u;f--;)if(e[f]===h)continue e;c.push(d)}else i(e,h,s)||c.push(d)}return c}var eP=mr(function(n,e){return aa(n)?Q2(n,ta(e,1,aa,!0)):[]});function tP(n,e){var t=-1,s=js(n)?Array(n.length):[];return ip(n,function(r,i,o){s[++t]=e(r,i,o)}),s}function ca(n){for(var e=-1,t=n==null?0:n.length,s={};++e<t;){var r=n[e];s[r[0]]=r[1]}return s}var nP=Object.prototype,sP=nP.hasOwnProperty,up=U2(function(n,e,t){sP.call(n,t)?n[t].push(e):Yo(n,t,[e])});function rP(n,e){return n>e}var iP=Object.prototype,oP=iP.hasOwnProperty;function aP(n,e){return n!=null&&oP.call(n,e)}function ua(n,e){return n!=null&&np(n,e,aP)}var lP="[object Map]",cP="[object Set]",uP=Object.prototype,dP=uP.hasOwnProperty;function dp(n){if(n==null)return!0;if(js(n)&&(ht(n)||typeof n=="string"||typeof n.splice=="function"||br(n)||Xo(n)||yr(n)))return!n.length;var e=Vt(n);if(e==lP||e==cP)return!n.size;if(qo(n))return!Jh(n).length;for(var t in n)if(dP.call(n,t))return!1;return!0}function xn(n,e){return oa(n,e)}var hP="[object Number]";function Mc(n){return typeof n=="number"||en(n)&&ls(n)==hP}function da(n){return n==null}function fP(n){return n===void 0}var pP=af("toLowerCase");function gP(n,e,t){for(var s=-1,r=n.length;++s<r;){var i=n[s],o=e(i);if(o!=null&&(a===void 0?o===o&&!bn(o):t(o,a)))var a=o,c=i}return c}function mP(n){return n&&n.length?gP(n,pr,rP):void 0}var Ye=jh(function(n,e,t){la(n,e,t)});function yP(n,e,t,s){if(!Ie(n))return n;e=Qo(e,n);for(var r=-1,i=e.length,o=i-1,a=n;a!=null&&++r<i;){var c=_i(e[r]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(r!=o){var d=a[c];u=void 0,u===void 0&&(u=Ie(d)?d:Go(e[r+1])?[]:{})}rc(a,c,u),a=a[c]}return n}function bP(n,e,t){for(var s=-1,r=e.length,i={};++s<r;){var o=e[s],a=ea(n,o);t(a,o)&&yP(i,Qo(o,n),a)}return i}function wP(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function xP(n,e){if(n!==e){var t=n!==void 0,s=n===null,r=n===n,i=bn(n),o=e!==void 0,a=e===null,c=e===e,u=bn(e);if(!a&&!u&&!i&&n>e||i&&o&&c&&!a&&!u||s&&o&&c||!t&&c||!r)return 1;if(!s&&!i&&!u&&n<e||u&&t&&r&&!s&&!i||a&&t&&r||!o&&r||!c)return-1}return 0}function vP(n,e,t){for(var s=-1,r=n.criteria,i=e.criteria,o=r.length,a=t.length;++s<o;){var c=xP(r[s],i[s]);if(c){if(s>=a)return c;var u=t[s];return c*(u=="desc"?-1:1)}}return n.index-e.index}function CP(n,e,t){e.length?e=Uo(e,function(i){return ht(i)?function(o){return ea(o,i.length===1?i[0]:i)}:i}):e=[pr];var s=-1;e=Uo(e,Jo(Cc));var r=tP(n,function(i,o,a){var c=Uo(e,function(u){return u(i)});return{criteria:c,index:++s,value:i}});return wP(r,function(i,o){return vP(i,o,t)})}function SP(n,e){return bP(n,e,function(t,s){return sp(n,s)})}var Pc=tE(function(n,e){return n==null?{}:SP(n,e)}),Ac=mr(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Wo(n,e[0],e[1])?e=[]:t>2&&Wo(e[0],e[1],e[2])&&(e=[e[0]]),CP(n,ta(e),[])}),EP=4294967295,OP=EP-1,MP=Math.floor,PP=Math.min;function hp(n,e,t,s){var r=0,i=n==null?0:n.length;if(i===0)return 0;e=t(e);for(var o=e!==e,a=e===null,c=bn(e),u=e===void 0;r<i;){var d=MP((r+i)/2),h=t(n[d]),f=h!==void 0,p=h===null,g=h===h,m=bn(h);if(o)var y=g;else u?y=g&&f:a?y=g&&f&&!p:c?y=g&&f&&!p&&!m:p||m?y=!1:y=h<e;y?r=d+1:i=d}return PP(i,OP)}var AP=4294967295,NP=AP>>>1;function TP(n,e,t){var s=0,r=n==null?s:n.length;if(typeof e=="number"&&e===e&&r<=NP){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!bn(o)&&o<e?s=i+1:r=i}return r}return hp(n,e,pr)}function _P(n,e){return TP(n,e)}function kP(n,e,t){return hp(n,e,Cc(t))}var DP=Of(function(n,e,t){return n+(t?" ":"")+na(e)}),RP="Expected a function";function LP(n,e,t){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(RP);return Ie(t)&&(s="leading"in t?!!t.leading:s,r="trailing"in t?!!t.trailing:r),op(n,e,{leading:s,maxWait:e,trailing:r})}var IP=1/0,VP=Cr&&1/xc(new Cr([,-0]))[1]==IP?function(n){return new Cr(n)}:pC,BP=200;function fp(n,e,t){var s=-1,r=Ih,i=n.length,o=!0,a=[],c=a;if(i>=BP){var u=VP(n);if(u)return xc(u);o=!1,r=wc,c=new Sr}else c=a;e:for(;++s<i;){var d=n[s],h=d;if(d=d!==0?d:0,o&&h===h){for(var f=c.length;f--;)if(c[f]===h)continue e;a.push(d)}else r(c,h,t)||(c!==a&&c.push(h),a.push(d))}return a}var pp=mr(function(n){return fp(ta(n,1,aa,!0))});function gp(n){return n&&n.length?fp(n):[]}const mp=n=>n===void 0,ha=n=>typeof n=="boolean",Bt=n=>typeof n=="number",Hn=n=>typeof Element>"u"?!1:n instanceof Element,jP=n=>Zt(n)?!Number.isNaN(Number(n)):!1,yp=n=>Object.keys(n);class bp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function $P(n,e){throw new bp(`[${n}] ${e}`)}function At(n,e){if(process.env.NODE_ENV!=="production"){const t=Zt(n)?new bp(`[${n}] ${e}`):n;console.warn(t)}}const zP="utils/dom/style",wp=(n="")=>n.split(" ").filter(e=>!!e.trim()),xp=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},FP=(n,e)=>{!n||!e.trim()||n.classList.add(...wp(e))},UP=(n,e)=>{!n||!e.trim()||n.classList.remove(...wp(e))},HP=(n,e)=>{var t;if(!Ge||!n||!e)return"";let s=_v(e);s==="float"&&(s="cssFloat");try{const r=n.style[s];if(r)return r;const i=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return i?i[s]:""}catch{return n.style[s]}};function Di(n,e="px"){if(!n)return"";if(Bt(n)||jP(n))return`${n}${e}`;if(Zt(n))return n;At(zP,"binding value must be a string or number")}let fa;const GP=n=>{var e;if(!Ge)return 0;if(fa!==void 0)return fa;const t=document.createElement("div");t.className=`${n}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const s=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),fa=s-i,fa};/*! Element Plus Icons Vue v2.3.1 */var YP=l.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),WP=YP,qP=l.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),l.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),JP=qP,XP=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),vp=XP,KP=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Cp=KP,ZP=l.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),QP=ZP,eA=l.defineComponent({name:"DeleteFilled",__name:"delete-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32"})]))}}),Sp=eA,tA=l.defineComponent({name:"Document",__name:"document",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),nA=tA,sA=l.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),l.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),rA=sA,iA=l.defineComponent({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Ep=iA,oA=l.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),pa=oA,aA=l.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),lA=aA,cA=l.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),Op=cA,uA=l.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Mp=uA,dA=l.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Pp=dA;const Ap="__epPropKey",he=n=>n,hA=n=>fr(n)&&!!n[Ap],ga=(n,e)=>{if(!fr(n)||hA(n))return n;const{values:t,required:s,default:r,type:i,validator:o}=n,c={type:i,required:!!s,validator:t||o?u=>{let d=!1,h=[];if(t&&(h=Array.from(t),Fo(n,"default")&&h.push(r),d||(d=h.includes(u))),o&&(d||(d=o(u))),!d&&h.length>0){const f=[...new Set(h)].map(p=>JSON.stringify(p)).join(", ");l.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${f}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Ap]:!0};return Fo(n,"default")&&(c.default=r),c},Ze=n=>ca(Object.entries(n).map(([e,t])=>[e,ga(t,e)])),Ri=he([String,Object,Function]),Np={Close:QP,SuccessFilled:Op,InfoFilled:Ep,WarningFilled:Pp,CircleCloseFilled:vp},ma={success:Op,warning:Pp,error:vp,info:Ep},fA={validating:pa,success:JP,error:Cp},zs=(n,e)=>{if(n.install=t=>{for(const s of[n,...Object.values(e??{})])t.component(s.name,s)},e)for(const[t,s]of Object.entries(e))n[t]=s;return n},pA=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),gA=n=>(n.install=as,n),Er={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},Nc="update:modelValue",Tp=["","default","small","large"],mA=n=>["",...Tp].includes(n);var ya=(n=>(n[n.TEXT=1]="TEXT",n[n.CLASS=2]="CLASS",n[n.STYLE=4]="STYLE",n[n.PROPS=8]="PROPS",n[n.FULL_PROPS=16]="FULL_PROPS",n[n.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",n[n.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",n[n.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",n[n.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",n[n.NEED_PATCH=512]="NEED_PATCH",n[n.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",n[n.HOISTED=-1]="HOISTED",n[n.BAIL=-2]="BAIL",n))(ya||{});const yA=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),_p=n=>n,bA=["class","style"],wA=/^on[A-Z]/,xA=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,s=l.computed(()=>((t==null?void 0:t.value)||[]).concat(bA)),r=l.getCurrentInstance();return r?l.computed(()=>{var i;return ca(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(e&&wA.test(o))))}):(At("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},vA=({from:n,replacement:e,scope:t,version:s,ref:r,type:i="API"},o)=>{l.watch(()=>l.unref(o),a=>{a&&At(t,`[${i}] ${n} is about to be deprecated in version ${s}, please use ${e} instead.
14
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const os=()=>{},jv=Object.prototype.hasOwnProperty,Go=(n,e)=>jv.call(n,e),$v=Array.isArray,Lt=n=>typeof n=="function",en=n=>typeof n=="string",pr=n=>n!==null&&typeof n=="object",zv=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Fv=/-(\w)/g,Uv=zv(n=>n.replace(Fv,(e,t)=>t?t.toUpperCase():""));var Dh=typeof global=="object"&&global&&global.Object===Object&&global,Hv=typeof self=="object"&&self&&self.Object===Object&&self,tn=Dh||Hv||Function("return this")(),It=tn.Symbol,Rh=Object.prototype,Gv=Rh.hasOwnProperty,Wv=Rh.toString,Mi=It?It.toStringTag:void 0;function Yv(n){var e=Gv.call(n,Mi),t=n[Mi];try{n[Mi]=void 0;var s=!0}catch{}var r=Wv.call(n);return s&&(e?n[Mi]=t:delete n[Mi]),r}var qv=Object.prototype,Jv=qv.toString;function Xv(n){return Jv.call(n)}var Kv="[object Null]",Zv="[object Undefined]",Lh=It?It.toStringTag:void 0;function as(n){return n==null?n===void 0?Zv:Kv:Lh&&Lh in Object(n)?Yv(n):Xv(n)}function nn(n){return n!=null&&typeof n=="object"}var Qv="[object Symbol]";function xn(n){return typeof n=="symbol"||nn(n)&&as(n)==Qv}function Wo(n,e){for(var t=-1,s=n==null?0:n.length,r=Array(s);++t<s;)r[t]=e(n[t],t,n);return r}var ht=Array.isArray,eC=1/0,Ih=It?It.prototype:void 0,Bh=Ih?Ih.toString:void 0;function jh(n){if(typeof n=="string")return n;if(ht(n))return Wo(n,jh)+"";if(xn(n))return Bh?Bh.call(n):"";var e=n+"";return e=="0"&&1/n==-eC?"-0":e}var tC=/\s/;function nC(n){for(var e=n.length;e--&&tC.test(n.charAt(e)););return e}var sC=/^\s+/;function rC(n){return n&&n.slice(0,nC(n)+1).replace(sC,"")}function Ie(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var $h=NaN,iC=/^[-+]0x[0-9a-f]+$/i,oC=/^0b[01]+$/i,aC=/^0o[0-7]+$/i,lC=parseInt;function Pi(n){if(typeof n=="number")return n;if(xn(n))return $h;if(Ie(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ie(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=rC(n);var t=oC.test(n);return t||aC.test(n)?lC(n.slice(2),t?2:8):iC.test(n)?$h:+n}function gr(n){return n}var cC="[object AsyncFunction]",uC="[object Function]",dC="[object GeneratorFunction]",hC="[object Proxy]";function ac(n){if(!Ie(n))return!1;var e=as(n);return e==uC||e==dC||e==cC||e==hC}var lc=tn["__core-js_shared__"],zh=function(){var n=/[^.]+$/.exec(lc&&lc.keys&&lc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function fC(n){return!!zh&&zh in n}var pC=Function.prototype,gC=pC.toString;function Rs(n){if(n!=null){try{return gC.call(n)}catch{}try{return n+""}catch{}}return""}var mC=/[\\^$.*+?()[\]{}|]/g,yC=/^\[object .+?Constructor\]$/,bC=Function.prototype,wC=Object.prototype,xC=bC.toString,vC=wC.hasOwnProperty,CC=RegExp("^"+xC.call(vC).replace(mC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function SC(n){if(!Ie(n)||fC(n))return!1;var e=ac(n)?CC:yC;return e.test(Rs(n))}function EC(n,e){return n==null?void 0:n[e]}function Ls(n,e){var t=EC(n,e);return SC(t)?t:void 0}var cc=Ls(tn,"WeakMap"),Fh=Object.create,OC=function(){function n(){}return function(e){if(!Ie(e))return{};if(Fh)return Fh(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Uh(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function MC(){}function Hh(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var PC=800,NC=16,AC=Date.now;function _C(n){var e=0,t=0;return function(){var s=AC(),r=NC-(s-t);if(t=s,r>0){if(++e>=PC)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function TC(n){return function(){return n}}var Yo=function(){try{var n=Ls(Object,"defineProperty");return n({},"",{}),n}catch{}}(),kC=Yo?function(n,e){return Yo(n,"toString",{configurable:!0,enumerable:!1,value:TC(e),writable:!0})}:gr,Gh=_C(kC);function VC(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}function DC(n,e,t,s){for(var r=n.length,i=t+-1;++i<r;)if(e(n[i],i,n))return i;return-1}function RC(n){return n!==n}function LC(n,e,t){for(var s=t-1,r=n.length;++s<r;)if(n[s]===e)return s;return-1}function IC(n,e,t){return e===e?LC(n,e,t):DC(n,RC,t)}function Wh(n,e){var t=n==null?0:n.length;return!!t&&IC(n,e,0)>-1}var BC=9007199254740991,jC=/^(?:0|[1-9]\d*)$/;function qo(n,e){var t=typeof n;return e=e??BC,!!e&&(t=="number"||t!="symbol"&&jC.test(n))&&n>-1&&n%1==0&&n<e}function Jo(n,e,t){e=="__proto__"&&Yo?Yo(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function mr(n,e){return n===e||n!==n&&e!==e}var $C=Object.prototype,zC=$C.hasOwnProperty;function uc(n,e,t){var s=n[e];(!(zC.call(n,e)&&mr(s,t))||t===void 0&&!(e in n))&&Jo(n,e,t)}function Ni(n,e,t,s){var r=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],c=void 0;c===void 0&&(c=n[a]),r?Jo(t,a,c):uc(t,a,c)}return t}var Yh=Math.max;function qh(n,e,t){return e=Yh(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Yh(s.length-e,0),o=Array(i);++r<i;)o[r]=s[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=s[r];return a[e]=t(o),Uh(n,this,a)}}function yr(n,e){return Gh(qh(n,e,gr),n+"")}var FC=9007199254740991;function dc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=FC}function Is(n){return n!=null&&dc(n.length)&&!ac(n)}function Xo(n,e,t){if(!Ie(t))return!1;var s=typeof e;return(s=="number"?Is(t)&&qo(e,t.length):s=="string"&&e in t)?mr(t[e],n):!1}function Jh(n){return yr(function(e,t){var s=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&Xo(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++s<r;){var a=t[s];a&&n(e,a,s,i)}return e})}var UC=Object.prototype;function Ko(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||UC;return n===t}function HC(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var GC="[object Arguments]";function Xh(n){return nn(n)&&as(n)==GC}var Kh=Object.prototype,WC=Kh.hasOwnProperty,YC=Kh.propertyIsEnumerable,br=Xh(function(){return arguments}())?Xh:function(n){return nn(n)&&WC.call(n,"callee")&&!YC.call(n,"callee")};function qC(){return!1}var Zh=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Qh=Zh&&typeof module=="object"&&module&&!module.nodeType&&module,JC=Qh&&Qh.exports===Zh,ef=JC?tn.Buffer:void 0,XC=ef?ef.isBuffer:void 0,wr=XC||qC,KC="[object Arguments]",ZC="[object Array]",QC="[object Boolean]",eS="[object Date]",tS="[object Error]",nS="[object Function]",sS="[object Map]",rS="[object Number]",iS="[object Object]",oS="[object RegExp]",aS="[object Set]",lS="[object String]",cS="[object WeakMap]",uS="[object ArrayBuffer]",dS="[object DataView]",hS="[object Float32Array]",fS="[object Float64Array]",pS="[object Int8Array]",gS="[object Int16Array]",mS="[object Int32Array]",yS="[object Uint8Array]",bS="[object Uint8ClampedArray]",wS="[object Uint16Array]",xS="[object Uint32Array]",Ae={};Ae[hS]=Ae[fS]=Ae[pS]=Ae[gS]=Ae[mS]=Ae[yS]=Ae[bS]=Ae[wS]=Ae[xS]=!0,Ae[KC]=Ae[ZC]=Ae[uS]=Ae[QC]=Ae[dS]=Ae[eS]=Ae[tS]=Ae[nS]=Ae[sS]=Ae[rS]=Ae[iS]=Ae[oS]=Ae[aS]=Ae[lS]=Ae[cS]=!1;function vS(n){return nn(n)&&dc(n.length)&&!!Ae[as(n)]}function Zo(n){return function(e){return n(e)}}var tf=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Ai=tf&&typeof module=="object"&&module&&!module.nodeType&&module,CS=Ai&&Ai.exports===tf,hc=CS&&Dh.process,xr=function(){try{var n=Ai&&Ai.require&&Ai.require("util").types;return n||hc&&hc.binding&&hc.binding("util")}catch{}}(),nf=xr&&xr.isTypedArray,Qo=nf?Zo(nf):vS,SS=Object.prototype,ES=SS.hasOwnProperty;function sf(n,e){var t=ht(n),s=!t&&br(n),r=!t&&!s&&wr(n),i=!t&&!s&&!r&&Qo(n),o=t||s||r||i,a=o?HC(n.length,String):[],c=a.length;for(var u in n)(e||ES.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||qo(u,c)))&&a.push(u);return a}function rf(n,e){return function(t){return n(e(t))}}var OS=rf(Object.keys,Object),MS=Object.prototype,PS=MS.hasOwnProperty;function of(n){if(!Ko(n))return OS(n);var e=[];for(var t in Object(n))PS.call(n,t)&&t!="constructor"&&e.push(t);return e}function _i(n){return Is(n)?sf(n):of(n)}function NS(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var AS=Object.prototype,_S=AS.hasOwnProperty;function TS(n){if(!Ie(n))return NS(n);var e=Ko(n),t=[];for(var s in n)s=="constructor"&&(e||!_S.call(n,s))||t.push(s);return t}function vr(n){return Is(n)?sf(n,!0):TS(n)}var kS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VS=/^\w*$/;function fc(n,e){if(ht(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||xn(n)?!0:VS.test(n)||!kS.test(n)||e!=null&&n in Object(e)}var Ti=Ls(Object,"create");function DS(){this.__data__=Ti?Ti(null):{},this.size=0}function RS(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var LS="__lodash_hash_undefined__",IS=Object.prototype,BS=IS.hasOwnProperty;function jS(n){var e=this.__data__;if(Ti){var t=e[n];return t===LS?void 0:t}return BS.call(e,n)?e[n]:void 0}var $S=Object.prototype,zS=$S.hasOwnProperty;function FS(n){var e=this.__data__;return Ti?e[n]!==void 0:zS.call(e,n)}var US="__lodash_hash_undefined__";function HS(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ti&&e===void 0?US:e,this}function Bs(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Bs.prototype.clear=DS,Bs.prototype.delete=RS,Bs.prototype.get=jS,Bs.prototype.has=FS,Bs.prototype.set=HS;function GS(){this.__data__=[],this.size=0}function ea(n,e){for(var t=n.length;t--;)if(mr(n[t][0],e))return t;return-1}var WS=Array.prototype,YS=WS.splice;function qS(n){var e=this.__data__,t=ea(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():YS.call(e,t,1),--this.size,!0}function JS(n){var e=this.__data__,t=ea(e,n);return t<0?void 0:e[t][1]}function XS(n){return ea(this.__data__,n)>-1}function KS(n,e){var t=this.__data__,s=ea(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Un(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Un.prototype.clear=GS,Un.prototype.delete=qS,Un.prototype.get=JS,Un.prototype.has=XS,Un.prototype.set=KS;var ki=Ls(tn,"Map");function ZS(){this.size=0,this.__data__={hash:new Bs,map:new(ki||Un),string:new Bs}}function QS(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ta(n,e){var t=n.__data__;return QS(e)?t[typeof e=="string"?"string":"hash"]:t.map}function eE(n){var e=ta(this,n).delete(n);return this.size-=e?1:0,e}function tE(n){return ta(this,n).get(n)}function nE(n){return ta(this,n).has(n)}function sE(n,e){var t=ta(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function Hn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Hn.prototype.clear=ZS,Hn.prototype.delete=eE,Hn.prototype.get=tE,Hn.prototype.has=nE,Hn.prototype.set=sE;var rE="Expected a function";function pc(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(rE);var t=function(){var s=arguments,r=e?e.apply(this,s):s[0],i=t.cache;if(i.has(r))return i.get(r);var o=n.apply(this,s);return t.cache=i.set(r,o)||i,o};return t.cache=new(pc.Cache||Hn),t}pc.Cache=Hn;var iE=500;function oE(n){var e=pc(n,function(s){return t.size===iE&&t.clear(),s}),t=e.cache;return e}var aE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lE=/\\(\\)?/g,cE=oE(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(aE,function(t,s,r,i){e.push(r?i.replace(lE,"$1"):s||t)}),e});function Vi(n){return n==null?"":jh(n)}function na(n,e){return ht(n)?n:fc(n,e)?[n]:cE(Vi(n))}var uE=1/0;function Di(n){if(typeof n=="string"||xn(n))return n;var e=n+"";return e=="0"&&1/n==-uE?"-0":e}function sa(n,e){e=na(e,n);for(var t=0,s=e.length;n!=null&&t<s;)n=n[Di(e[t++])];return t&&t==s?n:void 0}function af(n,e,t){var s=n==null?void 0:sa(n,e);return s===void 0?t:s}function gc(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var lf=It?It.isConcatSpreadable:void 0;function dE(n){return ht(n)||br(n)||!!(lf&&n&&n[lf])}function ra(n,e,t,s,r){var i=-1,o=n.length;for(t||(t=dE),r||(r=[]);++i<o;){var a=n[i];t(a)?gc(r,a):s||(r[r.length]=a)}return r}function hE(n){var e=n==null?0:n.length;return e?ra(n):[]}function fE(n){return Gh(qh(n,void 0,hE),n+"")}var mc=rf(Object.getPrototypeOf,Object),pE="[object Object]",gE=Function.prototype,mE=Object.prototype,cf=gE.toString,yE=mE.hasOwnProperty,bE=cf.call(Object);function vn(n){if(!nn(n)||as(n)!=pE)return!1;var e=mc(n);if(e===null)return!0;var t=yE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&cf.call(t)==bE}function wE(n,e,t){var s=-1,r=n.length;e<0&&(e=-e>r?0:r+e),t=t>r?r:t,t<0&&(t+=r),r=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(r);++s<r;)i[s]=n[s+e];return i}function xE(n,e,t){var s=n.length;return t=t===void 0?s:t,!e&&t>=s?n:wE(n,e,t)}var vE="\\ud800-\\udfff",CE="\\u0300-\\u036f",SE="\\ufe20-\\ufe2f",EE="\\u20d0-\\u20ff",OE=CE+SE+EE,ME="\\ufe0e\\ufe0f",PE="\\u200d",NE=RegExp("["+PE+vE+OE+ME+"]");function uf(n){return NE.test(n)}function AE(n){return n.split("")}var df="\\ud800-\\udfff",_E="\\u0300-\\u036f",TE="\\ufe20-\\ufe2f",kE="\\u20d0-\\u20ff",VE=_E+TE+kE,DE="\\ufe0e\\ufe0f",RE="["+df+"]",yc="["+VE+"]",bc="\\ud83c[\\udffb-\\udfff]",LE="(?:"+yc+"|"+bc+")",hf="[^"+df+"]",ff="(?:\\ud83c[\\udde6-\\uddff]){2}",pf="[\\ud800-\\udbff][\\udc00-\\udfff]",IE="\\u200d",gf=LE+"?",mf="["+DE+"]?",BE="(?:"+IE+"(?:"+[hf,ff,pf].join("|")+")"+mf+gf+")*",jE=mf+gf+BE,$E="(?:"+[hf+yc+"?",yc,ff,pf,RE].join("|")+")",zE=RegExp(bc+"(?="+bc+")|"+$E+jE,"g");function FE(n){return n.match(zE)||[]}function UE(n){return uf(n)?FE(n):AE(n)}function yf(n){return function(e){e=Vi(e);var t=uf(e)?UE(e):void 0,s=t?t[0]:e.charAt(0),r=t?xE(t,1).join(""):e.slice(1);return s[n]()+r}}var ia=yf("toUpperCase");function HE(n){return ia(Vi(n).toLowerCase())}function GE(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;)t=e(t,n[r],r,n);return t}function WE(n){return function(e){return n==null?void 0:n[e]}}var YE={À:"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"},qE=WE(YE),JE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,XE="\\u0300-\\u036f",KE="\\ufe20-\\ufe2f",ZE="\\u20d0-\\u20ff",QE=XE+KE+ZE,eO="["+QE+"]",tO=RegExp(eO,"g");function nO(n){return n=Vi(n),n&&n.replace(JE,qE).replace(tO,"")}var sO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function rO(n){return n.match(sO)||[]}var iO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function oO(n){return iO.test(n)}var bf="\\ud800-\\udfff",aO="\\u0300-\\u036f",lO="\\ufe20-\\ufe2f",cO="\\u20d0-\\u20ff",uO=aO+lO+cO,wf="\\u2700-\\u27bf",xf="a-z\\xdf-\\xf6\\xf8-\\xff",dO="\\xac\\xb1\\xd7\\xf7",hO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fO="\\u2000-\\u206f",pO=" \\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",vf="A-Z\\xc0-\\xd6\\xd8-\\xde",gO="\\ufe0e\\ufe0f",Cf=dO+hO+fO+pO,Sf="['’]",Ef="["+Cf+"]",mO="["+uO+"]",Of="\\d+",yO="["+wf+"]",Mf="["+xf+"]",Pf="[^"+bf+Cf+Of+wf+xf+vf+"]",bO="\\ud83c[\\udffb-\\udfff]",wO="(?:"+mO+"|"+bO+")",xO="[^"+bf+"]",Nf="(?:\\ud83c[\\udde6-\\uddff]){2}",Af="[\\ud800-\\udbff][\\udc00-\\udfff]",Cr="["+vf+"]",vO="\\u200d",_f="(?:"+Mf+"|"+Pf+")",CO="(?:"+Cr+"|"+Pf+")",Tf="(?:"+Sf+"(?:d|ll|m|re|s|t|ve))?",kf="(?:"+Sf+"(?:D|LL|M|RE|S|T|VE))?",Vf=wO+"?",Df="["+gO+"]?",SO="(?:"+vO+"(?:"+[xO,Nf,Af].join("|")+")"+Df+Vf+")*",EO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",MO=Df+Vf+SO,PO="(?:"+[yO,Nf,Af].join("|")+")"+MO,NO=RegExp([Cr+"?"+Mf+"+"+Tf+"(?="+[Ef,Cr,"$"].join("|")+")",CO+"+"+kf+"(?="+[Ef,Cr+_f,"$"].join("|")+")",Cr+"?"+_f+"+"+Tf,Cr+"+"+kf,OO,EO,Of,PO].join("|"),"g");function AO(n){return n.match(NO)||[]}function _O(n,e,t){return n=Vi(n),e=e,e===void 0?oO(n)?AO(n):rO(n):n.match(e)||[]}var TO="['’]",kO=RegExp(TO,"g");function Rf(n){return function(e){return GE(_O(nO(e).replace(kO,"")),n,"")}}var oa=Rf(function(n,e,t){return e=e.toLowerCase(),n+(t?HE(e):e)});function VO(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function xt(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Pi(t),t=t===t?t:0),e!==void 0&&(e=Pi(e),e=e===e?e:0),VO(Pi(n),e,t)}function DO(){this.__data__=new Un,this.size=0}function RO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function LO(n){return this.__data__.get(n)}function IO(n){return this.__data__.has(n)}var BO=200;function jO(n,e){var t=this.__data__;if(t instanceof Un){var s=t.__data__;if(!ki||s.length<BO-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new Hn(s)}return t.set(n,e),this.size=t.size,this}function sn(n){var e=this.__data__=new Un(n);this.size=e.size}sn.prototype.clear=DO,sn.prototype.delete=RO,sn.prototype.get=LO,sn.prototype.has=IO,sn.prototype.set=jO;function $O(n,e){return n&&Ni(e,_i(e),n)}function zO(n,e){return n&&Ni(e,vr(e),n)}var Lf=typeof Re=="object"&&Re&&!Re.nodeType&&Re,If=Lf&&typeof module=="object"&&module&&!module.nodeType&&module,FO=If&&If.exports===Lf,Bf=FO?tn.Buffer:void 0,jf=Bf?Bf.allocUnsafe:void 0;function $f(n,e){if(e)return n.slice();var t=n.length,s=jf?jf(t):new n.constructor(t);return n.copy(s),s}function UO(n,e){for(var t=-1,s=n==null?0:n.length,r=0,i=[];++t<s;){var o=n[t];e(o,t,n)&&(i[r++]=o)}return i}function zf(){return[]}var HO=Object.prototype,GO=HO.propertyIsEnumerable,Ff=Object.getOwnPropertySymbols,wc=Ff?function(n){return n==null?[]:(n=Object(n),UO(Ff(n),function(e){return GO.call(n,e)}))}:zf;function WO(n,e){return Ni(n,wc(n),e)}var YO=Object.getOwnPropertySymbols,Uf=YO?function(n){for(var e=[];n;)gc(e,wc(n)),n=mc(n);return e}:zf;function qO(n,e){return Ni(n,Uf(n),e)}function Hf(n,e,t){var s=e(n);return ht(n)?s:gc(s,t(n))}function xc(n){return Hf(n,_i,wc)}function JO(n){return Hf(n,vr,Uf)}var vc=Ls(tn,"DataView"),Cc=Ls(tn,"Promise"),Sr=Ls(tn,"Set"),Gf="[object Map]",XO="[object Object]",Wf="[object Promise]",Yf="[object Set]",qf="[object WeakMap]",Jf="[object DataView]",KO=Rs(vc),ZO=Rs(ki),QO=Rs(Cc),e2=Rs(Sr),t2=Rs(cc),Bt=as;(vc&&Bt(new vc(new ArrayBuffer(1)))!=Jf||ki&&Bt(new ki)!=Gf||Cc&&Bt(Cc.resolve())!=Wf||Sr&&Bt(new Sr)!=Yf||cc&&Bt(new cc)!=qf)&&(Bt=function(n){var e=as(n),t=e==XO?n.constructor:void 0,s=t?Rs(t):"";if(s)switch(s){case KO:return Jf;case ZO:return Gf;case QO:return Wf;case e2:return Yf;case t2:return qf}return e});var n2=Object.prototype,s2=n2.hasOwnProperty;function r2(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&s2.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var aa=tn.Uint8Array;function Sc(n){var e=new n.constructor(n.byteLength);return new aa(e).set(new aa(n)),e}function i2(n,e){var t=e?Sc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var o2=/\w*$/;function a2(n){var e=new n.constructor(n.source,o2.exec(n));return e.lastIndex=n.lastIndex,e}var Xf=It?It.prototype:void 0,Kf=Xf?Xf.valueOf:void 0;function l2(n){return Kf?Object(Kf.call(n)):{}}function Zf(n,e){var t=e?Sc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var c2="[object Boolean]",u2="[object Date]",d2="[object Map]",h2="[object Number]",f2="[object RegExp]",p2="[object Set]",g2="[object String]",m2="[object Symbol]",y2="[object ArrayBuffer]",b2="[object DataView]",w2="[object Float32Array]",x2="[object Float64Array]",v2="[object Int8Array]",C2="[object Int16Array]",S2="[object Int32Array]",E2="[object Uint8Array]",O2="[object Uint8ClampedArray]",M2="[object Uint16Array]",P2="[object Uint32Array]";function N2(n,e,t){var s=n.constructor;switch(e){case y2:return Sc(n);case c2:case u2:return new s(+n);case b2:return i2(n,t);case w2:case x2:case v2:case C2:case S2:case E2:case O2:case M2:case P2:return Zf(n,t);case d2:return new s;case h2:case g2:return new s(n);case f2:return a2(n);case p2:return new s;case m2:return l2(n)}}function Qf(n){return typeof n.constructor=="function"&&!Ko(n)?OC(mc(n)):{}}var A2="[object Map]";function _2(n){return nn(n)&&Bt(n)==A2}var ep=xr&&xr.isMap,T2=ep?Zo(ep):_2,k2="[object Set]";function V2(n){return nn(n)&&Bt(n)==k2}var tp=xr&&xr.isSet,D2=tp?Zo(tp):V2,R2=1,L2=2,I2=4,np="[object Arguments]",B2="[object Array]",j2="[object Boolean]",$2="[object Date]",z2="[object Error]",sp="[object Function]",F2="[object GeneratorFunction]",U2="[object Map]",H2="[object Number]",rp="[object Object]",G2="[object RegExp]",W2="[object Set]",Y2="[object String]",q2="[object Symbol]",J2="[object WeakMap]",X2="[object ArrayBuffer]",K2="[object DataView]",Z2="[object Float32Array]",Q2="[object Float64Array]",eM="[object Int8Array]",tM="[object Int16Array]",nM="[object Int32Array]",sM="[object Uint8Array]",rM="[object Uint8ClampedArray]",iM="[object Uint16Array]",oM="[object Uint32Array]",Me={};Me[np]=Me[B2]=Me[X2]=Me[K2]=Me[j2]=Me[$2]=Me[Z2]=Me[Q2]=Me[eM]=Me[tM]=Me[nM]=Me[U2]=Me[H2]=Me[rp]=Me[G2]=Me[W2]=Me[Y2]=Me[q2]=Me[sM]=Me[rM]=Me[iM]=Me[oM]=!0,Me[z2]=Me[sp]=Me[J2]=!1;function Ri(n,e,t,s,r,i){var o,a=e&R2,c=e&L2,u=e&I2;if(o!==void 0)return o;if(!Ie(n))return n;var d=ht(n);if(d){if(o=r2(n),!a)return Hh(n,o)}else{var f=Bt(n),h=f==sp||f==F2;if(wr(n))return $f(n,a);if(f==rp||f==np||h&&!r){if(o=c||h?{}:Qf(n),!a)return c?qO(n,zO(o,n)):WO(n,$O(o,n))}else{if(!Me[f])return r?n:{};o=N2(n,f,a)}}i||(i=new sn);var p=i.get(n);if(p)return p;i.set(n,o),D2(n)?n.forEach(function(y){o.add(Ri(y,e,t,y,n,i))}):T2(n)&&n.forEach(function(y,b){o.set(b,Ri(y,e,t,b,n,i))});var g=u?c?JO:xc:c?vr:_i,m=d?void 0:g(n);return VC(m||n,function(y,b){m&&(b=y,y=n[b]),uc(o,b,Ri(y,e,t,b,n,i))}),o}var aM=4;function Ec(n){return Ri(n,aM)}var lM=1,cM=4;function _e(n){return Ri(n,lM|cM)}var uM="__lodash_hash_undefined__";function dM(n){return this.__data__.set(n,uM),this}function hM(n){return this.__data__.has(n)}function Er(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Hn;++e<t;)this.add(n[e])}Er.prototype.add=Er.prototype.push=dM,Er.prototype.has=hM;function fM(n,e){for(var t=-1,s=n==null?0:n.length;++t<s;)if(e(n[t],t,n))return!0;return!1}function Oc(n,e){return n.has(e)}var pM=1,gM=2;function ip(n,e,t,s,r,i){var o=t&pM,a=n.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=i.get(n),d=i.get(e);if(u&&d)return u==e&&d==n;var f=-1,h=!0,p=t&gM?new Er:void 0;for(i.set(n,e),i.set(e,n);++f<a;){var g=n[f],m=e[f];if(s)var y=o?s(m,g,f,e,n,i):s(g,m,f,n,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!fM(e,function(b,w){if(!Oc(p,w)&&(g===b||r(g,b,t,s,i)))return p.push(w)})){h=!1;break}}else if(!(g===m||r(g,m,t,s,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function mM(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function Mc(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var yM=1,bM=2,wM="[object Boolean]",xM="[object Date]",vM="[object Error]",CM="[object Map]",SM="[object Number]",EM="[object RegExp]",OM="[object Set]",MM="[object String]",PM="[object Symbol]",NM="[object ArrayBuffer]",AM="[object DataView]",op=It?It.prototype:void 0,Pc=op?op.valueOf:void 0;function _M(n,e,t,s,r,i,o){switch(t){case AM:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case NM:return!(n.byteLength!=e.byteLength||!i(new aa(n),new aa(e)));case wM:case xM:case SM:return mr(+n,+e);case vM:return n.name==e.name&&n.message==e.message;case EM:case MM:return n==e+"";case CM:var a=mM;case OM:var c=s&yM;if(a||(a=Mc),n.size!=e.size&&!c)return!1;var u=o.get(n);if(u)return u==e;s|=bM,o.set(n,e);var d=ip(a(n),a(e),s,r,i,o);return o.delete(n),d;case PM:if(Pc)return Pc.call(n)==Pc.call(e)}return!1}var TM=1,kM=Object.prototype,VM=kM.hasOwnProperty;function DM(n,e,t,s,r,i){var o=t&TM,a=xc(n),c=a.length,u=xc(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=a[f];if(!(o?h in e:VM.call(e,h)))return!1}var p=i.get(n),g=i.get(e);if(p&&g)return p==e&&g==n;var m=!0;i.set(n,e),i.set(e,n);for(var y=o;++f<c;){h=a[f];var b=n[h],w=e[h];if(s)var x=o?s(w,b,h,e,n,i):s(b,w,h,n,e,i);if(!(x===void 0?b===w||r(b,w,t,s,i):x)){m=!1;break}y||(y=h=="constructor")}if(m&&!y){var v=n.constructor,S=e.constructor;v!=S&&"constructor"in n&&"constructor"in e&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(n),i.delete(e),m}var RM=1,ap="[object Arguments]",lp="[object Array]",la="[object Object]",LM=Object.prototype,cp=LM.hasOwnProperty;function IM(n,e,t,s,r,i){var o=ht(n),a=ht(e),c=o?lp:Bt(n),u=a?lp:Bt(e);c=c==ap?la:c,u=u==ap?la:u;var d=c==la,f=u==la,h=c==u;if(h&&wr(n)){if(!wr(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new sn),o||Qo(n)?ip(n,e,t,s,r,i):_M(n,e,c,t,s,r,i);if(!(t&RM)){var p=d&&cp.call(n,"__wrapped__"),g=f&&cp.call(e,"__wrapped__");if(p||g){var m=p?n.value():n,y=g?e.value():e;return i||(i=new sn),r(m,y,t,s,i)}}return h?(i||(i=new sn),DM(n,e,t,s,r,i)):!1}function ca(n,e,t,s,r){return n===e?!0:n==null||e==null||!nn(n)&&!nn(e)?n!==n&&e!==e:IM(n,e,t,s,ca,r)}var BM=1,jM=2;function $M(n,e,t,s){var r=t.length,i=r;if(n==null)return!i;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<i;){o=t[r];var a=o[0],c=n[a],u=o[1];if(o[2]){if(c===void 0&&!(a in n))return!1}else{var d=new sn,f;if(!(f===void 0?ca(u,c,BM|jM,s,d):f))return!1}}return!0}function up(n){return n===n&&!Ie(n)}function zM(n){for(var e=_i(n),t=e.length;t--;){var s=e[t],r=n[s];e[t]=[s,r,up(r)]}return e}function dp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function FM(n){var e=zM(n);return e.length==1&&e[0][2]?dp(e[0][0],e[0][1]):function(t){return t===n||$M(t,n,e)}}function UM(n,e){return n!=null&&e in Object(n)}function hp(n,e,t){e=na(e,n);for(var s=-1,r=e.length,i=!1;++s<r;){var o=Di(e[s]);if(!(i=n!=null&&t(n,o)))break;n=n[o]}return i||++s!=r?i:(r=n==null?0:n.length,!!r&&dc(r)&&qo(o,r)&&(ht(n)||br(n)))}function fp(n,e){return n!=null&&hp(n,e,UM)}var HM=1,GM=2;function WM(n,e){return fc(n)&&up(e)?dp(Di(n),e):function(t){var s=af(t,n);return s===void 0&&s===e?fp(t,n):ca(e,s,HM|GM)}}function YM(n){return function(e){return e==null?void 0:e[n]}}function qM(n){return function(e){return sa(e,n)}}function JM(n){return fc(n)?YM(Di(n)):qM(n)}function Nc(n){return typeof n=="function"?n:n==null?gr:typeof n=="object"?ht(n)?WM(n[0],n[1]):FM(n):JM(n)}function XM(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;){var o=n[r];e(s,o,t(o),n)}return s}function KM(n){return function(e,t,s){for(var r=-1,i=Object(e),o=s(e),a=o.length;a--;){var c=o[++r];if(t(i[c],c,i)===!1)break}return e}}var pp=KM();function ZM(n,e){return n&&pp(n,e,_i)}function QM(n,e){return function(t,s){if(t==null)return t;if(!Is(t))return n(t,s);for(var r=t.length,i=-1,o=Object(t);++i<r&&s(o[i],i,o)!==!1;);return t}}var gp=QM(ZM);function eP(n,e,t,s){return gp(n,function(r,i,o){e(s,r,t(r),o)}),s}function tP(n,e){return function(t,s){var r=ht(t)?XM:eP,i=e?e():{};return r(t,n,Nc(s),i)}}var Ac=function(){return tn.Date.now()},nP="Expected a function",sP=Math.max,rP=Math.min;function mp(n,e,t){var s,r,i,o,a,c,u=0,d=!1,f=!1,h=!0;if(typeof n!="function")throw new TypeError(nP);e=Pi(e)||0,Ie(t)&&(d=!!t.leading,f="maxWait"in t,i=f?sP(Pi(t.maxWait)||0,e):i,h="trailing"in t?!!t.trailing:h);function p(E){var C=s,P=r;return s=r=void 0,u=E,o=n.apply(P,C),o}function g(E){return u=E,a=setTimeout(b,e),d?p(E):o}function m(E){var C=E-c,P=E-u,A=e-C;return f?rP(A,i-P):A}function y(E){var C=E-c,P=E-u;return c===void 0||C>=e||C<0||f&&P>=i}function b(){var E=Ac();if(y(E))return w(E);a=setTimeout(b,m(E))}function w(E){return a=void 0,h&&s?p(E):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=c=r=a=void 0}function v(){return a===void 0?o:w(Ac())}function S(){var E=Ac(),C=y(E);if(s=arguments,r=this,c=E,C){if(a===void 0)return g(c);if(f)return clearTimeout(a),a=setTimeout(b,e),p(c)}return a===void 0&&(a=setTimeout(b,e)),o}return S.cancel=x,S.flush=v,S}var yp=Object.prototype,iP=yp.hasOwnProperty,oP=yr(function(n,e){n=Object(n);var t=-1,s=e.length,r=s>2?e[2]:void 0;for(r&&Xo(e[0],e[1],r)&&(s=1);++t<s;)for(var i=e[t],o=vr(i),a=-1,c=o.length;++a<c;){var u=o[a],d=n[u];(d===void 0||mr(d,yp[u])&&!iP.call(n,u))&&(n[u]=i[u])}return n});function _c(n,e,t){(t!==void 0&&!mr(n[e],t)||t===void 0&&!(e in n))&&Jo(n,e,t)}function ua(n){return nn(n)&&Is(n)}function Tc(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function aP(n){return Ni(n,vr(n))}function lP(n,e,t,s,r,i,o){var a=Tc(n,t),c=Tc(e,t),u=o.get(c);if(u){_c(n,t,u);return}var d=i?i(a,c,t+"",n,e,o):void 0,f=d===void 0;if(f){var h=ht(c),p=!h&&wr(c),g=!h&&!p&&Qo(c);d=c,h||p||g?ht(a)?d=a:ua(a)?d=Hh(a):p?(f=!1,d=$f(c,!0)):g?(f=!1,d=Zf(c,!0)):d=[]:vn(c)||br(c)?(d=a,br(a)?d=aP(a):(!Ie(a)||ac(a))&&(d=Qf(c))):f=!1}f&&(o.set(c,d),r(d,c,s,i,o),o.delete(c)),_c(n,t,d)}function da(n,e,t,s,r){n!==e&&pp(e,function(i,o){if(r||(r=new sn),Ie(i))lP(n,e,o,t,da,s,r);else{var a=s?s(Tc(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),_c(n,o,a)}},vr)}function bp(n,e,t,s,r,i){return Ie(n)&&Ie(e)&&(i.set(e,n),da(n,e,void 0,bp,i),i.delete(e)),n}var cP=Jh(function(n,e,t,s){da(n,e,t,s)}),wp=yr(function(n){return n.push(void 0,bp),Uh(cP,void 0,n)}),uP=200;function dP(n,e,t,s){var r=-1,i=Wh,o=!0,a=n.length,c=[],u=e.length;if(!a)return c;e.length>=uP&&(i=Oc,o=!1,e=new Er(e));e:for(;++r<a;){var d=n[r],f=d;if(d=d!==0?d:0,o&&f===f){for(var h=u;h--;)if(e[h]===f)continue e;c.push(d)}else i(e,f,s)||c.push(d)}return c}var hP=yr(function(n,e){return ua(n)?dP(n,ra(e,1,ua,!0)):[]});function fP(n,e){var t=-1,s=Is(n)?Array(n.length):[];return gp(n,function(r,i,o){s[++t]=e(r,i,o)}),s}function ha(n){for(var e=-1,t=n==null?0:n.length,s={};++e<t;){var r=n[e];s[r[0]]=r[1]}return s}var pP=Object.prototype,gP=pP.hasOwnProperty,xp=tP(function(n,e,t){gP.call(n,t)?n[t].push(e):Jo(n,t,[e])});function mP(n,e){return n>e}var yP=Object.prototype,bP=yP.hasOwnProperty;function wP(n,e){return n!=null&&bP.call(n,e)}function fa(n,e){return n!=null&&hp(n,e,wP)}var xP="[object Map]",vP="[object Set]",CP=Object.prototype,SP=CP.hasOwnProperty;function vp(n){if(n==null)return!0;if(Is(n)&&(ht(n)||typeof n=="string"||typeof n.splice=="function"||wr(n)||Qo(n)||br(n)))return!n.length;var e=Bt(n);if(e==xP||e==vP)return!n.size;if(Ko(n))return!of(n).length;for(var t in n)if(SP.call(n,t))return!1;return!0}function Cn(n,e){return ca(n,e)}var EP="[object Number]";function kc(n){return typeof n=="number"||nn(n)&&as(n)==EP}function pa(n){return n==null}function OP(n){return n===void 0}var MP=yf("toLowerCase");function PP(n,e,t){for(var s=-1,r=n.length;++s<r;){var i=n[s],o=e(i);if(o!=null&&(a===void 0?o===o&&!xn(o):t(o,a)))var a=o,c=i}return c}function NP(n){return n&&n.length?PP(n,gr,mP):void 0}var We=Jh(function(n,e,t){da(n,e,t)});function AP(n,e,t,s){if(!Ie(n))return n;e=na(e,n);for(var r=-1,i=e.length,o=i-1,a=n;a!=null&&++r<i;){var c=Di(e[r]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(r!=o){var d=a[c];u=void 0,u===void 0&&(u=Ie(d)?d:qo(e[r+1])?[]:{})}uc(a,c,u),a=a[c]}return n}function _P(n,e,t){for(var s=-1,r=e.length,i={};++s<r;){var o=e[s],a=sa(n,o);t(a,o)&&AP(i,na(o,n),a)}return i}function TP(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function kP(n,e){if(n!==e){var t=n!==void 0,s=n===null,r=n===n,i=xn(n),o=e!==void 0,a=e===null,c=e===e,u=xn(e);if(!a&&!u&&!i&&n>e||i&&o&&c&&!a&&!u||s&&o&&c||!t&&c||!r)return 1;if(!s&&!i&&!u&&n<e||u&&t&&r&&!s&&!i||a&&t&&r||!o&&r||!c)return-1}return 0}function VP(n,e,t){for(var s=-1,r=n.criteria,i=e.criteria,o=r.length,a=t.length;++s<o;){var c=kP(r[s],i[s]);if(c){if(s>=a)return c;var u=t[s];return c*(u=="desc"?-1:1)}}return n.index-e.index}function DP(n,e,t){e.length?e=Wo(e,function(i){return ht(i)?function(o){return sa(o,i.length===1?i[0]:i)}:i}):e=[gr];var s=-1;e=Wo(e,Zo(Nc));var r=fP(n,function(i,o,a){var c=Wo(e,function(u){return u(i)});return{criteria:c,index:++s,value:i}});return TP(r,function(i,o){return VP(i,o,t)})}function RP(n,e){return _P(n,e,function(t,s){return fp(n,s)})}var Vc=fE(function(n,e){return n==null?{}:RP(n,e)}),Dc=yr(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Xo(n,e[0],e[1])?e=[]:t>2&&Xo(e[0],e[1],e[2])&&(e=[e[0]]),DP(n,ra(e),[])}),LP=4294967295,IP=LP-1,BP=Math.floor,jP=Math.min;function Cp(n,e,t,s){var r=0,i=n==null?0:n.length;if(i===0)return 0;e=t(e);for(var o=e!==e,a=e===null,c=xn(e),u=e===void 0;r<i;){var d=BP((r+i)/2),f=t(n[d]),h=f!==void 0,p=f===null,g=f===f,m=xn(f);if(o)var y=g;else u?y=g&&h:a?y=g&&h&&!p:c?y=g&&h&&!p&&!m:p||m?y=!1:y=f<e;y?r=d+1:i=d}return jP(i,IP)}var $P=4294967295,zP=$P>>>1;function FP(n,e,t){var s=0,r=n==null?s:n.length;if(typeof e=="number"&&e===e&&r<=zP){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!xn(o)&&o<e?s=i+1:r=i}return r}return Cp(n,e,gr)}function UP(n,e){return FP(n,e)}function HP(n,e,t){return Cp(n,e,Nc(t))}var GP=Rf(function(n,e,t){return n+(t?" ":"")+ia(e)}),WP="Expected a function";function YP(n,e,t){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(WP);return Ie(t)&&(s="leading"in t?!!t.leading:s,r="trailing"in t?!!t.trailing:r),mp(n,e,{leading:s,maxWait:e,trailing:r})}var qP=1/0,JP=Sr&&1/Mc(new Sr([,-0]))[1]==qP?function(n){return new Sr(n)}:MC,XP=200;function Sp(n,e,t){var s=-1,r=Wh,i=n.length,o=!0,a=[],c=a;if(i>=XP){var u=JP(n);if(u)return Mc(u);o=!1,r=Oc,c=new Er}else c=a;e:for(;++s<i;){var d=n[s],f=d;if(d=d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;a.push(d)}else r(c,f,t)||(c!==a&&c.push(f),a.push(d))}return a}var Ep=yr(function(n){return Sp(ra(n,1,ua,!0))});function Op(n){return n&&n.length?Sp(n):[]}const Mp=n=>n===void 0,ga=n=>typeof n=="boolean",jt=n=>typeof n=="number",Gn=n=>typeof Element>"u"?!1:n instanceof Element,KP=n=>en(n)?!Number.isNaN(Number(n)):!1,Pp=n=>Object.keys(n);class Np extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function ZP(n,e){throw new Np(`[${n}] ${e}`)}function At(n,e){if(process.env.NODE_ENV!=="production"){const t=en(n)?new Np(`[${n}] ${e}`):n;console.warn(t)}}const QP="utils/dom/style",Ap=(n="")=>n.split(" ").filter(e=>!!e.trim()),_p=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},eN=(n,e)=>{!n||!e.trim()||n.classList.add(...Ap(e))},tN=(n,e)=>{!n||!e.trim()||n.classList.remove(...Ap(e))},nN=(n,e)=>{var t;if(!Ge||!n||!e)return"";let s=Uv(e);s==="float"&&(s="cssFloat");try{const r=n.style[s];if(r)return r;const i=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return i?i[s]:""}catch{return n.style[s]}};function Li(n,e="px"){if(!n)return"";if(jt(n)||KP(n))return`${n}${e}`;if(en(n))return n;At(QP,"binding value must be a string or number")}let ma;const sN=n=>{var e;if(!Ge)return 0;if(ma!==void 0)return ma;const t=document.createElement("div");t.className=`${n}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const s=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),ma=s-i,ma};/*! Element Plus Icons Vue v2.3.1 */var rN=l.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),iN=rN,oN=l.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),l.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),aN=oN,lN=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),Tp=lN,cN=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),kp=cN,uN=l.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),dN=uN,hN=l.defineComponent({name:"DeleteFilled",__name:"delete-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32"})]))}}),Vp=hN,fN=l.defineComponent({name:"Document",__name:"document",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),pN=fN,gN=l.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),l.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),mN=gN,yN=l.defineComponent({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Dp=yN,bN=l.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),ya=bN,wN=l.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),xN=wN,vN=l.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),Rp=vN,CN=l.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Lp=CN,SN=l.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Ip=SN;const Bp="__epPropKey",he=n=>n,EN=n=>pr(n)&&!!n[Bp],ba=(n,e)=>{if(!pr(n)||EN(n))return n;const{values:t,required:s,default:r,type:i,validator:o}=n,c={type:i,required:!!s,validator:t||o?u=>{let d=!1,f=[];if(t&&(f=Array.from(t),Go(n,"default")&&f.push(r),d||(d=f.includes(u))),o&&(d||(d=o(u))),!d&&f.length>0){const h=[...new Set(f)].map(p=>JSON.stringify(p)).join(", ");l.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Bp]:!0};return Go(n,"default")&&(c.default=r),c},Ze=n=>ha(Object.entries(n).map(([e,t])=>[e,ba(t,e)])),Ii=he([String,Object,Function]),jp={Close:dN,SuccessFilled:Rp,InfoFilled:Dp,WarningFilled:Ip,CircleCloseFilled:Tp},wa={success:Rp,warning:Ip,error:Tp,info:Dp},ON={validating:ya,success:aN,error:kp},js=(n,e)=>{if(n.install=t=>{for(const s of[n,...Object.values(e??{})])t.component(s.name,s)},e)for(const[t,s]of Object.entries(e))n[t]=s;return n},MN=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),PN=n=>(n.install=os,n),Or={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},Rc="update:modelValue",$p=["","default","small","large"],NN=n=>["",...$p].includes(n);var xa=(n=>(n[n.TEXT=1]="TEXT",n[n.CLASS=2]="CLASS",n[n.STYLE=4]="STYLE",n[n.PROPS=8]="PROPS",n[n.FULL_PROPS=16]="FULL_PROPS",n[n.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",n[n.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",n[n.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",n[n.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",n[n.NEED_PATCH=512]="NEED_PATCH",n[n.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",n[n.HOISTED=-1]="HOISTED",n[n.BAIL=-2]="BAIL",n))(xa||{});const AN=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),zp=n=>n,_N=["class","style"],TN=/^on[A-Z]/,kN=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,s=l.computed(()=>((t==null?void 0:t.value)||[]).concat(_N)),r=l.getCurrentInstance();return r?l.computed(()=>{var i;return ha(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(e&&TN.test(o))))}):(At("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},VN=({from:n,replacement:e,scope:t,version:s,ref:r,type:i="API"},o)=>{l.watch(()=>l.unref(o),a=>{a&&At(t,`[${i}] ${n} is about to be deprecated in version ${s}, please use ${e} instead.
15
15
  For more detail, please visit: ${r}
16
- `)},{immediate:!0})},CA=(n,e,t,s)=>{let r={offsetX:0,offsetY:0};const i=u=>{const d=u.clientX,h=u.clientY,{offsetX:f,offsetY:p}=r,g=n.value.getBoundingClientRect(),m=g.left,y=g.top,b=g.width,w=g.height,x=document.documentElement.clientWidth,v=document.documentElement.clientHeight,S=-m+f,E=-y+p,C=x-m-b+f,M=v-y-w+p,N=T=>{let k=f+T.clientX-d,R=p+T.clientY-h;s!=null&&s.value||(k=Math.min(Math.max(k,S),C),R=Math.min(Math.max(R,E),M)),r={offsetX:k,offsetY:R},n.value&&(n.value.style.transform=`translate(${Di(k)}, ${Di(R)})`)},_=()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",N),document.addEventListener("mouseup",_)},o=()=>{e.value&&n.value&&e.value.addEventListener("mousedown",i)},a=()=>{e.value&&n.value&&e.value.removeEventListener("mousedown",i)},c=()=>{r={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return l.onMounted(()=>{l.watchEffect(()=>{t.value?o():a()})}),l.onBeforeUnmount(()=>{a()}),{resetPosition:c}};var SA={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const EA=n=>(e,t)=>OA(e,t,l.unref(n)),OA=(n,e,t)=>Xh(t,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=e==null?void 0:e[r])!=null?i:`{${r}}`}`}),MA=n=>{const e=l.computed(()=>l.unref(n).name),t=l.isRef(n)?n:l.ref(n);return{lang:e,locale:t,t:EA(n)}},kp=Symbol("localeContextKey"),PA=n=>{const e=n||l.inject(kp,l.ref());return MA(l.computed(()=>e.value||SA))},ba="el",AA="is-",Fs=(n,e,t,s,r)=>{let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Dp=Symbol("namespaceContextKey"),Tc=n=>{const e=n||(l.getCurrentInstance()?l.inject(Dp,l.ref(ba)):l.ref(ba));return l.computed(()=>l.unref(e)||ba)},mt=(n,e)=>{const t=Tc(e);return{namespace:t,b:(m="")=>Fs(t.value,n,m,"",""),e:m=>m?Fs(t.value,n,"",m,""):"",m:m=>m?Fs(t.value,n,"","",m):"",be:(m,y)=>m&&y?Fs(t.value,n,m,y,""):"",em:(m,y)=>m&&y?Fs(t.value,n,"",m,y):"",bm:(m,y)=>m&&y?Fs(t.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?Fs(t.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${AA}${m}`:""},cssVar:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${b}`]=m[b]);return y},cssVarName:m=>`--${t.value}-${m}`,cssVarBlock:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${n}-${b}`]=m[b]);return y},cssVarBlockName:m=>`--${t.value}-${n}-${m}`}},NA=(n,e={})=>{l.isRef(n)||$P("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||mt("popup"),s=l.computed(()=>t.bm("parent","hidden"));if(!Ge||xp(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(UP(document==null?void 0:document.body,s.value),i&&document&&(document.body.style.width=o))},200)};l.watch(n,c=>{if(!c){a();return}i=!xp(document.body,s.value),i&&(o=document.body.style.width),r=GP(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=HP(document.body,"overflowY");r>0&&(u||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),FP(document.body,s.value)}),l.onScopeDispose(()=>a())},TA=ga({type:he(Boolean),default:null}),_A=ga({type:he(Function)}),kA=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,s=[e],r={[n]:TA,[t]:_A};return{useModelToggle:({indicator:o,toggleReason:a,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:h})=>{const f=l.getCurrentInstance(),{emit:p}=f,g=f.props,m=l.computed(()=>Lt(g[t])),y=l.computed(()=>g[n]===null),b=C=>{o.value!==!0&&(o.value=!0,a&&(a.value=C),Lt(d)&&d(C))},w=C=>{o.value!==!1&&(o.value=!1,a&&(a.value=C),Lt(h)&&h(C))},x=C=>{if(g.disabled===!0||Lt(u)&&!u())return;const M=m.value&&Ge;M&&p(e,!0),(y.value||!M)&&b(C)},v=C=>{if(g.disabled===!0||!Ge)return;const M=m.value&&Ge;M&&p(e,!1),(y.value||!M)&&w(C)},S=C=>{ha(C)&&(g.disabled&&C?m.value&&p(e,!1):o.value!==C&&(C?b():w()))},E=()=>{o.value?v():x()};return l.watch(()=>g[n],S),c&&f.appContext.config.globalProperties.$route!==void 0&&l.watch(()=>({...f.proxy.$route}),()=>{c.value&&o.value&&v()}),l.onMounted(()=>{S(g[n])}),{hide:v,show:x,toggle:E,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},Rp=n=>{const e=l.getCurrentInstance();return l.computed(()=>{var t,s;return(s=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:s[n]})};var xt="top",jt="bottom",$t="right",vt="left",_c="auto",Li=[xt,jt,$t,vt],Or="start",Ii="end",DA="clippingParents",Lp="viewport",Vi="popper",RA="reference",Ip=Li.reduce(function(n,e){return n.concat([e+"-"+Or,e+"-"+Ii])},[]),kc=[].concat(Li,[_c]).reduce(function(n,e){return n.concat([e,e+"-"+Or,e+"-"+Ii])},[]),LA="beforeRead",IA="read",VA="afterRead",BA="beforeMain",jA="main",$A="afterMain",zA="beforeWrite",FA="write",UA="afterWrite",HA=[LA,IA,VA,BA,jA,$A,zA,FA,UA];function vn(n){return n?(n.nodeName||"").toLowerCase():null}function nn(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Mr(n){var e=nn(n).Element;return n instanceof e||n instanceof Element}function zt(n){var e=nn(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Dc(n){if(typeof ShadowRoot>"u")return!1;var e=nn(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function GA(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];!zt(i)||!vn(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(o){var a=r[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function YA(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var r=e.elements[s],i=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(c,u){return c[u]="",c},{});!zt(r)||!vn(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}var Vp={name:"applyStyles",enabled:!0,phase:"write",fn:GA,effect:YA,requires:["computeStyles"]};function Cn(n){return n.split("-")[0]}var Us=Math.max,wa=Math.min,Pr=Math.round;function Ar(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),s=1,r=1;if(zt(n)&&e){var i=n.offsetHeight,o=n.offsetWidth;o>0&&(s=Pr(t.width)/o||1),i>0&&(r=Pr(t.height)/i||1)}return{width:t.width/s,height:t.height/r,top:t.top/r,right:t.right/s,bottom:t.bottom/r,left:t.left/s,x:t.left/s,y:t.top/r}}function Rc(n){var e=Ar(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function Bp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Dc(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Gn(n){return nn(n).getComputedStyle(n)}function WA(n){return["table","td","th"].indexOf(vn(n))>=0}function cs(n){return((Mr(n)?n.ownerDocument:n.document)||window.document).documentElement}function xa(n){return vn(n)==="html"?n:n.assignedSlot||n.parentNode||(Dc(n)?n.host:null)||cs(n)}function jp(n){return!zt(n)||Gn(n).position==="fixed"?null:n.offsetParent}function qA(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&zt(n)){var s=Gn(n);if(s.position==="fixed")return null}var r=xa(n);for(Dc(r)&&(r=r.host);zt(r)&&["html","body"].indexOf(vn(r))<0;){var i=Gn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Bi(n){for(var e=nn(n),t=jp(n);t&&WA(t)&&Gn(t).position==="static";)t=jp(t);return t&&(vn(t)==="html"||vn(t)==="body"&&Gn(t).position==="static")?e:t||qA(n)||e}function Lc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function ji(n,e,t){return Us(n,wa(e,t))}function JA(n,e,t){var s=ji(n,e,t);return s>t?t:s}function $p(){return{top:0,right:0,bottom:0,left:0}}function zp(n){return Object.assign({},$p(),n)}function Fp(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var XA=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,zp(typeof n!="number"?n:Fp(n,Li))};function KA(n){var e,t=n.state,s=n.name,r=n.options,i=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Cn(t.placement),c=Lc(a),u=[vt,$t].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!o)){var h=XA(r.padding,t),f=Rc(i),p=c==="y"?xt:vt,g=c==="y"?jt:$t,m=t.rects.reference[d]+t.rects.reference[c]-o[c]-t.rects.popper[d],y=o[c]-t.rects.reference[c],b=Bi(i),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,v=h[p],S=w-f[d]-h[g],E=w/2-f[d]/2+x,C=ji(v,E,S),M=c;t.modifiersData[s]=(e={},e[M]=C,e.centerOffset=C-E,e)}}function ZA(n){var e=n.state,t=n.options,s=t.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!Bp(e.elements.popper,r)||(e.elements.arrow=r))}var QA={name:"arrow",enabled:!0,phase:"main",fn:KA,effect:ZA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Nr(n){return n.split("-")[1]}var eN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tN(n){var e=n.x,t=n.y,s=window,r=s.devicePixelRatio||1;return{x:Pr(e*r)/r||0,y:Pr(t*r)/r||0}}function Up(n){var e,t=n.popper,s=n.popperRect,r=n.placement,i=n.variation,o=n.offsets,a=n.position,c=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,h=n.isFixed,f=o.x,p=f===void 0?0:f,g=o.y,m=g===void 0?0:g,y=typeof d=="function"?d({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),x=vt,v=xt,S=window;if(u){var E=Bi(t),C="clientHeight",M="clientWidth";if(E===nn(t)&&(E=cs(t),Gn(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),E=E,r===xt||(r===vt||r===$t)&&i===Ii){v=jt;var N=h&&E===S&&S.visualViewport?S.visualViewport.height:E[C];m-=N-s.height,m*=c?1:-1}if(r===vt||(r===xt||r===jt)&&i===Ii){x=$t;var _=h&&E===S&&S.visualViewport?S.visualViewport.width:E[M];p-=_-s.width,p*=c?1:-1}}var T=Object.assign({position:a},u&&eN),k=d===!0?tN({x:p,y:m}):{x:p,y:m};if(p=k.x,m=k.y,c){var R;return Object.assign({},T,(R={},R[v]=w?"0":"",R[x]=b?"0":"",R.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",R))}return Object.assign({},T,(e={},e[v]=w?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function nN(n){var e=n.state,t=n.options,s=t.gpuAcceleration,r=s===void 0?!0:s,i=t.adaptive,o=i===void 0?!0:i,a=t.roundOffsets,c=a===void 0?!0:a,u={placement:Cn(e.placement),variation:Nr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Up(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Up(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Hp={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:nN,data:{}},va={passive:!0};function sN(n){var e=n.state,t=n.instance,s=n.options,r=s.scroll,i=r===void 0?!0:r,o=s.resize,a=o===void 0?!0:o,c=nn(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",t.update,va)}),a&&c.addEventListener("resize",t.update,va),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",t.update,va)}),a&&c.removeEventListener("resize",t.update,va)}}var Gp={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sN,data:{}},rN={left:"right",right:"left",bottom:"top",top:"bottom"};function Ca(n){return n.replace(/left|right|bottom|top/g,function(e){return rN[e]})}var iN={start:"end",end:"start"};function Yp(n){return n.replace(/start|end/g,function(e){return iN[e]})}function Ic(n){var e=nn(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function Vc(n){return Ar(cs(n)).left+Ic(n).scrollLeft}function oN(n){var e=nn(n),t=cs(n),s=e.visualViewport,r=t.clientWidth,i=t.clientHeight,o=0,a=0;return s&&(r=s.width,i=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:r,height:i,x:o+Vc(n),y:a}}function aN(n){var e,t=cs(n),s=Ic(n),r=(e=n.ownerDocument)==null?void 0:e.body,i=Us(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Us(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Vc(n),c=-s.scrollTop;return Gn(r||t).direction==="rtl"&&(a+=Us(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function Bc(n){var e=Gn(n),t=e.overflow,s=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+s)}function Wp(n){return["html","body","#document"].indexOf(vn(n))>=0?n.ownerDocument.body:zt(n)&&Bc(n)?n:Wp(xa(n))}function $i(n,e){var t;e===void 0&&(e=[]);var s=Wp(n),r=s===((t=n.ownerDocument)==null?void 0:t.body),i=nn(s),o=r?[i].concat(i.visualViewport||[],Bc(s)?s:[]):s,a=e.concat(o);return r?a:a.concat($i(xa(o)))}function jc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function lN(n){var e=Ar(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function qp(n,e){return e===Lp?jc(oN(n)):Mr(e)?lN(e):jc(aN(cs(n)))}function cN(n){var e=$i(xa(n)),t=["absolute","fixed"].indexOf(Gn(n).position)>=0,s=t&&zt(n)?Bi(n):n;return Mr(s)?e.filter(function(r){return Mr(r)&&Bp(r,s)&&vn(r)!=="body"}):[]}function uN(n,e,t){var s=e==="clippingParents"?cN(n):[].concat(e),r=[].concat(s,[t]),i=r[0],o=r.reduce(function(a,c){var u=qp(n,c);return a.top=Us(u.top,a.top),a.right=wa(u.right,a.right),a.bottom=wa(u.bottom,a.bottom),a.left=Us(u.left,a.left),a},qp(n,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Jp(n){var e=n.reference,t=n.element,s=n.placement,r=s?Cn(s):null,i=s?Nr(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(r){case xt:c={x:o,y:e.y-t.height};break;case jt:c={x:o,y:e.y+e.height};break;case $t:c={x:e.x+e.width,y:a};break;case vt:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=r?Lc(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Or:c[u]=c[u]-(e[d]/2-t[d]/2);break;case Ii:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function zi(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=s===void 0?n.placement:s,i=t.boundary,o=i===void 0?DA:i,a=t.rootBoundary,c=a===void 0?Lp:a,u=t.elementContext,d=u===void 0?Vi:u,h=t.altBoundary,f=h===void 0?!1:h,p=t.padding,g=p===void 0?0:p,m=zp(typeof g!="number"?g:Fp(g,Li)),y=d===Vi?RA:Vi,b=n.rects.popper,w=n.elements[f?y:d],x=uN(Mr(w)?w:w.contextElement||cs(n.elements.popper),o,c),v=Ar(n.elements.reference),S=Jp({reference:v,element:b,strategy:"absolute",placement:r}),E=jc(Object.assign({},b,S)),C=d===Vi?E:v,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},N=n.modifiersData.offset;if(d===Vi&&N){var _=N[r];Object.keys(M).forEach(function(T){var k=[$t,jt].indexOf(T)>=0?1:-1,R=[xt,jt].indexOf(T)>=0?"y":"x";M[T]+=_[R]*k})}return M}function dN(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=t.boundary,i=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,u=c===void 0?kc:c,d=Nr(s),h=d?a?Ip:Ip.filter(function(g){return Nr(g)===d}):Li,f=h.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=h);var p=f.reduce(function(g,m){return g[m]=zi(n,{placement:m,boundary:r,rootBoundary:i,padding:o})[Cn(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function hN(n){if(Cn(n)===_c)return[];var e=Ca(n);return[Yp(n),e,Yp(e)]}function fN(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,u=t.padding,d=t.boundary,h=t.rootBoundary,f=t.altBoundary,p=t.flipVariations,g=p===void 0?!0:p,m=t.allowedAutoPlacements,y=e.options.placement,b=Cn(y),w=b===y,x=c||(w||!g?[Ca(y)]:hN(y)),v=[y].concat(x).reduce(function(L,G){return L.concat(Cn(G)===_c?dN(e,{placement:G,boundary:d,rootBoundary:h,padding:u,flipVariations:g,allowedAutoPlacements:m}):G)},[]),S=e.rects.reference,E=e.rects.popper,C=new Map,M=!0,N=v[0],_=0;_<v.length;_++){var T=v[_],k=Cn(T),R=Nr(T)===Or,V=[xt,jt].indexOf(k)>=0,A=V?"width":"height",P=zi(e,{placement:T,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),j=V?R?$t:vt:R?jt:xt;S[A]>E[A]&&(j=Ca(j));var z=Ca(j),Y=[];if(i&&Y.push(P[k]<=0),a&&Y.push(P[j]<=0,P[z]<=0),Y.every(function(L){return L})){N=T,M=!1;break}C.set(T,Y)}if(M)for(var le=g?3:1,I=function(L){var G=v.find(function(ie){var Z=C.get(ie);if(Z)return Z.slice(0,L).every(function(ae){return ae})});if(G)return N=G,"break"},B=le;B>0;B--){var ne=I(B);if(ne==="break")break}e.placement!==N&&(e.modifiersData[s]._skip=!0,e.placement=N,e.reset=!0)}}var pN={name:"flip",enabled:!0,phase:"main",fn:fN,requiresIfExists:["offset"],data:{_skip:!1}};function Xp(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Kp(n){return[xt,$t,jt,vt].some(function(e){return n[e]>=0})}function gN(n){var e=n.state,t=n.name,s=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=zi(e,{elementContext:"reference"}),a=zi(e,{altBoundary:!0}),c=Xp(o,s),u=Xp(a,r,i),d=Kp(c),h=Kp(u);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}var mN={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gN};function yN(n,e,t){var s=Cn(n),r=[vt,xt].indexOf(s)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=i[0],a=i[1];return o=o||0,a=(a||0)*r,[vt,$t].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function bN(n){var e=n.state,t=n.options,s=n.name,r=t.offset,i=r===void 0?[0,0]:r,o=kc.reduce(function(d,h){return d[h]=yN(h,e.rects,i),d},{}),a=o[e.placement],c=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[s]=o}var wN={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bN};function xN(n){var e=n.state,t=n.name;e.modifiersData[t]=Jp({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Zp={name:"popperOffsets",enabled:!0,phase:"read",fn:xN,data:{}};function vN(n){return n==="x"?"y":"x"}function CN(n){var e=n.state,t=n.options,s=n.name,r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,u=t.rootBoundary,d=t.altBoundary,h=t.padding,f=t.tether,p=f===void 0?!0:f,g=t.tetherOffset,m=g===void 0?0:g,y=zi(e,{boundary:c,rootBoundary:u,padding:h,altBoundary:d}),b=Cn(e.placement),w=Nr(e.placement),x=!w,v=Lc(b),S=vN(v),E=e.modifiersData.popperOffsets,C=e.rects.reference,M=e.rects.popper,N=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,_=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(E){if(i){var R,V=v==="y"?xt:vt,A=v==="y"?jt:$t,P=v==="y"?"height":"width",j=E[v],z=j+y[V],Y=j-y[A],le=p?-M[P]/2:0,I=w===Or?C[P]:M[P],B=w===Or?-M[P]:-C[P],ne=e.elements.arrow,L=p&&ne?Rc(ne):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:$p(),ie=G[V],Z=G[A],ae=ji(0,C[P],L[P]),He=x?C[P]/2-le-ae-ie-_.mainAxis:I-ae-ie-_.mainAxis,re=x?-C[P]/2+le+ae+Z+_.mainAxis:B+ae+Z+_.mainAxis,at=e.elements.arrow&&Bi(e.elements.arrow),nt=at?v==="y"?at.clientTop||0:at.clientLeft||0:0,Mt=(R=T==null?void 0:T[v])!=null?R:0,Tn=j+He-Mt-nt,es=j+re-Mt,J=ji(p?wa(z,Tn):z,j,p?Us(Y,es):Y);E[v]=J,k[v]=J-j}if(a){var ci,oe=v==="x"?xt:vt,Wt=v==="x"?jt:$t,ts=E[S],ui=S==="y"?"height":"width",bo=ts+y[oe],wl=ts-y[Wt],di=[xt,vt].indexOf(b)!==-1,H=(ci=T==null?void 0:T[S])!=null?ci:0,Ee=di?bo:ts-C[ui]-M[ui]-H+_.altAxis,ns=di?ts+C[ui]+M[ui]-H-_.altAxis:wl,wo=p&&di?JA(Ee,ts,ns):ji(p?Ee:bo,ts,p?ns:wl);E[S]=wo,k[S]=wo-ts}e.modifiersData[s]=k}}var SN={name:"preventOverflow",enabled:!0,phase:"main",fn:CN,requiresIfExists:["offset"]};function EN(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function ON(n){return n===nn(n)||!zt(n)?Ic(n):EN(n)}function MN(n){var e=n.getBoundingClientRect(),t=Pr(e.width)/n.offsetWidth||1,s=Pr(e.height)/n.offsetHeight||1;return t!==1||s!==1}function PN(n,e,t){t===void 0&&(t=!1);var s=zt(e),r=zt(e)&&MN(e),i=cs(e),o=Ar(n,r),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((vn(e)!=="body"||Bc(i))&&(a=ON(e)),zt(e)?(c=Ar(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Vc(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function AN(n){var e=new Map,t=new Set,s=[];n.forEach(function(i){e.set(i.name,i)});function r(i){t.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&r(c)}}),s.push(i)}return n.forEach(function(i){t.has(i.name)||r(i)}),s}function NN(n){var e=AN(n);return HA.reduce(function(t,s){return t.concat(e.filter(function(r){return r.phase===s}))},[])}function TN(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function _N(n){var e=n.reduce(function(t,s){var r=t[s.name];return t[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var Qp={placement:"bottom",modifiers:[],strategy:"absolute"};function eg(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function $c(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,r=e.defaultOptions,i=r===void 0?Qp:r;return function(o,a,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qp,i),modifiersData:{},elements:{reference:o,popper:a},attributes:{},styles:{}},d=[],h=!1,f={state:u,setOptions:function(m){var y=typeof m=="function"?m(u.options):m;g(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:Mr(o)?$i(o):o.contextElement?$i(o.contextElement):[],popper:$i(a)};var b=NN(_N([].concat(s,u.options.modifiers)));return u.orderedModifiers=b.filter(function(w){return w.enabled}),p(),f.update()},forceUpdate:function(){if(!h){var m=u.elements,y=m.reference,b=m.popper;if(eg(y,b)){u.rects={reference:PN(y,Bi(b),u.options.strategy==="fixed"),popper:Rc(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(M){return u.modifiersData[M.name]=Object.assign({},M.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var x=u.orderedModifiers[w],v=x.fn,S=x.options,E=S===void 0?{}:S,C=x.name;typeof v=="function"&&(u=v({state:u,options:E,name:C,instance:f})||u)}}}},update:TN(function(){return new Promise(function(m){f.forceUpdate(),m(u)})}),destroy:function(){g(),h=!0}};if(!eg(o,a))return f;f.setOptions(c).then(function(m){!h&&c.onFirstUpdate&&c.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var y=m.name,b=m.options,w=b===void 0?{}:b,x=m.effect;if(typeof x=="function"){var v=x({state:u,name:y,instance:f,options:w}),S=function(){};d.push(v||S)}})}function g(){d.forEach(function(m){return m()}),d=[]}return f}}$c();var kN=[Gp,Zp,Hp,Vp];$c({defaultModifiers:kN});var DN=[Gp,Zp,Hp,Vp,wN,pN,SN,QA,mN],RN=$c({defaultModifiers:DN});const LN=(n,e,t={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=IN(c);Object.assign(o.value,u)},requires:["computeStyles"]},r=l.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:h}=l.unref(t);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...h||[],s,{name:"applyStyles",enabled:!1}]}}),i=l.shallowRef(),o=l.ref({styles:{popper:{position:l.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return l.watch(r,c=>{const u=l.unref(i);u&&u.setOptions(c)},{deep:!0}),l.watch([n,e],([c,u])=>{a(),!(!c||!u)&&(i.value=RN(c,u,l.unref(r)))}),l.onBeforeUnmount(()=>{a()}),{state:l.computed(()=>{var c;return{...((c=l.unref(i))==null?void 0:c.state)||{}}}),styles:l.computed(()=>l.unref(o).styles),attributes:l.computed(()=>l.unref(o).attributes),update:()=>{var c;return(c=l.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=l.unref(i))==null?void 0:c.forceUpdate()},instanceRef:l.computed(()=>l.unref(i))}};function IN(n){const e=Object.keys(n.elements),t=ca(e.map(r=>[r,n.styles[r]||{}])),s=ca(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:s}}const tg=n=>{if(!n)return{onClick:as,onMousedown:as,onMouseup:as};let e=!1,t=!1;return{onClick:o=>{e&&t&&n(o),e=t=!1},onMousedown:o=>{e=o.target===o.currentTarget},onMouseup:o=>{t=o.target===o.currentTarget}}};function ng(){let n;const e=(s,r)=>{t(),n=window.setTimeout(s,r)},t=()=>window.clearTimeout(n);return zo(()=>t()),{registerTimeout:e,cancelTimeout:t}}const zc={prefix:Math.floor(Math.random()*1e4),current:0},VN=Symbol("elIdInjection"),sg=()=>l.getCurrentInstance()?l.inject(VN,zc):zc,Sa=n=>{const e=sg();!Ge&&e===zc&&At("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
16
+ `)},{immediate:!0})},DN=(n,e,t,s)=>{let r={offsetX:0,offsetY:0};const i=u=>{const d=u.clientX,f=u.clientY,{offsetX:h,offsetY:p}=r,g=n.value.getBoundingClientRect(),m=g.left,y=g.top,b=g.width,w=g.height,x=document.documentElement.clientWidth,v=document.documentElement.clientHeight,S=-m+h,E=-y+p,C=x-m-b+h,P=v-y-w+p,A=k=>{let V=h+k.clientX-d,R=p+k.clientY-f;s!=null&&s.value||(V=Math.min(Math.max(V,S),C),R=Math.min(Math.max(R,E),P)),r={offsetX:V,offsetY:R},n.value&&(n.value.style.transform=`translate(${Li(V)}, ${Li(R)})`)},T=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",T)},o=()=>{e.value&&n.value&&e.value.addEventListener("mousedown",i)},a=()=>{e.value&&n.value&&e.value.removeEventListener("mousedown",i)},c=()=>{r={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return l.onMounted(()=>{l.watchEffect(()=>{t.value?o():a()})}),l.onBeforeUnmount(()=>{a()}),{resetPosition:c}};var RN={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const LN=n=>(e,t)=>IN(e,t,l.unref(n)),IN=(n,e,t)=>af(t,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=e==null?void 0:e[r])!=null?i:`{${r}}`}`}),BN=n=>{const e=l.computed(()=>l.unref(n).name),t=l.isRef(n)?n:l.ref(n);return{lang:e,locale:t,t:LN(n)}},Fp=Symbol("localeContextKey"),jN=n=>{const e=n||l.inject(Fp,l.ref());return BN(l.computed(()=>e.value||RN))},va="el",$N="is-",$s=(n,e,t,s,r)=>{let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Up=Symbol("namespaceContextKey"),Lc=n=>{const e=n||(l.getCurrentInstance()?l.inject(Up,l.ref(va)):l.ref(va));return l.computed(()=>l.unref(e)||va)},mt=(n,e)=>{const t=Lc(e);return{namespace:t,b:(m="")=>$s(t.value,n,m,"",""),e:m=>m?$s(t.value,n,"",m,""):"",m:m=>m?$s(t.value,n,"","",m):"",be:(m,y)=>m&&y?$s(t.value,n,m,y,""):"",em:(m,y)=>m&&y?$s(t.value,n,"",m,y):"",bm:(m,y)=>m&&y?$s(t.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?$s(t.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${$N}${m}`:""},cssVar:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${b}`]=m[b]);return y},cssVarName:m=>`--${t.value}-${m}`,cssVarBlock:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${n}-${b}`]=m[b]);return y},cssVarBlockName:m=>`--${t.value}-${n}-${m}`}},zN=(n,e={})=>{l.isRef(n)||ZP("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||mt("popup"),s=l.computed(()=>t.bm("parent","hidden"));if(!Ge||_p(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(tN(document==null?void 0:document.body,s.value),i&&document&&(document.body.style.width=o))},200)};l.watch(n,c=>{if(!c){a();return}i=!_p(document.body,s.value),i&&(o=document.body.style.width),r=sN(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=nN(document.body,"overflowY");r>0&&(u||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),eN(document.body,s.value)}),l.onScopeDispose(()=>a())},FN=ba({type:he(Boolean),default:null}),UN=ba({type:he(Function)}),HN=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,s=[e],r={[n]:FN,[t]:UN};return{useModelToggle:({indicator:o,toggleReason:a,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const h=l.getCurrentInstance(),{emit:p}=h,g=h.props,m=l.computed(()=>Lt(g[t])),y=l.computed(()=>g[n]===null),b=C=>{o.value!==!0&&(o.value=!0,a&&(a.value=C),Lt(d)&&d(C))},w=C=>{o.value!==!1&&(o.value=!1,a&&(a.value=C),Lt(f)&&f(C))},x=C=>{if(g.disabled===!0||Lt(u)&&!u())return;const P=m.value&&Ge;P&&p(e,!0),(y.value||!P)&&b(C)},v=C=>{if(g.disabled===!0||!Ge)return;const P=m.value&&Ge;P&&p(e,!1),(y.value||!P)&&w(C)},S=C=>{ga(C)&&(g.disabled&&C?m.value&&p(e,!1):o.value!==C&&(C?b():w()))},E=()=>{o.value?v():x()};return l.watch(()=>g[n],S),c&&h.appContext.config.globalProperties.$route!==void 0&&l.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&v()}),l.onMounted(()=>{S(g[n])}),{hide:v,show:x,toggle:E,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},Hp=n=>{const e=l.getCurrentInstance();return l.computed(()=>{var t,s;return(s=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:s[n]})};var vt="top",$t="bottom",zt="right",Ct="left",Ic="auto",Bi=[vt,$t,zt,Ct],Mr="start",ji="end",GN="clippingParents",Gp="viewport",$i="popper",WN="reference",Wp=Bi.reduce(function(n,e){return n.concat([e+"-"+Mr,e+"-"+ji])},[]),Bc=[].concat(Bi,[Ic]).reduce(function(n,e){return n.concat([e,e+"-"+Mr,e+"-"+ji])},[]),YN="beforeRead",qN="read",JN="afterRead",XN="beforeMain",KN="main",ZN="afterMain",QN="beforeWrite",eA="write",tA="afterWrite",nA=[YN,qN,JN,XN,KN,ZN,QN,eA,tA];function Sn(n){return n?(n.nodeName||"").toLowerCase():null}function rn(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Pr(n){var e=rn(n).Element;return n instanceof e||n instanceof Element}function Ft(n){var e=rn(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function jc(n){if(typeof ShadowRoot>"u")return!1;var e=rn(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function sA(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];!Ft(i)||!Sn(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(o){var a=r[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function rA(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var r=e.elements[s],i=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(c,u){return c[u]="",c},{});!Ft(r)||!Sn(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}var Yp={name:"applyStyles",enabled:!0,phase:"write",fn:sA,effect:rA,requires:["computeStyles"]};function En(n){return n.split("-")[0]}var zs=Math.max,Ca=Math.min,Nr=Math.round;function Ar(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),s=1,r=1;if(Ft(n)&&e){var i=n.offsetHeight,o=n.offsetWidth;o>0&&(s=Nr(t.width)/o||1),i>0&&(r=Nr(t.height)/i||1)}return{width:t.width/s,height:t.height/r,top:t.top/r,right:t.right/s,bottom:t.bottom/r,left:t.left/s,x:t.left/s,y:t.top/r}}function $c(n){var e=Ar(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function qp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&jc(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Wn(n){return rn(n).getComputedStyle(n)}function iA(n){return["table","td","th"].indexOf(Sn(n))>=0}function ls(n){return((Pr(n)?n.ownerDocument:n.document)||window.document).documentElement}function Sa(n){return Sn(n)==="html"?n:n.assignedSlot||n.parentNode||(jc(n)?n.host:null)||ls(n)}function Jp(n){return!Ft(n)||Wn(n).position==="fixed"?null:n.offsetParent}function oA(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Ft(n)){var s=Wn(n);if(s.position==="fixed")return null}var r=Sa(n);for(jc(r)&&(r=r.host);Ft(r)&&["html","body"].indexOf(Sn(r))<0;){var i=Wn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function zi(n){for(var e=rn(n),t=Jp(n);t&&iA(t)&&Wn(t).position==="static";)t=Jp(t);return t&&(Sn(t)==="html"||Sn(t)==="body"&&Wn(t).position==="static")?e:t||oA(n)||e}function zc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Fi(n,e,t){return zs(n,Ca(e,t))}function aA(n,e,t){var s=Fi(n,e,t);return s>t?t:s}function Xp(){return{top:0,right:0,bottom:0,left:0}}function Kp(n){return Object.assign({},Xp(),n)}function Zp(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var lA=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,Kp(typeof n!="number"?n:Zp(n,Bi))};function cA(n){var e,t=n.state,s=n.name,r=n.options,i=t.elements.arrow,o=t.modifiersData.popperOffsets,a=En(t.placement),c=zc(a),u=[Ct,zt].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!o)){var f=lA(r.padding,t),h=$c(i),p=c==="y"?vt:Ct,g=c==="y"?$t:zt,m=t.rects.reference[d]+t.rects.reference[c]-o[c]-t.rects.popper[d],y=o[c]-t.rects.reference[c],b=zi(i),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,v=f[p],S=w-h[d]-f[g],E=w/2-h[d]/2+x,C=Fi(v,E,S),P=c;t.modifiersData[s]=(e={},e[P]=C,e.centerOffset=C-E,e)}}function uA(n){var e=n.state,t=n.options,s=t.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!qp(e.elements.popper,r)||(e.elements.arrow=r))}var dA={name:"arrow",enabled:!0,phase:"main",fn:cA,effect:uA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _r(n){return n.split("-")[1]}var hA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function fA(n){var e=n.x,t=n.y,s=window,r=s.devicePixelRatio||1;return{x:Nr(e*r)/r||0,y:Nr(t*r)/r||0}}function Qp(n){var e,t=n.popper,s=n.popperRect,r=n.placement,i=n.variation,o=n.offsets,a=n.position,c=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,f=n.isFixed,h=o.x,p=h===void 0?0:h,g=o.y,m=g===void 0?0:g,y=typeof d=="function"?d({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),x=Ct,v=vt,S=window;if(u){var E=zi(t),C="clientHeight",P="clientWidth";if(E===rn(t)&&(E=ls(t),Wn(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",P="scrollWidth")),E=E,r===vt||(r===Ct||r===zt)&&i===ji){v=$t;var A=f&&E===S&&S.visualViewport?S.visualViewport.height:E[C];m-=A-s.height,m*=c?1:-1}if(r===Ct||(r===vt||r===$t)&&i===ji){x=zt;var T=f&&E===S&&S.visualViewport?S.visualViewport.width:E[P];p-=T-s.width,p*=c?1:-1}}var k=Object.assign({position:a},u&&hA),V=d===!0?fA({x:p,y:m}):{x:p,y:m};if(p=V.x,m=V.y,c){var R;return Object.assign({},k,(R={},R[v]=w?"0":"",R[x]=b?"0":"",R.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",R))}return Object.assign({},k,(e={},e[v]=w?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function pA(n){var e=n.state,t=n.options,s=t.gpuAcceleration,r=s===void 0?!0:s,i=t.adaptive,o=i===void 0?!0:i,a=t.roundOffsets,c=a===void 0?!0:a,u={placement:En(e.placement),variation:_r(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qp(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qp(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var eg={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pA,data:{}},Ea={passive:!0};function gA(n){var e=n.state,t=n.instance,s=n.options,r=s.scroll,i=r===void 0?!0:r,o=s.resize,a=o===void 0?!0:o,c=rn(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",t.update,Ea)}),a&&c.addEventListener("resize",t.update,Ea),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",t.update,Ea)}),a&&c.removeEventListener("resize",t.update,Ea)}}var tg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gA,data:{}},mA={left:"right",right:"left",bottom:"top",top:"bottom"};function Oa(n){return n.replace(/left|right|bottom|top/g,function(e){return mA[e]})}var yA={start:"end",end:"start"};function ng(n){return n.replace(/start|end/g,function(e){return yA[e]})}function Fc(n){var e=rn(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function Uc(n){return Ar(ls(n)).left+Fc(n).scrollLeft}function bA(n){var e=rn(n),t=ls(n),s=e.visualViewport,r=t.clientWidth,i=t.clientHeight,o=0,a=0;return s&&(r=s.width,i=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:r,height:i,x:o+Uc(n),y:a}}function wA(n){var e,t=ls(n),s=Fc(n),r=(e=n.ownerDocument)==null?void 0:e.body,i=zs(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=zs(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Uc(n),c=-s.scrollTop;return Wn(r||t).direction==="rtl"&&(a+=zs(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function Hc(n){var e=Wn(n),t=e.overflow,s=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+s)}function sg(n){return["html","body","#document"].indexOf(Sn(n))>=0?n.ownerDocument.body:Ft(n)&&Hc(n)?n:sg(Sa(n))}function Ui(n,e){var t;e===void 0&&(e=[]);var s=sg(n),r=s===((t=n.ownerDocument)==null?void 0:t.body),i=rn(s),o=r?[i].concat(i.visualViewport||[],Hc(s)?s:[]):s,a=e.concat(o);return r?a:a.concat(Ui(Sa(o)))}function Gc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function xA(n){var e=Ar(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function rg(n,e){return e===Gp?Gc(bA(n)):Pr(e)?xA(e):Gc(wA(ls(n)))}function vA(n){var e=Ui(Sa(n)),t=["absolute","fixed"].indexOf(Wn(n).position)>=0,s=t&&Ft(n)?zi(n):n;return Pr(s)?e.filter(function(r){return Pr(r)&&qp(r,s)&&Sn(r)!=="body"}):[]}function CA(n,e,t){var s=e==="clippingParents"?vA(n):[].concat(e),r=[].concat(s,[t]),i=r[0],o=r.reduce(function(a,c){var u=rg(n,c);return a.top=zs(u.top,a.top),a.right=Ca(u.right,a.right),a.bottom=Ca(u.bottom,a.bottom),a.left=zs(u.left,a.left),a},rg(n,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ig(n){var e=n.reference,t=n.element,s=n.placement,r=s?En(s):null,i=s?_r(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(r){case vt:c={x:o,y:e.y-t.height};break;case $t:c={x:o,y:e.y+e.height};break;case zt:c={x:e.x+e.width,y:a};break;case Ct:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=r?zc(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Mr:c[u]=c[u]-(e[d]/2-t[d]/2);break;case ji:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function Hi(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=s===void 0?n.placement:s,i=t.boundary,o=i===void 0?GN:i,a=t.rootBoundary,c=a===void 0?Gp:a,u=t.elementContext,d=u===void 0?$i:u,f=t.altBoundary,h=f===void 0?!1:f,p=t.padding,g=p===void 0?0:p,m=Kp(typeof g!="number"?g:Zp(g,Bi)),y=d===$i?WN:$i,b=n.rects.popper,w=n.elements[h?y:d],x=CA(Pr(w)?w:w.contextElement||ls(n.elements.popper),o,c),v=Ar(n.elements.reference),S=ig({reference:v,element:b,strategy:"absolute",placement:r}),E=Gc(Object.assign({},b,S)),C=d===$i?E:v,P={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},A=n.modifiersData.offset;if(d===$i&&A){var T=A[r];Object.keys(P).forEach(function(k){var V=[zt,$t].indexOf(k)>=0?1:-1,R=[vt,$t].indexOf(k)>=0?"y":"x";P[k]+=T[R]*V})}return P}function SA(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=t.boundary,i=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,u=c===void 0?Bc:c,d=_r(s),f=d?a?Wp:Wp.filter(function(g){return _r(g)===d}):Bi,h=f.filter(function(g){return u.indexOf(g)>=0});h.length===0&&(h=f);var p=h.reduce(function(g,m){return g[m]=Hi(n,{placement:m,boundary:r,rootBoundary:i,padding:o})[En(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function EA(n){if(En(n)===Ic)return[];var e=Oa(n);return[ng(n),e,ng(e)]}function OA(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,u=t.padding,d=t.boundary,f=t.rootBoundary,h=t.altBoundary,p=t.flipVariations,g=p===void 0?!0:p,m=t.allowedAutoPlacements,y=e.options.placement,b=En(y),w=b===y,x=c||(w||!g?[Oa(y)]:EA(y)),v=[y].concat(x).reduce(function(K,q){return K.concat(En(q)===Ic?SA(e,{placement:q,boundary:d,rootBoundary:f,padding:u,flipVariations:g,allowedAutoPlacements:m}):q)},[]),S=e.rects.reference,E=e.rects.popper,C=new Map,P=!0,A=v[0],T=0;T<v.length;T++){var k=v[T],V=En(k),R=_r(k)===Mr,j=[vt,$t].indexOf(V)>=0,N=j?"width":"height",M=Hi(e,{placement:k,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),D=j?R?zt:Ct:R?$t:vt;S[N]>E[N]&&(D=Oa(D));var B=Oa(D),G=[];if(i&&G.push(M[V]<=0),a&&G.push(M[D]<=0,M[B]<=0),G.every(function(K){return K})){A=k,P=!1;break}C.set(k,G)}if(P)for(var se=g?3:1,I=function(K){var q=v.find(function(re){var Z=C.get(re);if(Z)return Z.slice(0,K).every(function(ge){return ge})});if(q)return A=q,"break"},_=se;_>0;_--){var H=I(_);if(H==="break")break}e.placement!==A&&(e.modifiersData[s]._skip=!0,e.placement=A,e.reset=!0)}}var MA={name:"flip",enabled:!0,phase:"main",fn:OA,requiresIfExists:["offset"],data:{_skip:!1}};function og(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function ag(n){return[vt,zt,$t,Ct].some(function(e){return n[e]>=0})}function PA(n){var e=n.state,t=n.name,s=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=Hi(e,{elementContext:"reference"}),a=Hi(e,{altBoundary:!0}),c=og(o,s),u=og(a,r,i),d=ag(c),f=ag(u);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var NA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:PA};function AA(n,e,t){var s=En(n),r=[Ct,vt].indexOf(s)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=i[0],a=i[1];return o=o||0,a=(a||0)*r,[Ct,zt].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function _A(n){var e=n.state,t=n.options,s=n.name,r=t.offset,i=r===void 0?[0,0]:r,o=Bc.reduce(function(d,f){return d[f]=AA(f,e.rects,i),d},{}),a=o[e.placement],c=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[s]=o}var TA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_A};function kA(n){var e=n.state,t=n.name;e.modifiersData[t]=ig({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var lg={name:"popperOffsets",enabled:!0,phase:"read",fn:kA,data:{}};function VA(n){return n==="x"?"y":"x"}function DA(n){var e=n.state,t=n.options,s=n.name,r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,u=t.rootBoundary,d=t.altBoundary,f=t.padding,h=t.tether,p=h===void 0?!0:h,g=t.tetherOffset,m=g===void 0?0:g,y=Hi(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),b=En(e.placement),w=_r(e.placement),x=!w,v=zc(b),S=VA(v),E=e.modifiersData.popperOffsets,C=e.rects.reference,P=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,T=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),k=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,V={x:0,y:0};if(E){if(i){var R,j=v==="y"?vt:Ct,N=v==="y"?$t:zt,M=v==="y"?"height":"width",D=E[v],B=D+y[j],G=D-y[N],se=p?-P[M]/2:0,I=w===Mr?C[M]:P[M],_=w===Mr?-P[M]:-C[M],H=e.elements.arrow,K=p&&H?$c(H):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Xp(),re=q[j],Z=q[N],ge=Fi(0,C[M],K[M]),te=x?C[M]/2-se-ge-re-T.mainAxis:I-ge-re-T.mainAxis,le=x?-C[M]/2+se+ge+Z+T.mainAxis:_+ge+Z+T.mainAxis,bt=e.elements.arrow&&zi(e.elements.arrow),st=bt?v==="y"?bt.clientTop||0:bt.clientLeft||0:0,Pt=(R=k==null?void 0:k[v])!=null?R:0,Q=D+te-Pt-st,sr=D+le-Pt,rr=Fi(p?Ca(B,Q):B,D,p?zs(G,sr):G);E[v]=rr,V[v]=rr-D}if(a){var hi,ae=v==="x"?vt:Ct,Jt=v==="x"?$t:zt,es=E[S],fi=S==="y"?"height":"width",vo=es+y[ae],Ol=es-y[Jt],pi=[vt,Ct].indexOf(b)!==-1,U=(hi=k==null?void 0:k[S])!=null?hi:0,Oe=pi?vo:es-C[fi]-P[fi]-U+T.altAxis,ts=pi?es+C[fi]+P[fi]-U-T.altAxis:Ol,Co=p&&pi?aA(Oe,es,ts):Fi(p?Oe:vo,es,p?ts:Ol);E[S]=Co,V[S]=Co-es}e.modifiersData[s]=V}}var RA={name:"preventOverflow",enabled:!0,phase:"main",fn:DA,requiresIfExists:["offset"]};function LA(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function IA(n){return n===rn(n)||!Ft(n)?Fc(n):LA(n)}function BA(n){var e=n.getBoundingClientRect(),t=Nr(e.width)/n.offsetWidth||1,s=Nr(e.height)/n.offsetHeight||1;return t!==1||s!==1}function jA(n,e,t){t===void 0&&(t=!1);var s=Ft(e),r=Ft(e)&&BA(e),i=ls(e),o=Ar(n,r),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((Sn(e)!=="body"||Hc(i))&&(a=IA(e)),Ft(e)?(c=Ar(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Uc(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function $A(n){var e=new Map,t=new Set,s=[];n.forEach(function(i){e.set(i.name,i)});function r(i){t.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&r(c)}}),s.push(i)}return n.forEach(function(i){t.has(i.name)||r(i)}),s}function zA(n){var e=$A(n);return nA.reduce(function(t,s){return t.concat(e.filter(function(r){return r.phase===s}))},[])}function FA(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function UA(n){var e=n.reduce(function(t,s){var r=t[s.name];return t[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var cg={placement:"bottom",modifiers:[],strategy:"absolute"};function ug(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Wc(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,r=e.defaultOptions,i=r===void 0?cg:r;return function(o,a,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},cg,i),modifiersData:{},elements:{reference:o,popper:a},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(m){var y=typeof m=="function"?m(u.options):m;g(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:Pr(o)?Ui(o):o.contextElement?Ui(o.contextElement):[],popper:Ui(a)};var b=zA(UA([].concat(s,u.options.modifiers)));return u.orderedModifiers=b.filter(function(w){return w.enabled}),p(),h.update()},forceUpdate:function(){if(!f){var m=u.elements,y=m.reference,b=m.popper;if(ug(y,b)){u.rects={reference:jA(y,zi(b),u.options.strategy==="fixed"),popper:$c(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(P){return u.modifiersData[P.name]=Object.assign({},P.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var x=u.orderedModifiers[w],v=x.fn,S=x.options,E=S===void 0?{}:S,C=x.name;typeof v=="function"&&(u=v({state:u,options:E,name:C,instance:h})||u)}}}},update:FA(function(){return new Promise(function(m){h.forceUpdate(),m(u)})}),destroy:function(){g(),f=!0}};if(!ug(o,a))return h;h.setOptions(c).then(function(m){!f&&c.onFirstUpdate&&c.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var y=m.name,b=m.options,w=b===void 0?{}:b,x=m.effect;if(typeof x=="function"){var v=x({state:u,name:y,instance:h,options:w}),S=function(){};d.push(v||S)}})}function g(){d.forEach(function(m){return m()}),d=[]}return h}}Wc();var HA=[tg,lg,eg,Yp];Wc({defaultModifiers:HA});var GA=[tg,lg,eg,Yp,TA,MA,RA,dA,NA],WA=Wc({defaultModifiers:GA});const YA=(n,e,t={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=qA(c);Object.assign(o.value,u)},requires:["computeStyles"]},r=l.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=l.unref(t);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],s,{name:"applyStyles",enabled:!1}]}}),i=l.shallowRef(),o=l.ref({styles:{popper:{position:l.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return l.watch(r,c=>{const u=l.unref(i);u&&u.setOptions(c)},{deep:!0}),l.watch([n,e],([c,u])=>{a(),!(!c||!u)&&(i.value=WA(c,u,l.unref(r)))}),l.onBeforeUnmount(()=>{a()}),{state:l.computed(()=>{var c;return{...((c=l.unref(i))==null?void 0:c.state)||{}}}),styles:l.computed(()=>l.unref(o).styles),attributes:l.computed(()=>l.unref(o).attributes),update:()=>{var c;return(c=l.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=l.unref(i))==null?void 0:c.forceUpdate()},instanceRef:l.computed(()=>l.unref(i))}};function qA(n){const e=Object.keys(n.elements),t=ha(e.map(r=>[r,n.styles[r]||{}])),s=ha(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:s}}const dg=n=>{if(!n)return{onClick:os,onMousedown:os,onMouseup:os};let e=!1,t=!1;return{onClick:o=>{e&&t&&n(o),e=t=!1},onMousedown:o=>{e=o.target===o.currentTarget},onMouseup:o=>{t=o.target===o.currentTarget}}};function hg(){let n;const e=(s,r)=>{t(),n=window.setTimeout(s,r)},t=()=>window.clearTimeout(n);return Ho(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Yc={prefix:Math.floor(Math.random()*1e4),current:0},JA=Symbol("elIdInjection"),fg=()=>l.getCurrentInstance()?l.inject(JA,Yc):Yc,Ma=n=>{const e=fg();!Ge&&e===Yc&&At("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
17
17
  usage: app.provide(ID_INJECTION_KEY, {
18
18
  prefix: number,
19
19
  current: number,
20
- })`);const t=Tc();return l.computed(()=>l.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let Tr=[];const rg=n=>{const e=n;e.key===Er.esc&&Tr.forEach(t=>t(e))},BN=n=>{l.onMounted(()=>{Tr.length===0&&document.addEventListener("keydown",rg),Ge&&Tr.push(n)}),l.onBeforeUnmount(()=>{Tr=Tr.filter(e=>e!==n),Tr.length===0&&Ge&&document.removeEventListener("keydown",rg)})},ig=()=>{const n=Tc(),e=sg(),t=l.computed(()=>`${n.value}-popper-container-${e.prefix}`),s=l.computed(()=>`#${t.value}`);return{id:t,selector:s}},jN=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},$N=()=>{const{id:n,selector:e}=ig();return l.onBeforeMount(()=>{Ge&&(process.env.NODE_ENV==="test"||!document.body.querySelector(e.value))&&jN(n.value)}),{id:n,selector:e}},zN=Ze({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),FN=({showAfter:n,hideAfter:e,autoClose:t,open:s,close:r})=>{const{registerTimeout:i}=ng(),{registerTimeout:o,cancelTimeout:a}=ng();return{onOpen:d=>{i(()=>{s(d);const h=l.unref(t);Bt(h)&&h>0&&o(()=>{r(d)},h)},l.unref(n))},onClose:d=>{a(),i(()=>{r(d)},l.unref(e))}}},og=Symbol("elForwardRef"),UN=n=>{const e=t=>{n.value=t};l.provide(og,{setForwardRef:e})},HN=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),ag={current:0},lg=l.ref(0),cg=2e3,ug=Symbol("elZIndexContextKey"),dg=Symbol("zIndexContextKey"),hg=n=>{const e=l.getCurrentInstance()?l.inject(ug,ag):ag,t=n||(l.getCurrentInstance()?l.inject(dg,void 0):void 0),s=l.computed(()=>{const o=l.unref(t);return Bt(o)?o:cg}),r=l.computed(()=>s.value+lg.value),i=()=>(e.current++,lg.value=e.current,r.value);return!Ge&&!l.inject(ug)&&At("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
21
- usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function GN(n){let e;function t(){if(n.value==null)return;const{selectionStart:r,selectionEnd:i,value:o}=n.value;if(r==null||i==null)return;const a=o.slice(0,Math.max(0,r)),c=o.slice(Math.max(0,i));e={selectionStart:r,selectionEnd:i,value:o,beforeTxt:a,afterTxt:c}}function s(){if(n.value==null||e==null)return;const{value:r}=n.value,{beforeTxt:i,afterTxt:o,selectionStart:a}=e;if(i==null||o==null||a==null)return;let c=r.length;if(r.endsWith(o))c=r.length-o.length;else if(r.startsWith(i))c=i.length;else{const u=i[a-1],d=r.indexOf(u,a-1);d!==-1&&(c=d+1)}n.value.setSelectionRange(c,c)}return[t,s]}const Fc=ga({type:String,values:Tp,required:!1}),fg=Symbol("size"),YN=()=>{const n=l.inject(fg,{});return l.computed(()=>l.unref(n.size)||"")};function WN(n,{beforeFocus:e,afterFocus:t,beforeBlur:s,afterBlur:r}={}){const i=l.getCurrentInstance(),{emit:o}=i,a=l.shallowRef(),c=l.ref(!1),u=f=>{Lt(e)&&e(f)||c.value||(c.value=!0,o("focus",f),t==null||t())},d=f=>{var p;Lt(s)&&s(f)||f.relatedTarget&&((p=a.value)!=null&&p.contains(f.relatedTarget))||(c.value=!1,o("blur",f),r==null||r())},h=()=>{var f,p;(f=a.value)!=null&&f.contains(document.activeElement)&&a.value!==document.activeElement||(p=n.value)==null||p.focus()};return l.watch(a,f=>{f&&f.setAttribute("tabindex","-1")}),zn(a,"focus",u,!0),zn(a,"blur",d,!0),zn(a,"click",h,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const f=Hn(n.value)?n.value:document.querySelector("input,textarea");f&&(zn(f,"focus",u,!0),zn(f,"blur",d,!0))}),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}function qN({afterComposition:n,emit:e}){const t=l.ref(!1),s=a=>{e==null||e("compositionstart",a),t.value=!0},r=a=>{var c;e==null||e("compositionupdate",a);const u=(c=a.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!yA(d)},i=a=>{e==null||e("compositionend",a),t.value&&(t.value=!1,l.nextTick(()=>n(a)))};return{isComposing:t,handleComposition:a=>{a.type==="compositionend"?i(a):r(a)},handleCompositionStart:s,handleCompositionUpdate:r,handleCompositionEnd:i}}const JN=Symbol("emptyValuesContextKey"),XN=Ze({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>Lt(n)?!n():!n}}),KN=Ze({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Uc=n=>Pc(KN,n),pg=Symbol(),Ea=l.ref();function Hc(n,e=void 0){const t=l.getCurrentInstance()?l.inject(pg,Ea):Ea;return n?l.computed(()=>{var s,r;return(r=(s=t.value)==null?void 0:s[n])!=null?r:e}):t}function gg(n,e){const t=Hc(),s=mt(n,l.computed(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||ba})),r=PA(l.computed(()=>{var a;return(a=t.value)==null?void 0:a.locale})),i=hg(l.computed(()=>{var a;return((a=t.value)==null?void 0:a.zIndex)||cg})),o=l.computed(()=>{var a;return l.unref(e)||((a=t.value)==null?void 0:a.size)||""});return mg(l.computed(()=>l.unref(t)||{})),{ns:s,locale:r,zIndex:i,size:o}}const mg=(n,e,t=!1)=>{var s;const r=!!l.getCurrentInstance(),i=r?Hc():void 0,o=(s=void 0)!=null?s:r?l.provide:void 0;if(!o){At("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=l.computed(()=>{const c=l.unref(n);return i!=null&&i.value?ZN(i.value,c):c});return o(pg,a),o(kp,l.computed(()=>a.value.locale)),o(Dp,l.computed(()=>a.value.namespace)),o(dg,l.computed(()=>a.value.zIndex)),o(fg,{size:l.computed(()=>a.value.size||"")}),o(JN,l.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!Ea.value)&&(Ea.value=a.value),a},ZN=(n,e)=>{const t=[...new Set([...yp(n),...yp(e)])],s={};for(const r of t)s[r]=e[r]!==void 0?e[r]:n[r];return s},QN=Ze({a11y:{type:Boolean,default:!0},locale:{type:he(Object)},size:Fc,button:{type:he(Object)},experimentalFeatures:{type:he(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:he(Object)},zIndex:Number,namespace:{type:String,default:"el"},...XN}),sn={};l.defineComponent({name:"ElConfigProvider",props:QN,setup(n,{slots:e}){l.watch(()=>n.message,s=>{Object.assign(sn,s??{})},{immediate:!0,deep:!0});const t=mg(n);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var ft=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};const eT=Ze({size:{type:he([Number,String])},color:{type:String}}),tT=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),nT=l.defineComponent({...tT,props:eT,setup(n){const e=n,t=mt("icon"),s=l.computed(()=>{const{size:r,color:i}=e;return!r&&!i?{}:{fontSize:mp(r)?void 0:Di(r),"--color":i}});return(r,i)=>(l.openBlock(),l.createElementBlock("i",l.mergeProps({class:l.unref(t).b(),style:l.unref(s)},r.$attrs),[l.renderSlot(r.$slots,"default")],16))}});var sT=ft(nT,[["__file","icon.vue"]]);const Sn=zs(sT),Gc=Symbol("formContextKey"),Oa=Symbol("formItemContextKey"),yg=(n,e={})=>{const t=l.ref(void 0),s=e.prop?t:Rp("size"),r=e.global?t:YN(),i=e.form?{size:void 0}:l.inject(Gc,void 0),o=e.formItem?{size:void 0}:l.inject(Oa,void 0);return l.computed(()=>s.value||l.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},Yc=n=>{const e=Rp("disabled"),t=l.inject(Gc,void 0);return l.computed(()=>e.value||l.unref(n)||(t==null?void 0:t.disabled)||!1)},bg=()=>{const n=l.inject(Gc,void 0),e=l.inject(Oa,void 0);return{form:n,formItem:e}},rT=(n,{formItemContext:e,disableIdGeneration:t,disableIdManagement:s})=>{t||(t=l.ref(!1)),s||(s=l.ref(!1));const r=l.ref();let i;const o=l.computed(()=>{var a;return!!(!(n.label||n.ariaLabel)&&e&&e.inputIds&&((a=e.inputIds)==null?void 0:a.length)<=1)});return l.onMounted(()=>{i=l.watch([l.toRef(n,"id"),t],([a,c])=>{const u=a??(c?void 0:Sa().value);u!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(s!=null&&s.value)&&!c&&u&&e.addInputId(u)),r.value=u)},{immediate:!0})}),l.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:o,inputId:r}};let rn;const iT=`
20
+ })`);const t=Lc();return l.computed(()=>l.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let Tr=[];const pg=n=>{const e=n;e.key===Or.esc&&Tr.forEach(t=>t(e))},XA=n=>{l.onMounted(()=>{Tr.length===0&&document.addEventListener("keydown",pg),Ge&&Tr.push(n)}),l.onBeforeUnmount(()=>{Tr=Tr.filter(e=>e!==n),Tr.length===0&&Ge&&document.removeEventListener("keydown",pg)})},gg=()=>{const n=Lc(),e=fg(),t=l.computed(()=>`${n.value}-popper-container-${e.prefix}`),s=l.computed(()=>`#${t.value}`);return{id:t,selector:s}},KA=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},ZA=()=>{const{id:n,selector:e}=gg();return l.onBeforeMount(()=>{Ge&&(process.env.NODE_ENV==="test"||!document.body.querySelector(e.value))&&KA(n.value)}),{id:n,selector:e}},QA=Ze({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),e_=({showAfter:n,hideAfter:e,autoClose:t,open:s,close:r})=>{const{registerTimeout:i}=hg(),{registerTimeout:o,cancelTimeout:a}=hg();return{onOpen:d=>{i(()=>{s(d);const f=l.unref(t);jt(f)&&f>0&&o(()=>{r(d)},f)},l.unref(n))},onClose:d=>{a(),i(()=>{r(d)},l.unref(e))}}},mg=Symbol("elForwardRef"),t_=n=>{const e=t=>{n.value=t};l.provide(mg,{setForwardRef:e})},n_=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),yg={current:0},bg=l.ref(0),wg=2e3,xg=Symbol("elZIndexContextKey"),vg=Symbol("zIndexContextKey"),Cg=n=>{const e=l.getCurrentInstance()?l.inject(xg,yg):yg,t=n||(l.getCurrentInstance()?l.inject(vg,void 0):void 0),s=l.computed(()=>{const o=l.unref(t);return jt(o)?o:wg}),r=l.computed(()=>s.value+bg.value),i=()=>(e.current++,bg.value=e.current,r.value);return!Ge&&!l.inject(xg)&&At("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
21
+ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function s_(n){let e;function t(){if(n.value==null)return;const{selectionStart:r,selectionEnd:i,value:o}=n.value;if(r==null||i==null)return;const a=o.slice(0,Math.max(0,r)),c=o.slice(Math.max(0,i));e={selectionStart:r,selectionEnd:i,value:o,beforeTxt:a,afterTxt:c}}function s(){if(n.value==null||e==null)return;const{value:r}=n.value,{beforeTxt:i,afterTxt:o,selectionStart:a}=e;if(i==null||o==null||a==null)return;let c=r.length;if(r.endsWith(o))c=r.length-o.length;else if(r.startsWith(i))c=i.length;else{const u=i[a-1],d=r.indexOf(u,a-1);d!==-1&&(c=d+1)}n.value.setSelectionRange(c,c)}return[t,s]}const qc=ba({type:String,values:$p,required:!1}),Sg=Symbol("size"),r_=()=>{const n=l.inject(Sg,{});return l.computed(()=>l.unref(n.size)||"")};function i_(n,{beforeFocus:e,afterFocus:t,beforeBlur:s,afterBlur:r}={}){const i=l.getCurrentInstance(),{emit:o}=i,a=l.shallowRef(),c=l.ref(!1),u=h=>{Lt(e)&&e(h)||c.value||(c.value=!0,o("focus",h),t==null||t())},d=h=>{var p;Lt(s)&&s(h)||h.relatedTarget&&((p=a.value)!=null&&p.contains(h.relatedTarget))||(c.value=!1,o("blur",h),r==null||r())},f=()=>{var h,p;(h=a.value)!=null&&h.contains(document.activeElement)&&a.value!==document.activeElement||(p=n.value)==null||p.focus()};return l.watch(a,h=>{h&&h.setAttribute("tabindex","-1")}),Fn(a,"focus",u,!0),Fn(a,"blur",d,!0),Fn(a,"click",f,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const h=Gn(n.value)?n.value:document.querySelector("input,textarea");h&&(Fn(h,"focus",u,!0),Fn(h,"blur",d,!0))}),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}function o_({afterComposition:n,emit:e}){const t=l.ref(!1),s=a=>{e==null||e("compositionstart",a),t.value=!0},r=a=>{var c;e==null||e("compositionupdate",a);const u=(c=a.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!AN(d)},i=a=>{e==null||e("compositionend",a),t.value&&(t.value=!1,l.nextTick(()=>n(a)))};return{isComposing:t,handleComposition:a=>{a.type==="compositionend"?i(a):r(a)},handleCompositionStart:s,handleCompositionUpdate:r,handleCompositionEnd:i}}const a_=Symbol("emptyValuesContextKey"),l_=Ze({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>Lt(n)?!n():!n}}),c_=Ze({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Jc=n=>Vc(c_,n),Eg=Symbol(),Pa=l.ref();function Xc(n,e=void 0){const t=l.getCurrentInstance()?l.inject(Eg,Pa):Pa;return n?l.computed(()=>{var s,r;return(r=(s=t.value)==null?void 0:s[n])!=null?r:e}):t}function Og(n,e){const t=Xc(),s=mt(n,l.computed(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||va})),r=jN(l.computed(()=>{var a;return(a=t.value)==null?void 0:a.locale})),i=Cg(l.computed(()=>{var a;return((a=t.value)==null?void 0:a.zIndex)||wg})),o=l.computed(()=>{var a;return l.unref(e)||((a=t.value)==null?void 0:a.size)||""});return Mg(l.computed(()=>l.unref(t)||{})),{ns:s,locale:r,zIndex:i,size:o}}const Mg=(n,e,t=!1)=>{var s;const r=!!l.getCurrentInstance(),i=r?Xc():void 0,o=(s=void 0)!=null?s:r?l.provide:void 0;if(!o){At("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=l.computed(()=>{const c=l.unref(n);return i!=null&&i.value?u_(i.value,c):c});return o(Eg,a),o(Fp,l.computed(()=>a.value.locale)),o(Up,l.computed(()=>a.value.namespace)),o(vg,l.computed(()=>a.value.zIndex)),o(Sg,{size:l.computed(()=>a.value.size||"")}),o(a_,l.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!Pa.value)&&(Pa.value=a.value),a},u_=(n,e)=>{const t=[...new Set([...Pp(n),...Pp(e)])],s={};for(const r of t)s[r]=e[r]!==void 0?e[r]:n[r];return s},d_=Ze({a11y:{type:Boolean,default:!0},locale:{type:he(Object)},size:qc,button:{type:he(Object)},experimentalFeatures:{type:he(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:he(Object)},zIndex:Number,namespace:{type:String,default:"el"},...l_}),on={};l.defineComponent({name:"ElConfigProvider",props:d_,setup(n,{slots:e}){l.watch(()=>n.message,s=>{Object.assign(on,s??{})},{immediate:!0,deep:!0});const t=Mg(n);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var ft=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};const h_=Ze({size:{type:he([Number,String])},color:{type:String}}),f_=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),p_=l.defineComponent({...f_,props:h_,setup(n){const e=n,t=mt("icon"),s=l.computed(()=>{const{size:r,color:i}=e;return!r&&!i?{}:{fontSize:Mp(r)?void 0:Li(r),"--color":i}});return(r,i)=>(l.openBlock(),l.createElementBlock("i",l.mergeProps({class:l.unref(t).b(),style:l.unref(s)},r.$attrs),[l.renderSlot(r.$slots,"default")],16))}});var g_=ft(p_,[["__file","icon.vue"]]);const On=js(g_),Kc=Symbol("formContextKey"),Na=Symbol("formItemContextKey"),Pg=(n,e={})=>{const t=l.ref(void 0),s=e.prop?t:Hp("size"),r=e.global?t:r_(),i=e.form?{size:void 0}:l.inject(Kc,void 0),o=e.formItem?{size:void 0}:l.inject(Na,void 0);return l.computed(()=>s.value||l.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},Zc=n=>{const e=Hp("disabled"),t=l.inject(Kc,void 0);return l.computed(()=>e.value||l.unref(n)||(t==null?void 0:t.disabled)||!1)},Ng=()=>{const n=l.inject(Kc,void 0),e=l.inject(Na,void 0);return{form:n,formItem:e}},m_=(n,{formItemContext:e,disableIdGeneration:t,disableIdManagement:s})=>{t||(t=l.ref(!1)),s||(s=l.ref(!1));const r=l.ref();let i;const o=l.computed(()=>{var a;return!!(!(n.label||n.ariaLabel)&&e&&e.inputIds&&((a=e.inputIds)==null?void 0:a.length)<=1)});return l.onMounted(()=>{i=l.watch([l.toRef(n,"id"),t],([a,c])=>{const u=a??(c?void 0:Ma().value);u!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(s!=null&&s.value)&&!c&&u&&e.addInputId(u)),r.value=u)},{immediate:!0})}),l.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:o,inputId:r}};let an;const y_=`
22
22
  height:0 !important;
23
23
  visibility:hidden !important;
24
- ${Mv()?"":"overflow:hidden !important;"}
24
+ ${Bv()?"":"overflow:hidden !important;"}
25
25
  position:absolute !important;
26
26
  z-index:-1000 !important;
27
27
  top:0 !important;
28
28
  right:0 !important;
29
- `,oT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function aT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),s=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:oT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:t}}function wg(n,e=1,t){var s;rn||(rn=document.createElement("textarea"),document.body.appendChild(rn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=aT(n);rn.setAttribute("style",`${a};${iT}`),rn.value=n.value||n.placeholder||"";let c=rn.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-r),rn.value="";const d=rn.scrollHeight-r;if(Bt(e)){let h=d*e;o==="border-box"&&(h=h+r+i),c=Math.max(h,c),u.minHeight=`${h}px`}if(Bt(t)){let h=d*t;o==="border-box"&&(h=h+r+i),c=Math.min(h,c)}return u.height=`${c}px`,(s=rn.parentNode)==null||s.removeChild(rn),rn=void 0,u}const lT=Ze({id:{type:String,default:void 0},size:Fc,disabled:Boolean,modelValue:{type:he([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:he([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Ri},prefixIcon:{type:Ri},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:he([Object,Array,String]),default:()=>_p({})},autofocus:Boolean,rows:{type:Number,default:2},...Uc(["ariaLabel"])}),cT={[Nc]:n=>Zt(n),input:n=>Zt(n),change:n=>Zt(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},uT=l.defineComponent({name:"ElInput",inheritAttrs:!1}),dT=l.defineComponent({...uT,props:lT,emits:cT,setup(n,{expose:e,emit:t}){const s=n,r=l.useAttrs(),i=l.useSlots(),o=l.computed(()=>{const H={};return s.containerRole==="combobox"&&(H["aria-haspopup"]=r["aria-haspopup"],H["aria-owns"]=r["aria-owns"],H["aria-expanded"]=r["aria-expanded"]),H}),a=l.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(p.value),m.is("disabled",g.value),m.is("exceed",ne.value),{[m.b("group")]:i.prepend||i.append,[m.m("prefix")]:i.prefix||s.prefixIcon,[m.m("suffix")]:i.suffix||s.suffixIcon||s.clearable||s.showPassword,[m.bm("suffix","password-clear")]:Y.value&&le.value,[m.b("hidden")]:s.type==="hidden"},r.class]),c=l.computed(()=>[m.e("wrapper"),m.is("focus",N.value)]),u=xA({excludeKeys:l.computed(()=>Object.keys(o.value))}),{form:d,formItem:h}=bg(),{inputId:f}=rT(s,{formItemContext:h}),p=yg(),g=Yc(),m=mt("input"),y=mt("textarea"),b=l.shallowRef(),w=l.shallowRef(),x=l.ref(!1),v=l.ref(!1),S=l.ref(),E=l.shallowRef(s.inputStyle),C=l.computed(()=>b.value||w.value),{wrapperRef:M,isFocused:N,handleFocus:_,handleBlur:T}=WN(C,{beforeFocus(){return g.value},afterBlur(){var H;s.validateEvent&&((H=h==null?void 0:h.validate)==null||H.call(h,"blur").catch(Ee=>At(Ee)))}}),k=l.computed(()=>{var H;return(H=d==null?void 0:d.statusIcon)!=null?H:!1}),R=l.computed(()=>(h==null?void 0:h.validateState)||""),V=l.computed(()=>R.value&&fA[R.value]),A=l.computed(()=>v.value?Mp:rA),P=l.computed(()=>[r.style]),j=l.computed(()=>[s.inputStyle,E.value,{resize:s.resize}]),z=l.computed(()=>da(s.modelValue)?"":String(s.modelValue)),Y=l.computed(()=>s.clearable&&!g.value&&!s.readonly&&!!z.value&&(N.value||x.value)),le=l.computed(()=>s.showPassword&&!g.value&&!!z.value&&(!!z.value||N.value)),I=l.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!g.value&&!s.readonly&&!s.showPassword),B=l.computed(()=>z.value.length),ne=l.computed(()=>!!I.value&&B.value>Number(s.maxlength)),L=l.computed(()=>!!i.suffix||!!s.suffixIcon||Y.value||s.showPassword||I.value||!!R.value&&k.value),[G,ie]=GN(b);xh(w,H=>{if(He(),!I.value||s.resize!=="both")return;const Ee=H[0],{width:ns}=Ee.contentRect;S.value={right:`calc(100% - ${ns+15+6}px)`}});const Z=()=>{const{type:H,autosize:Ee}=s;if(!(!Ge||H!=="textarea"||!w.value))if(Ee){const ns=fr(Ee)?Ee.minRows:void 0,wo=fr(Ee)?Ee.maxRows:void 0,o0=wg(w.value,ns,wo);E.value={overflowY:"hidden",...o0},l.nextTick(()=>{w.value.offsetHeight,E.value=o0})}else E.value={minHeight:wg(w.value).minHeight}},He=(H=>{let Ee=!1;return()=>{var ns;if(Ee||!s.autosize)return;((ns=w.value)==null?void 0:ns.offsetParent)===null||(H(),Ee=!0)}})(Z),re=()=>{const H=C.value,Ee=s.formatter?s.formatter(z.value):z.value;!H||H.value===Ee||(H.value=Ee)},at=async H=>{G();let{value:Ee}=H.target;if(s.formatter&&(Ee=s.parser?s.parser(Ee):Ee),!Mt.value){if(Ee===z.value){re();return}t(Nc,Ee),t("input",Ee),await l.nextTick(),re(),ie()}},nt=H=>{t("change",H.target.value)},{isComposing:Mt,handleCompositionStart:Tn,handleCompositionUpdate:es,handleCompositionEnd:J}=qN({emit:t,afterComposition:at}),ci=()=>{v.value=!v.value,oe()},oe=async()=>{var H;await l.nextTick(),(H=C.value)==null||H.focus()},Wt=()=>{var H;return(H=C.value)==null?void 0:H.blur()},ts=H=>{x.value=!1,t("mouseleave",H)},ui=H=>{x.value=!0,t("mouseenter",H)},bo=H=>{t("keydown",H)},wl=()=>{var H;(H=C.value)==null||H.select()},di=()=>{t(Nc,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>s.modelValue,()=>{var H;l.nextTick(()=>Z()),s.validateEvent&&((H=h==null?void 0:h.validate)==null||H.call(h,"change").catch(Ee=>At(Ee)))}),l.watch(z,()=>re()),l.watch(()=>s.type,async()=>{await l.nextTick(),re(),Z()}),l.onMounted(()=>{!s.formatter&&s.parser&&At("ElInput","If you set the parser, you also need to set the formatter."),re(),l.nextTick(Z)}),e({input:b,textarea:w,ref:C,textareaStyle:j,autosize:l.toRef(s,"autosize"),isComposing:Mt,focus:oe,blur:Wt,select:wl,clear:di,resizeTextarea:Z}),(H,Ee)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(o),{class:[l.unref(a),{[l.unref(m).bm("group","append")]:H.$slots.append,[l.unref(m).bm("group","prepend")]:H.$slots.prepend}],style:l.unref(P),role:H.containerRole,onMouseenter:ui,onMouseleave:ts}),[l.createCommentVNode(" input "),H.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),H.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(m).be("group","prepend"))},[l.renderSlot(H.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:M,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),H.$slots.prefix||H.prefixIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(l.unref(m).e("prefix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("prefix-inner"))},[l.renderSlot(H.$slots,"prefix"),H.prefixIcon?(l.openBlock(),l.createBlock(l.unref(Sn),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(H.prefixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("input",l.mergeProps({id:l.unref(f),ref_key:"input",ref:b,class:l.unref(m).e("inner")},l.unref(u),{minlength:H.minlength,maxlength:H.maxlength,type:H.showPassword?v.value?"text":"password":H.type,disabled:l.unref(g),readonly:H.readonly,autocomplete:H.autocomplete,tabindex:H.tabindex,"aria-label":H.ariaLabel,placeholder:H.placeholder,style:H.inputStyle,form:H.form,autofocus:H.autofocus,onCompositionstart:l.unref(Tn),onCompositionupdate:l.unref(es),onCompositionend:l.unref(J),onInput:at,onChange:nt,onKeydown:bo}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(L)?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(l.unref(m).e("suffix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("suffix-inner"))},[!l.unref(Y)||!l.unref(le)||!l.unref(I)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(H.$slots,"suffix"),H.suffixIcon?(l.openBlock(),l.createBlock(l.unref(Sn),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(H.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(Y)?(l.openBlock(),l.createBlock(l.unref(Sn),{key:1,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("clear")]),onMousedown:l.withModifiers(l.unref(as),["prevent"]),onClick:di},{default:l.withCtx(()=>[l.createVNode(l.unref(Cp))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(le)?(l.openBlock(),l.createBlock(l.unref(Sn),{key:2,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("password")]),onClick:ci},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(A))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(I)?(l.openBlock(),l.createElementBlock("span",{key:3,class:l.normalizeClass(l.unref(m).e("count"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("count-inner"))},l.toDisplayString(l.unref(B))+" / "+l.toDisplayString(H.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(R)&&l.unref(V)&&l.unref(k)?(l.openBlock(),l.createBlock(l.unref(Sn),{key:4,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("validateIcon"),l.unref(m).is("loading",l.unref(R)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(V))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),H.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(m).be("group","append"))},[l.renderSlot(H.$slots,"append")],2)):l.createCommentVNode("v-if",!0)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" textarea "),l.createElementVNode("textarea",l.mergeProps({id:l.unref(f),ref_key:"textarea",ref:w,class:[l.unref(y).e("inner"),l.unref(m).is("focus",l.unref(N))]},l.unref(u),{minlength:H.minlength,maxlength:H.maxlength,tabindex:H.tabindex,disabled:l.unref(g),readonly:H.readonly,autocomplete:H.autocomplete,style:l.unref(j),"aria-label":H.ariaLabel,placeholder:H.placeholder,form:H.form,autofocus:H.autofocus,rows:H.rows,onCompositionstart:l.unref(Tn),onCompositionupdate:l.unref(es),onCompositionend:l.unref(J),onInput:at,onFocus:l.unref(_),onBlur:l.unref(T),onChange:nt,onKeydown:bo}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),l.unref(I)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(S.value),class:l.normalizeClass(l.unref(m).e("count"))},l.toDisplayString(l.unref(B))+" / "+l.toDisplayString(H.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var hT=ft(dT,[["__file","input.vue"]]);const fT=zs(hT),Wc=Symbol("popper"),xg=Symbol("popperContent"),vg=Ze({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),pT=l.defineComponent({name:"ElPopper",inheritAttrs:!1}),gT=l.defineComponent({...pT,props:vg,setup(n,{expose:e}){const t=n,s=l.ref(),r=l.ref(),i=l.ref(),o=l.ref(),a=l.computed(()=>t.role),c={triggerRef:s,popperInstanceRef:r,contentRef:i,referenceRef:o,role:a};return e(c),l.provide(Wc,c),(u,d)=>l.renderSlot(u.$slots,"default")}});var mT=ft(gT,[["__file","popper.vue"]]);const Cg=Ze({arrowOffset:{type:Number,default:5}}),yT=l.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),bT=l.defineComponent({...yT,props:Cg,setup(n,{expose:e}){const t=n,s=mt("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=l.inject(xg,void 0);return l.watch(()=>t.arrowOffset,a=>{r.value=a}),l.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(a,c)=>(l.openBlock(),l.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:l.normalizeClass(l.unref(s).e("arrow")),style:l.normalizeStyle(l.unref(o)),"data-popper-arrow":""},null,6))}});var wT=ft(bT,[["__file","arrow.vue"]]);const qc="ElOnlyChild",xT=l.defineComponent({name:qc,setup(n,{slots:e,attrs:t}){var s;const r=l.inject(og),i=HN((s=r==null?void 0:r.setForwardRef)!=null?s:as);return()=>{var o;const a=(o=e.default)==null?void 0:o.call(e,t);if(!a)return null;if(a.length>1)return At(qc,"requires exact only one valid child."),null;const c=Sg(a);return c?l.withDirectives(l.cloneVNode(c,t),[[i]]):(At(qc,"no valid child node found"),null)}}});function Sg(n){if(!n)return null;const e=n;for(const t of e){if(fr(t))switch(t.type){case l.Comment:continue;case l.Text:case"svg":return Eg(t);case l.Fragment:return Sg(t.children);default:return t}return Eg(t)}return null}function Eg(n){const e=mt("only-child");return l.createVNode("span",{class:e.e("content")},[n])}const Og=Ze({virtualRef:{type:he(Object)},virtualTriggering:Boolean,onMouseenter:{type:he(Function)},onMouseleave:{type:he(Function)},onClick:{type:he(Function)},onKeydown:{type:he(Function)},onFocus:{type:he(Function)},onBlur:{type:he(Function)},onContextmenu:{type:he(Function)},id:String,open:Boolean}),vT=l.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),CT=l.defineComponent({...vT,props:Og,setup(n,{expose:e}){const t=n,{role:s,triggerRef:r}=l.inject(Wc,void 0);UN(r);const i=l.computed(()=>a.value?t.id:void 0),o=l.computed(()=>{if(s&&s.value==="tooltip")return t.open&&t.id?t.id:void 0}),a=l.computed(()=>{if(s&&s.value!=="tooltip")return s.value}),c=l.computed(()=>a.value?`${t.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return l.onMounted(()=>{l.watch(()=>t.virtualRef,h=>{h&&(r.value=os(h))},{immediate:!0}),l.watch(r,(h,f)=>{u==null||u(),u=void 0,Hn(h)&&(d.forEach(p=>{var g;const m=t[p];m&&(h.addEventListener(p.slice(2).toLowerCase(),m),(g=f==null?void 0:f.removeEventListener)==null||g.call(f,p.slice(2).toLowerCase(),m))}),u=l.watch([i,o,a,c],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((g,m)=>{da(p[m])?h.removeAttribute(g):h.setAttribute(g,p[m])})},{immediate:!0})),Hn(f)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>f.removeAttribute(p))},{immediate:!0})}),l.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,r.value&&Hn(r.value)){const h=r.value;d.forEach(f=>{const p=t[f];p&&h.removeEventListener(f.slice(2).toLowerCase(),p)}),r.value=void 0}}),e({triggerRef:r}),(h,f)=>h.virtualTriggering?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock(l.unref(xT),l.mergeProps({key:0},h.$attrs,{"aria-controls":l.unref(i),"aria-describedby":l.unref(o),"aria-expanded":l.unref(c),"aria-haspopup":l.unref(a)}),{default:l.withCtx(()=>[l.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var ST=ft(CT,[["__file","trigger.vue"]]);const Jc="focus-trap.focus-after-trapped",Xc="focus-trap.focus-after-released",ET="focus-trap.focusout-prevented",Mg={cancelable:!0,bubbles:!1},OT={cancelable:!0,bubbles:!1},Pg="focusAfterTrapped",Ag="focusAfterReleased",MT=Symbol("elFocusTrap"),Kc=l.ref(),Ma=l.ref(0),Zc=l.ref(0);let Pa=0;const Ng=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0||s===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},Tg=(n,e)=>{for(const t of n)if(!PT(t,e))return t},PT=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},AT=n=>{const e=Ng(n),t=Tg(e,n),s=Tg(e.reverse(),n);return[t,s]},NT=n=>n instanceof HTMLInputElement&&"select"in n,us=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),Zc.value=window.performance.now(),n!==t&&NT(n)&&e&&n.select()}};function _g(n,e){const t=[...n],s=n.indexOf(e);return s!==-1&&t.splice(s,1),t}const TT=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=_g(n,s),n.unshift(s)},remove:s=>{var r,i;n=_g(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},_T=(n,e=!1)=>{const t=document.activeElement;for(const s of n)if(us(s,e),document.activeElement!==t)return},kg=TT(),kT=()=>Ma.value>Zc.value,Aa=()=>{Kc.value="pointer",Ma.value=window.performance.now()},Dg=()=>{Kc.value="keyboard",Ma.value=window.performance.now()},DT=()=>(l.onMounted(()=>{Pa===0&&(document.addEventListener("mousedown",Aa),document.addEventListener("touchstart",Aa),document.addEventListener("keydown",Dg)),Pa++}),l.onBeforeUnmount(()=>{Pa--,Pa<=0&&(document.removeEventListener("mousedown",Aa),document.removeEventListener("touchstart",Aa),document.removeEventListener("keydown",Dg))}),{focusReason:Kc,lastUserFocusTimestamp:Ma,lastAutomatedFocusTimestamp:Zc}),Na=n=>new CustomEvent(ET,{...OT,detail:n}),RT=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Pg,Ag,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=l.ref();let s,r;const{focusReason:i}=DT();BN(g=>{n.trapped&&!o.paused&&e("release-requested",g)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=g=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:m,altKey:y,ctrlKey:b,metaKey:w,currentTarget:x,shiftKey:v}=g,{loop:S}=n,E=m===Er.tab&&!y&&!b&&!w,C=document.activeElement;if(E&&C){const M=x,[N,_]=AT(M);if(N&&_){if(!v&&C===_){const k=Na({focusReason:i.value});e("focusout-prevented",k),k.defaultPrevented||(g.preventDefault(),S&&us(N,!0))}else if(v&&[N,M].includes(C)){const k=Na({focusReason:i.value});e("focusout-prevented",k),k.defaultPrevented||(g.preventDefault(),S&&us(_,!0))}}else if(C===M){const k=Na({focusReason:i.value});e("focusout-prevented",k),k.defaultPrevented||g.preventDefault()}}};l.provide(MT,{focusTrapRef:t,onKeydown:a}),l.watch(()=>n.focusTrapEl,g=>{g&&(t.value=g)},{immediate:!0}),l.watch([t],([g],[m])=>{g&&(g.addEventListener("keydown",a),g.addEventListener("focusin",d),g.addEventListener("focusout",h)),m&&(m.removeEventListener("keydown",a),m.removeEventListener("focusin",d),m.removeEventListener("focusout",h))});const c=g=>{e(Pg,g)},u=g=>e(Ag,g),d=g=>{const m=l.unref(t);if(!m)return;const y=g.target,b=g.relatedTarget,w=y&&m.contains(y);n.trapped||b&&m.contains(b)||(s=b),w&&e("focusin",g),!o.paused&&n.trapped&&(w?r=y:us(r,!0))},h=g=>{const m=l.unref(t);if(!(o.paused||!m))if(n.trapped){const y=g.relatedTarget;!da(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=Na({focusReason:i.value});e("focusout-prevented",b),b.defaultPrevented||us(r,!0)}},0)}else{const y=g.target;y&&m.contains(y)||e("focusout",g)}};async function f(){await l.nextTick();const g=l.unref(t);if(g){kg.push(o);const m=g.contains(document.activeElement)?s:document.activeElement;if(s=m,!g.contains(m)){const b=new Event(Jc,Mg);g.addEventListener(Jc,c),g.dispatchEvent(b),b.defaultPrevented||l.nextTick(()=>{let w=n.focusStartEl;Zt(w)||(us(w),document.activeElement!==w&&(w="first")),w==="first"&&_T(Ng(g),!0),(document.activeElement===m||w==="container")&&us(g)})}}}function p(){const g=l.unref(t);if(g){g.removeEventListener(Jc,c);const m=new CustomEvent(Xc,{...Mg,detail:{focusReason:i.value}});g.addEventListener(Xc,u),g.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!kT()||g.contains(document.activeElement))&&us(s??document.body),g.removeEventListener(Xc,u),kg.remove(o)}}return l.onMounted(()=>{n.trapped&&f(),l.watch(()=>n.trapped,g=>{g?f():p()})}),l.onBeforeUnmount(()=>{n.trapped&&p(),t.value&&(t.value.removeEventListener("keydown",a),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:a}}});function LT(n,e,t,s,r,i){return l.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Rg=ft(RT,[["render",LT],["__file","focus-trap.vue"]]);const IT=["fixed","absolute"],VT=Ze({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:he(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:kc,default:"bottom"},popperOptions:{type:he(Object),default:()=>({})},strategy:{type:String,values:IT,default:"absolute"}}),Lg=Ze({...VT,id:String,style:{type:he([String,Array,Object])},className:{type:he([String,Array,Object])},effect:{type:he(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:he([String,Array,Object])},popperStyle:{type:he([String,Array,Object])},referenceEl:{type:he(Object)},triggerTargetEl:{type:he(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Uc(["ariaLabel"])}),BT={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},jT=(n,e=[])=>{const{placement:t,strategy:s,popperOptions:r}=n,i={placement:t,strategy:s,...r,modifiers:[...zT(n),...e]};return FT(i,r==null?void 0:r.modifiers),i},$T=n=>{if(Ge)return os(n)};function zT(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:s}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:s}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function FT(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const UT=0,HT=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:s,role:r}=l.inject(Wc,void 0),i=l.ref(),o=l.ref(),a=l.computed(()=>({name:"eventListeners",enabled:!!n.visible})),c=l.computed(()=>{var b;const w=l.unref(i),x=(b=l.unref(o))!=null?b:UT;return{name:"arrow",enabled:!fP(w),options:{element:w,padding:x}}}),u=l.computed(()=>({onFirstUpdate:()=>{g()},...jT(n,[l.unref(c),l.unref(a)])})),d=l.computed(()=>$T(n.referenceEl)||l.unref(s)),{attributes:h,state:f,styles:p,update:g,forceUpdate:m,instanceRef:y}=LN(d,t,u);return l.watch(y,b=>e.value=b),l.onMounted(()=>{l.watch(()=>{var b;return(b=l.unref(d))==null?void 0:b.getBoundingClientRect()},()=>{g()})}),{attributes:h,arrowRef:i,contentRef:t,instanceRef:y,state:f,styles:p,role:r,forceUpdate:m,update:g}},GT=(n,{attributes:e,styles:t,role:s})=>{const{nextZIndex:r}=hg(),i=mt("popper"),o=l.computed(()=>l.unref(e).popper),a=l.ref(Bt(n.zIndex)?n.zIndex:r()),c=l.computed(()=>[i.b(),i.is("pure",n.pure),i.is(n.effect),n.popperClass]),u=l.computed(()=>[{zIndex:l.unref(a)},l.unref(t).popper,n.popperStyle||{}]),d=l.computed(()=>s.value==="dialog"?"false":void 0),h=l.computed(()=>l.unref(t).arrow||{});return{ariaModal:d,arrowStyle:h,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=Bt(n.zIndex)?n.zIndex:r()}}},YT=(n,e)=>{const t=l.ref(!1),s=l.ref();return{focusStartRef:s,trapped:t,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(s.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{n.visible&&!t.value&&(u.target&&(s.value=u.target),t.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},WT=l.defineComponent({name:"ElPopperContent"}),qT=l.defineComponent({...WT,props:Lg,emits:BT,setup(n,{expose:e,emit:t}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=YT(s,t),{attributes:h,arrowRef:f,contentRef:p,styles:g,instanceRef:m,role:y,update:b}=HT(s),{ariaModal:w,arrowStyle:x,contentAttrs:v,contentClass:S,contentStyle:E,updateZIndex:C}=GT(s,{styles:g,attributes:h,role:y}),M=l.inject(Oa,void 0),N=l.ref();l.provide(xg,{arrowStyle:x,arrowRef:f,arrowOffset:N}),M&&l.provide(Oa,{...M,addInputId:as,removeInputId:as});let _;const T=(R=!0)=>{b(),R&&C()},k=()=>{T(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return l.onMounted(()=>{l.watch(()=>s.triggerTargetEl,(R,V)=>{_==null||_(),_=void 0;const A=l.unref(R||p.value),P=l.unref(V||p.value);Hn(A)&&(_=l.watch([y,()=>s.ariaLabel,w,()=>s.id],j=>{["role","aria-label","aria-modal","id"].forEach((z,Y)=>{da(j[Y])?A.removeAttribute(z):A.setAttribute(z,j[Y])})},{immediate:!0})),P!==A&&Hn(P)&&["role","aria-label","aria-modal","id"].forEach(j=>{P.removeAttribute(j)})},{immediate:!0}),l.watch(()=>s.visible,k,{immediate:!0})}),l.onBeforeUnmount(()=>{_==null||_(),_=void 0}),e({popperContentRef:p,popperInstanceRef:m,updatePopper:T,contentStyle:E}),(R,V)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({ref_key:"contentRef",ref:p},l.unref(v),{style:l.unref(E),class:l.unref(S),tabindex:"-1",onMouseenter:A=>R.$emit("mouseenter",A),onMouseleave:A=>R.$emit("mouseleave",A)}),[l.createVNode(l.unref(Rg),{trapped:l.unref(i),"trap-on-focus-in":!0,"focus-trap-el":l.unref(p),"focus-start-el":l.unref(r),onFocusAfterTrapped:l.unref(a),onFocusAfterReleased:l.unref(o),onFocusin:l.unref(c),onFocusoutPrevented:l.unref(u),onReleaseRequested:l.unref(d)},{default:l.withCtx(()=>[l.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var JT=ft(qT,[["__file","content.vue"]]);const XT=zs(mT),Qc=Symbol("elTooltip"),Ig=Ze({...zN,...Lg,appendTo:{type:he([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:he(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Uc(["ariaLabel"])}),Vg=Ze({...Og,disabled:Boolean,trigger:{type:he([String,Array]),default:"hover"},triggerKeys:{type:he(Array),default:()=>[Er.enter,Er.space]}}),{useModelToggleProps:KT,useModelToggleEmits:ZT,useModelToggle:QT}=kA("visible"),e_=Ze({...vg,...KT,...Ig,...Vg,...Cg,showArrow:{type:Boolean,default:!0}}),t_=[...ZT,"before-show","before-hide","show","hide","open","close"],n_=(n,e)=>Av(n)?n.includes(e):n===e,_r=(n,e,t)=>s=>{n_(l.unref(n),e)&&t(s)},s_=l.defineComponent({name:"ElTooltipTrigger"}),r_=l.defineComponent({...s_,props:Vg,setup(n,{expose:e}){const t=n,s=mt("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:c,onToggle:u}=l.inject(Qc,void 0),d=l.ref(null),h=()=>{if(l.unref(r)||t.disabled)return!0},f=l.toRef(t,"trigger"),p=$n(h,_r(f,"hover",a)),g=$n(h,_r(f,"hover",c)),m=$n(h,_r(f,"click",v=>{v.button===0&&u(v)})),y=$n(h,_r(f,"focus",a)),b=$n(h,_r(f,"focus",c)),w=$n(h,_r(f,"contextmenu",v=>{v.preventDefault(),u(v)})),x=$n(h,v=>{const{code:S}=v;t.triggerKeys.includes(S)&&(v.preventDefault(),u(v))});return e({triggerRef:d}),(v,S)=>(l.openBlock(),l.createBlock(l.unref(ST),{id:l.unref(i),"virtual-ref":v.virtualRef,open:l.unref(o),"virtual-triggering":v.virtualTriggering,class:l.normalizeClass(l.unref(s).e("trigger")),onBlur:l.unref(b),onClick:l.unref(m),onContextmenu:l.unref(w),onFocus:l.unref(y),onMouseenter:l.unref(p),onMouseleave:l.unref(g),onKeydown:l.unref(x)},{default:l.withCtx(()=>[l.renderSlot(v.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var i_=ft(r_,[["__file","trigger.vue"]]);const o_=Ze({to:{type:he([String,Object]),required:!0},disabled:Boolean});var a_=ft(l.defineComponent({__name:"teleport",props:o_,setup(n){return(e,t)=>e.disabled?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(),l.createBlock(l.Teleport,{key:1,to:e.to},[l.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const l_=zs(a_),c_=l.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),u_=l.defineComponent({...c_,props:Ig,setup(n,{expose:e}){const t=n,{selector:s}=ig(),r=mt("tooltip"),i=l.ref(null);let o;const{controlled:a,id:c,open:u,trigger:d,onClose:h,onOpen:f,onShow:p,onHide:g,onBeforeShow:m,onBeforeHide:y}=l.inject(Qc,void 0),b=l.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),w=l.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);l.onBeforeUnmount(()=>{o==null||o()});const x=l.computed(()=>l.unref(w)?!0:l.unref(u)),v=l.computed(()=>t.disabled?!1:l.unref(u)),S=l.computed(()=>t.appendTo||s.value),E=l.computed(()=>{var P;return(P=t.style)!=null?P:{}}),C=l.ref(!0),M=()=>{g(),C.value=!0},N=()=>{if(l.unref(a))return!0},_=$n(N,()=>{t.enterable&&l.unref(d)==="hover"&&f()}),T=$n(N,()=>{l.unref(d)==="hover"&&h()}),k=()=>{var P,j;(j=(P=i.value)==null?void 0:P.updatePopper)==null||j.call(P),m==null||m()},R=()=>{y==null||y()},V=()=>{p(),o=yv(l.computed(()=>{var P;return(P=i.value)==null?void 0:P.popperContentRef}),()=>{if(l.unref(a))return;l.unref(d)!=="hover"&&h()})},A=()=>{t.virtualTriggering||h()};return l.watch(()=>l.unref(u),P=>{P?C.value=!1:o==null||o()},{flush:"post"}),l.watch(()=>t.content,()=>{var P,j;(j=(P=i.value)==null?void 0:P.updatePopper)==null||j.call(P)}),e({contentRef:i}),(P,j)=>(l.openBlock(),l.createBlock(l.unref(l_),{disabled:!P.teleported,to:l.unref(S)},{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(b),onAfterLeave:M,onBeforeEnter:k,onAfterEnter:V,onBeforeLeave:R},{default:l.withCtx(()=>[l.unref(x)?l.withDirectives((l.openBlock(),l.createBlock(l.unref(JT),l.mergeProps({key:0,id:l.unref(c),ref_key:"contentRef",ref:i},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":C.value,"boundaries-padding":P.boundariesPadding,"fallback-placements":P.fallbackPlacements,"gpu-acceleration":P.gpuAcceleration,offset:P.offset,placement:P.placement,"popper-options":P.popperOptions,strategy:P.strategy,effect:P.effect,enterable:P.enterable,pure:P.pure,"popper-class":P.popperClass,"popper-style":[P.popperStyle,l.unref(E)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:l.unref(v),"z-index":P.zIndex,onMouseenter:l.unref(_),onMouseleave:l.unref(T),onBlur:A,onClose:l.unref(h)}),{default:l.withCtx(()=>[l.renderSlot(P.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[l.vShow,l.unref(v)]]):l.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var d_=ft(u_,[["__file","content.vue"]]);const h_=l.defineComponent({name:"ElTooltip"}),f_=l.defineComponent({...h_,props:e_,emits:t_,setup(n,{expose:e,emit:t}){const s=n;$N();const r=Sa(),i=l.ref(),o=l.ref(),a=()=>{var b;const w=l.unref(i);w&&((b=w.popperInstanceRef)==null||b.update())},c=l.ref(!1),u=l.ref(),{show:d,hide:h,hasUpdateHandler:f}=QT({indicator:c,toggleReason:u}),{onOpen:p,onClose:g}=FN({showAfter:l.toRef(s,"showAfter"),hideAfter:l.toRef(s,"hideAfter"),autoClose:l.toRef(s,"autoClose"),open:d,close:h}),m=l.computed(()=>ha(s.visible)&&!f.value);l.provide(Qc,{controlled:m,id:r,open:l.readonly(c),trigger:l.toRef(s,"trigger"),onOpen:b=>{p(b)},onClose:b=>{g(b)},onToggle:b=>{l.unref(c)?g(b):p(b)},onShow:()=>{t("show",u.value)},onHide:()=>{t("hide",u.value)},onBeforeShow:()=>{t("before-show",u.value)},onBeforeHide:()=>{t("before-hide",u.value)},updatePopper:a}),l.watch(()=>s.disabled,b=>{b&&c.value&&(c.value=!1)});const y=b=>{var w,x;const v=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,S=(b==null?void 0:b.relatedTarget)||document.activeElement;return v&&v.contains(S)};return l.onDeactivated(()=>c.value&&h()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:a,onOpen:p,onClose:g,hide:h}),(b,w)=>(l.openBlock(),l.createBlock(l.unref(XT),{ref_key:"popperRef",ref:i,role:b.role},{default:l.withCtx(()=>[l.createVNode(i_,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:l.withCtx(()=>[b.$slots.default?l.renderSlot(b.$slots,"default",{key:0}):l.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),l.createVNode(d_,{ref_key:"contentRef",ref:o,"aria-label":b.ariaLabel,"boundaries-padding":b.boundariesPadding,content:b.content,disabled:b.disabled,effect:b.effect,enterable:b.enterable,"fallback-placements":b.fallbackPlacements,"hide-after":b.hideAfter,"gpu-acceleration":b.gpuAcceleration,offset:b.offset,persistent:b.persistent,"popper-class":b.popperClass,"popper-style":b.popperStyle,placement:b.placement,"popper-options":b.popperOptions,pure:b.pure,"raw-content":b.rawContent,"reference-el":b.referenceEl,"trigger-target-el":b.triggerTargetEl,"show-after":b.showAfter,strategy:b.strategy,teleported:b.teleported,transition:b.transition,"virtual-triggering":b.virtualTriggering,"z-index":b.zIndex,"append-to":b.appendTo},{default:l.withCtx(()=>[l.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(l.openBlock(),l.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(l.openBlock(),l.createElementBlock("span",{key:1},l.toDisplayString(b.content),1))]),b.showArrow?(l.openBlock(),l.createBlock(l.unref(wT),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):l.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var p_=ft(f_,[["__file","tooltip.vue"]]);const Bg=zs(p_),g_=Ze({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:he([String,Object,Array])},offset:{type:he(Array),default:[0,0]},badgeClass:{type:String}}),m_=l.defineComponent({name:"ElBadge"}),y_=l.defineComponent({...m_,props:g_,setup(n,{expose:e}){const t=n,s=mt("badge"),r=l.computed(()=>t.isDot?"":Bt(t.value)&&Bt(t.max)?t.max<t.value?`${t.max}+`:`${t.value}`:`${t.value}`),i=l.computed(()=>{var o,a,c,u,d;return[{backgroundColor:t.color,marginRight:Di(-((a=(o=t.offset)==null?void 0:o[0])!=null?a:0)),marginTop:Di((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:r}),(o,a)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(s).b())},[l.renderSlot(o.$slots,"default"),l.createVNode(l.Transition,{name:`${l.unref(s).namespace.value}-zoom-in-center`,persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("sup",{class:l.normalizeClass([l.unref(s).e("content"),l.unref(s).em("content",o.type),l.unref(s).is("fixed",!!o.$slots.default),l.unref(s).is("dot",o.isDot),l.unref(s).is("hide-zero",!o.showZero&&t.value===0),o.badgeClass]),style:l.normalizeStyle(l.unref(i)),textContent:l.toDisplayString(l.unref(r))},null,14,["textContent"]),[[l.vShow,!o.hidden&&(l.unref(r)||o.isDot)]])]),_:1},8,["name"])],2))}});var b_=ft(y_,[["__file","badge.vue"]]);const w_=zs(b_),jg=Symbol("buttonGroupContextKey"),x_=(n,e)=>{vA({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},l.computed(()=>n.type==="text"));const t=l.inject(jg,void 0),s=Hc("button"),{form:r}=bg(),i=yg(l.computed(()=>t==null?void 0:t.size)),o=Yc(),a=l.ref(),c=l.useSlots(),u=l.computed(()=>n.type||(t==null?void 0:t.type)||""),d=l.computed(()=>{var g,m,y;return(y=(m=n.autoInsertSpace)!=null?m:(g=s.value)==null?void 0:g.autoInsertSpace)!=null?y:!1}),h=l.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),f=l.computed(()=>{var g;const m=(g=c.default)==null?void 0:g.call(c);if(d.value&&(m==null?void 0:m.length)===1){const y=m[0];if((y==null?void 0:y.type)===l.Text){const b=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(b.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:a,_props:h,shouldAddSpace:f,handleClick:g=>{if(o.value||n.loading){g.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",g)}}},eu=Ze({size:Fc,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ri},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ri,default:()=>pa},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:he([String,Object]),default:"button"}}),v_={click:n=>n instanceof MouseEvent};function lt(n,e){C_(n)&&(n="100%");var t=S_(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function Ta(n){return Math.min(1,Math.max(0,n))}function C_(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function S_(n){return typeof n=="string"&&n.indexOf("%")!==-1}function $g(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function _a(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Hs(n){return n.length===1?"0"+n:String(n)}function E_(n,e,t){return{r:lt(n,255)*255,g:lt(e,255)*255,b:lt(t,255)*255}}function zg(n,e,t){n=lt(n,255),e=lt(e,255),t=lt(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=0,a=(s+r)/2;if(s===r)o=0,i=0;else{var c=s-r;switch(o=a>.5?c/(2-s-r):c/(s+r),s){case n:i=(e-t)/c+(e<t?6:0);break;case e:i=(t-n)/c+2;break;case t:i=(n-e)/c+4;break}i/=6}return{h:i,s:o,l:a}}function tu(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function O_(n,e,t){var s,r,i;if(n=lt(n,360),e=lt(e,100),t=lt(t,100),e===0)r=t,i=t,s=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;s=tu(a,o,n+1/3),r=tu(a,o,n),i=tu(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function Fg(n,e,t){n=lt(n,255),e=lt(e,255),t=lt(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=s,a=s-r,c=s===0?0:a/s;if(s===r)i=0;else{switch(s){case n:i=(e-t)/a+(e<t?6:0);break;case e:i=(t-n)/a+2;break;case t:i=(n-e)/a+4;break}i/=6}return{h:i,s:c,v:o}}function M_(n,e,t){n=lt(n,360)*6,e=lt(e,100),t=lt(t,100);var s=Math.floor(n),r=n-s,i=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),c=s%6,u=[t,o,i,i,a,t][c],d=[a,t,t,o,i,i][c],h=[i,i,a,t,t,o][c];return{r:u*255,g:d*255,b:h*255}}function Ug(n,e,t,s){var r=[Hs(Math.round(n).toString(16)),Hs(Math.round(e).toString(16)),Hs(Math.round(t).toString(16))];return s&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function P_(n,e,t,s,r){var i=[Hs(Math.round(n).toString(16)),Hs(Math.round(e).toString(16)),Hs(Math.round(t).toString(16)),Hs(A_(s))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function A_(n){return Math.round(parseFloat(n)*255).toString(16)}function Hg(n){return Nt(n)/255}function Nt(n){return parseInt(n,16)}function N_(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var nu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function T_(n){var e={r:0,g:0,b:0},t=1,s=null,r=null,i=null,o=!1,a=!1;return typeof n=="string"&&(n=D_(n)),typeof n=="object"&&(Yn(n.r)&&Yn(n.g)&&Yn(n.b)?(e=E_(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Yn(n.h)&&Yn(n.s)&&Yn(n.v)?(s=_a(n.s),r=_a(n.v),e=M_(n.h,s,r),o=!0,a="hsv"):Yn(n.h)&&Yn(n.s)&&Yn(n.l)&&(s=_a(n.s),i=_a(n.l),e=O_(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=$g(t),{ok:o,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var __="[-\\+]?\\d+%?",k_="[-\\+]?\\d*\\.\\d+%?",ds="(?:".concat(k_,")|(?:").concat(__,")"),su="[\\s|\\(]+(".concat(ds,")[,|\\s]+(").concat(ds,")[,|\\s]+(").concat(ds,")\\s*\\)?"),ru="[\\s|\\(]+(".concat(ds,")[,|\\s]+(").concat(ds,")[,|\\s]+(").concat(ds,")[,|\\s]+(").concat(ds,")\\s*\\)?"),on={CSS_UNIT:new RegExp(ds),rgb:new RegExp("rgb"+su),rgba:new RegExp("rgba"+ru),hsl:new RegExp("hsl"+su),hsla:new RegExp("hsla"+ru),hsv:new RegExp("hsv"+su),hsva:new RegExp("hsva"+ru),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function D_(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(nu[n])n=nu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=on.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=on.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=on.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=on.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=on.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=on.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=on.hex8.exec(n),t?{r:Nt(t[1]),g:Nt(t[2]),b:Nt(t[3]),a:Hg(t[4]),format:e?"name":"hex8"}:(t=on.hex6.exec(n),t?{r:Nt(t[1]),g:Nt(t[2]),b:Nt(t[3]),format:e?"name":"hex"}:(t=on.hex4.exec(n),t?{r:Nt(t[1]+t[1]),g:Nt(t[2]+t[2]),b:Nt(t[3]+t[3]),a:Hg(t[4]+t[4]),format:e?"name":"hex8"}:(t=on.hex3.exec(n),t?{r:Nt(t[1]+t[1]),g:Nt(t[2]+t[2]),b:Nt(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Yn(n){return!!on.CSS_UNIT.exec(String(n))}var R_=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var s;if(e instanceof n)return e;typeof e=="number"&&(e=N_(e)),this.originalInput=e;var r=T_(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(s=t.format)!==null&&s!==void 0?s:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,s,r,i=e.r/255,o=e.g/255,a=e.b/255;return i<=.03928?t=i/12.92:t=Math.pow((i+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*s+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=$g(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Fg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Fg(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=zg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=zg(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),Ug(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),P_(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),s=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(s,")"):"rgba(".concat(e,", ").concat(t,", ").concat(s,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(lt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(lt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+Ug(this.r,this.g,this.b,!1),t=0,s=Object.entries(nu);t<s.length;t++){var r=s[t],i=r[0],o=r[1];if(e===o)return i}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var s=!1,r=this.a<1&&this.a>=0,i=!t&&r&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(s=this.toRgbString()),e==="prgb"&&(s=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(s=this.toHexString()),e==="hex3"&&(s=this.toHexString(!0)),e==="hex4"&&(s=this.toHex8String(!0)),e==="hex8"&&(s=this.toHex8String()),e==="name"&&(s=this.toName()),e==="hsl"&&(s=this.toHslString()),e==="hsv"&&(s=this.toHsvString()),s||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Ta(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Ta(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Ta(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Ta(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),s=(t.h+e)%360;return t.h=s<0?360+s:s,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var s=this.toRgb(),r=new n(e).toRgb(),i=t/100,o={r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var s=this.toHsl(),r=360/t,i=[this];for(s.h=(s.h-(r*e>>1)+720)%360;--e;)s.h=(s.h+r)%360,i.push(new n(s));return i},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),s=t.h,r=t.s,i=t.v,o=[],a=1/e;e--;)o.push(new n({h:s,s:r,v:i})),i=(i+a)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),s=new n(e).toRgb(),r=t.a+s.a*(1-t.a);return new n({r:(t.r*t.a+s.r*s.a*(1-t.a))/r,g:(t.g*t.a+s.g*s.a*(1-t.a))/r,b:(t.b*t.a+s.b*s.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),s=t.h,r=[this],i=360/e,o=1;o<e;o++)r.push(new n({h:(s+o*i)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function hs(n,e=20){return n.mix("#141414",e).toString()}function L_(n){const e=Yc(),t=mt("button");return l.computed(()=>{let s={},r=n.color;if(r){const i=r.match(/var\((.*?)\)/);i&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new R_(r),a=n.dark?o.tint(20).toString():hs(o,20);if(n.plain)s=t.cssVarBlock({"bg-color":n.dark?hs(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?hs(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":a}),e.value&&(s[t.cssVarBlockName("disabled-bg-color")]=n.dark?hs(o,90):o.tint(90).toString(),s[t.cssVarBlockName("disabled-text-color")]=n.dark?hs(o,50):o.tint(50).toString(),s[t.cssVarBlockName("disabled-border-color")]=n.dark?hs(o,80):o.tint(80).toString());else{const c=n.dark?hs(o,30):o.tint(30).toString(),u=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(s=t.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":a,"active-border-color":a}),e.value){const d=n.dark?hs(o,50):o.tint(50).toString();s[t.cssVarBlockName("disabled-bg-color")]=d,s[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,s[t.cssVarBlockName("disabled-border-color")]=d}}}return s})}const I_=l.defineComponent({name:"ElButton"}),V_=l.defineComponent({...I_,props:eu,emits:v_,setup(n,{expose:e,emit:t}){const s=n,r=L_(s),i=mt("button"),{_ref:o,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:h,handleClick:f}=x_(s,t),p=l.computed(()=>[i.b(),i.m(c.value),i.m(a.value),i.is("disabled",u.value),i.is("loading",s.loading),i.is("plain",s.plain),i.is("round",s.round),i.is("circle",s.circle),i.is("text",s.text),i.is("link",s.link),i.is("has-bg",s.bg)]);return e({ref:o,size:a,type:c,disabled:u,shouldAddSpace:h}),(g,m)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.tag),l.mergeProps({ref_key:"_ref",ref:o},l.unref(d),{class:l.unref(p),style:l.unref(r),onClick:l.unref(f)}),{default:l.withCtx(()=>[g.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[g.$slots.loading?l.renderSlot(g.$slots,"loading",{key:0}):(l.openBlock(),l.createBlock(l.unref(Sn),{key:1,class:l.normalizeClass(l.unref(i).is("loading"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.loadingIcon)))]),_:1},8,["class"]))],64)):g.icon||g.$slots.icon?(l.openBlock(),l.createBlock(l.unref(Sn),{key:1},{default:l.withCtx(()=>[g.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.icon),{key:0})):l.renderSlot(g.$slots,"icon",{key:1})]),_:3})):l.createCommentVNode("v-if",!0),g.$slots.default?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass({[l.unref(i).em("text","expand")]:l.unref(h)})},[l.renderSlot(g.$slots,"default")],2)):l.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var B_=ft(V_,[["__file","button.vue"]]);const j_={size:eu.size,type:eu.type},$_=l.defineComponent({name:"ElButtonGroup"}),z_=l.defineComponent({...$_,props:j_,setup(n){const e=n;l.provide(jg,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=mt("button");return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(s.$slots,"default")],2))}});var Gg=ft(z_,[["__file","button-group.vue"]]);const F_=zs(B_,{ButtonGroup:Gg});gA(Gg);function U_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const iu="_trap-focus-children",Gs=[],Yg=n=>{var e;if(Gs.length===0)return;const t=Gs[Gs.length-1][iu];if(t.length>0&&n.code===Er.tab){if(t.length===1){n.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const s=n.shiftKey,r=n.target===t[0],i=n.target===t[t.length-1];if(r&&s&&(n.preventDefault(),t[t.length-1].focus()),i&&!s&&(n.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const o=t.indexOf(n.target);o!==-1&&((e=t[s?o-1:o+1])==null||e.focus())}}},H_={beforeMount(n){n[iu]=fh(n),Gs.push(n),Gs.length<=1&&document.addEventListener("keydown",Yg)},updated(n){l.nextTick(()=>{n[iu]=fh(n)})},unmounted(){Gs.shift(),Gs.length===0&&document.removeEventListener("keydown",Yg)}},G_=Ze({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:he([String,Array,Object])},zIndex:{type:he([String,Number])}}),Y_={click:n=>n instanceof MouseEvent},W_="overlay";var q_=l.defineComponent({name:"ElOverlay",props:G_,emits:Y_,setup(n,{slots:e,emit:t}){const s=mt(W_),r=c=>{t("click",c)},{onClick:i,onMousedown:o,onMouseup:a}=tg(n.customMaskEvent?void 0:r);return()=>n.mask?l.createVNode("div",{class:[s.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:i,onMousedown:o,onMouseup:a},[l.renderSlot(e,"default")],ya.STYLE|ya.CLASS|ya.PROPS,["onClick","onMouseup","onMousedown"]):l.h("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[l.renderSlot(e,"default")])}});const J_=q_,Wg=["success","info","warning","error"],pt=_p({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Ge?document.body:void 0}),X_=Ze({customClass:{type:String,default:pt.customClass},center:{type:Boolean,default:pt.center},dangerouslyUseHTMLString:{type:Boolean,default:pt.dangerouslyUseHTMLString},duration:{type:Number,default:pt.duration},icon:{type:Ri,default:pt.icon},id:{type:String,default:pt.id},message:{type:he([String,Object,Function]),default:pt.message},onClose:{type:he(Function),default:pt.onClose},showClose:{type:Boolean,default:pt.showClose},type:{type:String,values:Wg,default:pt.type},plain:{type:Boolean,default:pt.plain},offset:{type:Number,default:pt.offset},zIndex:{type:Number,default:pt.zIndex},grouping:{type:Boolean,default:pt.grouping},repeatNum:{type:Number,default:pt.repeatNum}}),K_={destroy:()=>!0},an=l.shallowReactive([]),Z_=n=>{const e=an.findIndex(r=>r.id===n),t=an[e];let s;return e>0&&(s=an[e-1]),{current:t,prev:s}},Q_=n=>{const{prev:e}=Z_(n);return e?e.vm.exposed.bottom.value:0},ek=(n,e)=>an.findIndex(s=>s.id===n)>0?16:e,tk=l.defineComponent({name:"ElMessage"}),nk=l.defineComponent({...tk,props:X_,emits:K_,setup(n,{expose:e}){const t=n,{Close:s}=Np,{ns:r,zIndex:i}=gg("message"),{currentZIndex:o,nextZIndex:a}=i,c=l.ref(),u=l.ref(!1),d=l.ref(0);let h;const f=l.computed(()=>t.type?t.type==="error"?"danger":t.type:"info"),p=l.computed(()=>{const C=t.type;return{[r.bm("icon",C)]:C&&ma[C]}}),g=l.computed(()=>t.icon||ma[t.type]||""),m=l.computed(()=>Q_(t.id)),y=l.computed(()=>ek(t.id,t.offset)+m.value),b=l.computed(()=>d.value+y.value),w=l.computed(()=>({top:`${y.value}px`,zIndex:o.value}));function x(){t.duration!==0&&({stop:h}=mv(()=>{S()},t.duration))}function v(){h==null||h()}function S(){u.value=!1}function E({code:C}){C===Er.esc&&S()}return l.onMounted(()=>{x(),a(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{v(),x()}),zn(document,"keydown",E),xh(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:b,close:S}),(C,M)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:C.onClose,onAfterLeave:N=>C.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:C.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(C.type)]:C.type},l.unref(r).is("center",C.center),l.unref(r).is("closable",C.showClose),l.unref(r).is("plain",C.plain),C.customClass]),style:l.normalizeStyle(l.unref(w)),role:"alert",onMouseenter:v,onMouseleave:x},[C.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(w_),{key:0,value:C.repeatNum,type:l.unref(f),class:l.normalizeClass(l.unref(r).e("badge"))},null,8,["value","type","class"])):l.createCommentVNode("v-if",!0),l.unref(g)?(l.openBlock(),l.createBlock(l.unref(Sn),{key:1,class:l.normalizeClass([l.unref(r).e("icon"),l.unref(p)])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(g))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.renderSlot(C.$slots,"default",{},()=>[C.dangerouslyUseHTMLString?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),l.createElementVNode("p",{class:l.normalizeClass(l.unref(r).e("content")),innerHTML:C.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(C.message),3))]),C.showClose?(l.openBlock(),l.createBlock(l.unref(Sn),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(S,["stop"])},{default:l.withCtx(()=>[l.createVNode(l.unref(s))]),_:1},8,["class","onClick"])):l.createCommentVNode("v-if",!0)],46,["id"]),[[l.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var sk=ft(nk,[["__file","message.vue"]]);let rk=1;const qg=n=>{const e=!n||Zt(n)||l.isVNode(n)||Lt(n)?{message:n}:n,t={...pt,...e};if(!t.appendTo)t.appendTo=document.body;else if(Zt(t.appendTo)){let s=document.querySelector(t.appendTo);Hn(s)||(At("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),t.appendTo=s}return ha(sn.grouping)&&!t.grouping&&(t.grouping=sn.grouping),Bt(sn.duration)&&t.duration===3e3&&(t.duration=sn.duration),Bt(sn.offset)&&t.offset===16&&(t.offset=sn.offset),ha(sn.showClose)&&!t.showClose&&(t.showClose=sn.showClose),t},ik=n=>{const e=an.indexOf(n);if(e===-1)return;an.splice(e,1);const{handler:t}=n;t.close()},ok=({appendTo:n,...e},t)=>{const s=`message_${rk++}`,r=e.onClose,i=document.createElement("div"),o={...e,id:s,onClose:()=>{r==null||r(),ik(d)},onDestroy:()=>{l.render(null,i)}},a=l.createVNode(sk,o,Lt(o.message)||l.isVNode(o.message)?{default:Lt(o.message)?o.message:()=>o.message}:null);a.appContext=t||kr._context,l.render(a,i),n.appendChild(i.firstElementChild);const c=a.component,d={id:s,vnode:a,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:a.component.props};return d},kr=(n={},e)=>{if(!Ge)return{close:()=>{}};const t=qg(n);if(t.grouping&&an.length){const r=an.find(({vnode:i})=>{var o;return((o=i.props)==null?void 0:o.message)===t.message});if(r)return r.props.repeatNum+=1,r.props.type=t.type,r.handler}if(Bt(sn.max)&&an.length>=sn.max)return{close:()=>{}};const s=ok(t,e);return an.push(s),s.handler};Wg.forEach(n=>{kr[n]=(e={},t)=>{const s=qg(e);return kr({...s,type:n},t)}});function ak(n){for(const e of an)(!n||n===e.props.type)&&e.handler.close()}kr.closeAll=ak,kr._context=null;const We=pA(kr,"$message"),lk=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:H_},components:{ElButton:F_,ElFocusTrap:Rg,ElInput:fT,ElOverlay:J_,ElIcon:Sn,...Np},inheritAttrs:!1,props:{buttonSize:{type:String,validator:mA},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(n,{emit:e}){const{locale:t,zIndex:s,ns:r,size:i}=gg("message-box",l.computed(()=>n.buttonSize)),{t:o}=t,{nextZIndex:a}=s,c=l.ref(!1),u=l.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:l.markRaw(pa),cancelButtonLoadingIcon:l.markRaw(pa),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=l.computed(()=>{const P=u.type;return{[r.bm("icon",P)]:P&&ma[P]}}),h=Sa(),f=Sa(),p=l.computed(()=>u.icon||ma[u.type]||""),g=l.computed(()=>!!u.message),m=l.ref(),y=l.ref(),b=l.ref(),w=l.ref(),x=l.ref(),v=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async P=>{await l.nextTick(),n.boxType==="prompt"&&P!==null&&k()},{immediate:!0}),l.watch(()=>c.value,P=>{var j,z;P&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(z=(j=x.value)==null?void 0:j.$el)!=null?z:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(P?l.nextTick().then(()=>{var Y;w.value&&w.value.$el&&(u.autofocus?b.value=(Y=R())!=null?Y:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const S=l.computed(()=>n.draggable),E=l.computed(()=>n.overflow);CA(m,y,S,E),l.onMounted(async()=>{await l.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",C)}),l.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",C)});function C(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const M=()=>{n.closeOnClickModal&&T(u.distinguishCancelAndClose?"close":"cancel")},N=tg(M),_=P=>{if(u.inputType!=="textarea")return P.preventDefault(),T("confirm")},T=P=>{var j;n.boxType==="prompt"&&P==="confirm"&&!k()||(u.action=P,u.beforeClose?(j=u.beforeClose)==null||j.call(u,P,u,C):C())},k=()=>{if(n.boxType==="prompt"){const P=u.inputPattern;if(P&&!P.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;const j=u.inputValidator;if(typeof j=="function"){const z=j(u.inputValue);if(z===!1)return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;if(typeof z=="string")return u.editorErrorMessage=z,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},R=()=>{const P=w.value.$refs;return P.input||P.textarea},V=()=>{T("close")},A=()=>{n.closeOnPressEscape&&V()};return n.lockScroll&&NA(c),{...l.toRefs(u),ns:r,overlayEvent:N,visible:c,hasMessage:g,typeClass:d,contentId:h,inputId:f,btnSize:i,iconComponent:p,confirmButtonClasses:v,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:C,handleClose:V,onCloseRequested:A,handleWrapperClick:M,handleInputEnter:_,handleAction:T,t:o}}});function ck(n,e,t,s,r,i){const o=l.resolveComponent("el-icon"),a=l.resolveComponent("close"),c=l.resolveComponent("el-input"),u=l.resolveComponent("el-button"),d=l.resolveComponent("el-focus-trap"),h=l.resolveComponent("el-overlay");return l.openBlock(),l.createBlock(l.Transition,{name:"fade-in-linear",onAfterLeave:f=>n.$emit("vanish"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(h,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:l.withCtx(()=>[l.createElementVNode("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:l.normalizeClass(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[l.createVNode(d,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:l.withCtx(()=>[l.createElementVNode("div",{ref:"rootRef",class:l.normalizeClass([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:l.normalizeStyle(n.customStyle),tabindex:"-1",onClick:l.withModifiers(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,ref:"headerRef",class:l.normalizeClass([n.ns.e("header"),{"show-close":n.showClose}])},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("title"))},[n.iconComponent&&n.center?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.createElementVNode("span",null,l.toDisplayString(n.title),1)],2),n.showClose?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:f=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:l.withKeys(l.withModifiers(f=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[l.createVNode(o,{class:l.normalizeClass(n.ns.e("close"))},{default:l.withCtx(()=>[l.createVNode(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):l.createCommentVNode("v-if",!0)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{id:n.contentId,class:l.normalizeClass(n.ns.e("content"))},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),n.hasMessage?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(n.ns.e("message"))},[l.renderSlot(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):l.createCommentVNode("v-if",!0)],2),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("input"))},[l.createVNode(c,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":f=>n.inputValue=f,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:l.normalizeClass({invalid:n.validateError}),onKeydown:l.withKeys(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("errormsg")),style:l.normalizeStyle({visibility:n.editorErrorMessage?"visible":"hidden"})},l.toDisplayString(n.editorErrorMessage),7)],2),[[l.vShow,n.showInput]])],10,["id"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("btns"))},[n.showCancelButton?(l.openBlock(),l.createBlock(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:l.normalizeClass([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:f=>n.handleAction("cancel"),onKeydown:l.withKeys(l.withModifiers(f=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:l.normalizeClass([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:f=>n.handleAction("confirm"),onKeydown:l.withKeys(l.withModifiers(f=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[l.vShow,n.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[l.vShow,n.visible]])]),_:3},8,["onAfterLeave"])}var uk=ft(lk,[["render",ck],["__file","index.vue"]]);const Fi=new Map,dk=n=>{let e=document.body;return n.appendTo&&(Zt(n.appendTo)&&(e=document.querySelector(n.appendTo)),Hn(n.appendTo)&&(e=n.appendTo),Hn(e)||(At("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},hk=(n,e,t=null)=>{const s=l.createVNode(uk,n,Lt(n.message)||l.isVNode(n.message)?{default:Lt(n.message)?n.message:()=>n.message}:null);return s.appContext=t,l.render(s,e),dk(n).appendChild(e.firstElementChild),s.component},fk=()=>document.createElement("div"),pk=(n,e)=>{const t=fk();n.onVanish=()=>{l.render(null,t),Fi.delete(r)},n.onAction=i=>{const o=Fi.get(r);let a;n.showInput?a={value:r.inputValue,action:i}:a=i,n.callback?n.callback(a,s.proxy):i==="cancel"||i==="close"?n.distinguishCancelAndClose&&i!=="cancel"?o.reject("close"):o.reject("cancel"):o.resolve(a)};const s=hk(n,t,e),r=s.proxy;for(const i in n)Fo(n,i)&&!Fo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function Dr(n,e=null){if(!Ge)return Promise.reject();let t;return Zt(n)||l.isVNode(n)?n={message:n}:t=n.callback,new Promise((s,r)=>{const i=pk(n,e??Dr._context);Fi.set(i,{options:n,callback:t,resolve:s,reject:r})})}const gk=["alert","confirm","prompt"],mk={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};gk.forEach(n=>{Dr[n]=yk(n)});function yk(n){return(e,t,s,r)=>{let i="";return fr(t)?(s=t,i=""):mp(t)?i="":i=t,Dr(Object.assign({title:i,message:e,type:"",...mk[n]},s,{boxType:n}),r)}}Dr.close=()=>{Fi.forEach((n,e)=>{e.doClose()}),Fi.clear()},Dr._context=null;const fs=Dr;fs.install=n=>{fs._context=n._context,n.config.globalProperties.$msgbox=fs,n.config.globalProperties.$messageBox=fs,n.config.globalProperties.$alert=fs.alert,n.config.globalProperties.$confirm=fs.confirm,n.config.globalProperties.$prompt=fs.prompt};const bk=fs;function Jg(n,e){return function(){return n.apply(e,arguments)}}const{toString:wk}=Object.prototype,{getPrototypeOf:ou}=Object,ka=(n=>e=>{const t=wk.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),ln=n=>(n=n.toLowerCase(),e=>ka(e)===n),Da=n=>e=>typeof e===n,{isArray:Rr}=Array,Ui=Da("undefined");function xk(n){return n!==null&&!Ui(n)&&n.constructor!==null&&!Ui(n.constructor)&&Tt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Xg=ln("ArrayBuffer");function vk(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Xg(n.buffer),e}const Ck=Da("string"),Tt=Da("function"),Kg=Da("number"),Ra=n=>n!==null&&typeof n=="object",Sk=n=>n===!0||n===!1,La=n=>{if(ka(n)!=="object")return!1;const e=ou(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Ek=ln("Date"),Ok=ln("File"),Mk=ln("Blob"),Pk=ln("FileList"),Ak=n=>Ra(n)&&Tt(n.pipe),Nk=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Tt(n.append)&&((e=ka(n))==="formdata"||e==="object"&&Tt(n.toString)&&n.toString()==="[object FormData]"))},Tk=ln("URLSearchParams"),[_k,kk,Dk,Rk]=["ReadableStream","Request","Response","Headers"].map(ln),Lk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hi(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),Rr(n))for(s=0,r=n.length;s<r;s++)e.call(null,n[s],s,n);else{const i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,n[a],a,n)}}function Zg(n,e){e=e.toLowerCase();const t=Object.keys(n);let s=t.length,r;for(;s-- >0;)if(r=t[s],e===r.toLowerCase())return r;return null}const Ys=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qg=n=>!Ui(n)&&n!==Ys;function au(){const{caseless:n}=Qg(this)&&this||{},e={},t=(s,r)=>{const i=n&&Zg(e,r)||r;La(e[i])&&La(s)?e[i]=au(e[i],s):La(s)?e[i]=au({},s):Rr(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Hi(arguments[s],t);return e}const Ik=(n,e,t,{allOwnKeys:s}={})=>(Hi(e,(r,i)=>{t&&Tt(r)?n[i]=Jg(r,t):n[i]=r},{allOwnKeys:s}),n),Vk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Bk=(n,e,t,s)=>{n.prototype=Object.create(e.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},jk=(n,e,t,s)=>{let r,i,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),i=r.length;i-- >0;)o=r[i],(!s||s(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&ou(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},$k=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const s=n.indexOf(e,t);return s!==-1&&s===t},zk=n=>{if(!n)return null;if(Rr(n))return n;let e=n.length;if(!Kg(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Fk=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&ou(Uint8Array)),Uk=(n,e)=>{const s=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(n,i[0],i[1])}},Hk=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},Gk=ln("HTMLFormElement"),Yk=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),em=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),Wk=ln("RegExp"),tm=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};Hi(t,(r,i)=>{let o;(o=e(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},qk=n=>{tm(n,(e,t)=>{if(Tt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(Tt(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Jk=(n,e)=>{const t={},s=r=>{r.forEach(i=>{t[i]=!0})};return Rr(n)?s(n):s(String(n).split(e)),t},Xk=()=>{},Kk=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,lu="abcdefghijklmnopqrstuvwxyz",nm="0123456789",sm={DIGIT:nm,ALPHA:lu,ALPHA_DIGIT:lu+lu.toUpperCase()+nm},Zk=(n=16,e=sm.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;n--;)t+=e[Math.random()*s|0];return t};function Qk(n){return!!(n&&Tt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const eD=n=>{const e=new Array(10),t=(s,r)=>{if(Ra(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=Rr(s)?[]:{};return Hi(s,(o,a)=>{const c=t(o,r+1);!Ui(c)&&(i[a]=c)}),e[r]=void 0,i}}return s};return t(n,0)},tD=ln("AsyncFunction"),nD=n=>n&&(Ra(n)||Tt(n))&&Tt(n.then)&&Tt(n.catch),rm=((n,e)=>n?setImmediate:e?((t,s)=>(Ys.addEventListener("message",({source:r,data:i})=>{r===Ys&&i===t&&s.length&&s.shift()()},!1),r=>{s.push(r),Ys.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Tt(Ys.postMessage)),sD=typeof queueMicrotask<"u"?queueMicrotask.bind(Ys):typeof process<"u"&&process.nextTick||rm,D={isArray:Rr,isArrayBuffer:Xg,isBuffer:xk,isFormData:Nk,isArrayBufferView:vk,isString:Ck,isNumber:Kg,isBoolean:Sk,isObject:Ra,isPlainObject:La,isReadableStream:_k,isRequest:kk,isResponse:Dk,isHeaders:Rk,isUndefined:Ui,isDate:Ek,isFile:Ok,isBlob:Mk,isRegExp:Wk,isFunction:Tt,isStream:Ak,isURLSearchParams:Tk,isTypedArray:Fk,isFileList:Pk,forEach:Hi,merge:au,extend:Ik,trim:Lk,stripBOM:Vk,inherits:Bk,toFlatObject:jk,kindOf:ka,kindOfTest:ln,endsWith:$k,toArray:zk,forEachEntry:Uk,matchAll:Hk,isHTMLForm:Gk,hasOwnProperty:em,hasOwnProp:em,reduceDescriptors:tm,freezeMethods:qk,toObjectSet:Jk,toCamelCase:Yk,noop:Xk,toFiniteNumber:Kk,findKey:Zg,global:Ys,isContextDefined:Qg,ALPHABET:sm,generateString:Zk,isSpecCompliantForm:Qk,toJSONObject:eD,isAsyncFn:tD,isThenable:nD,setImmediate:rm,asap:sD};function ue(n,e,t,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}D.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.status}}});const im=ue.prototype,om={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{om[n]={value:n}}),Object.defineProperties(ue,om),Object.defineProperty(im,"isAxiosError",{value:!0}),ue.from=(n,e,t,s,r,i)=>{const o=Object.create(im);return D.toFlatObject(n,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ue.call(o,n.message,e,t,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const rD=null;function cu(n){return D.isPlainObject(n)||D.isArray(n)}function am(n){return D.endsWith(n,"[]")?n.slice(0,-2):n}function lm(n,e,t){return n?n.concat(e).map(function(r,i){return r=am(r),!t&&i?"["+r+"]":r}).join(t?".":""):e}function iD(n){return D.isArray(n)&&!n.some(cu)}const oD=D.toFlatObject(D,{},null,function(e){return/^is[A-Z]/.test(e)});function Ia(n,e,t){if(!D.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=D.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!D.isUndefined(y[m])});const s=t.metaTokens,r=t.visitor||d,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(e);if(!D.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(D.isDate(g))return g.toISOString();if(!c&&D.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(g)||D.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(D.endsWith(m,"{}"))m=s?m:m.slice(0,-2),g=JSON.stringify(g);else if(D.isArray(g)&&iD(g)||(D.isFileList(g)||D.endsWith(m,"[]"))&&(b=D.toArray(g)))return m=am(m),b.forEach(function(x,v){!(D.isUndefined(x)||x===null)&&e.append(o===!0?lm([m],v,i):o===null?m:m+"[]",u(x))}),!1}return cu(g)?!0:(e.append(lm(y,m,i),u(g)),!1)}const h=[],f=Object.assign(oD,{defaultVisitor:d,convertValue:u,isVisitable:cu});function p(g,m){if(!D.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(g),D.forEach(g,function(b,w){(!(D.isUndefined(b)||b===null)&&r.call(e,b,D.isString(w)?w.trim():w,m,f))===!0&&p(b,m?m.concat(w):[w])}),h.pop()}}if(!D.isObject(n))throw new TypeError("data must be an object");return p(n),e}function cm(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function uu(n,e){this._pairs=[],n&&Ia(n,this,e)}const um=uu.prototype;um.append=function(e,t){this._pairs.push([e,t])},um.toString=function(e){const t=e?function(s){return e.call(this,s,cm)}:cm;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function aD(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dm(n,e,t){if(!e)return n;const s=t&&t.encode||aD,r=t&&t.serialize;let i;if(r?i=r(e,t):i=D.isURLSearchParams(e)?e.toString():new uu(e,t).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class hm{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){D.forEach(this.handlers,function(s){s!==null&&e(s)})}}const fm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lD={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:uu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},du=typeof window<"u"&&typeof document<"u",hu=typeof navigator=="object"&&navigator||void 0,cD=du&&(!hu||["ReactNative","NativeScript","NS"].indexOf(hu.product)<0),uD=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dD=du&&window.location.href||"http://localhost",Ct={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:du,hasStandardBrowserEnv:cD,hasStandardBrowserWebWorkerEnv:uD,navigator:hu,origin:dD},Symbol.toStringTag,{value:"Module"})),...lD};function hD(n,e){return Ia(n,new Ct.classes.URLSearchParams,Object.assign({visitor:function(t,s,r,i){return Ct.isNode&&D.isBuffer(t)?(this.append(s,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function fD(n){return D.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function pD(n){const e={},t=Object.keys(n);let s;const r=t.length;let i;for(s=0;s<r;s++)i=t[s],e[i]=n[i];return e}function pm(n){function e(t,s,r,i){let o=t[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=t.length;return o=!o&&D.isArray(r)?r.length:o,c?(D.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!D.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],i)&&D.isArray(r[o])&&(r[o]=pD(r[o])),!a)}if(D.isFormData(n)&&D.isFunction(n.entries)){const t={};return D.forEachEntry(n,(s,r)=>{e(fD(s),r,t,0)}),t}return null}function gD(n,e,t){if(D.isString(n))try{return(e||JSON.parse)(n),D.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const Gi={transitional:fm,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,i=D.isObject(e);if(i&&D.isHTMLForm(e)&&(e=new FormData(e)),D.isFormData(e))return r?JSON.stringify(pm(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e)||D.isReadableStream(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return hD(e,this.formSerializer).toString();if((a=D.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ia(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),gD(e)):e}],transformResponse:[function(e){const t=this.transitional||Gi.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(D.isResponse(e)||D.isReadableStream(e))return e;if(e&&D.isString(e)&&(s&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?ue.from(a,ue.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ct.classes.FormData,Blob:Ct.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],n=>{Gi.headers[n]={}});const mD=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),yD=n=>{const e={};let t,s,r;return n&&n.split(`
30
- `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&mD[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},gm=Symbol("internals");function Yi(n){return n&&String(n).trim().toLowerCase()}function Va(n){return n===!1||n==null?n:D.isArray(n)?n.map(Va):String(n)}function bD(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(n);)e[s[1]]=s[2];return e}const wD=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function fu(n,e,t,s,r){if(D.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!D.isString(e)){if(D.isString(s))return e.indexOf(s)!==-1;if(D.isRegExp(s))return s.test(e)}}function xD(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function vD(n,e){const t=D.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+t,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class St{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function i(a,c,u){const d=Yi(c);if(!d)throw new Error("header name must be a non-empty string");const h=D.findKey(r,d);(!h||r[h]===void 0||u===!0||u===void 0&&r[h]!==!1)&&(r[h||c]=Va(a))}const o=(a,c)=>D.forEach(a,(u,d)=>i(u,d,c));if(D.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(D.isString(e)&&(e=e.trim())&&!wD(e))o(yD(e),t);else if(D.isHeaders(e))for(const[a,c]of e.entries())i(c,a,s);else e!=null&&i(t,e,s);return this}get(e,t){if(e=Yi(e),e){const s=D.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return bD(r);if(D.isFunction(t))return t.call(this,r,s);if(D.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Yi(e),e){const s=D.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||fu(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function i(o){if(o=Yi(o),o){const a=D.findKey(s,o);a&&(!t||fu(s,s[a],a,t))&&(delete s[a],r=!0)}}return D.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let s=t.length,r=!1;for(;s--;){const i=t[s];(!e||fu(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,s={};return D.forEach(this,(r,i)=>{const o=D.findKey(s,i);if(o){t[o]=Va(r),delete t[i];return}const a=e?xD(i):String(i).trim();a!==i&&delete t[i],t[a]=Va(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&D.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
31
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[gm]=this[gm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Yi(o);s[a]||(vD(r,o),s[a]=!0)}return D.isArray(e)?e.forEach(i):i(e),this}}St.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(St.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}}),D.freezeMethods(St);function pu(n,e){const t=this||Gi,s=e||t,r=St.from(s.headers);let i=s.data;return D.forEach(n,function(a){i=a.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function mm(n){return!!(n&&n.__CANCEL__)}function Lr(n,e,t){ue.call(this,n??"canceled",ue.ERR_CANCELED,e,t),this.name="CanceledError"}D.inherits(Lr,ue,{__CANCEL__:!0});function ym(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new ue("Request failed with status code "+t.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function CD(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function SD(n,e){n=n||10;const t=new Array(n),s=new Array(n);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=s[i];o||(o=u),t[r]=c,s[r]=u;let h=i,f=0;for(;h!==r;)f+=t[h++],h=h%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),u-o<e)return;const p=d&&u-d;return p?Math.round(f*1e3/p):void 0}}function ED(n,e){let t=0,s=1e3/e,r,i;const o=(u,d=Date.now())=>{t=d,r=null,i&&(clearTimeout(i),i=null),n.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-t;h>=s?o(u,d):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-h)))},()=>r&&o(r)]}const Ba=(n,e,t=3)=>{let s=0;const r=SD(50,250);return ED(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-s,u=r(c),d=o<=a;s=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(h)},t)},bm=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},wm=n=>(...e)=>D.asap(()=>n(...e)),OD=Ct.hasStandardBrowserEnv?function(){const e=Ct.navigator&&/(msie|trident)/i.test(Ct.navigator.userAgent),t=document.createElement("a");let s;function r(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=r(window.location.href),function(o){const a=D.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),MD=Ct.hasStandardBrowserEnv?{write(n,e,t,s,r,i){const o=[n+"="+encodeURIComponent(e)];D.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),D.isString(s)&&o.push("path="+s),D.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function PD(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function AD(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function xm(n,e){return n&&!PD(e)?AD(n,e):e}const vm=n=>n instanceof St?{...n}:n;function Ws(n,e){e=e||{};const t={};function s(u,d,h){return D.isPlainObject(u)&&D.isPlainObject(d)?D.merge.call({caseless:h},u,d):D.isPlainObject(d)?D.merge({},d):D.isArray(d)?d.slice():d}function r(u,d,h){if(D.isUndefined(d)){if(!D.isUndefined(u))return s(void 0,u,h)}else return s(u,d,h)}function i(u,d){if(!D.isUndefined(d))return s(void 0,d)}function o(u,d){if(D.isUndefined(d)){if(!D.isUndefined(u))return s(void 0,u)}else return s(void 0,d)}function a(u,d,h){if(h in e)return s(u,d);if(h in n)return s(void 0,u)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d)=>r(vm(u),vm(d),!0)};return D.forEach(Object.keys(Object.assign({},n,e)),function(d){const h=c[d]||r,f=h(n[d],e[d],d);D.isUndefined(f)&&h!==a||(t[d]=f)}),t}const Cm=n=>{const e=Ws({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=St.from(o),e.url=dm(xm(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(D.isFormData(t)){if(Ct.hasStandardBrowserEnv||Ct.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Ct.hasStandardBrowserEnv&&(s&&D.isFunction(s)&&(s=s(e)),s||s!==!1&&OD(e.url))){const u=r&&i&&MD.read(i);u&&o.set(r,u)}return e},ND=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,s){const r=Cm(n);let i=r.data;const o=St.from(r.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=r,d,h,f,p,g;function m(){p&&p(),g&&g(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function b(){if(!y)return;const x=St.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};ym(function(C){t(C),m()},function(C){s(C),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(s(new ue("Request aborted",ue.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new ue("Network Error",ue.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||fm;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),s(new ue(v,S.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&D.forEach(o.toJSON(),function(v,S){y.setRequestHeader(S,v)}),D.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([f,g]=Ba(u,!0),y.addEventListener("progress",f)),c&&y.upload&&([h,p]=Ba(c),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new Lr(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const w=CD(r.url);if(w&&Ct.protocols.indexOf(w)===-1){s(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,n));return}y.send(i||null)})},TD=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let s=new AbortController,r;const i=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;s.abort(d instanceof ue?d:new Lr(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),n=null)};n.forEach(u=>u.addEventListener("abort",i));const{signal:c}=s;return c.unsubscribe=()=>D.asap(a),c}},_D=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let s=0,r;for(;s<t;)r=s+e,yield n.slice(s,r),s=r},kD=async function*(n,e){for await(const t of DD(n))yield*_D(t,e)},DD=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Sm=(n,e,t,s)=>{const r=kD(n,e);let i=0,o,a=c=>{o||(o=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){a(),c.close();return}let h=d.byteLength;if(t){let f=i+=h;t(f)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},ja=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Em=ja&&typeof ReadableStream=="function",RD=ja&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Om=(n,...e)=>{try{return!!n(...e)}catch{return!1}},LD=Em&&Om(()=>{let n=!1;const e=new Request(Ct.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Mm=64*1024,gu=Em&&Om(()=>D.isReadableStream(new Response("").body)),$a={stream:gu&&(n=>n.body)};ja&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!$a[e]&&($a[e]=D.isFunction(n[e])?t=>t[e]():(t,s)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,s)})})})(new Response);const ID=async n=>{if(n==null)return 0;if(D.isBlob(n))return n.size;if(D.isSpecCompliantForm(n))return(await new Request(Ct.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(D.isArrayBufferView(n)||D.isArrayBuffer(n))return n.byteLength;if(D.isURLSearchParams(n)&&(n=n+""),D.isString(n))return(await RD(n)).byteLength},VD=async(n,e)=>{const t=D.toFiniteNumber(n.getContentLength());return t??ID(e)},mu={http:rD,xhr:ND,fetch:ja&&(async n=>{let{url:e,method:t,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:f}=Cm(n);u=u?(u+"").toLowerCase():"text";let p=TD([r,i&&i.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&LD&&t!=="get"&&t!=="head"&&(y=await VD(d,s))!==0){let S=new Request(e,{method:"POST",body:s,duplex:"half"}),E;if(D.isFormData(s)&&(E=S.headers.get("content-type"))&&d.setContentType(E),S.body){const[C,M]=bm(y,Ba(wm(c)));s=Sm(S.body,Mm,C,M)}}D.isString(h)||(h=h?"include":"omit");const b="credentials"in Request.prototype;g=new Request(e,{...f,signal:p,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:b?h:void 0});let w=await fetch(g);const x=gu&&(u==="stream"||u==="response");if(gu&&(a||x&&m)){const S={};["status","statusText","headers"].forEach(N=>{S[N]=w[N]});const E=D.toFiniteNumber(w.headers.get("content-length")),[C,M]=a&&bm(E,Ba(wm(a),!0))||[];w=new Response(Sm(w.body,Mm,C,()=>{M&&M(),m&&m()}),S)}u=u||"text";let v=await $a[D.findKey($a,u)||"text"](w,n);return!x&&m&&m(),await new Promise((S,E)=>{ym(S,E,{data:v,headers:St.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,n,g),{cause:b.cause||b}):ue.from(b,b&&b.code,n,g)}})};D.forEach(mu,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Pm=n=>`- ${n}`,BD=n=>D.isFunction(n)||n===null||n===!1,Am={getAdapter:n=>{n=D.isArray(n)?n:[n];const{length:e}=n;let t,s;const r={};for(let i=0;i<e;i++){t=n[i];let o;if(s=t,!BD(t)&&(s=mu[(o=String(t)).toLowerCase()],s===void 0))throw new ue(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
32
- `+i.map(Pm).join(`
33
- `):" "+Pm(i[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:mu};function yu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Lr(null,n)}function Nm(n){return yu(n),n.headers=St.from(n.headers),n.data=pu.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Am.getAdapter(n.adapter||Gi.adapter)(n).then(function(s){return yu(n),s.data=pu.call(n,n.transformResponse,s),s.headers=St.from(s.headers),s},function(s){return mm(s)||(yu(n),s&&s.response&&(s.response.data=pu.call(n,n.transformResponse,s.response),s.response.headers=St.from(s.response.headers))),Promise.reject(s)})}const Tm="1.7.7",bu={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{bu[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const _m={};bu.transitional=function(e,t,s){function r(i,o){return"[Axios v"+Tm+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new ue(r(o," has been removed"+(t?" in "+t:"")),ue.ERR_DEPRECATED);return t&&!_m[o]&&(_m[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};function jD(n,e,t){if(typeof n!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=n[i],c=a===void 0||o(a,i,n);if(c!==!0)throw new ue("option "+i+" must be "+c,ue.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new ue("Unknown option "+i,ue.ERR_BAD_OPTION)}}const wu={assertOptions:jD,validators:bu},ps=wu.validators;class qs{constructor(e){this.defaults=e,this.interceptors={request:new hm,response:new hm}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
34
- `+i):s.stack=i}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Ws(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:i}=t;s!==void 0&&wu.assertOptions(s,{silentJSONParsing:ps.transitional(ps.boolean),forcedJSONParsing:ps.transitional(ps.boolean),clarifyTimeoutError:ps.transitional(ps.boolean)},!1),r!=null&&(D.isFunction(r)?t.paramsSerializer={serialize:r}:wu.assertOptions(r,{encode:ps.function,serialize:ps.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&D.merge(i.common,i[t.method]);i&&D.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=St.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,h=0,f;if(!c){const g=[Nm.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),f=g.length,d=Promise.resolve(t);h<f;)d=d.then(g[h++],g[h++]);return d}f=a.length;let p=t;for(h=0;h<f;){const g=a[h++],m=a[h++];try{p=g(p)}catch(y){m.call(this,y);break}}try{d=Nm.call(this,p)}catch(g){return Promise.reject(g)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=Ws(this.defaults,e);const t=xm(e.baseURL,e.url);return dm(t,e.params,e.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(e){qs.prototype[e]=function(t,s){return this.request(Ws(s||{},{method:e,url:t,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,a){return this.request(Ws(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}qs.prototype[e]=t(),qs.prototype[e+"Form"]=t(!0)});class xu{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,a){s.reason||(s.reason=new Lr(i,o,a),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xu(function(r){e=r}),cancel:e}}}function $D(n){return function(t){return n.apply(null,t)}}function zD(n){return D.isObject(n)&&n.isAxiosError===!0}const vu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vu).forEach(([n,e])=>{vu[e]=n});function km(n){const e=new qs(n),t=Jg(qs.prototype.request,e);return D.extend(t,qs.prototype,e,{allOwnKeys:!0}),D.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return km(Ws(n,r))},t}const qe=km(Gi);qe.Axios=qs,qe.CanceledError=Lr,qe.CancelToken=xu,qe.isCancel=mm,qe.VERSION=Tm,qe.toFormData=Ia,qe.AxiosError=ue,qe.Cancel=qe.CanceledError,qe.all=function(e){return Promise.all(e)},qe.spread=$D,qe.isAxiosError=zD,qe.mergeConfig=Ws,qe.AxiosHeaders=St,qe.formToJSON=n=>pm(D.isHTMLForm(n)?new FormData(n):n),qe.getAdapter=Am.getAdapter,qe.HttpStatusCode=vu,qe.default=qe;const gs=qe.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),FD=n=>{gs.defaults.baseURL=n},UD=n=>{gs.interceptors.request.use(e=>{if(n)return e.headers.token=n,e},e=>Promise.reject(e))};gs.interceptors.response.use(n=>(n.data.isOk=n.data.code===200,n.data),n=>{if(n.response)switch(n.response.status){}return Promise.reject(n)});const Wi=(n,e={})=>gs.get(n,{params:e}),za=(n,e={})=>gs.post(n,e),Dm=(n,e={})=>gs.delete(n,{params:e}),HD=(n,e={})=>gs.post(n,e,{headers:{"Content-Type":"multipart/form-data"}}),qi=(n,e)=>{const t=document.querySelector(n),s=t.querySelectorAll(".x6-port-body"),r=t.querySelectorAll(".x6-port-label");for(let i=0,o=s.length;i<o;i+=1)s[i].style.visibility=e?"visible":"hidden";for(let i=0,o=r.length;i<o;i+=1)r[i].style.visibility=e?"visible":"hidden"},Rm=()=>Wi("/cny/custom/deviceList").then(n=>{if(n!=null&&n.isOk)return n.data}),Lm=n=>Wi("/cny/custom/monitorInfo",{deviceCode:n,fieldType:1}).then(e=>{if(e!=null&&e.isOk)return e.data}),Im=n=>Wi("/cny/template/selectOne",{id:n}).then(e=>{if(e!=null&&e.isOk){const t=JSON.parse(e.data.remark);return{background:t.background,grid:t.grid,data:t.data}}else We.error((e==null?void 0:e.msg)||"获取失败")}),GD=n=>za("/cny/custom/arrRealData2",n).then(e=>{if(e!=null&&e.isOk)return e.data;We.error((e==null?void 0:e.msg)||"获取失败")}),Vm={color:"#000000"},Bm={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},YD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},Cu={position:"absolute",args:{x:0,y:0},attrs:{text:{fill:"#5174ff",fontSize:8},circle:{magnet:!0,stroke:"#5174ff",r:4}},label:{position:"top"}},WD={shape:"rect",label:"文本",width:50,height:30,attrs:{body:{fill:"#00000000",stroke:"#00000000",strokeWidth:1,rx:6,ry:6},text:{fill:"#ffffff"},label:{textAnchor:"start",x:-14,y:0}},data:{type:"text",content:"文本",fields:[]},ports:{groups:{ports:{portOption:Cu}}}},Wn={markup:[{tagName:"path",selector:"line1",groupSelector:"lines"},{tagName:"path",selector:"line2",groupSelector:"lines"}],attrs:{lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},line1:{stroke:"#2364DD",strokeWidth:1},line2:{stroke:"#ffffff",strokeWidth:1,strokeDasharray:0,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}}},En=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},qD={class:"control"},JD={class:"row-column"},XD=En({__name:"index",props:{payload:Object},setup(n){var f,p,g,m,y,b,w,x,v,S,E,C,M,N,_,T,k,R,V,A,P;const e=n,t=l.ref(((f=e.payload.value.options.background)==null?void 0:f.color)||null),s=l.ref(((g=(p=e.payload.value.options)==null?void 0:p.grid)==null?void 0:g.visible)||null),r=l.ref(((y=(m=e.payload.value.options)==null?void 0:m.grid)==null?void 0:y.size)||10),i=l.ref(((v=(x=(w=(b=e.payload.value.options)==null?void 0:b.grid)==null?void 0:w.args)==null?void 0:x[0])==null?void 0:v.color)||null),o=l.ref(((M=(C=(E=(S=e.payload.value.options)==null?void 0:S.grid)==null?void 0:E.args)==null?void 0:C[0])==null?void 0:M.thickness)||1),a=l.ref(((k=(T=(_=(N=e.payload.value.options)==null?void 0:N.grid)==null?void 0:_.args)==null?void 0:T[1])==null?void 0:k.color)||null),c=l.ref(((P=(A=(V=(R=e.payload.value.options)==null?void 0:R.grid)==null?void 0:V.args)==null?void 0:A[1])==null?void 0:P.thickness)||1),u=l.ref("1"),d=j=>{e.payload.value.drawBackground({color:j})},h=()=>{e.payload.value.drawGrid({visible:s.value,size:r.value,type:"doubleMesh",args:[{color:i.value,thickness:o.value},{color:a.value,thickness:c.value}]})};return(j,z)=>{const Y=l.resolveComponent("el-col"),le=l.resolveComponent("el-color-picker"),I=l.resolveComponent("el-row"),B=l.resolveComponent("el-switch"),ne=l.resolveComponent("el-input-number"),L=l.resolveComponent("el-collapse-item"),G=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",qD,[l.createVNode(G,{modelValue:u.value,"onUpdate:modelValue":z[7]||(z[7]=ie=>u.value=ie),accordion:""},{default:l.withCtx(()=>[l.createVNode(L,{title:"基础属性",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",JD,[l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[8]||(z[8]=[l.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(le,{modelValue:t.value,"onUpdate:modelValue":z[0]||(z[0]=ie=>t.value=ie),size:"small","show-alpha":"",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[9]||(z[9]=[l.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(B,{modelValue:s.value,"onUpdate:modelValue":z[1]||(z[1]=ie=>s.value=ie),"active-value":!0,"inactive-value":!1,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[10]||(z[10]=[l.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:r.value,"onUpdate:modelValue":z[2]||(z[2]=ie=>r.value=ie),min:1,max:20,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[11]||(z[11]=[l.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(le,{modelValue:i.value,"onUpdate:modelValue":z[3]||(z[3]=ie=>i.value=ie),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[12]||(z[12]=[l.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(le,{modelValue:a.value,"onUpdate:modelValue":z[4]||(z[4]=ie=>a.value=ie),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[13]||(z[13]=[l.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:o.value,"onUpdate:modelValue":z[5]||(z[5]=ie=>o.value=ie),min:.5,max:10,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>z[14]||(z[14]=[l.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:c.value,"onUpdate:modelValue":z[6]||(z[6]=ie=>c.value=ie),min:.5,max:10,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]);typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const s=document.createDocumentFragment();t.forEach(r=>{const i=r instanceof Node;s.appendChild(i?r:document.createTextNode(String(r)))}),this.appendChild(s)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class yt{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,s,r)=>{const i=r.value,o=t.__proto__;r.value=function(...a){this.disposed||(i.call(this,...a),o.dispose.call(this))}}}n.dispose=e})(yt||(yt={}));class jm{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const s=new n;return t.forEach(r=>{s.add(r)}),s}n.from=e})(jm||(jm={}));function $m(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function Q(n,e,...t){return $m(n,e,t)}function KD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Su(n){return n!=null&&(n instanceof Promise||KD(n))}function Eu(...n){const e=[];if(n.forEach(s=>{Array.isArray(s)?e.push(...s):e.push(s)}),e.some(s=>Su(s))){const s=e.map(r=>Su(r)?r:Promise.resolve(r!==!1));return Promise.all(s).then(r=>r.reduce((i,o)=>o!==!1&&i,!0))}return e.every(s=>s!==!1)}function ZD(...n){const e=Eu(n);return typeof e=="boolean"?Promise.resolve(e):e}function Ou(n,e){const t=[];for(let s=0;s<n.length;s+=2){const r=n[s],i=n[s+1],o=Array.isArray(e)?e:[e],a=$m(r,i,o);t.push(a)}return Eu(t)}class QD{constructor(){this.listeners={}}on(e,t,s){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,s),this)}once(e,t,s){const r=(...i)=>(this.off(e,r),Ou([t,s],i));return this.on(e,r,this)}off(e,t,s){if(!(e||t||s))return this.listeners={},this;const r=this.listeners;return(e?[e]:Object.keys(r)).forEach(o=>{const a=r[o];if(a){if(!(t||s)){delete r[o];return}for(let c=a.length-2;c>=0;c-=2)t&&a[c]!==t||s&&a[c+1]!==s||a.splice(c,2)}}),this}trigger(e,...t){let s=!0;if(e!=="*"){const i=this.listeners[e];i!=null&&(s=Ou([...i],t))}const r=this.listeners["*"];return r!=null?Eu([s,Ou([...r],[e,...t])]):s}emit(e,...t){return this.trigger(e,...t)}}function eR(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(t.prototype,s))})})}const tR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function nR(n,e){tR(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}class sR{}const rR=/^\s*class\s+/.test(`${sR}`)||/^\s*class\s*\{/.test(`${class{}}`);function Mu(n,e){let t;return rR?t=class extends e{}:(t=function(){return e.apply(this,arguments)},nR(t,e)),Object.defineProperty(t,"name",{value:n}),t}function zm(n){return n==="__proto__"}function Pu(n,e,t="/"){let s;const r=Array.isArray(e)?e:e.split(t);if(r.length)for(s=n;r.length;){const i=r.shift();if(Object(s)===s&&i&&i in s)s=s[i];else return}return s}function Ir(n,e,t,s="/"){const r=Array.isArray(e)?e:e.split(s),i=r.pop();if(i&&!zm(i)){let o=n;r.forEach(a=>{zm(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=t}return n}function Fm(n,e,t="/"){const s=Array.isArray(e)?e.slice():e.split(t),r=s.pop();if(r)if(s.length>0){const i=Pu(n,s);i&&delete i[r]}else delete n[r];return n}var iR=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Te extends QD{dispose(){this.off()}}iR([yt.dispose()],Te.prototype,"dispose",null),function(n){n.dispose=yt.dispose}(Te||(Te={})),eR(Te,yt);const Um=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hm=Um(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Au=Um(n=>DP(sa(n)).replace(/ /g,""));function Nu(n){let e=2166136261,t=!1,s=n;for(let r=0,i=s.length;r<i;r+=1){let o=s.charCodeAt(r);o>127&&!t&&(s=unescape(encodeURIComponent(s)),o=s.charCodeAt(r),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Fa(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=Math.random()*16|0,o=r==="x"?i:r==="y"?i&3|8:r;n+=o.toString(16)}return n}function oR(n,e,t){const s=Math.min(2,Math.floor(n.length*.34));let r=Math.floor(n.length*.4)+1,i,o=!1;const a=n.toLowerCase();for(const c of e){const u=t(c);if(u!==void 0&&Math.abs(u.length-a.length)<=s){const d=u.toLowerCase();if(d===a){if(u===n)continue;return c}if(o||u.length<3)continue;const h=aR(a,d,r-1);if(h===void 0)continue;h<3?(o=!0,i=c):(r=h,i=c)}}return i}function aR(n,e,t){let s=new Array(e.length+1),r=new Array(e.length+1);const i=t+1;for(let a=0;a<=e.length;a+=1)s[a]=a;for(let a=1;a<=n.length;a+=1){const c=n.charCodeAt(a-1),u=a>t?a-t:1,d=e.length>t+a?t+a:e.length;r[0]=a;let h=a;for(let p=1;p<u;p+=1)r[p]=i;for(let p=u;p<=d;p+=1){const g=c===e.charCodeAt(p-1)?s[p-1]:Math.min(s[p]+1,r[p-1]+1,s[p-1]+2);r[p]=g,h=Math.min(h,g)}for(let p=d+1;p<=e.length;p+=1)r[p]=i;if(h>t)return;const f=s;s=r,r=f}const o=s[e.length];return o>t?void 0:o}function qn(n){return typeof n=="string"&&n.slice(-1)==="%"}function cn(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),qn(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function ms(n){if(typeof n=="object"){let t=0,s=0,r=0,i=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(s=i=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(r=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=n.left),n.top!=null&&Number.isFinite(n.top)&&(s=n.top),n.right!=null&&Number.isFinite(n.right)&&(r=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(i=n.bottom),{top:s,right:r,bottom:i,left:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let Tu=!1,Gm=!1,Ym=!1,Wm=!1,qm=!1,Jm=!1,Xm=!1,Km=!1,Zm=!1,Qm=!1,ey=!1,ty=!1,ny=!1,sy=!1,ry=!1,iy=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Tu=n.indexOf("Macintosh")>=0,Gm=!!n.match(/(iPad|iPhone|iPod)/g),Ym=n.indexOf("Windows")>=0,Wm=n.indexOf("MSIE")>=0,qm=!!n.match(/Trident\/7\./),Jm=!!n.match(/Edge\//),Xm=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,Zm=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,Qm=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,ey=n.indexOf("Firefox/")>=0,ty=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(iy=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Km=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,sy=window.PointerEvent!=null&&!Tu),typeof document=="object"){ny="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){ry=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var ys;(function(n){n.IS_MAC=Tu,n.IS_IOS=Gm,n.IS_WINDOWS=Ym,n.IS_IE=Wm,n.IS_IE11=qm,n.IS_EDGE=Jm,n.IS_NETSCAPE=Xm,n.IS_CHROME_APP=Km,n.IS_CHROME=Zm,n.IS_OPERA=Qm,n.IS_FIREFOX=ey,n.IS_SAFARI=ty,n.SUPPORT_TOUCH=ny,n.SUPPORT_POINTER=sy,n.SUPPORT_PASSIVE=ry,n.NO_FOREIGNOBJECT=iy,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(ys||(ys={})),function(n){function e(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;const s={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function r(i){const o=document.createElement(s[i]||"div"),a=`on${i}`;let c=a in o;return c||(o.setAttribute(a,"return;"),c=typeof o[a]=="function"),c}n.isEventSupported=r}(ys||(ys={}));const _u=/[\t\r\n\f]/g,ku=/\S+/g,Vr=n=>` ${n} `;function Br(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function On(n,e){if(n==null||e==null)return!1;const t=Vr(Br(n)),s=Vr(e);return n.nodeType===1?t.replace(_u," ").includes(s):!1}function K(n,e){if(!(n==null||e==null)){if(typeof e=="function")return K(n,e(Br(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(ku)||[],s=Vr(Br(n)).replace(_u," ");let r=t.reduce((i,o)=>i.indexOf(Vr(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function De(n,e){if(n!=null){if(typeof e=="function")return De(n,e(Br(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(ku)||[],s=Vr(Br(n)).replace(_u," ");let r=t.reduce((i,o)=>{const a=Vr(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=e?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function un(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?K(n,e):De(n,e);return}if(typeof e=="function")return un(n,e(Br(n),t),t);typeof e=="string"&&(e.match(ku)||[]).forEach(r=>{On(n,r)?De(n,r):K(n,r)})}}let oy=0;function lR(){return oy+=1,`v${oy}`}function Du(n){return(n.id==null||n.id==="")&&(n.id=lR()),n.id}function bs(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const st={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},ay="1.1";function ly(n,e=document){return e.createElement(n)}function Ru(n,e=st.xhtml,t=document){return t.createElementNS(e,n)}function dn(n,e=document){return Ru(n,st.svg,e)}function Ua(n){if(n){const t=`<svg xmlns="${st.svg}" xmlns:xlink="${st.xlink}" version="${ay}">${n}</svg>`,{documentElement:s}=cR(t,{async:!1});return s}const e=document.createElementNS(st.svg,"svg");return e.setAttributeNS(st.xmlns,"xmlns:xlink",st.xlink),e.setAttribute("version",ay),e}function cR(n,e={}){let t;try{const s=new DOMParser;if(e.async!=null){const r=s;r.async=e.async}t=s.parseFromString(n,e.mimeType||"text/xml")}catch{t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function uR(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Lu(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function dR(n,e){return n.querySelectorAll(e)}function hR(n,e){return n.querySelector(e)}function cy(n,e,t){const s=n.ownerSVGElement;let r=n.parentNode;for(;r&&r!==t&&r!==s;){if(On(r,e))return r;r=r.parentNode}return null}function Iu(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Ft(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function Ji(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function _t(n,e){(Array.isArray(e)?e:[e]).forEach(s=>{s!=null&&n.appendChild(s)})}function uy(n,e){const t=n.firstChild;return t?Vu(t,e):_t(n,e)}function Vu(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&t.insertBefore(r,n)})}function ws(n,e){e!=null&&e.appendChild(n)}function dy(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function fR(n,e){const t=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!e||On(s,e))&&t.push(s);return t}const hy=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function pR(n,e){return n.getAttribute(e)}function Bu(n,e){const t=py(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function ju(n,e,t){if(t==null)return Bu(n,e);const s=py(e);s.ns&&typeof t=="string"?n.setAttributeNS(s.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function fy(n,e){Object.keys(e).forEach(t=>{ju(n,t,e[t])})}function fe(n,e,t){if(e==null){const s=n.attributes,r={};for(let i=0;i<s.length;i+=1)r[s[i].name]=s[i].value;return r}if(typeof e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?fy(n,e):ju(n,e,t)}function py(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:st[e[0]],local:e[1]}}return{ns:null,local:n}}function Xi(n){const e={};return Object.keys(n).forEach(t=>{const s=hy.includes(t)?t:Hm(t);e[s]=n[t]}),e}function Ha(n){const e={};return n.split(";").forEach(s=>{const r=s.trim();if(r){const i=r.split("=");i.length&&(e[i[0].trim()]=i[1]?i[1].trim():"")}}),e}function $u(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const s=typeof n[t]=="object",r=typeof e[t]=="object";let i,o;s&&r?(i=n[t],o=e[t]):s?(i=n[t],o=Ha(e[t])):r?(i=Ha(n[t]),o=e[t]):(i=Ha(n[t]),o=Ha(e[t])),n[t]=$u(i,o)}else n[t]=e[t]}),n}function gR(n,e,t={}){const s=t.offset||0,r=[],i=[];let o,a,c=null;for(let u=0;u<n.length;u+=1){o=i[u]=n[u];for(let d=0,h=e.length;d<h;d+=1){const f=e[d],p=f.start+s,g=f.end+s;u>=p&&u<g&&(typeof o=="string"?o=i[u]={t:n[u],attrs:f.attrs}:o.attrs=$u($u({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(d)))}a=i[u-1],a?Ie(o)&&Ie(a)?(c=c,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?c.t+=o.t:(r.push(c),c=o)):Ie(o)||Ie(a)?(c=c,r.push(c),c=o):c=(c||"")+o:c=o}return c!=null&&r.push(c),r}function mR(n){return n.replace(/ /g," ")}var Js;(function(n){function e(u){const d="data:";return u.substr(0,d.length)===d}n.isDataUrl=e;function t(u,d){if(!u||e(u)){setTimeout(()=>d(null,u));return}const h=()=>{d(new Error(`Failed to load image: ${u}`))},f=window.FileReader?g=>{if(g.status===200){const m=new FileReader;m.onload=y=>{const b=y.target.result;d(null,b)},m.onerror=h,m.readAsDataURL(g.response)}else h()}:g=>{const m=y=>{const w=[];for(let x=0;x<y.length;x+=32768)w.push(String.fromCharCode.apply(null,y.subarray(x,x+32768)));return w.join("")};if(g.status===200){let y=u.split(".").pop()||"png";y==="svg"&&(y="svg+xml");const b=`data:image/${y};base64,`,w=new Uint8Array(g.response),x=b+btoa(m(w));d(null,x)}else h()},p=new XMLHttpRequest;p.responseType=window.FileReader?"blob":"arraybuffer",p.open("GET",u,!0),p.addEventListener("error",h),p.addEventListener("load",()=>f(p)),p.send()}n.imageToDataUri=t;function s(u){let d=u.replace(/\s/g,"");d=decodeURIComponent(d);const h=d.indexOf(","),f=d.slice(0,h),p=f.split(":")[1].split(";")[0],g=d.slice(h+1);let m;f.indexOf("base64")>=0?m=atob(g):m=unescape(encodeURIComponent(g));const y=new Uint8Array(m.length);for(let b=0;b<m.length;b+=1)y[b]=m.charCodeAt(b);return new Blob([y],{type:p})}n.dataUriToBlob=s;function r(u,d){const h=window.navigator.msSaveBlob;if(h)h(u,d);else{const f=window.URL.createObjectURL(u),p=document.createElement("a");p.href=f,p.download=d,document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(f)}}n.downloadBlob=r;function i(u,d){const h=s(u);r(h,d)}n.downloadDataUri=i;function o(u){const d=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return d&&d[2]?d[2].replace(/\s+/," ").split(" "):null}function a(u){const d=parseFloat(u);return Number.isNaN(d)?null:d}function c(u,d={}){let h=null;const f=x=>(h==null&&(h=o(u)),h!=null?a(h[x]):null),p=x=>{const v=u.match(x);return v&&v[2]?a(v[2]):null};let g=d.width;if(g==null&&(g=p(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=f(2)),g==null)throw new Error("Can not parse width from svg string");let m=d.height;if(m==null&&(m=p(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),m==null&&(m=f(3)),m==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(u).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=c})(Js||(Js={}));let Xs;const yR={px(n){return n},mm(n){return Xs*n},cm(n){return Xs*n*10},in(n){return Xs*n*25.4},pt(n){return Xs*(25.4*n/72)},pc(n){return Xs*(25.4*n/6)}};var gy;(function(n){function e(s,r,i){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=s+(i||"px"),a.height=r+(i||"px"),document.body.appendChild(o);const c=o.getBoundingClientRect(),u={width:c.width||0,height:c.height||0};return document.body.removeChild(o),u}n.measure=e;function t(s,r){Xs==null&&(Xs=e("1","1","mm").width);const i=r?yR[r]:null;return i?i(s):s}n.toPx=t})(gy||(gy={}));const bR=/-(.)/g;function wR(n){return n.replace(bR,(e,t)=>t.toUpperCase())}const zu={},my=["webkit","ms","moz","o"],yy=typeof document<"u"?document.createElement("div").style:{};function xR(n){for(let e=0;e<my.length;e+=1){const t=my[e]+n;if(t in yy)return t}return null}function vR(n){const e=wR(n);if(zu[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);zu[e]=e in yy?e:xR(t)}return zu[e]}function by(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const CR={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function SR(n){return/^--/.test(n)}function ER(n,e,t){const s=window.getComputedStyle(n,null);return t?s.getPropertyValue(e)||void 0:s[e]||n.style[e]}function OR(n,e){return!CR[n]&&typeof e=="number"?`${e}px`:e}function Je(n,e,t){if(typeof e=="string"){const s=SR(e);if(s||(e=vR(e)),t===void 0)return ER(n,e,s);s||(t=OR(e,t));const r=n.style;s?r.setProperty(e,t):r[e]=t;return}for(const s in e)Je(n,s,e[s])}const Ga=new WeakMap;function wy(n,e){const t=sa(e),s=Ga.get(n);if(s)return s[t]}function MR(n,e,t){const s=sa(e),r=Ga.get(n);r?r[s]=t:Ga.set(n,{[s]:t})}function Ks(n,e,t){if(!e){const s={};return Object.keys(Ga).forEach(r=>{s[r]=wy(n,r)}),s}if(typeof e=="string"){if(t===void 0)return wy(n,e);MR(n,e,t);return}for(const s in e)Ks(n,s,e[s])}class se{get[Symbol.toStringTag](){return se.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,s){if(!e)throw new TypeError("Invalid element to create vector");let r;if(se.isVector(e))r=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")r=Ua();else if(e[0]==="<"){const i=Ua(e);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(st.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),s&&this.append(s)}transform(e,t){return e==null?$r(this.node):($r(this.node,e,t),this)}translate(e,t=0,s={}){return e==null?Ay(this.node):(Ay(this.node,e,t,s),this)}rotate(e,t,s,r={}){return e==null?Hu(this.node):(Hu(this.node,e,t,s,r),this)}scale(e,t){return e==null?Gu(this.node):(Gu(this.node,e,t),this)}getTransformToElement(e){const t=se.toNode(e);return eo(this.node,t)}removeAttribute(e){return Bu(this.node,e),this}getAttribute(e){return pR(this.node,e)}setAttribute(e,t){return ju(this.node,e,t),this}setAttributes(e){return fy(this.node,e),this}attr(e,t){return e==null?fe(this.node):typeof e=="string"&&t===void 0?fe(this.node,e):(typeof e=="object"?fe(this.node,e):fe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:se.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?se.create(t):se.create("defs").appendTo(e)}text(e,t={}){return vy(this.node,e,t),this}tagName(){return uR(this.node)}clone(){return se.create(this.node.cloneNode(!0))}remove(){return Ft(this.node),this}empty(){return Ji(this.node),this}append(e){return _t(this.node,se.toNodes(e)),this}appendTo(e){return ws(this.node,se.isVector(e)?e.node:e),this}prepend(e){return uy(this.node,se.toNodes(e)),this}before(e){return Vu(this.node,se.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(se.toNode(e),this.node),se.create(e)}first(){return this.node.firstChild?se.create(this.node.firstChild):null}last(){return this.node.lastChild?se.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?se.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(se.toNode(e))}find(e){const t=[],s=dR(this.node,e);if(s)for(let r=0,i=s.length;r<i;r+=1)t.push(se.create(s[r]));return t}findOne(e){const t=hR(this.node,e);return t?se.create(t):null}findParentByClass(e,t){const s=cy(this.node,e,t);return s?se.create(s):null}matches(e){const t=this.node;this.node.matches;const s=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return s&&s.call(t,e)}contains(e){return Iu(this.node,se.isVector(e)?e.node:e)}wrap(e){const t=se.create(e),s=this.node.parentNode;return s!=null&&s.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=se.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=se.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let s=0;s<e.length;s+=1)e[s].nodeType===1&&t.push(se.create(e[s]));return t}eachChild(e,t){const s=this.children();for(let r=0,i=s.length;r<i;r+=1)e.call(s[r],s[r],r,s),t&&s[r].eachChild(e,t);return this}index(){return Lu(this.node)}hasClass(e){return On(this.node,e)}addClass(e){return K(this.node,e),this}removeClass(e){return De(this.node,e),this}toggleClass(e,t){return un(this.node,e,t),this}toLocalPoint(e,t){return YR(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?TR(this.node,e):[]}toPath(){return se.create(VR(this.node))}toPathData(){return My(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],c=o;return(a==null||a===n.toStringTag)&&c.node instanceof SVGElement&&typeof c.sample=="function"&&typeof c.toPath=="function"}n.isVector=e;function t(o,a,c){return new n(o,a,c)}n.create=t;function s(o){if(o[0]==="<"){const a=Ua(o),c=[];for(let u=0,d=a.childNodes.length;u<d;u+=1){const h=a.childNodes[u];c.push(t(document.importNode(h,!0)))}return c}return[t(o)]}n.createVectors=s;function r(o){return e(o)?o.node:o}n.toNode=r;function i(o){return Array.isArray(o)?o.map(a=>r(a)):[r(o)]}n.toNodes=i})(se||(se={}));function PR(n,e){const t=se.create(e),s=se.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=se.create("path").attr("d",r).appendTo(t.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function AR(n,e,t){const s=t.eol,r=t.baseSize,i=t.lineHeight;let o=0,a;const c={},u=e.length-1;for(let d=0;d<=u;d+=1){let h=e[d],f=null;if(typeof h=="object"){const p=h.attrs,g=se.create("tspan",p);a=g.node;let m=h.t;s&&d===u&&(m+=s),a.textContent=m;const y=p.class;y&&g.addClass(y),t.includeAnnotationIndices&&g.attr("annotations",h.annotations.join(",")),f=parseFloat(p["font-size"]),f===void 0&&(f=r),f&&f>o&&(o=f)}else s&&d===u&&(h+=s),a=document.createTextNode(h||" "),r&&r>o&&(o=r);n.appendChild(a)}return o&&(c.maxFontSize=o),i?c.lineHeight=i:o&&(c.lineHeight=o*1.2),c}const xy=/em$/;function Ya(n,e){const t=parseFloat(n);return xy.test(n)?t*e:t}function NR(n,e,t,s){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let i=e[0];const o=Ya(i.maxFontSize,t)||t;let a=0;const c=Ya(s,t);for(let h=1;h<r;h+=1){i=e[h];const f=Ya(i.lineHeight,t)||c;a+=f}const u=Ya(i.maxFontSize,t)||t;let d;switch(n){case"middle":d=o/2-.15*u-a/2;break;case"bottom":d=-(.25*u)-a;break;case"top":default:d=.8*o;break}return d}function vy(n,e,t={}){e=mR(e);const s=t.eol;let r=t.textPath;const i=t.textVerticalAnchor,o=i==="middle"||i==="bottom"||i==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const c=t.includeAnnotationIndices;let u=t.annotations;u&&!Array.isArray(u)&&(u=[u]);const d=t.lineHeight,h=d==="auto",f=h?"1.5em":d||"1em";let p=!0;const g=n.childNodes;if(g.length===1){const N=g[0];N&&N.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&Ji(n),fe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const m=fe(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&fe(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=PR(r,n)):b=document.createDocumentFragment();let w,x=0,v;const S=e.split(`
35
- `),E=[],C=S.length-1;for(let N=0;N<=C;N+=1){w=f;let _="v-line";const T=dn("tspan");let k,R=S[N];if(R)if(u){const V=gR(R,u,{offset:-x,includeAnnotationIndices:c});k=AR(T,V,{eol:N!==C&&s,baseSize:y,lineHeight:h?null:f,includeAnnotationIndices:c});const A=k.lineHeight;A&&h&&N!==0&&(w=A),N===0&&(v=k.maxFontSize*.8)}else s&&N!==C&&(R+=s),T.textContent=R;else{T.textContent="-",_+=" v-empty-line";const V=T.style;V.fillOpacity=0,V.strokeOpacity=0,u&&(k={})}k&&E.push(k),N>0&&T.setAttribute("dy",w),(N>0||r)&&T.setAttribute("x",a),T.className.baseVal=_,b.appendChild(T),x+=R.length+1}if(o)if(u)w=NR(i,E,y,f);else if(i==="top")w="0.8em";else{let N;switch(C>0?(N=parseFloat(f)||1,N*=C,xy.test(f)||(N/=y)):N=0,i){case"middle":w=`${.3-N/2}em`;break;case"bottom":w=`${-N-.3}em`;break}}else i===0?w="0em":i?w=i:(w=0,n.getAttribute("y")==null&&n.setAttribute("y",`${v||"0.8em"}`));b.firstChild.setAttribute("dy",w),n.appendChild(b)}function Ki(n,e={}){const t=document.createElement("canvas").getContext("2d");if(!n)return{width:0};const s=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return s.push(e["font-style"]||"normal"),s.push(e["font-variant"]||"normal"),s.push(e["font-weight"]||400),s.push(r),s.push(e["font-family"]||"sans-serif"),t.font=s.join(" "),t.measureText(n)}function Cy(n,e,t,s={}){if(e>=t)return[n,""];const r=n.length,i={};let o=Math.round(e/t*r-1);for(o<0&&(o=0);o>=0&&o<r;){const a=n.slice(0,o),c=i[a]||Ki(a,s).width,u=n.slice(0,o+1),d=i[u]||Ki(u,s).width;if(i[a]=c,i[u]=d,c>e)o-=1;else if(d<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function Sy(n,e,t={},s={}){const r=e.width,i=e.height,o=s.eol||`
36
- `,a=t.fontSize||14,c=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(a*1.4),u=Math.floor(i/c);if(n.indexOf(o)>-1){const y=Fa(),b=[];return n.split(o).map(w=>{const x=Sy(w,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),t,Object.assign(Object.assign({},s),{eol:y}));x&&b.push(...x.split(y))}),b.slice(0,u).join(o)}const{width:d}=Ki(n,t);if(d<r)return n;const h=[];let f=n,p=d,g=s.ellipsis,m=0;g&&(typeof g!="string"&&(g="…"),m=Ki(g,t).width);for(let y=0;y<u;y+=1)if(p>r)if(y===u-1){const[w]=Cy(f,r-m,p,t);h.push(g?`${w}${g}`:w)}else{const[w,x]=Cy(f,r,p,t);h.push(w),f=x,p=Ki(f,t).width}else{h.push(f);break}return h.join(o)}const Fu=.551784;function ct(n,e,t=NaN){const s=n.getAttribute(e);if(s==null)return t;const r=parseFloat(s);return Number.isNaN(r)?t:r}function TR(n,e=1){const t=n.getTotalLength(),s=[];let r=0,i;for(;r<t;)i=n.getPointAtLength(r),s.push({distance:r,x:i.x,y:i.y}),r+=e;return s}function _R(n){return["M",ct(n,"x1"),ct(n,"y1"),"L",ct(n,"x2"),ct(n,"y2")].join(" ")}function kR(n){const e=Wa(n);return e.length===0?null:`${Ey(e)} Z`}function DR(n){const e=Wa(n);return e.length===0?null:Ey(e)}function Ey(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function Wa(n){const e=[],t=n.points;if(t)for(let s=0,r=t.numberOfItems;s<r;s+=1)e.push(t.getItem(s));return e}function RR(n){const e=ct(n,"cx",0),t=ct(n,"cy",0),s=ct(n,"r"),r=s*Fu;return["M",e,t-s,"C",e+r,t-s,e+s,t-r,e+s,t,"C",e+s,t+r,e+r,t+s,e,t+s,"C",e-r,t+s,e-s,t+r,e-s,t,"C",e-s,t-r,e-r,t-s,e,t-s,"Z"].join(" ")}function LR(n){const e=ct(n,"cx",0),t=ct(n,"cy",0),s=ct(n,"rx"),r=ct(n,"ry")||s,i=s*Fu,o=r*Fu;return["M",e,t-r,"C",e+i,t-r,e+s,t-o,e+s,t,"C",e+s,t+o,e+i,t+r,e,t+r,"C",e-i,t+r,e-s,t+o,e-s,t,"C",e-s,t-o,e-i,t-r,e,t-r,"Z"].join(" ")}function IR(n){return Oy({x:ct(n,"x",0),y:ct(n,"y",0),width:ct(n,"width",0),height:ct(n,"height",0),rx:ct(n,"rx",0),ry:ct(n,"ry",0)})}function Oy(n){let e;const t=n.x,s=n.y,r=n.width,i=n.height,o=Math.min(n.rx||n["top-rx"]||0,r/2),a=Math.min(n.rx||n["bottom-rx"]||0,r/2),c=Math.min(n.ry||n["top-ry"]||0,i/2),u=Math.min(n.ry||n["bottom-ry"]||0,i/2);return o||a||c||u?e=["M",t,s+c,"v",i-c-u,"a",a,u,0,0,0,a,u,"h",r-2*a,"a",a,u,0,0,0,a,-u,"v",-(i-u-c),"a",o,c,0,0,0,-o,-c,"h",-(r-2*o),"a",o,c,0,0,0,-o,c,"Z"]:e=["M",t,s,"H",t+r,"V",s+i,"H",t,"V",s,"Z"],e.join(" ")}function VR(n){const e=dn("path");fe(e,fe(n));const t=My(n);return t&&e.setAttribute("d",t),e}function My(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return _R(n);case"polygon":return kR(n);case"polyline":return DR(n);case"ellipse":return LR(n);case"circle":return RR(n);case"rect":return IR(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const BR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Py=/[ ,]+/,jR=/^(\w+)\((.*)\)/;function $R(n,e){const s=dn("svg").createSVGPoint();return s.x=n,s.y=e,s}function rt(n){const t=dn("svg").createSVGMatrix();if(n!=null){const s=n,r=t;for(const i in s)r[i]=s[i]}return t}function Zi(n){const e=dn("svg");return n!=null?(n instanceof DOMMatrix||(n=rt(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function Qi(n){let e=rt();const t=n!=null&&n.match(BR);if(!t)return e;for(let s=0,r=t.length;s<r;s+=1){const o=t[s].match(jR);if(o){let a,c,u,d,h,f=rt();const p=o[2].split(Py);switch(o[1].toLowerCase()){case"scale":a=parseFloat(p[0]),c=p[1]===void 0?a:parseFloat(p[1]),f=f.scaleNonUniform(a,c);break;case"translate":u=parseFloat(p[0]),d=parseFloat(p[1]),f=f.translate(u,d);break;case"rotate":h=parseFloat(p[0]),u=parseFloat(p[1])||0,d=parseFloat(p[2])||0,u!==0||d!==0?f=f.translate(u,d).rotate(h).translate(-u,-d):f=f.rotate(h);break;case"skewx":h=parseFloat(p[0]),f=f.skewX(h);break;case"skewy":h=parseFloat(p[0]),f=f.skewY(h);break;case"matrix":f.a=parseFloat(p[0]),f.b=parseFloat(p[1]),f.c=parseFloat(p[2]),f.d=parseFloat(p[3]),f.e=parseFloat(p[4]),f.f=parseFloat(p[5]);break;default:continue}e=e.multiply(f)}}return e}function jr(n){const e=n||{},t=e.a!=null?e.a:1,s=e.b!=null?e.b:0,r=e.c!=null?e.c:0,i=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${s},${r},${i},${o},${a})`}function qa(n){let e,t,s;if(n){const i=Py;if(n.trim().indexOf("matrix")>=0){const o=Qi(n),a=zR(o);e=[a.translateX,a.translateY],t=[a.rotation],s=[a.scaleX,a.scaleY];const c=[];(e[0]!==0||e[1]!==0)&&c.push(`translate(${e.join(",")})`),(s[0]!==1||s[1]!==1)&&c.push(`scale(${s.join(",")})`),t[0]!==0&&c.push(`rotate(${t[0]})`),n=c.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(i));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(i));const c=n.match(/scale\((.*?)\)/);c&&(s=c[1].split(i))}}const r=s&&s[0]?parseFloat(s[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:r,sy:s&&s[1]?parseFloat(s[1]):r}}}function Uu(n,e){const t=e.x*n.a+e.y*n.c+0,s=e.x*n.b+e.y*n.d+0;return{x:t,y:s}}function zR(n){const e=Uu(n,{x:0,y:1}),t=Uu(n,{x:1,y:0}),s=180/Math.PI*Math.atan2(e.y,e.x)-90,r=180/Math.PI*Math.atan2(t.y,t.x);return{skewX:s,skewY:r,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:s}}function FR(n){let e,t,s,r;return n?(e=n.a==null?1:n.a,r=n.d==null?1:n.d,t=n.b,s=n.c):e=r=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:s?Math.sqrt(s*s+r*r):r}}function UR(n){let e={x:0,y:1};n&&(e=Uu(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function HR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function $r(n,e,t={}){if(e==null)return Qi(fe(n,"transform"));if(t.absolute){n.setAttribute("transform",jr(e));return}const s=n.transform,r=Zi(e);s.baseVal.appendItem(r)}function Ay(n,e,t=0,s={}){let r=fe(n,"transform");const i=qa(r);if(e==null)return i.translation;r=i.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=s.absolute?e:i.translation.tx+e,a=s.absolute?t:i.translation.ty+t,c=`translate(${o},${a})`;n.setAttribute("transform",`${c} ${r}`.trim())}function Hu(n,e,t,s,r={}){let i=fe(n,"transform");const o=qa(i);if(e==null)return o.rotation;i=o.raw,i=i.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=r.absolute?e:o.rotation.angle+e,c=t!=null&&s!=null?`,${t},${s}`:"",u=`rotate(${a}${c})`;n.setAttribute("transform",`${i} ${u}`.trim())}function Gu(n,e,t){let s=fe(n,"transform");const r=qa(s);if(e==null)return r.scale;t=t??e,s=r.raw,s=s.replace(/scale\([^)]*\)/g,"").trim();const i=`scale(${e},${t})`;n.setAttribute("transform",`${s} ${i}`.trim())}function eo(n,e){if(bs(e)&&bs(n)){const t=e.getScreenCTM(),s=n.getScreenCTM();if(t&&s)return t.inverse().multiply(s)}return rt()}function GR(n,e){let t=rt();if(bs(e)&&bs(n)){let s=n;const r=[];for(;s&&s!==e;){const i=s.getAttribute("transform")||null,o=Qi(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{t=t.multiply(i)})}return t}function YR(n,e,t){const s=n instanceof SVGSVGElement?n:n.ownerSVGElement,r=s.createSVGPoint();r.x=e,r.y=t;try{const i=s.getScreenCTM(),o=r.matrixTransform(i.inverse()),a=eo(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var Ut;(function(n){const e={};function t(i){return e[i]||{}}n.get=t;function s(i,o){e[i]=o}n.register=s;function r(i){delete e[i]}n.unregister=r})(Ut||(Ut={}));var Zs;(function(n){const e=new WeakMap;function t(i){return e.has(i)||e.set(i,{events:Object.create(null)}),e.get(i)}n.ensure=t;function s(i){return e.get(i)}n.get=s;function r(i){return e.delete(i)}n.remove=r})(Zs||(Zs={}));var ce;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(r){r.stopPropagation()}n.stopPropagationCallback=e;function t(r,i,o){r.addEventListener!=null&&r.addEventListener(i,o)}n.addEventListener=t;function s(r,i,o){r.removeEventListener!=null&&r.removeEventListener(i,o)}n.removeEventListener=s})(ce||(ce={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function s(a){return(a||"").match(e)||[""]}n.splitType=s;function r(a){const c=t.exec(a)||[];return{originType:c[1]?c[1].trim():c[1],namespaces:c[2]?c[2].split(".").map(u=>u.trim()).sort():[]}}n.normalizeType=r;function i(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=i;function o(a,c){if(c){const u=a;return u.querySelector!=null&&u.querySelector(c)!=null}return!0}n.isValidSelector=o}(ce||(ce={})),function(n){let e=0;const t=new WeakMap;function s(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=s;function r(a){return t.get(a)}n.getHandlerId=r;function i(a){return t.delete(a)}n.removeHandlerId=i;function o(a,c){return t.set(a,c)}n.setHandlerId=o}(ce||(ce={})),function(n){function e(t,s){const r=[],i=Zs.get(t),o=i&&i.events&&i.events[s.type],a=o&&o.handlers||[],c=o?o.delegateCount:0;if(c>0&&!(s.type==="click"&&typeof s.button=="number"&&s.button>=1)){for(let u=s.target;u!==t;u=u.parentNode||t)if(u.nodeType===1&&!(s.type==="click"&&u.disabled===!0)){const d=[],h={};for(let f=0;f<c;f+=1){const p=a[f],g=p.selector;if(g!=null&&h[g]==null){const m=t,y=[];m.querySelectorAll(g).forEach(b=>{y.push(b)}),h[g]=y.includes(u)}h[g]&&d.push(p)}d.length&&r.push({elem:u,handlers:d})}}return c<a.length&&r.push({elem:t,handlers:a.slice(c)}),r}n.getHandlerQueue=e}(ce||(ce={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ce||(ce={})),function(n){function e(t,s){const r=t.nodeType===9?t.documentElement:t,i=s&&s.parentNode;return t===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):t.compareDocumentPosition&&t.compareDocumentPosition(i)&16))}n.contains=e}(ce||(ce={}));class Mn{constructor(e,t){this.isDefaultPrevented=ce.returnFalse,this.isPropagationStopped=ce.returnFalse,this.isImmediatePropagationStopped=ce.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=ce.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ce.returnTrue:ce.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Mn||(Mn={})),function(n){function e(t,s){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof s=="function"?function(){if(this.originalEvent)return s(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(r){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:r})}})}n.addProperty=e}(Mn||(Mn={})),function(n){const e={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(e).forEach(t=>n.addProperty(t,e[t]))}(Mn||(Mn={})),function(n){Ut.register("load",{noBubble:!0})}(),function(n){Ut.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){Ut.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseover"),s}}),Ut.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseout"),s}})}();var WR=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},to;(function(n){let e;function t(o,a,c,u,d){if(!ce.isValidTarget(o))return;let h;if(typeof c!="function"){const{handler:m,selector:y}=c,b=WR(c,["handler","selector"]);c=m,d=y,h=b}const f=Zs.ensure(o);let p=f.handler;p==null&&(p=f.handler=function(m,...y){return e!==m.type?r(o,m,...y):void 0});const g=ce.ensureHandlerId(c);ce.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=ce.normalizeType(m);if(!y)return;let w=y,x=Ut.get(w);w=(d?x.delegateType:x.bindType)||w,x=Ut.get(w);const v=Object.assign({type:w,originType:y,data:u,selector:d,guid:g,handler:c,namespace:b.join(".")},h),S=f.events;let E=S[w];E||(E=S[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,p)===!1)&&ce.addEventListener(o,w,p)),x.add&&(ce.removeHandlerId(v.handler),x.add(o,v),ce.setHandlerId(v.handler,g)),d?(E.handlers.splice(E.delegateCount,0,v),E.delegateCount+=1):E.handlers.push(v)})}n.on=t;function s(o,a,c,u,d){const h=Zs.get(o);if(!h)return;const f=h.events;f&&(ce.splitType(a).forEach(p=>{const{originType:g,namespaces:m}=ce.normalizeType(p);if(!g){Object.keys(f).forEach(S=>{s(o,S+p,c,u,!0)});return}let y=g;const b=Ut.get(y);y=(u?b.delegateType:b.bindType)||y;const w=f[y];if(!w)return;const x=m.length>0?new RegExp(`(^|\\.)${m.join("\\.(?:.*\\.|)")}(\\.|$)`):null,v=w.handlers.length;for(let S=w.handlers.length-1;S>=0;S-=1){const E=w.handlers[S];(d||g===E.originType)&&(!c||ce.getHandlerId(c)===E.guid)&&(x==null||E.namespace&&x.test(E.namespace))&&(u==null||u===E.selector||u==="**"&&E.selector)&&(w.handlers.splice(S,1),E.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,E))}v&&w.handlers.length===0&&((!b.teardown||b.teardown(o,m,h.handler)===!1)&&ce.removeEventListener(o,y,h.handler),delete f[y])}),Object.keys(f).length===0&&Zs.remove(o))}n.off=s;function r(o,a,...c){const u=Mn.create(a);u.delegateTarget=o;const d=Ut.get(u.type);if(d.preDispatch&&d.preDispatch(o,u)===!1)return;const h=ce.getHandlerQueue(o,u);for(let f=0,p=h.length;f<p&&!u.isPropagationStopped();f+=1){const g=h[f];u.currentTarget=g.elem;for(let m=0,y=g.handlers.length;m<y&&!u.isImmediatePropagationStopped();m+=1){const b=g.handlers[m];if(u.rnamespace==null||b.namespace&&u.rnamespace.test(b.namespace)){u.handleObj=b,u.data=b.data;const w=Ut.get(b.originType).handle,x=w?w(g.elem,u,...c):b.handler.call(g.elem,u,...c);x!==void 0&&(u.result=x,x===!1&&(u.preventDefault(),u.stopPropagation()))}}}return d.postDispatch&&d.postDispatch(o,u),u.result}n.dispatch=r;function i(o,a,c,u){let d=o,h=typeof o=="string"?o:o.type,f=typeof o=="string"||d.namespace==null?[]:d.namespace.split(".");const p=c;if(p.nodeType===3||p.nodeType===8)return;h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort());const g=h.indexOf(":")<0&&`on${h}`;d=o instanceof Mn?o:new Mn(h,typeof o=="object"?o:null),d.namespace=f.join("."),d.rnamespace=d.namespace?new RegExp(`(^|\\.)${f.join("\\.(?:.*\\.|)")}(\\.|$)`):null,d.result=void 0,d.target||(d.target=p);const m=[d];Array.isArray(a)?m.push(...a):m.push(a);const y=Ut.get(h);if(!u&&y.trigger&&y.trigger(p,d,a)===!1)return;let b;const w=[p];if(!u&&!y.noBubble&&!ce.isWindow(p)){b=y.delegateType||h;let v=p,S=p.parentNode;for(;S!=null;)w.push(S),v=S,S=S.parentNode;const E=p.ownerDocument||document;if(v===E){const C=v.defaultView||v.parentWindow||window;w.push(C)}}let x=p;for(let v=0,S=w.length;v<S&&!d.isPropagationStopped();v+=1){const E=w[v];x=E,d.type=v>1?b:y.bindType||h;const C=Zs.get(E);C&&C.events[d.type]&&C.handler&&C.handler.call(E,...m);const M=g&&E[g]||null;M&&ce.isValidTarget(E)&&(d.result=M.call(E,...m),d.result===!1&&d.preventDefault())}if(d.type=h,!u&&!d.isDefaultPrevented()){const v=y.preventDefault;if((v==null||v(w.pop(),d,a)===!1)&&ce.isValidTarget(p)&&g&&typeof p[h]=="function"&&!ce.isWindow(p)){const S=p[g];S&&(p[g]=null),e=h,d.isPropagationStopped()&&x.addEventListener(h,ce.stopPropagationCallback),p[h](),d.isPropagationStopped()&&x.removeEventListener(h,ce.stopPropagationCallback),e=void 0,S&&(p[g]=S)}}return d.result}n.trigger=i})(to||(to={}));var ut;(function(n){function e(i,o,a,c,u){return no.on(i,o,a,c,u),i}n.on=e;function t(i,o,a,c,u){return no.on(i,o,a,c,u,!0),i}n.once=t;function s(i,o,a,c){return no.off(i,o,a,c),i}n.off=s;function r(i,o,a,c){return to.trigger(o,a,i,c),i}n.trigger=r})(ut||(ut={}));var no;(function(n){function e(s,r,i,o,a,c){if(typeof r=="object"){typeof i!="string"&&(o=o||i,i=void 0),Object.keys(r).forEach(u=>e(s,u,i,o,r[u],c));return}if(o==null&&a==null?(a=i,o=i=void 0):a==null&&(typeof i=="string"?(a=o,o=void 0):(a=o,o=i,i=void 0)),a===!1)a=ce.returnFalse;else if(!a)return;if(c){const u=a;a=function(d,...h){return n.off(s,d),u.call(this,d,...h)},ce.setHandlerId(a,ce.ensureHandlerId(u))}to.on(s,r,a,o,i)}n.on=e;function t(s,r,i,o){const a=r;if(a&&a.preventDefault!=null&&a.handleObj!=null){const c=a.handleObj;t(a.delegateTarget,c.namespace?`${c.originType}.${c.namespace}`:c.originType,c.selector,c.handler);return}if(typeof r=="object"){const c=r;Object.keys(c).forEach(u=>t(s,u,i,c[u]));return}(i===!1||typeof i=="function")&&(o=i,i=void 0),o===!1&&(o=ce.returnFalse),to.off(s,r,o,i)}n.off=t})(no||(no={}));class Ny{constructor(e,t,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=ys.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=s,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Yu(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function qR(n){return n.getBoundingClientRect().width}function JR(n){return n.getBoundingClientRect().height}function Ty(n,e=60){let t=null;return(...s)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,s)},e)}}function XR(n){let e=null,t=[];const s=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const c=document.createElement("object");return c.onload=()=>{c.contentDocument.defaultView.addEventListener("resize",r),r()},c.style.display="block",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.height="100%",c.style.width="100%",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="-1",c.style.opacity="0",c.setAttribute("tabindex","-1"),c.type="text/html",n.appendChild(c),c.data="about:blank",c},r=Ty(()=>{t.forEach(c=>c(n))}),i=c=>{e||(e=s()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}function KR(n){let e=null,t=[];const s=Ty(()=>{t.forEach(c=>{c(n)})}),r=()=>{const c=new ResizeObserver(s);return c.observe(n),s(),c},i=c=>{e||(e=r()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}const ZR=typeof ResizeObserver<"u"?KR:XR;var Ja;(function(n){const e=new WeakMap;function t(r){let i=e.get(r);return i||(i=ZR(r),e.set(r,i),i)}function s(r){r.destroy(),e.delete(r.element)}n.bind=(r,i)=>{const o=t(r);return o.bind(i),()=>o.unbind(i)},n.clear=r=>{const i=t(r);s(i)}})(Ja||(Ja={}));class so{constructor(e={}){this.comparator=e.comparator||so.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,s){const r={priority:e,value:t},i=this.data.length;return s&&(r.id=s,this.index[s]=i),this.data.push(r),this.bubbleUp(i),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){const s=this.index[e];if(typeof s>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const r=this.data,i=r[s].priority,o=this.comparator(t,i);o<0?(r[s].priority=t,this.bubbleUp(s)):o>0&&(r[s].priority=t,this.bubbleDown(s))}remove(){const e=this.data,t=e[0],s=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=s,s.id&&(this.index[s.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let s,r,i=e;for(;i>0&&(r=i-1>>>1,this.comparator(t[i].priority,t[r].priority)<0);){s=t[r],t[r]=t[i];let o=t[i].id;o!=null&&(this.index[o]=r),t[i]=s,o=t[i].id,o!=null&&(this.index[o]=i),i=r}}bubbleDown(e){const t=this.data,s=t.length-1;let r=e;for(;;){const i=(r<<1)+1,o=i+1;let a=r;if(i<=s&&this.comparator(t[i].priority,t[a].priority)<0&&(a=i),o<=s&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==r){const c=t[a];t[a]=t[r];let u=t[r].id;u!=null&&(this.index[u]=a),t[r]=c,u=t[r].id,u!=null&&(this.index[u]=r),r=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(so||(so={}));var Wu;(function(n){function e(t,s,r=(i,o)=>1){const i={},o={},a={},c=new so;for(i[s]=0,Object.keys(t).forEach(u=>{u!==s&&(i[u]=1/0),c.insert(i[u],u,u)});!c.isEmpty();){const u=c.remove();a[u]=!0;const d=t[u]||[];for(let h=0;h<d.length;h+=1){const f=d[h];if(!a[f]){const p=i[u]+r(u,f);p<i[f]&&(i[f]=p,o[f]=u,c.updatePriority(f,p))}}}return o}n.run=e})(Wu||(Wu={}));class Jn{constructor(e,t,s,r){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,s,r);if(typeof e=="string")return Jn.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,s){this.set(e.r+(t.r-e.r)*s,e.g+(t.g-e.g)*s,e.b+(t.b-e.b)*s,e.a+(t.a-e.a)*s)}lighten(e){const t=Jn.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,s,r){const i=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:s,c=Array.isArray(e)?e[3]:r;return this.r=Math.round(wt(i,0,255)),this.g=Math.round(wt(o,0,255)),this.b=Math.round(wt(a,0,255)),this.a=c==null?1:wt(c,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const s=this[t].toString(16);return s.length<2?`0${s}`:s}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Jn.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return Jn.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function e(x){return new n(x)}n.fromArray=e;function t(x){return new n([...g(x),1])}n.fromHex=t;function s(x){const v=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(v){const S=v[1].split(/\s*,\s*/).map(E=>parseInt(E,10));return new n(S)}return null}n.fromRGBA=s;function r(x,v,S){S<0&&++S,S>1&&--S;const E=6*S;return E<1?x+(v-x)*E:2*S<1?v:3*S<2?x+(v-x)*(2/3-S)*6:x}function i(x){const v=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(v){const S=v[2].split(/\s*,\s*/),E=(parseFloat(S[0])%360+360)%360/360,C=parseFloat(S[1])/100,M=parseFloat(S[2])/100,N=S[3]==null?1:parseInt(S[3],10);return new n(u(E,C,M,N))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return t(x);if(x.startsWith("rgb"))return s(x);const v=n.named[x];return v?t(v):i(x)}n.fromString=o;function a(x,v){return n.fromArray([x,x,x,v])}n.makeGrey=a;function c(x,v,S,E){const C=Array.isArray(x)?x[0]:x,M=Array.isArray(x)?x[1]:v,N=Array.isArray(x)?x[2]:S,_=Array.isArray(x)?x[3]:E,T=Math.max(C,M,N),k=Math.min(C,M,N),R=(T+k)/2;let V=0,A=0;if(k!==T){const P=T-k;switch(A=R>.5?P/(2-T-k):P/(T+k),T){case C:V=(M-N)/P+(M<N?6:0);break;case M:V=(N-C)/P+2;break;case N:V=(C-M)/P+4;break}V/=6}return[V,A,R,_??1]}n.rgba2hsla=c;function u(x,v,S,E){const C=Array.isArray(x)?x[0]:x,M=Array.isArray(x)?x[1]:v,N=Array.isArray(x)?x[2]:S,_=Array.isArray(x)?x[3]:E,T=N<=.5?N*(M+1):N+M-N*M,k=2*N-T;return[r(k,T,C+1/3)*256,r(k,T,C)*256,r(k,T,C-1/3)*256,_??1]}n.hsla2rgba=u;function d(x){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),x?void 0:parseFloat(Math.random().toFixed(2)))}n.random=d;function h(){const x="0123456789ABCDEF";let v="#";for(let S=0;S<6;S+=1)v+=x[Math.floor(Math.random()*16)];return v}n.randomHex=h;function f(x){return d(x).toString()}n.randomRGBA=f;function p(x,v){if(typeof x=="string"){const N=x[0]==="#",[_,T,k]=g(x);return v?_*.299+T*.587+k*.114>186?"#000000":"#ffffff":`${N?"#":""}${m(255-_,255-T,255-k)}`}const S=x[0],E=x[1],C=x[2],M=x[3];return v?S*.299+E*.587+C*.114>186?[0,0,0,M]:[255,255,255,M]:[255-S,255-E,255-C,M]}n.invert=p;function g(x){const v=x.indexOf("#")===0?x:`#${x}`;let S=+`0x${v.substr(1)}`;if(!(v.length===4||v.length===7)||Number.isNaN(S))throw new Error("Invalid hex color.");const E=v.length===4?4:8,C=(1<<E)-1,M=["b","g","r"].map(()=>{const N=S&C;return S>>=E,E===4?17*N:N});return[M[2],M[1],M[0]]}function m(x,v,S){const E=C=>C.length<2?`0${C}`:C;return`${E(x.toString(16))}${E(v.toString(16))}${E(S.toString(16))}`}function y(x,v){return w(x,v)}n.lighten=y;function b(x,v){return w(x,-v)}n.darken=b;function w(x,v){if(typeof x=="string"){const C=x[0]==="#",M=parseInt(C?x.substr(1):x,16),N=wt((M>>16)+v,0,255),_=wt((M>>8&255)+v,0,255),T=wt((M&255)+v,0,255);return`${C?"#":""}${(T|_<<8|N<<16).toString(16)}`}const S=m(x[0],x[1],x[2]),E=g(w(S,v));return[E[0],E[1],E[2],x[3]]}})(Jn||(Jn={})),function(n){n.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(Jn||(Jn={}));class qu{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const s=this.map.get(e);return this.map.delete(e),s}each(e){this.arr.forEach(t=>{const s=this.map.get(t);e(s,t)})}dispose(){this.clear()}}var xs;(function(n){function e(r){const i=[],o=[];return Array.isArray(r)?i.push(...r):r.split("|").forEach(a=>{a.indexOf("&")===-1?i.push(a):o.push(...a.split("&"))}),{or:i,and:o}}n.parse=e;function t(r,i){if(r!=null&&i!=null){const o=e(r),a=e(i),c=o.or.sort(),u=a.or.sort(),d=o.and.sort(),h=a.and.sort(),f=(p,g)=>p.length===g.length&&(p.length===0||p.every((m,y)=>m===g[y]));return f(c,u)&&f(d,h)}return r==null&&i==null}n.equals=t;function s(r,i,o){if(i==null||Array.isArray(i)&&i.length===0)return o?r.altKey!==!0&&r.ctrlKey!==!0&&r.metaKey!==!0&&r.shiftKey!==!0:!0;const{or:a,and:c}=e(i),u=d=>{const h=`${d.toLowerCase()}Key`;return r[h]===!0};return a.some(d=>u(d))&&c.every(d=>u(d))}n.isMatch=s})(xs||(xs={}));var Qs;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,s=t*e;return 4*(e<.5?s:3*(e-t)+s-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,s=1;;t+=s,s/=2)if(e>=(7-4*t)/11){const r=(11-6*t-11*e)/4;return-r*r+s*s}}})(Qs||(Qs={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,s=1){return r=>{const i=e(r);return i<t?t:i>s?s:i}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(Qs||(Qs={})),function(n){function e(A){return-1*Math.cos(A*(Math.PI/2))+1}n.easeInSine=e;function t(A){return Math.sin(A*(Math.PI/2))}n.easeOutSine=t;function s(A){return-.5*(Math.cos(Math.PI*A)-1)}n.easeInOutSine=s;function r(A){return A*A}n.easeInQuad=r;function i(A){return A*(2-A)}n.easeOutQuad=i;function o(A){return A<.5?2*A*A:-1+(4-2*A)*A}n.easeInOutQuad=o;function a(A){return A*A*A}n.easeInCubic=a;function c(A){const P=A-1;return P*P*P+1}n.easeOutCubic=c;function u(A){return A<.5?4*A*A*A:(A-1)*(2*A-2)*(2*A-2)+1}n.easeInOutCubic=u;function d(A){return A*A*A*A}n.easeInQuart=d;function h(A){const P=A-1;return 1-P*P*P*P}n.easeOutQuart=h;function f(A){const P=A-1;return A<.5?8*A*A*A*A:1-8*P*P*P*P}n.easeInOutQuart=f;function p(A){return A*A*A*A*A}n.easeInQuint=p;function g(A){const P=A-1;return 1+P*P*P*P*P}n.easeOutQuint=g;function m(A){const P=A-1;return A<.5?16*A*A*A*A*A:1+16*P*P*P*P*P}n.easeInOutQuint=m;function y(A){return A===0?0:Math.pow(2,10*(A-1))}n.easeInExpo=y;function b(A){return A===1?1:-Math.pow(2,-10*A)+1}n.easeOutExpo=b;function w(A){if(A===0||A===1)return A;const P=A*2,j=P-1;return P<1?.5*Math.pow(2,10*j):.5*(-Math.pow(2,-10*j)+2)}n.easeInOutExpo=w;function x(A){const P=A/1;return-1*(Math.sqrt(1-P*A)-1)}n.easeInCirc=x;function v(A){const P=A-1;return Math.sqrt(1-P*P)}n.easeOutCirc=v;function S(A){const P=A*2,j=P-2;return P<1?-.5*(Math.sqrt(1-P*P)-1):.5*(Math.sqrt(1-j*j)+1)}n.easeInOutCirc=S;function E(A,P=1.70158){return A*A*((P+1)*A-P)}n.easeInBack=E;function C(A,P=1.70158){const j=A/1-1;return j*j*((P+1)*j+P)+1}n.easeOutBack=C;function M(A,P=1.70158){const j=A*2,z=j-2,Y=P*1.525;return j<1?.5*j*j*((Y+1)*j-Y):.5*(z*z*((Y+1)*z+Y)+2)}n.easeInOutBack=M;function N(A,P=.7){if(A===0||A===1)return A;const z=A/1-1,Y=1-P,le=Y/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*z)*Math.sin((z-le)*(2*Math.PI)/Y))}n.easeInElastic=N;function _(A,P=.7){const j=1-P,z=A*2;if(A===0||A===1)return A;const Y=j/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*z)*Math.sin((z-Y)*(2*Math.PI)/j)+1}n.easeOutElastic=_;function T(A,P=.65){const j=1-P;if(A===0||A===1)return A;const z=A*2,Y=z-1,le=j/(2*Math.PI)*Math.asin(1);return z<1?-.5*(Math.pow(2,10*Y)*Math.sin((Y-le)*(2*Math.PI)/j)):Math.pow(2,-10*Y)*Math.sin((Y-le)*(2*Math.PI)/j)*.5+1}n.easeInOutElastic=T;function k(A){const P=A/1;if(P<1/2.75)return 7.5625*P*P;if(P<2/2.75){const j=P-.5454545454545454;return 7.5625*j*j+.75}if(P<2.5/2.75){const j=P-.8181818181818182;return 7.5625*j*j+.9375}{const j=P-.9545454545454546;return 7.5625*j*j+.984375}}n.easeOutBounce=k;function R(A){return 1-k(1-A)}n.easeInBounce=R;function V(A){return A<.5?R(A*2)*.5:k(A*2-1)*.5+.5}n.easeInOutBounce=V}(Qs||(Qs={}));var er;(function(n){n.number=(e,t)=>{const s=t-e;return r=>e+s*r},n.object=(e,t)=>{const s=Object.keys(e);return r=>{const i={};for(let o=s.length-1;o!==-1;o-=1){const a=s[o];i[a]=e[a]+(t[a]-e[a])*r}return i}},n.unit=(e,t)=>{const s=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=s.exec(e),i=s.exec(t),o=i?i[1]:"",a=r?+r[1]:0,c=i?+i[1]:0,u=o.indexOf("."),d=u>0?o[1].length-u-1:0,h=c-a,f=r?r[2]:"";return p=>(a+h*p).toFixed(d)+f},n.color=(e,t)=>{const s=parseInt(e.slice(1),16),r=parseInt(t.slice(1),16),i=s&255,o=(r&255)-i,a=s&65280,c=(r&65280)-a,u=s&16711680,d=(r&16711680)-u;return h=>{const f=i+o*h&255,p=a+c*h&65280,g=u+d*h&16711680;return`#${(1<<24|f|p|g).toString(16).slice(1)}`}}})(er||(er={}));const ro=[];function zr(n,e){const t=ro.find(s=>s.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!ys.isApplyingHMR()){const s=document.createElement("style");s.setAttribute("type","text/css"),s.textContent=e;const r=document.querySelector("head");r&&r.insertBefore(s,r.firstChild),ro.push({name:n,loadTimes:1,styleElement:s})}}function Fr(n){const e=ro.findIndex(t=>t.name===n);if(e>-1){const t=ro[e];if(t.loadTimes-=1,t.loadTimes>0)return;let s=t.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,ro.splice(e,1)}}var me;(function(n){function e(s){return 180*s/Math.PI%360}n.toDeg=e,n.toRad=function(s,r=!1){return(r?s:s%360)*Math.PI/180};function t(s){return s%360+(s<0?360:0)}n.normalize=t})(me||(me={}));var ve;(function(n){function e(a,c=0){return Number.isInteger(a)?a:+a.toFixed(c)}n.round=e;function t(a,c){let u,d;if(c==null?(d=a??1,u=0):(d=c,u=a??0),d<u){const h=u;u=d,d=h}return Math.floor(Math.random()*(d-u+1)+u)}n.random=t;function s(a,c,u){return Number.isNaN(a)?NaN:Number.isNaN(c)||Number.isNaN(u)?0:c<u?a<c?c:a>u?u:a:a<u?u:a>c?c:a}n.clamp=s;function r(a,c){return c*Math.round(a/c)}n.snapToGrid=r;function i(a,c){return c!=null&&a!=null&&c.x>=a.x&&c.x<=a.x+a.width&&c.y>=a.y&&c.y<=a.y+a.height}n.containsPoint=i;function o(a,c){const u=a.x-c.x,d=a.y-c.y;return u*u+d*d}n.squaredLength=o})(ve||(ve={}));class vs{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class O extends vs{constructor(e,t){super(),this.x=e??0,this.y=t??0}round(e=0){return this.x=ve.round(this.x,e),this.y=ve.round(this.y,e),this}add(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}update(e,t){const s=O.create(e,t);return this.x=s.x,this.y=s.y,this}translate(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}rotate(e,t){const s=O.rotate(this,e,t);return this.x=s.x,this.y=s.y,this}scale(e,t,s=new O){const r=O.create(s);return this.x=r.x+e*(this.x-r.x),this.y=r.y+t*(this.y-r.y),this}closest(e){if(e.length===1)return O.create(e[0]);let t=null,s=1/0;return e.forEach(r=>{const i=this.squaredDistance(r);i<s&&(t=r,s=i)}),t?O.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=O.create(e),s=this.x-t.x,r=this.y-t.y;return s*s+r*r}manhattanDistance(e){const t=O.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new O){const t=O.create(e),s=-(t.y-this.y),r=t.x-this.x;let i=Math.atan2(s,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let s=this.theta(t)-this.theta(e);return s<0&&(s+=360),s}vectorAngle(e){return new O(0,0).angleBetween(this,e)}toPolar(e){return this.update(O.toPolar(this,e)),this}changeInAngle(e,t,s=new O){return this.clone().translate(-e,-t).theta(s)-this.theta(s)}adhereToRect(e){return ve.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=O.create(e),s=me.toRad(this.y),r=me.toRad(t.y),i=this.x,o=t.x,a=me.toRad(o-i),c=Math.sin(a)*Math.cos(r),u=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(a),d=me.toDeg(Math.atan2(c,u)),h=["NE","E","SE","S","SW","W","NW","N"];let f=d-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),h[f]}cross(e,t){if(e!=null&&t!=null){const s=O.create(e),r=O.create(t);return(r.x-this.x)*(s.y-this.y)-(r.y-this.y)*(s.x-this.x)}return NaN}dot(e){const t=O.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new O(this.x-e,this.y-t);const s=O.create(e);return new O(this.x-s.x,this.y-s.y)}lerp(e,t){const s=O.create(e);return new O((1-t)*this.x+t*s.x,(1-t)*this.y+t*s.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const s=O.create(e),r=me.toRad(s.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return O.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=ve.snapToGrid(this.x,e),this.y=ve.snapToGrid(this.y,t??e),this}equals(e){const t=O.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return O.clone(this)}toJSON(){return O.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(O||(O={})),function(n){function e(s){return s!=null&&typeof s=="object"&&typeof s.x=="number"&&typeof s.y=="number"}n.isPointLike=e;function t(s){return s!=null&&Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"}n.isPointData=t}(O||(O={})),function(n){function e(h,f){return h==null||typeof h=="number"?new n(h,f):t(h)}n.create=e;function t(h){return n.isPoint(h)?new n(h.x,h.y):Array.isArray(h)?new n(h[0],h[1]):new n(h.x,h.y)}n.clone=t;function s(h){return n.isPoint(h)?{x:h.x,y:h.y}:Array.isArray(h)?{x:h[0],y:h[1]}:{x:h.x,y:h.y}}n.toJSON=s;function r(h,f,p=new n){let g=Math.abs(h*Math.cos(f)),m=Math.abs(h*Math.sin(f));const y=t(p),b=me.normalize(me.toDeg(f));return b<90?m=-m:b<180?(g=-g,m=-m):b<270&&(g=-g),new n(y.x+g,y.y+m)}n.fromPolar=r;function i(h,f=new n){const p=t(h),g=t(f),m=p.x-g.x,y=p.y-g.y;return new n(Math.sqrt(m*m+y*y),me.toRad(g.theta(p)))}n.toPolar=i;function o(h,f){return h===f?!0:h!=null&&f!=null?h.x===f.x&&h.y===f.y:!1}n.equals=o;function a(h,f){if(h==null&&f!=null||h!=null&&f==null||h!=null&&f!=null&&h.length!==f.length)return!1;if(h!=null&&f!=null){for(let p=0,g=h.length;p<g;p+=1)if(!o(h[p],f[p]))return!1}return!0}n.equalPoints=a;function c(h,f,p,g){return new n(ve.random(h,f),ve.random(p,g))}n.random=c;function u(h,f,p){const g=me.toRad(me.normalize(-f)),m=Math.sin(g),y=Math.cos(g);return d(h,y,m,p)}n.rotate=u;function d(h,f,p,g=new n){const m=t(h),y=t(g),b=m.x-y.x,w=m.y-y.y,x=b*f-w*p,v=w*f+b*p;return new n(x+y.x,v+y.y)}n.rotateEx=d}(O||(O={}));class U extends vs{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new O(this.x,this.y)}get topLeft(){return new O(this.x,this.y)}get topCenter(){return new O(this.x+this.width/2,this.y)}get topRight(){return new O(this.x+this.width,this.y)}get center(){return new O(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new O(this.x,this.y+this.height)}get bottomCenter(){return new O(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new O(this.x+this.width,this.y+this.height)}get corner(){return new O(this.x+this.width,this.y+this.height)}get rightMiddle(){return new O(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new O(this.x,this.y+this.height/2)}get topLine(){return new q(this.topLeft,this.topRight)}get rightLine(){return new q(this.topRight,this.bottomRight)}get bottomLine(){return new q(this.bottomLeft,this.bottomRight)}get leftLine(){return new q(this.topLeft,this.bottomLeft)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??0,this.width=s??0,this.height=r??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const t=me.toRad(e),s=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),i=this.width*r+this.height*s,o=this.width*s+this.height*r;return new U(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=ve.round(this.x,e),this.y=ve.round(this.y,e),this.width=ve.round(this.width,e),this.height=ve.round(this.height,e),this}add(e,t,s,r){const i=U.create(e,t,s,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),c=Math.max(this.x+this.width,i.x+i.width),u=Math.max(this.y+this.height,i.y+i.height);return this.x=o,this.y=a,this.width=c-o,this.height=u-a,this}update(e,t,s,r){const i=U.create(e,t,s,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(e,t){const s=e,r=t??e;return this.x-=s,this.y-=r,this.width+=2*s,this.height+=2*r,this}snapToGrid(e,t){const s=this.origin.snapToGrid(e,t),r=this.corner.snapToGrid(e,t);return this.x=s.x,this.y=s.y,this.width=r.x-s.x,this.height=r.y-s.y,this}translate(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}scale(e,t,s=new O){const r=this.origin.scale(e,t,s);return this.x=r.x,this.y=r.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const s=me.toRad(e),r=Math.cos(s),i=Math.sin(s);let o=this.getOrigin(),a=this.getTopRight(),c=this.getBottomRight(),u=this.getBottomLeft();o=O.rotateEx(o,r,i,t),a=O.rotateEx(a,r,i,t),c=O.rotateEx(c,r,i,t),u=O.rotateEx(u,r,i,t);const d=new U(o.x,o.y,0,0);d.add(a.x,a.y,0,0),d.add(c.x,c.y,0,0),d.add(u.x,u.y,0,0),this.update(d)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=U.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const s=U.clone(e),r=t.x,i=t.y;let o=1/0,a=1/0,c=1/0,u=1/0,d=1/0,h=1/0,f=1/0,p=1/0;const g=s.topLeft;g.x<r&&(o=(this.x-r)/(g.x-r)),g.y<i&&(d=(this.y-i)/(g.y-i));const m=s.bottomRight;m.x>r&&(a=(this.x+this.width-r)/(m.x-r)),m.y>i&&(h=(this.y+this.height-i)/(m.y-i));const y=s.topRight;y.x>r&&(c=(this.x+this.width-r)/(y.x-r)),y.y<i&&(f=(this.y-i)/(y.y-i));const b=s.bottomLeft;return b.x<r&&(u=(this.x-r)/(b.x-r)),b.y>i&&(p=(this.y+this.height-i)/(b.y-i)),{sx:Math.min(o,a,c,u),sy:Math.min(d,h,f,p)}}getMaxUniformScaleToFit(e,t=this.center){const s=this.getMaxScaleToFit(e,t);return Math.min(s.sx,s.sy)}containsPoint(e,t){return ve.containsPoint(this,O.create(e,t))}containsRect(e,t,s,r){const i=U.create(e,t,s,r),o=this.x,a=this.y,c=this.width,u=this.height,d=i.x,h=i.y,f=i.width,p=i.height;return c===0||u===0||f===0||p===0?!1:d>=o&&h>=a&&d+f<=o+c&&h+p<=a+u}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=[],r=[];return t.forEach(i=>{const o=e.intersectsWithLine(i);o!==null&&r.indexOf(o.toString())<0&&(s.push(o),r.push(o.toString()))}),s.length>0?s:null}intersectsWithLineFromCenterToPoint(e,t){const s=O.clone(e),r=this.center;let i=null;t!=null&&t!==0&&s.rotate(t,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new q(r,s);for(let c=o.length-1;c>=0;c-=1){const u=o[c].intersectsWithLine(a);if(u!==null){i=u;break}}return i&&t!=null&&t!==0&&i.rotate(-t,r),i}intersectsWithRect(e,t,s,r){const i=U.create(e,t,s,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,c=i.origin,u=i.corner,d=Math.max(o.x,c.x),h=Math.max(o.y,c.y);return new U(d,h,Math.min(a.x,u.x)-d,Math.min(a.y,u.y)-h)}isIntersectWithRect(e,t,s,r){const i=U.create(e,t,s,r),o=this.origin,a=this.corner,c=i.origin,u=i.corner;return!(u.x<=o.x||u.y<=o.y||c.x>=a.x||c.y>=a.y)}normalize(){let e=this.x,t=this.y,s=this.width,r=this.height;return this.width<0&&(e=this.x+this.width,s=-this.width),this.height<0&&(t=this.y+this.height,r=-this.height),this.x=e,this.y=t,this.width=s,this.height=r,this}union(e){const t=U.clone(e),s=this.origin,r=this.corner,i=t.origin,o=t.corner,a=Math.min(s.x,i.x),c=Math.min(s.y,i.y),u=Math.max(r.x,o.x),d=Math.max(r.y,o.y);return new U(a,c,u-a,d-c)}getNearestSideToPoint(e){const t=O.clone(e),s=t.x-this.x,r=this.x+this.width-t.x,i=t.y-this.y,o=this.y+this.height-t.y;let a=s,c="left";return r<a&&(a=r,c="right"),i<a&&(a=i,c="top"),o<a&&(c="bottom"),c}getNearestPointToPoint(e){const t=O.clone(e);if(this.containsPoint(t)){const s=this.getNearestSideToPoint(t);if(s==="left")return new O(this.x,t.y);if(s==="top")return new O(t.x,this.y);if(s==="right")return new O(this.x+this.width,t.y);if(s==="bottom")return new O(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new U(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isRectangle=e})(U||(U={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(U||(U={})),function(n){function e(o,a,c,u){return o==null||typeof o=="number"?new n(o,a,c,u):t(o)}n.create=e;function t(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=t;function s(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=s;function r(o){return new n(0,0,o.width,o.height)}n.fromSize=r;function i(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=i}(U||(U={}));class q extends vs{get center(){return new O((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,s,r){super(),typeof e=="number"&&typeof t=="number"?(this.start=new O(e,t),this.end=new O(s,r)):(this.start=O.create(e),this.end=O.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,s){return this.start.scale(e,t,s),this.end.scale(e,t,s),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const s=e/t;return this.scale(s,s,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:s,end:r}=t,i=s.clone().rotate(270,r),o=r.clone().rotate(90,s);return s.move(o,e),r.move(i,e),t}vector(){return new O(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new O(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),s=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new U(e,t,s-e,r-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new q(this.start,e).vector()),s=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(s)?0:s}pointAt(e){const t=this.start,s=this.end;return e<=0?t.clone():e>=1?s.clone():t.lerp(s,e)}pointAtLength(e){const t=this.start,s=this.end;let r=!0;e<0&&(r=!1,e=-e);const i=this.length();if(e>=i)return r?s.clone():t.clone();const o=(r?e:i-e)/i;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new q(this.start,t),new q(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new q(this.start,t),new q(t,this.end)]}containsPoint(e){const t=this.start,s=this.end;if(t.cross(e,s)!==0)return!1;const r=this.length();return!(new q(t,e).length()>r||new q(e,s).length()>r)}intersect(e,t){const s=e.intersectsWithLine(this,t);return s?Array.isArray(s)?s:[s]:null}intersectsWithLine(e){const t=new O(this.end.x-this.start.x,this.end.y-this.start.y),s=new O(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*s.y-t.y*s.x,i=new O(e.start.x-this.start.x,e.start.y-this.start.y),o=i.x*s.y-i.y*s.x,a=i.x*t.y-i.y*t.x;if(r===0||o*r<0||a*r<0)return null;if(r>0){if(o>r||a>r)return null}else if(o<r||a<r)return null;return new O(this.start.x+o*t.x/r,this.start.y+o*t.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=O.clone(e),s=this.start,r=this.end;return((r.x-s.x)*(t.y-s.y)-(r.y-s.y)*(t.x-s.x))/this.length()}pointSquaredDistance(e,t){const s=O.create(e,t);return this.closestPoint(s).squaredDistance(s)}pointDistance(e,t){const s=O.create(e,t);return this.closestPoint(s).distance(s)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAt(e),i=new q(t,s);return i.translate(r.x-t.x,r.y-t.y),i}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAtLength(e),i=new q(t,s);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){const s=O.create(e,t);let r=s.x-this.start.x,i=s.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let c=r*a-i*o;return c===0&&(c=r*o+i*a,c>0&&(r-=o,i-=a,c=r*o+i*a,c<0&&(c=0))),c<0?-1:c>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new q(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isLine=e})(q||(q={}));class hn extends vs{get center(){return new O(this.x,this.y)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??0,this.a=s??0,this.b=r??0}bbox(){return U.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const s=e,r=t??e;return this.a+=2*s,this.b+=2*r,this}normalizedDistance(e,t){const s=O.create(e,t),r=s.x-this.x,i=s.y-this.y,o=this.a,a=this.b;return r*r/(o*o)+i*i/(a*a)}containsPoint(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],s=this.a,r=this.b,i=e.start,o=e.end,a=e.vector(),c=i.diff(new O(this.x,this.y)),u=new O(a.x/(s*s),a.y/(r*r)),d=new O(c.x/(s*s),c.y/(r*r)),h=a.dot(u),f=a.dot(d),p=c.dot(d)-1,g=f*f-h*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-f-m)/h,b=(-f+m)/h;if((y<0||y>1)&&(b<0||b>1))return null;y>=0&&y<=1&&t.push(i.lerp(o,y)),b>=0&&b<=1&&t.push(i.lerp(o,b))}else{const m=-f/h;if(m>=0&&m<=1)t.push(i.lerp(o,m));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const s=O.clone(e);t&&s.rotate(t,this.getCenter());const r=s.x-this.x,i=s.y-this.y;let o;if(r===0)return o=this.bbox().getNearestPointToPoint(s),t?o.rotate(-t,this.getCenter()):o;const a=i/r,c=a*a,u=this.a*this.a,d=this.b*this.b;let h=Math.sqrt(1/(1/u+c/d));h=r<0?-h:h;const f=a*h;return o=new O(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=O.clone(e),s=t.x,r=t.y,i=this.a,o=this.b,a=this.bbox().center,c=a.x,u=a.y,d=30,h=s>a.x+i/2,f=s<a.x-i/2;let p,g;return h||f?(g=s>a.x?r-d:r+d,p=i*i/(s-c)-i*i*(r-u)*(g-u)/(o*o*(s-c))+c):(p=r>a.y?s+d:s-d,g=o*o/(r-u)-o*o*(s-c)*(p-c)/(i*i*(r-u))+u),new O(p,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const s=U.fromEllipse(this);s.rotate(e,t);const r=hn.fromRect(s);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new hn(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isEllipse=e})(hn||(hn={})),function(n){function e(r,i,o,a){return r==null||typeof r=="number"?new n(r,i,o,a):t(r)}n.create=e;function t(r){return n.isEllipse(r)?r.clone():Array.isArray(r)?new n(r[0],r[1],r[2],r[3]):new n(r.x,r.y,r.a,r.b)}n.parse=t;function s(r){const i=r.center;return new n(i.x,i.y,r.width/2,r.height/2)}n.fromRect=s}(hn||(hn={}));const QR=new RegExp("^[\\s\\dLMCZz,.]*$");function eL(n){return typeof n!="string"?!1:QR.test(n)}function Ju(n,e){return(n%e+e)%e}function tL(n,e,t,s,r){const i=[],o=n[n.length-1],a=e!=null&&e>0,c=e||0;if(s&&a){n=n.slice();const h=n[0],f=new O(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2);n.splice(0,0,f)}let u=n[0],d=1;for(t?i.push("M",u.x,u.y):i.push("L",u.x,u.y);d<(s?n.length:n.length-1);){let h=n[Ju(d,n.length)],f=u.x-h.x,p=u.y-h.y;if(a&&(f!==0||p!==0)&&(r==null||r.indexOf(d-1)<0)){let g=Math.sqrt(f*f+p*p);const m=f*Math.min(c,g/2)/g,y=p*Math.min(c,g/2)/g,b=h.x+m,w=h.y+y;i.push("L",b,w);let x=n[Ju(d+1,n.length)];for(;d<n.length-2&&Math.round(x.x-h.x)===0&&Math.round(x.y-h.y)===0;)x=n[Ju(d+2,n.length)],d+=1;f=x.x-h.x,p=x.y-h.y,g=Math.max(1,Math.sqrt(f*f+p*p));const v=f*Math.min(c,g/2)/g,S=p*Math.min(c,g/2)/g,E=h.x+v,C=h.y+S;i.push("Q",h.x,h.y,E,C),h=new O(E,C)}else i.push("L",h.x,h.y);u=h,d+=1}return s?i.push("Z"):i.push("L",o.x,o.y),i.map(h=>typeof h=="string"?h:+h.toFixed(3)).join(" ")}function _y(n,e={}){const t=[];return n&&n.length&&n.forEach(s=>{Array.isArray(s)?t.push({x:s[0],y:s[1]}):t.push({x:s.x,y:s.y})}),tL(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function Xa(n,e,t,s,r=0,i=0,o=0,a,c){if(t===0||s===0)return[];a-=n,c-=e,t=Math.abs(t),s=Math.abs(s);const u=-a/2,d=-c/2,h=Math.cos(r*Math.PI/180),f=Math.sin(r*Math.PI/180),p=h*u+f*d,g=-1*f*u+h*d,m=p*p,y=g*g,b=t*t,w=s*s,x=m/b+y/w;let v;if(x>1)t=Math.sqrt(x)*t,s=Math.sqrt(x)*s,v=0;else{let Z=1;i===o&&(Z=-1),v=Z*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const S=v*t*g/s,E=-1*v*s*p/t,C=h*S-f*E+a/2,M=f*S+h*E+c/2;let N=Math.atan2((g-E)/s,(p-S)/t)-Math.atan2(0,1),_=N>=0?N:2*Math.PI+N;N=Math.atan2((-g-E)/s,(-p-S)/t)-Math.atan2((g-E)/s,(p-S)/t);let T=N>=0?N:2*Math.PI+N;o===0&&T>0?T-=2*Math.PI:o!==0&&T<0&&(T+=2*Math.PI);const k=T*2/Math.PI,R=Math.ceil(k<0?-1*k:k),V=T/R,A=8/3*Math.sin(V/4)*Math.sin(V/4)/Math.sin(V/2),P=h*t,j=h*s,z=f*t,Y=f*s;let le=Math.cos(_),I=Math.sin(_),B=-A*(P*I+Y*le),ne=-A*(z*I-j*le),L=0,G=0;const ie=[];for(let Z=0;Z<R;Z+=1){_+=V,le=Math.cos(_),I=Math.sin(_),L=P*le-Y*I+C,G=z*le+j*I+M;const ae=-A*(P*I+Y*le),He=-A*(z*I-j*le),re=Z*6;ie[re]=Number(B+n),ie[re+1]=Number(ne+e),ie[re+2]=Number(L-ae+n),ie[re+3]=Number(G-He+e),ie[re+4]=Number(L+n),ie[re+5]=Number(G+e),B=L+ae,ne=G+He}return ie.map(Z=>+Z.toFixed(2))}function nL(n,e,t,s,r=0,i=0,o=0,a,c){const u=[],d=Xa(n,e,t,s,r,i,o,a,c);if(d!=null)for(let h=0,f=d.length;h<f;h+=6)u.push("C",d[h],d[h+1],d[h+2],d[h+3],d[h+4],d[h+5]);return u.join(" ")}class $e extends vs{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return $e.parse(e);this.points=e.map(t=>O.create(t))}else this.points=[]}scale(e,t,s=new O){return this.points.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.points.forEach(s=>s.rotate(e,t)),this}translate(e,t){const s=O.create(e,t);return this.points.forEach(r=>r.translate(s.x,s.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new U;let e=1/0,t=-1/0,s=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const c=i[o],u=c.x,d=c.y;u<e&&(e=u),u>t&&(t=u),d<s&&(s=d),d>r&&(r=d)}return new U(e,s,t-e,r-s)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,s=t.length;if(s===0||s===1)return 0;let r=0,i=0,o=1/0;for(let a=0,c=s-1;a<c;a+=1){const u=new q(t[a],t[a+1]),d=u.length(),h=u.closestPointNormalizedLength(e),p=u.pointAt(h).squaredDistance(e);p<o&&(o=p,i=r+h*d),r+=d}return i}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=O.clone(e),s=t.x,r=t.y,i=this.points,o=i.length;let a=o-1,c=0;for(let u=0;u<o;u+=1){const d=i[a],h=i[u];if(t.equals(d))return!0;const f=new q(d,h);if(f.containsPoint(e))return!0;if(r<=d.y&&r>h.y||r>d.y&&r<=h.y){const p=d.x-s>h.x-s?d.x-s:h.x-s;if(p>=0){const g=new O(s+p,r),m=new q(e,g);f.intersectsWithLine(m)&&(c+=1)}}a=u}return c%2===1}intersectsWithLine(e){const t=[];for(let s=0,r=this.points.length-1;s<r;s+=1){const i=this.points[s],o=this.points[s+1],a=e.intersectsWithLine(new q(i,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const s=this.points[e],r=this.points[e+1];if(new q(s,r).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,s=this.points.length-1;t<s;t+=1){const r=this.points[t],i=this.points[t+1];e+=r.distance(i)}return e}pointAt(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1||e<=0)return t[0].clone();if(e>=1)return t[s-1].clone();const i=this.length()*e;return this.pointAtLength(i)}pointAtLength(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1)return t[0].clone();let r=!0;e<0&&(r=!1,e=-e);let i=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],h=t[u+1],f=new q(d,h),p=d.distance(h);if(e<=i+p)return f.pointAtLength((r?1:-1)*(e-i));i+=p}return(r?t[s-1]:t[0]).clone()}tangentAt(e){const s=this.points.length;if(s===0||s===1)return null;e<0&&(e=0),e>1&&(e=1);const i=this.length()*e;return this.tangentAtLength(i)}tangentAtLength(e){const t=this.points,s=t.length;if(s===0||s===1)return null;let r=!0;e<0&&(r=!1,e=-e);let i,o=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],h=t[u+1],f=new q(d,h),p=d.distance(h);if(f.isDifferentiable()){if(e<=o+p)return f.tangentAtLength((r?1:-1)*(e-o));i=f}o+=p}if(i){const a=r?1:0;return i.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const s=e.threshold||0;let r=0;for(;t[r+2];){const i=r,o=r+1,a=r+2,c=t[i],u=t[o],d=t[a];new q(c,d).closestPoint(u).distance(u)<=s?t.splice(o,1):r+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new $e;let s=e[0];for(let f=1;f<t;f+=1)(e[f].y<s.y||e[f].y===s.y&&e[f].x>s.x)&&(s=e[f]);const r=[];for(let f=0;f<t;f+=1){let p=s.theta(e[f]);p===0&&(p=360),r.push([e[f],f,p])}if(r.sort((f,p)=>{let g=f[2]-p[2];return g===0&&(g=p[1]-f[1]),g}),r.length>2){const f=r[r.length-1];r.unshift(f)}const i={},o=[],a=f=>`${f[0].toString()}@${f[1]}`;for(;r.length!==0;){const f=r.pop(),p=f[0];if(i[a(f)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(f),g=!0;else{const m=o.pop(),y=m[0],b=o.pop(),w=b[0],x=w.cross(y,p);if(x<0)o.push(b),o.push(m),o.push(f),g=!0;else if(x===0){const S=y.angleBetween(w,p);Math.abs(S-180)<1e-10||y.equals(p)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((S+1)%360-1)<1e-10&&(o.push(b),r.push(m))}else i[a(m)]=y,o.push(b)}}o.length>2&&o.pop();let c,u=-1;for(let f=0,p=o.length;f<p;f+=1){const g=o[f][1];(c===void 0||g<c)&&(c=g,u=f)}let d=[];if(u>0){const f=o.slice(u),p=o.slice(0,u);d=f.concat(p)}else d=o;const h=[];for(let f=0,p=d.length;f<p;f+=1)h.push(d[f][0]);return new $e(h)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,s)=>t.equals(this.points[s]))}clone(){return new $e(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})($e||($e={})),function(n){function e(t){const s=t.trim();if(s==="")return new n;const r=[],i=s.split(/\s*,\s*|\s+/);for(let o=0,a=i.length;o<a;o+=2)r.push({x:+i[o],y:+i[o+1]});return new n(r)}n.parse=e}($e||($e={}));class Ve extends vs{constructor(e,t,s,r){super(),this.PRECISION=3,this.start=O.create(e),this.controlPoint1=O.create(t),this.controlPoint2=O.create(s),this.end=O.create(r)}bbox(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end,i=e.x,o=e.y,a=t.x,c=t.y,u=s.x,d=s.y,h=r.x,f=r.y,p=[],g=[[],[]];let m,y,b,w,x,v,S,E;for(let P=0;P<2;P+=1){if(P===0?(y=6*i-12*a+6*u,m=-3*i+9*a-9*u+3*h,b=3*a-3*i):(y=6*o-12*c+6*d,m=-3*o+9*c-9*d+3*f,b=3*c-3*o),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;w=-b/y,w>0&&w<1&&p.push(w);continue}S=y*y-4*b*m,E=Math.sqrt(S),!(S<0)&&(x=(-y+E)/(2*m),x>0&&x<1&&p.push(x),v=(-y-E)/(2*m),v>0&&v<1&&p.push(v))}let C,M,N,_=p.length;const T=_;for(;_;)_-=1,w=p[_],N=1-w,C=N*N*N*i+3*N*N*w*a+3*N*w*w*u+w*w*w*h,g[0][_]=C,M=N*N*N*o+3*N*N*w*c+3*N*w*w*d+w*w*w*f,g[1][_]=M;p[T]=0,p[T+1]=1,g[0][T]=i,g[1][T]=o,g[0][T+1]=h,g[1][T+1]=f,p.length=T+2,g[0].length=T+2,g[1].length=T+2;const k=Math.min.apply(null,g[0]),R=Math.min.apply(null,g[1]),V=Math.max.apply(null,g[0]),A=Math.max.apply(null,g[1]);return new U(k,R,V-k,A-R)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const s=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,s),s)}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(!r)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){const s=this.getPrecision(t),r=this.getDivisions(t),i=Math.pow(10,-s);let o=null,a=0,c=0,u=0,d=0,h=0,f=null;const p=r.length;let g=p>0?1/p:0;for(r.forEach((m,y)=>{const b=m.start.distance(e),w=m.end.distance(e),x=b+w;(f==null||x<f)&&(o=m,a=y*g,c=(y+1)*g,u=b,d=w,f=x,h=m.endpointDistance())});;){const m=u?Math.abs(u-d)/u:0,y=d!=null?Math.abs(u-d)/d:0,b=m<i||y<i,w=u?u<h*i:!0,x=d?d<h*i:!0;if(b||(w||x))return u<=d?a:c;const S=o.divide(.5);g/=2;const E=S[0].start.distance(e),C=S[0].end.distance(e),M=E+C,N=S[1].start.distance(e),_=S[1].end.distance(e),T=N+_;M<=T?(o=S[0],c-=g,u=E,d=C):(o=S[1],a+=g,u=N,d=_)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const s=this.tAt(e,t);return this.divideAtT(s)}divideAtLength(e,t={}){const s=this.tAtLength(e,t);return this.divideAtT(s)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return[new Ve(t,t,t,t),new Ve(t,s,r,i)];if(e>=1)return[new Ve(t,s,r,i),new Ve(i,i,i,i)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,c=o.startControlPoint2,u=o.divider,d=o.dividerControlPoint1,h=o.dividerControlPoint2;return[new Ve(t,a,c,u),new Ve(u,d,h,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:r.clone()};if(e>=1)return{startControlPoint1:s.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new q(t,s).pointAt(e),a=new q(s,r).pointAt(e),c=new q(r,i).pointAt(e),u=new q(o,a).pointAt(e),d=new q(a,c).pointAt(e),h=new q(u,d).pointAt(e);return{startControlPoint1:o,startControlPoint2:u,divider:h,dividerControlPoint1:d,dividerControlPoint2:c}}getSubdivisions(e={}){const t=this.getPrecision(e);let s=[new Ve(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return s;let r=this.endpointDistance();const i=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];s.forEach(d=>{const h=d.divide(.5);a.push(h[0],h[1])});const c=a.reduce((d,h)=>d+h.endpointDistance(),0),u=c!==0?(c-r)/c:0;if(o>1&&u<i)return a;s=a,r=c}}length(e={}){return this.getDivisions(e).reduce((s,r)=>s+r.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const s=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:s})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.tAt(e,t);return this.pointAtT(s)}pointAtLength(e,t={}){const s=this.tAtLength(e,t);return this.pointAtT(s)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const s=this.tAt(e,t);return this.tangentAtT(s)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const s=this.tAtLength(e,t);return this.tangentAtT(s)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),s=t.startControlPoint2,r=t.dividerControlPoint1,i=t.divider,o=new q(s,r);return o.translate(i.x-s.x,i.y-s.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),s=this.getDivisions(e);return{precision:t,subdivisions:s}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const s=this.getOptions(t),i=this.length(s)*e;return this.tAtLength(i,s)}tAtLength(e,t={}){let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getDivisions(t),o={precision:r,subdivisions:i};let a=null,c,u,d=0,h=0,f=0;const p=i.length;let g=p>0?1/p:0;for(let b=0;b<p;b+=1){const w=s?b:p-1-b,x=i[b],v=x.endpointDistance();if(e<=f+v){a=x,c=w*g,u=(w+1)*g,d=s?e-f:v+f-e,h=s?v+f-e:e-f;break}f+=v}if(a==null)return s?1:0;const m=this.length(o),y=Math.pow(10,-r);for(;;){let b;if(b=m!==0?d/m:0,b<y)return c;if(b=m!==0?h/m:0,b<y)return u;let w,x;const v=a.divide(.5);g/=2;const S=v[0].endpointDistance(),E=v[1].endpointDistance();d<=S?(a=v[0],u-=g,w=d,x=S-w):(a=v[1],c+=g,w=d-S,x=E-w),d=w,h=x}}toPoints(e={}){const t=this.getDivisions(e),s=[t[0].start.clone()];return t.forEach(r=>s.push(r.end.clone())),s}toPolyline(e={}){return new $e(this.toPoints(e))}scale(e,t,s){return this.start.scale(e,t,s),this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Ve(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isCurve=e})(Ve||(Ve={})),function(n){function e(r){const i=r.length,o=[],a=[];let c=2;o[0]=r[0]/c;for(let u=1;u<i;u+=1)a[u]=1/c,c=(u<i-1?4:3.5)-a[u],o[u]=(r[u]-o[u-1])/c;for(let u=1;u<i;u+=1)o[i-u-1]-=a[i-u]*o[i-u];return o}function t(r){const i=r.map(f=>O.clone(f)),o=[],a=[],c=i.length-1;if(c===1)return o[0]=new O((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new O(2*o[0].x-i[0].x,2*o[0].y-i[0].y),[o,a];const u=[];for(let f=1;f<c-1;f+=1)u[f]=4*i[f].x+2*i[f+1].x;u[0]=i[0].x+2*i[1].x,u[c-1]=(8*i[c-1].x+i[c].x)/2;const d=e(u);for(let f=1;f<c-1;f+=1)u[f]=4*i[f].y+2*i[f+1].y;u[0]=i[0].y+2*i[1].y,u[c-1]=(8*i[c-1].y+i[c].y)/2;const h=e(u);for(let f=0;f<c;f+=1)o.push(new O(d[f],h[f])),f<c-1?a.push(new O(2*i[f+1].x-d[f+1],2*i[f+1].y-h[f+1])):a.push(new O((i[c].x+d[c-1])/2,(i[c].y+h[c-1])/2));return[o,a]}function s(r){if(r==null||Array.isArray(r)&&r.length<2)throw new Error("At least 2 points are required");const i=t(r),o=[];for(let a=0,c=i[0].length;a<c;a+=1){const u=new O(i[0][a].x,i[0][a].y),d=new O(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,d,r[a+1]))}return o}n.throughPoints=s}(Ve||(Ve={}));class Ka extends vs{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const s=this.length();return e>=1?s:s*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class gt extends Ka{constructor(e,t){super(),q.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=O.create(e,t).round(2)}get type(){return"L"}get line(){return new q(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new gt(t[0]),new gt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new gt(t[0]),new gt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new gt(this.end)}scale(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(q.isLine(r))return new n(r);if(O.isPointLike(r))return s===1?new n(r):t.map(o=>new n(o));if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];i.push(new n(a,c))}return i}n.create=e})(gt||(gt={}));class Ur extends Ka{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new q(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new gt(t[0]):this.clone(),new gt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new gt(t[0]):this.clone(),new gt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new Ur}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(Ur||(Ur={}));class Hr extends Ka{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,q.isLine(e)||Ve.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=O.create(e,t).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new Hr(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(q.isLine(r))return new n(r);if(Ve.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===1)return new n(r);const o=[];for(let a=0;a<s;a+=1)a===0?o.push(new n(t[a])):o.push(new gt(t[a]));return o}if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];o===0?i.push(new n(a,c)):i.push(new gt(a,c))}return i}n.create=e})(Hr||(Hr={}));class Ht extends Ka{constructor(e,t,s,r,i,o){super(),Ve.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new O(e,t).round(2),this.controlPoint2=new O(s,r).round(2),this.endPoint=new O(i,o).round(2)):(this.controlPoint1=O.create(e).round(2),this.controlPoint2=O.create(t).round(2),this.endPoint=O.create(s).round(2))}get type(){return"C"}get curve(){return new Ve(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const s=this.curve.divideAt(e,t);return[new Ht(s[0]),new Ht(s[1])]}divideAtLength(e,t={}){const s=this.curve.divideAtLength(e,t);return[new Ht(s[0]),new Ht(s[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new Ht(t[0]),new Ht(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}scale(e,t,s){return this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new Ht(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,t=this.controlPoint2,s=this.end;return[this.type,e.x,e.y,t.x,t.y,s.x,s.y].join(" ")}}(function(n){function e(...t){const s=t.length,r=t[0];if(Ve.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<s;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(s===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const i=[];for(let o=0;o<s;o+=6)i.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return i}n.create=e})(Ht||(Ht={}));function Za(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function ky(n,e,t,s,r,i){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*s,o*r+a*t,o*i+a*s,r,i]}function Dy(n,e,t,s,r,i,o,a,c,u){const d=Math.PI*120/180,h=Math.PI/180*(+r||0);let f=[],p,g,m,y,b;if(u)g=u[0],m=u[1],y=u[2],b=u[3];else{p=Za(n,e,-h),n=p.x,e=p.y,p=Za(a,c,-h),a=p.x,c=p.y;const V=(n-a)/2,A=(e-c)/2;let P=V*V/(t*t)+A*A/(s*s);P>1&&(P=Math.sqrt(P),t=P*t,s=P*s);const j=t*t,z=s*s,Y=(i===o?-1:1)*Math.sqrt(Math.abs((j*z-j*A*A-z*V*V)/(j*A*A+z*V*V)));y=Y*t*A/s+(n+a)/2,b=Y*-s*V/t+(e+c)/2,g=Math.asin((e-b)/s),m=Math.asin((c-b)/s),g=n<y?Math.PI-g:g,m=a<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),o&&g>m&&(g-=Math.PI*2),!o&&m>g&&(m-=Math.PI*2)}let w=m-g;if(Math.abs(w)>d){const V=m,A=a,P=c;m=g+d*(o&&m>g?1:-1),a=y+t*Math.cos(m),c=b+s*Math.sin(m),f=Dy(a,c,t,s,r,0,o,A,P,[m,V,y,b])}w=m-g;const x=Math.cos(g),v=Math.sin(g),S=Math.cos(m),E=Math.sin(m),C=Math.tan(w/4),M=4/3*(t*C),N=4/3*(s*C),_=[n,e],T=[n+M*v,e-N*x],k=[a+M*E,c-N*S],R=[a,c];if(T[0]=2*_[0]-T[0],T[1]=2*_[1]-T[1],u)return[T,k,R].concat(f);{f=[T,k,R].concat(f).join().split(",");const V=[],A=f.length;for(let P=0;P<A;P+=1)V[P]=P%2?Za(+f[P-1],+f[P],h).y:Za(+f[P],+f[P+1],h).x;return V}}function sL(n){if(!n)return null;const e=`
37
- \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),s=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return n.replace(t,(o,a,c)=>{const u=[];let d=a.toLowerCase();c.replace(s,(f,p)=>(p&&u.push(+p),f)),d==="m"&&u.length>2&&(i.push([a,...u.splice(0,2)]),d="l",a=a==="m"?"l":"L");const h=r[d];for(;u.length>=h&&(i.push([a,...u.splice(0,h)]),!!h););return o}),i}function rL(n){const e=sL(n);if(!e||!e.length)return[["M",0,0]];let t=0,s=0,r=0,i=0;const o=[];for(let a=0,c=e.length;a<c;a+=1){const u=[];o.push(u);const d=e[a],h=d[0];if(h!==h.toUpperCase())switch(u[0]=h.toUpperCase(),u[0]){case"A":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+d[6]+t,u[7]=+d[7]+s;break;case"V":u[1]=+d[1]+s;break;case"H":u[1]=+d[1]+t;break;case"M":r=+d[1]+t,i=+d[2]+s;for(let f=1,p=d.length;f<p;f+=1)u[f]=+d[f]+(f%2?t:s);break;default:for(let f=1,p=d.length;f<p;f+=1)u[f]=+d[f]+(f%2?t:s);break}else for(let f=0,p=d.length;f<p;f+=1)u[f]=d[f];switch(u[0]){case"Z":t=+r,s=+i;break;case"H":t=u[1];break;case"V":s=u[1];break;case"M":r=u[u.length-2],i=u[u.length-1],t=u[u.length-2],s=u[u.length-1];break;default:t=u[u.length-2],s=u[u.length-1];break}}return o}function iL(n){const e=rL(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function s(c,u,d){let h,f;if(!c)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(c[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),c[0]){case"M":u.X=c[1],u.Y=c[2];break;case"A":return parseFloat(c[1])===0||parseFloat(c[2])===0?["L",c[6],c[7]]:["C"].concat(Dy.apply(0,[u.x,u.y].concat(c.slice(1))));case"S":return d==="C"||d==="S"?(h=u.x*2-u.bx,f=u.y*2-u.by):(h=u.x,f=u.y),["C",h,f].concat(c.slice(1));case"T":return d==="Q"||d==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(ky(u.x,u.y,u.qx,u.qy,c[1],c[2]));case"Q":return u.qx=c[1],u.qy=c[2],["C"].concat(ky(u.x,u.y,c[1],c[2],c[3],c[4]));case"H":return["L"].concat(c[1],u.y);case"V":return["L"].concat(u.x,c[1])}return c}function r(c,u){if(c[u].length>7){c[u].shift();const d=c[u];for(;d.length;)i[u]="A",u+=1,c.splice(u,0,["C"].concat(d.splice(0,6)));c.splice(u,1),a=e.length}}const i=[];let o="",a=e.length;for(let c=0;c<a;c+=1){let u="";e[c]&&(u=e[c][0]),u!=="C"&&(i[c]=u,c>0&&(o=i[c-1])),e[c]=s(e[c],t,o),i[c]!=="A"&&u==="C"&&(i[c]="C"),r(e,c);const d=e[c],h=d.length;t.x=d[h-2],t.y=d[h-1],t.bx=parseFloat(d[h-4])||t.x,t.by=parseFloat(d[h-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function oL(n){return iL(n).map(e=>e.map(t=>typeof t=="string"?t:ve.round(t,2))).join(",").split(",").join(" ")}class ee extends vs{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(q.isLine(e[0])||Ve.isCurve(e[0])){let t=null;e.forEach((r,i)=>{i===0&&this.appendSegment(ee.createSegment("M",r.start)),t!=null&&!t.end.equals(r.start)&&this.appendSegment(ee.createSegment("M",r.start)),q.isLine(r)?this.appendSegment(ee.createSegment("L",r.end)):Ve.isCurve(r)&&this.appendSegment(ee.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),t=r})}else e.forEach(s=>{s.isSegment&&this.appendSegment(s)});else e!=null&&(q.isLine(e)?(this.appendSegment(ee.createSegment("M",e.start)),this.appendSegment(ee.createSegment("L",e.end))):Ve.isCurve(e)?(this.appendSegment(ee.createSegment("M",e.start)),this.appendSegment(ee.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):$e.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,s)=>{const r=s===0?ee.createSegment("M",t):ee.createSegment("L",t);this.appendSegment(r)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=0;s<t;s+=1){const r=e[s];if(r.isVisible)return r.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=t-1;s>=0;s-=1){const r=e[s];if(r.isVisible)return r.end}return e[t-1].end}moveTo(...e){return this.appendSegment(Hr.create.call(null,...e))}lineTo(...e){return this.appendSegment(gt.create.call(null,...e))}curveTo(...e){return this.appendSegment(Ht.create.call(null,...e))}arcTo(e,t,s,r,i,o,a){const c=this.end||new O,u=typeof o=="number"?Xa(c.x,c.y,e,t,s,r,i,o,a):Xa(c.x,c.y,e,t,s,r,i,o.x,o.y);if(u!=null)for(let d=0,h=u.length;d<h;d+=6)this.curveTo(u[d],u[d+1],u[d+2],u[d+3],u[d+4],u[d+5]);return this}quadTo(e,t,s,r){const i=this.end||new O,o=["M",i.x,i.y];if(typeof e=="number")o.push("Q",e,t,s,r);else{const c=t;o.push("Q",e.x,e.y,c.x,c.y)}const a=ee.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Ur.create())}drawPoints(e,t={}){const s=_y(e,t),r=ee.parse(s);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let s;for(let i=0;i<t;i+=1){const o=e[i];if(o.isVisible){const a=o.bbox();a!=null&&(s=s?s.union(a):a)}}if(s!=null)return s;const r=e[t-1];return new U(r.end.x,r.end.y,0,0)}appendSegment(e){const t=this.segments.length;let s=t!==0?this.segments[t-1]:null,r;const i=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const c=e[o];r=this.prepareSegment(c,s,i),this.segments.push(r),s=r}else e!=null&&e.isSegment&&(r=this.prepareSegment(e,s,i),this.segments.push(r));return this}insertSegment(e,t){const s=this.segments.length;if(e<0&&(e=s+e+1),e>s||e<0)throw new Error("Index out of range.");let r,i=null,o=null;if(s!==0&&(e>=1?(i=this.segments[e-1],o=i.nextSegment):(i=null,o=this.segments[0])),!Array.isArray(t))r=this.prepareSegment(t,i,o),this.segments.splice(e,0,r);else for(let a=0,c=t.length;a<c;a+=1){const u=t[a];r=this.prepareSegment(u,i,o),this.segments.splice(e+a,0,r),i=r}return this}removeSegment(e){const t=this.fixIndex(e),s=this.segments.splice(t,1)[0],r=s.previousSegment,i=s.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),s.isSubpathStart&&i&&this.updateSubpathStartSegment(i),s}replaceSegment(e,t){const s=this.fixIndex(e);let r;const i=this.segments[s];let o=i.previousSegment;const a=i.nextSegment;let c=i.isSubpathStart;if(!Array.isArray(t))r=this.prepareSegment(t,o,a),this.segments.splice(s,1,r),c&&r.isSubpathStart&&(c=!1);else{this.segments.splice(e,1);for(let u=0,d=t.length;u<d;u+=1){const h=t[u];r=this.prepareSegment(h,o,a),this.segments.splice(e+u,0,r),o=r,c&&r.isSubpathStart&&(c=!1)}}c&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let s=e;for(;s<0;)s=t+s;if(s>=t||s<0)throw new Error("Index out of range.");return s}segmentAt(e,t={}){const s=this.segmentIndexAt(e,t);return s?this.getSegment(s):null}segmentAtLength(e,t={}){const s=this.segmentIndexAtLength(e,t);return s?this.getSegment(s):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const s=ve.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(e,t={}){const s=this.segments.length;if(s===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,c=null;for(let u=0;u<s;u+=1){const d=r?u:s-1-u,h=this.segments[d],f=o[d],p=h.length({precision:i,subdivisions:f});if(h.isVisible){if(e<=a+p)return d;c=d}a+=p}return c}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),s=[];for(let r=0,i=this.segments.length;r<i;r+=1){const a=this.segments[r].getSubdivisions({precision:t});s.push(a)}return s}updateSubpathStartSegment(e){let t=e.previousSegment,s=e;for(;s&&!s.isSubpathStart;)t!=null?s.subpathStartSegment=t.subpathStartSegment:s.subpathStartSegment=null,t=s,s=s.nextSegment}prepareSegment(e,t,s){e.previousSegment=t,e.nextSegment=s,t!=null&&(t.nextSegment=e),s!=null&&(s.previousSegment=e);let r=e;return e.isSubpathStart&&(e.subpathStartSegment=e,r=s),r!=null&&this.updateSubpathStartSegment(r),e}closestPoint(e,t={}){const s=this.closestPointT(e,t);return s?this.pointAtT(s):null}closestPointLength(e,t={}){const s=this.getOptions(t),r=this.closestPointT(e,s);return r?this.lengthAtT(r,s):0}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(r===0)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isVisible){const h=u.closestPointT(e,{precision:s,subdivisions:d}),f=u.pointAtT(h),p=ve.squaredLength(f,e);p<o&&(i={segmentIndex:a,value:h},o=p)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isDifferentiable()){const h=u.closestPointT(e,{precision:s,subdivisions:d}),f=u.pointAtT(h),p=ve.squaredLength(f,e);p<o&&(i=u.tangentAtT(h),o=p)}}return i||null}containsPoint(e,t={}){const s=this.toPolylines(t);if(!s)return!1;let r=0;for(let i=0,o=s.length;i<o;i+=1)s[i].containsPoint(e)&&(r+=1);return r%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.getOptions(t),i=this.length(s)*e;return this.pointAtLength(i,s)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let u=0,d=this.segments.length;u<d;u+=1){const h=s?u:d-1-u,f=this.segments[h],p=i[h],g=f.length({precision:r,subdivisions:p});if(f.isVisible){if(e<=a+g)return f.pointAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:p});o=f}a+=g}return o?s?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,s=t.length;if(s===0)return null;const r=e.segmentIndex;if(r<0)return t[0].pointAtT(0);if(r>=s)return t[s-1].pointAtT(1);const i=ve.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(this.segments.length===0)return null;const s=ve.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.divideAtLength(o,r)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o=0,a,c,u,d,h;for(let S=0,E=this.segments.length;S<E;S+=1){const C=s?S:E-1-S,M=this.getSegment(C),N=i[C],_={precision:r,subdivisions:N},T=M.length(_);if(M.isDifferentiable()&&(u=M,d=C,e<=o+T)){c=C,a=M.divideAtLength((s?1:-1)*(e-o),_);break}o+=T}if(!u)return null;a||(c=d,h=s?1:0,a=u.divideAtT(h));const f=this.clone(),p=c;f.replaceSegment(p,a);const g=p;let m=p+1,y=p+2;a[0].isDifferentiable()||(f.removeSegment(g),m-=1,y-=1);const b=f.getSegment(m).start;f.insertSegment(m,ee.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(f.removeSegment(y-1),y-=1);const w=y-g-1;for(let S=y,E=f.segments.length;S<E;S+=1){const C=this.getSegment(S-w),M=f.getSegment(S);if(M.type==="Z"&&!C.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const N=ee.createSegment("L",C.end);f.replaceSegment(S,N)}}const x=new ee(f.segments.slice(0,m)),v=new ee(f.segments.slice(m));return[x,v]}intersectsWithLine(e,t={}){const s=this.toPolylines(t);if(s==null)return null;let r=null;for(let i=0,o=s.length;i<o;i+=1){const a=s[i],c=e.intersect(a);c&&(r==null&&(r=[]),Array.isArray(c)?r.push(...c):r.push(c))}return r}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let s=0;for(let r=0,i=this.segments.length;r<i;r+=1){const o=this.segments[r],a=t[r];s+=o.length({subdivisions:a})}return s}lengthAtT(e,t={}){const s=this.segments.length;if(s===0)return 0;let r=e.segmentIndex;if(r<0)return 0;let i=ve.clamp(e.value,0,1);r>=s&&(r=s-1,i=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let c=0;for(let h=0;h<r;h+=1){const f=this.segments[h],p=a[h];c+=f.length({precision:o,subdivisions:p})}const u=this.segments[r],d=a[r];return c+=u.lengthAtT(i,{precision:o,subdivisions:d}),c}tangentAt(e,t={}){if(this.segments.length===0)return null;const s=ve.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.tangentAtLength(o,r)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const d=s?c:u-1-c,h=this.segments[d],f=i[d],p=h.length({precision:r,subdivisions:f});if(h.isDifferentiable()){if(e<=a+p)return h.tangentAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:f});o=h}a+=p}if(o){const c=s?1:0;return o.tangentAtT(c)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const s=e.segmentIndex;if(s<0)return this.segments[0].tangentAtT(0);if(s>=t)return this.segments[t-1].tangentAtT(1);const r=ve.clamp(e.value,0,1);return this.segments[s].tangentAtT(r)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),s=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:s}}toPoints(e={}){const t=this.segments,s=t.length;if(s===0)return null;const r=this.getSubdivisions(e),i=[];let o=[];for(let a=0;a<s;a+=1){const c=t[a];if(c.isVisible){const u=r[a];u.length>0?u.forEach(d=>o.push(d.start)):o.push(c.start)}else o.length>0&&(o.push(t[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(s=>new $e(s)):null}scale(e,t,s){return this.segments.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.segments.forEach(s=>s.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(s=>s.translate(e,t)):this.segments.forEach(s=>s.translate(e)),this}clone(){const e=new ee;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,s=e.segments,r=t.length;if(s.length!==r)return!1;for(let i=0;i<r;i+=1){const o=t[i],a=s[i];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(ee||(ee={})),function(n){function e(s){if(!s)return new n;const r=new n,i=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(s).match(i);if(o!=null)for(let a=0,c=o.length;a<c;a+=1){const u=o[a],d=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,h=u.match(d);if(h!=null){const f=h[0],p=h.slice(1).map(m=>+m),g=t.call(null,f,...p);r.appendSegment(g)}}return r}n.parse=e;function t(s,...r){if(s==="M")return Hr.create.call(null,...r);if(s==="L")return gt.create.call(null,...r);if(s==="C")return Ht.create.call(null,...r);if(s==="z"||s==="Z")return Ur.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=t}(ee||(ee={})),function(n){n.normalize=oL,n.isValid=eL,n.drawArc=nL,n.drawPoints=_y,n.arcToCurves=Xa}(ee||(ee={}));class ze{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,s=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!s&&!ys.isApplyingHMR()&&this.onDuplicated(e);const r=this.options.process,i=r?Q(r,this,e,t):t;return this.data[e]=i,i}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&Q(this.options.onConflict,this,e),new Error(`${na(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const s=this.getSpellingSuggestionForName(e),r=t?`${t} ${pP(this.options.type)}`:this.options.type;return`${na(r)} with name '${e}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(e){return oR(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(ze||(ze={}));const aL=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,s=e.thickness*e.sy;fe(n,{width:t,height:s,rx:t,ry:s,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const s=e.factor||1,r=e.width*s,i=e.height*s,o=e.thickness;r-o>=0&&i-o>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",e.width=r,e.height=i,fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;fe(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Cs{constructor(){this.patterns={},this.root=se.create(Ua(),{width:"100%",height:"100%"},[dn("defs")]).node}add(e,t){const s=this.root.childNodes[0];s&&s.appendChild(t),this.patterns[e]=t,se.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=aL,n.registry=ze.create({type:"grid"}),n.registry.register(n.presets,!0)})(Cs||(Cs={}));const Ry=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t*2,e.height=s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(2*t,0),r.scale(-1,1),r.drawImage(n,0,0,t,s),e},Ly=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t,e.height=s*2;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(0,2*s),r.scale(1,-1),r.drawImage(n,0,0,t,s),e},Iy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=2*t,e.height=2*s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,-1,e.width,e.height),r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,1,e.width,0),r.drawImage(n,0,0,t,s),r.setTransform(1,0,0,-1,0,e.height),r.drawImage(n,0,0,t,s),e},lL=Object.freeze(Object.defineProperty({__proto__:null,flipX:Ry,flipXY:Iy,flipY:Ly,watermark:function(n,e){const t=n.width,s=n.height,r=document.createElement("canvas");r.width=t*3,r.height=s*3;const i=r.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=me.toRad(o),c=r.width/4,u=r.height/4;for(let d=0;d<4;d+=1)for(let h=0;h<4;h+=1)(d+h)%2>0&&(i.setTransform(1,0,0,1,(2*d-1)*c,(2*h-1)*u),i.rotate(a),i.drawImage(n,-t/2,-s/2,t,s));return r}},Symbol.toStringTag,{value:"Module"}));var io;(function(n){n.presets=Object.assign({},lL),n.presets["flip-x"]=Ry,n.presets["flip-y"]=Ly,n.presets["flip-xy"]=Iy,n.registry=ze.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(io||(io={}));function Xu(n,e){return n??e}function it(n,e){return n!=null&&Number.isFinite(n)?n:e}function cL(n={}){const e=Xu(n.color,"blue"),t=it(n.width,1),s=it(n.margin,2),r=it(n.opacity,1),i=s,o=s+t;return`
29
+ `,b_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function w_(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),s=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:b_.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:t}}function Ag(n,e=1,t){var s;an||(an=document.createElement("textarea"),document.body.appendChild(an));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=w_(n);an.setAttribute("style",`${a};${y_}`),an.value=n.value||n.placeholder||"";let c=an.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-r),an.value="";const d=an.scrollHeight-r;if(jt(e)){let f=d*e;o==="border-box"&&(f=f+r+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(jt(t)){let f=d*t;o==="border-box"&&(f=f+r+i),c=Math.min(f,c)}return u.height=`${c}px`,(s=an.parentNode)==null||s.removeChild(an),an=void 0,u}const x_=Ze({id:{type:String,default:void 0},size:qc,disabled:Boolean,modelValue:{type:he([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:he([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Ii},prefixIcon:{type:Ii},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:he([Object,Array,String]),default:()=>zp({})},autofocus:Boolean,rows:{type:Number,default:2},...Jc(["ariaLabel"])}),v_={[Rc]:n=>en(n),input:n=>en(n),change:n=>en(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},C_=l.defineComponent({name:"ElInput",inheritAttrs:!1}),S_=l.defineComponent({...C_,props:x_,emits:v_,setup(n,{expose:e,emit:t}){const s=n,r=l.useAttrs(),i=l.useSlots(),o=l.computed(()=>{const U={};return s.containerRole==="combobox"&&(U["aria-haspopup"]=r["aria-haspopup"],U["aria-owns"]=r["aria-owns"],U["aria-expanded"]=r["aria-expanded"]),U}),a=l.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(p.value),m.is("disabled",g.value),m.is("exceed",H.value),{[m.b("group")]:i.prepend||i.append,[m.m("prefix")]:i.prefix||s.prefixIcon,[m.m("suffix")]:i.suffix||s.suffixIcon||s.clearable||s.showPassword,[m.bm("suffix","password-clear")]:G.value&&se.value,[m.b("hidden")]:s.type==="hidden"},r.class]),c=l.computed(()=>[m.e("wrapper"),m.is("focus",A.value)]),u=kN({excludeKeys:l.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Ng(),{inputId:h}=m_(s,{formItemContext:f}),p=Pg(),g=Zc(),m=mt("input"),y=mt("textarea"),b=l.shallowRef(),w=l.shallowRef(),x=l.ref(!1),v=l.ref(!1),S=l.ref(),E=l.shallowRef(s.inputStyle),C=l.computed(()=>b.value||w.value),{wrapperRef:P,isFocused:A,handleFocus:T,handleBlur:k}=i_(C,{beforeFocus(){return g.value},afterBlur(){var U;s.validateEvent&&((U=f==null?void 0:f.validate)==null||U.call(f,"blur").catch(Oe=>At(Oe)))}}),V=l.computed(()=>{var U;return(U=d==null?void 0:d.statusIcon)!=null?U:!1}),R=l.computed(()=>(f==null?void 0:f.validateState)||""),j=l.computed(()=>R.value&&ON[R.value]),N=l.computed(()=>v.value?Lp:mN),M=l.computed(()=>[r.style]),D=l.computed(()=>[s.inputStyle,E.value,{resize:s.resize}]),B=l.computed(()=>pa(s.modelValue)?"":String(s.modelValue)),G=l.computed(()=>s.clearable&&!g.value&&!s.readonly&&!!B.value&&(A.value||x.value)),se=l.computed(()=>s.showPassword&&!g.value&&!!B.value&&(!!B.value||A.value)),I=l.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!g.value&&!s.readonly&&!s.showPassword),_=l.computed(()=>B.value.length),H=l.computed(()=>!!I.value&&_.value>Number(s.maxlength)),K=l.computed(()=>!!i.suffix||!!s.suffixIcon||G.value||s.showPassword||I.value||!!R.value&&V.value),[q,re]=s_(b);_h(w,U=>{if(te(),!I.value||s.resize!=="both")return;const Oe=U[0],{width:ts}=Oe.contentRect;S.value={right:`calc(100% - ${ts+15+6}px)`}});const Z=()=>{const{type:U,autosize:Oe}=s;if(!(!Ge||U!=="textarea"||!w.value))if(Oe){const ts=pr(Oe)?Oe.minRows:void 0,Co=pr(Oe)?Oe.maxRows:void 0,b0=Ag(w.value,ts,Co);E.value={overflowY:"hidden",...b0},l.nextTick(()=>{w.value.offsetHeight,E.value=b0})}else E.value={minHeight:Ag(w.value).minHeight}},te=(U=>{let Oe=!1;return()=>{var ts;if(Oe||!s.autosize)return;((ts=w.value)==null?void 0:ts.offsetParent)===null||(U(),Oe=!0)}})(Z),le=()=>{const U=C.value,Oe=s.formatter?s.formatter(B.value):B.value;!U||U.value===Oe||(U.value=Oe)},bt=async U=>{q();let{value:Oe}=U.target;if(s.formatter&&(Oe=s.parser?s.parser(Oe):Oe),!Pt.value){if(Oe===B.value){le();return}t(Rc,Oe),t("input",Oe),await l.nextTick(),le(),re()}},st=U=>{t("change",U.target.value)},{isComposing:Pt,handleCompositionStart:Q,handleCompositionUpdate:sr,handleCompositionEnd:rr}=o_({emit:t,afterComposition:bt}),hi=()=>{v.value=!v.value,ae()},ae=async()=>{var U;await l.nextTick(),(U=C.value)==null||U.focus()},Jt=()=>{var U;return(U=C.value)==null?void 0:U.blur()},es=U=>{x.value=!1,t("mouseleave",U)},fi=U=>{x.value=!0,t("mouseenter",U)},vo=U=>{t("keydown",U)},Ol=()=>{var U;(U=C.value)==null||U.select()},pi=()=>{t(Rc,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>s.modelValue,()=>{var U;l.nextTick(()=>Z()),s.validateEvent&&((U=f==null?void 0:f.validate)==null||U.call(f,"change").catch(Oe=>At(Oe)))}),l.watch(B,()=>le()),l.watch(()=>s.type,async()=>{await l.nextTick(),le(),Z()}),l.onMounted(()=>{!s.formatter&&s.parser&&At("ElInput","If you set the parser, you also need to set the formatter."),le(),l.nextTick(Z)}),e({input:b,textarea:w,ref:C,textareaStyle:D,autosize:l.toRef(s,"autosize"),isComposing:Pt,focus:ae,blur:Jt,select:Ol,clear:pi,resizeTextarea:Z}),(U,Oe)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(o),{class:[l.unref(a),{[l.unref(m).bm("group","append")]:U.$slots.append,[l.unref(m).bm("group","prepend")]:U.$slots.prepend}],style:l.unref(M),role:U.containerRole,onMouseenter:fi,onMouseleave:es}),[l.createCommentVNode(" input "),U.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),U.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(m).be("group","prepend"))},[l.renderSlot(U.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:P,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),U.$slots.prefix||U.prefixIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(l.unref(m).e("prefix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("prefix-inner"))},[l.renderSlot(U.$slots,"prefix"),U.prefixIcon?(l.openBlock(),l.createBlock(l.unref(On),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(U.prefixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("input",l.mergeProps({id:l.unref(h),ref_key:"input",ref:b,class:l.unref(m).e("inner")},l.unref(u),{minlength:U.minlength,maxlength:U.maxlength,type:U.showPassword?v.value?"text":"password":U.type,disabled:l.unref(g),readonly:U.readonly,autocomplete:U.autocomplete,tabindex:U.tabindex,"aria-label":U.ariaLabel,placeholder:U.placeholder,style:U.inputStyle,form:U.form,autofocus:U.autofocus,onCompositionstart:l.unref(Q),onCompositionupdate:l.unref(sr),onCompositionend:l.unref(rr),onInput:bt,onChange:st,onKeydown:vo}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(K)?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(l.unref(m).e("suffix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("suffix-inner"))},[!l.unref(G)||!l.unref(se)||!l.unref(I)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(U.$slots,"suffix"),U.suffixIcon?(l.openBlock(),l.createBlock(l.unref(On),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(U.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(G)?(l.openBlock(),l.createBlock(l.unref(On),{key:1,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("clear")]),onMousedown:l.withModifiers(l.unref(os),["prevent"]),onClick:pi},{default:l.withCtx(()=>[l.createVNode(l.unref(kp))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(se)?(l.openBlock(),l.createBlock(l.unref(On),{key:2,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("password")]),onClick:hi},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(N))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(I)?(l.openBlock(),l.createElementBlock("span",{key:3,class:l.normalizeClass(l.unref(m).e("count"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("count-inner"))},l.toDisplayString(l.unref(_))+" / "+l.toDisplayString(U.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(R)&&l.unref(j)&&l.unref(V)?(l.openBlock(),l.createBlock(l.unref(On),{key:4,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("validateIcon"),l.unref(m).is("loading",l.unref(R)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(j))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),U.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(m).be("group","append"))},[l.renderSlot(U.$slots,"append")],2)):l.createCommentVNode("v-if",!0)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" textarea "),l.createElementVNode("textarea",l.mergeProps({id:l.unref(h),ref_key:"textarea",ref:w,class:[l.unref(y).e("inner"),l.unref(m).is("focus",l.unref(A))]},l.unref(u),{minlength:U.minlength,maxlength:U.maxlength,tabindex:U.tabindex,disabled:l.unref(g),readonly:U.readonly,autocomplete:U.autocomplete,style:l.unref(D),"aria-label":U.ariaLabel,placeholder:U.placeholder,form:U.form,autofocus:U.autofocus,rows:U.rows,onCompositionstart:l.unref(Q),onCompositionupdate:l.unref(sr),onCompositionend:l.unref(rr),onInput:bt,onFocus:l.unref(T),onBlur:l.unref(k),onChange:st,onKeydown:vo}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),l.unref(I)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(S.value),class:l.normalizeClass(l.unref(m).e("count"))},l.toDisplayString(l.unref(_))+" / "+l.toDisplayString(U.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var E_=ft(S_,[["__file","input.vue"]]);const O_=js(E_),Qc=Symbol("popper"),_g=Symbol("popperContent"),Tg=Ze({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),M_=l.defineComponent({name:"ElPopper",inheritAttrs:!1}),P_=l.defineComponent({...M_,props:Tg,setup(n,{expose:e}){const t=n,s=l.ref(),r=l.ref(),i=l.ref(),o=l.ref(),a=l.computed(()=>t.role),c={triggerRef:s,popperInstanceRef:r,contentRef:i,referenceRef:o,role:a};return e(c),l.provide(Qc,c),(u,d)=>l.renderSlot(u.$slots,"default")}});var N_=ft(P_,[["__file","popper.vue"]]);const kg=Ze({arrowOffset:{type:Number,default:5}}),A_=l.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),__=l.defineComponent({...A_,props:kg,setup(n,{expose:e}){const t=n,s=mt("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=l.inject(_g,void 0);return l.watch(()=>t.arrowOffset,a=>{r.value=a}),l.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(a,c)=>(l.openBlock(),l.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:l.normalizeClass(l.unref(s).e("arrow")),style:l.normalizeStyle(l.unref(o)),"data-popper-arrow":""},null,6))}});var T_=ft(__,[["__file","arrow.vue"]]);const eu="ElOnlyChild",k_=l.defineComponent({name:eu,setup(n,{slots:e,attrs:t}){var s;const r=l.inject(mg),i=n_((s=r==null?void 0:r.setForwardRef)!=null?s:os);return()=>{var o;const a=(o=e.default)==null?void 0:o.call(e,t);if(!a)return null;if(a.length>1)return At(eu,"requires exact only one valid child."),null;const c=Vg(a);return c?l.withDirectives(l.cloneVNode(c,t),[[i]]):(At(eu,"no valid child node found"),null)}}});function Vg(n){if(!n)return null;const e=n;for(const t of e){if(pr(t))switch(t.type){case l.Comment:continue;case l.Text:case"svg":return Dg(t);case l.Fragment:return Vg(t.children);default:return t}return Dg(t)}return null}function Dg(n){const e=mt("only-child");return l.createVNode("span",{class:e.e("content")},[n])}const Rg=Ze({virtualRef:{type:he(Object)},virtualTriggering:Boolean,onMouseenter:{type:he(Function)},onMouseleave:{type:he(Function)},onClick:{type:he(Function)},onKeydown:{type:he(Function)},onFocus:{type:he(Function)},onBlur:{type:he(Function)},onContextmenu:{type:he(Function)},id:String,open:Boolean}),V_=l.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),D_=l.defineComponent({...V_,props:Rg,setup(n,{expose:e}){const t=n,{role:s,triggerRef:r}=l.inject(Qc,void 0);t_(r);const i=l.computed(()=>a.value?t.id:void 0),o=l.computed(()=>{if(s&&s.value==="tooltip")return t.open&&t.id?t.id:void 0}),a=l.computed(()=>{if(s&&s.value!=="tooltip")return s.value}),c=l.computed(()=>a.value?`${t.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return l.onMounted(()=>{l.watch(()=>t.virtualRef,f=>{f&&(r.value=is(f))},{immediate:!0}),l.watch(r,(f,h)=>{u==null||u(),u=void 0,Gn(f)&&(d.forEach(p=>{var g;const m=t[p];m&&(f.addEventListener(p.slice(2).toLowerCase(),m),(g=h==null?void 0:h.removeEventListener)==null||g.call(h,p.slice(2).toLowerCase(),m))}),u=l.watch([i,o,a,c],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((g,m)=>{pa(p[m])?f.removeAttribute(g):f.setAttribute(g,p[m])})},{immediate:!0})),Gn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>h.removeAttribute(p))},{immediate:!0})}),l.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,r.value&&Gn(r.value)){const f=r.value;d.forEach(h=>{const p=t[h];p&&f.removeEventListener(h.slice(2).toLowerCase(),p)}),r.value=void 0}}),e({triggerRef:r}),(f,h)=>f.virtualTriggering?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock(l.unref(k_),l.mergeProps({key:0},f.$attrs,{"aria-controls":l.unref(i),"aria-describedby":l.unref(o),"aria-expanded":l.unref(c),"aria-haspopup":l.unref(a)}),{default:l.withCtx(()=>[l.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var R_=ft(D_,[["__file","trigger.vue"]]);const tu="focus-trap.focus-after-trapped",nu="focus-trap.focus-after-released",L_="focus-trap.focusout-prevented",Lg={cancelable:!0,bubbles:!1},I_={cancelable:!0,bubbles:!1},Ig="focusAfterTrapped",Bg="focusAfterReleased",B_=Symbol("elFocusTrap"),su=l.ref(),Aa=l.ref(0),ru=l.ref(0);let _a=0;const jg=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0||s===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},$g=(n,e)=>{for(const t of n)if(!j_(t,e))return t},j_=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},$_=n=>{const e=jg(n),t=$g(e,n),s=$g(e.reverse(),n);return[t,s]},z_=n=>n instanceof HTMLInputElement&&"select"in n,cs=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),ru.value=window.performance.now(),n!==t&&z_(n)&&e&&n.select()}};function zg(n,e){const t=[...n],s=n.indexOf(e);return s!==-1&&t.splice(s,1),t}const F_=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=zg(n,s),n.unshift(s)},remove:s=>{var r,i;n=zg(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},U_=(n,e=!1)=>{const t=document.activeElement;for(const s of n)if(cs(s,e),document.activeElement!==t)return},Fg=F_(),H_=()=>Aa.value>ru.value,Ta=()=>{su.value="pointer",Aa.value=window.performance.now()},Ug=()=>{su.value="keyboard",Aa.value=window.performance.now()},G_=()=>(l.onMounted(()=>{_a===0&&(document.addEventListener("mousedown",Ta),document.addEventListener("touchstart",Ta),document.addEventListener("keydown",Ug)),_a++}),l.onBeforeUnmount(()=>{_a--,_a<=0&&(document.removeEventListener("mousedown",Ta),document.removeEventListener("touchstart",Ta),document.removeEventListener("keydown",Ug))}),{focusReason:su,lastUserFocusTimestamp:Aa,lastAutomatedFocusTimestamp:ru}),ka=n=>new CustomEvent(L_,{...I_,detail:n}),W_=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Ig,Bg,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=l.ref();let s,r;const{focusReason:i}=G_();XA(g=>{n.trapped&&!o.paused&&e("release-requested",g)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=g=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:m,altKey:y,ctrlKey:b,metaKey:w,currentTarget:x,shiftKey:v}=g,{loop:S}=n,E=m===Or.tab&&!y&&!b&&!w,C=document.activeElement;if(E&&C){const P=x,[A,T]=$_(P);if(A&&T){if(!v&&C===T){const V=ka({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),S&&cs(A,!0))}else if(v&&[A,P].includes(C)){const V=ka({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),S&&cs(T,!0))}}else if(C===P){const V=ka({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||g.preventDefault()}}};l.provide(B_,{focusTrapRef:t,onKeydown:a}),l.watch(()=>n.focusTrapEl,g=>{g&&(t.value=g)},{immediate:!0}),l.watch([t],([g],[m])=>{g&&(g.addEventListener("keydown",a),g.addEventListener("focusin",d),g.addEventListener("focusout",f)),m&&(m.removeEventListener("keydown",a),m.removeEventListener("focusin",d),m.removeEventListener("focusout",f))});const c=g=>{e(Ig,g)},u=g=>e(Bg,g),d=g=>{const m=l.unref(t);if(!m)return;const y=g.target,b=g.relatedTarget,w=y&&m.contains(y);n.trapped||b&&m.contains(b)||(s=b),w&&e("focusin",g),!o.paused&&n.trapped&&(w?r=y:cs(r,!0))},f=g=>{const m=l.unref(t);if(!(o.paused||!m))if(n.trapped){const y=g.relatedTarget;!pa(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=ka({focusReason:i.value});e("focusout-prevented",b),b.defaultPrevented||cs(r,!0)}},0)}else{const y=g.target;y&&m.contains(y)||e("focusout",g)}};async function h(){await l.nextTick();const g=l.unref(t);if(g){Fg.push(o);const m=g.contains(document.activeElement)?s:document.activeElement;if(s=m,!g.contains(m)){const b=new Event(tu,Lg);g.addEventListener(tu,c),g.dispatchEvent(b),b.defaultPrevented||l.nextTick(()=>{let w=n.focusStartEl;en(w)||(cs(w),document.activeElement!==w&&(w="first")),w==="first"&&U_(jg(g),!0),(document.activeElement===m||w==="container")&&cs(g)})}}}function p(){const g=l.unref(t);if(g){g.removeEventListener(tu,c);const m=new CustomEvent(nu,{...Lg,detail:{focusReason:i.value}});g.addEventListener(nu,u),g.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!H_()||g.contains(document.activeElement))&&cs(s??document.body),g.removeEventListener(nu,u),Fg.remove(o)}}return l.onMounted(()=>{n.trapped&&h(),l.watch(()=>n.trapped,g=>{g?h():p()})}),l.onBeforeUnmount(()=>{n.trapped&&p(),t.value&&(t.value.removeEventListener("keydown",a),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",f),t.value=void 0)}),{onKeydown:a}}});function Y_(n,e,t,s,r,i){return l.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Hg=ft(W_,[["render",Y_],["__file","focus-trap.vue"]]);const q_=["fixed","absolute"],J_=Ze({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:he(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Bc,default:"bottom"},popperOptions:{type:he(Object),default:()=>({})},strategy:{type:String,values:q_,default:"absolute"}}),Gg=Ze({...J_,id:String,style:{type:he([String,Array,Object])},className:{type:he([String,Array,Object])},effect:{type:he(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:he([String,Array,Object])},popperStyle:{type:he([String,Array,Object])},referenceEl:{type:he(Object)},triggerTargetEl:{type:he(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Jc(["ariaLabel"])}),X_={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},K_=(n,e=[])=>{const{placement:t,strategy:s,popperOptions:r}=n,i={placement:t,strategy:s,...r,modifiers:[...Q_(n),...e]};return eT(i,r==null?void 0:r.modifiers),i},Z_=n=>{if(Ge)return is(n)};function Q_(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:s}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:s}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function eT(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const tT=0,nT=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:s,role:r}=l.inject(Qc,void 0),i=l.ref(),o=l.ref(),a=l.computed(()=>({name:"eventListeners",enabled:!!n.visible})),c=l.computed(()=>{var b;const w=l.unref(i),x=(b=l.unref(o))!=null?b:tT;return{name:"arrow",enabled:!OP(w),options:{element:w,padding:x}}}),u=l.computed(()=>({onFirstUpdate:()=>{g()},...K_(n,[l.unref(c),l.unref(a)])})),d=l.computed(()=>Z_(n.referenceEl)||l.unref(s)),{attributes:f,state:h,styles:p,update:g,forceUpdate:m,instanceRef:y}=YA(d,t,u);return l.watch(y,b=>e.value=b),l.onMounted(()=>{l.watch(()=>{var b;return(b=l.unref(d))==null?void 0:b.getBoundingClientRect()},()=>{g()})}),{attributes:f,arrowRef:i,contentRef:t,instanceRef:y,state:h,styles:p,role:r,forceUpdate:m,update:g}},sT=(n,{attributes:e,styles:t,role:s})=>{const{nextZIndex:r}=Cg(),i=mt("popper"),o=l.computed(()=>l.unref(e).popper),a=l.ref(jt(n.zIndex)?n.zIndex:r()),c=l.computed(()=>[i.b(),i.is("pure",n.pure),i.is(n.effect),n.popperClass]),u=l.computed(()=>[{zIndex:l.unref(a)},l.unref(t).popper,n.popperStyle||{}]),d=l.computed(()=>s.value==="dialog"?"false":void 0),f=l.computed(()=>l.unref(t).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=jt(n.zIndex)?n.zIndex:r()}}},rT=(n,e)=>{const t=l.ref(!1),s=l.ref();return{focusStartRef:s,trapped:t,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(s.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{n.visible&&!t.value&&(u.target&&(s.value=u.target),t.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},iT=l.defineComponent({name:"ElPopperContent"}),oT=l.defineComponent({...iT,props:Gg,emits:X_,setup(n,{expose:e,emit:t}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=rT(s,t),{attributes:f,arrowRef:h,contentRef:p,styles:g,instanceRef:m,role:y,update:b}=nT(s),{ariaModal:w,arrowStyle:x,contentAttrs:v,contentClass:S,contentStyle:E,updateZIndex:C}=sT(s,{styles:g,attributes:f,role:y}),P=l.inject(Na,void 0),A=l.ref();l.provide(_g,{arrowStyle:x,arrowRef:h,arrowOffset:A}),P&&l.provide(Na,{...P,addInputId:os,removeInputId:os});let T;const k=(R=!0)=>{b(),R&&C()},V=()=>{k(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return l.onMounted(()=>{l.watch(()=>s.triggerTargetEl,(R,j)=>{T==null||T(),T=void 0;const N=l.unref(R||p.value),M=l.unref(j||p.value);Gn(N)&&(T=l.watch([y,()=>s.ariaLabel,w,()=>s.id],D=>{["role","aria-label","aria-modal","id"].forEach((B,G)=>{pa(D[G])?N.removeAttribute(B):N.setAttribute(B,D[G])})},{immediate:!0})),M!==N&&Gn(M)&&["role","aria-label","aria-modal","id"].forEach(D=>{M.removeAttribute(D)})},{immediate:!0}),l.watch(()=>s.visible,V,{immediate:!0})}),l.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:p,popperInstanceRef:m,updatePopper:k,contentStyle:E}),(R,j)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({ref_key:"contentRef",ref:p},l.unref(v),{style:l.unref(E),class:l.unref(S),tabindex:"-1",onMouseenter:N=>R.$emit("mouseenter",N),onMouseleave:N=>R.$emit("mouseleave",N)}),[l.createVNode(l.unref(Hg),{trapped:l.unref(i),"trap-on-focus-in":!0,"focus-trap-el":l.unref(p),"focus-start-el":l.unref(r),onFocusAfterTrapped:l.unref(a),onFocusAfterReleased:l.unref(o),onFocusin:l.unref(c),onFocusoutPrevented:l.unref(u),onReleaseRequested:l.unref(d)},{default:l.withCtx(()=>[l.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var aT=ft(oT,[["__file","content.vue"]]);const lT=js(N_),iu=Symbol("elTooltip"),Wg=Ze({...QA,...Gg,appendTo:{type:he([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:he(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Jc(["ariaLabel"])}),Yg=Ze({...Rg,disabled:Boolean,trigger:{type:he([String,Array]),default:"hover"},triggerKeys:{type:he(Array),default:()=>[Or.enter,Or.space]}}),{useModelToggleProps:cT,useModelToggleEmits:uT,useModelToggle:dT}=HN("visible"),hT=Ze({...Tg,...cT,...Wg,...Yg,...kg,showArrow:{type:Boolean,default:!0}}),fT=[...uT,"before-show","before-hide","show","hide","open","close"],pT=(n,e)=>$v(n)?n.includes(e):n===e,kr=(n,e,t)=>s=>{pT(l.unref(n),e)&&t(s)},gT=l.defineComponent({name:"ElTooltipTrigger"}),mT=l.defineComponent({...gT,props:Yg,setup(n,{expose:e}){const t=n,s=mt("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:c,onToggle:u}=l.inject(iu,void 0),d=l.ref(null),f=()=>{if(l.unref(r)||t.disabled)return!0},h=l.toRef(t,"trigger"),p=zn(f,kr(h,"hover",a)),g=zn(f,kr(h,"hover",c)),m=zn(f,kr(h,"click",v=>{v.button===0&&u(v)})),y=zn(f,kr(h,"focus",a)),b=zn(f,kr(h,"focus",c)),w=zn(f,kr(h,"contextmenu",v=>{v.preventDefault(),u(v)})),x=zn(f,v=>{const{code:S}=v;t.triggerKeys.includes(S)&&(v.preventDefault(),u(v))});return e({triggerRef:d}),(v,S)=>(l.openBlock(),l.createBlock(l.unref(R_),{id:l.unref(i),"virtual-ref":v.virtualRef,open:l.unref(o),"virtual-triggering":v.virtualTriggering,class:l.normalizeClass(l.unref(s).e("trigger")),onBlur:l.unref(b),onClick:l.unref(m),onContextmenu:l.unref(w),onFocus:l.unref(y),onMouseenter:l.unref(p),onMouseleave:l.unref(g),onKeydown:l.unref(x)},{default:l.withCtx(()=>[l.renderSlot(v.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var yT=ft(mT,[["__file","trigger.vue"]]);const bT=Ze({to:{type:he([String,Object]),required:!0},disabled:Boolean});var wT=ft(l.defineComponent({__name:"teleport",props:bT,setup(n){return(e,t)=>e.disabled?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(),l.createBlock(l.Teleport,{key:1,to:e.to},[l.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const xT=js(wT),vT=l.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),CT=l.defineComponent({...vT,props:Wg,setup(n,{expose:e}){const t=n,{selector:s}=gg(),r=mt("tooltip"),i=l.ref(null);let o;const{controlled:a,id:c,open:u,trigger:d,onClose:f,onOpen:h,onShow:p,onHide:g,onBeforeShow:m,onBeforeHide:y}=l.inject(iu,void 0),b=l.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),w=l.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);l.onBeforeUnmount(()=>{o==null||o()});const x=l.computed(()=>l.unref(w)?!0:l.unref(u)),v=l.computed(()=>t.disabled?!1:l.unref(u)),S=l.computed(()=>t.appendTo||s.value),E=l.computed(()=>{var M;return(M=t.style)!=null?M:{}}),C=l.ref(!0),P=()=>{g(),C.value=!0},A=()=>{if(l.unref(a))return!0},T=zn(A,()=>{t.enterable&&l.unref(d)==="hover"&&h()}),k=zn(A,()=>{l.unref(d)==="hover"&&f()}),V=()=>{var M,D;(D=(M=i.value)==null?void 0:M.updatePopper)==null||D.call(M),m==null||m()},R=()=>{y==null||y()},j=()=>{p(),o=Av(l.computed(()=>{var M;return(M=i.value)==null?void 0:M.popperContentRef}),()=>{if(l.unref(a))return;l.unref(d)!=="hover"&&f()})},N=()=>{t.virtualTriggering||f()};return l.watch(()=>l.unref(u),M=>{M?C.value=!1:o==null||o()},{flush:"post"}),l.watch(()=>t.content,()=>{var M,D;(D=(M=i.value)==null?void 0:M.updatePopper)==null||D.call(M)}),e({contentRef:i}),(M,D)=>(l.openBlock(),l.createBlock(l.unref(xT),{disabled:!M.teleported,to:l.unref(S)},{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(b),onAfterLeave:P,onBeforeEnter:V,onAfterEnter:j,onBeforeLeave:R},{default:l.withCtx(()=>[l.unref(x)?l.withDirectives((l.openBlock(),l.createBlock(l.unref(aT),l.mergeProps({key:0,id:l.unref(c),ref_key:"contentRef",ref:i},M.$attrs,{"aria-label":M.ariaLabel,"aria-hidden":C.value,"boundaries-padding":M.boundariesPadding,"fallback-placements":M.fallbackPlacements,"gpu-acceleration":M.gpuAcceleration,offset:M.offset,placement:M.placement,"popper-options":M.popperOptions,strategy:M.strategy,effect:M.effect,enterable:M.enterable,pure:M.pure,"popper-class":M.popperClass,"popper-style":[M.popperStyle,l.unref(E)],"reference-el":M.referenceEl,"trigger-target-el":M.triggerTargetEl,visible:l.unref(v),"z-index":M.zIndex,onMouseenter:l.unref(T),onMouseleave:l.unref(k),onBlur:N,onClose:l.unref(f)}),{default:l.withCtx(()=>[l.renderSlot(M.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[l.vShow,l.unref(v)]]):l.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var ST=ft(CT,[["__file","content.vue"]]);const ET=l.defineComponent({name:"ElTooltip"}),OT=l.defineComponent({...ET,props:hT,emits:fT,setup(n,{expose:e,emit:t}){const s=n;ZA();const r=Ma(),i=l.ref(),o=l.ref(),a=()=>{var b;const w=l.unref(i);w&&((b=w.popperInstanceRef)==null||b.update())},c=l.ref(!1),u=l.ref(),{show:d,hide:f,hasUpdateHandler:h}=dT({indicator:c,toggleReason:u}),{onOpen:p,onClose:g}=e_({showAfter:l.toRef(s,"showAfter"),hideAfter:l.toRef(s,"hideAfter"),autoClose:l.toRef(s,"autoClose"),open:d,close:f}),m=l.computed(()=>ga(s.visible)&&!h.value);l.provide(iu,{controlled:m,id:r,open:l.readonly(c),trigger:l.toRef(s,"trigger"),onOpen:b=>{p(b)},onClose:b=>{g(b)},onToggle:b=>{l.unref(c)?g(b):p(b)},onShow:()=>{t("show",u.value)},onHide:()=>{t("hide",u.value)},onBeforeShow:()=>{t("before-show",u.value)},onBeforeHide:()=>{t("before-hide",u.value)},updatePopper:a}),l.watch(()=>s.disabled,b=>{b&&c.value&&(c.value=!1)});const y=b=>{var w,x;const v=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,S=(b==null?void 0:b.relatedTarget)||document.activeElement;return v&&v.contains(S)};return l.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:a,onOpen:p,onClose:g,hide:f}),(b,w)=>(l.openBlock(),l.createBlock(l.unref(lT),{ref_key:"popperRef",ref:i,role:b.role},{default:l.withCtx(()=>[l.createVNode(yT,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:l.withCtx(()=>[b.$slots.default?l.renderSlot(b.$slots,"default",{key:0}):l.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),l.createVNode(ST,{ref_key:"contentRef",ref:o,"aria-label":b.ariaLabel,"boundaries-padding":b.boundariesPadding,content:b.content,disabled:b.disabled,effect:b.effect,enterable:b.enterable,"fallback-placements":b.fallbackPlacements,"hide-after":b.hideAfter,"gpu-acceleration":b.gpuAcceleration,offset:b.offset,persistent:b.persistent,"popper-class":b.popperClass,"popper-style":b.popperStyle,placement:b.placement,"popper-options":b.popperOptions,pure:b.pure,"raw-content":b.rawContent,"reference-el":b.referenceEl,"trigger-target-el":b.triggerTargetEl,"show-after":b.showAfter,strategy:b.strategy,teleported:b.teleported,transition:b.transition,"virtual-triggering":b.virtualTriggering,"z-index":b.zIndex,"append-to":b.appendTo},{default:l.withCtx(()=>[l.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(l.openBlock(),l.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(l.openBlock(),l.createElementBlock("span",{key:1},l.toDisplayString(b.content),1))]),b.showArrow?(l.openBlock(),l.createBlock(l.unref(T_),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):l.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var MT=ft(OT,[["__file","tooltip.vue"]]);const qg=js(MT),PT=Ze({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:he([String,Object,Array])},offset:{type:he(Array),default:[0,0]},badgeClass:{type:String}}),NT=l.defineComponent({name:"ElBadge"}),AT=l.defineComponent({...NT,props:PT,setup(n,{expose:e}){const t=n,s=mt("badge"),r=l.computed(()=>t.isDot?"":jt(t.value)&&jt(t.max)?t.max<t.value?`${t.max}+`:`${t.value}`:`${t.value}`),i=l.computed(()=>{var o,a,c,u,d;return[{backgroundColor:t.color,marginRight:Li(-((a=(o=t.offset)==null?void 0:o[0])!=null?a:0)),marginTop:Li((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:r}),(o,a)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(s).b())},[l.renderSlot(o.$slots,"default"),l.createVNode(l.Transition,{name:`${l.unref(s).namespace.value}-zoom-in-center`,persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("sup",{class:l.normalizeClass([l.unref(s).e("content"),l.unref(s).em("content",o.type),l.unref(s).is("fixed",!!o.$slots.default),l.unref(s).is("dot",o.isDot),l.unref(s).is("hide-zero",!o.showZero&&t.value===0),o.badgeClass]),style:l.normalizeStyle(l.unref(i)),textContent:l.toDisplayString(l.unref(r))},null,14,["textContent"]),[[l.vShow,!o.hidden&&(l.unref(r)||o.isDot)]])]),_:1},8,["name"])],2))}});var _T=ft(AT,[["__file","badge.vue"]]);const TT=js(_T),Jg=Symbol("buttonGroupContextKey"),kT=(n,e)=>{VN({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},l.computed(()=>n.type==="text"));const t=l.inject(Jg,void 0),s=Xc("button"),{form:r}=Ng(),i=Pg(l.computed(()=>t==null?void 0:t.size)),o=Zc(),a=l.ref(),c=l.useSlots(),u=l.computed(()=>n.type||(t==null?void 0:t.type)||""),d=l.computed(()=>{var g,m,y;return(y=(m=n.autoInsertSpace)!=null?m:(g=s.value)==null?void 0:g.autoInsertSpace)!=null?y:!1}),f=l.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),h=l.computed(()=>{var g;const m=(g=c.default)==null?void 0:g.call(c);if(d.value&&(m==null?void 0:m.length)===1){const y=m[0];if((y==null?void 0:y.type)===l.Text){const b=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(b.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:a,_props:f,shouldAddSpace:h,handleClick:g=>{if(o.value||n.loading){g.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",g)}}},ou=Ze({size:qc,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ii},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ii,default:()=>ya},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:he([String,Object]),default:"button"}}),VT={click:n=>n instanceof MouseEvent};function lt(n,e){DT(n)&&(n="100%");var t=RT(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function Va(n){return Math.min(1,Math.max(0,n))}function DT(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function RT(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Xg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Da(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Fs(n){return n.length===1?"0"+n:String(n)}function LT(n,e,t){return{r:lt(n,255)*255,g:lt(e,255)*255,b:lt(t,255)*255}}function Kg(n,e,t){n=lt(n,255),e=lt(e,255),t=lt(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=0,a=(s+r)/2;if(s===r)o=0,i=0;else{var c=s-r;switch(o=a>.5?c/(2-s-r):c/(s+r),s){case n:i=(e-t)/c+(e<t?6:0);break;case e:i=(t-n)/c+2;break;case t:i=(n-e)/c+4;break}i/=6}return{h:i,s:o,l:a}}function au(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function IT(n,e,t){var s,r,i;if(n=lt(n,360),e=lt(e,100),t=lt(t,100),e===0)r=t,i=t,s=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;s=au(a,o,n+1/3),r=au(a,o,n),i=au(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function Zg(n,e,t){n=lt(n,255),e=lt(e,255),t=lt(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=s,a=s-r,c=s===0?0:a/s;if(s===r)i=0;else{switch(s){case n:i=(e-t)/a+(e<t?6:0);break;case e:i=(t-n)/a+2;break;case t:i=(n-e)/a+4;break}i/=6}return{h:i,s:c,v:o}}function BT(n,e,t){n=lt(n,360)*6,e=lt(e,100),t=lt(t,100);var s=Math.floor(n),r=n-s,i=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),c=s%6,u=[t,o,i,i,a,t][c],d=[a,t,t,o,i,i][c],f=[i,i,a,t,t,o][c];return{r:u*255,g:d*255,b:f*255}}function Qg(n,e,t,s){var r=[Fs(Math.round(n).toString(16)),Fs(Math.round(e).toString(16)),Fs(Math.round(t).toString(16))];return s&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function jT(n,e,t,s,r){var i=[Fs(Math.round(n).toString(16)),Fs(Math.round(e).toString(16)),Fs(Math.round(t).toString(16)),Fs($T(s))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function $T(n){return Math.round(parseFloat(n)*255).toString(16)}function em(n){return _t(n)/255}function _t(n){return parseInt(n,16)}function zT(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var lu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function FT(n){var e={r:0,g:0,b:0},t=1,s=null,r=null,i=null,o=!1,a=!1;return typeof n=="string"&&(n=GT(n)),typeof n=="object"&&(Yn(n.r)&&Yn(n.g)&&Yn(n.b)?(e=LT(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Yn(n.h)&&Yn(n.s)&&Yn(n.v)?(s=Da(n.s),r=Da(n.v),e=BT(n.h,s,r),o=!0,a="hsv"):Yn(n.h)&&Yn(n.s)&&Yn(n.l)&&(s=Da(n.s),i=Da(n.l),e=IT(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Xg(t),{ok:o,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var UT="[-\\+]?\\d+%?",HT="[-\\+]?\\d*\\.\\d+%?",us="(?:".concat(HT,")|(?:").concat(UT,")"),cu="[\\s|\\(]+(".concat(us,")[,|\\s]+(").concat(us,")[,|\\s]+(").concat(us,")\\s*\\)?"),uu="[\\s|\\(]+(".concat(us,")[,|\\s]+(").concat(us,")[,|\\s]+(").concat(us,")[,|\\s]+(").concat(us,")\\s*\\)?"),ln={CSS_UNIT:new RegExp(us),rgb:new RegExp("rgb"+cu),rgba:new RegExp("rgba"+uu),hsl:new RegExp("hsl"+cu),hsla:new RegExp("hsla"+uu),hsv:new RegExp("hsv"+cu),hsva:new RegExp("hsva"+uu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function GT(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(lu[n])n=lu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=ln.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=ln.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ln.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=ln.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ln.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=ln.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ln.hex8.exec(n),t?{r:_t(t[1]),g:_t(t[2]),b:_t(t[3]),a:em(t[4]),format:e?"name":"hex8"}:(t=ln.hex6.exec(n),t?{r:_t(t[1]),g:_t(t[2]),b:_t(t[3]),format:e?"name":"hex"}:(t=ln.hex4.exec(n),t?{r:_t(t[1]+t[1]),g:_t(t[2]+t[2]),b:_t(t[3]+t[3]),a:em(t[4]+t[4]),format:e?"name":"hex8"}:(t=ln.hex3.exec(n),t?{r:_t(t[1]+t[1]),g:_t(t[2]+t[2]),b:_t(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Yn(n){return!!ln.CSS_UNIT.exec(String(n))}var WT=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var s;if(e instanceof n)return e;typeof e=="number"&&(e=zT(e)),this.originalInput=e;var r=FT(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(s=t.format)!==null&&s!==void 0?s:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,s,r,i=e.r/255,o=e.g/255,a=e.b/255;return i<=.03928?t=i/12.92:t=Math.pow((i+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*s+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=Xg(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Zg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Zg(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=Kg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=Kg(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),Qg(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),jT(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),s=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(s,")"):"rgba(".concat(e,", ").concat(t,", ").concat(s,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(lt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(lt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+Qg(this.r,this.g,this.b,!1),t=0,s=Object.entries(lu);t<s.length;t++){var r=s[t],i=r[0],o=r[1];if(e===o)return i}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var s=!1,r=this.a<1&&this.a>=0,i=!t&&r&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(s=this.toRgbString()),e==="prgb"&&(s=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(s=this.toHexString()),e==="hex3"&&(s=this.toHexString(!0)),e==="hex4"&&(s=this.toHex8String(!0)),e==="hex8"&&(s=this.toHex8String()),e==="name"&&(s=this.toName()),e==="hsl"&&(s=this.toHslString()),e==="hsv"&&(s=this.toHsvString()),s||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Va(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Va(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Va(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Va(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),s=(t.h+e)%360;return t.h=s<0?360+s:s,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var s=this.toRgb(),r=new n(e).toRgb(),i=t/100,o={r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var s=this.toHsl(),r=360/t,i=[this];for(s.h=(s.h-(r*e>>1)+720)%360;--e;)s.h=(s.h+r)%360,i.push(new n(s));return i},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),s=t.h,r=t.s,i=t.v,o=[],a=1/e;e--;)o.push(new n({h:s,s:r,v:i})),i=(i+a)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),s=new n(e).toRgb(),r=t.a+s.a*(1-t.a);return new n({r:(t.r*t.a+s.r*s.a*(1-t.a))/r,g:(t.g*t.a+s.g*s.a*(1-t.a))/r,b:(t.b*t.a+s.b*s.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),s=t.h,r=[this],i=360/e,o=1;o<e;o++)r.push(new n({h:(s+o*i)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function ds(n,e=20){return n.mix("#141414",e).toString()}function YT(n){const e=Zc(),t=mt("button");return l.computed(()=>{let s={},r=n.color;if(r){const i=r.match(/var\((.*?)\)/);i&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new WT(r),a=n.dark?o.tint(20).toString():ds(o,20);if(n.plain)s=t.cssVarBlock({"bg-color":n.dark?ds(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ds(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":a}),e.value&&(s[t.cssVarBlockName("disabled-bg-color")]=n.dark?ds(o,90):o.tint(90).toString(),s[t.cssVarBlockName("disabled-text-color")]=n.dark?ds(o,50):o.tint(50).toString(),s[t.cssVarBlockName("disabled-border-color")]=n.dark?ds(o,80):o.tint(80).toString());else{const c=n.dark?ds(o,30):o.tint(30).toString(),u=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(s=t.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":a,"active-border-color":a}),e.value){const d=n.dark?ds(o,50):o.tint(50).toString();s[t.cssVarBlockName("disabled-bg-color")]=d,s[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,s[t.cssVarBlockName("disabled-border-color")]=d}}}return s})}const qT=l.defineComponent({name:"ElButton"}),JT=l.defineComponent({...qT,props:ou,emits:VT,setup(n,{expose:e,emit:t}){const s=n,r=YT(s),i=mt("button"),{_ref:o,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=kT(s,t),p=l.computed(()=>[i.b(),i.m(c.value),i.m(a.value),i.is("disabled",u.value),i.is("loading",s.loading),i.is("plain",s.plain),i.is("round",s.round),i.is("circle",s.circle),i.is("text",s.text),i.is("link",s.link),i.is("has-bg",s.bg)]);return e({ref:o,size:a,type:c,disabled:u,shouldAddSpace:f}),(g,m)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.tag),l.mergeProps({ref_key:"_ref",ref:o},l.unref(d),{class:l.unref(p),style:l.unref(r),onClick:l.unref(h)}),{default:l.withCtx(()=>[g.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[g.$slots.loading?l.renderSlot(g.$slots,"loading",{key:0}):(l.openBlock(),l.createBlock(l.unref(On),{key:1,class:l.normalizeClass(l.unref(i).is("loading"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.loadingIcon)))]),_:1},8,["class"]))],64)):g.icon||g.$slots.icon?(l.openBlock(),l.createBlock(l.unref(On),{key:1},{default:l.withCtx(()=>[g.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.icon),{key:0})):l.renderSlot(g.$slots,"icon",{key:1})]),_:3})):l.createCommentVNode("v-if",!0),g.$slots.default?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass({[l.unref(i).em("text","expand")]:l.unref(f)})},[l.renderSlot(g.$slots,"default")],2)):l.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var XT=ft(JT,[["__file","button.vue"]]);const KT={size:ou.size,type:ou.type},ZT=l.defineComponent({name:"ElButtonGroup"}),QT=l.defineComponent({...ZT,props:KT,setup(n){const e=n;l.provide(Jg,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=mt("button");return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(s.$slots,"default")],2))}});var tm=ft(QT,[["__file","button-group.vue"]]);const ek=js(XT,{ButtonGroup:tm});PN(tm);function tk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const du="_trap-focus-children",Us=[],nm=n=>{var e;if(Us.length===0)return;const t=Us[Us.length-1][du];if(t.length>0&&n.code===Or.tab){if(t.length===1){n.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const s=n.shiftKey,r=n.target===t[0],i=n.target===t[t.length-1];if(r&&s&&(n.preventDefault(),t[t.length-1].focus()),i&&!s&&(n.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const o=t.indexOf(n.target);o!==-1&&((e=t[s?o-1:o+1])==null||e.focus())}}},nk={beforeMount(n){n[du]=Sh(n),Us.push(n),Us.length<=1&&document.addEventListener("keydown",nm)},updated(n){l.nextTick(()=>{n[du]=Sh(n)})},unmounted(){Us.shift(),Us.length===0&&document.removeEventListener("keydown",nm)}},sk=Ze({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:he([String,Array,Object])},zIndex:{type:he([String,Number])}}),rk={click:n=>n instanceof MouseEvent},ik="overlay";var ok=l.defineComponent({name:"ElOverlay",props:sk,emits:rk,setup(n,{slots:e,emit:t}){const s=mt(ik),r=c=>{t("click",c)},{onClick:i,onMousedown:o,onMouseup:a}=dg(n.customMaskEvent?void 0:r);return()=>n.mask?l.createVNode("div",{class:[s.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:i,onMousedown:o,onMouseup:a},[l.renderSlot(e,"default")],xa.STYLE|xa.CLASS|xa.PROPS,["onClick","onMouseup","onMousedown"]):l.h("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[l.renderSlot(e,"default")])}});const ak=ok,sm=["success","info","warning","error"],pt=zp({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Ge?document.body:void 0}),lk=Ze({customClass:{type:String,default:pt.customClass},center:{type:Boolean,default:pt.center},dangerouslyUseHTMLString:{type:Boolean,default:pt.dangerouslyUseHTMLString},duration:{type:Number,default:pt.duration},icon:{type:Ii,default:pt.icon},id:{type:String,default:pt.id},message:{type:he([String,Object,Function]),default:pt.message},onClose:{type:he(Function),default:pt.onClose},showClose:{type:Boolean,default:pt.showClose},type:{type:String,values:sm,default:pt.type},plain:{type:Boolean,default:pt.plain},offset:{type:Number,default:pt.offset},zIndex:{type:Number,default:pt.zIndex},grouping:{type:Boolean,default:pt.grouping},repeatNum:{type:Number,default:pt.repeatNum}}),ck={destroy:()=>!0},cn=l.shallowReactive([]),uk=n=>{const e=cn.findIndex(r=>r.id===n),t=cn[e];let s;return e>0&&(s=cn[e-1]),{current:t,prev:s}},dk=n=>{const{prev:e}=uk(n);return e?e.vm.exposed.bottom.value:0},hk=(n,e)=>cn.findIndex(s=>s.id===n)>0?16:e,fk=l.defineComponent({name:"ElMessage"}),pk=l.defineComponent({...fk,props:lk,emits:ck,setup(n,{expose:e}){const t=n,{Close:s}=jp,{ns:r,zIndex:i}=Og("message"),{currentZIndex:o,nextZIndex:a}=i,c=l.ref(),u=l.ref(!1),d=l.ref(0);let f;const h=l.computed(()=>t.type?t.type==="error"?"danger":t.type:"info"),p=l.computed(()=>{const C=t.type;return{[r.bm("icon",C)]:C&&wa[C]}}),g=l.computed(()=>t.icon||wa[t.type]||""),m=l.computed(()=>dk(t.id)),y=l.computed(()=>hk(t.id,t.offset)+m.value),b=l.computed(()=>d.value+y.value),w=l.computed(()=>({top:`${y.value}px`,zIndex:o.value}));function x(){t.duration!==0&&({stop:f}=Nv(()=>{S()},t.duration))}function v(){f==null||f()}function S(){u.value=!1}function E({code:C}){C===Or.esc&&S()}return l.onMounted(()=>{x(),a(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{v(),x()}),Fn(document,"keydown",E),_h(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:b,close:S}),(C,P)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:C.onClose,onAfterLeave:A=>C.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:C.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(C.type)]:C.type},l.unref(r).is("center",C.center),l.unref(r).is("closable",C.showClose),l.unref(r).is("plain",C.plain),C.customClass]),style:l.normalizeStyle(l.unref(w)),role:"alert",onMouseenter:v,onMouseleave:x},[C.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(TT),{key:0,value:C.repeatNum,type:l.unref(h),class:l.normalizeClass(l.unref(r).e("badge"))},null,8,["value","type","class"])):l.createCommentVNode("v-if",!0),l.unref(g)?(l.openBlock(),l.createBlock(l.unref(On),{key:1,class:l.normalizeClass([l.unref(r).e("icon"),l.unref(p)])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(g))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.renderSlot(C.$slots,"default",{},()=>[C.dangerouslyUseHTMLString?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),l.createElementVNode("p",{class:l.normalizeClass(l.unref(r).e("content")),innerHTML:C.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(C.message),3))]),C.showClose?(l.openBlock(),l.createBlock(l.unref(On),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(S,["stop"])},{default:l.withCtx(()=>[l.createVNode(l.unref(s))]),_:1},8,["class","onClick"])):l.createCommentVNode("v-if",!0)],46,["id"]),[[l.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var gk=ft(pk,[["__file","message.vue"]]);let mk=1;const rm=n=>{const e=!n||en(n)||l.isVNode(n)||Lt(n)?{message:n}:n,t={...pt,...e};if(!t.appendTo)t.appendTo=document.body;else if(en(t.appendTo)){let s=document.querySelector(t.appendTo);Gn(s)||(At("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),t.appendTo=s}return ga(on.grouping)&&!t.grouping&&(t.grouping=on.grouping),jt(on.duration)&&t.duration===3e3&&(t.duration=on.duration),jt(on.offset)&&t.offset===16&&(t.offset=on.offset),ga(on.showClose)&&!t.showClose&&(t.showClose=on.showClose),t},yk=n=>{const e=cn.indexOf(n);if(e===-1)return;cn.splice(e,1);const{handler:t}=n;t.close()},bk=({appendTo:n,...e},t)=>{const s=`message_${mk++}`,r=e.onClose,i=document.createElement("div"),o={...e,id:s,onClose:()=>{r==null||r(),yk(d)},onDestroy:()=>{l.render(null,i)}},a=l.createVNode(gk,o,Lt(o.message)||l.isVNode(o.message)?{default:Lt(o.message)?o.message:()=>o.message}:null);a.appContext=t||Vr._context,l.render(a,i),n.appendChild(i.firstElementChild);const c=a.component,d={id:s,vnode:a,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:a.component.props};return d},Vr=(n={},e)=>{if(!Ge)return{close:()=>{}};const t=rm(n);if(t.grouping&&cn.length){const r=cn.find(({vnode:i})=>{var o;return((o=i.props)==null?void 0:o.message)===t.message});if(r)return r.props.repeatNum+=1,r.props.type=t.type,r.handler}if(jt(on.max)&&cn.length>=on.max)return{close:()=>{}};const s=bk(t,e);return cn.push(s),s.handler};sm.forEach(n=>{Vr[n]=(e={},t)=>{const s=rm(e);return Vr({...s,type:n},t)}});function wk(n){for(const e of cn)(!n||n===e.props.type)&&e.handler.close()}Vr.closeAll=wk,Vr._context=null;const Ye=MN(Vr,"$message"),xk=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:nk},components:{ElButton:ek,ElFocusTrap:Hg,ElInput:O_,ElOverlay:ak,ElIcon:On,...jp},inheritAttrs:!1,props:{buttonSize:{type:String,validator:NN},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(n,{emit:e}){const{locale:t,zIndex:s,ns:r,size:i}=Og("message-box",l.computed(()=>n.buttonSize)),{t:o}=t,{nextZIndex:a}=s,c=l.ref(!1),u=l.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:l.markRaw(ya),cancelButtonLoadingIcon:l.markRaw(ya),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=l.computed(()=>{const M=u.type;return{[r.bm("icon",M)]:M&&wa[M]}}),f=Ma(),h=Ma(),p=l.computed(()=>u.icon||wa[u.type]||""),g=l.computed(()=>!!u.message),m=l.ref(),y=l.ref(),b=l.ref(),w=l.ref(),x=l.ref(),v=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async M=>{await l.nextTick(),n.boxType==="prompt"&&M!==null&&V()},{immediate:!0}),l.watch(()=>c.value,M=>{var D,B;M&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(B=(D=x.value)==null?void 0:D.$el)!=null?B:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(M?l.nextTick().then(()=>{var G;w.value&&w.value.$el&&(u.autofocus?b.value=(G=R())!=null?G:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const S=l.computed(()=>n.draggable),E=l.computed(()=>n.overflow);DN(m,y,S,E),l.onMounted(async()=>{await l.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",C)}),l.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",C)});function C(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const P=()=>{n.closeOnClickModal&&k(u.distinguishCancelAndClose?"close":"cancel")},A=dg(P),T=M=>{if(u.inputType!=="textarea")return M.preventDefault(),k("confirm")},k=M=>{var D;n.boxType==="prompt"&&M==="confirm"&&!V()||(u.action=M,u.beforeClose?(D=u.beforeClose)==null||D.call(u,M,u,C):C())},V=()=>{if(n.boxType==="prompt"){const M=u.inputPattern;if(M&&!M.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;const D=u.inputValidator;if(typeof D=="function"){const B=D(u.inputValue);if(B===!1)return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;if(typeof B=="string")return u.editorErrorMessage=B,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},R=()=>{const M=w.value.$refs;return M.input||M.textarea},j=()=>{k("close")},N=()=>{n.closeOnPressEscape&&j()};return n.lockScroll&&zN(c),{...l.toRefs(u),ns:r,overlayEvent:A,visible:c,hasMessage:g,typeClass:d,contentId:f,inputId:h,btnSize:i,iconComponent:p,confirmButtonClasses:v,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:C,handleClose:j,onCloseRequested:N,handleWrapperClick:P,handleInputEnter:T,handleAction:k,t:o}}});function vk(n,e,t,s,r,i){const o=l.resolveComponent("el-icon"),a=l.resolveComponent("close"),c=l.resolveComponent("el-input"),u=l.resolveComponent("el-button"),d=l.resolveComponent("el-focus-trap"),f=l.resolveComponent("el-overlay");return l.openBlock(),l.createBlock(l.Transition,{name:"fade-in-linear",onAfterLeave:h=>n.$emit("vanish"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(f,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:l.withCtx(()=>[l.createElementVNode("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:l.normalizeClass(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[l.createVNode(d,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:l.withCtx(()=>[l.createElementVNode("div",{ref:"rootRef",class:l.normalizeClass([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:l.normalizeStyle(n.customStyle),tabindex:"-1",onClick:l.withModifiers(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,ref:"headerRef",class:l.normalizeClass([n.ns.e("header"),{"show-close":n.showClose}])},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("title"))},[n.iconComponent&&n.center?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.createElementVNode("span",null,l.toDisplayString(n.title),1)],2),n.showClose?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:h=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[l.createVNode(o,{class:l.normalizeClass(n.ns.e("close"))},{default:l.withCtx(()=>[l.createVNode(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):l.createCommentVNode("v-if",!0)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{id:n.contentId,class:l.normalizeClass(n.ns.e("content"))},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),n.hasMessage?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(n.ns.e("message"))},[l.renderSlot(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):l.createCommentVNode("v-if",!0)],2),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("input"))},[l.createVNode(c,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":h=>n.inputValue=h,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:l.normalizeClass({invalid:n.validateError}),onKeydown:l.withKeys(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("errormsg")),style:l.normalizeStyle({visibility:n.editorErrorMessage?"visible":"hidden"})},l.toDisplayString(n.editorErrorMessage),7)],2),[[l.vShow,n.showInput]])],10,["id"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("btns"))},[n.showCancelButton?(l.openBlock(),l.createBlock(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:l.normalizeClass([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:h=>n.handleAction("cancel"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:l.normalizeClass([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:h=>n.handleAction("confirm"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[l.vShow,n.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[l.vShow,n.visible]])]),_:3},8,["onAfterLeave"])}var Ck=ft(xk,[["render",vk],["__file","index.vue"]]);const Gi=new Map,Sk=n=>{let e=document.body;return n.appendTo&&(en(n.appendTo)&&(e=document.querySelector(n.appendTo)),Gn(n.appendTo)&&(e=n.appendTo),Gn(e)||(At("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},Ek=(n,e,t=null)=>{const s=l.createVNode(Ck,n,Lt(n.message)||l.isVNode(n.message)?{default:Lt(n.message)?n.message:()=>n.message}:null);return s.appContext=t,l.render(s,e),Sk(n).appendChild(e.firstElementChild),s.component},Ok=()=>document.createElement("div"),Mk=(n,e)=>{const t=Ok();n.onVanish=()=>{l.render(null,t),Gi.delete(r)},n.onAction=i=>{const o=Gi.get(r);let a;n.showInput?a={value:r.inputValue,action:i}:a=i,n.callback?n.callback(a,s.proxy):i==="cancel"||i==="close"?n.distinguishCancelAndClose&&i!=="cancel"?o.reject("close"):o.reject("cancel"):o.resolve(a)};const s=Ek(n,t,e),r=s.proxy;for(const i in n)Go(n,i)&&!Go(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function Dr(n,e=null){if(!Ge)return Promise.reject();let t;return en(n)||l.isVNode(n)?n={message:n}:t=n.callback,new Promise((s,r)=>{const i=Mk(n,e??Dr._context);Gi.set(i,{options:n,callback:t,resolve:s,reject:r})})}const Pk=["alert","confirm","prompt"],Nk={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Pk.forEach(n=>{Dr[n]=Ak(n)});function Ak(n){return(e,t,s,r)=>{let i="";return pr(t)?(s=t,i=""):Mp(t)?i="":i=t,Dr(Object.assign({title:i,message:e,type:"",...Nk[n]},s,{boxType:n}),r)}}Dr.close=()=>{Gi.forEach((n,e)=>{e.doClose()}),Gi.clear()},Dr._context=null;const hs=Dr;hs.install=n=>{hs._context=n._context,n.config.globalProperties.$msgbox=hs,n.config.globalProperties.$messageBox=hs,n.config.globalProperties.$alert=hs.alert,n.config.globalProperties.$confirm=hs.confirm,n.config.globalProperties.$prompt=hs.prompt};const _k=hs;function im(n,e){return function(){return n.apply(e,arguments)}}const{toString:Tk}=Object.prototype,{getPrototypeOf:hu}=Object,Ra=(n=>e=>{const t=Tk.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),un=n=>(n=n.toLowerCase(),e=>Ra(e)===n),La=n=>e=>typeof e===n,{isArray:Rr}=Array,Wi=La("undefined");function kk(n){return n!==null&&!Wi(n)&&n.constructor!==null&&!Wi(n.constructor)&&Tt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const om=un("ArrayBuffer");function Vk(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&om(n.buffer),e}const Dk=La("string"),Tt=La("function"),am=La("number"),Ia=n=>n!==null&&typeof n=="object",Rk=n=>n===!0||n===!1,Ba=n=>{if(Ra(n)!=="object")return!1;const e=hu(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Lk=un("Date"),Ik=un("File"),Bk=un("Blob"),jk=un("FileList"),$k=n=>Ia(n)&&Tt(n.pipe),zk=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Tt(n.append)&&((e=Ra(n))==="formdata"||e==="object"&&Tt(n.toString)&&n.toString()==="[object FormData]"))},Fk=un("URLSearchParams"),[Uk,Hk,Gk,Wk]=["ReadableStream","Request","Response","Headers"].map(un),Yk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yi(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),Rr(n))for(s=0,r=n.length;s<r;s++)e.call(null,n[s],s,n);else{const i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,n[a],a,n)}}function lm(n,e){e=e.toLowerCase();const t=Object.keys(n);let s=t.length,r;for(;s-- >0;)if(r=t[s],e===r.toLowerCase())return r;return null}const Hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,cm=n=>!Wi(n)&&n!==Hs;function fu(){const{caseless:n}=cm(this)&&this||{},e={},t=(s,r)=>{const i=n&&lm(e,r)||r;Ba(e[i])&&Ba(s)?e[i]=fu(e[i],s):Ba(s)?e[i]=fu({},s):Rr(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Yi(arguments[s],t);return e}const qk=(n,e,t,{allOwnKeys:s}={})=>(Yi(e,(r,i)=>{t&&Tt(r)?n[i]=im(r,t):n[i]=r},{allOwnKeys:s}),n),Jk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Xk=(n,e,t,s)=>{n.prototype=Object.create(e.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},Kk=(n,e,t,s)=>{let r,i,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),i=r.length;i-- >0;)o=r[i],(!s||s(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&hu(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Zk=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const s=n.indexOf(e,t);return s!==-1&&s===t},Qk=n=>{if(!n)return null;if(Rr(n))return n;let e=n.length;if(!am(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},eV=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&hu(Uint8Array)),tV=(n,e)=>{const s=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(n,i[0],i[1])}},nV=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},sV=un("HTMLFormElement"),rV=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),um=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),iV=un("RegExp"),dm=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};Yi(t,(r,i)=>{let o;(o=e(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},oV=n=>{dm(n,(e,t)=>{if(Tt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(Tt(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},aV=(n,e)=>{const t={},s=r=>{r.forEach(i=>{t[i]=!0})};return Rr(n)?s(n):s(String(n).split(e)),t},lV=()=>{},cV=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,pu="abcdefghijklmnopqrstuvwxyz",hm="0123456789",fm={DIGIT:hm,ALPHA:pu,ALPHA_DIGIT:pu+pu.toUpperCase()+hm},uV=(n=16,e=fm.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;n--;)t+=e[Math.random()*s|0];return t};function dV(n){return!!(n&&Tt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const hV=n=>{const e=new Array(10),t=(s,r)=>{if(Ia(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=Rr(s)?[]:{};return Yi(s,(o,a)=>{const c=t(o,r+1);!Wi(c)&&(i[a]=c)}),e[r]=void 0,i}}return s};return t(n,0)},fV=un("AsyncFunction"),pV=n=>n&&(Ia(n)||Tt(n))&&Tt(n.then)&&Tt(n.catch),pm=((n,e)=>n?setImmediate:e?((t,s)=>(Hs.addEventListener("message",({source:r,data:i})=>{r===Hs&&i===t&&s.length&&s.shift()()},!1),r=>{s.push(r),Hs.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Tt(Hs.postMessage)),gV=typeof queueMicrotask<"u"?queueMicrotask.bind(Hs):typeof process<"u"&&process.nextTick||pm,L={isArray:Rr,isArrayBuffer:om,isBuffer:kk,isFormData:zk,isArrayBufferView:Vk,isString:Dk,isNumber:am,isBoolean:Rk,isObject:Ia,isPlainObject:Ba,isReadableStream:Uk,isRequest:Hk,isResponse:Gk,isHeaders:Wk,isUndefined:Wi,isDate:Lk,isFile:Ik,isBlob:Bk,isRegExp:iV,isFunction:Tt,isStream:$k,isURLSearchParams:Fk,isTypedArray:eV,isFileList:jk,forEach:Yi,merge:fu,extend:qk,trim:Yk,stripBOM:Jk,inherits:Xk,toFlatObject:Kk,kindOf:Ra,kindOfTest:un,endsWith:Zk,toArray:Qk,forEachEntry:tV,matchAll:nV,isHTMLForm:sV,hasOwnProperty:um,hasOwnProp:um,reduceDescriptors:dm,freezeMethods:oV,toObjectSet:aV,toCamelCase:rV,noop:lV,toFiniteNumber:cV,findKey:lm,global:Hs,isContextDefined:cm,ALPHABET:fm,generateString:uV,isSpecCompliantForm:dV,toJSONObject:hV,isAsyncFn:fV,isThenable:pV,setImmediate:pm,asap:gV};function ue(n,e,t,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}L.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.status}}});const gm=ue.prototype,mm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{mm[n]={value:n}}),Object.defineProperties(ue,mm),Object.defineProperty(gm,"isAxiosError",{value:!0}),ue.from=(n,e,t,s,r,i)=>{const o=Object.create(gm);return L.toFlatObject(n,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ue.call(o,n.message,e,t,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const mV=null;function gu(n){return L.isPlainObject(n)||L.isArray(n)}function ym(n){return L.endsWith(n,"[]")?n.slice(0,-2):n}function bm(n,e,t){return n?n.concat(e).map(function(r,i){return r=ym(r),!t&&i?"["+r+"]":r}).join(t?".":""):e}function yV(n){return L.isArray(n)&&!n.some(gu)}const bV=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function ja(n,e,t){if(!L.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=L.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!L.isUndefined(y[m])});const s=t.metaTokens,r=t.visitor||d,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(e);if(!L.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(L.isDate(g))return g.toISOString();if(!c&&L.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(g)||L.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(L.endsWith(m,"{}"))m=s?m:m.slice(0,-2),g=JSON.stringify(g);else if(L.isArray(g)&&yV(g)||(L.isFileList(g)||L.endsWith(m,"[]"))&&(b=L.toArray(g)))return m=ym(m),b.forEach(function(x,v){!(L.isUndefined(x)||x===null)&&e.append(o===!0?bm([m],v,i):o===null?m:m+"[]",u(x))}),!1}return gu(g)?!0:(e.append(bm(y,m,i),u(g)),!1)}const f=[],h=Object.assign(bV,{defaultVisitor:d,convertValue:u,isVisitable:gu});function p(g,m){if(!L.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),L.forEach(g,function(b,w){(!(L.isUndefined(b)||b===null)&&r.call(e,b,L.isString(w)?w.trim():w,m,h))===!0&&p(b,m?m.concat(w):[w])}),f.pop()}}if(!L.isObject(n))throw new TypeError("data must be an object");return p(n),e}function wm(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function mu(n,e){this._pairs=[],n&&ja(n,this,e)}const xm=mu.prototype;xm.append=function(e,t){this._pairs.push([e,t])},xm.toString=function(e){const t=e?function(s){return e.call(this,s,wm)}:wm;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function wV(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function vm(n,e,t){if(!e)return n;const s=t&&t.encode||wV,r=t&&t.serialize;let i;if(r?i=r(e,t):i=L.isURLSearchParams(e)?e.toString():new mu(e,t).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Cm{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Sm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xV={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:mu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},yu=typeof window<"u"&&typeof document<"u",bu=typeof navigator=="object"&&navigator||void 0,vV=yu&&(!bu||["ReactNative","NativeScript","NS"].indexOf(bu.product)<0),CV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",SV=yu&&window.location.href||"http://localhost",St={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yu,hasStandardBrowserEnv:vV,hasStandardBrowserWebWorkerEnv:CV,navigator:bu,origin:SV},Symbol.toStringTag,{value:"Module"})),...xV};function EV(n,e){return ja(n,new St.classes.URLSearchParams,Object.assign({visitor:function(t,s,r,i){return St.isNode&&L.isBuffer(t)?(this.append(s,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function OV(n){return L.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function MV(n){const e={},t=Object.keys(n);let s;const r=t.length;let i;for(s=0;s<r;s++)i=t[s],e[i]=n[i];return e}function Em(n){function e(t,s,r,i){let o=t[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=t.length;return o=!o&&L.isArray(r)?r.length:o,c?(L.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!L.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],i)&&L.isArray(r[o])&&(r[o]=MV(r[o])),!a)}if(L.isFormData(n)&&L.isFunction(n.entries)){const t={};return L.forEachEntry(n,(s,r)=>{e(OV(s),r,t,0)}),t}return null}function PV(n,e,t){if(L.isString(n))try{return(e||JSON.parse)(n),L.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const qi={transitional:Sm,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r?JSON.stringify(Em(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return EV(e,this.formSerializer).toString();if((a=L.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ja(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),PV(e)):e}],transformResponse:[function(e){const t=this.transitional||qi.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(s&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?ue.from(a,ue.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:St.classes.FormData,Blob:St.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],n=>{qi.headers[n]={}});const NV=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),AV=n=>{const e={};let t,s,r;return n&&n.split(`
30
+ `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&NV[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Om=Symbol("internals");function Ji(n){return n&&String(n).trim().toLowerCase()}function $a(n){return n===!1||n==null?n:L.isArray(n)?n.map($a):String(n)}function _V(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(n);)e[s[1]]=s[2];return e}const TV=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function wu(n,e,t,s,r){if(L.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!L.isString(e)){if(L.isString(s))return e.indexOf(s)!==-1;if(L.isRegExp(s))return s.test(e)}}function kV(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function VV(n,e){const t=L.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+t,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class Et{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function i(a,c,u){const d=Ji(c);if(!d)throw new Error("header name must be a non-empty string");const f=L.findKey(r,d);(!f||r[f]===void 0||u===!0||u===void 0&&r[f]!==!1)&&(r[f||c]=$a(a))}const o=(a,c)=>L.forEach(a,(u,d)=>i(u,d,c));if(L.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(L.isString(e)&&(e=e.trim())&&!TV(e))o(AV(e),t);else if(L.isHeaders(e))for(const[a,c]of e.entries())i(c,a,s);else e!=null&&i(t,e,s);return this}get(e,t){if(e=Ji(e),e){const s=L.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return _V(r);if(L.isFunction(t))return t.call(this,r,s);if(L.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ji(e),e){const s=L.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||wu(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function i(o){if(o=Ji(o),o){const a=L.findKey(s,o);a&&(!t||wu(s,s[a],a,t))&&(delete s[a],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let s=t.length,r=!1;for(;s--;){const i=t[s];(!e||wu(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,s={};return L.forEach(this,(r,i)=>{const o=L.findKey(s,i);if(o){t[o]=$a(r),delete t[i];return}const a=e?kV(i):String(i).trim();a!==i&&delete t[i],t[a]=$a(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&L.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
31
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Om]=this[Om]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Ji(o);s[a]||(VV(r,o),s[a]=!0)}return L.isArray(e)?e.forEach(i):i(e),this}}Et.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(Et.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}}),L.freezeMethods(Et);function xu(n,e){const t=this||qi,s=e||t,r=Et.from(s.headers);let i=s.data;return L.forEach(n,function(a){i=a.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function Mm(n){return!!(n&&n.__CANCEL__)}function Lr(n,e,t){ue.call(this,n??"canceled",ue.ERR_CANCELED,e,t),this.name="CanceledError"}L.inherits(Lr,ue,{__CANCEL__:!0});function Pm(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new ue("Request failed with status code "+t.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function DV(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function RV(n,e){n=n||10;const t=new Array(n),s=new Array(n);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=s[i];o||(o=u),t[r]=c,s[r]=u;let f=i,h=0;for(;f!==r;)h+=t[f++],f=f%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),u-o<e)return;const p=d&&u-d;return p?Math.round(h*1e3/p):void 0}}function LV(n,e){let t=0,s=1e3/e,r,i;const o=(u,d=Date.now())=>{t=d,r=null,i&&(clearTimeout(i),i=null),n.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-t;f>=s?o(u,d):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-f)))},()=>r&&o(r)]}const za=(n,e,t=3)=>{let s=0;const r=RV(50,250);return LV(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-s,u=r(c),d=o<=a;s=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(f)},t)},Nm=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},Am=n=>(...e)=>L.asap(()=>n(...e)),IV=St.hasStandardBrowserEnv?function(){const e=St.navigator&&/(msie|trident)/i.test(St.navigator.userAgent),t=document.createElement("a");let s;function r(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=r(window.location.href),function(o){const a=L.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),BV=St.hasStandardBrowserEnv?{write(n,e,t,s,r,i){const o=[n+"="+encodeURIComponent(e)];L.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),L.isString(s)&&o.push("path="+s),L.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jV(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function $V(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function _m(n,e){return n&&!jV(e)?$V(n,e):e}const Tm=n=>n instanceof Et?{...n}:n;function Gs(n,e){e=e||{};const t={};function s(u,d,f){return L.isPlainObject(u)&&L.isPlainObject(d)?L.merge.call({caseless:f},u,d):L.isPlainObject(d)?L.merge({},d):L.isArray(d)?d.slice():d}function r(u,d,f){if(L.isUndefined(d)){if(!L.isUndefined(u))return s(void 0,u,f)}else return s(u,d,f)}function i(u,d){if(!L.isUndefined(d))return s(void 0,d)}function o(u,d){if(L.isUndefined(d)){if(!L.isUndefined(u))return s(void 0,u)}else return s(void 0,d)}function a(u,d,f){if(f in e)return s(u,d);if(f in n)return s(void 0,u)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d)=>r(Tm(u),Tm(d),!0)};return L.forEach(Object.keys(Object.assign({},n,e)),function(d){const f=c[d]||r,h=f(n[d],e[d],d);L.isUndefined(h)&&f!==a||(t[d]=h)}),t}const km=n=>{const e=Gs({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Et.from(o),e.url=vm(_m(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(L.isFormData(t)){if(St.hasStandardBrowserEnv||St.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(St.hasStandardBrowserEnv&&(s&&L.isFunction(s)&&(s=s(e)),s||s!==!1&&IV(e.url))){const u=r&&i&&BV.read(i);u&&o.set(r,u)}return e},zV=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,s){const r=km(n);let i=r.data;const o=Et.from(r.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=r,d,f,h,p,g;function m(){p&&p(),g&&g(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function b(){if(!y)return;const x=Et.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};Pm(function(C){t(C),m()},function(C){s(C),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(s(new ue("Request aborted",ue.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new ue("Network Error",ue.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||Sm;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),s(new ue(v,S.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&L.forEach(o.toJSON(),function(v,S){y.setRequestHeader(S,v)}),L.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([h,g]=za(u,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,p]=za(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new Lr(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const w=DV(r.url);if(w&&St.protocols.indexOf(w)===-1){s(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,n));return}y.send(i||null)})},FV=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let s=new AbortController,r;const i=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;s.abort(d instanceof ue?d:new Lr(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),n=null)};n.forEach(u=>u.addEventListener("abort",i));const{signal:c}=s;return c.unsubscribe=()=>L.asap(a),c}},UV=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let s=0,r;for(;s<t;)r=s+e,yield n.slice(s,r),s=r},HV=async function*(n,e){for await(const t of GV(n))yield*UV(t,e)},GV=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Vm=(n,e,t,s)=>{const r=HV(n,e);let i=0,o,a=c=>{o||(o=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){a(),c.close();return}let f=d.byteLength;if(t){let h=i+=f;t(h)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},Fa=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Dm=Fa&&typeof ReadableStream=="function",WV=Fa&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Rm=(n,...e)=>{try{return!!n(...e)}catch{return!1}},YV=Dm&&Rm(()=>{let n=!1;const e=new Request(St.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Lm=64*1024,vu=Dm&&Rm(()=>L.isReadableStream(new Response("").body)),Ua={stream:vu&&(n=>n.body)};Fa&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ua[e]&&(Ua[e]=L.isFunction(n[e])?t=>t[e]():(t,s)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,s)})})})(new Response);const qV=async n=>{if(n==null)return 0;if(L.isBlob(n))return n.size;if(L.isSpecCompliantForm(n))return(await new Request(St.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(L.isArrayBufferView(n)||L.isArrayBuffer(n))return n.byteLength;if(L.isURLSearchParams(n)&&(n=n+""),L.isString(n))return(await WV(n)).byteLength},JV=async(n,e)=>{const t=L.toFiniteNumber(n.getContentLength());return t??qV(e)},Cu={http:mV,xhr:zV,fetch:Fa&&(async n=>{let{url:e,method:t,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=km(n);u=u?(u+"").toLowerCase():"text";let p=FV([r,i&&i.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&YV&&t!=="get"&&t!=="head"&&(y=await JV(d,s))!==0){let S=new Request(e,{method:"POST",body:s,duplex:"half"}),E;if(L.isFormData(s)&&(E=S.headers.get("content-type"))&&d.setContentType(E),S.body){const[C,P]=Nm(y,za(Am(c)));s=Vm(S.body,Lm,C,P)}}L.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(e,{...h,signal:p,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:b?f:void 0});let w=await fetch(g);const x=vu&&(u==="stream"||u==="response");if(vu&&(a||x&&m)){const S={};["status","statusText","headers"].forEach(A=>{S[A]=w[A]});const E=L.toFiniteNumber(w.headers.get("content-length")),[C,P]=a&&Nm(E,za(Am(a),!0))||[];w=new Response(Vm(w.body,Lm,C,()=>{P&&P(),m&&m()}),S)}u=u||"text";let v=await Ua[L.findKey(Ua,u)||"text"](w,n);return!x&&m&&m(),await new Promise((S,E)=>{Pm(S,E,{data:v,headers:Et.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,n,g),{cause:b.cause||b}):ue.from(b,b&&b.code,n,g)}})};L.forEach(Cu,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Im=n=>`- ${n}`,XV=n=>L.isFunction(n)||n===null||n===!1,Bm={getAdapter:n=>{n=L.isArray(n)?n:[n];const{length:e}=n;let t,s;const r={};for(let i=0;i<e;i++){t=n[i];let o;if(s=t,!XV(t)&&(s=Cu[(o=String(t)).toLowerCase()],s===void 0))throw new ue(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
32
+ `+i.map(Im).join(`
33
+ `):" "+Im(i[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:Cu};function Su(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Lr(null,n)}function jm(n){return Su(n),n.headers=Et.from(n.headers),n.data=xu.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Bm.getAdapter(n.adapter||qi.adapter)(n).then(function(s){return Su(n),s.data=xu.call(n,n.transformResponse,s),s.headers=Et.from(s.headers),s},function(s){return Mm(s)||(Su(n),s&&s.response&&(s.response.data=xu.call(n,n.transformResponse,s.response),s.response.headers=Et.from(s.response.headers))),Promise.reject(s)})}const $m="1.7.7",Eu={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Eu[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const zm={};Eu.transitional=function(e,t,s){function r(i,o){return"[Axios v"+$m+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new ue(r(o," has been removed"+(t?" in "+t:"")),ue.ERR_DEPRECATED);return t&&!zm[o]&&(zm[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};function KV(n,e,t){if(typeof n!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=n[i],c=a===void 0||o(a,i,n);if(c!==!0)throw new ue("option "+i+" must be "+c,ue.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new ue("Unknown option "+i,ue.ERR_BAD_OPTION)}}const Ou={assertOptions:KV,validators:Eu},fs=Ou.validators;class Ws{constructor(e){this.defaults=e,this.interceptors={request:new Cm,response:new Cm}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
34
+ `+i):s.stack=i}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Gs(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:i}=t;s!==void 0&&Ou.assertOptions(s,{silentJSONParsing:fs.transitional(fs.boolean),forcedJSONParsing:fs.transitional(fs.boolean),clarifyTimeoutError:fs.transitional(fs.boolean)},!1),r!=null&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Ou.assertOptions(r,{encode:fs.function,serialize:fs.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&L.merge(i.common,i[t.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=Et.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[jm.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),h=g.length,d=Promise.resolve(t);f<h;)d=d.then(g[f++],g[f++]);return d}h=a.length;let p=t;for(f=0;f<h;){const g=a[f++],m=a[f++];try{p=g(p)}catch(y){m.call(this,y);break}}try{d=jm.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(e){e=Gs(this.defaults,e);const t=_m(e.baseURL,e.url);return vm(t,e.params,e.paramsSerializer)}}L.forEach(["delete","get","head","options"],function(e){Ws.prototype[e]=function(t,s){return this.request(Gs(s||{},{method:e,url:t,data:(s||{}).data}))}}),L.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,a){return this.request(Gs(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Ws.prototype[e]=t(),Ws.prototype[e+"Form"]=t(!0)});class Mu{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,a){s.reason||(s.reason=new Lr(i,o,a),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Mu(function(r){e=r}),cancel:e}}}function ZV(n){return function(t){return n.apply(null,t)}}function QV(n){return L.isObject(n)&&n.isAxiosError===!0}const Pu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pu).forEach(([n,e])=>{Pu[e]=n});function Fm(n){const e=new Ws(n),t=im(Ws.prototype.request,e);return L.extend(t,Ws.prototype,e,{allOwnKeys:!0}),L.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Fm(Gs(n,r))},t}const qe=Fm(qi);qe.Axios=Ws,qe.CanceledError=Lr,qe.CancelToken=Mu,qe.isCancel=Mm,qe.VERSION=$m,qe.toFormData=ja,qe.AxiosError=ue,qe.Cancel=qe.CanceledError,qe.all=function(e){return Promise.all(e)},qe.spread=ZV,qe.isAxiosError=QV,qe.mergeConfig=Gs,qe.AxiosHeaders=Et,qe.formToJSON=n=>Em(L.isHTMLForm(n)?new FormData(n):n),qe.getAdapter=Bm.getAdapter,qe.HttpStatusCode=Pu,qe.default=qe;const Mn=qe.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),eD=n=>{Mn.defaults.baseURL=n},tD=n=>{Mn.interceptors.request.use(e=>{if(n)return e.headers.token=n,e},e=>Promise.reject(e))};Mn.interceptors.response.use(n=>(n.data.isOk=n.data.code===200,n.data),n=>{if(n.response)switch(n.response.status){}return Promise.reject(n)});const Xi=(n,e={})=>Mn.get(n,{params:e}),Ha=(n,e={})=>Mn.post(n,e),Um=(n,e={})=>Mn.delete(n,{params:e}),nD=(n,e={})=>Mn.post(n,e,{headers:{"Content-Type":"multipart/form-data"}}),Ki=(n,e)=>{const t=document.querySelector(n),s=t.querySelectorAll(".x6-port-body"),r=t.querySelectorAll(".x6-port-label");for(let i=0,o=s.length;i<o;i+=1)s[i].style.visibility=e?"visible":"hidden";for(let i=0,o=r.length;i<o;i+=1)r[i].style.visibility=e?"visible":"hidden"},Nu=()=>Xi("/cny/custom/deviceList").then(n=>{if(n!=null&&n.isOk)return n.data}),Au=n=>Xi("/cny/custom/monitorInfo",{deviceCode:n,fieldType:1}).then(e=>{if(e!=null&&e.isOk)return e.data}),Hm=n=>Xi("/cny/template/selectOne",{id:n}).then(e=>{if(e!=null&&e.isOk){const t=JSON.parse(e.data.remark);return{background:t.background,grid:t.grid,data:t.data}}else Ye.error((e==null?void 0:e.msg)||"获取失败")}),sD=n=>Ha("/cny/custom/arrRealData2",n).then(e=>{if(e!=null&&e.isOk)return e.data;Ye.error((e==null?void 0:e.msg)||"获取失败")}),Gm={color:"#000000"},Wm={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},rD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},_u={position:"absolute",args:{x:0,y:0},attrs:{text:{fill:"#5174ff",fontSize:8},circle:{magnet:!0,stroke:"#5174ff",r:4}},label:{position:"top"}},iD={shape:"rect",label:"文本",width:50,height:30,attrs:{body:{fill:"#00000000",stroke:"#00000000",strokeWidth:1,rx:6,ry:6},text:{fill:"#ffffff"},label:{textAnchor:"start",x:-14,y:0}},data:{type:"text",content:"文本",fields:[]},ports:{groups:{ports:{portOption:_u}}}},Ym={markup:[{tagName:"path",selector:"line",groupSelector:"lines"}],attrs:{wrap:{strokeWidth:10},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},line:{stroke:"#ffffff",strokeWidth:1,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}}},qm={markup:[{tagName:"path",selector:"line",groupSelector:"lines"},{tagName:"path",selector:"pipe",groupSelector:"lines"}],attrs:{wrap:{strokeWidth:10},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},line:{stroke:"#ffffff",strokeWidth:1,targetMarker:null,sourceMarker:null},pipe:{stroke:"#2364DD",strokeWidth:1,strokeDasharray:5,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}}},Ga="M 0 -6 8 0 0 6 z",Jm="M 0 -6 -8 0 0 6 z",Wa={attrs:{wrap:{strokeWidth:10},arrow:{d:Ga,fill:"#ED8A19",stroke:"#ED8A19",style:{animation:"flashing 2s infinite linear"},display:"block"},arrow1:{atConnectionRatio:.5},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},line:{stroke:"#ffffff",strokeWidth:1,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}},markup:[{tagName:"path",selector:"line",groupSelector:"lines"},{tagName:"path",groupSelector:"arrow",selector:"arrow1"}]},Qe={markup:Wa.markup,attrs:Wa.attrs},Ut=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},oD={class:"control"},aD={class:"row-column"},lD=Ut({__name:"index",props:{payload:Object},setup(n){var h,p,g,m,y,b,w,x,v,S,E,C,P,A,T,k,V,R,j,N,M;const e=n,t=l.ref(((h=e.payload.value.options.background)==null?void 0:h.color)||null),s=l.ref(((g=(p=e.payload.value.options)==null?void 0:p.grid)==null?void 0:g.visible)||null),r=l.ref(((y=(m=e.payload.value.options)==null?void 0:m.grid)==null?void 0:y.size)||10),i=l.ref(((v=(x=(w=(b=e.payload.value.options)==null?void 0:b.grid)==null?void 0:w.args)==null?void 0:x[0])==null?void 0:v.color)||null),o=l.ref(((P=(C=(E=(S=e.payload.value.options)==null?void 0:S.grid)==null?void 0:E.args)==null?void 0:C[0])==null?void 0:P.thickness)||1),a=l.ref(((V=(k=(T=(A=e.payload.value.options)==null?void 0:A.grid)==null?void 0:T.args)==null?void 0:k[1])==null?void 0:V.color)||null),c=l.ref(((M=(N=(j=(R=e.payload.value.options)==null?void 0:R.grid)==null?void 0:j.args)==null?void 0:N[1])==null?void 0:M.thickness)||1),u=l.ref("1"),d=D=>{e.payload.value.drawBackground({color:D})},f=()=>{e.payload.value.drawGrid({visible:s.value,size:r.value,type:"doubleMesh",args:[{color:i.value,thickness:o.value},{color:a.value,thickness:c.value}]})};return(D,B)=>{const G=l.resolveComponent("el-col"),se=l.resolveComponent("el-color-picker"),I=l.resolveComponent("el-row"),_=l.resolveComponent("el-switch"),H=l.resolveComponent("el-input-number"),K=l.resolveComponent("el-collapse-item"),q=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",oD,[l.createVNode(q,{modelValue:u.value,"onUpdate:modelValue":B[7]||(B[7]=re=>u.value=re),accordion:""},{default:l.withCtx(()=>[l.createVNode(K,{title:"基础属性",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",aD,[l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[8]||(B[8]=[l.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(se,{modelValue:t.value,"onUpdate:modelValue":B[0]||(B[0]=re=>t.value=re),size:"small","show-alpha":"",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[9]||(B[9]=[l.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":B[1]||(B[1]=re=>s.value=re),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[10]||(B[10]=[l.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:r.value,"onUpdate:modelValue":B[2]||(B[2]=re=>r.value=re),min:1,max:20,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[11]||(B[11]=[l.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(se,{modelValue:i.value,"onUpdate:modelValue":B[3]||(B[3]=re=>i.value=re),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[12]||(B[12]=[l.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(se,{modelValue:a.value,"onUpdate:modelValue":B[4]||(B[4]=re=>a.value=re),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[13]||(B[13]=[l.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:o.value,"onUpdate:modelValue":B[5]||(B[5]=re=>o.value=re),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(I,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>B[14]||(B[14]=[l.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:c.value,"onUpdate:modelValue":B[6]||(B[6]=re=>c.value=re),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]);typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const s=document.createDocumentFragment();t.forEach(r=>{const i=r instanceof Node;s.appendChild(i?r:document.createTextNode(String(r)))}),this.appendChild(s)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class yt{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,s,r)=>{const i=r.value,o=t.__proto__;r.value=function(...a){this.disposed||(i.call(this,...a),o.dispose.call(this))}}}n.dispose=e})(yt||(yt={}));class Xm{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const s=new n;return t.forEach(r=>{s.add(r)}),s}n.from=e})(Xm||(Xm={}));function Km(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function ee(n,e,...t){return Km(n,e,t)}function cD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Tu(n){return n!=null&&(n instanceof Promise||cD(n))}function ku(...n){const e=[];if(n.forEach(s=>{Array.isArray(s)?e.push(...s):e.push(s)}),e.some(s=>Tu(s))){const s=e.map(r=>Tu(r)?r:Promise.resolve(r!==!1));return Promise.all(s).then(r=>r.reduce((i,o)=>o!==!1&&i,!0))}return e.every(s=>s!==!1)}function uD(...n){const e=ku(n);return typeof e=="boolean"?Promise.resolve(e):e}function Vu(n,e){const t=[];for(let s=0;s<n.length;s+=2){const r=n[s],i=n[s+1],o=Array.isArray(e)?e:[e],a=Km(r,i,o);t.push(a)}return ku(t)}class dD{constructor(){this.listeners={}}on(e,t,s){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,s),this)}once(e,t,s){const r=(...i)=>(this.off(e,r),Vu([t,s],i));return this.on(e,r,this)}off(e,t,s){if(!(e||t||s))return this.listeners={},this;const r=this.listeners;return(e?[e]:Object.keys(r)).forEach(o=>{const a=r[o];if(a){if(!(t||s)){delete r[o];return}for(let c=a.length-2;c>=0;c-=2)t&&a[c]!==t||s&&a[c+1]!==s||a.splice(c,2)}}),this}trigger(e,...t){let s=!0;if(e!=="*"){const i=this.listeners[e];i!=null&&(s=Vu([...i],t))}const r=this.listeners["*"];return r!=null?ku([s,Vu([...r],[e,...t])]):s}emit(e,...t){return this.trigger(e,...t)}}function hD(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(t.prototype,s))})})}const fD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function pD(n,e){fD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}class gD{}const mD=/^\s*class\s+/.test(`${gD}`)||/^\s*class\s*\{/.test(`${class{}}`);function Du(n,e){let t;return mD?t=class extends e{}:(t=function(){return e.apply(this,arguments)},pD(t,e)),Object.defineProperty(t,"name",{value:n}),t}function Zm(n){return n==="__proto__"}function Ru(n,e,t="/"){let s;const r=Array.isArray(e)?e:e.split(t);if(r.length)for(s=n;r.length;){const i=r.shift();if(Object(s)===s&&i&&i in s)s=s[i];else return}return s}function Ir(n,e,t,s="/"){const r=Array.isArray(e)?e:e.split(s),i=r.pop();if(i&&!Zm(i)){let o=n;r.forEach(a=>{Zm(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=t}return n}function Qm(n,e,t="/"){const s=Array.isArray(e)?e.slice():e.split(t),r=s.pop();if(r)if(s.length>0){const i=Ru(n,s);i&&delete i[r]}else delete n[r];return n}var yD=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Te extends dD{dispose(){this.off()}}yD([yt.dispose()],Te.prototype,"dispose",null),function(n){n.dispose=yt.dispose}(Te||(Te={})),hD(Te,yt);const ey=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ty=ey(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Lu=ey(n=>GP(oa(n)).replace(/ /g,""));function Iu(n){let e=2166136261,t=!1,s=n;for(let r=0,i=s.length;r<i;r+=1){let o=s.charCodeAt(r);o>127&&!t&&(s=unescape(encodeURIComponent(s)),o=s.charCodeAt(r),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Ya(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=Math.random()*16|0,o=r==="x"?i:r==="y"?i&3|8:r;n+=o.toString(16)}return n}function bD(n,e,t){const s=Math.min(2,Math.floor(n.length*.34));let r=Math.floor(n.length*.4)+1,i,o=!1;const a=n.toLowerCase();for(const c of e){const u=t(c);if(u!==void 0&&Math.abs(u.length-a.length)<=s){const d=u.toLowerCase();if(d===a){if(u===n)continue;return c}if(o||u.length<3)continue;const f=wD(a,d,r-1);if(f===void 0)continue;f<3?(o=!0,i=c):(r=f,i=c)}}return i}function wD(n,e,t){let s=new Array(e.length+1),r=new Array(e.length+1);const i=t+1;for(let a=0;a<=e.length;a+=1)s[a]=a;for(let a=1;a<=n.length;a+=1){const c=n.charCodeAt(a-1),u=a>t?a-t:1,d=e.length>t+a?t+a:e.length;r[0]=a;let f=a;for(let p=1;p<u;p+=1)r[p]=i;for(let p=u;p<=d;p+=1){const g=c===e.charCodeAt(p-1)?s[p-1]:Math.min(s[p]+1,r[p-1]+1,s[p-1]+2);r[p]=g,f=Math.min(f,g)}for(let p=d+1;p<=e.length;p+=1)r[p]=i;if(f>t)return;const h=s;s=r,r=h}const o=s[e.length];return o>t?void 0:o}function qn(n){return typeof n=="string"&&n.slice(-1)==="%"}function dn(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),qn(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function ps(n){if(typeof n=="object"){let t=0,s=0,r=0,i=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(s=i=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(r=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=n.left),n.top!=null&&Number.isFinite(n.top)&&(s=n.top),n.right!=null&&Number.isFinite(n.right)&&(r=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(i=n.bottom),{top:s,right:r,bottom:i,left:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let Bu=!1,ny=!1,sy=!1,ry=!1,iy=!1,oy=!1,ay=!1,ly=!1,cy=!1,uy=!1,dy=!1,hy=!1,fy=!1,py=!1,gy=!1,my=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Bu=n.indexOf("Macintosh")>=0,ny=!!n.match(/(iPad|iPhone|iPod)/g),sy=n.indexOf("Windows")>=0,ry=n.indexOf("MSIE")>=0,iy=!!n.match(/Trident\/7\./),oy=!!n.match(/Edge\//),ay=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,cy=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,uy=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,dy=n.indexOf("Firefox/")>=0,hy=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(my=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(ly=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,py=window.PointerEvent!=null&&!Bu),typeof document=="object"){fy="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){gy=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var gs;(function(n){n.IS_MAC=Bu,n.IS_IOS=ny,n.IS_WINDOWS=sy,n.IS_IE=ry,n.IS_IE11=iy,n.IS_EDGE=oy,n.IS_NETSCAPE=ay,n.IS_CHROME_APP=ly,n.IS_CHROME=cy,n.IS_OPERA=uy,n.IS_FIREFOX=dy,n.IS_SAFARI=hy,n.SUPPORT_TOUCH=fy,n.SUPPORT_POINTER=py,n.SUPPORT_PASSIVE=gy,n.NO_FOREIGNOBJECT=my,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(gs||(gs={})),function(n){function e(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;const s={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function r(i){const o=document.createElement(s[i]||"div"),a=`on${i}`;let c=a in o;return c||(o.setAttribute(a,"return;"),c=typeof o[a]=="function"),c}n.isEventSupported=r}(gs||(gs={}));const ju=/[\t\r\n\f]/g,$u=/\S+/g,Br=n=>` ${n} `;function jr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function Pn(n,e){if(n==null||e==null)return!1;const t=Br(jr(n)),s=Br(e);return n.nodeType===1?t.replace(ju," ").includes(s):!1}function X(n,e){if(!(n==null||e==null)){if(typeof e=="function")return X(n,e(jr(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match($u)||[],s=Br(jr(n)).replace(ju," ");let r=t.reduce((i,o)=>i.indexOf(Br(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function De(n,e){if(n!=null){if(typeof e=="function")return De(n,e(jr(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match($u)||[],s=Br(jr(n)).replace(ju," ");let r=t.reduce((i,o)=>{const a=Br(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=e?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function hn(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?X(n,e):De(n,e);return}if(typeof e=="function")return hn(n,e(jr(n),t),t);typeof e=="string"&&(e.match($u)||[]).forEach(r=>{Pn(n,r)?De(n,r):X(n,r)})}}let yy=0;function xD(){return yy+=1,`v${yy}`}function zu(n){return(n.id==null||n.id==="")&&(n.id=xD()),n.id}function ms(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const rt={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},by="1.1";function wy(n,e=document){return e.createElement(n)}function Fu(n,e=rt.xhtml,t=document){return t.createElementNS(e,n)}function fn(n,e=document){return Fu(n,rt.svg,e)}function qa(n){if(n){const t=`<svg xmlns="${rt.svg}" xmlns:xlink="${rt.xlink}" version="${by}">${n}</svg>`,{documentElement:s}=vD(t,{async:!1});return s}const e=document.createElementNS(rt.svg,"svg");return e.setAttributeNS(rt.xmlns,"xmlns:xlink",rt.xlink),e.setAttribute("version",by),e}function vD(n,e={}){let t;try{const s=new DOMParser;if(e.async!=null){const r=s;r.async=e.async}t=s.parseFromString(n,e.mimeType||"text/xml")}catch{t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function CD(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Uu(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function SD(n,e){return n.querySelectorAll(e)}function ED(n,e){return n.querySelector(e)}function xy(n,e,t){const s=n.ownerSVGElement;let r=n.parentNode;for(;r&&r!==t&&r!==s;){if(Pn(r,e))return r;r=r.parentNode}return null}function Hu(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Ht(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function Zi(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function kt(n,e){(Array.isArray(e)?e:[e]).forEach(s=>{s!=null&&n.appendChild(s)})}function vy(n,e){const t=n.firstChild;return t?Gu(t,e):kt(n,e)}function Gu(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&t.insertBefore(r,n)})}function ys(n,e){e!=null&&e.appendChild(n)}function Cy(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function OD(n,e){const t=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!e||Pn(s,e))&&t.push(s);return t}const Sy=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function MD(n,e){return n.getAttribute(e)}function Wu(n,e){const t=Oy(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Yu(n,e,t){if(t==null)return Wu(n,e);const s=Oy(e);s.ns&&typeof t=="string"?n.setAttributeNS(s.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function Ey(n,e){Object.keys(e).forEach(t=>{Yu(n,t,e[t])})}function fe(n,e,t){if(e==null){const s=n.attributes,r={};for(let i=0;i<s.length;i+=1)r[s[i].name]=s[i].value;return r}if(typeof e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?Ey(n,e):Yu(n,e,t)}function Oy(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:rt[e[0]],local:e[1]}}return{ns:null,local:n}}function Qi(n){const e={};return Object.keys(n).forEach(t=>{const s=Sy.includes(t)?t:ty(t);e[s]=n[t]}),e}function Ja(n){const e={};return n.split(";").forEach(s=>{const r=s.trim();if(r){const i=r.split("=");i.length&&(e[i[0].trim()]=i[1]?i[1].trim():"")}}),e}function qu(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const s=typeof n[t]=="object",r=typeof e[t]=="object";let i,o;s&&r?(i=n[t],o=e[t]):s?(i=n[t],o=Ja(e[t])):r?(i=Ja(n[t]),o=e[t]):(i=Ja(n[t]),o=Ja(e[t])),n[t]=qu(i,o)}else n[t]=e[t]}),n}function PD(n,e,t={}){const s=t.offset||0,r=[],i=[];let o,a,c=null;for(let u=0;u<n.length;u+=1){o=i[u]=n[u];for(let d=0,f=e.length;d<f;d+=1){const h=e[d],p=h.start+s,g=h.end+s;u>=p&&u<g&&(typeof o=="string"?o=i[u]={t:n[u],attrs:h.attrs}:o.attrs=qu(qu({},o.attrs),h.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(d)))}a=i[u-1],a?Ie(o)&&Ie(a)?(c=c,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?c.t+=o.t:(r.push(c),c=o)):Ie(o)||Ie(a)?(c=c,r.push(c),c=o):c=(c||"")+o:c=o}return c!=null&&r.push(c),r}function ND(n){return n.replace(/ /g," ")}var Ys;(function(n){function e(u){const d="data:";return u.substr(0,d.length)===d}n.isDataUrl=e;function t(u,d){if(!u||e(u)){setTimeout(()=>d(null,u));return}const f=()=>{d(new Error(`Failed to load image: ${u}`))},h=window.FileReader?g=>{if(g.status===200){const m=new FileReader;m.onload=y=>{const b=y.target.result;d(null,b)},m.onerror=f,m.readAsDataURL(g.response)}else f()}:g=>{const m=y=>{const w=[];for(let x=0;x<y.length;x+=32768)w.push(String.fromCharCode.apply(null,y.subarray(x,x+32768)));return w.join("")};if(g.status===200){let y=u.split(".").pop()||"png";y==="svg"&&(y="svg+xml");const b=`data:image/${y};base64,`,w=new Uint8Array(g.response),x=b+btoa(m(w));d(null,x)}else f()},p=new XMLHttpRequest;p.responseType=window.FileReader?"blob":"arraybuffer",p.open("GET",u,!0),p.addEventListener("error",f),p.addEventListener("load",()=>h(p)),p.send()}n.imageToDataUri=t;function s(u){let d=u.replace(/\s/g,"");d=decodeURIComponent(d);const f=d.indexOf(","),h=d.slice(0,f),p=h.split(":")[1].split(";")[0],g=d.slice(f+1);let m;h.indexOf("base64")>=0?m=atob(g):m=unescape(encodeURIComponent(g));const y=new Uint8Array(m.length);for(let b=0;b<m.length;b+=1)y[b]=m.charCodeAt(b);return new Blob([y],{type:p})}n.dataUriToBlob=s;function r(u,d){const f=window.navigator.msSaveBlob;if(f)f(u,d);else{const h=window.URL.createObjectURL(u),p=document.createElement("a");p.href=h,p.download=d,document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(h)}}n.downloadBlob=r;function i(u,d){const f=s(u);r(f,d)}n.downloadDataUri=i;function o(u){const d=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return d&&d[2]?d[2].replace(/\s+/," ").split(" "):null}function a(u){const d=parseFloat(u);return Number.isNaN(d)?null:d}function c(u,d={}){let f=null;const h=x=>(f==null&&(f=o(u)),f!=null?a(f[x]):null),p=x=>{const v=u.match(x);return v&&v[2]?a(v[2]):null};let g=d.width;if(g==null&&(g=p(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=h(2)),g==null)throw new Error("Can not parse width from svg string");let m=d.height;if(m==null&&(m=p(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),m==null&&(m=h(3)),m==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(u).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=c})(Ys||(Ys={}));let qs;const AD={px(n){return n},mm(n){return qs*n},cm(n){return qs*n*10},in(n){return qs*n*25.4},pt(n){return qs*(25.4*n/72)},pc(n){return qs*(25.4*n/6)}};var My;(function(n){function e(s,r,i){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=s+(i||"px"),a.height=r+(i||"px"),document.body.appendChild(o);const c=o.getBoundingClientRect(),u={width:c.width||0,height:c.height||0};return document.body.removeChild(o),u}n.measure=e;function t(s,r){qs==null&&(qs=e("1","1","mm").width);const i=r?AD[r]:null;return i?i(s):s}n.toPx=t})(My||(My={}));const _D=/-(.)/g;function TD(n){return n.replace(_D,(e,t)=>t.toUpperCase())}const Ju={},Py=["webkit","ms","moz","o"],Ny=typeof document<"u"?document.createElement("div").style:{};function kD(n){for(let e=0;e<Py.length;e+=1){const t=Py[e]+n;if(t in Ny)return t}return null}function VD(n){const e=TD(n);if(Ju[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Ju[e]=e in Ny?e:kD(t)}return Ju[e]}function Ay(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const DD={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function RD(n){return/^--/.test(n)}function LD(n,e,t){const s=window.getComputedStyle(n,null);return t?s.getPropertyValue(e)||void 0:s[e]||n.style[e]}function ID(n,e){return!DD[n]&&typeof e=="number"?`${e}px`:e}function Je(n,e,t){if(typeof e=="string"){const s=RD(e);if(s||(e=VD(e)),t===void 0)return LD(n,e,s);s||(t=ID(e,t));const r=n.style;s?r.setProperty(e,t):r[e]=t;return}for(const s in e)Je(n,s,e[s])}const Xa=new WeakMap;function _y(n,e){const t=oa(e),s=Xa.get(n);if(s)return s[t]}function BD(n,e,t){const s=oa(e),r=Xa.get(n);r?r[s]=t:Xa.set(n,{[s]:t})}function Js(n,e,t){if(!e){const s={};return Object.keys(Xa).forEach(r=>{s[r]=_y(n,r)}),s}if(typeof e=="string"){if(t===void 0)return _y(n,e);BD(n,e,t);return}for(const s in e)Js(n,s,e[s])}class oe{get[Symbol.toStringTag](){return oe.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,s){if(!e)throw new TypeError("Invalid element to create vector");let r;if(oe.isVector(e))r=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")r=qa();else if(e[0]==="<"){const i=qa(e);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(rt.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),s&&this.append(s)}transform(e,t){return e==null?zr(this.node):(zr(this.node,e,t),this)}translate(e,t=0,s={}){return e==null?jy(this.node):(jy(this.node,e,t,s),this)}rotate(e,t,s,r={}){return e==null?Zu(this.node):(Zu(this.node,e,t,s,r),this)}scale(e,t){return e==null?Qu(this.node):(Qu(this.node,e,t),this)}getTransformToElement(e){const t=oe.toNode(e);return so(this.node,t)}removeAttribute(e){return Wu(this.node,e),this}getAttribute(e){return MD(this.node,e)}setAttribute(e,t){return Yu(this.node,e,t),this}setAttributes(e){return Ey(this.node,e),this}attr(e,t){return e==null?fe(this.node):typeof e=="string"&&t===void 0?fe(this.node,e):(typeof e=="object"?fe(this.node,e):fe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:oe.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?oe.create(t):oe.create("defs").appendTo(e)}text(e,t={}){return ky(this.node,e,t),this}tagName(){return CD(this.node)}clone(){return oe.create(this.node.cloneNode(!0))}remove(){return Ht(this.node),this}empty(){return Zi(this.node),this}append(e){return kt(this.node,oe.toNodes(e)),this}appendTo(e){return ys(this.node,oe.isVector(e)?e.node:e),this}prepend(e){return vy(this.node,oe.toNodes(e)),this}before(e){return Gu(this.node,oe.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(oe.toNode(e),this.node),oe.create(e)}first(){return this.node.firstChild?oe.create(this.node.firstChild):null}last(){return this.node.lastChild?oe.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?oe.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(oe.toNode(e))}find(e){const t=[],s=SD(this.node,e);if(s)for(let r=0,i=s.length;r<i;r+=1)t.push(oe.create(s[r]));return t}findOne(e){const t=ED(this.node,e);return t?oe.create(t):null}findParentByClass(e,t){const s=xy(this.node,e,t);return s?oe.create(s):null}matches(e){const t=this.node;this.node.matches;const s=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return s&&s.call(t,e)}contains(e){return Hu(this.node,oe.isVector(e)?e.node:e)}wrap(e){const t=oe.create(e),s=this.node.parentNode;return s!=null&&s.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=oe.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=oe.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let s=0;s<e.length;s+=1)e[s].nodeType===1&&t.push(oe.create(e[s]));return t}eachChild(e,t){const s=this.children();for(let r=0,i=s.length;r<i;r+=1)e.call(s[r],s[r],r,s),t&&s[r].eachChild(e,t);return this}index(){return Uu(this.node)}hasClass(e){return Pn(this.node,e)}addClass(e){return X(this.node,e),this}removeClass(e){return De(this.node,e),this}toggleClass(e,t){return hn(this.node,e,t),this}toLocalPoint(e,t){return rR(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?FD(this.node,e):[]}toPath(){return oe.create(JD(this.node))}toPathData(){return Iy(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],c=o;return(a==null||a===n.toStringTag)&&c.node instanceof SVGElement&&typeof c.sample=="function"&&typeof c.toPath=="function"}n.isVector=e;function t(o,a,c){return new n(o,a,c)}n.create=t;function s(o){if(o[0]==="<"){const a=qa(o),c=[];for(let u=0,d=a.childNodes.length;u<d;u+=1){const f=a.childNodes[u];c.push(t(document.importNode(f,!0)))}return c}return[t(o)]}n.createVectors=s;function r(o){return e(o)?o.node:o}n.toNode=r;function i(o){return Array.isArray(o)?o.map(a=>r(a)):[r(o)]}n.toNodes=i})(oe||(oe={}));function jD(n,e){const t=oe.create(e),s=oe.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=oe.create("path").attr("d",r).appendTo(t.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function $D(n,e,t){const s=t.eol,r=t.baseSize,i=t.lineHeight;let o=0,a;const c={},u=e.length-1;for(let d=0;d<=u;d+=1){let f=e[d],h=null;if(typeof f=="object"){const p=f.attrs,g=oe.create("tspan",p);a=g.node;let m=f.t;s&&d===u&&(m+=s),a.textContent=m;const y=p.class;y&&g.addClass(y),t.includeAnnotationIndices&&g.attr("annotations",f.annotations.join(",")),h=parseFloat(p["font-size"]),h===void 0&&(h=r),h&&h>o&&(o=h)}else s&&d===u&&(f+=s),a=document.createTextNode(f||" "),r&&r>o&&(o=r);n.appendChild(a)}return o&&(c.maxFontSize=o),i?c.lineHeight=i:o&&(c.lineHeight=o*1.2),c}const Ty=/em$/;function Ka(n,e){const t=parseFloat(n);return Ty.test(n)?t*e:t}function zD(n,e,t,s){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let i=e[0];const o=Ka(i.maxFontSize,t)||t;let a=0;const c=Ka(s,t);for(let f=1;f<r;f+=1){i=e[f];const h=Ka(i.lineHeight,t)||c;a+=h}const u=Ka(i.maxFontSize,t)||t;let d;switch(n){case"middle":d=o/2-.15*u-a/2;break;case"bottom":d=-(.25*u)-a;break;case"top":default:d=.8*o;break}return d}function ky(n,e,t={}){e=ND(e);const s=t.eol;let r=t.textPath;const i=t.textVerticalAnchor,o=i==="middle"||i==="bottom"||i==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const c=t.includeAnnotationIndices;let u=t.annotations;u&&!Array.isArray(u)&&(u=[u]);const d=t.lineHeight,f=d==="auto",h=f?"1.5em":d||"1em";let p=!0;const g=n.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&Zi(n),fe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const m=fe(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&fe(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=jD(r,n)):b=document.createDocumentFragment();let w,x=0,v;const S=e.split(`
35
+ `),E=[],C=S.length-1;for(let A=0;A<=C;A+=1){w=h;let T="v-line";const k=fn("tspan");let V,R=S[A];if(R)if(u){const j=PD(R,u,{offset:-x,includeAnnotationIndices:c});V=$D(k,j,{eol:A!==C&&s,baseSize:y,lineHeight:f?null:h,includeAnnotationIndices:c});const N=V.lineHeight;N&&f&&A!==0&&(w=N),A===0&&(v=V.maxFontSize*.8)}else s&&A!==C&&(R+=s),k.textContent=R;else{k.textContent="-",T+=" v-empty-line";const j=k.style;j.fillOpacity=0,j.strokeOpacity=0,u&&(V={})}V&&E.push(V),A>0&&k.setAttribute("dy",w),(A>0||r)&&k.setAttribute("x",a),k.className.baseVal=T,b.appendChild(k),x+=R.length+1}if(o)if(u)w=zD(i,E,y,h);else if(i==="top")w="0.8em";else{let A;switch(C>0?(A=parseFloat(h)||1,A*=C,Ty.test(h)||(A/=y)):A=0,i){case"middle":w=`${.3-A/2}em`;break;case"bottom":w=`${-A-.3}em`;break}}else i===0?w="0em":i?w=i:(w=0,n.getAttribute("y")==null&&n.setAttribute("y",`${v||"0.8em"}`));b.firstChild.setAttribute("dy",w),n.appendChild(b)}function eo(n,e={}){const t=document.createElement("canvas").getContext("2d");if(!n)return{width:0};const s=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return s.push(e["font-style"]||"normal"),s.push(e["font-variant"]||"normal"),s.push(e["font-weight"]||400),s.push(r),s.push(e["font-family"]||"sans-serif"),t.font=s.join(" "),t.measureText(n)}function Vy(n,e,t,s={}){if(e>=t)return[n,""];const r=n.length,i={};let o=Math.round(e/t*r-1);for(o<0&&(o=0);o>=0&&o<r;){const a=n.slice(0,o),c=i[a]||eo(a,s).width,u=n.slice(0,o+1),d=i[u]||eo(u,s).width;if(i[a]=c,i[u]=d,c>e)o-=1;else if(d<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function Dy(n,e,t={},s={}){const r=e.width,i=e.height,o=s.eol||`
36
+ `,a=t.fontSize||14,c=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(a*1.4),u=Math.floor(i/c);if(n.indexOf(o)>-1){const y=Ya(),b=[];return n.split(o).map(w=>{const x=Dy(w,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),t,Object.assign(Object.assign({},s),{eol:y}));x&&b.push(...x.split(y))}),b.slice(0,u).join(o)}const{width:d}=eo(n,t);if(d<r)return n;const f=[];let h=n,p=d,g=s.ellipsis,m=0;g&&(typeof g!="string"&&(g="…"),m=eo(g,t).width);for(let y=0;y<u;y+=1)if(p>r)if(y===u-1){const[w]=Vy(h,r-m,p,t);f.push(g?`${w}${g}`:w)}else{const[w,x]=Vy(h,r,p,t);f.push(w),h=x,p=eo(h,t).width}else{f.push(h);break}return f.join(o)}const Xu=.551784;function ct(n,e,t=NaN){const s=n.getAttribute(e);if(s==null)return t;const r=parseFloat(s);return Number.isNaN(r)?t:r}function FD(n,e=1){const t=n.getTotalLength(),s=[];let r=0,i;for(;r<t;)i=n.getPointAtLength(r),s.push({distance:r,x:i.x,y:i.y}),r+=e;return s}function UD(n){return["M",ct(n,"x1"),ct(n,"y1"),"L",ct(n,"x2"),ct(n,"y2")].join(" ")}function HD(n){const e=Za(n);return e.length===0?null:`${Ry(e)} Z`}function GD(n){const e=Za(n);return e.length===0?null:Ry(e)}function Ry(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function Za(n){const e=[],t=n.points;if(t)for(let s=0,r=t.numberOfItems;s<r;s+=1)e.push(t.getItem(s));return e}function WD(n){const e=ct(n,"cx",0),t=ct(n,"cy",0),s=ct(n,"r"),r=s*Xu;return["M",e,t-s,"C",e+r,t-s,e+s,t-r,e+s,t,"C",e+s,t+r,e+r,t+s,e,t+s,"C",e-r,t+s,e-s,t+r,e-s,t,"C",e-s,t-r,e-r,t-s,e,t-s,"Z"].join(" ")}function YD(n){const e=ct(n,"cx",0),t=ct(n,"cy",0),s=ct(n,"rx"),r=ct(n,"ry")||s,i=s*Xu,o=r*Xu;return["M",e,t-r,"C",e+i,t-r,e+s,t-o,e+s,t,"C",e+s,t+o,e+i,t+r,e,t+r,"C",e-i,t+r,e-s,t+o,e-s,t,"C",e-s,t-o,e-i,t-r,e,t-r,"Z"].join(" ")}function qD(n){return Ly({x:ct(n,"x",0),y:ct(n,"y",0),width:ct(n,"width",0),height:ct(n,"height",0),rx:ct(n,"rx",0),ry:ct(n,"ry",0)})}function Ly(n){let e;const t=n.x,s=n.y,r=n.width,i=n.height,o=Math.min(n.rx||n["top-rx"]||0,r/2),a=Math.min(n.rx||n["bottom-rx"]||0,r/2),c=Math.min(n.ry||n["top-ry"]||0,i/2),u=Math.min(n.ry||n["bottom-ry"]||0,i/2);return o||a||c||u?e=["M",t,s+c,"v",i-c-u,"a",a,u,0,0,0,a,u,"h",r-2*a,"a",a,u,0,0,0,a,-u,"v",-(i-u-c),"a",o,c,0,0,0,-o,-c,"h",-(r-2*o),"a",o,c,0,0,0,-o,c,"Z"]:e=["M",t,s,"H",t+r,"V",s+i,"H",t,"V",s,"Z"],e.join(" ")}function JD(n){const e=fn("path");fe(e,fe(n));const t=Iy(n);return t&&e.setAttribute("d",t),e}function Iy(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return UD(n);case"polygon":return HD(n);case"polyline":return GD(n);case"ellipse":return YD(n);case"circle":return WD(n);case"rect":return qD(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const XD=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,By=/[ ,]+/,KD=/^(\w+)\((.*)\)/;function ZD(n,e){const s=fn("svg").createSVGPoint();return s.x=n,s.y=e,s}function it(n){const t=fn("svg").createSVGMatrix();if(n!=null){const s=n,r=t;for(const i in s)r[i]=s[i]}return t}function to(n){const e=fn("svg");return n!=null?(n instanceof DOMMatrix||(n=it(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function no(n){let e=it();const t=n!=null&&n.match(XD);if(!t)return e;for(let s=0,r=t.length;s<r;s+=1){const o=t[s].match(KD);if(o){let a,c,u,d,f,h=it();const p=o[2].split(By);switch(o[1].toLowerCase()){case"scale":a=parseFloat(p[0]),c=p[1]===void 0?a:parseFloat(p[1]),h=h.scaleNonUniform(a,c);break;case"translate":u=parseFloat(p[0]),d=parseFloat(p[1]),h=h.translate(u,d);break;case"rotate":f=parseFloat(p[0]),u=parseFloat(p[1])||0,d=parseFloat(p[2])||0,u!==0||d!==0?h=h.translate(u,d).rotate(f).translate(-u,-d):h=h.rotate(f);break;case"skewx":f=parseFloat(p[0]),h=h.skewX(f);break;case"skewy":f=parseFloat(p[0]),h=h.skewY(f);break;case"matrix":h.a=parseFloat(p[0]),h.b=parseFloat(p[1]),h.c=parseFloat(p[2]),h.d=parseFloat(p[3]),h.e=parseFloat(p[4]),h.f=parseFloat(p[5]);break;default:continue}e=e.multiply(h)}}return e}function $r(n){const e=n||{},t=e.a!=null?e.a:1,s=e.b!=null?e.b:0,r=e.c!=null?e.c:0,i=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${s},${r},${i},${o},${a})`}function Qa(n){let e,t,s;if(n){const i=By;if(n.trim().indexOf("matrix")>=0){const o=no(n),a=QD(o);e=[a.translateX,a.translateY],t=[a.rotation],s=[a.scaleX,a.scaleY];const c=[];(e[0]!==0||e[1]!==0)&&c.push(`translate(${e.join(",")})`),(s[0]!==1||s[1]!==1)&&c.push(`scale(${s.join(",")})`),t[0]!==0&&c.push(`rotate(${t[0]})`),n=c.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(i));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(i));const c=n.match(/scale\((.*?)\)/);c&&(s=c[1].split(i))}}const r=s&&s[0]?parseFloat(s[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:r,sy:s&&s[1]?parseFloat(s[1]):r}}}function Ku(n,e){const t=e.x*n.a+e.y*n.c+0,s=e.x*n.b+e.y*n.d+0;return{x:t,y:s}}function QD(n){const e=Ku(n,{x:0,y:1}),t=Ku(n,{x:1,y:0}),s=180/Math.PI*Math.atan2(e.y,e.x)-90,r=180/Math.PI*Math.atan2(t.y,t.x);return{skewX:s,skewY:r,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:s}}function eR(n){let e,t,s,r;return n?(e=n.a==null?1:n.a,r=n.d==null?1:n.d,t=n.b,s=n.c):e=r=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:s?Math.sqrt(s*s+r*r):r}}function tR(n){let e={x:0,y:1};n&&(e=Ku(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function nR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function zr(n,e,t={}){if(e==null)return no(fe(n,"transform"));if(t.absolute){n.setAttribute("transform",$r(e));return}const s=n.transform,r=to(e);s.baseVal.appendItem(r)}function jy(n,e,t=0,s={}){let r=fe(n,"transform");const i=Qa(r);if(e==null)return i.translation;r=i.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=s.absolute?e:i.translation.tx+e,a=s.absolute?t:i.translation.ty+t,c=`translate(${o},${a})`;n.setAttribute("transform",`${c} ${r}`.trim())}function Zu(n,e,t,s,r={}){let i=fe(n,"transform");const o=Qa(i);if(e==null)return o.rotation;i=o.raw,i=i.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=r.absolute?e:o.rotation.angle+e,c=t!=null&&s!=null?`,${t},${s}`:"",u=`rotate(${a}${c})`;n.setAttribute("transform",`${i} ${u}`.trim())}function Qu(n,e,t){let s=fe(n,"transform");const r=Qa(s);if(e==null)return r.scale;t=t??e,s=r.raw,s=s.replace(/scale\([^)]*\)/g,"").trim();const i=`scale(${e},${t})`;n.setAttribute("transform",`${s} ${i}`.trim())}function so(n,e){if(ms(e)&&ms(n)){const t=e.getScreenCTM(),s=n.getScreenCTM();if(t&&s)return t.inverse().multiply(s)}return it()}function sR(n,e){let t=it();if(ms(e)&&ms(n)){let s=n;const r=[];for(;s&&s!==e;){const i=s.getAttribute("transform")||null,o=no(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{t=t.multiply(i)})}return t}function rR(n,e,t){const s=n instanceof SVGSVGElement?n:n.ownerSVGElement,r=s.createSVGPoint();r.x=e,r.y=t;try{const i=s.getScreenCTM(),o=r.matrixTransform(i.inverse()),a=so(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var Gt;(function(n){const e={};function t(i){return e[i]||{}}n.get=t;function s(i,o){e[i]=o}n.register=s;function r(i){delete e[i]}n.unregister=r})(Gt||(Gt={}));var Xs;(function(n){const e=new WeakMap;function t(i){return e.has(i)||e.set(i,{events:Object.create(null)}),e.get(i)}n.ensure=t;function s(i){return e.get(i)}n.get=s;function r(i){return e.delete(i)}n.remove=r})(Xs||(Xs={}));var ce;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(r){r.stopPropagation()}n.stopPropagationCallback=e;function t(r,i,o){r.addEventListener!=null&&r.addEventListener(i,o)}n.addEventListener=t;function s(r,i,o){r.removeEventListener!=null&&r.removeEventListener(i,o)}n.removeEventListener=s})(ce||(ce={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function s(a){return(a||"").match(e)||[""]}n.splitType=s;function r(a){const c=t.exec(a)||[];return{originType:c[1]?c[1].trim():c[1],namespaces:c[2]?c[2].split(".").map(u=>u.trim()).sort():[]}}n.normalizeType=r;function i(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=i;function o(a,c){if(c){const u=a;return u.querySelector!=null&&u.querySelector(c)!=null}return!0}n.isValidSelector=o}(ce||(ce={})),function(n){let e=0;const t=new WeakMap;function s(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=s;function r(a){return t.get(a)}n.getHandlerId=r;function i(a){return t.delete(a)}n.removeHandlerId=i;function o(a,c){return t.set(a,c)}n.setHandlerId=o}(ce||(ce={})),function(n){function e(t,s){const r=[],i=Xs.get(t),o=i&&i.events&&i.events[s.type],a=o&&o.handlers||[],c=o?o.delegateCount:0;if(c>0&&!(s.type==="click"&&typeof s.button=="number"&&s.button>=1)){for(let u=s.target;u!==t;u=u.parentNode||t)if(u.nodeType===1&&!(s.type==="click"&&u.disabled===!0)){const d=[],f={};for(let h=0;h<c;h+=1){const p=a[h],g=p.selector;if(g!=null&&f[g]==null){const m=t,y=[];m.querySelectorAll(g).forEach(b=>{y.push(b)}),f[g]=y.includes(u)}f[g]&&d.push(p)}d.length&&r.push({elem:u,handlers:d})}}return c<a.length&&r.push({elem:t,handlers:a.slice(c)}),r}n.getHandlerQueue=e}(ce||(ce={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ce||(ce={})),function(n){function e(t,s){const r=t.nodeType===9?t.documentElement:t,i=s&&s.parentNode;return t===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):t.compareDocumentPosition&&t.compareDocumentPosition(i)&16))}n.contains=e}(ce||(ce={}));class Nn{constructor(e,t){this.isDefaultPrevented=ce.returnFalse,this.isPropagationStopped=ce.returnFalse,this.isImmediatePropagationStopped=ce.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=ce.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ce.returnTrue:ce.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Nn||(Nn={})),function(n){function e(t,s){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof s=="function"?function(){if(this.originalEvent)return s(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(r){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:r})}})}n.addProperty=e}(Nn||(Nn={})),function(n){const e={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(e).forEach(t=>n.addProperty(t,e[t]))}(Nn||(Nn={})),function(n){Gt.register("load",{noBubble:!0})}(),function(n){Gt.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){Gt.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseover"),s}}),Gt.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseout"),s}})}();var iR=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},ro;(function(n){let e;function t(o,a,c,u,d){if(!ce.isValidTarget(o))return;let f;if(typeof c!="function"){const{handler:m,selector:y}=c,b=iR(c,["handler","selector"]);c=m,d=y,f=b}const h=Xs.ensure(o);let p=h.handler;p==null&&(p=h.handler=function(m,...y){return e!==m.type?r(o,m,...y):void 0});const g=ce.ensureHandlerId(c);ce.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=ce.normalizeType(m);if(!y)return;let w=y,x=Gt.get(w);w=(d?x.delegateType:x.bindType)||w,x=Gt.get(w);const v=Object.assign({type:w,originType:y,data:u,selector:d,guid:g,handler:c,namespace:b.join(".")},f),S=h.events;let E=S[w];E||(E=S[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,p)===!1)&&ce.addEventListener(o,w,p)),x.add&&(ce.removeHandlerId(v.handler),x.add(o,v),ce.setHandlerId(v.handler,g)),d?(E.handlers.splice(E.delegateCount,0,v),E.delegateCount+=1):E.handlers.push(v)})}n.on=t;function s(o,a,c,u,d){const f=Xs.get(o);if(!f)return;const h=f.events;h&&(ce.splitType(a).forEach(p=>{const{originType:g,namespaces:m}=ce.normalizeType(p);if(!g){Object.keys(h).forEach(S=>{s(o,S+p,c,u,!0)});return}let y=g;const b=Gt.get(y);y=(u?b.delegateType:b.bindType)||y;const w=h[y];if(!w)return;const x=m.length>0?new RegExp(`(^|\\.)${m.join("\\.(?:.*\\.|)")}(\\.|$)`):null,v=w.handlers.length;for(let S=w.handlers.length-1;S>=0;S-=1){const E=w.handlers[S];(d||g===E.originType)&&(!c||ce.getHandlerId(c)===E.guid)&&(x==null||E.namespace&&x.test(E.namespace))&&(u==null||u===E.selector||u==="**"&&E.selector)&&(w.handlers.splice(S,1),E.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,E))}v&&w.handlers.length===0&&((!b.teardown||b.teardown(o,m,f.handler)===!1)&&ce.removeEventListener(o,y,f.handler),delete h[y])}),Object.keys(h).length===0&&Xs.remove(o))}n.off=s;function r(o,a,...c){const u=Nn.create(a);u.delegateTarget=o;const d=Gt.get(u.type);if(d.preDispatch&&d.preDispatch(o,u)===!1)return;const f=ce.getHandlerQueue(o,u);for(let h=0,p=f.length;h<p&&!u.isPropagationStopped();h+=1){const g=f[h];u.currentTarget=g.elem;for(let m=0,y=g.handlers.length;m<y&&!u.isImmediatePropagationStopped();m+=1){const b=g.handlers[m];if(u.rnamespace==null||b.namespace&&u.rnamespace.test(b.namespace)){u.handleObj=b,u.data=b.data;const w=Gt.get(b.originType).handle,x=w?w(g.elem,u,...c):b.handler.call(g.elem,u,...c);x!==void 0&&(u.result=x,x===!1&&(u.preventDefault(),u.stopPropagation()))}}}return d.postDispatch&&d.postDispatch(o,u),u.result}n.dispatch=r;function i(o,a,c,u){let d=o,f=typeof o=="string"?o:o.type,h=typeof o=="string"||d.namespace==null?[]:d.namespace.split(".");const p=c;if(p.nodeType===3||p.nodeType===8)return;f.indexOf(".")>-1&&(h=f.split("."),f=h.shift(),h.sort());const g=f.indexOf(":")<0&&`on${f}`;d=o instanceof Nn?o:new Nn(f,typeof o=="object"?o:null),d.namespace=h.join("."),d.rnamespace=d.namespace?new RegExp(`(^|\\.)${h.join("\\.(?:.*\\.|)")}(\\.|$)`):null,d.result=void 0,d.target||(d.target=p);const m=[d];Array.isArray(a)?m.push(...a):m.push(a);const y=Gt.get(f);if(!u&&y.trigger&&y.trigger(p,d,a)===!1)return;let b;const w=[p];if(!u&&!y.noBubble&&!ce.isWindow(p)){b=y.delegateType||f;let v=p,S=p.parentNode;for(;S!=null;)w.push(S),v=S,S=S.parentNode;const E=p.ownerDocument||document;if(v===E){const C=v.defaultView||v.parentWindow||window;w.push(C)}}let x=p;for(let v=0,S=w.length;v<S&&!d.isPropagationStopped();v+=1){const E=w[v];x=E,d.type=v>1?b:y.bindType||f;const C=Xs.get(E);C&&C.events[d.type]&&C.handler&&C.handler.call(E,...m);const P=g&&E[g]||null;P&&ce.isValidTarget(E)&&(d.result=P.call(E,...m),d.result===!1&&d.preventDefault())}if(d.type=f,!u&&!d.isDefaultPrevented()){const v=y.preventDefault;if((v==null||v(w.pop(),d,a)===!1)&&ce.isValidTarget(p)&&g&&typeof p[f]=="function"&&!ce.isWindow(p)){const S=p[g];S&&(p[g]=null),e=f,d.isPropagationStopped()&&x.addEventListener(f,ce.stopPropagationCallback),p[f](),d.isPropagationStopped()&&x.removeEventListener(f,ce.stopPropagationCallback),e=void 0,S&&(p[g]=S)}}return d.result}n.trigger=i})(ro||(ro={}));var ut;(function(n){function e(i,o,a,c,u){return io.on(i,o,a,c,u),i}n.on=e;function t(i,o,a,c,u){return io.on(i,o,a,c,u,!0),i}n.once=t;function s(i,o,a,c){return io.off(i,o,a,c),i}n.off=s;function r(i,o,a,c){return ro.trigger(o,a,i,c),i}n.trigger=r})(ut||(ut={}));var io;(function(n){function e(s,r,i,o,a,c){if(typeof r=="object"){typeof i!="string"&&(o=o||i,i=void 0),Object.keys(r).forEach(u=>e(s,u,i,o,r[u],c));return}if(o==null&&a==null?(a=i,o=i=void 0):a==null&&(typeof i=="string"?(a=o,o=void 0):(a=o,o=i,i=void 0)),a===!1)a=ce.returnFalse;else if(!a)return;if(c){const u=a;a=function(d,...f){return n.off(s,d),u.call(this,d,...f)},ce.setHandlerId(a,ce.ensureHandlerId(u))}ro.on(s,r,a,o,i)}n.on=e;function t(s,r,i,o){const a=r;if(a&&a.preventDefault!=null&&a.handleObj!=null){const c=a.handleObj;t(a.delegateTarget,c.namespace?`${c.originType}.${c.namespace}`:c.originType,c.selector,c.handler);return}if(typeof r=="object"){const c=r;Object.keys(c).forEach(u=>t(s,u,i,c[u]));return}(i===!1||typeof i=="function")&&(o=i,i=void 0),o===!1&&(o=ce.returnFalse),ro.off(s,r,o,i)}n.off=t})(io||(io={}));class $y{constructor(e,t,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=gs.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=s,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function ed(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function oR(n){return n.getBoundingClientRect().width}function aR(n){return n.getBoundingClientRect().height}function zy(n,e=60){let t=null;return(...s)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,s)},e)}}function lR(n){let e=null,t=[];const s=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const c=document.createElement("object");return c.onload=()=>{c.contentDocument.defaultView.addEventListener("resize",r),r()},c.style.display="block",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.height="100%",c.style.width="100%",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="-1",c.style.opacity="0",c.setAttribute("tabindex","-1"),c.type="text/html",n.appendChild(c),c.data="about:blank",c},r=zy(()=>{t.forEach(c=>c(n))}),i=c=>{e||(e=s()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}function cR(n){let e=null,t=[];const s=zy(()=>{t.forEach(c=>{c(n)})}),r=()=>{const c=new ResizeObserver(s);return c.observe(n),s(),c},i=c=>{e||(e=r()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}const uR=typeof ResizeObserver<"u"?cR:lR;var el;(function(n){const e=new WeakMap;function t(r){let i=e.get(r);return i||(i=uR(r),e.set(r,i),i)}function s(r){r.destroy(),e.delete(r.element)}n.bind=(r,i)=>{const o=t(r);return o.bind(i),()=>o.unbind(i)},n.clear=r=>{const i=t(r);s(i)}})(el||(el={}));class oo{constructor(e={}){this.comparator=e.comparator||oo.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,s){const r={priority:e,value:t},i=this.data.length;return s&&(r.id=s,this.index[s]=i),this.data.push(r),this.bubbleUp(i),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){const s=this.index[e];if(typeof s>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const r=this.data,i=r[s].priority,o=this.comparator(t,i);o<0?(r[s].priority=t,this.bubbleUp(s)):o>0&&(r[s].priority=t,this.bubbleDown(s))}remove(){const e=this.data,t=e[0],s=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=s,s.id&&(this.index[s.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let s,r,i=e;for(;i>0&&(r=i-1>>>1,this.comparator(t[i].priority,t[r].priority)<0);){s=t[r],t[r]=t[i];let o=t[i].id;o!=null&&(this.index[o]=r),t[i]=s,o=t[i].id,o!=null&&(this.index[o]=i),i=r}}bubbleDown(e){const t=this.data,s=t.length-1;let r=e;for(;;){const i=(r<<1)+1,o=i+1;let a=r;if(i<=s&&this.comparator(t[i].priority,t[a].priority)<0&&(a=i),o<=s&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==r){const c=t[a];t[a]=t[r];let u=t[r].id;u!=null&&(this.index[u]=a),t[r]=c,u=t[r].id,u!=null&&(this.index[u]=r),r=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(oo||(oo={}));var td;(function(n){function e(t,s,r=(i,o)=>1){const i={},o={},a={},c=new oo;for(i[s]=0,Object.keys(t).forEach(u=>{u!==s&&(i[u]=1/0),c.insert(i[u],u,u)});!c.isEmpty();){const u=c.remove();a[u]=!0;const d=t[u]||[];for(let f=0;f<d.length;f+=1){const h=d[f];if(!a[h]){const p=i[u]+r(u,h);p<i[h]&&(i[h]=p,o[h]=u,c.updatePriority(h,p))}}}return o}n.run=e})(td||(td={}));class Jn{constructor(e,t,s,r){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,s,r);if(typeof e=="string")return Jn.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,s){this.set(e.r+(t.r-e.r)*s,e.g+(t.g-e.g)*s,e.b+(t.b-e.b)*s,e.a+(t.a-e.a)*s)}lighten(e){const t=Jn.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,s,r){const i=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:s,c=Array.isArray(e)?e[3]:r;return this.r=Math.round(xt(i,0,255)),this.g=Math.round(xt(o,0,255)),this.b=Math.round(xt(a,0,255)),this.a=c==null?1:xt(c,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const s=this[t].toString(16);return s.length<2?`0${s}`:s}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Jn.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return Jn.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function e(x){return new n(x)}n.fromArray=e;function t(x){return new n([...g(x),1])}n.fromHex=t;function s(x){const v=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(v){const S=v[1].split(/\s*,\s*/).map(E=>parseInt(E,10));return new n(S)}return null}n.fromRGBA=s;function r(x,v,S){S<0&&++S,S>1&&--S;const E=6*S;return E<1?x+(v-x)*E:2*S<1?v:3*S<2?x+(v-x)*(2/3-S)*6:x}function i(x){const v=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(v){const S=v[2].split(/\s*,\s*/),E=(parseFloat(S[0])%360+360)%360/360,C=parseFloat(S[1])/100,P=parseFloat(S[2])/100,A=S[3]==null?1:parseInt(S[3],10);return new n(u(E,C,P,A))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return t(x);if(x.startsWith("rgb"))return s(x);const v=n.named[x];return v?t(v):i(x)}n.fromString=o;function a(x,v){return n.fromArray([x,x,x,v])}n.makeGrey=a;function c(x,v,S,E){const C=Array.isArray(x)?x[0]:x,P=Array.isArray(x)?x[1]:v,A=Array.isArray(x)?x[2]:S,T=Array.isArray(x)?x[3]:E,k=Math.max(C,P,A),V=Math.min(C,P,A),R=(k+V)/2;let j=0,N=0;if(V!==k){const M=k-V;switch(N=R>.5?M/(2-k-V):M/(k+V),k){case C:j=(P-A)/M+(P<A?6:0);break;case P:j=(A-C)/M+2;break;case A:j=(C-P)/M+4;break}j/=6}return[j,N,R,T??1]}n.rgba2hsla=c;function u(x,v,S,E){const C=Array.isArray(x)?x[0]:x,P=Array.isArray(x)?x[1]:v,A=Array.isArray(x)?x[2]:S,T=Array.isArray(x)?x[3]:E,k=A<=.5?A*(P+1):A+P-A*P,V=2*A-k;return[r(V,k,C+1/3)*256,r(V,k,C)*256,r(V,k,C-1/3)*256,T??1]}n.hsla2rgba=u;function d(x){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),x?void 0:parseFloat(Math.random().toFixed(2)))}n.random=d;function f(){const x="0123456789ABCDEF";let v="#";for(let S=0;S<6;S+=1)v+=x[Math.floor(Math.random()*16)];return v}n.randomHex=f;function h(x){return d(x).toString()}n.randomRGBA=h;function p(x,v){if(typeof x=="string"){const A=x[0]==="#",[T,k,V]=g(x);return v?T*.299+k*.587+V*.114>186?"#000000":"#ffffff":`${A?"#":""}${m(255-T,255-k,255-V)}`}const S=x[0],E=x[1],C=x[2],P=x[3];return v?S*.299+E*.587+C*.114>186?[0,0,0,P]:[255,255,255,P]:[255-S,255-E,255-C,P]}n.invert=p;function g(x){const v=x.indexOf("#")===0?x:`#${x}`;let S=+`0x${v.substr(1)}`;if(!(v.length===4||v.length===7)||Number.isNaN(S))throw new Error("Invalid hex color.");const E=v.length===4?4:8,C=(1<<E)-1,P=["b","g","r"].map(()=>{const A=S&C;return S>>=E,E===4?17*A:A});return[P[2],P[1],P[0]]}function m(x,v,S){const E=C=>C.length<2?`0${C}`:C;return`${E(x.toString(16))}${E(v.toString(16))}${E(S.toString(16))}`}function y(x,v){return w(x,v)}n.lighten=y;function b(x,v){return w(x,-v)}n.darken=b;function w(x,v){if(typeof x=="string"){const C=x[0]==="#",P=parseInt(C?x.substr(1):x,16),A=xt((P>>16)+v,0,255),T=xt((P>>8&255)+v,0,255),k=xt((P&255)+v,0,255);return`${C?"#":""}${(k|T<<8|A<<16).toString(16)}`}const S=m(x[0],x[1],x[2]),E=g(w(S,v));return[E[0],E[1],E[2],x[3]]}})(Jn||(Jn={})),function(n){n.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(Jn||(Jn={}));class nd{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const s=this.map.get(e);return this.map.delete(e),s}each(e){this.arr.forEach(t=>{const s=this.map.get(t);e(s,t)})}dispose(){this.clear()}}var bs;(function(n){function e(r){const i=[],o=[];return Array.isArray(r)?i.push(...r):r.split("|").forEach(a=>{a.indexOf("&")===-1?i.push(a):o.push(...a.split("&"))}),{or:i,and:o}}n.parse=e;function t(r,i){if(r!=null&&i!=null){const o=e(r),a=e(i),c=o.or.sort(),u=a.or.sort(),d=o.and.sort(),f=a.and.sort(),h=(p,g)=>p.length===g.length&&(p.length===0||p.every((m,y)=>m===g[y]));return h(c,u)&&h(d,f)}return r==null&&i==null}n.equals=t;function s(r,i,o){if(i==null||Array.isArray(i)&&i.length===0)return o?r.altKey!==!0&&r.ctrlKey!==!0&&r.metaKey!==!0&&r.shiftKey!==!0:!0;const{or:a,and:c}=e(i),u=d=>{const f=`${d.toLowerCase()}Key`;return r[f]===!0};return a.some(d=>u(d))&&c.every(d=>u(d))}n.isMatch=s})(bs||(bs={}));var Ks;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,s=t*e;return 4*(e<.5?s:3*(e-t)+s-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,s=1;;t+=s,s/=2)if(e>=(7-4*t)/11){const r=(11-6*t-11*e)/4;return-r*r+s*s}}})(Ks||(Ks={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,s=1){return r=>{const i=e(r);return i<t?t:i>s?s:i}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(Ks||(Ks={})),function(n){function e(N){return-1*Math.cos(N*(Math.PI/2))+1}n.easeInSine=e;function t(N){return Math.sin(N*(Math.PI/2))}n.easeOutSine=t;function s(N){return-.5*(Math.cos(Math.PI*N)-1)}n.easeInOutSine=s;function r(N){return N*N}n.easeInQuad=r;function i(N){return N*(2-N)}n.easeOutQuad=i;function o(N){return N<.5?2*N*N:-1+(4-2*N)*N}n.easeInOutQuad=o;function a(N){return N*N*N}n.easeInCubic=a;function c(N){const M=N-1;return M*M*M+1}n.easeOutCubic=c;function u(N){return N<.5?4*N*N*N:(N-1)*(2*N-2)*(2*N-2)+1}n.easeInOutCubic=u;function d(N){return N*N*N*N}n.easeInQuart=d;function f(N){const M=N-1;return 1-M*M*M*M}n.easeOutQuart=f;function h(N){const M=N-1;return N<.5?8*N*N*N*N:1-8*M*M*M*M}n.easeInOutQuart=h;function p(N){return N*N*N*N*N}n.easeInQuint=p;function g(N){const M=N-1;return 1+M*M*M*M*M}n.easeOutQuint=g;function m(N){const M=N-1;return N<.5?16*N*N*N*N*N:1+16*M*M*M*M*M}n.easeInOutQuint=m;function y(N){return N===0?0:Math.pow(2,10*(N-1))}n.easeInExpo=y;function b(N){return N===1?1:-Math.pow(2,-10*N)+1}n.easeOutExpo=b;function w(N){if(N===0||N===1)return N;const M=N*2,D=M-1;return M<1?.5*Math.pow(2,10*D):.5*(-Math.pow(2,-10*D)+2)}n.easeInOutExpo=w;function x(N){const M=N/1;return-1*(Math.sqrt(1-M*N)-1)}n.easeInCirc=x;function v(N){const M=N-1;return Math.sqrt(1-M*M)}n.easeOutCirc=v;function S(N){const M=N*2,D=M-2;return M<1?-.5*(Math.sqrt(1-M*M)-1):.5*(Math.sqrt(1-D*D)+1)}n.easeInOutCirc=S;function E(N,M=1.70158){return N*N*((M+1)*N-M)}n.easeInBack=E;function C(N,M=1.70158){const D=N/1-1;return D*D*((M+1)*D+M)+1}n.easeOutBack=C;function P(N,M=1.70158){const D=N*2,B=D-2,G=M*1.525;return D<1?.5*D*D*((G+1)*D-G):.5*(B*B*((G+1)*B+G)+2)}n.easeInOutBack=P;function A(N,M=.7){if(N===0||N===1)return N;const B=N/1-1,G=1-M,se=G/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*B)*Math.sin((B-se)*(2*Math.PI)/G))}n.easeInElastic=A;function T(N,M=.7){const D=1-M,B=N*2;if(N===0||N===1)return N;const G=D/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*B)*Math.sin((B-G)*(2*Math.PI)/D)+1}n.easeOutElastic=T;function k(N,M=.65){const D=1-M;if(N===0||N===1)return N;const B=N*2,G=B-1,se=D/(2*Math.PI)*Math.asin(1);return B<1?-.5*(Math.pow(2,10*G)*Math.sin((G-se)*(2*Math.PI)/D)):Math.pow(2,-10*G)*Math.sin((G-se)*(2*Math.PI)/D)*.5+1}n.easeInOutElastic=k;function V(N){const M=N/1;if(M<1/2.75)return 7.5625*M*M;if(M<2/2.75){const D=M-.5454545454545454;return 7.5625*D*D+.75}if(M<2.5/2.75){const D=M-.8181818181818182;return 7.5625*D*D+.9375}{const D=M-.9545454545454546;return 7.5625*D*D+.984375}}n.easeOutBounce=V;function R(N){return 1-V(1-N)}n.easeInBounce=R;function j(N){return N<.5?R(N*2)*.5:V(N*2-1)*.5+.5}n.easeInOutBounce=j}(Ks||(Ks={}));var Zs;(function(n){n.number=(e,t)=>{const s=t-e;return r=>e+s*r},n.object=(e,t)=>{const s=Object.keys(e);return r=>{const i={};for(let o=s.length-1;o!==-1;o-=1){const a=s[o];i[a]=e[a]+(t[a]-e[a])*r}return i}},n.unit=(e,t)=>{const s=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=s.exec(e),i=s.exec(t),o=i?i[1]:"",a=r?+r[1]:0,c=i?+i[1]:0,u=o.indexOf("."),d=u>0?o[1].length-u-1:0,f=c-a,h=r?r[2]:"";return p=>(a+f*p).toFixed(d)+h},n.color=(e,t)=>{const s=parseInt(e.slice(1),16),r=parseInt(t.slice(1),16),i=s&255,o=(r&255)-i,a=s&65280,c=(r&65280)-a,u=s&16711680,d=(r&16711680)-u;return f=>{const h=i+o*f&255,p=a+c*f&65280,g=u+d*f&16711680;return`#${(1<<24|h|p|g).toString(16).slice(1)}`}}})(Zs||(Zs={}));const ao=[];function Fr(n,e){const t=ao.find(s=>s.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!gs.isApplyingHMR()){const s=document.createElement("style");s.setAttribute("type","text/css"),s.textContent=e;const r=document.querySelector("head");r&&r.insertBefore(s,r.firstChild),ao.push({name:n,loadTimes:1,styleElement:s})}}function Ur(n){const e=ao.findIndex(t=>t.name===n);if(e>-1){const t=ao[e];if(t.loadTimes-=1,t.loadTimes>0)return;let s=t.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,ao.splice(e,1)}}var ye;(function(n){function e(s){return 180*s/Math.PI%360}n.toDeg=e,n.toRad=function(s,r=!1){return(r?s:s%360)*Math.PI/180};function t(s){return s%360+(s<0?360:0)}n.normalize=t})(ye||(ye={}));var Ce;(function(n){function e(a,c=0){return Number.isInteger(a)?a:+a.toFixed(c)}n.round=e;function t(a,c){let u,d;if(c==null?(d=a??1,u=0):(d=c,u=a??0),d<u){const f=u;u=d,d=f}return Math.floor(Math.random()*(d-u+1)+u)}n.random=t;function s(a,c,u){return Number.isNaN(a)?NaN:Number.isNaN(c)||Number.isNaN(u)?0:c<u?a<c?c:a>u?u:a:a<u?u:a>c?c:a}n.clamp=s;function r(a,c){return c*Math.round(a/c)}n.snapToGrid=r;function i(a,c){return c!=null&&a!=null&&c.x>=a.x&&c.x<=a.x+a.width&&c.y>=a.y&&c.y<=a.y+a.height}n.containsPoint=i;function o(a,c){const u=a.x-c.x,d=a.y-c.y;return u*u+d*d}n.squaredLength=o})(Ce||(Ce={}));class ws{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class O extends ws{constructor(e,t){super(),this.x=e??0,this.y=t??0}round(e=0){return this.x=Ce.round(this.x,e),this.y=Ce.round(this.y,e),this}add(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}update(e,t){const s=O.create(e,t);return this.x=s.x,this.y=s.y,this}translate(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}rotate(e,t){const s=O.rotate(this,e,t);return this.x=s.x,this.y=s.y,this}scale(e,t,s=new O){const r=O.create(s);return this.x=r.x+e*(this.x-r.x),this.y=r.y+t*(this.y-r.y),this}closest(e){if(e.length===1)return O.create(e[0]);let t=null,s=1/0;return e.forEach(r=>{const i=this.squaredDistance(r);i<s&&(t=r,s=i)}),t?O.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=O.create(e),s=this.x-t.x,r=this.y-t.y;return s*s+r*r}manhattanDistance(e){const t=O.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new O){const t=O.create(e),s=-(t.y-this.y),r=t.x-this.x;let i=Math.atan2(s,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let s=this.theta(t)-this.theta(e);return s<0&&(s+=360),s}vectorAngle(e){return new O(0,0).angleBetween(this,e)}toPolar(e){return this.update(O.toPolar(this,e)),this}changeInAngle(e,t,s=new O){return this.clone().translate(-e,-t).theta(s)-this.theta(s)}adhereToRect(e){return Ce.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=O.create(e),s=ye.toRad(this.y),r=ye.toRad(t.y),i=this.x,o=t.x,a=ye.toRad(o-i),c=Math.sin(a)*Math.cos(r),u=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(a),d=ye.toDeg(Math.atan2(c,u)),f=["NE","E","SE","S","SW","W","NW","N"];let h=d-22.5;return h<0&&(h+=360),h=parseInt(h/45,10),f[h]}cross(e,t){if(e!=null&&t!=null){const s=O.create(e),r=O.create(t);return(r.x-this.x)*(s.y-this.y)-(r.y-this.y)*(s.x-this.x)}return NaN}dot(e){const t=O.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new O(this.x-e,this.y-t);const s=O.create(e);return new O(this.x-s.x,this.y-s.y)}lerp(e,t){const s=O.create(e);return new O((1-t)*this.x+t*s.x,(1-t)*this.y+t*s.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const s=O.create(e),r=ye.toRad(s.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return O.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Ce.snapToGrid(this.x,e),this.y=Ce.snapToGrid(this.y,t??e),this}equals(e){const t=O.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return O.clone(this)}toJSON(){return O.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(O||(O={})),function(n){function e(s){return s!=null&&typeof s=="object"&&typeof s.x=="number"&&typeof s.y=="number"}n.isPointLike=e;function t(s){return s!=null&&Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"}n.isPointData=t}(O||(O={})),function(n){function e(f,h){return f==null||typeof f=="number"?new n(f,h):t(f)}n.create=e;function t(f){return n.isPoint(f)?new n(f.x,f.y):Array.isArray(f)?new n(f[0],f[1]):new n(f.x,f.y)}n.clone=t;function s(f){return n.isPoint(f)?{x:f.x,y:f.y}:Array.isArray(f)?{x:f[0],y:f[1]}:{x:f.x,y:f.y}}n.toJSON=s;function r(f,h,p=new n){let g=Math.abs(f*Math.cos(h)),m=Math.abs(f*Math.sin(h));const y=t(p),b=ye.normalize(ye.toDeg(h));return b<90?m=-m:b<180?(g=-g,m=-m):b<270&&(g=-g),new n(y.x+g,y.y+m)}n.fromPolar=r;function i(f,h=new n){const p=t(f),g=t(h),m=p.x-g.x,y=p.y-g.y;return new n(Math.sqrt(m*m+y*y),ye.toRad(g.theta(p)))}n.toPolar=i;function o(f,h){return f===h?!0:f!=null&&h!=null?f.x===h.x&&f.y===h.y:!1}n.equals=o;function a(f,h){if(f==null&&h!=null||f!=null&&h==null||f!=null&&h!=null&&f.length!==h.length)return!1;if(f!=null&&h!=null){for(let p=0,g=f.length;p<g;p+=1)if(!o(f[p],h[p]))return!1}return!0}n.equalPoints=a;function c(f,h,p,g){return new n(Ce.random(f,h),Ce.random(p,g))}n.random=c;function u(f,h,p){const g=ye.toRad(ye.normalize(-h)),m=Math.sin(g),y=Math.cos(g);return d(f,y,m,p)}n.rotate=u;function d(f,h,p,g=new n){const m=t(f),y=t(g),b=m.x-y.x,w=m.y-y.y,x=b*h-w*p,v=w*h+b*p;return new n(x+y.x,v+y.y)}n.rotateEx=d}(O||(O={}));class F extends ws{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new O(this.x,this.y)}get topLeft(){return new O(this.x,this.y)}get topCenter(){return new O(this.x+this.width/2,this.y)}get topRight(){return new O(this.x+this.width,this.y)}get center(){return new O(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new O(this.x,this.y+this.height)}get bottomCenter(){return new O(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new O(this.x+this.width,this.y+this.height)}get corner(){return new O(this.x+this.width,this.y+this.height)}get rightMiddle(){return new O(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new O(this.x,this.y+this.height/2)}get topLine(){return new Y(this.topLeft,this.topRight)}get rightLine(){return new Y(this.topRight,this.bottomRight)}get bottomLine(){return new Y(this.bottomLeft,this.bottomRight)}get leftLine(){return new Y(this.topLeft,this.bottomLeft)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??0,this.width=s??0,this.height=r??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const t=ye.toRad(e),s=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),i=this.width*r+this.height*s,o=this.width*s+this.height*r;return new F(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=Ce.round(this.x,e),this.y=Ce.round(this.y,e),this.width=Ce.round(this.width,e),this.height=Ce.round(this.height,e),this}add(e,t,s,r){const i=F.create(e,t,s,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),c=Math.max(this.x+this.width,i.x+i.width),u=Math.max(this.y+this.height,i.y+i.height);return this.x=o,this.y=a,this.width=c-o,this.height=u-a,this}update(e,t,s,r){const i=F.create(e,t,s,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(e,t){const s=e,r=t??e;return this.x-=s,this.y-=r,this.width+=2*s,this.height+=2*r,this}snapToGrid(e,t){const s=this.origin.snapToGrid(e,t),r=this.corner.snapToGrid(e,t);return this.x=s.x,this.y=s.y,this.width=r.x-s.x,this.height=r.y-s.y,this}translate(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}scale(e,t,s=new O){const r=this.origin.scale(e,t,s);return this.x=r.x,this.y=r.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const s=ye.toRad(e),r=Math.cos(s),i=Math.sin(s);let o=this.getOrigin(),a=this.getTopRight(),c=this.getBottomRight(),u=this.getBottomLeft();o=O.rotateEx(o,r,i,t),a=O.rotateEx(a,r,i,t),c=O.rotateEx(c,r,i,t),u=O.rotateEx(u,r,i,t);const d=new F(o.x,o.y,0,0);d.add(a.x,a.y,0,0),d.add(c.x,c.y,0,0),d.add(u.x,u.y,0,0),this.update(d)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=F.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const s=F.clone(e),r=t.x,i=t.y;let o=1/0,a=1/0,c=1/0,u=1/0,d=1/0,f=1/0,h=1/0,p=1/0;const g=s.topLeft;g.x<r&&(o=(this.x-r)/(g.x-r)),g.y<i&&(d=(this.y-i)/(g.y-i));const m=s.bottomRight;m.x>r&&(a=(this.x+this.width-r)/(m.x-r)),m.y>i&&(f=(this.y+this.height-i)/(m.y-i));const y=s.topRight;y.x>r&&(c=(this.x+this.width-r)/(y.x-r)),y.y<i&&(h=(this.y-i)/(y.y-i));const b=s.bottomLeft;return b.x<r&&(u=(this.x-r)/(b.x-r)),b.y>i&&(p=(this.y+this.height-i)/(b.y-i)),{sx:Math.min(o,a,c,u),sy:Math.min(d,f,h,p)}}getMaxUniformScaleToFit(e,t=this.center){const s=this.getMaxScaleToFit(e,t);return Math.min(s.sx,s.sy)}containsPoint(e,t){return Ce.containsPoint(this,O.create(e,t))}containsRect(e,t,s,r){const i=F.create(e,t,s,r),o=this.x,a=this.y,c=this.width,u=this.height,d=i.x,f=i.y,h=i.width,p=i.height;return c===0||u===0||h===0||p===0?!1:d>=o&&f>=a&&d+h<=o+c&&f+p<=a+u}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=[],r=[];return t.forEach(i=>{const o=e.intersectsWithLine(i);o!==null&&r.indexOf(o.toString())<0&&(s.push(o),r.push(o.toString()))}),s.length>0?s:null}intersectsWithLineFromCenterToPoint(e,t){const s=O.clone(e),r=this.center;let i=null;t!=null&&t!==0&&s.rotate(t,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new Y(r,s);for(let c=o.length-1;c>=0;c-=1){const u=o[c].intersectsWithLine(a);if(u!==null){i=u;break}}return i&&t!=null&&t!==0&&i.rotate(-t,r),i}intersectsWithRect(e,t,s,r){const i=F.create(e,t,s,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,c=i.origin,u=i.corner,d=Math.max(o.x,c.x),f=Math.max(o.y,c.y);return new F(d,f,Math.min(a.x,u.x)-d,Math.min(a.y,u.y)-f)}isIntersectWithRect(e,t,s,r){const i=F.create(e,t,s,r),o=this.origin,a=this.corner,c=i.origin,u=i.corner;return!(u.x<=o.x||u.y<=o.y||c.x>=a.x||c.y>=a.y)}normalize(){let e=this.x,t=this.y,s=this.width,r=this.height;return this.width<0&&(e=this.x+this.width,s=-this.width),this.height<0&&(t=this.y+this.height,r=-this.height),this.x=e,this.y=t,this.width=s,this.height=r,this}union(e){const t=F.clone(e),s=this.origin,r=this.corner,i=t.origin,o=t.corner,a=Math.min(s.x,i.x),c=Math.min(s.y,i.y),u=Math.max(r.x,o.x),d=Math.max(r.y,o.y);return new F(a,c,u-a,d-c)}getNearestSideToPoint(e){const t=O.clone(e),s=t.x-this.x,r=this.x+this.width-t.x,i=t.y-this.y,o=this.y+this.height-t.y;let a=s,c="left";return r<a&&(a=r,c="right"),i<a&&(a=i,c="top"),o<a&&(c="bottom"),c}getNearestPointToPoint(e){const t=O.clone(e);if(this.containsPoint(t)){const s=this.getNearestSideToPoint(t);if(s==="left")return new O(this.x,t.y);if(s==="top")return new O(t.x,this.y);if(s==="right")return new O(this.x+this.width,t.y);if(s==="bottom")return new O(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new F(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isRectangle=e})(F||(F={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(F||(F={})),function(n){function e(o,a,c,u){return o==null||typeof o=="number"?new n(o,a,c,u):t(o)}n.create=e;function t(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=t;function s(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=s;function r(o){return new n(0,0,o.width,o.height)}n.fromSize=r;function i(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=i}(F||(F={}));class Y extends ws{get center(){return new O((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,s,r){super(),typeof e=="number"&&typeof t=="number"?(this.start=new O(e,t),this.end=new O(s,r)):(this.start=O.create(e),this.end=O.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,s){return this.start.scale(e,t,s),this.end.scale(e,t,s),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const s=e/t;return this.scale(s,s,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:s,end:r}=t,i=s.clone().rotate(270,r),o=r.clone().rotate(90,s);return s.move(o,e),r.move(i,e),t}vector(){return new O(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new O(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),s=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new F(e,t,s-e,r-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new Y(this.start,e).vector()),s=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(s)?0:s}pointAt(e){const t=this.start,s=this.end;return e<=0?t.clone():e>=1?s.clone():t.lerp(s,e)}pointAtLength(e){const t=this.start,s=this.end;let r=!0;e<0&&(r=!1,e=-e);const i=this.length();if(e>=i)return r?s.clone():t.clone();const o=(r?e:i-e)/i;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new Y(this.start,t),new Y(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new Y(this.start,t),new Y(t,this.end)]}containsPoint(e){const t=this.start,s=this.end;if(t.cross(e,s)!==0)return!1;const r=this.length();return!(new Y(t,e).length()>r||new Y(e,s).length()>r)}intersect(e,t){const s=e.intersectsWithLine(this,t);return s?Array.isArray(s)?s:[s]:null}intersectsWithLine(e){const t=new O(this.end.x-this.start.x,this.end.y-this.start.y),s=new O(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*s.y-t.y*s.x,i=new O(e.start.x-this.start.x,e.start.y-this.start.y),o=i.x*s.y-i.y*s.x,a=i.x*t.y-i.y*t.x;if(r===0||o*r<0||a*r<0)return null;if(r>0){if(o>r||a>r)return null}else if(o<r||a<r)return null;return new O(this.start.x+o*t.x/r,this.start.y+o*t.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=O.clone(e),s=this.start,r=this.end;return((r.x-s.x)*(t.y-s.y)-(r.y-s.y)*(t.x-s.x))/this.length()}pointSquaredDistance(e,t){const s=O.create(e,t);return this.closestPoint(s).squaredDistance(s)}pointDistance(e,t){const s=O.create(e,t);return this.closestPoint(s).distance(s)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAt(e),i=new Y(t,s);return i.translate(r.x-t.x,r.y-t.y),i}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAtLength(e),i=new Y(t,s);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){const s=O.create(e,t);let r=s.x-this.start.x,i=s.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let c=r*a-i*o;return c===0&&(c=r*o+i*a,c>0&&(r-=o,i-=a,c=r*o+i*a,c<0&&(c=0))),c<0?-1:c>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new Y(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isLine=e})(Y||(Y={}));class pn extends ws{get center(){return new O(this.x,this.y)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??0,this.a=s??0,this.b=r??0}bbox(){return F.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const s=e,r=t??e;return this.a+=2*s,this.b+=2*r,this}normalizedDistance(e,t){const s=O.create(e,t),r=s.x-this.x,i=s.y-this.y,o=this.a,a=this.b;return r*r/(o*o)+i*i/(a*a)}containsPoint(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],s=this.a,r=this.b,i=e.start,o=e.end,a=e.vector(),c=i.diff(new O(this.x,this.y)),u=new O(a.x/(s*s),a.y/(r*r)),d=new O(c.x/(s*s),c.y/(r*r)),f=a.dot(u),h=a.dot(d),p=c.dot(d)-1,g=h*h-f*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-h-m)/f,b=(-h+m)/f;if((y<0||y>1)&&(b<0||b>1))return null;y>=0&&y<=1&&t.push(i.lerp(o,y)),b>=0&&b<=1&&t.push(i.lerp(o,b))}else{const m=-h/f;if(m>=0&&m<=1)t.push(i.lerp(o,m));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const s=O.clone(e);t&&s.rotate(t,this.getCenter());const r=s.x-this.x,i=s.y-this.y;let o;if(r===0)return o=this.bbox().getNearestPointToPoint(s),t?o.rotate(-t,this.getCenter()):o;const a=i/r,c=a*a,u=this.a*this.a,d=this.b*this.b;let f=Math.sqrt(1/(1/u+c/d));f=r<0?-f:f;const h=a*f;return o=new O(this.x+f,this.y+h),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=O.clone(e),s=t.x,r=t.y,i=this.a,o=this.b,a=this.bbox().center,c=a.x,u=a.y,d=30,f=s>a.x+i/2,h=s<a.x-i/2;let p,g;return f||h?(g=s>a.x?r-d:r+d,p=i*i/(s-c)-i*i*(r-u)*(g-u)/(o*o*(s-c))+c):(p=r>a.y?s+d:s-d,g=o*o/(r-u)-o*o*(s-c)*(p-c)/(i*i*(r-u))+u),new O(p,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const s=F.fromEllipse(this);s.rotate(e,t);const r=pn.fromRect(s);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(e,t){const s=O.create(e,t);return this.x+=s.x,this.y+=s.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new pn(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isEllipse=e})(pn||(pn={})),function(n){function e(r,i,o,a){return r==null||typeof r=="number"?new n(r,i,o,a):t(r)}n.create=e;function t(r){return n.isEllipse(r)?r.clone():Array.isArray(r)?new n(r[0],r[1],r[2],r[3]):new n(r.x,r.y,r.a,r.b)}n.parse=t;function s(r){const i=r.center;return new n(i.x,i.y,r.width/2,r.height/2)}n.fromRect=s}(pn||(pn={}));const dR=new RegExp("^[\\s\\dLMCZz,.]*$");function hR(n){return typeof n!="string"?!1:dR.test(n)}function sd(n,e){return(n%e+e)%e}function fR(n,e,t,s,r){const i=[],o=n[n.length-1],a=e!=null&&e>0,c=e||0;if(s&&a){n=n.slice();const f=n[0],h=new O(o.x+(f.x-o.x)/2,o.y+(f.y-o.y)/2);n.splice(0,0,h)}let u=n[0],d=1;for(t?i.push("M",u.x,u.y):i.push("L",u.x,u.y);d<(s?n.length:n.length-1);){let f=n[sd(d,n.length)],h=u.x-f.x,p=u.y-f.y;if(a&&(h!==0||p!==0)&&(r==null||r.indexOf(d-1)<0)){let g=Math.sqrt(h*h+p*p);const m=h*Math.min(c,g/2)/g,y=p*Math.min(c,g/2)/g,b=f.x+m,w=f.y+y;i.push("L",b,w);let x=n[sd(d+1,n.length)];for(;d<n.length-2&&Math.round(x.x-f.x)===0&&Math.round(x.y-f.y)===0;)x=n[sd(d+2,n.length)],d+=1;h=x.x-f.x,p=x.y-f.y,g=Math.max(1,Math.sqrt(h*h+p*p));const v=h*Math.min(c,g/2)/g,S=p*Math.min(c,g/2)/g,E=f.x+v,C=f.y+S;i.push("Q",f.x,f.y,E,C),f=new O(E,C)}else i.push("L",f.x,f.y);u=f,d+=1}return s?i.push("Z"):i.push("L",o.x,o.y),i.map(f=>typeof f=="string"?f:+f.toFixed(3)).join(" ")}function Fy(n,e={}){const t=[];return n&&n.length&&n.forEach(s=>{Array.isArray(s)?t.push({x:s[0],y:s[1]}):t.push({x:s.x,y:s.y})}),fR(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function tl(n,e,t,s,r=0,i=0,o=0,a,c){if(t===0||s===0)return[];a-=n,c-=e,t=Math.abs(t),s=Math.abs(s);const u=-a/2,d=-c/2,f=Math.cos(r*Math.PI/180),h=Math.sin(r*Math.PI/180),p=f*u+h*d,g=-1*h*u+f*d,m=p*p,y=g*g,b=t*t,w=s*s,x=m/b+y/w;let v;if(x>1)t=Math.sqrt(x)*t,s=Math.sqrt(x)*s,v=0;else{let Z=1;i===o&&(Z=-1),v=Z*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const S=v*t*g/s,E=-1*v*s*p/t,C=f*S-h*E+a/2,P=h*S+f*E+c/2;let A=Math.atan2((g-E)/s,(p-S)/t)-Math.atan2(0,1),T=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-E)/s,(-p-S)/t)-Math.atan2((g-E)/s,(p-S)/t);let k=A>=0?A:2*Math.PI+A;o===0&&k>0?k-=2*Math.PI:o!==0&&k<0&&(k+=2*Math.PI);const V=k*2/Math.PI,R=Math.ceil(V<0?-1*V:V),j=k/R,N=8/3*Math.sin(j/4)*Math.sin(j/4)/Math.sin(j/2),M=f*t,D=f*s,B=h*t,G=h*s;let se=Math.cos(T),I=Math.sin(T),_=-N*(M*I+G*se),H=-N*(B*I-D*se),K=0,q=0;const re=[];for(let Z=0;Z<R;Z+=1){T+=j,se=Math.cos(T),I=Math.sin(T),K=M*se-G*I+C,q=B*se+D*I+P;const ge=-N*(M*I+G*se),te=-N*(B*I-D*se),le=Z*6;re[le]=Number(_+n),re[le+1]=Number(H+e),re[le+2]=Number(K-ge+n),re[le+3]=Number(q-te+e),re[le+4]=Number(K+n),re[le+5]=Number(q+e),_=K+ge,H=q+te}return re.map(Z=>+Z.toFixed(2))}function pR(n,e,t,s,r=0,i=0,o=0,a,c){const u=[],d=tl(n,e,t,s,r,i,o,a,c);if(d!=null)for(let f=0,h=d.length;f<h;f+=6)u.push("C",d[f],d[f+1],d[f+2],d[f+3],d[f+4],d[f+5]);return u.join(" ")}class ze extends ws{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return ze.parse(e);this.points=e.map(t=>O.create(t))}else this.points=[]}scale(e,t,s=new O){return this.points.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.points.forEach(s=>s.rotate(e,t)),this}translate(e,t){const s=O.create(e,t);return this.points.forEach(r=>r.translate(s.x,s.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new F;let e=1/0,t=-1/0,s=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const c=i[o],u=c.x,d=c.y;u<e&&(e=u),u>t&&(t=u),d<s&&(s=d),d>r&&(r=d)}return new F(e,s,t-e,r-s)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,s=t.length;if(s===0||s===1)return 0;let r=0,i=0,o=1/0;for(let a=0,c=s-1;a<c;a+=1){const u=new Y(t[a],t[a+1]),d=u.length(),f=u.closestPointNormalizedLength(e),p=u.pointAt(f).squaredDistance(e);p<o&&(o=p,i=r+f*d),r+=d}return i}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=O.clone(e),s=t.x,r=t.y,i=this.points,o=i.length;let a=o-1,c=0;for(let u=0;u<o;u+=1){const d=i[a],f=i[u];if(t.equals(d))return!0;const h=new Y(d,f);if(h.containsPoint(e))return!0;if(r<=d.y&&r>f.y||r>d.y&&r<=f.y){const p=d.x-s>f.x-s?d.x-s:f.x-s;if(p>=0){const g=new O(s+p,r),m=new Y(e,g);h.intersectsWithLine(m)&&(c+=1)}}a=u}return c%2===1}intersectsWithLine(e){const t=[];for(let s=0,r=this.points.length-1;s<r;s+=1){const i=this.points[s],o=this.points[s+1],a=e.intersectsWithLine(new Y(i,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const s=this.points[e],r=this.points[e+1];if(new Y(s,r).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,s=this.points.length-1;t<s;t+=1){const r=this.points[t],i=this.points[t+1];e+=r.distance(i)}return e}pointAt(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1||e<=0)return t[0].clone();if(e>=1)return t[s-1].clone();const i=this.length()*e;return this.pointAtLength(i)}pointAtLength(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1)return t[0].clone();let r=!0;e<0&&(r=!1,e=-e);let i=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],f=t[u+1],h=new Y(d,f),p=d.distance(f);if(e<=i+p)return h.pointAtLength((r?1:-1)*(e-i));i+=p}return(r?t[s-1]:t[0]).clone()}tangentAt(e){const s=this.points.length;if(s===0||s===1)return null;e<0&&(e=0),e>1&&(e=1);const i=this.length()*e;return this.tangentAtLength(i)}tangentAtLength(e){const t=this.points,s=t.length;if(s===0||s===1)return null;let r=!0;e<0&&(r=!1,e=-e);let i,o=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],f=t[u+1],h=new Y(d,f),p=d.distance(f);if(h.isDifferentiable()){if(e<=o+p)return h.tangentAtLength((r?1:-1)*(e-o));i=h}o+=p}if(i){const a=r?1:0;return i.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const s=e.threshold||0;let r=0;for(;t[r+2];){const i=r,o=r+1,a=r+2,c=t[i],u=t[o],d=t[a];new Y(c,d).closestPoint(u).distance(u)<=s?t.splice(o,1):r+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new ze;let s=e[0];for(let h=1;h<t;h+=1)(e[h].y<s.y||e[h].y===s.y&&e[h].x>s.x)&&(s=e[h]);const r=[];for(let h=0;h<t;h+=1){let p=s.theta(e[h]);p===0&&(p=360),r.push([e[h],h,p])}if(r.sort((h,p)=>{let g=h[2]-p[2];return g===0&&(g=p[1]-h[1]),g}),r.length>2){const h=r[r.length-1];r.unshift(h)}const i={},o=[],a=h=>`${h[0].toString()}@${h[1]}`;for(;r.length!==0;){const h=r.pop(),p=h[0];if(i[a(h)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(h),g=!0;else{const m=o.pop(),y=m[0],b=o.pop(),w=b[0],x=w.cross(y,p);if(x<0)o.push(b),o.push(m),o.push(h),g=!0;else if(x===0){const S=y.angleBetween(w,p);Math.abs(S-180)<1e-10||y.equals(p)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((S+1)%360-1)<1e-10&&(o.push(b),r.push(m))}else i[a(m)]=y,o.push(b)}}o.length>2&&o.pop();let c,u=-1;for(let h=0,p=o.length;h<p;h+=1){const g=o[h][1];(c===void 0||g<c)&&(c=g,u=h)}let d=[];if(u>0){const h=o.slice(u),p=o.slice(0,u);d=h.concat(p)}else d=o;const f=[];for(let h=0,p=d.length;h<p;h+=1)f.push(d[h][0]);return new ze(f)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,s)=>t.equals(this.points[s]))}clone(){return new ze(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(ze||(ze={})),function(n){function e(t){const s=t.trim();if(s==="")return new n;const r=[],i=s.split(/\s*,\s*|\s+/);for(let o=0,a=i.length;o<a;o+=2)r.push({x:+i[o],y:+i[o+1]});return new n(r)}n.parse=e}(ze||(ze={}));class Be extends ws{constructor(e,t,s,r){super(),this.PRECISION=3,this.start=O.create(e),this.controlPoint1=O.create(t),this.controlPoint2=O.create(s),this.end=O.create(r)}bbox(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end,i=e.x,o=e.y,a=t.x,c=t.y,u=s.x,d=s.y,f=r.x,h=r.y,p=[],g=[[],[]];let m,y,b,w,x,v,S,E;for(let M=0;M<2;M+=1){if(M===0?(y=6*i-12*a+6*u,m=-3*i+9*a-9*u+3*f,b=3*a-3*i):(y=6*o-12*c+6*d,m=-3*o+9*c-9*d+3*h,b=3*c-3*o),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;w=-b/y,w>0&&w<1&&p.push(w);continue}S=y*y-4*b*m,E=Math.sqrt(S),!(S<0)&&(x=(-y+E)/(2*m),x>0&&x<1&&p.push(x),v=(-y-E)/(2*m),v>0&&v<1&&p.push(v))}let C,P,A,T=p.length;const k=T;for(;T;)T-=1,w=p[T],A=1-w,C=A*A*A*i+3*A*A*w*a+3*A*w*w*u+w*w*w*f,g[0][T]=C,P=A*A*A*o+3*A*A*w*c+3*A*w*w*d+w*w*w*h,g[1][T]=P;p[k]=0,p[k+1]=1,g[0][k]=i,g[1][k]=o,g[0][k+1]=f,g[1][k+1]=h,p.length=k+2,g[0].length=k+2,g[1].length=k+2;const V=Math.min.apply(null,g[0]),R=Math.min.apply(null,g[1]),j=Math.max.apply(null,g[0]),N=Math.max.apply(null,g[1]);return new F(V,R,j-V,N-R)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const s=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,s),s)}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(!r)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){const s=this.getPrecision(t),r=this.getDivisions(t),i=Math.pow(10,-s);let o=null,a=0,c=0,u=0,d=0,f=0,h=null;const p=r.length;let g=p>0?1/p:0;for(r.forEach((m,y)=>{const b=m.start.distance(e),w=m.end.distance(e),x=b+w;(h==null||x<h)&&(o=m,a=y*g,c=(y+1)*g,u=b,d=w,h=x,f=m.endpointDistance())});;){const m=u?Math.abs(u-d)/u:0,y=d!=null?Math.abs(u-d)/d:0,b=m<i||y<i,w=u?u<f*i:!0,x=d?d<f*i:!0;if(b||(w||x))return u<=d?a:c;const S=o.divide(.5);g/=2;const E=S[0].start.distance(e),C=S[0].end.distance(e),P=E+C,A=S[1].start.distance(e),T=S[1].end.distance(e),k=A+T;P<=k?(o=S[0],c-=g,u=E,d=C):(o=S[1],a+=g,u=A,d=T)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const s=this.tAt(e,t);return this.divideAtT(s)}divideAtLength(e,t={}){const s=this.tAtLength(e,t);return this.divideAtT(s)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return[new Be(t,t,t,t),new Be(t,s,r,i)];if(e>=1)return[new Be(t,s,r,i),new Be(i,i,i,i)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,c=o.startControlPoint2,u=o.divider,d=o.dividerControlPoint1,f=o.dividerControlPoint2;return[new Be(t,a,c,u),new Be(u,d,f,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:r.clone()};if(e>=1)return{startControlPoint1:s.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new Y(t,s).pointAt(e),a=new Y(s,r).pointAt(e),c=new Y(r,i).pointAt(e),u=new Y(o,a).pointAt(e),d=new Y(a,c).pointAt(e),f=new Y(u,d).pointAt(e);return{startControlPoint1:o,startControlPoint2:u,divider:f,dividerControlPoint1:d,dividerControlPoint2:c}}getSubdivisions(e={}){const t=this.getPrecision(e);let s=[new Be(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return s;let r=this.endpointDistance();const i=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];s.forEach(d=>{const f=d.divide(.5);a.push(f[0],f[1])});const c=a.reduce((d,f)=>d+f.endpointDistance(),0),u=c!==0?(c-r)/c:0;if(o>1&&u<i)return a;s=a,r=c}}length(e={}){return this.getDivisions(e).reduce((s,r)=>s+r.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const s=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:s})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.tAt(e,t);return this.pointAtT(s)}pointAtLength(e,t={}){const s=this.tAtLength(e,t);return this.pointAtT(s)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const s=this.tAt(e,t);return this.tangentAtT(s)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const s=this.tAtLength(e,t);return this.tangentAtT(s)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),s=t.startControlPoint2,r=t.dividerControlPoint1,i=t.divider,o=new Y(s,r);return o.translate(i.x-s.x,i.y-s.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),s=this.getDivisions(e);return{precision:t,subdivisions:s}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const s=this.getOptions(t),i=this.length(s)*e;return this.tAtLength(i,s)}tAtLength(e,t={}){let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getDivisions(t),o={precision:r,subdivisions:i};let a=null,c,u,d=0,f=0,h=0;const p=i.length;let g=p>0?1/p:0;for(let b=0;b<p;b+=1){const w=s?b:p-1-b,x=i[b],v=x.endpointDistance();if(e<=h+v){a=x,c=w*g,u=(w+1)*g,d=s?e-h:v+h-e,f=s?v+h-e:e-h;break}h+=v}if(a==null)return s?1:0;const m=this.length(o),y=Math.pow(10,-r);for(;;){let b;if(b=m!==0?d/m:0,b<y)return c;if(b=m!==0?f/m:0,b<y)return u;let w,x;const v=a.divide(.5);g/=2;const S=v[0].endpointDistance(),E=v[1].endpointDistance();d<=S?(a=v[0],u-=g,w=d,x=S-w):(a=v[1],c+=g,w=d-S,x=E-w),d=w,f=x}}toPoints(e={}){const t=this.getDivisions(e),s=[t[0].start.clone()];return t.forEach(r=>s.push(r.end.clone())),s}toPolyline(e={}){return new ze(this.toPoints(e))}scale(e,t,s){return this.start.scale(e,t,s),this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Be(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isCurve=e})(Be||(Be={})),function(n){function e(r){const i=r.length,o=[],a=[];let c=2;o[0]=r[0]/c;for(let u=1;u<i;u+=1)a[u]=1/c,c=(u<i-1?4:3.5)-a[u],o[u]=(r[u]-o[u-1])/c;for(let u=1;u<i;u+=1)o[i-u-1]-=a[i-u]*o[i-u];return o}function t(r){const i=r.map(h=>O.clone(h)),o=[],a=[],c=i.length-1;if(c===1)return o[0]=new O((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new O(2*o[0].x-i[0].x,2*o[0].y-i[0].y),[o,a];const u=[];for(let h=1;h<c-1;h+=1)u[h]=4*i[h].x+2*i[h+1].x;u[0]=i[0].x+2*i[1].x,u[c-1]=(8*i[c-1].x+i[c].x)/2;const d=e(u);for(let h=1;h<c-1;h+=1)u[h]=4*i[h].y+2*i[h+1].y;u[0]=i[0].y+2*i[1].y,u[c-1]=(8*i[c-1].y+i[c].y)/2;const f=e(u);for(let h=0;h<c;h+=1)o.push(new O(d[h],f[h])),h<c-1?a.push(new O(2*i[h+1].x-d[h+1],2*i[h+1].y-f[h+1])):a.push(new O((i[c].x+d[c-1])/2,(i[c].y+f[c-1])/2));return[o,a]}function s(r){if(r==null||Array.isArray(r)&&r.length<2)throw new Error("At least 2 points are required");const i=t(r),o=[];for(let a=0,c=i[0].length;a<c;a+=1){const u=new O(i[0][a].x,i[0][a].y),d=new O(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,d,r[a+1]))}return o}n.throughPoints=s}(Be||(Be={}));class nl extends ws{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const s=this.length();return e>=1?s:s*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class gt extends nl{constructor(e,t){super(),Y.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=O.create(e,t).round(2)}get type(){return"L"}get line(){return new Y(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new gt(t[0]),new gt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new gt(t[0]),new gt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new gt(this.end)}scale(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(Y.isLine(r))return new n(r);if(O.isPointLike(r))return s===1?new n(r):t.map(o=>new n(o));if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];i.push(new n(a,c))}return i}n.create=e})(gt||(gt={}));class Hr extends nl{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new Y(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new gt(t[0]):this.clone(),new gt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new gt(t[0]):this.clone(),new gt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new Hr}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(Hr||(Hr={}));class Gr extends nl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,Y.isLine(e)||Be.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=O.create(e,t).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new Gr(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(Y.isLine(r))return new n(r);if(Be.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===1)return new n(r);const o=[];for(let a=0;a<s;a+=1)a===0?o.push(new n(t[a])):o.push(new gt(t[a]));return o}if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];o===0?i.push(new n(a,c)):i.push(new gt(a,c))}return i}n.create=e})(Gr||(Gr={}));class Wt extends nl{constructor(e,t,s,r,i,o){super(),Be.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new O(e,t).round(2),this.controlPoint2=new O(s,r).round(2),this.endPoint=new O(i,o).round(2)):(this.controlPoint1=O.create(e).round(2),this.controlPoint2=O.create(t).round(2),this.endPoint=O.create(s).round(2))}get type(){return"C"}get curve(){return new Be(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const s=this.curve.divideAt(e,t);return[new Wt(s[0]),new Wt(s[1])]}divideAtLength(e,t={}){const s=this.curve.divideAtLength(e,t);return[new Wt(s[0]),new Wt(s[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new Wt(t[0]),new Wt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}scale(e,t,s){return this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new Wt(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,t=this.controlPoint2,s=this.end;return[this.type,e.x,e.y,t.x,t.y,s.x,s.y].join(" ")}}(function(n){function e(...t){const s=t.length,r=t[0];if(Be.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<s;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(s===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const i=[];for(let o=0;o<s;o+=6)i.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return i}n.create=e})(Wt||(Wt={}));function sl(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function Uy(n,e,t,s,r,i){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*s,o*r+a*t,o*i+a*s,r,i]}function Hy(n,e,t,s,r,i,o,a,c,u){const d=Math.PI*120/180,f=Math.PI/180*(+r||0);let h=[],p,g,m,y,b;if(u)g=u[0],m=u[1],y=u[2],b=u[3];else{p=sl(n,e,-f),n=p.x,e=p.y,p=sl(a,c,-f),a=p.x,c=p.y;const j=(n-a)/2,N=(e-c)/2;let M=j*j/(t*t)+N*N/(s*s);M>1&&(M=Math.sqrt(M),t=M*t,s=M*s);const D=t*t,B=s*s,G=(i===o?-1:1)*Math.sqrt(Math.abs((D*B-D*N*N-B*j*j)/(D*N*N+B*j*j)));y=G*t*N/s+(n+a)/2,b=G*-s*j/t+(e+c)/2,g=Math.asin((e-b)/s),m=Math.asin((c-b)/s),g=n<y?Math.PI-g:g,m=a<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),o&&g>m&&(g-=Math.PI*2),!o&&m>g&&(m-=Math.PI*2)}let w=m-g;if(Math.abs(w)>d){const j=m,N=a,M=c;m=g+d*(o&&m>g?1:-1),a=y+t*Math.cos(m),c=b+s*Math.sin(m),h=Hy(a,c,t,s,r,0,o,N,M,[m,j,y,b])}w=m-g;const x=Math.cos(g),v=Math.sin(g),S=Math.cos(m),E=Math.sin(m),C=Math.tan(w/4),P=4/3*(t*C),A=4/3*(s*C),T=[n,e],k=[n+P*v,e-A*x],V=[a+P*E,c-A*S],R=[a,c];if(k[0]=2*T[0]-k[0],k[1]=2*T[1]-k[1],u)return[k,V,R].concat(h);{h=[k,V,R].concat(h).join().split(",");const j=[],N=h.length;for(let M=0;M<N;M+=1)j[M]=M%2?sl(+h[M-1],+h[M],f).y:sl(+h[M],+h[M+1],f).x;return j}}function gR(n){if(!n)return null;const e=`
37
+ \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),s=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return n.replace(t,(o,a,c)=>{const u=[];let d=a.toLowerCase();c.replace(s,(h,p)=>(p&&u.push(+p),h)),d==="m"&&u.length>2&&(i.push([a,...u.splice(0,2)]),d="l",a=a==="m"?"l":"L");const f=r[d];for(;u.length>=f&&(i.push([a,...u.splice(0,f)]),!!f););return o}),i}function mR(n){const e=gR(n);if(!e||!e.length)return[["M",0,0]];let t=0,s=0,r=0,i=0;const o=[];for(let a=0,c=e.length;a<c;a+=1){const u=[];o.push(u);const d=e[a],f=d[0];if(f!==f.toUpperCase())switch(u[0]=f.toUpperCase(),u[0]){case"A":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+d[6]+t,u[7]=+d[7]+s;break;case"V":u[1]=+d[1]+s;break;case"H":u[1]=+d[1]+t;break;case"M":r=+d[1]+t,i=+d[2]+s;for(let h=1,p=d.length;h<p;h+=1)u[h]=+d[h]+(h%2?t:s);break;default:for(let h=1,p=d.length;h<p;h+=1)u[h]=+d[h]+(h%2?t:s);break}else for(let h=0,p=d.length;h<p;h+=1)u[h]=d[h];switch(u[0]){case"Z":t=+r,s=+i;break;case"H":t=u[1];break;case"V":s=u[1];break;case"M":r=u[u.length-2],i=u[u.length-1],t=u[u.length-2],s=u[u.length-1];break;default:t=u[u.length-2],s=u[u.length-1];break}}return o}function yR(n){const e=mR(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function s(c,u,d){let f,h;if(!c)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(c[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),c[0]){case"M":u.X=c[1],u.Y=c[2];break;case"A":return parseFloat(c[1])===0||parseFloat(c[2])===0?["L",c[6],c[7]]:["C"].concat(Hy.apply(0,[u.x,u.y].concat(c.slice(1))));case"S":return d==="C"||d==="S"?(f=u.x*2-u.bx,h=u.y*2-u.by):(f=u.x,h=u.y),["C",f,h].concat(c.slice(1));case"T":return d==="Q"||d==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(Uy(u.x,u.y,u.qx,u.qy,c[1],c[2]));case"Q":return u.qx=c[1],u.qy=c[2],["C"].concat(Uy(u.x,u.y,c[1],c[2],c[3],c[4]));case"H":return["L"].concat(c[1],u.y);case"V":return["L"].concat(u.x,c[1])}return c}function r(c,u){if(c[u].length>7){c[u].shift();const d=c[u];for(;d.length;)i[u]="A",u+=1,c.splice(u,0,["C"].concat(d.splice(0,6)));c.splice(u,1),a=e.length}}const i=[];let o="",a=e.length;for(let c=0;c<a;c+=1){let u="";e[c]&&(u=e[c][0]),u!=="C"&&(i[c]=u,c>0&&(o=i[c-1])),e[c]=s(e[c],t,o),i[c]!=="A"&&u==="C"&&(i[c]="C"),r(e,c);const d=e[c],f=d.length;t.x=d[f-2],t.y=d[f-1],t.bx=parseFloat(d[f-4])||t.x,t.by=parseFloat(d[f-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function bR(n){return yR(n).map(e=>e.map(t=>typeof t=="string"?t:Ce.round(t,2))).join(",").split(",").join(" ")}class ne extends ws{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(Y.isLine(e[0])||Be.isCurve(e[0])){let t=null;e.forEach((r,i)=>{i===0&&this.appendSegment(ne.createSegment("M",r.start)),t!=null&&!t.end.equals(r.start)&&this.appendSegment(ne.createSegment("M",r.start)),Y.isLine(r)?this.appendSegment(ne.createSegment("L",r.end)):Be.isCurve(r)&&this.appendSegment(ne.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),t=r})}else e.forEach(s=>{s.isSegment&&this.appendSegment(s)});else e!=null&&(Y.isLine(e)?(this.appendSegment(ne.createSegment("M",e.start)),this.appendSegment(ne.createSegment("L",e.end))):Be.isCurve(e)?(this.appendSegment(ne.createSegment("M",e.start)),this.appendSegment(ne.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):ze.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,s)=>{const r=s===0?ne.createSegment("M",t):ne.createSegment("L",t);this.appendSegment(r)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=0;s<t;s+=1){const r=e[s];if(r.isVisible)return r.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=t-1;s>=0;s-=1){const r=e[s];if(r.isVisible)return r.end}return e[t-1].end}moveTo(...e){return this.appendSegment(Gr.create.call(null,...e))}lineTo(...e){return this.appendSegment(gt.create.call(null,...e))}curveTo(...e){return this.appendSegment(Wt.create.call(null,...e))}arcTo(e,t,s,r,i,o,a){const c=this.end||new O,u=typeof o=="number"?tl(c.x,c.y,e,t,s,r,i,o,a):tl(c.x,c.y,e,t,s,r,i,o.x,o.y);if(u!=null)for(let d=0,f=u.length;d<f;d+=6)this.curveTo(u[d],u[d+1],u[d+2],u[d+3],u[d+4],u[d+5]);return this}quadTo(e,t,s,r){const i=this.end||new O,o=["M",i.x,i.y];if(typeof e=="number")o.push("Q",e,t,s,r);else{const c=t;o.push("Q",e.x,e.y,c.x,c.y)}const a=ne.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Hr.create())}drawPoints(e,t={}){const s=Fy(e,t),r=ne.parse(s);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let s;for(let i=0;i<t;i+=1){const o=e[i];if(o.isVisible){const a=o.bbox();a!=null&&(s=s?s.union(a):a)}}if(s!=null)return s;const r=e[t-1];return new F(r.end.x,r.end.y,0,0)}appendSegment(e){const t=this.segments.length;let s=t!==0?this.segments[t-1]:null,r;const i=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const c=e[o];r=this.prepareSegment(c,s,i),this.segments.push(r),s=r}else e!=null&&e.isSegment&&(r=this.prepareSegment(e,s,i),this.segments.push(r));return this}insertSegment(e,t){const s=this.segments.length;if(e<0&&(e=s+e+1),e>s||e<0)throw new Error("Index out of range.");let r,i=null,o=null;if(s!==0&&(e>=1?(i=this.segments[e-1],o=i.nextSegment):(i=null,o=this.segments[0])),!Array.isArray(t))r=this.prepareSegment(t,i,o),this.segments.splice(e,0,r);else for(let a=0,c=t.length;a<c;a+=1){const u=t[a];r=this.prepareSegment(u,i,o),this.segments.splice(e+a,0,r),i=r}return this}removeSegment(e){const t=this.fixIndex(e),s=this.segments.splice(t,1)[0],r=s.previousSegment,i=s.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),s.isSubpathStart&&i&&this.updateSubpathStartSegment(i),s}replaceSegment(e,t){const s=this.fixIndex(e);let r;const i=this.segments[s];let o=i.previousSegment;const a=i.nextSegment;let c=i.isSubpathStart;if(!Array.isArray(t))r=this.prepareSegment(t,o,a),this.segments.splice(s,1,r),c&&r.isSubpathStart&&(c=!1);else{this.segments.splice(e,1);for(let u=0,d=t.length;u<d;u+=1){const f=t[u];r=this.prepareSegment(f,o,a),this.segments.splice(e+u,0,r),o=r,c&&r.isSubpathStart&&(c=!1)}}c&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let s=e;for(;s<0;)s=t+s;if(s>=t||s<0)throw new Error("Index out of range.");return s}segmentAt(e,t={}){const s=this.segmentIndexAt(e,t);return s?this.getSegment(s):null}segmentAtLength(e,t={}){const s=this.segmentIndexAtLength(e,t);return s?this.getSegment(s):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const s=Ce.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(e,t={}){const s=this.segments.length;if(s===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,c=null;for(let u=0;u<s;u+=1){const d=r?u:s-1-u,f=this.segments[d],h=o[d],p=f.length({precision:i,subdivisions:h});if(f.isVisible){if(e<=a+p)return d;c=d}a+=p}return c}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),s=[];for(let r=0,i=this.segments.length;r<i;r+=1){const a=this.segments[r].getSubdivisions({precision:t});s.push(a)}return s}updateSubpathStartSegment(e){let t=e.previousSegment,s=e;for(;s&&!s.isSubpathStart;)t!=null?s.subpathStartSegment=t.subpathStartSegment:s.subpathStartSegment=null,t=s,s=s.nextSegment}prepareSegment(e,t,s){e.previousSegment=t,e.nextSegment=s,t!=null&&(t.nextSegment=e),s!=null&&(s.previousSegment=e);let r=e;return e.isSubpathStart&&(e.subpathStartSegment=e,r=s),r!=null&&this.updateSubpathStartSegment(r),e}closestPoint(e,t={}){const s=this.closestPointT(e,t);return s?this.pointAtT(s):null}closestPointLength(e,t={}){const s=this.getOptions(t),r=this.closestPointT(e,s);return r?this.lengthAtT(r,s):0}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(r===0)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isVisible){const f=u.closestPointT(e,{precision:s,subdivisions:d}),h=u.pointAtT(f),p=Ce.squaredLength(h,e);p<o&&(i={segmentIndex:a,value:f},o=p)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isDifferentiable()){const f=u.closestPointT(e,{precision:s,subdivisions:d}),h=u.pointAtT(f),p=Ce.squaredLength(h,e);p<o&&(i=u.tangentAtT(f),o=p)}}return i||null}containsPoint(e,t={}){const s=this.toPolylines(t);if(!s)return!1;let r=0;for(let i=0,o=s.length;i<o;i+=1)s[i].containsPoint(e)&&(r+=1);return r%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.getOptions(t),i=this.length(s)*e;return this.pointAtLength(i,s)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let u=0,d=this.segments.length;u<d;u+=1){const f=s?u:d-1-u,h=this.segments[f],p=i[f],g=h.length({precision:r,subdivisions:p});if(h.isVisible){if(e<=a+g)return h.pointAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:p});o=h}a+=g}return o?s?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,s=t.length;if(s===0)return null;const r=e.segmentIndex;if(r<0)return t[0].pointAtT(0);if(r>=s)return t[s-1].pointAtT(1);const i=Ce.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(this.segments.length===0)return null;const s=Ce.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.divideAtLength(o,r)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o=0,a,c,u,d,f;for(let S=0,E=this.segments.length;S<E;S+=1){const C=s?S:E-1-S,P=this.getSegment(C),A=i[C],T={precision:r,subdivisions:A},k=P.length(T);if(P.isDifferentiable()&&(u=P,d=C,e<=o+k)){c=C,a=P.divideAtLength((s?1:-1)*(e-o),T);break}o+=k}if(!u)return null;a||(c=d,f=s?1:0,a=u.divideAtT(f));const h=this.clone(),p=c;h.replaceSegment(p,a);const g=p;let m=p+1,y=p+2;a[0].isDifferentiable()||(h.removeSegment(g),m-=1,y-=1);const b=h.getSegment(m).start;h.insertSegment(m,ne.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(h.removeSegment(y-1),y-=1);const w=y-g-1;for(let S=y,E=h.segments.length;S<E;S+=1){const C=this.getSegment(S-w),P=h.getSegment(S);if(P.type==="Z"&&!C.subpathStartSegment.end.equals(P.subpathStartSegment.end)){const A=ne.createSegment("L",C.end);h.replaceSegment(S,A)}}const x=new ne(h.segments.slice(0,m)),v=new ne(h.segments.slice(m));return[x,v]}intersectsWithLine(e,t={}){const s=this.toPolylines(t);if(s==null)return null;let r=null;for(let i=0,o=s.length;i<o;i+=1){const a=s[i],c=e.intersect(a);c&&(r==null&&(r=[]),Array.isArray(c)?r.push(...c):r.push(c))}return r}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let s=0;for(let r=0,i=this.segments.length;r<i;r+=1){const o=this.segments[r],a=t[r];s+=o.length({subdivisions:a})}return s}lengthAtT(e,t={}){const s=this.segments.length;if(s===0)return 0;let r=e.segmentIndex;if(r<0)return 0;let i=Ce.clamp(e.value,0,1);r>=s&&(r=s-1,i=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let c=0;for(let f=0;f<r;f+=1){const h=this.segments[f],p=a[f];c+=h.length({precision:o,subdivisions:p})}const u=this.segments[r],d=a[r];return c+=u.lengthAtT(i,{precision:o,subdivisions:d}),c}tangentAt(e,t={}){if(this.segments.length===0)return null;const s=Ce.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.tangentAtLength(o,r)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const d=s?c:u-1-c,f=this.segments[d],h=i[d],p=f.length({precision:r,subdivisions:h});if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:h});o=f}a+=p}if(o){const c=s?1:0;return o.tangentAtT(c)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const s=e.segmentIndex;if(s<0)return this.segments[0].tangentAtT(0);if(s>=t)return this.segments[t-1].tangentAtT(1);const r=Ce.clamp(e.value,0,1);return this.segments[s].tangentAtT(r)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),s=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:s}}toPoints(e={}){const t=this.segments,s=t.length;if(s===0)return null;const r=this.getSubdivisions(e),i=[];let o=[];for(let a=0;a<s;a+=1){const c=t[a];if(c.isVisible){const u=r[a];u.length>0?u.forEach(d=>o.push(d.start)):o.push(c.start)}else o.length>0&&(o.push(t[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(s=>new ze(s)):null}scale(e,t,s){return this.segments.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.segments.forEach(s=>s.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(s=>s.translate(e,t)):this.segments.forEach(s=>s.translate(e)),this}clone(){const e=new ne;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,s=e.segments,r=t.length;if(s.length!==r)return!1;for(let i=0;i<r;i+=1){const o=t[i],a=s[i];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(ne||(ne={})),function(n){function e(s){if(!s)return new n;const r=new n,i=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(s).match(i);if(o!=null)for(let a=0,c=o.length;a<c;a+=1){const u=o[a],d=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,f=u.match(d);if(f!=null){const h=f[0],p=f.slice(1).map(m=>+m),g=t.call(null,h,...p);r.appendSegment(g)}}return r}n.parse=e;function t(s,...r){if(s==="M")return Gr.create.call(null,...r);if(s==="L")return gt.create.call(null,...r);if(s==="C")return Wt.create.call(null,...r);if(s==="z"||s==="Z")return Hr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=t}(ne||(ne={})),function(n){n.normalize=bR,n.isValid=hR,n.drawArc=pR,n.drawPoints=Fy,n.arcToCurves=tl}(ne||(ne={}));class Fe{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,s=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!s&&!gs.isApplyingHMR()&&this.onDuplicated(e);const r=this.options.process,i=r?ee(r,this,e,t):t;return this.data[e]=i,i}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&ee(this.options.onConflict,this,e),new Error(`${ia(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const s=this.getSpellingSuggestionForName(e),r=t?`${t} ${MP(this.options.type)}`:this.options.type;return`${ia(r)} with name '${e}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(e){return bD(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Fe||(Fe={}));const wR=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,s=e.thickness*e.sy;fe(n,{width:t,height:s,rx:t,ry:s,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const s=e.factor||1,r=e.width*s,i=e.height*s,o=e.thickness;r-o>=0&&i-o>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",e.width=r,e.height=i,fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;fe(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class xs{constructor(){this.patterns={},this.root=oe.create(qa(),{width:"100%",height:"100%"},[fn("defs")]).node}add(e,t){const s=this.root.childNodes[0];s&&s.appendChild(t),this.patterns[e]=t,oe.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=wR,n.registry=Fe.create({type:"grid"}),n.registry.register(n.presets,!0)})(xs||(xs={}));const Gy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t*2,e.height=s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(2*t,0),r.scale(-1,1),r.drawImage(n,0,0,t,s),e},Wy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t,e.height=s*2;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(0,2*s),r.scale(1,-1),r.drawImage(n,0,0,t,s),e},Yy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=2*t,e.height=2*s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,-1,e.width,e.height),r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,1,e.width,0),r.drawImage(n,0,0,t,s),r.setTransform(1,0,0,-1,0,e.height),r.drawImage(n,0,0,t,s),e},xR=Object.freeze(Object.defineProperty({__proto__:null,flipX:Gy,flipXY:Yy,flipY:Wy,watermark:function(n,e){const t=n.width,s=n.height,r=document.createElement("canvas");r.width=t*3,r.height=s*3;const i=r.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ye.toRad(o),c=r.width/4,u=r.height/4;for(let d=0;d<4;d+=1)for(let f=0;f<4;f+=1)(d+f)%2>0&&(i.setTransform(1,0,0,1,(2*d-1)*c,(2*f-1)*u),i.rotate(a),i.drawImage(n,-t/2,-s/2,t,s));return r}},Symbol.toStringTag,{value:"Module"}));var lo;(function(n){n.presets=Object.assign({},xR),n.presets["flip-x"]=Gy,n.presets["flip-y"]=Wy,n.presets["flip-xy"]=Yy,n.registry=Fe.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(lo||(lo={}));function rd(n,e){return n??e}function ot(n,e){return n!=null&&Number.isFinite(n)?n:e}function vR(n={}){const e=rd(n.color,"blue"),t=ot(n.width,1),s=ot(n.margin,2),r=ot(n.opacity,1),i=s,o=s+t;return`
38
38
  <filter>
39
39
  <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>
40
40
  <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
@@ -46,7 +46,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
46
46
  <feMergeNode in="SourceGraphic"/>
47
47
  </feMerge>
48
48
  </filter>
49
- `.trim()}function uL(n={}){const e=Xu(n.color,"red"),t=it(n.blur,0),s=it(n.width,1),r=it(n.opacity,1);return`
49
+ `.trim()}function CR(n={}){const e=rd(n.color,"red"),t=ot(n.blur,0),s=ot(n.width,1),r=ot(n.opacity,1);return`
50
50
  <filter>
51
51
  <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>
52
52
  <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${s}"/>
@@ -54,11 +54,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
54
54
  <feGaussianBlur result="blured" in="composed" stdDeviation="${t}"/>
55
55
  <feBlend in="SourceGraphic" in2="blured" mode="normal"/>
56
56
  </filter>
57
- `.trim()}function dL(n={}){const e=it(n.x,2);return`
57
+ `.trim()}function SR(n={}){const e=ot(n.x,2);return`
58
58
  <filter>
59
59
  <feGaussianBlur stdDeviation="${n.y!=null&&Number.isFinite(n.y)?[e,n.y]:e}"/>
60
60
  </filter>
61
- `.trim()}function hL(n={}){const e=it(n.dx,0),t=it(n.dy,0),s=Xu(n.color,"black"),r=it(n.blur,4),i=it(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
61
+ `.trim()}function ER(n={}){const e=ot(n.dx,0),t=ot(n.dy,0),s=rd(n.color,"black"),r=ot(n.blur,4),i=ot(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
62
62
  <feDropShadow stdDeviation="${r}" dx="${e}" dy="${t}" flood-color="${s}" flood-opacity="${i}" />
63
63
  </filter>`.trim():`<filter>
64
64
  <feGaussianBlur in="SourceAlpha" stdDeviation="${r}" />
@@ -72,23 +72,23 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
72
72
  <feMergeNode/>
73
73
  <feMergeNode in="SourceGraphic"/>
74
74
  </feMerge>
75
- </filter>`.trim()}function fL(n={}){const e=it(n.amount,1),t=.2126+.7874*(1-e),s=.7152-.7152*(1-e),r=.0722-.0722*(1-e),i=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),c=.2126-.2126*(1-e),u=.0722+.9278*(1-e);return`
75
+ </filter>`.trim()}function OR(n={}){const e=ot(n.amount,1),t=.2126+.7874*(1-e),s=.7152-.7152*(1-e),r=.0722-.0722*(1-e),i=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),c=.2126-.2126*(1-e),u=.0722+.9278*(1-e);return`
76
76
  <filter>
77
77
  <feColorMatrix type="matrix" values="${t} ${s} ${r} 0 0 ${i} ${o} ${a} 0 0 ${c} ${s} ${u} 0 0 0 0 0 1 0"/>
78
78
  </filter>
79
- `.trim()}function pL(n={}){const e=it(n.amount,1),t=.393+.607*(1-e),s=.769-.769*(1-e),r=.189-.189*(1-e),i=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),c=.272-.272*(1-e),u=.534-.534*(1-e),d=.131+.869*(1-e);return`
79
+ `.trim()}function MR(n={}){const e=ot(n.amount,1),t=.393+.607*(1-e),s=.769-.769*(1-e),r=.189-.189*(1-e),i=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),c=.272-.272*(1-e),u=.534-.534*(1-e),d=.131+.869*(1-e);return`
80
80
  <filter>
81
81
  <feColorMatrix type="matrix" values="${t} ${s} ${r} 0 0 ${i} ${o} ${a} 0 0 ${c} ${u} ${d} 0 0 0 0 0 1 0"/>
82
82
  </filter>
83
- `.trim()}function gL(n={}){return`
83
+ `.trim()}function PR(n={}){return`
84
84
  <filter>
85
- <feColorMatrix type="saturate" values="${1-it(n.amount,1)}"/>
85
+ <feColorMatrix type="saturate" values="${1-ot(n.amount,1)}"/>
86
86
  </filter>
87
- `.trim()}function mL(n={}){return`
87
+ `.trim()}function NR(n={}){return`
88
88
  <filter>
89
- <feColorMatrix type="hueRotate" values="${it(n.angle,0)}"/>
89
+ <feColorMatrix type="hueRotate" values="${ot(n.angle,0)}"/>
90
90
  </filter>
91
- `.trim()}function yL(n={}){const e=it(n.amount,1),t=1-e;return`
91
+ `.trim()}function AR(n={}){const e=ot(n.amount,1),t=1-e;return`
92
92
  <filter>
93
93
  <feComponentTransfer>
94
94
  <feFuncR type="table" tableValues="${e} ${t}"/>
@@ -96,7 +96,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
96
96
  <feFuncB type="table" tableValues="${e} ${t}"/>
97
97
  </feComponentTransfer>
98
98
  </filter>
99
- `.trim()}function bL(n={}){const e=it(n.amount,1);return`
99
+ `.trim()}function _R(n={}){const e=ot(n.amount,1);return`
100
100
  <filter>
101
101
  <feComponentTransfer>
102
102
  <feFuncR type="linear" slope="${e}"/>
@@ -104,7 +104,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
104
104
  <feFuncB type="linear" slope="${e}"/>
105
105
  </feComponentTransfer>
106
106
  </filter>
107
- `.trim()}function wL(n={}){const e=it(n.amount,1),t=.5-e/2;return`
107
+ `.trim()}function TR(n={}){const e=ot(n.amount,1),t=.5-e/2;return`
108
108
  <filter>
109
109
  <feComponentTransfer>
110
110
  <feFuncR type="linear" slope="${e}" intercept="${t}"/>
@@ -112,11 +112,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
112
112
  <feFuncB type="linear" slope="${e}" intercept="${t}"/>
113
113
  </feComponentTransfer>
114
114
  </filter>
115
- `.trim()}const xL=Object.freeze(Object.defineProperty({__proto__:null,blur:dL,brightness:bL,contrast:wL,dropShadow:hL,grayScale:fL,highlight:uL,hueRotate:mL,invert:yL,outline:cL,saturate:gL,sepia:pL},Symbol.toStringTag,{value:"Module"}));var Gr;(function(n){n.presets=xL,n.registry=ze.create({type:"filter"}),n.registry.register(n.presets,!0)})(Gr||(Gr={}));const vL={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},CL={},Vy={position:Qa("x","width","origin")},By={position:Qa("y","height","origin")},SL={position:Qa("x","width","corner")},EL={position:Qa("y","height","corner")},jy={set:Ss("width","width")},$y={set:Ss("height","height")},OL={set:Ss("rx","width")},ML={set:Ss("ry","height")},zy={set:(n=>{const e=Ss(n,"width"),t=Ss(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?e:t;return Q(o,this,s,r)}})("r")},PL={set(n,{refBBox:e}){let t=parseFloat(n);const s=qn(n);s&&(t/=100);const r=Math.sqrt(e.height*e.height+e.width*e.width);let i;return Number.isFinite(t)&&(s||t>=0&&t<=1?i=t*r:i=Math.max(t+r,0)),{r:i}}},AL={set:Ss("cx","width")},NL={set:Ss("cy","height")},Fy={set:Gy({resetOffset:!0})},TL={set:Gy({resetOffset:!1})},Uy={set:Yy({resetOffset:!0})},_L={set:Yy({resetOffset:!1})},kL=zy,DL=Fy,RL=Uy,LL=Vy,IL=By,VL=jy,BL=$y;function Qa(n,e,t){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=qn(s);o&&(i/=100);let a;if(Number.isFinite(i)){const u=r[t];o||i>0&&i<1?a=u[n]+r[e]*i:a=u[n]+i}const c=new O;return c[n]=a||0,c}}function Ss(n,e){return function(t,{refBBox:s}){let r=parseFloat(t);const i=qn(t);i&&(r/=100);const o={};if(Number.isFinite(r)){const a=i||r>=0&&r<=1?r*s[e]:Math.max(r+s[e],0);o[n]=a}return o}}function Hy(n,e){const t="x6-shape",s=e&&e.resetOffset;return function(r,{elem:i,refBBox:o}){let a=Ks(i,t);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},Ks(i,t,a)}const c=a.shape.clone(),u=a.shapeBBox.clone(),d=u.getOrigin(),h=o.getOrigin();u.x=h.x,u.y=h.y;const f=o.getMaxScaleToFit(u,h),p=u.width===0||o.width===0?1:f.sx,g=u.height===0||o.height===0?1:f.sy;return c.scale(p,g,d),s&&c.translate(-d.x,-d.y),c}}function Gy(n){function e(s){return ee.parse(s)}const t=Hy(e,n);return(s,r)=>({d:t(s,r).serialize()})}function Yy(n){const e=Hy(t=>new $e(t),n);return(t,s)=>({points:e(t,s).serialize()})}const jL={qualify:wn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},$L={qualify:wn,set(n,{view:e}){const t=e.cell,s=Object.assign({},n);if(t.isEdge()&&s.type==="linearGradient"){const r=e,i=r.sourcePoint,o=r.targetPoint;s.id=`gradient-${s.type}-${t.id}`,s.attrs=Object.assign(Object.assign({},s.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(s.id)}return`url(#${e.graph.defineGradient(s)})`}},Wy={qualify(n,{attrs:e}){return e.textWrap==null||!wn(e.textWrap)},set(n,{view:e,elem:t,attrs:s}){const r="x6-text",i=Ks(t,r),o=d=>{try{return JSON.parse(d)}catch{return d}},a={x:s.x,eol:s.eol,annotations:o(s.annotations),textPath:o(s["text-path"]||s.textPath),textVerticalAnchor:s["text-vertical-anchor"]||s.textVerticalAnchor,displayEmpty:(s["display-empty"]||s.displayEmpty)==="true",lineHeight:s["line-height"]||s.lineHeight},c=s["font-size"]||s.fontSize,u=JSON.stringify([n,a]);if(c&&t.setAttribute("font-size",c),i==null||i!==u){const d=a.textPath;if(d!=null&&typeof d=="object"){const h=d.selector;if(typeof h=="string"){const f=e.find(h)[0];f instanceof SVGPathElement&&(Du(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},d))}}vy(t,`${n}`,a),Ks(t,r,u)}}},zL={qualify:wn,set(n,{view:e,elem:t,attrs:s,refBBox:r}){const i=n,o=i.width||0;qn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;qn(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let c,u=i.text;u==null&&(u=s.text||(t==null?void 0:t.textContent)),u!=null?c=Sy(`${u}`,r,{"font-weight":s["font-weight"]||s.fontWeight,"font-size":s["font-size"]||s.fontSize,"font-family":s["font-family"]||s.fontFamily,lineHeight:s.lineHeight},{ellipsis:i.ellipsis}):c="",Q(Wy.set,this,c,{view:e,elem:t,attrs:s,refBBox:r,cell:e.cell})}},Yr=(n,{attrs:e})=>e.text!==void 0,FL={qualify:Yr},UL={qualify:Yr},HL={qualify:Yr},GL={qualify:Yr},YL={qualify:Yr},WL={qualify:Yr},qL={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",s=`${n}`,r=Ks(e,t);if(r==null||r!==s){Ks(e,t,s);const i=e.firstChild;if(i&&i.tagName.toUpperCase()==="TITLE"){const o=i;o.textContent=s}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=s,e.insertBefore(o,i)}}}},JL={offset:qy("x","width","right")},XL={offset:qy("y","height","bottom")},KL={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function qy(n,e,t){return(s,{refBBox:r})=>{const i=new O;let o;return s==="middle"?o=r[e]/2:s===t?o=r[e]:typeof s=="number"&&Number.isFinite(s)?o=s>-1&&s<1?-r[e]*s:-s:qn(s)?o=r[e]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const ZL={qualify:wn,set(n,{elem:e}){Je(e,n)}},QL={set(n,{elem:e}){e.innerHTML=`${n}`}},eI={qualify:wn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},tI={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Es(n,e,t){let s,r;typeof e=="object"?(s=e.x,r=e.y):(s=e,r=t);const i=ee.parse(n),o=i.bbox();if(o){let a=-o.height/2-o.y,c=-o.width/2-o.x;typeof s=="number"&&(c-=s),typeof r=="number"&&(a-=r),i.translate(c,a)}return i.serialize()}var Jy=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const nI=n=>{var{size:e,width:t,height:s,offset:r,open:i}=n,o=Jy(n,["size","width","height","offset","open"]);return Xy({size:e,width:t,height:s,offset:r},i===!0,!0,void 0,o)},sI=n=>{var{size:e,width:t,height:s,offset:r,factor:i}=n,o=Jy(n,["size","width","height","offset","factor"]);return Xy({size:e,width:t,height:s,offset:r},!1,!1,i,o)};function Xy(n,e,t,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,c=new ee,u={};if(e)c.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(c.moveTo(0,a/2),c.lineTo(o,0),!t){const d=wt(s,0,1);c.lineTo(o*d,a/2)}c.lineTo(o,a),c.close()}return Object.assign(Object.assign(Object.assign({},u),r),{tagName:"path",d:Es(c.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var rI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const iI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=rI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new ee;return u.moveTo(0,c/2).lineTo(a/2,0).lineTo(a,c/2).lineTo(a/2,c).close(),Object.assign(Object.assign({},i),{tagName:"path",d:Es(u.serialize(),r??-a/2)})};var oI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const aI=n=>{var{d:e,offsetX:t,offsetY:s}=n,r=oI(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Es(e,t,s)})};var lI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const cI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=lI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new ee;return u.moveTo(0,0).lineTo(a,c).moveTo(0,c).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:Es(u.serialize(),r||-a/2)})};var uI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const dI=n=>{var{width:e,height:t,offset:s,open:r,flip:i}=n,o=uI(n,["width","height","offset","open","flip"]);let a=t||6;const c=e||10,u=r===!0,d=i===!0,h=Object.assign(Object.assign({},o),{tagName:"path"});d&&(a=-a);const f=new ee;return f.moveTo(0,a).lineTo(c,0),u?h.fill="none":(f.lineTo(c,a),f.close()),h.d=Es(f.serialize(),{x:s||-c/2,y:a/2}),h};var Ky=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const Zy=n=>{var{r:e}=n,t=Ky(n,["r"]);const s=e||5;return Object.assign(Object.assign({cx:s},t),{tagName:"circle",r:s})},hI=n=>{var{r:e}=n,t=Ky(n,["r"]);const s=e||5,r=new ee;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},Zy({r:s})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Es(r.serialize(),-s)})]}};var fI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const pI=Object.freeze(Object.defineProperty({__proto__:null,async:dI,block:nI,circle:Zy,circlePlus:hI,classic:sI,cross:cI,diamond:iI,ellipse:n=>{var{rx:e,ry:t}=n,s=fI(n,["rx","ry"]);const r=e||5,i=t||5;return Object.assign(Object.assign({cx:r},s),{tagName:"ellipse",rx:r,ry:i})},path:aI},Symbol.toStringTag,{value:"Module"}));var Os;(function(n){n.presets=pI,n.registry=ze.create({type:"marker"}),n.registry.register(n.presets,!0)})(Os||(Os={})),function(n){n.normalize=Es}(Os||(Os={}));var gI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function Ku(n){return typeof n=="string"||wn(n)}const mI={qualify:Ku,set(n,{view:e,attrs:t}){return Zu("marker-start",n,e,t)}},yI={qualify:Ku,set(n,{view:e,attrs:t}){return Zu("marker-end",n,e,t,{transform:"rotate(180)"})}},bI={qualify:Ku,set(n,{view:e,attrs:t}){return Zu("marker-mid",n,e,t)}};function Zu(n,e,t,s,r={}){const i=typeof e=="string"?{name:e}:e,{name:o,args:a}=i,c=gI(i,["name","args"]);let u=c;if(o&&typeof o=="string"){const h=Os.registry.get(o);if(h)u=h(Object.assign(Object.assign({},c),a));else return Os.registry.onNotFound(o)}const d=Object.assign(Object.assign(Object.assign({},wI(s,n)),r),u);return{[n]:`url(#${t.graph.defineMarker(d)})`}}function wI(n,e){const t={},s=n.stroke;typeof s=="string"&&(t.stroke=s,t.fill=s);let r=n.strokeOpacity;if(r==null&&(r=n["stroke-opacity"]),r==null&&(r=n.opacity),r!=null&&(t["stroke-opacity"]=r,t["fill-opacity"]=r),e!=="marker-mid"){const i=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);t.refX=e==="marker-start"?o:-o}}return t}const oo=(n,{view:e})=>e.cell.isEdge(),xI={qualify:oo,set(n,e){var t,s,r,i;const o=e.view,a=n.reverse||!1,c=n.stubs||0;let u;if(Number.isFinite(c)&&c!==0)if(a){let d,h;const f=o.getConnectionLength()||0;c<0?(d=(f+c)/2,h=-c):(d=c,h=f-c*2);const p=o.getConnection();u=(i=(r=(s=(t=p==null?void 0:p.divideAtLength(d))===null||t===void 0?void 0:t[1])===null||s===void 0?void 0:s.divideAtLength(h))===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.serialize()}else{let d;c<0?d=((o.getConnectionLength()||0)+c)/2:d=c;const h=o.getConnection();if(h){const f=h.divideAtLength(d),p=h.divideAtLength(-d);f&&p&&(u=`${f[0].serialize()} ${p[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},Qy={qualify:oo,set:el("getTangentAtLength",{rotate:!0})},vI={qualify:oo,set:el("getTangentAtLength",{rotate:!1})},eb={qualify:oo,set:el("getTangentAtRatio",{rotate:!0})},CI={qualify:oo,set:el("getTangentAtRatio",{rotate:!1})},SI=Qy,EI=eb;function el(n,e){const t={x:1,y:0};return(s,r)=>{let i,o;const a=r.view,c=a[n](Number(s));return c?(o=e.rotate?c.vector().vectorAngle(t):0,i=c.start):(i=a.path.start,o=0),o===0?{transform:`translate(${i.x},${i.y}')`}:{transform:`translate(${i.x},${i.y}') rotate(${o})`}}}const OI=Object.freeze(Object.defineProperty({__proto__:null,annotations:GL,atConnectionLength:SI,atConnectionLengthIgnoreGradient:vI,atConnectionLengthKeepGradient:Qy,atConnectionRatio:EI,atConnectionRatioIgnoreGradient:CI,atConnectionRatioKeepGradient:eb,connection:xI,displayEmpty:WL,eol:YL,fill:jL,filter:eI,html:QL,lineHeight:FL,port:tI,ref:CL,refCx:AL,refCy:NL,refD:DL,refDKeepOffset:TL,refDResetOffset:Fy,refDx:SL,refDy:EL,refHeight:$y,refHeight2:BL,refPoints:RL,refPointsKeepOffset:_L,refPointsResetOffset:Uy,refR:kL,refRCircumscribed:PL,refRInscribed:zy,refRx:OL,refRy:ML,refWidth:jy,refWidth2:VL,refX:Vy,refX2:LL,refY:By,refY2:IL,resetOffset:KL,sourceMarker:mI,stroke:$L,style:ZL,targetMarker:yI,text:Wy,textPath:HL,textVerticalAnchor:UL,textWrap:zL,title:qL,vertexMarker:bI,xAlign:JL,yAlign:XL},Symbol.toStringTag,{value:"Module"}));var Pn;(function(n){function e(t,s,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||Q(t.qualify,this,s,r)))}n.isValidDefinition=e})(Pn||(Pn={})),function(n){n.presets=Object.assign(Object.assign({},vL),OI),n.registry=ze.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Pn||(Pn={}));const Gt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Gt.prefixCls}-${n}`}},tb=Gt.prefix("highlighted"),MI={highlight(n,e,t){const s=t&&t.className||tb;K(e,s)},unhighlight(n,e,t){const s=t&&t.className||tb;De(e,s)}},nb=Gt.prefix("highlight-opacity"),PI={highlight(n,e){K(e,nb)},unhighlight(n,e){De(e,nb)}};var Ce;(function(n){n.normalizeMarker=Es;function e(f,p){const g=$R(f.x,f.y).matrixTransform(p);return new O(g.x,g.y)}n.transformPoint=e;function t(f,p){return new q(e(f.start,p),e(f.end,p))}n.transformLine=t;function s(f,p){let g=f instanceof $e?f.points:f;return Array.isArray(g)||(g=[]),new $e(g.map(m=>e(m,p)))}n.transformPolyline=s;function r(f,p){const m=dn("svg").createSVGPoint();m.x=f.x,m.y=f.y;const y=m.matrixTransform(p);m.x=f.x+f.width,m.y=f.y;const b=m.matrixTransform(p);m.x=f.x+f.width,m.y=f.y+f.height;const w=m.matrixTransform(p);m.x=f.x,m.y=f.y+f.height;const x=m.matrixTransform(p),v=Math.min(y.x,b.x,w.x,x.x),S=Math.max(y.x,b.x,w.x,x.x),E=Math.min(y.y,b.y,w.y,x.y),C=Math.max(y.y,b.y,w.y,x.y);return new U(v,E,S-v,C-E)}n.transformRectangle=r;function i(f,p,g){let m;const y=f.ownerSVGElement;if(!y)return new U(0,0,0,0);try{m=f.getBBox()}catch{m={x:f.clientLeft,y:f.clientTop,width:f.clientWidth,height:f.clientHeight}}if(p)return U.create(m);const b=eo(f,g||y);return r(m,b)}n.bbox=i;function o(f,p={}){let g;if(!f.ownerSVGElement||!bs(f)){if(dy(f)){const{left:w,top:x,width:v,height:S}=a(f);return new U(w,x,v,S)}return new U(0,0,0,0)}let y=p.target;if(!p.recursive){try{g=f.getBBox()}catch{g={x:f.clientLeft,y:f.clientTop,width:f.clientWidth,height:f.clientHeight}}if(!y)return U.create(g);const w=eo(f,y);return r(g,w)}{const w=f.childNodes,x=w.length;if(x===0)return o(f,{target:y});y||(y=f);for(let v=0;v<x;v+=1){const S=w[v];let E;S.childNodes.length===0?E=o(S,{target:y}):E=o(S,{target:y,recursive:!0}),g?g=g.union(E):g=E}return g}}n.getBBox=o;function a(f){let p=0,g=0,m=0,y=0;if(f){let b=f;for(;b;)p+=b.offsetLeft,g+=b.offsetTop,b=b.offsetParent,b&&(p+=parseInt(by(b,"borderLeft"),10),g+=parseInt(by(b,"borderTop"),10));m=f.offsetWidth,y=f.offsetHeight}return{left:p,top:g,width:m,height:y}}n.getBoundingOffsetRect=a;function c(f){const p=g=>{const m=f.getAttribute(g),y=m?parseFloat(m):0;return Number.isNaN(y)?0:y};switch(f instanceof SVGElement&&f.nodeName.toLowerCase()){case"rect":return new U(p("x"),p("y"),p("width"),p("height"));case"circle":return new hn(p("cx"),p("cy"),p("r"),p("r"));case"ellipse":return new hn(p("cx"),p("cy"),p("rx"),p("ry"));case"polyline":{const g=Wa(f);return new $e(g)}case"polygon":{const g=Wa(f);return g.length>1&&g.push(g[0]),new $e(g)}case"path":{let g=f.getAttribute("d");return ee.isValid(g)||(g=ee.normalize(g)),ee.parse(g)}case"line":return new q(p("x1"),p("y1"),p("x2"),p("y2"))}return o(f)}n.toGeometryShape=c;function u(f,p,g,m){const y=O.create(p),b=O.create(g);m||(m=f instanceof SVGSVGElement?f:f.ownerSVGElement);const w=Gu(f);f.setAttribute("transform","");const x=o(f,{target:m}).scale(w.sx,w.sy),v=Zi();v.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const S=Zi(),E=y.angleBetween(b,y.clone().translate(1,0));E&&S.setRotate(E,0,0);const C=Zi(),M=y.clone().move(b,x.width/2);C.setTranslate(2*y.x-M.x,2*y.y-M.y);const N=eo(f,m),_=Zi();_.setMatrix(C.matrix.multiply(S.matrix.multiply(v.matrix.multiply(N.scale(w.sx,w.sy))))),f.setAttribute("transform",jr(_.matrix))}n.translateAndAutoOrient=u;function d(f){if(f==null)return null;let p=f;do{let g=p.tagName;if(typeof g!="string")return null;if(g=g.toUpperCase(),On(p,"x6-port"))p=p.nextElementSibling;else if(g==="G")p=p.firstElementChild;else if(g==="TITLE")p=p.nextElementSibling;else break}while(p);return p}n.findShapeNode=d;function h(f){const p=d(f);if(!bs(p)){if(dy(f)){const{left:y,top:b,width:w,height:x}=a(f);return new U(y,b,w,x)}return new U(0,0,0,0)}return c(p).bbox()||U.create()}n.getBBoxV2=h})(Ce||(Ce={}));const AI={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},NI={highlight(n,e,t){const s=Ms.getHighlighterId(e,t);if(Ms.hasCache(s))return;t=cp({},t,AI);const r=se.create(e);let i,o;try{i=r.toPathData()}catch{o=Ce.bbox(r.node,!0),i=Oy(Object.assign(Object.assign({},t),o))}const a=dn("path");if(fe(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?Xi(t.attrs):null)),n.isEdgeElement(e))fe(a,"d",n.getConnectionPathData());else{let d=r.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=Ce.bbox(r.node,!0));const f=o.x+o.width/2,p=o.y+o.height/2;o=Ce.transformRectangle(o,d);const g=Math.max(o.width,1),m=Math.max(o.height,1),y=(g+h)/g,b=(m+h)/m,w=rt({a:y,b:0,c:0,d:b,e:f-y*f,f:p-b*p});d=d.multiply(w)}$r(a,d)}K(a,Gt.prefix("highlight-stroke"));const c=n.cell,u=()=>Ms.removeHighlighter(s);c.on("removed",u),c.model&&c.model.on("reseted",u),n.container.appendChild(a),Ms.setCache(s,a)},unhighlight(n,e,t){Ms.removeHighlighter(Ms.getHighlighterId(e,t))}};var Ms;(function(n){function e(o,a){return Du(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function s(o,a){t[o]=a}n.setCache=s;function r(o){return t[o]!=null}n.hasCache=r;function i(o){const a=t[o];a&&(Ft(a),delete t[o])}n.removeHighlighter=i})(Ms||(Ms={}));const TI=Object.freeze(Object.defineProperty({__proto__:null,className:MI,opacity:PI,stroke:NI},Symbol.toStringTag,{value:"Module"}));var Xn;(function(n){function e(t,s){if(typeof s.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof s.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(Xn||(Xn={})),function(n){n.presets=TI,n.registry=ze.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(Xn||(Xn={}));function Qu(n,e={}){return new O(cn(e.x,n.width),cn(e.y,n.height))}function ed(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const _I=(n,e)=>n.map(({x:t,y:s,angle:r})=>ed(Qu(e,{x:t,y:s}),r||0)),kI=(n,e,t)=>{const s=t.start||0,r=t.step||20;return sb(n,e,s,(i,o)=>(i+.5-o/2)*r)},DI=(n,e,t)=>{const s=t.start||0,r=t.step||360/n.length;return sb(n,e,s,i=>i*r)};function sb(n,e,t,s){const r=e.getCenter(),i=e.getTopCenter(),o=e.width/e.height,a=hn.fromRect(e),c=n.length;return n.map((u,d)=>{const h=t+s(d,c),f=i.clone().rotate(-h,r).scale(o,1,r),p=u.compensateRotate?-a.tangentTheta(f):0;return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),u.dr&&f.move(r,u.dr),ed(f.round(),p,u)})}var RI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const LI=(n,e,t)=>{const s=Qu(e,t.start||e.getOrigin()),r=Qu(e,t.end||e.getCorner());return ao(n,s,r,t)},II=(n,e,t)=>ao(n,e.getTopLeft(),e.getBottomLeft(),t),VI=(n,e,t)=>ao(n,e.getTopRight(),e.getBottomRight(),t),BI=(n,e,t)=>ao(n,e.getTopLeft(),e.getTopRight(),t),jI=(n,e,t)=>ao(n,e.getBottomLeft(),e.getBottomRight(),t);function ao(n,e,t,s){const r=new q(e,t),i=n.length;return n.map((o,a)=>{var{strict:c}=o,u=RI(o,["strict"]);const d=c||s.strict?(a+1)/(i+1):(a+.5)/i,h=r.pointAt(d);return(u.dx||u.dy)&&h.translate(u.dx||0,u.dy||0),ed(h.round(),0,u)})}const $I=Object.freeze(Object.defineProperty({__proto__:null,absolute:_I,bottom:jI,ellipse:kI,ellipseSpread:DI,left:II,line:LI,right:VI,top:BI},Symbol.toStringTag,{value:"Module"}));var tr;(function(n){n.presets=$I,n.registry=ze.create({type:"port layout"}),n.registry.register(n.presets,!0)})(tr||(tr={}));const zI={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ps(n,e){const{x:t,y:s,angle:r,attrs:i}=e||{};return cp({},{angle:r,attrs:i,position:{x:t,y:s}},n,zI)}const FI=(n,e,t)=>Ps({position:e.getTopLeft()},t),UI=(n,e,t)=>Ps({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),HI=(n,e,t)=>Ps({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),GI=(n,e,t)=>Ps({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),YI=(n,e,t)=>Ps({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),WI=(n,e,t)=>rb(n,e,!1,t),qI=(n,e,t)=>rb(n,e,!0,t),JI=(n,e,t)=>ib(n,e,!1,t),XI=(n,e,t)=>ib(n,e,!0,t);function rb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=ob(e);let a,c,u,d,h=0;return i<o[1]||i>o[2]?(a=".3em",c=r,u=0,d="start"):i<o[0]?(a="0",c=0,u=-r,t?(h=-90,d="start"):d="middle"):i<o[3]?(a=".3em",c=-r,u=0,d="end"):(a=".6em",c=0,u=r,t?(h=90,d="start"):d="middle"),Ps({position:{x:Math.round(c),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":d}}},s)}function ib(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=ob(e);let a,c,u,d,h=0;return i<o[1]||i>o[2]?(a=".3em",c=-r,u=0,d="end"):i<o[0]?(a=".6em",c=0,u=r,t?(h=90,d="start"):d="middle"):i<o[3]?(a=".3em",c=r,u=0,d="start"):(a="0em",c=0,u=-r,t?(h=-90,d="start"):d="middle"),Ps({position:{x:Math.round(c),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":d}}},s)}function ob(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),s=e.theta(n.getBottomLeft()),r=e.theta(n.getBottomRight()),i=e.theta(n.getTopRight());return[t,i,r,s]}const KI=(n,e,t)=>ab(n.diff(e.getCenter()),!1,t),ZI=(n,e,t)=>ab(n.diff(e.getCenter()),!0,t);function ab(n,e,t){const s=t.offset!=null?t.offset:20,r=new O(0,0),i=-n.theta(r),o=n.clone().move(r,s).diff(n).round();let a=".3em",c,u=i;return(i+90)%180===0?(c=e?"end":"middle",!e&&i===-270&&(a="0em")):i>-270&&i<-90?(c="start",u=i-180):c="end",Ps({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":c}}},t)}const QI=Object.freeze(Object.defineProperty({__proto__:null,bottom:YI,inside:JI,insideOriented:XI,left:UI,manual:FI,outside:WI,outsideOriented:qI,radial:KI,radialOriented:ZI,right:HI,top:GI},Symbol.toStringTag,{value:"Module"}));var Wr;(function(n){n.presets=QI,n.registry=ze.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(Wr||(Wr={}));var eV=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ye extends Te{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=td.uniqueId(),ye.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return Ji(e),this}unmount(e=this.container){return Ft(e),this}remove(e=this.container){return e===this.container?(this.removeEventListeners(document),this.onRemove(),delete ye.views[this.cid],this.disposeContainer&&this.unmount(e)):this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return K(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return De(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Je(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&fe(t,e),this}findAttr(e,t=this.container){let s=t;for(;s&&s.nodeType===1;){const r=s.getAttribute(e);if(r!=null)return r;if(s===this.container)return null;s=s.parentNode}return null}find(e,t=this.container,s=this.selectors){return ye.find(e,t,s).elems}findOne(e,t=this.container,s=this.selectors){const r=this.find(e,t,s);return r.length>0?r[0]:null}findByAttr(e,t=this.container){let s=t;for(;s&&s.getAttribute;){const r=s.getAttribute(e);if((r!=null||s===this.container)&&r!=="false")return s;s=s.parentNode}return null}getSelector(e,t){let s;if(e===this.container)return typeof t=="string"&&(s=`> ${t}`),s;if(e){const r=Lu(e)+1;s=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(s+=` > ${t}`),s=this.getSelector(e.parentNode,s)}return s}prefixClassName(e){return Gt.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const s=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(r=>{const i=r.match(s);if(i==null)return;const o=this.getEventHandler(e[r]);typeof o=="function"&&this.delegateEvent(i[1],i[2],o)}),this}undelegateEvents(){return ut.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,s){return ut.on(this.container,e+this.getEventNamespace(),t,s),this}undelegateEvent(e,t,s){const r=e+this.getEventNamespace();return t==null?ut.off(this.container,r):typeof t=="string"?ut.off(this.container,r,t,s):ut.off(this.container,r,t),this}addEventListeners(e,t,s){if(t==null)return this;const r=this.getEventNamespace();return Object.keys(t).forEach(i=>{const o=this.getEventHandler(t[i]);typeof o=="function"&&ut.on(e,i+r,s,o)}),this}removeEventListeners(e){return e!=null&&ut.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Gt.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const s=this[e];typeof s=="function"&&(t=(...r)=>s.call(this,...r))}else t=(...s)=>e.call(this,...s);return t}getEventTarget(e,t={}){const{target:s,type:r,clientX:i=0,clientY:o=0}=e;return t.fromPoint||r==="touchmove"||r==="touchend"?document.elementFromPoint(i,o):s}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let s=e.data;const r=`__${this.cid}__`;return t==null?s==null?{}:s[r]||{}:(s==null&&(s=e.data={}),s[r]==null?s[r]=Object.assign({},t):s[r]=Object.assign(Object.assign({},s[r]),t),s[r])}normalizeEvent(e){return ye.normalizeEvent(e)}dispose(){this.remove()}}eV([ye.dispose()],ye.prototype,"dispose",null),function(n){function e(r,i){return i?dn(r||"g"):Ru(r||"div")}n.createElement=e;function t(r,i,o){if(!r||r===".")return{elems:[i]};if(o){const a=o[r];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=r.includes(">")?`:scope ${r}`:r;return{isCSSSelector:!0,elems:Array.prototype.slice.call(i.querySelectorAll(a))}}}n.find=t;function s(r){let i=r;const o=r.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const c in r)a[c]===void 0&&(a[c]=r[c]);i=a}return i}n.normalizeEvent=s}(ye||(ye={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(ye||(ye={}));var td;(function(n){let e=0;function t(){const s=`v${e}`;return e+=1,s}n.uniqueId=t})(td||(td={}));class tV{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new qu,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const s=this.view.container;t.matrix=GR(e,s)}return rt(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Ce.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Ce.getBBoxV2(e)),t.boundingRect.clone()}}var _e;(function(n){function e(u){return u!=null&&!t(u)}n.isJSONMarkup=e;function t(u){return u!=null&&typeof u=="string"}n.isStringMarkup=t;function s(u){return u==null||t(u)?u:Ne(u)}n.clone=s;function r(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=r;function i(u,d={ns:st.svg}){const h=document.createDocumentFragment(),f={},p={},g=[{markup:Array.isArray(u)?u:[u],parent:h,ns:d.ns}];for(;g.length>0;){const m=g.pop();let y=m.ns||st.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const v=x.tagName;if(!v)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const S=y?Ru(v,y):ly(v),E=x.attrs;E&&fe(S,Xi(E));const C=x.style;C&&Je(S,C);const M=x.className;M!=null&&S.setAttribute("class",Array.isArray(M)?M.join(" "):M),x.textContent&&(S.textContent=x.textContent);const N=x.selector;if(N!=null){if(p[N])throw new TypeError("Selector must be unique");p[N]=S}if(x.groupSelector){let T=x.groupSelector;Array.isArray(T)||(T=[T]),T.forEach(k=>{f[k]||(f[k]=[]),f[k].push(S)})}w.appendChild(S);const _=x.children;Array.isArray(_)&&g.push({ns:y,markup:_,parent:S})})}return Object.keys(f).forEach(m=>{if(p[m])throw new Error("Ambiguous group selector");p[m]=f[m]}),{fragment:h,selectors:p,groups:f}}n.parseJSONMarkup=i;function o(u){return u instanceof SVGElement?dn("g"):ly("div")}function a(u){if(t(u)){const p=se.createVectors(u),g=p.length;if(g===1)return{elem:p[0].node};if(g>1){const m=o(p[0].node);return p.forEach(y=>{m.appendChild(y.node)}),{elem:m}}return{}}const d=i(u),h=d.fragment;let f=null;return h.childNodes.length>1?(f=o(h.firstChild),f.appendChild(h)):f=h.firstChild,{elem:f,selectors:d.selectors}}n.renderMarkup=a;function c(u){const d=se.createVectors(u),h=document.createDocumentFragment();for(let f=0,p=d.length;f<p;f+=1){const g=d[f].node;h.appendChild(g)}return{fragment:h,selectors:{}}}n.parseLabelStringMarkup=c})(_e||(_e={})),function(n){function e(t,s,r){if(t!=null){let i;const o=t.tagName.toLowerCase();if(t===s)return typeof r=="string"?i=`> ${o} > ${r}`:i=`> ${o}`,i;const a=t.parentNode;if(a&&a.childNodes.length>1){const c=Lu(t)+1;i=`${o}:nth-child(${c})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,s,i)}return r}n.getSelector=e}(_e||(_e={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function s(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=s}(_e||(_e={})),function(n){function e(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=e}(_e||(_e={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:st.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:st.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(_e||(_e={}));class lb{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let s,r,i,o;const a=[];return Object.keys(t).forEach(c=>{const u=t[c],d=this.getDefinition(c),h=Q(Pn.isValidDefinition,this.view,d,u,{elem:e,attrs:t,cell:this.cell,view:this.view});if(d&&h)typeof d=="string"?(s==null&&(s={}),s[d]=u):u!==null&&a.push({name:c,definition:d});else{s==null&&(s={});const f=hy.includes(c)?c:Hm(c);s[f]=u}}),a.forEach(({name:c,definition:u})=>{const d=t[c];typeof u.set=="function"&&(r==null&&(r={}),r[c]=d),typeof u.offset=="function"&&(i==null&&(i={}),i[c]=d),typeof u.position=="function"&&(o==null&&(o={}),o[c]=d)}),{raw:t,normal:s,set:r,offset:i,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const s=e.normal&&e.normal.transform;s!=null&&t.normal&&(t.normal.transform=s),e.normal=t.normal}findAttrs(e,t,s,r){const i=[],o=new qu;return Object.keys(e).forEach(a=>{const c=e[a];if(!wn(c))return;const{isCSSSelector:u,elems:d}=ye.find(a,t,r);s[a]=d;for(let h=0,f=d.length;h<f;h+=1){const p=d[h],g=r&&r[a]===p,m=o.get(p);if(m){m.array||(i.push(p),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const y=m.attrs,b=m.priority;if(g)y.unshift(c),b.unshift(-1);else{const w=_P(b,u?-1:f);y.splice(w,0,c),b.splice(w,0,f)}}else o.set(p,{elem:p,attrs:c,priority:g?-1:f,array:!1})}}),i.forEach(a=>{const c=o.get(a),u=c.attrs;c.attrs=u.reduceRight((d,h)=>Ye(d,h),{})}),o}updateRelativeAttrs(e,t,s){const r=t.raw||{};let i=t.normal||{};const o=t.set,a=t.position,c=t.offset,u=()=>({elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:s.clone()});if(o!=null&&Object.keys(o).forEach(y=>{const b=o[y],w=this.getDefinition(y);if(w!=null){const x=Q(w.set,this.view,b,u());typeof x=="object"?i=Object.assign(Object.assign({},i),x):x!=null&&(i[y]=x)}}),e instanceof HTMLElement){this.view.setAttrs(i,e);return}const d=i.transform,h=d?`${d}`:null,f=Qi(h),p=new O(f.e,f.f);d&&(delete i.transform,f.e=0,f.f=0);let g=!1;a!=null&&Object.keys(a).forEach(y=>{const b=a[y],w=this.getDefinition(y);if(w!=null){const x=Q(w.position,this.view,b,u());x!=null&&(g=!0,p.translate(O.create(x)))}}),this.view.setAttrs(i,e);let m=!1;if(c!=null){const y=this.view.getBoundingRectOfElement(e);if(y.width>0&&y.height>0){const b=Ce.transformRectangle(y,f);Object.keys(c).forEach(w=>{const x=c[w],v=this.getDefinition(w);if(v!=null){const S=Q(v.offset,this.view,x,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:b});S!=null&&(m=!0,p.translate(O.create(S)))}})}}(d!=null||g||m)&&(p.round(1),f.e=p.x,f.f=p.y,e.setAttribute("transform",jr(f)))}update(e,t,s){const r={},i=this.findAttrs(s.attrs||t,e,r,s.selectors),o=s.attrs?this.findAttrs(t,e,r,s.selectors):i,a=[];i.each(d=>{const h=d.elem,f=d.attrs,p=this.processAttrs(h,f);if(p.set==null&&p.position==null&&p.offset==null)this.view.setAttrs(p.normal,h);else{const g=o.get(h),m=g?g.attrs:null,y=m&&f.ref==null?m.ref:f.ref;let b;if(y){if(b=(r[y]||this.view.find(y,e,s.selectors))[0],!b)throw new Error(`"${y}" reference does not exist.`)}else b=null;const w={node:h,refNode:b,attributes:m,processedAttributes:p},x=a.findIndex(v=>v.refNode===h);x>-1?a.splice(x,0,w):a.push(w)}});const c=new qu;let u;a.forEach(d=>{const h=d.node,f=d.refNode;let p;const g=f!=null&&s.rotatableNode!=null&&Iu(s.rotatableNode,f);if(f&&(p=c.get(f)),!p){const b=g?s.rotatableNode:e;p=f?Ce.getBBox(f,{target:b}):s.rootBBox,f&&c.set(f,p)}let m;s.attrs&&d.attributes?(m=this.processAttrs(h,d.attributes),this.mergeProcessedAttrs(m,d.processedAttributes)):m=d.processedAttributes;let y=p;g&&s.rotatableNode!=null&&!s.rotatableNode.contains(h)&&(u||(u=Qi(fe(s.rotatableNode,"transform"))),y=Ce.transformRectangle(p,u)),this.updateRelativeAttrs(h,m,y)})}}class cb{get cell(){return this.view.cell}constructor(e,t,s=[]){this.view=e;const r={},i={};let o=0;Object.keys(t).forEach(c=>{let u=t[c];Array.isArray(u)||(u=[u]),u.forEach(d=>{let h=r[d];h||(o+=1,h=r[d]=1<<o),i[c]|=h})});let a=s;if(Array.isArray(a)||(a=[a]),a.forEach(c=>{r[c]||(o+=1,r[c]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=s}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((s,r)=>s|t[r],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var nV=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},sV=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Fe extends ye{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,d)=>d!=null?gp([...Array.isArray(u)?u:[u],...Array.isArray(d)?d:[d]]):Array.isArray(u)?[...u]:[u],s=Ne(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=e,c=sV(e,["bootstrap","actions","events","documentEvents"]);return r&&(s.bootstrap=t(s.bootstrap,r)),i&&Object.entries(i).forEach(([u,d])=>{const h=s.actions[u];d&&h?s.actions[u]=t(h,d):d&&(s.actions[u]=t(d))}),o&&(s.events=Object.assign(Object.assign({},s.events),o)),e.documentEvents&&(s.documentEvents=Object.assign(Object.assign({},s.documentEvents),a)),Ye(s,c)}get[Symbol.toStringTag](){return Fe.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new lb(this),this.flag=new cb(this,this.options.actions,this.options.bootstrap),this.cache=new tV(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return ye.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const s=this.getContainerStyle();s!=null&&this.setStyle(s,e);const r=this.getContainerClassName();r!=null&&this.addClass(r,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,s,r){if(this.hasAction(e,t)){s();const i=[t];return r&&(typeof r=="string"?i.push(r):i.push(...r)),this.removeAction(e,i)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const s=_e.parseJSONMarkup(e),r=s.selectors,i=this.rootSelector;if(t&&i){if(r[i])throw new Error("Invalid root selector");r[i]=t}return s}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=Q(t,this.graph,this)),typeof t=="object"){let s=t[e];return typeof s=="function"&&(s=Q(s,this.graph,this)),s!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return Ce.transformRectangle(t,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return Ce.transformRectangle(t,r.multiply(s))}getBBox(e={}){let t;if(e.useCellGeometry){const s=this.cell,r=s.isNode()?s.getAngle():0;t=s.getBBox().bbox(r)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return rt().translate(t.x,t.y)}getRootRotatedMatrix(){let e=rt();const t=this.cell,s=t.isNode()?t.getAngle():0;if(s){const r=t.getBBox(),i=r.width/2,o=r.height/2;e=e.translate(i,o).rotate(s).translate(-i,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,s={}){s.rootBBox==null&&(s.rootBBox=new U),s.selectors==null&&(s.selectors=this.selectors),this.attr.update(e,t,s)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const s=e||this.container;return t.partial=s===this.container,s}highlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,s,r,i){const o=this.cell,a=this.findAttr("port",e),c=e.getAttribute("data-selector"),u={cell:o.id};return c!=null&&(u.magnet=c),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&c==null&&(u.selector=this.getSelector(e))):c==null&&this.container!==e&&(u.selector=this.getSelector(e)),u}getMagnetFromEdgeTerminal(e){const t=this.cell,s=this.container,r=e.port;let i=e.magnet,o;return r!=null&&t.isNode()&&t.hasPort(r)?o=this.findPortElem(r,i)||s:(i||(i=e.selector),!i&&r!=null&&(i=`[port="${r}"]`),o=this.findOne(i,s,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;const t=Xe.isToolsView(e)?e:new Xe(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,s){const r=this,i=r.cell;return t==null||s==null?{e,view:r,cell:i}:{e,x:t,y:s,view:r,cell:i}}onClick(e,t,s){this.notify("cell:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){this.notify("cell:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){this.notify("cell:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,s))}onMouseUp(e,t,s){this.notify("cell:mouseup",this.getEventArgs(e,t,s)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,s){this.notify("cell:mousemove",this.getEventArgs(e,t,s))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),this.notify(t,Object.assign({},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){}onMagnetDblClick(e,t,s,r){}onMagnetContextMenu(e,t,s,r){}onLabelMouseDown(e,t,s){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),s=this.graph.findViewByElem(t);s!==this&&(this.onMouseLeave(e),s&&s.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}Fe.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},nV([Fe.dispose()],Fe.prototype,"dispose",null),function(n){n.Flag=cb,n.Attr=lb}(Fe||(Fe={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"}n.isCellView=e}(Fe||(Fe={})),function(n){function e(s){return function(r){r.config({priority:s})}}n.priority=e;function t(s){return function(r){r.config({bootstrap:s})}}n.bootstrap=t}(Fe||(Fe={})),function(n){n.registry=ze.create({type:"view"})}(Fe||(Fe={}));class Xe extends ye{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Xe.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const s=e?ye.createElement("g",!0):ye.createElement("div",!1);return K(s,this.prefixClassName("cell-tools")),t.className&&K(s,t.className),s}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!Fe.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(K(this.svgContainer,this.prefixClassName("edge-tools")),K(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(K(this.svgContainer,this.prefixClassName("node-tools")),K(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const s=[];t.forEach(r=>{Xe.ToolItem.isToolItem(r)?r.name==="vertices"?s.unshift(r):s.push(r):(typeof r=="object"?r.name:r)==="vertices"?s.unshift(r):s.push(r)});for(let r=0;r<s.length;r+=1){const i=s[r];let o;if(Xe.ToolItem.isToolItem(i))o=i;else{const a=typeof i=="object"?i.name:i,c=typeof i=="object"?i.args||{}:{};if(a){if(this.cell.isNode()){const u=Jr.registry.get(a);if(u)o=new u(c);else return Jr.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=Xr.registry.get(a);if(u)o=new u(c);else return Xr.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(e={}){const t=this.tools;return t&&t.forEach(s=>{e.toolId!==s.cid&&s.isVisible()&&s.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(s=>{e===s?s.show():s.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(s=>{s!==e&&!s.isVisible()&&(s.show(),s.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),Ft(this.svgContainer),Ft(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const s=e.some(i=>i.options.isSVGElement!==!1),r=e.some(i=>i.options.isSVGElement===!1);s&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&r.graph!=null&&r.cell!=null&&typeof r.config=="function"&&typeof r.update=="function"&&typeof r.focus=="function"&&typeof r.blur=="function"&&typeof r.show=="function"&&typeof r.hide=="function"}n.isToolsView=e})(Xe||(Xe={})),function(n){class e extends ye{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return Ye(Ne(this.getDefaults()),s)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}constructor(s={}){super(),this.visible=!0,this.options=this.getOptions(s),this.container=ye.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),K(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&K(this.container,this.options.className),this.init()}init(){}getOptions(s){return this.constructor.getOptions(s)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(s,r){return this.cellView=s,this.parent=r,this.stamp(this.container),this.cell.isEdge()?K(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&K(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const s=this.options.markup;if(s){const r=_e.parseJSONMarkup(s);this.container.appendChild(r.fragment),this.childNodes=r.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(s){s&&s.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const s=this.options.focusOpacity;return s!=null&&Number.isFinite(s)&&(this.container.style.opacity=`${s}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(s){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(s,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let s=0;function r(o){return o?Au(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Mu(r(o.name),this);return a.config(o),a}t.define=i}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function s(r){if(r==null)return!1;if(r instanceof t)return!0;const i=r[Symbol.toStringTag],o=r;return(i==null||i===t.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}t.isToolItem=s}(e=n.ToolItem||(n.ToolItem={}))}(Xe||(Xe={}));const rV=n=>n;function ub(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function db(n){return(t,s,r,i)=>s.isEdgeElement(r)?oV(n,t,s,r,i):iV(n,t,s,r,i)}function iV(n,e,t,s,r){const i=t.cell,o=i.getAngle(),a=t.getUnrotatedBBoxOfElement(s),c=i.getBBox().getCenter(),u=O.create(r).rotate(o,c);let d=u.x-a.x,h=u.y-a.y;return n&&(d=ub(d,a.width),h=ub(h,a.height)),e.anchor={name:"topLeft",args:{dx:d,dy:h,rotate:!0}},e}function oV(n,e,t,s,r){const i=t.getConnection();if(!i)return e;const o=i.closestPointLength(r);if(n){const a=i.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const aV=db(!0),lV=db(!1),cV=Object.freeze(Object.defineProperty({__proto__:null,noop:rV,pinAbsolute:lV,pinRelative:aV},Symbol.toStringTag,{value:"Module"}));var nd;(function(n){n.presets=cV,n.registry=ze.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(nd||(nd={}));function hb(n,e,t,s){return Q(nd.presets.pinRelative,this.graph,{},e,t,n,this.cell,s,{}).anchor}function fb(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class As extends Xe.ToolItem{onRender(){K(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();$r(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:s=0,y:r=0}=t;const{offset:i,useCellGeometry:o,rotate:a}=t;let c=fb(e,o);const u=e.cell.getAngle();a||(c=c.bbox(u));let d=0,h=0;typeof i=="number"?(d=i,h=i):typeof i=="object"&&(d=i.x,h=i.y),s=cn(s,c.width),r=cn(r,c.height);let f=rt().translate(c.x+c.width/2,c.y+c.height/2);return a&&(f=f.rotate(u)),f=f.translate(s+d-c.width/2,r+h-c.height/2),f}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:s=0,distance:r=0,rotate:i}=t;let o,a,c;const u=cn(r,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,c=o.vector().vectorAngle(new O(1,0))||0):(a=e.getConnection().start,c=0);let d=rt().translate(a.x,a.y).rotate(c);return typeof s=="object"?d=d.translate(s.x||0,s.y||0):d=d.translate(0,s),i||(d=d.rotate(-c)),d}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&Q(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(As||(As={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(As||(As={}));var uV=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class tl extends Xe.ToolItem{onRender(){if(K(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,s=uV(e,["class"]);fe(this.container,Xi(s)),t&&K(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:s,rotate:r}=t,i=ms(t.padding);let o=fb(e,s).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const a=e.cell;if(a.isNode()){const c=a.getAngle();if(c)if(r){const u=a.getBBox().getCenter();Hu(this.container,c,u.x,u.y,{absolute:!0})}else o=o.bbox(c)}return fe(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(tl||(tl={}));class lo extends Xe.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.options.createHandle,o=this.options.processHandle,a=i({index:t,graph:this.graph,guard:c=>this.guard(c),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(r.x,r.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.handles[t];i&&i.updatePosition(r.x,r.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,s=this.vertices,r=e>0?s[e-1]:t.sourceAnchor,i=e<s.length-1?s[e+1]:t.targetAnchor;return{prev:O.create(r),next:O.create(i)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:s,y:r}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:s,y:r}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:s,x:r,y:i}=this.getMouseEventArgs(e);this.eventData(s,{start:{x:r,y:i}}),t.notifyMouseDown(s,r,i)}}onHandleChanging({handle:e,e:t}){const s=this.cellView,r=e.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(t),c={x:o,y:a};this.snapVertex(c,r),s.cell.setVertexAt(r,c,{ui:!0,toolId:this.cid}),e.updatePosition(c.x,c.y),this.options.stopPropagation||s.notifyMouseMove(i,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,s=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}s.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:i,x:o,y:a}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){s.notifyMouseUp(i,o,a);const{start:c}=this.eventData(i);if(c){const{x:u,y:d}=c;u===o&&d===a&&s.onClick(i,o,a)}}s.checkMouseleave(i),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}snapVertex(e,t){const s=this.options.snapRadius||0;if(s>0){const r=this.getNeighborPoints(t),i=r.prev,o=r.next;Math.abs(e.x-i.x)<s?e.x=i.x:Math.abs(e.x-o.x)<s&&(e.x=o.x),Math.abs(e.y-i.y)<s?e.y=r.prev.y:Math.abs(e.y-o.y)<s&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const s=e.options.index,r=this.cellView;r.cell.removeVertexAt(s,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),s=this.options.addable&&this.cellView.can("vertexAddable"),r=this.options.modifiers?xs.isMatch(e,this.options.modifiers):!0;return!t&&s&&r}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=t.getVertexIndex(r.x,r.y);this.snapVertex(r,i),t.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[i];this.eventData(s,{vertexAdded:!0}),o.onMouseDown(s)}onRemove(){this.resetHandles()}}(function(n){class e extends ye{get graph(){return this.options.graph}constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=ye.createElement("circle",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(s,r){this.setAttrs({cx:s,cy:r})}onMouseDown(s){this.options.guard(s)||(s.stopPropagation(),s.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data),this.emit("change",{e:s,handle:this}))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(s){this.emit("remove",{e:s,handle:this})}}n.Handle=e})(lo||(lo={})),function(n){const e=Gt.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(lo||(lo={}));class co extends Xe.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){K(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let s=0,r=t.length;s<r-1;s+=1){const i=t[s],o=t[s+1],a=this.renderHandle(i,o,s);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,s){const r=this.options.createHandle({index:s,graph:this.graph,guard:i=>this.guard(i),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(r),this.updateHandle(r,e,t),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let s=0,r=t.length;s<r;s+=1)t[s].options.index+=e}resetAnchor(e,t){const s=this.cellView.cell,r={ui:!0,toolId:this.cid};t?s.prop([e,"anchor"],t,r):s.removeProp([e,"anchor"],r)}snapHandle(e,t,s){const r=e.options.axis,i=e.options.index,c=this.cellView.cell.getVertices(),u=c[i-2]||s.sourceAnchor,d=c[i+1]||s.targetAnchor,h=this.options.snapRadius;return Math.abs(t[r]-u[r])<h?t[r]=u[r]:Math.abs(t[r]-d[r])<h&&(t[r]=d[r]),t}onHandleChanging({handle:e,e:t}){const s=this.graph,r=this.options,i=this.cellView,o=r.anchor,a=e.options.axis,c=e.options.index-1,u=this.getEventData(t),d=this.normalizeEvent(t),h=s.snapToGrid(d.clientX,d.clientY),f=this.snapHandle(e,h.clone(),u),p=Ne(this.vertices);let g=p[c],m=p[c+1];const y=i.sourceView,b=i.sourceBBox;let w=!1,x=!1;if(g?c===0?b.containsPoint(g)?(p.shift(),this.shiftHandleIndexes(-1),w=!0):(g[a]=f[a],x=!0):g[a]=f[a]:(g=i.sourceAnchor.toJSON(),g[a]=f[a],b.containsPoint(g)?w=!0:(p.unshift(g),this.shiftHandleIndexes(1),x=!0)),typeof o=="function"&&y){if(w){const M=u.sourceAnchor.clone();M[a]=f[a];const N=Q(o,i,M,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",N)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const v=i.targetView,S=i.targetBBox;let E=!1,C=!1;if(m?c===p.length-2?S.containsPoint(m)?(p.pop(),E=!0):(m[a]=f[a],C=!0):m[a]=f[a]:(m=i.targetAnchor.toJSON(),m[a]=f[a],S.containsPoint(m)?E=!0:(p.push(m),C=!0)),typeof o=="function"&&v){if(E){const M=u.targetAnchor.clone();M[a]=f[a];const N=Q(o,i,M,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",N)}C&&this.resetAnchor("target",u.targetAnchorDef)}O.equalPoints(p,this.vertices)||this.cellView.cell.setVertices(p,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,m,0),r.stopPropagation||i.notifyMouseMove(d,h.x,h.y)}onHandleChange({handle:e,e:t}){const s=this.options,r=this.handles,i=this.cellView,o=e.options.index;if(Array.isArray(r)){for(let a=0,c=r.length;a<c;a+=1)a!==o&&r[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:Ne(this.cell.prop(["source","anchor"])),targetAnchorDef:Ne(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!s.stopPropagation){const a=this.normalizeEvent(t),c=this.graph.snapToGrid(a.clientX,a.clientY);i.notifyMouseDown(a,c.x,c.y)}}}onHandleChanged({e}){const t=this.options,s=this.cellView;t.removeRedundancies&&s.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||s.notifyMouseUp(r,i.x,i.y),s.checkMouseleave(r),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}updateHandle(e,t,s,r=0){const i=this.options.precision||0,o=Math.abs(t.x-s.x)<i,a=Math.abs(t.y-s.y)<i;if(o||a){const c=new q(t,s);if(c.length()<this.options.threshold)e.hide();else{const d=c.getCenter(),h=o?"x":"y";d[h]+=r||0;const f=c.vector().vectorAngle(new O(1,0));e.updatePosition(d.x,d.y,f,this.cellView),e.show(),e.options.axis=h}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends ye{constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=ye.createElement("rect",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(s,r,i,o){const a=o.getClosestPoint(new O(s,r))||new O(s,r);let c=rt().translate(a.x,a.y);if(a.equals({x:s,y:r}))c=c.rotate(i);else{let d=new q(s,r,a.x,a.y).vector().vectorAngle(new O(1,0));d!==0&&(d+=90),c=c.rotate(d)}this.setAttrs({transform:jr(c),cursor:i%180===0?"row-resize":"col-resize"})}onMouseDown(s){this.options.guard(s)||(this.trigger("change",{e:s,handle:this}),s.stopPropagation(),s.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=e})(co||(co={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new n.Handle(e),anchor:hb})}(co||(co={}));class nl extends Xe.ToolItem{get type(){return this.options.type}onRender(){K(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const s=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(s),a=r.cell.prop([s,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const c=a?i.customAnchorAttrs:i.defaultAnchorAttrs;c&&Object.keys(c).forEach(u=>{t.setAttribute(u,c[u])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const s=this.type,r=this.cellView,i=r.getTerminalView(s);if(i){const o=i.cell,a=r.getTerminalMagnet(s);let c=this.options.areaPadding||0;Number.isFinite(c)||(c=0);let u,d,h;i.isEdgeElement(a)?(u=i.getBBox(),d=0,h=u.getCenter()):(u=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),h=u.getCenter(),d&&h.rotate(-d,o.getBBox().getCenter())),u.inflate(c),fe(t,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${h.x}, ${h.y}) rotate(${d})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(e){const t=this.type,s=this.cell;e?s.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):s.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,s=this.cellView,r=s.getTerminalView(t);if(r==null)return;const i=this.normalizeEvent(e),o=r.cell,a=s.getTerminalMagnet(t);let c=this.graph.coord.clientToLocalPoint(i.clientX,i.clientY);const u=this.options.snap;if(typeof u=="function"){const f=Q(u,s,c,r,a,t,s,this);c=O.create(f)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const f=r.getClosestPoint(c);f&&(c=f)}else{const f=r.getUnrotatedBBoxOfElement(a),p=o.getAngle(),g=o.getBBox().getCenter(),m=c.clone().rotate(p,g);f.containsPoint(m)||(c=f.getNearestPointToPoint(m).rotate(-p,g))}let d;const h=this.options.anchor;typeof h=="function"&&(d=Q(h,s,c,r,a,t,s,this)),this.resetAnchor(d),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:hb,snap(e,t,s,r,i,o){const a=o.options.snapRadius||0,c=r==="source",u=c?0:-1,d=this.cell.getVertexAt(u)||this.getTerminalAnchor(c?"target":"source");return d&&(Math.abs(d.x-e.x)<a&&(e.x=d.x),Math.abs(d.y-e.y)<a&&(e.y=d.y)),e}})})(nl||(nl={}));const dV=nl.define({name:"source-anchor",type:"source"}),hV=nl.define({name:"target-anchor",type:"target"});var fV=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class sl extends Xe.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,s=fV(e,["class"]);this.setAttrs(s,this.container),t&&K(this.container,t)}}onRender(){K(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,s=t.getTangentAtRatio(e),r=s?s.start:t.getPointAtRatio(e),i=s&&s.vector().vectorAngle(new O(1,0))||0;if(!r)return this;const o=rt().translate(r.x,r.y).rotate(i);return $r(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const s=this.graph.snapToGrid(e.clientX,e.clientY),r=t.prepareArrowheadDragging(this.type,{x:s.x,y:s.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,r),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,s.x,s.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.cellView,r=this.graph.snapToGrid(t.clientX,t.clientY);s.onMouseUp(t,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",s.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(sl||(sl={}));const pV=sl.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),gV=sl.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class qr extends Xe.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Xe.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:e,editor:t}=this;if(!t)return;const{style:s}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();const{attrs:r}=this.options;s.fontSize=`${r.fontSize}px`,s.fontFamily=r.fontFamily,s.color=r.color,s.backgroundColor=r.backgroundColor;const i=this.getCellText()||"";return t.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:s}=this;if(!s)return;let r=O.create(),i=20,o="",{x:a,y:c}=this.options;const{width:u,height:d}=this.options;if(typeof a<"u"&&typeof c<"u"){const p=t.getBBox();a=cn(a,p.width),c=cn(c,p.height),r=p.topLeft.translate(a,c),i=p.width-a*2}else{const p=t.getBBox();r=p.center,i=p.width-4,o="translate(-50%, -50%)"}const h=e.scale(),{style:f}=s;r=e.localToGraph(r),f.left=`${r.x}px`,f.top=`${r.y}px`,f.transform=`scale(${h.sx}, ${h.sy}) ${o}`,f.minWidth=`${i}px`,typeof u=="number"&&(f.width=`${u}px`),typeof d=="number"&&(f.height=`${d}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let s=O.create(),r=20;const{style:i}=t,o=this.event.target,a=o.parentElement;if(a&&On(a,this.prefixClassName("edge-label"))){const d=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(d,10);const h=a.getAttribute("transform"),{translation:f}=qa(h);s=new O(f.tx,f.ty),r=Ce.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=e.clientToLocal(O.create(this.event.clientX,this.event.clientY));const h=this.cellView.path.closestPointLength(s);this.distance=h,this.labelIndex=-1}s=e.localToGraph(s);const u=e.scale();i.left=`${s.x}px`,i.top=`${s.y}px`,i.minWidth=`${r}px`,i.transform=`scale(${u.sx}, ${u.sy}) translate(-50%, -50%)`}onDocumentMouseUp(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){this.editor||(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return Q(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){Q(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const s=this.cell;if(this.labelIndex===-1){if(e){const r={position:{distance:this.distance},attrs:{}};Ir(r,`attrs/${t}`,e),s.appendLabel(r)}}else e!==null?s.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&s.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})})(qr||(qr={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(qr||(qr={}));var pb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},Jr;(function(n){n.presets={boundary:tl,button:As,"button-remove":As.Remove,"node-editor":qr.NodeEditor},n.registry=ze.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let s=Xe.ToolItem;const{inherit:r}=t,i=pb(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(Jr||(Jr={}));var Xr;(function(n){n.presets={boundary:tl,vertices:lo,segments:co,button:As,"button-remove":As.Remove,"source-anchor":dV,"target-anchor":hV,"source-arrowhead":pV,"target-arrowhead":gV,"edge-editor":qr.EdgeEditor},n.registry=ze.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let s=Xe.ToolItem;const{inherit:r}=t,i=pb(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(Xr||(Xr={}));const mV=Kn("center"),yV=Kn("topCenter"),bV=Kn("bottomCenter"),wV=Kn("leftMiddle"),xV=Kn("rightMiddle"),vV=Kn("topLeft"),CV=Kn("topRight"),SV=Kn("bottomLeft"),EV=Kn("bottomRight");function Kn(n){return function(e,t,s,r={}){const i=r.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=i[n];o.x+=cn(r.dx,i.width),o.y+=cn(r.dy,i.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function rl(n){return function(e,t,s,r){if(s instanceof Element){const i=this.graph.findViewByElem(s);let o;if(i)if(i.isEdgeElement(s)){const a=r.fixedAt!=null?r.fixedAt:"50%";o=gb(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new O;return n.call(this,e,t,o,r)}return n.apply(this,arguments)}}function gb(n,e){const t=qn(e),s=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const OV=rl(function(n,e,t,s){const r=me.normalize(n.cell.getAngle()),i=n.getBBoxOfElement(e),o=i.getCenter(),a=i.getTopLeft(),c=i.getBottomRight();let u=s.padding;if(Number.isFinite(u)||(u=0),a.y+u<=t.y&&t.y<=c.y-u){const d=t.y-o.y;o.x+=r===0||r===180?0:d*1/Math.tan(me.toRad(r)),o.y+=d}else if(a.x+u<=t.x&&t.x<=c.x-u){const d=t.x-o.x;o.y+=r===90||r===270?0:d*Math.tan(me.toRad(r)),o.x+=d}return o}),MV=function(n,e,t,s,r){const i=n.cell.getConnectionPoint(this.cell,r);return(s.dx||s.dy)&&i.translate(s.dx||0,s.dy||0),i},PV=rl(function(n,e,t,s){let r,i=0,o;const a=n.cell;s.rotate?(r=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),i=a.getAngle()):r=n.getBBoxOfElement(e);const c=s.padding;c!=null&&Number.isFinite(c)&&r.inflate(c),s.rotate&&t.rotate(i,o);const u=r.getNearestSideToPoint(t);let d;switch(u){case"left":d=r.getLeftMiddle();break;case"right":d=r.getRightMiddle();break;case"top":d=r.getTopCenter();break;case"bottom":d=r.getBottomCenter();break}const h=s.direction;return h==="H"?(u==="top"||u==="bottom")&&(t.x<=r.x+r.width?d=r.getLeftMiddle():d=r.getRightMiddle()):h==="V"&&(t.y<=r.y+r.height?d=r.getTopCenter():d=r.getBottomCenter()),s.rotate?d.rotate(-i,o):d}),AV=Object.freeze(Object.defineProperty({__proto__:null,bottom:bV,bottomLeft:SV,bottomRight:EV,center:mV,left:wV,midSide:PV,nodeCenter:MV,orth:OV,right:xV,top:yV,topLeft:vV,topRight:CV},Symbol.toStringTag,{value:"Module"}));var Kr;(function(n){n.presets=AV,n.registry=ze.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(Kr||(Kr={}));const NV=function(n,e,t,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},TV=function(n,e,t,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},mb=function(n,e,t,s){const r=n.getClosestPoint(t);return r??new O},_V=rl(mb),kV=rl(function(n,e,t,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new q(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),c=new q(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),u=a.intersect(i,{segmentSubdivisions:o}),d=c.intersect(i,{segmentSubdivisions:o}),h=[];return u&&h.push(...u),d&&h.push(...d),h.length>0?t.closest(h):s.fallbackAt!=null?gb(n,s.fallbackAt):Q(mb,this,n,e,t,s)}),DV=Object.freeze(Object.defineProperty({__proto__:null,closest:_V,length:TV,orth:kV,ratio:NV},Symbol.toStringTag,{value:"Module"}));var Zr;(function(n){n.presets=DV,n.registry=ze.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(Zr||(Zr={}));function il(n,e,t){let s;if(typeof t=="object"){if(Number.isFinite(t.y)){const i=new q(e,n),{start:o,end:a}=i.parallel(t.y);e=o,n=a}s=t.x}else s=t;if(s==null||!Number.isFinite(s))return n;const r=n.distance(e);return s===0&&r>0?n:n.move(e,-Math.min(s,r-1))}function ol(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function RV(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const yb=function(n,e,t,s){const r=e.getBBoxOfElement(t);s.stroked&&r.inflate(ol(t)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return il(o,n.start,s.offset)},LV=function(n,e,t,s,r){const i=e.cell,o=i.isNode()?i.getAngle():0;if(o===0)return Q(yb,this,n,e,t,s,r);const a=e.getUnrotatedBBoxOfElement(t);s.stroked&&a.inflate(ol(t)/2);const c=a.getCenter(),u=n.clone().rotate(o,c),d=u.setLength(1e6).intersect(a),h=d&&d.length?u.start.closest(d).rotate(-o,c):n.end;return il(h,n.start,s.offset)},IV=function(n,e,t,s){let r,i;const o=n.end,a=s.selector;if(typeof a=="string"?r=e.findOne(a):Array.isArray(a)?r=Pu(t,a):r=RV(t),!bs(r)){if(r===t||!bs(t))return o;r=t}const c=e.getShapeOfElement(r),u=e.getMatrixOfElement(r),d=e.getRootTranslatedMatrix(),h=e.getRootRotatedMatrix(),f=d.multiply(h).multiply(u),p=f.inverse(),g=Ce.transformLine(n,p),m=g.start.clone(),y=e.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=c.bbox());const v=y.shapeBBox;if(v!=null&&v.containsPoint(m))return o}s.extrapolate===!0&&g.setLength(1e6);let b;if(ee.isPath(c)){const v=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:v})),b={precision:v,segmentSubdivisions:y.segmentSubdivisions},i=g.intersect(c,b)}else i=g.intersect(c);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(U.isRectangle(c)?i=c.getNearestPointToPoint(m):hn.isEllipse(c)?i=c.intersectsWithLineFromCenterToPoint(m):i=c.closestPoint(m,b));const w=i?Ce.transformPoint(i,f):o;let x=s.offset||0;return s.stroked!==!1&&(typeof x=="object"?(x=Object.assign({},x),x.x==null&&(x.x=0),x.x+=ol(r)/2):x+=ol(r)/2),il(w,n.start,x)};function VV(n,e,t=0){const{start:s,end:r}=n;let i,o,a,c;switch(e){case"left":c="x",i=r,o=s,a=-1;break;case"right":c="x",i=s,o=r,a=1;break;case"top":c="y",i=r,o=s,a=-1;break;case"bottom":c="y",i=s,o=r,a=1;break;default:return}s[c]<r[c]?i[c]=o[c]:o[c]=i[c],Number.isFinite(t)&&(i[c]+=a*t,o[c]+=a*t)}const BV=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,s){const{alignOffset:r,align:i}=s;return i&&VV(n,i,r),il(n.end,n.start,s.offset)},bbox:yb,boundary:IV,rect:LV},Symbol.toStringTag,{value:"Module"}));var Qr;(function(n){n.presets=BV,n.registry=ze.create({type:"connection point"}),n.registry.register(n.presets,!0)})(Qr||(Qr={}));const jV=function(n){return[...n]},$V=function(n,e,t){const s=e.side||"bottom",r=ms(e.padding||40),i=t.sourceBBox,o=t.targetBBox,a=i.getCenter(),c=o.getCenter();let u,d,h;switch(s){case"top":h=-1,u="y",d="height";break;case"left":h=-1,u="x",d="width";break;case"right":h=1,u="x",d="width";break;case"bottom":default:h=1,u="y",d="height";break}return a[u]+=h*(i[d]/2+r[s]),c[u]+=h*(o[d]/2+r[s]),h*(a[u]-c[u])>0?c[u]=a[u]:a[u]=c[u],[a.toJSON(),...n,c.toJSON()]};function al(n){return new U(n.x,n.y,0,0)}function ll(n={}){const e=ms(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function bb(n,e={}){return n.sourceBBox.clone().moveAndExpand(ll(e))}function wb(n,e={}){return n.targetBBox.clone().moveAndExpand(ll(e))}function zV(n,e={}){return n.sourceAnchor?n.sourceAnchor:bb(n,e).getCenter()}function FV(n,e={}){return n.targetAnchor?n.targetAnchor:wb(n,e).getCenter()}const xb=function(n,e,t){let s=bb(t,e),r=wb(t,e);const i=zV(t,e),o=FV(t,e);s=s.union(al(i)),r=r.union(al(o));const a=n.map(d=>O.create(d));a.unshift(i),a.push(o);let c=null;const u=[];for(let d=0,h=a.length-1;d<h;d+=1){let f=null;const p=a[d],g=a[d+1],m=Yt.getBearing(p,g)!=null;if(d===0)d+1===h?s.intersectsWithRect(r.clone().inflate(1))?f=Yt.insideNode(p,g,s,r):m||(f=Yt.nodeToNode(p,g,s,r)):s.containsPoint(g)?f=Yt.insideNode(p,g,s,al(g).moveAndExpand(ll(e))):m||(f=Yt.nodeToVertex(p,g,s));else if(d+1===h){const y=m&&Yt.getBearing(g,p)===c;r.containsPoint(p)||y?f=Yt.insideNode(p,g,al(p).moveAndExpand(ll(e)),r,c):m||(f=Yt.vertexToNode(p,g,r,c))}else m||(f=Yt.vertexToVertex(p,g,c));f?(u.push(...f.points),c=f.direction):c=Yt.getBearing(p,g),d+1<h&&u.push(g)}return u};var Yt;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function s(h,f,p){let g=new O(h.x,f.y);return p.containsPoint(g)&&(g=new O(f.x,h.y)),g}function r(h,f){return h[f==="W"||f==="E"?"width":"height"]}n.getBBoxSize=r;function i(h,f){return h.x===f.x?h.y>f.y?"N":"S":h.y===f.y?h.x>f.x?"W":"E":null}n.getBearing=i;function o(h,f,p){const g=new O(h.x,f.y),m=new O(f.x,h.y),y=i(h,g),b=i(h,m),w=p?e[p]:null,x=y===p||y!==w&&(b===w||b!==p)?g:m;return{points:[x],direction:i(x,f)}}n.vertexToVertex=o;function a(h,f,p){const g=s(h,f,p);return{points:[g],direction:i(g,f)}}n.nodeToVertex=a;function c(h,f,p,g){const m=[new O(h.x,f.y),new O(f.x,h.y)],y=m.filter(x=>!p.containsPoint(x)),b=y.filter(x=>i(x,h)!==g);let w;if(b.length>0)return w=b.filter(x=>i(h,x)===g).pop(),w=w||b[0],{points:[w],direction:i(w,f)};{w=eP(m,y)[0];const x=O.create(f).move(w,-r(p,g)/2);return{points:[s(x,h,p),x],direction:i(x,f)}}}n.vertexToNode=c;function u(h,f,p,g){let m=a(f,h,g);const y=m.points[0];if(p.containsPoint(y)){m=a(h,f,p);const b=m.points[0];if(g.containsPoint(b)){const w=O.create(h).move(b,-r(p,i(h,b))/2),x=O.create(f).move(y,-r(g,i(f,y))/2),v=new q(w,x).getCenter(),S=a(h,v,p),E=o(v,f,S.direction);m.points=[S.points[0],E.points[0]],m.direction=E.direction}}return m}n.nodeToNode=u;function d(h,f,p,g,m){const y=p.union(g).inflate(1),b=y.getCenter(),w=b.distance(f)>b.distance(h),x=w?f:h,v=w?h:f;let S,E,C;m?(S=O.fromPolar(y.width+y.height,t[m],x),S=y.getNearestPointToPoint(S).move(S,-1)):S=y.getNearestPointToPoint(x).move(x,1),E=s(S,v,y);let M;S.round().equals(E.round())?(E=O.fromPolar(y.width+y.height,me.toRad(S.theta(x))+Math.PI/2,v),E=y.getNearestPointToPoint(E).move(v,1).round(),C=s(S,E,y),M=w?[E,C,S]:[S,C,E]):M=w?[E,S]:[S,E];const N=i(w?S:E,f);return{points:M,direction:N}}n.insideNode=d})(Yt||(Yt={}));const UV={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Ns(this.step,this)},directions(){const n=Ns(this.step,this),e=Ns(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=Ns(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Ns(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:xb,draggingRouter:null,snapToGrid:!0};function Ns(n,e){return typeof n=="function"?n.call(e):n}function HV(n){const e=Object.keys(n).reduce((t,s)=>{const r=t;return s==="fallbackRouter"||s==="draggingRouter"||s==="fallbackRoute"?r[s]=n[s]:r[s]=Ns(n[s],n),t},{});if(e.padding){const t=ms(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const s=new O(0,0),r=new O(t.offsetX,t.offsetY);t.angle=me.normalize(s.theta(r))}),e}const vb=1,Cb=2;class GV{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=vb,this.values[e]=t;const s=kP(this.items,e,r=>this.values[r]);this.items.splice(s,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Cb),e}isOpen(e){return this.hash[e]===vb}isClose(e){return this.hash[e]===Cb}isEmpty(){return this.items.length===0}}class YV{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const s=this.options,r=s.excludeTerminals.reduce((u,d)=>{const h=t[d];if(h){const f=e.getCell(h.cell);f&&u.push(f)}return u},[]);let i=[];const o=e.getCell(t.getSourceCellId());o&&(i=pp(i,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(i=pp(i,a.getAncestors().map(u=>u.id)));const c=this.mapGridSize;return e.getNodes().reduce((u,d)=>{const h=r.some(y=>y.id===d.id),f=d.shape?s.excludeShapes.includes(d.shape):!1,p=s.excludeNodes.some(y=>typeof y=="string"?d.id===y:y===d),g=i.includes(d.id),m=f||h||p||g;if(d.isVisible()&&!m){const y=d.getBBox().moveAndExpand(s.paddingBox),b=y.getOrigin().snapToGrid(c),w=y.getCorner().snapToGrid(c);for(let x=b.x;x<=w.x;x+=c)for(let v=b.y;v<=w.y;v+=c){const S=new O(x,v).toString();u[S]==null&&(u[S]=[]),u[S].push(y)}}return u},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),s=this.map[t];return s?s.every(r=>!r.containsPoint(e)):!0}}function Sb(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Eb(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Ob(n,e){return n.sourceAnchor?n.sourceAnchor:Sb(n,e).getCenter()}function WV(n,e){return n.targetAnchor?n.targetAnchor:Eb(n,e).getCenter()}function sd(n,e,t,s,r){const i=360/t,o=n.theta(qV(n,e,s,r)),a=me.normalize(o+i/2);return i*Math.floor(a/i)}function qV(n,e,t,s){const r=s.step,i=e.x-n.x,o=e.y-n.y,a=i/t.x,c=o/t.y,u=a*r,d=c*r;return new O(n.x+u,n.y+d)}function Mb(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function JV(n,e){const t=e.step;return e.directions.forEach(s=>{s.gridOffsetX=s.offsetX/t*n.x,s.gridOffsetY=s.offsetY/t*n.y}),e.directions}function XV(n,e,t){return{source:e.clone(),x:Pb(t.x-e.x,n),y:Pb(t.y-e.y,n)}}function Pb(n,e){if(!n)return e;const t=Math.abs(n),s=Math.round(t/e);if(!s)return t;const r=s*e,o=(t-r)/s;return e+o}function KV(n,e){const t=e.source,s=ve.snapToGrid(n.x-t.x,e.x)+t.x,r=ve.snapToGrid(n.y-t.y,e.y)+t.y;return new O(s,r)}function uo(n,e){return n.round(e)}function cl(n,e,t){return uo(KV(n.clone(),e),t)}function ho(n){return n.toString()}function rd(n){return new O(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function Ab(n,e){let t=1/0;for(let s=0,r=e.length;s<r;s+=1){const i=n.manhattanDistance(e[s]);i<t&&(t=i)}return t}function Nb(n,e,t,s,r){const i=r.precision,o=r.directionMap,a=n.diff(e.getCenter()),c=Object.keys(o).reduce((u,d)=>{if(t.includes(d)){const h=o[d],f=new O(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new q(n,f).intersect(e)||[];let m,y=null;for(let b=0;b<g.length;b+=1){const w=g[b],x=n.squaredDistance(w);(m==null||x>m)&&(m=x,y=w)}if(y){let b=cl(y,s,i);e.containsPoint(b)&&(b=cl(b.translate(h.x*s.x,h.y*s.y),s,i)),u.push(b)}}return u},[]);return e.containsPoint(n)||c.push(cl(n,s,i)),c}function ZV(n,e,t,s,r){const i=[];let o=rd(r.diff(t)),a=ho(t),c=n[a],u;for(;c;){u=e[a];const f=rd(u.diff(c));f.equals(o)||(i.unshift(u),o=f),a=ho(c),c=n[a]}const d=e[a];return rd(d.diff(s)).equals(o)||i.unshift(d),i}function QV(n,e,t,s,r){const i=r.precision;let o,a;U.isRectangle(e)?o=uo(Ob(n,r).clone(),i):o=uo(e.clone(),i),U.isRectangle(t)?a=uo(WV(n,r).clone(),i):a=uo(t.clone(),i);const c=XV(r.step,o,a),u=o,d=a;let h,f;if(U.isRectangle(e)?h=Nb(u,e,r.startDirections,c,r):h=[u],U.isRectangle(t)?f=Nb(a,t,r.endDirections,c,r):f=[d],h=h.filter(p=>s.isAccessible(p)),f=f.filter(p=>s.isAccessible(p)),h.length>0&&f.length>0){const p=new GV,g={},m={},y={};for(let _=0,T=h.length;_<T;_+=1){const k=h[_],R=ho(k);p.add(R,Ab(k,f)),g[R]=k,y[R]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,v;const S=JV(c,r),E=S.length,C=f.reduce((_,T)=>{const k=ho(T);return _.push(k),_},[]),M=O.equalPoints(h,f);let N=r.maxLoopCount;for(;!p.isEmpty()&&N>0;){const _=p.pop(),T=g[_],k=m[_],R=y[_],V=T.equals(u),A=k==null;let P;if(A?w?V?P=null:P=sd(u,T,E,c,r):P=b:P=sd(k,T,E,c,r),!(A&&M)&&C.indexOf(_)>=0)return r.previousDirectionAngle=P,ZV(m,g,T,u,d);for(let z=0;z<E;z+=1){x=S[z];const Y=x.angle;if(v=Mb(P,Y),!(w&&V)&&v>r.maxDirectionChange)continue;const le=cl(T.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),c,i),I=ho(le);if(p.isClose(I)||!s.isAccessible(le))continue;if(C.indexOf(I)>=0&&!le.equals(d)){const ie=sd(le,d,E,c,r);if(Mb(Y,ie)>r.maxDirectionChange)continue}const B=x.cost,ne=V?0:r.penalties[v],L=R+B+ne;(!p.isOpen(I)||L<y[I])&&(g[I]=le,m[I]=T,y[I]=L,p.add(I,L+Ab(le,f)))}N-=1}}return r.fallbackRoute?Q(r.fallbackRoute,this,u,d,r):null}function eB(n,e=10){if(n.length<=1)return n;for(let t=0,s=n.length;t<s-1;t+=1){const r=n[t],i=n[t+1];if(r.x===i.x){const o=e*Math.round(r.x/e);r.x!==o&&(r.x=o,i.x=o)}else if(r.y===i.y){const o=e*Math.round(r.y/e);r.y!==o&&(r.y=o,i.y=o)}}return n}const tB=function(n,e,t){const s=HV(e),r=Sb(t,s),i=Eb(t,s),o=Ob(t,s),a=new YV(s).build(t.graph.model,t.cell),c=n.map(p=>O.create(p)),u=[];let d=o,h,f;for(let p=0,g=c.length;p<=g;p+=1){let m=null;if(h=f||r,f=c[p],f==null){f=i;const b=t.cell;if((b.getSourceCellId()==null||b.getTargetCellId()==null)&&typeof s.draggingRouter=="function"){const x=h===r?o:h,v=f.getOrigin();m=Q(s.draggingRouter,t,x,v,s)}}if(m==null&&(m=QV(t,h,f,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),Q(s.fallbackRouter,this,n,s,t);const y=m[0];y&&y.equals(d)&&m.shift(),d=m[m.length-1]||d,u.push(...m)}return s.snapToGrid?eB(u,t.graph.grid.getGridSize()):u},Tb=function(n,e,t){return Q(tB,this,n,Object.assign(Object.assign({},UV),e),t)},nB={maxDirectionChange:45,directions(){const n=Ns(this.step,this),e=Ns(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const s=n.theta(e),r=[];let i={x:e.x,y:n.y},o={x:n.x,y:e.y};if(s%180>90){const x=i;i=o,o=x}const a=s%90<45?i:o,c=new q(n,a),u=90*Math.ceil(s/90),d=O.fromPolar(c.squaredLength(),me.toRad(u+135),a),h=new q(e,d),f=c.intersectsWithLine(h),p=f||e,g=f?p:n,m=360/t.directions.length,y=g.theta(e),b=me.normalize(y+m/2),w=m*Math.floor(b/m);return t.previousDirectionAngle=w,p&&r.push(p.round()),r.push(e),r}},sB=function(n,e,t){return Q(Tb,this,n,Object.assign(Object.assign({},nB),e),t)},rB=function(n,e,t){const s=e.offset||32,r=e.min==null?16:e.min;let i=0,o=e.direction;const a=t.sourceBBox,c=t.targetBBox,u=a.getCenter(),d=c.getCenter();if(typeof s=="number"&&(i=s),o==null){let b=c.left-a.right,w=c.top-a.bottom;b>=0&&w>=0?o=b>=w?"L":"T":b<=0&&w>=0?(b=a.left-c.right,b>=0?o=b>=w?"R":"T":o="T"):b>=0&&w<=0?(w=a.top-c.bottom,w>=0?o=b>=w?"L":"B":o="L"):(b=a.left-c.right,w=a.top-c.bottom,b>=0&&w>=0?o=b>=w?"R":"B":b<=0&&w>=0?o="B":b>=0&&w<=0?o="R":o=Math.abs(b)>Math.abs(w)?"R":"B")}o==="H"?o=d.x-u.x>=0?"L":"R":o==="V"&&(o=d.y-u.y>=0?"T":"B"),s==="center"&&(o==="L"?i=(c.left-a.right)/2:o==="R"?i=(a.left-c.right)/2:o==="T"?i=(c.top-a.bottom)/2:o==="B"&&(i=(a.top-c.bottom)/2));let h,f,p;const g=o==="L"||o==="R";if(g){if(d.y===u.y)return[...n];p=o==="L"?1:-1,h="x",f="width"}else{if(d.x===u.x)return[...n];p=o==="T"?1:-1,h="y",f="height"}const m=u.clone(),y=d.clone();if(m[h]+=p*(a[f]/2+i),y[h]-=p*(c[f]/2+i),g){const b=m.x,w=y.x,x=a.width/2+r,v=c.width/2+r;d.x>u.x?w<=b&&(m.x=Math.max(w,u.x+x),y.x=Math.min(b,d.x-v)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,d.x+v))}else{const b=m.y,w=y.y,x=a.height/2+r,v=c.height/2+r;d.y>u.y?w<=b&&(m.y=Math.max(w,u.y+x),y.y=Math.min(b,d.y-v)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,d.y+v))}return[m.toJSON(),...n,y.toJSON()]};function ei(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const s=O.create(n[1]).move(n[2],t),r=O.create(n[1]).move(n[0],t);return[s.toJSON(),...n,r.toJSON()]}{const s=n[1];return[Object.assign({},s),...n,Object.assign({},s)]}}return n}const iB=Object.freeze(Object.defineProperty({__proto__:null,er:rB,loop:function(n,e,t){const s=e.width||50,i=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,c=t.targetAnchor,u=t.sourceBBox,d=t.targetBBox;if(a.equals(c)){const h=b=>{const w=me.toRad(b),x=Math.sin(w),v=Math.cos(w),S=new O(a.x+v*s,a.y+x*s),E=new O(S.x-v*i,S.y-x*i),C=E.clone().rotate(-90,S),M=E.clone().rotate(90,S);return[C.toJSON(),S.toJSON(),M.toJSON()]},f=b=>{const w=a.clone().move(b,-1),x=new q(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},p=[0,90,180,270,45,135,225,315];if(typeof o=="number")return ei(h(o),e.merge);const g=u.getCenter();if(g.equals(a))return ei(h(0),e.merge);const m=g.angleBetween(a,g.clone().translate(1,0));let y=h(m);if(f(y[1]))return ei(y,e.merge);for(let b=1,w=p.length;b<w;b+=1)if(y=h(m+p[b]),f(y[1]))return ei(y,e.merge);return ei(y,e.merge)}{const h=new q(a,c);let f=h.parallel(-s),p=f.getCenter(),g=f.start.clone().move(f.end,i),m=f.end.clone().move(f.start,i);const y=h.parallel(-1),b=new q(y.start,p),w=new q(y.end,p);if((u.containsPoint(p)||d.containsPoint(p)||u.intersectsWithLine(b)||u.intersectsWithLine(w)||d.intersectsWithLine(b)||d.intersectsWithLine(w))&&(f=h.parallel(s),p=f.getCenter(),g=f.start.clone().move(f.end,i),m=f.end.clone().move(f.start,i)),e.merge){const x=new q(a,c),v=new q(p,x.center).setLength(Number.MAX_SAFE_INTEGER),S=u.intersectsWithLine(v),E=d.intersectsWithLine(v),C=S?Array.isArray(S)?S:[S]:[];E&&(Array.isArray(E)?C.push(...E):C.push(E));const M=x.center.closest(C);M?(t.sourceAnchor=M.clone(),t.targetAnchor=M.clone()):(t.sourceAnchor=x.center.clone(),t.targetAnchor=x.center.clone())}return ei([g.toJSON(),p.toJSON(),m.toJSON()],e.merge)}},manhattan:Tb,metro:sB,normal:jV,oneSide:$V,orth:xb},Symbol.toStringTag,{value:"Module"}));var Ts;(function(n){n.presets=iB,n.registry=ze.create({type:"router"}),n.registry.register(n.presets,!0)})(Ts||(Ts={}));const oB=function(n,e,t,s={}){const r=[n,...t,e],i=new $e(r),o=new ee(i);return s.raw?o:o.serialize()},aB=function(n,e,t,s={}){const r=t.length===3?0:1,i=O.create(t[0+r]),o=O.create(t[2+r]),a=O.create(t[1+r]);if(!O.equals(n,e)){const u=new O((n.x+e.x)/2,(n.y+e.y)/2),d=u.angleBetween(O.create(n).rotate(90,u),a);d>1&&(i.rotate(180-d,u),o.rotate(180-d,u),a.rotate(180-d,u))}const c=`
115
+ `.trim()}const kR=Object.freeze(Object.defineProperty({__proto__:null,blur:SR,brightness:_R,contrast:TR,dropShadow:ER,grayScale:OR,highlight:CR,hueRotate:NR,invert:AR,outline:vR,saturate:PR,sepia:MR},Symbol.toStringTag,{value:"Module"}));var Wr;(function(n){n.presets=kR,n.registry=Fe.create({type:"filter"}),n.registry.register(n.presets,!0)})(Wr||(Wr={}));const VR={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},DR={},qy={position:rl("x","width","origin")},Jy={position:rl("y","height","origin")},RR={position:rl("x","width","corner")},LR={position:rl("y","height","corner")},Xy={set:vs("width","width")},Ky={set:vs("height","height")},IR={set:vs("rx","width")},BR={set:vs("ry","height")},Zy={set:(n=>{const e=vs(n,"width"),t=vs(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?e:t;return ee(o,this,s,r)}})("r")},jR={set(n,{refBBox:e}){let t=parseFloat(n);const s=qn(n);s&&(t/=100);const r=Math.sqrt(e.height*e.height+e.width*e.width);let i;return Number.isFinite(t)&&(s||t>=0&&t<=1?i=t*r:i=Math.max(t+r,0)),{r:i}}},$R={set:vs("cx","width")},zR={set:vs("cy","height")},Qy={set:nb({resetOffset:!0})},FR={set:nb({resetOffset:!1})},eb={set:sb({resetOffset:!0})},UR={set:sb({resetOffset:!1})},HR=Zy,GR=Qy,WR=eb,YR=qy,qR=Jy,JR=Xy,XR=Ky;function rl(n,e,t){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=qn(s);o&&(i/=100);let a;if(Number.isFinite(i)){const u=r[t];o||i>0&&i<1?a=u[n]+r[e]*i:a=u[n]+i}const c=new O;return c[n]=a||0,c}}function vs(n,e){return function(t,{refBBox:s}){let r=parseFloat(t);const i=qn(t);i&&(r/=100);const o={};if(Number.isFinite(r)){const a=i||r>=0&&r<=1?r*s[e]:Math.max(r+s[e],0);o[n]=a}return o}}function tb(n,e){const t="x6-shape",s=e&&e.resetOffset;return function(r,{elem:i,refBBox:o}){let a=Js(i,t);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},Js(i,t,a)}const c=a.shape.clone(),u=a.shapeBBox.clone(),d=u.getOrigin(),f=o.getOrigin();u.x=f.x,u.y=f.y;const h=o.getMaxScaleToFit(u,f),p=u.width===0||o.width===0?1:h.sx,g=u.height===0||o.height===0?1:h.sy;return c.scale(p,g,d),s&&c.translate(-d.x,-d.y),c}}function nb(n){function e(s){return ne.parse(s)}const t=tb(e,n);return(s,r)=>({d:t(s,r).serialize()})}function sb(n){const e=tb(t=>new ze(t),n);return(t,s)=>({points:e(t,s).serialize()})}const KR={qualify:vn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},ZR={qualify:vn,set(n,{view:e}){const t=e.cell,s=Object.assign({},n);if(t.isEdge()&&s.type==="linearGradient"){const r=e,i=r.sourcePoint,o=r.targetPoint;s.id=`gradient-${s.type}-${t.id}`,s.attrs=Object.assign(Object.assign({},s.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(s.id)}return`url(#${e.graph.defineGradient(s)})`}},rb={qualify(n,{attrs:e}){return e.textWrap==null||!vn(e.textWrap)},set(n,{view:e,elem:t,attrs:s}){const r="x6-text",i=Js(t,r),o=d=>{try{return JSON.parse(d)}catch{return d}},a={x:s.x,eol:s.eol,annotations:o(s.annotations),textPath:o(s["text-path"]||s.textPath),textVerticalAnchor:s["text-vertical-anchor"]||s.textVerticalAnchor,displayEmpty:(s["display-empty"]||s.displayEmpty)==="true",lineHeight:s["line-height"]||s.lineHeight},c=s["font-size"]||s.fontSize,u=JSON.stringify([n,a]);if(c&&t.setAttribute("font-size",c),i==null||i!==u){const d=a.textPath;if(d!=null&&typeof d=="object"){const f=d.selector;if(typeof f=="string"){const h=e.find(f)[0];h instanceof SVGPathElement&&(zu(h),a.textPath=Object.assign({"xlink:href":`#${h.id}`},d))}}ky(t,`${n}`,a),Js(t,r,u)}}},QR={qualify:vn,set(n,{view:e,elem:t,attrs:s,refBBox:r}){const i=n,o=i.width||0;qn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;qn(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let c,u=i.text;u==null&&(u=s.text||(t==null?void 0:t.textContent)),u!=null?c=Dy(`${u}`,r,{"font-weight":s["font-weight"]||s.fontWeight,"font-size":s["font-size"]||s.fontSize,"font-family":s["font-family"]||s.fontFamily,lineHeight:s.lineHeight},{ellipsis:i.ellipsis}):c="",ee(rb.set,this,c,{view:e,elem:t,attrs:s,refBBox:r,cell:e.cell})}},Yr=(n,{attrs:e})=>e.text!==void 0,eL={qualify:Yr},tL={qualify:Yr},nL={qualify:Yr},sL={qualify:Yr},rL={qualify:Yr},iL={qualify:Yr},oL={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",s=`${n}`,r=Js(e,t);if(r==null||r!==s){Js(e,t,s);const i=e.firstChild;if(i&&i.tagName.toUpperCase()==="TITLE"){const o=i;o.textContent=s}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=s,e.insertBefore(o,i)}}}},aL={offset:ib("x","width","right")},lL={offset:ib("y","height","bottom")},cL={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ib(n,e,t){return(s,{refBBox:r})=>{const i=new O;let o;return s==="middle"?o=r[e]/2:s===t?o=r[e]:typeof s=="number"&&Number.isFinite(s)?o=s>-1&&s<1?-r[e]*s:-s:qn(s)?o=r[e]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const uL={qualify:vn,set(n,{elem:e}){Je(e,n)}},dL={set(n,{elem:e}){e.innerHTML=`${n}`}},hL={qualify:vn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},fL={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Cs(n,e,t){let s,r;typeof e=="object"?(s=e.x,r=e.y):(s=e,r=t);const i=ne.parse(n),o=i.bbox();if(o){let a=-o.height/2-o.y,c=-o.width/2-o.x;typeof s=="number"&&(c-=s),typeof r=="number"&&(a-=r),i.translate(c,a)}return i.serialize()}var ob=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const pL=n=>{var{size:e,width:t,height:s,offset:r,open:i}=n,o=ob(n,["size","width","height","offset","open"]);return ab({size:e,width:t,height:s,offset:r},i===!0,!0,void 0,o)},gL=n=>{var{size:e,width:t,height:s,offset:r,factor:i}=n,o=ob(n,["size","width","height","offset","factor"]);return ab({size:e,width:t,height:s,offset:r},!1,!1,i,o)};function ab(n,e,t,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,c=new ne,u={};if(e)c.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(c.moveTo(0,a/2),c.lineTo(o,0),!t){const d=xt(s,0,1);c.lineTo(o*d,a/2)}c.lineTo(o,a),c.close()}return Object.assign(Object.assign(Object.assign({},u),r),{tagName:"path",d:Cs(c.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var mL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const yL=n=>{var{size:e,width:t,height:s,offset:r}=n,i=mL(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new ne;return u.moveTo(0,c/2).lineTo(a/2,0).lineTo(a,c/2).lineTo(a/2,c).close(),Object.assign(Object.assign({},i),{tagName:"path",d:Cs(u.serialize(),r??-a/2)})};var bL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const wL=n=>{var{d:e,offsetX:t,offsetY:s}=n,r=bL(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Cs(e,t,s)})};var xL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const vL=n=>{var{size:e,width:t,height:s,offset:r}=n,i=xL(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new ne;return u.moveTo(0,0).lineTo(a,c).moveTo(0,c).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:Cs(u.serialize(),r||-a/2)})};var CL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const SL=n=>{var{width:e,height:t,offset:s,open:r,flip:i}=n,o=CL(n,["width","height","offset","open","flip"]);let a=t||6;const c=e||10,u=r===!0,d=i===!0,f=Object.assign(Object.assign({},o),{tagName:"path"});d&&(a=-a);const h=new ne;return h.moveTo(0,a).lineTo(c,0),u?f.fill="none":(h.lineTo(c,a),h.close()),f.d=Cs(h.serialize(),{x:s||-c/2,y:a/2}),f};var lb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const cb=n=>{var{r:e}=n,t=lb(n,["r"]);const s=e||5;return Object.assign(Object.assign({cx:s},t),{tagName:"circle",r:s})},EL=n=>{var{r:e}=n,t=lb(n,["r"]);const s=e||5,r=new ne;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},cb({r:s})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Cs(r.serialize(),-s)})]}};var OL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const ML=Object.freeze(Object.defineProperty({__proto__:null,async:SL,block:pL,circle:cb,circlePlus:EL,classic:gL,cross:vL,diamond:yL,ellipse:n=>{var{rx:e,ry:t}=n,s=OL(n,["rx","ry"]);const r=e||5,i=t||5;return Object.assign(Object.assign({cx:r},s),{tagName:"ellipse",rx:r,ry:i})},path:wL},Symbol.toStringTag,{value:"Module"}));var Ss;(function(n){n.presets=ML,n.registry=Fe.create({type:"marker"}),n.registry.register(n.presets,!0)})(Ss||(Ss={})),function(n){n.normalize=Cs}(Ss||(Ss={}));var PL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function id(n){return typeof n=="string"||vn(n)}const NL={qualify:id,set(n,{view:e,attrs:t}){return od("marker-start",n,e,t)}},AL={qualify:id,set(n,{view:e,attrs:t}){return od("marker-end",n,e,t,{transform:"rotate(180)"})}},_L={qualify:id,set(n,{view:e,attrs:t}){return od("marker-mid",n,e,t)}};function od(n,e,t,s,r={}){const i=typeof e=="string"?{name:e}:e,{name:o,args:a}=i,c=PL(i,["name","args"]);let u=c;if(o&&typeof o=="string"){const f=Ss.registry.get(o);if(f)u=f(Object.assign(Object.assign({},c),a));else return Ss.registry.onNotFound(o)}const d=Object.assign(Object.assign(Object.assign({},TL(s,n)),r),u);return{[n]:`url(#${t.graph.defineMarker(d)})`}}function TL(n,e){const t={},s=n.stroke;typeof s=="string"&&(t.stroke=s,t.fill=s);let r=n.strokeOpacity;if(r==null&&(r=n["stroke-opacity"]),r==null&&(r=n.opacity),r!=null&&(t["stroke-opacity"]=r,t["fill-opacity"]=r),e!=="marker-mid"){const i=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);t.refX=e==="marker-start"?o:-o}}return t}const co=(n,{view:e})=>e.cell.isEdge(),kL={qualify:co,set(n,e){var t,s,r,i;const o=e.view,a=n.reverse||!1,c=n.stubs||0;let u;if(Number.isFinite(c)&&c!==0)if(a){let d,f;const h=o.getConnectionLength()||0;c<0?(d=(h+c)/2,f=-c):(d=c,f=h-c*2);const p=o.getConnection();u=(i=(r=(s=(t=p==null?void 0:p.divideAtLength(d))===null||t===void 0?void 0:t[1])===null||s===void 0?void 0:s.divideAtLength(f))===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.serialize()}else{let d;c<0?d=((o.getConnectionLength()||0)+c)/2:d=c;const f=o.getConnection();if(f){const h=f.divideAtLength(d),p=f.divideAtLength(-d);h&&p&&(u=`${h[0].serialize()} ${p[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},ub={qualify:co,set:il("getTangentAtLength",{rotate:!0})},VL={qualify:co,set:il("getTangentAtLength",{rotate:!1})},db={qualify:co,set:il("getTangentAtRatio",{rotate:!0})},DL={qualify:co,set:il("getTangentAtRatio",{rotate:!1})},RL=ub,LL=db;function il(n,e){const t={x:1,y:0};return(s,r)=>{let i,o;const a=r.view,c=a[n](Number(s));return c?(o=e.rotate?c.vector().vectorAngle(t):0,i=c.start):(i=a.path.start,o=0),o===0?{transform:`translate(${i.x},${i.y}')`}:{transform:`translate(${i.x},${i.y}') rotate(${o})`}}}const IL=Object.freeze(Object.defineProperty({__proto__:null,annotations:sL,atConnectionLength:RL,atConnectionLengthIgnoreGradient:VL,atConnectionLengthKeepGradient:ub,atConnectionRatio:LL,atConnectionRatioIgnoreGradient:DL,atConnectionRatioKeepGradient:db,connection:kL,displayEmpty:iL,eol:rL,fill:KR,filter:hL,html:dL,lineHeight:eL,port:fL,ref:DR,refCx:$R,refCy:zR,refD:GR,refDKeepOffset:FR,refDResetOffset:Qy,refDx:RR,refDy:LR,refHeight:Ky,refHeight2:XR,refPoints:WR,refPointsKeepOffset:UR,refPointsResetOffset:eb,refR:HR,refRCircumscribed:jR,refRInscribed:Zy,refRx:IR,refRy:BR,refWidth:Xy,refWidth2:JR,refX:qy,refX2:YR,refY:Jy,refY2:qR,resetOffset:cL,sourceMarker:NL,stroke:ZR,style:uL,targetMarker:AL,text:rb,textPath:nL,textVerticalAnchor:tL,textWrap:QR,title:oL,vertexMarker:_L,xAlign:aL,yAlign:lL},Symbol.toStringTag,{value:"Module"}));var An;(function(n){function e(t,s,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||ee(t.qualify,this,s,r)))}n.isValidDefinition=e})(An||(An={})),function(n){n.presets=Object.assign(Object.assign({},VR),IL),n.registry=Fe.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(An||(An={}));const Yt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Yt.prefixCls}-${n}`}},hb=Yt.prefix("highlighted"),BL={highlight(n,e,t){const s=t&&t.className||hb;X(e,s)},unhighlight(n,e,t){const s=t&&t.className||hb;De(e,s)}},fb=Yt.prefix("highlight-opacity"),jL={highlight(n,e){X(e,fb)},unhighlight(n,e){De(e,fb)}};var Se;(function(n){n.normalizeMarker=Cs;function e(h,p){const g=ZD(h.x,h.y).matrixTransform(p);return new O(g.x,g.y)}n.transformPoint=e;function t(h,p){return new Y(e(h.start,p),e(h.end,p))}n.transformLine=t;function s(h,p){let g=h instanceof ze?h.points:h;return Array.isArray(g)||(g=[]),new ze(g.map(m=>e(m,p)))}n.transformPolyline=s;function r(h,p){const m=fn("svg").createSVGPoint();m.x=h.x,m.y=h.y;const y=m.matrixTransform(p);m.x=h.x+h.width,m.y=h.y;const b=m.matrixTransform(p);m.x=h.x+h.width,m.y=h.y+h.height;const w=m.matrixTransform(p);m.x=h.x,m.y=h.y+h.height;const x=m.matrixTransform(p),v=Math.min(y.x,b.x,w.x,x.x),S=Math.max(y.x,b.x,w.x,x.x),E=Math.min(y.y,b.y,w.y,x.y),C=Math.max(y.y,b.y,w.y,x.y);return new F(v,E,S-v,C-E)}n.transformRectangle=r;function i(h,p,g){let m;const y=h.ownerSVGElement;if(!y)return new F(0,0,0,0);try{m=h.getBBox()}catch{m={x:h.clientLeft,y:h.clientTop,width:h.clientWidth,height:h.clientHeight}}if(p)return F.create(m);const b=so(h,g||y);return r(m,b)}n.bbox=i;function o(h,p={}){let g;if(!h.ownerSVGElement||!ms(h)){if(Cy(h)){const{left:w,top:x,width:v,height:S}=a(h);return new F(w,x,v,S)}return new F(0,0,0,0)}let y=p.target;if(!p.recursive){try{g=h.getBBox()}catch{g={x:h.clientLeft,y:h.clientTop,width:h.clientWidth,height:h.clientHeight}}if(!y)return F.create(g);const w=so(h,y);return r(g,w)}{const w=h.childNodes,x=w.length;if(x===0)return o(h,{target:y});y||(y=h);for(let v=0;v<x;v+=1){const S=w[v];let E;S.childNodes.length===0?E=o(S,{target:y}):E=o(S,{target:y,recursive:!0}),g?g=g.union(E):g=E}return g}}n.getBBox=o;function a(h){let p=0,g=0,m=0,y=0;if(h){let b=h;for(;b;)p+=b.offsetLeft,g+=b.offsetTop,b=b.offsetParent,b&&(p+=parseInt(Ay(b,"borderLeft"),10),g+=parseInt(Ay(b,"borderTop"),10));m=h.offsetWidth,y=h.offsetHeight}return{left:p,top:g,width:m,height:y}}n.getBoundingOffsetRect=a;function c(h){const p=g=>{const m=h.getAttribute(g),y=m?parseFloat(m):0;return Number.isNaN(y)?0:y};switch(h instanceof SVGElement&&h.nodeName.toLowerCase()){case"rect":return new F(p("x"),p("y"),p("width"),p("height"));case"circle":return new pn(p("cx"),p("cy"),p("r"),p("r"));case"ellipse":return new pn(p("cx"),p("cy"),p("rx"),p("ry"));case"polyline":{const g=Za(h);return new ze(g)}case"polygon":{const g=Za(h);return g.length>1&&g.push(g[0]),new ze(g)}case"path":{let g=h.getAttribute("d");return ne.isValid(g)||(g=ne.normalize(g)),ne.parse(g)}case"line":return new Y(p("x1"),p("y1"),p("x2"),p("y2"))}return o(h)}n.toGeometryShape=c;function u(h,p,g,m){const y=O.create(p),b=O.create(g);m||(m=h instanceof SVGSVGElement?h:h.ownerSVGElement);const w=Qu(h);h.setAttribute("transform","");const x=o(h,{target:m}).scale(w.sx,w.sy),v=to();v.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const S=to(),E=y.angleBetween(b,y.clone().translate(1,0));E&&S.setRotate(E,0,0);const C=to(),P=y.clone().move(b,x.width/2);C.setTranslate(2*y.x-P.x,2*y.y-P.y);const A=so(h,m),T=to();T.setMatrix(C.matrix.multiply(S.matrix.multiply(v.matrix.multiply(A.scale(w.sx,w.sy))))),h.setAttribute("transform",$r(T.matrix))}n.translateAndAutoOrient=u;function d(h){if(h==null)return null;let p=h;do{let g=p.tagName;if(typeof g!="string")return null;if(g=g.toUpperCase(),Pn(p,"x6-port"))p=p.nextElementSibling;else if(g==="G")p=p.firstElementChild;else if(g==="TITLE")p=p.nextElementSibling;else break}while(p);return p}n.findShapeNode=d;function f(h){const p=d(h);if(!ms(p)){if(Cy(h)){const{left:y,top:b,width:w,height:x}=a(h);return new F(y,b,w,x)}return new F(0,0,0,0)}return c(p).bbox()||F.create()}n.getBBoxV2=f})(Se||(Se={}));const $L={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},zL={highlight(n,e,t){const s=Es.getHighlighterId(e,t);if(Es.hasCache(s))return;t=wp({},t,$L);const r=oe.create(e);let i,o;try{i=r.toPathData()}catch{o=Se.bbox(r.node,!0),i=Ly(Object.assign(Object.assign({},t),o))}const a=fn("path");if(fe(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?Qi(t.attrs):null)),n.isEdgeElement(e))fe(a,"d",n.getConnectionPathData());else{let d=r.getTransformToElement(n.container);const f=t.padding;if(f){o==null&&(o=Se.bbox(r.node,!0));const h=o.x+o.width/2,p=o.y+o.height/2;o=Se.transformRectangle(o,d);const g=Math.max(o.width,1),m=Math.max(o.height,1),y=(g+f)/g,b=(m+f)/m,w=it({a:y,b:0,c:0,d:b,e:h-y*h,f:p-b*p});d=d.multiply(w)}zr(a,d)}X(a,Yt.prefix("highlight-stroke"));const c=n.cell,u=()=>Es.removeHighlighter(s);c.on("removed",u),c.model&&c.model.on("reseted",u),n.container.appendChild(a),Es.setCache(s,a)},unhighlight(n,e,t){Es.removeHighlighter(Es.getHighlighterId(e,t))}};var Es;(function(n){function e(o,a){return zu(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function s(o,a){t[o]=a}n.setCache=s;function r(o){return t[o]!=null}n.hasCache=r;function i(o){const a=t[o];a&&(Ht(a),delete t[o])}n.removeHighlighter=i})(Es||(Es={}));const FL=Object.freeze(Object.defineProperty({__proto__:null,className:BL,opacity:jL,stroke:zL},Symbol.toStringTag,{value:"Module"}));var Xn;(function(n){function e(t,s){if(typeof s.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof s.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(Xn||(Xn={})),function(n){n.presets=FL,n.registry=Fe.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(Xn||(Xn={}));function ad(n,e={}){return new O(dn(e.x,n.width),dn(e.y,n.height))}function ld(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const UL=(n,e)=>n.map(({x:t,y:s,angle:r})=>ld(ad(e,{x:t,y:s}),r||0)),HL=(n,e,t)=>{const s=t.start||0,r=t.step||20;return pb(n,e,s,(i,o)=>(i+.5-o/2)*r)},GL=(n,e,t)=>{const s=t.start||0,r=t.step||360/n.length;return pb(n,e,s,i=>i*r)};function pb(n,e,t,s){const r=e.getCenter(),i=e.getTopCenter(),o=e.width/e.height,a=pn.fromRect(e),c=n.length;return n.map((u,d)=>{const f=t+s(d,c),h=i.clone().rotate(-f,r).scale(o,1,r),p=u.compensateRotate?-a.tangentTheta(h):0;return(u.dx||u.dy)&&h.translate(u.dx||0,u.dy||0),u.dr&&h.move(r,u.dr),ld(h.round(),p,u)})}var WL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const YL=(n,e,t)=>{const s=ad(e,t.start||e.getOrigin()),r=ad(e,t.end||e.getCorner());return uo(n,s,r,t)},qL=(n,e,t)=>uo(n,e.getTopLeft(),e.getBottomLeft(),t),JL=(n,e,t)=>uo(n,e.getTopRight(),e.getBottomRight(),t),XL=(n,e,t)=>uo(n,e.getTopLeft(),e.getTopRight(),t),KL=(n,e,t)=>uo(n,e.getBottomLeft(),e.getBottomRight(),t);function uo(n,e,t,s){const r=new Y(e,t),i=n.length;return n.map((o,a)=>{var{strict:c}=o,u=WL(o,["strict"]);const d=c||s.strict?(a+1)/(i+1):(a+.5)/i,f=r.pointAt(d);return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),ld(f.round(),0,u)})}const ZL=Object.freeze(Object.defineProperty({__proto__:null,absolute:UL,bottom:KL,ellipse:HL,ellipseSpread:GL,left:qL,line:YL,right:JL,top:XL},Symbol.toStringTag,{value:"Module"}));var Qs;(function(n){n.presets=ZL,n.registry=Fe.create({type:"port layout"}),n.registry.register(n.presets,!0)})(Qs||(Qs={}));const QL={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Os(n,e){const{x:t,y:s,angle:r,attrs:i}=e||{};return wp({},{angle:r,attrs:i,position:{x:t,y:s}},n,QL)}const eI=(n,e,t)=>Os({position:e.getTopLeft()},t),tI=(n,e,t)=>Os({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),nI=(n,e,t)=>Os({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),sI=(n,e,t)=>Os({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),rI=(n,e,t)=>Os({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),iI=(n,e,t)=>gb(n,e,!1,t),oI=(n,e,t)=>gb(n,e,!0,t),aI=(n,e,t)=>mb(n,e,!1,t),lI=(n,e,t)=>mb(n,e,!0,t);function gb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=yb(e);let a,c,u,d,f=0;return i<o[1]||i>o[2]?(a=".3em",c=r,u=0,d="start"):i<o[0]?(a="0",c=0,u=-r,t?(f=-90,d="start"):d="middle"):i<o[3]?(a=".3em",c=-r,u=0,d="end"):(a=".6em",c=0,u=r,t?(f=90,d="start"):d="middle"),Os({position:{x:Math.round(c),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":d}}},s)}function mb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=yb(e);let a,c,u,d,f=0;return i<o[1]||i>o[2]?(a=".3em",c=-r,u=0,d="end"):i<o[0]?(a=".6em",c=0,u=r,t?(f=90,d="start"):d="middle"):i<o[3]?(a=".3em",c=r,u=0,d="start"):(a="0em",c=0,u=-r,t?(f=-90,d="start"):d="middle"),Os({position:{x:Math.round(c),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":d}}},s)}function yb(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),s=e.theta(n.getBottomLeft()),r=e.theta(n.getBottomRight()),i=e.theta(n.getTopRight());return[t,i,r,s]}const cI=(n,e,t)=>bb(n.diff(e.getCenter()),!1,t),uI=(n,e,t)=>bb(n.diff(e.getCenter()),!0,t);function bb(n,e,t){const s=t.offset!=null?t.offset:20,r=new O(0,0),i=-n.theta(r),o=n.clone().move(r,s).diff(n).round();let a=".3em",c,u=i;return(i+90)%180===0?(c=e?"end":"middle",!e&&i===-270&&(a="0em")):i>-270&&i<-90?(c="start",u=i-180):c="end",Os({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":c}}},t)}const dI=Object.freeze(Object.defineProperty({__proto__:null,bottom:rI,inside:aI,insideOriented:lI,left:tI,manual:eI,outside:iI,outsideOriented:oI,radial:cI,radialOriented:uI,right:nI,top:sI},Symbol.toStringTag,{value:"Module"}));var qr;(function(n){n.presets=dI,n.registry=Fe.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(qr||(qr={}));var hI=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class be extends Te{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=cd.uniqueId(),be.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return Zi(e),this}unmount(e=this.container){return Ht(e),this}remove(e=this.container){return e===this.container?(this.removeEventListeners(document),this.onRemove(),delete be.views[this.cid],this.disposeContainer&&this.unmount(e)):this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return X(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return De(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Je(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&fe(t,e),this}findAttr(e,t=this.container){let s=t;for(;s&&s.nodeType===1;){const r=s.getAttribute(e);if(r!=null)return r;if(s===this.container)return null;s=s.parentNode}return null}find(e,t=this.container,s=this.selectors){return be.find(e,t,s).elems}findOne(e,t=this.container,s=this.selectors){const r=this.find(e,t,s);return r.length>0?r[0]:null}findByAttr(e,t=this.container){let s=t;for(;s&&s.getAttribute;){const r=s.getAttribute(e);if((r!=null||s===this.container)&&r!=="false")return s;s=s.parentNode}return null}getSelector(e,t){let s;if(e===this.container)return typeof t=="string"&&(s=`> ${t}`),s;if(e){const r=Uu(e)+1;s=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(s+=` > ${t}`),s=this.getSelector(e.parentNode,s)}return s}prefixClassName(e){return Yt.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const s=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(r=>{const i=r.match(s);if(i==null)return;const o=this.getEventHandler(e[r]);typeof o=="function"&&this.delegateEvent(i[1],i[2],o)}),this}undelegateEvents(){return ut.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,s){return ut.on(this.container,e+this.getEventNamespace(),t,s),this}undelegateEvent(e,t,s){const r=e+this.getEventNamespace();return t==null?ut.off(this.container,r):typeof t=="string"?ut.off(this.container,r,t,s):ut.off(this.container,r,t),this}addEventListeners(e,t,s){if(t==null)return this;const r=this.getEventNamespace();return Object.keys(t).forEach(i=>{const o=this.getEventHandler(t[i]);typeof o=="function"&&ut.on(e,i+r,s,o)}),this}removeEventListeners(e){return e!=null&&ut.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Yt.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const s=this[e];typeof s=="function"&&(t=(...r)=>s.call(this,...r))}else t=(...s)=>e.call(this,...s);return t}getEventTarget(e,t={}){const{target:s,type:r,clientX:i=0,clientY:o=0}=e;return t.fromPoint||r==="touchmove"||r==="touchend"?document.elementFromPoint(i,o):s}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let s=e.data;const r=`__${this.cid}__`;return t==null?s==null?{}:s[r]||{}:(s==null&&(s=e.data={}),s[r]==null?s[r]=Object.assign({},t):s[r]=Object.assign(Object.assign({},s[r]),t),s[r])}normalizeEvent(e){return be.normalizeEvent(e)}dispose(){this.remove()}}hI([be.dispose()],be.prototype,"dispose",null),function(n){function e(r,i){return i?fn(r||"g"):Fu(r||"div")}n.createElement=e;function t(r,i,o){if(!r||r===".")return{elems:[i]};if(o){const a=o[r];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=r.includes(">")?`:scope ${r}`:r;return{isCSSSelector:!0,elems:Array.prototype.slice.call(i.querySelectorAll(a))}}}n.find=t;function s(r){let i=r;const o=r.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const c in r)a[c]===void 0&&(a[c]=r[c]);i=a}return i}n.normalizeEvent=s}(be||(be={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(be||(be={}));var cd;(function(n){let e=0;function t(){const s=`v${e}`;return e+=1,s}n.uniqueId=t})(cd||(cd={}));class fI{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new nd,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const s=this.view.container;t.matrix=sR(e,s)}return it(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Se.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Se.getBBoxV2(e)),t.boundingRect.clone()}}var ke;(function(n){function e(u){return u!=null&&!t(u)}n.isJSONMarkup=e;function t(u){return u!=null&&typeof u=="string"}n.isStringMarkup=t;function s(u){return u==null||t(u)?u:_e(u)}n.clone=s;function r(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=r;function i(u,d={ns:rt.svg}){const f=document.createDocumentFragment(),h={},p={},g=[{markup:Array.isArray(u)?u:[u],parent:f,ns:d.ns}];for(;g.length>0;){const m=g.pop();let y=m.ns||rt.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const v=x.tagName;if(!v)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const S=y?Fu(v,y):wy(v),E=x.attrs;E&&fe(S,Qi(E));const C=x.style;C&&Je(S,C);const P=x.className;P!=null&&S.setAttribute("class",Array.isArray(P)?P.join(" "):P),x.textContent&&(S.textContent=x.textContent);const A=x.selector;if(A!=null){if(p[A])throw new TypeError("Selector must be unique");p[A]=S}if(x.groupSelector){let k=x.groupSelector;Array.isArray(k)||(k=[k]),k.forEach(V=>{h[V]||(h[V]=[]),h[V].push(S)})}w.appendChild(S);const T=x.children;Array.isArray(T)&&g.push({ns:y,markup:T,parent:S})})}return Object.keys(h).forEach(m=>{if(p[m])throw new Error("Ambiguous group selector");p[m]=h[m]}),{fragment:f,selectors:p,groups:h}}n.parseJSONMarkup=i;function o(u){return u instanceof SVGElement?fn("g"):wy("div")}function a(u){if(t(u)){const p=oe.createVectors(u),g=p.length;if(g===1)return{elem:p[0].node};if(g>1){const m=o(p[0].node);return p.forEach(y=>{m.appendChild(y.node)}),{elem:m}}return{}}const d=i(u),f=d.fragment;let h=null;return f.childNodes.length>1?(h=o(f.firstChild),h.appendChild(f)):h=f.firstChild,{elem:h,selectors:d.selectors}}n.renderMarkup=a;function c(u){const d=oe.createVectors(u),f=document.createDocumentFragment();for(let h=0,p=d.length;h<p;h+=1){const g=d[h].node;f.appendChild(g)}return{fragment:f,selectors:{}}}n.parseLabelStringMarkup=c})(ke||(ke={})),function(n){function e(t,s,r){if(t!=null){let i;const o=t.tagName.toLowerCase();if(t===s)return typeof r=="string"?i=`> ${o} > ${r}`:i=`> ${o}`,i;const a=t.parentNode;if(a&&a.childNodes.length>1){const c=Uu(t)+1;i=`${o}:nth-child(${c})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,s,i)}return r}n.getSelector=e}(ke||(ke={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function s(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=s}(ke||(ke={})),function(n){function e(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=e}(ke||(ke={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:rt.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:rt.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(ke||(ke={}));class wb{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let s,r,i,o;const a=[];return Object.keys(t).forEach(c=>{const u=t[c],d=this.getDefinition(c),f=ee(An.isValidDefinition,this.view,d,u,{elem:e,attrs:t,cell:this.cell,view:this.view});if(d&&f)typeof d=="string"?(s==null&&(s={}),s[d]=u):u!==null&&a.push({name:c,definition:d});else{s==null&&(s={});const h=Sy.includes(c)?c:ty(c);s[h]=u}}),a.forEach(({name:c,definition:u})=>{const d=t[c];typeof u.set=="function"&&(r==null&&(r={}),r[c]=d),typeof u.offset=="function"&&(i==null&&(i={}),i[c]=d),typeof u.position=="function"&&(o==null&&(o={}),o[c]=d)}),{raw:t,normal:s,set:r,offset:i,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const s=e.normal&&e.normal.transform;s!=null&&t.normal&&(t.normal.transform=s),e.normal=t.normal}findAttrs(e,t,s,r){const i=[],o=new nd;return Object.keys(e).forEach(a=>{const c=e[a];if(!vn(c))return;const{isCSSSelector:u,elems:d}=be.find(a,t,r);s[a]=d;for(let f=0,h=d.length;f<h;f+=1){const p=d[f],g=r&&r[a]===p,m=o.get(p);if(m){m.array||(i.push(p),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const y=m.attrs,b=m.priority;if(g)y.unshift(c),b.unshift(-1);else{const w=UP(b,u?-1:h);y.splice(w,0,c),b.splice(w,0,h)}}else o.set(p,{elem:p,attrs:c,priority:g?-1:h,array:!1})}}),i.forEach(a=>{const c=o.get(a),u=c.attrs;c.attrs=u.reduceRight((d,f)=>We(d,f),{})}),o}updateRelativeAttrs(e,t,s){const r=t.raw||{};let i=t.normal||{};const o=t.set,a=t.position,c=t.offset,u=()=>({elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:s.clone()});if(o!=null&&Object.keys(o).forEach(y=>{const b=o[y],w=this.getDefinition(y);if(w!=null){const x=ee(w.set,this.view,b,u());typeof x=="object"?i=Object.assign(Object.assign({},i),x):x!=null&&(i[y]=x)}}),e instanceof HTMLElement){this.view.setAttrs(i,e);return}const d=i.transform,f=d?`${d}`:null,h=no(f),p=new O(h.e,h.f);d&&(delete i.transform,h.e=0,h.f=0);let g=!1;a!=null&&Object.keys(a).forEach(y=>{const b=a[y],w=this.getDefinition(y);if(w!=null){const x=ee(w.position,this.view,b,u());x!=null&&(g=!0,p.translate(O.create(x)))}}),this.view.setAttrs(i,e);let m=!1;if(c!=null){const y=this.view.getBoundingRectOfElement(e);if(y.width>0&&y.height>0){const b=Se.transformRectangle(y,h);Object.keys(c).forEach(w=>{const x=c[w],v=this.getDefinition(w);if(v!=null){const S=ee(v.offset,this.view,x,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:b});S!=null&&(m=!0,p.translate(O.create(S)))}})}}(d!=null||g||m)&&(p.round(1),h.e=p.x,h.f=p.y,e.setAttribute("transform",$r(h)))}update(e,t,s){const r={},i=this.findAttrs(s.attrs||t,e,r,s.selectors),o=s.attrs?this.findAttrs(t,e,r,s.selectors):i,a=[];i.each(d=>{const f=d.elem,h=d.attrs,p=this.processAttrs(f,h);if(p.set==null&&p.position==null&&p.offset==null)this.view.setAttrs(p.normal,f);else{const g=o.get(f),m=g?g.attrs:null,y=m&&h.ref==null?m.ref:h.ref;let b;if(y){if(b=(r[y]||this.view.find(y,e,s.selectors))[0],!b)throw new Error(`"${y}" reference does not exist.`)}else b=null;const w={node:f,refNode:b,attributes:m,processedAttributes:p},x=a.findIndex(v=>v.refNode===f);x>-1?a.splice(x,0,w):a.push(w)}});const c=new nd;let u;a.forEach(d=>{const f=d.node,h=d.refNode;let p;const g=h!=null&&s.rotatableNode!=null&&Hu(s.rotatableNode,h);if(h&&(p=c.get(h)),!p){const b=g?s.rotatableNode:e;p=h?Se.getBBox(h,{target:b}):s.rootBBox,h&&c.set(h,p)}let m;s.attrs&&d.attributes?(m=this.processAttrs(f,d.attributes),this.mergeProcessedAttrs(m,d.processedAttributes)):m=d.processedAttributes;let y=p;g&&s.rotatableNode!=null&&!s.rotatableNode.contains(f)&&(u||(u=no(fe(s.rotatableNode,"transform"))),y=Se.transformRectangle(p,u)),this.updateRelativeAttrs(f,m,y)})}}class xb{get cell(){return this.view.cell}constructor(e,t,s=[]){this.view=e;const r={},i={};let o=0;Object.keys(t).forEach(c=>{let u=t[c];Array.isArray(u)||(u=[u]),u.forEach(d=>{let f=r[d];f||(o+=1,f=r[d]=1<<o),i[c]|=f})});let a=s;if(Array.isArray(a)||(a=[a]),a.forEach(c=>{r[c]||(o+=1,r[c]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=s}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((s,r)=>s|t[r],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var pI=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},gI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Ue extends be{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,d)=>d!=null?Op([...Array.isArray(u)?u:[u],...Array.isArray(d)?d:[d]]):Array.isArray(u)?[...u]:[u],s=_e(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=e,c=gI(e,["bootstrap","actions","events","documentEvents"]);return r&&(s.bootstrap=t(s.bootstrap,r)),i&&Object.entries(i).forEach(([u,d])=>{const f=s.actions[u];d&&f?s.actions[u]=t(f,d):d&&(s.actions[u]=t(d))}),o&&(s.events=Object.assign(Object.assign({},s.events),o)),e.documentEvents&&(s.documentEvents=Object.assign(Object.assign({},s.documentEvents),a)),We(s,c)}get[Symbol.toStringTag](){return Ue.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new wb(this),this.flag=new xb(this,this.options.actions,this.options.bootstrap),this.cache=new fI(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return be.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const s=this.getContainerStyle();s!=null&&this.setStyle(s,e);const r=this.getContainerClassName();r!=null&&this.addClass(r,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,s,r){if(this.hasAction(e,t)){s();const i=[t];return r&&(typeof r=="string"?i.push(r):i.push(...r)),this.removeAction(e,i)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const s=ke.parseJSONMarkup(e),r=s.selectors,i=this.rootSelector;if(t&&i){if(r[i])throw new Error("Invalid root selector");r[i]=t}return s}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=ee(t,this.graph,this)),typeof t=="object"){let s=t[e];return typeof s=="function"&&(s=ee(s,this.graph,this)),s!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return Se.transformRectangle(t,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return Se.transformRectangle(t,r.multiply(s))}getBBox(e={}){let t;if(e.useCellGeometry){const s=this.cell,r=s.isNode()?s.getAngle():0;t=s.getBBox().bbox(r)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return it().translate(t.x,t.y)}getRootRotatedMatrix(){let e=it();const t=this.cell,s=t.isNode()?t.getAngle():0;if(s){const r=t.getBBox(),i=r.width/2,o=r.height/2;e=e.translate(i,o).rotate(s).translate(-i,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,s={}){s.rootBBox==null&&(s.rootBBox=new F),s.selectors==null&&(s.selectors=this.selectors),this.attr.update(e,t,s)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const s=e||this.container;return t.partial=s===this.container,s}highlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,s,r,i){const o=this.cell,a=this.findAttr("port",e),c=e.getAttribute("data-selector"),u={cell:o.id};return c!=null&&(u.magnet=c),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&c==null&&(u.selector=this.getSelector(e))):c==null&&this.container!==e&&(u.selector=this.getSelector(e)),u}getMagnetFromEdgeTerminal(e){const t=this.cell,s=this.container,r=e.port;let i=e.magnet,o;return r!=null&&t.isNode()&&t.hasPort(r)?o=this.findPortElem(r,i)||s:(i||(i=e.selector),!i&&r!=null&&(i=`[port="${r}"]`),o=this.findOne(i,s,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;const t=Xe.isToolsView(e)?e:new Xe(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,s){const r=this,i=r.cell;return t==null||s==null?{e,view:r,cell:i}:{e,x:t,y:s,view:r,cell:i}}onClick(e,t,s){this.notify("cell:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){this.notify("cell:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){this.notify("cell:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,s))}onMouseUp(e,t,s){this.notify("cell:mouseup",this.getEventArgs(e,t,s)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,s){this.notify("cell:mousemove",this.getEventArgs(e,t,s))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),this.notify(t,Object.assign({},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){}onMagnetDblClick(e,t,s,r){}onMagnetContextMenu(e,t,s,r){}onLabelMouseDown(e,t,s){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),s=this.graph.findViewByElem(t);s!==this&&(this.onMouseLeave(e),s&&s.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}Ue.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},pI([Ue.dispose()],Ue.prototype,"dispose",null),function(n){n.Flag=xb,n.Attr=wb}(Ue||(Ue={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"}n.isCellView=e}(Ue||(Ue={})),function(n){function e(s){return function(r){r.config({priority:s})}}n.priority=e;function t(s){return function(r){r.config({bootstrap:s})}}n.bootstrap=t}(Ue||(Ue={})),function(n){n.registry=Fe.create({type:"view"})}(Ue||(Ue={}));class Xe extends be{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Xe.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const s=e?be.createElement("g",!0):be.createElement("div",!1);return X(s,this.prefixClassName("cell-tools")),t.className&&X(s,t.className),s}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!Ue.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(X(this.svgContainer,this.prefixClassName("edge-tools")),X(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(X(this.svgContainer,this.prefixClassName("node-tools")),X(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const s=[];t.forEach(r=>{Xe.ToolItem.isToolItem(r)?r.name==="vertices"?s.unshift(r):s.push(r):(typeof r=="object"?r.name:r)==="vertices"?s.unshift(r):s.push(r)});for(let r=0;r<s.length;r+=1){const i=s[r];let o;if(Xe.ToolItem.isToolItem(i))o=i;else{const a=typeof i=="object"?i.name:i,c=typeof i=="object"?i.args||{}:{};if(a){if(this.cell.isNode()){const u=Xr.registry.get(a);if(u)o=new u(c);else return Xr.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=Kr.registry.get(a);if(u)o=new u(c);else return Kr.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(e={}){const t=this.tools;return t&&t.forEach(s=>{e.toolId!==s.cid&&s.isVisible()&&s.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(s=>{e===s?s.show():s.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(s=>{s!==e&&!s.isVisible()&&(s.show(),s.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),Ht(this.svgContainer),Ht(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const s=e.some(i=>i.options.isSVGElement!==!1),r=e.some(i=>i.options.isSVGElement===!1);s&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&r.graph!=null&&r.cell!=null&&typeof r.config=="function"&&typeof r.update=="function"&&typeof r.focus=="function"&&typeof r.blur=="function"&&typeof r.show=="function"&&typeof r.hide=="function"}n.isToolsView=e})(Xe||(Xe={})),function(n){class e extends be{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return We(_e(this.getDefaults()),s)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}constructor(s={}){super(),this.visible=!0,this.options=this.getOptions(s),this.container=be.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),X(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&X(this.container,this.options.className),this.init()}init(){}getOptions(s){return this.constructor.getOptions(s)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(s,r){return this.cellView=s,this.parent=r,this.stamp(this.container),this.cell.isEdge()?X(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&X(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const s=this.options.markup;if(s){const r=ke.parseJSONMarkup(s);this.container.appendChild(r.fragment),this.childNodes=r.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(s){s&&s.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const s=this.options.focusOpacity;return s!=null&&Number.isFinite(s)&&(this.container.style.opacity=`${s}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(s){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(s,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let s=0;function r(o){return o?Lu(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Du(r(o.name),this);return a.config(o),a}t.define=i}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function s(r){if(r==null)return!1;if(r instanceof t)return!0;const i=r[Symbol.toStringTag],o=r;return(i==null||i===t.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}t.isToolItem=s}(e=n.ToolItem||(n.ToolItem={}))}(Xe||(Xe={}));const mI=n=>n;function vb(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Cb(n){return(t,s,r,i)=>s.isEdgeElement(r)?bI(n,t,s,r,i):yI(n,t,s,r,i)}function yI(n,e,t,s,r){const i=t.cell,o=i.getAngle(),a=t.getUnrotatedBBoxOfElement(s),c=i.getBBox().getCenter(),u=O.create(r).rotate(o,c);let d=u.x-a.x,f=u.y-a.y;return n&&(d=vb(d,a.width),f=vb(f,a.height)),e.anchor={name:"topLeft",args:{dx:d,dy:f,rotate:!0}},e}function bI(n,e,t,s,r){const i=t.getConnection();if(!i)return e;const o=i.closestPointLength(r);if(n){const a=i.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const wI=Cb(!0),xI=Cb(!1),vI=Object.freeze(Object.defineProperty({__proto__:null,noop:mI,pinAbsolute:xI,pinRelative:wI},Symbol.toStringTag,{value:"Module"}));var ud;(function(n){n.presets=vI,n.registry=Fe.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(ud||(ud={}));function Sb(n,e,t,s){return ee(ud.presets.pinRelative,this.graph,{},e,t,n,this.cell,s,{}).anchor}function Eb(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Ms extends Xe.ToolItem{onRender(){X(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();zr(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:s=0,y:r=0}=t;const{offset:i,useCellGeometry:o,rotate:a}=t;let c=Eb(e,o);const u=e.cell.getAngle();a||(c=c.bbox(u));let d=0,f=0;typeof i=="number"?(d=i,f=i):typeof i=="object"&&(d=i.x,f=i.y),s=dn(s,c.width),r=dn(r,c.height);let h=it().translate(c.x+c.width/2,c.y+c.height/2);return a&&(h=h.rotate(u)),h=h.translate(s+d-c.width/2,r+f-c.height/2),h}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:s=0,distance:r=0,rotate:i}=t;let o,a,c;const u=dn(r,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,c=o.vector().vectorAngle(new O(1,0))||0):(a=e.getConnection().start,c=0);let d=it().translate(a.x,a.y).rotate(c);return typeof s=="object"?d=d.translate(s.x||0,s.y||0):d=d.translate(0,s),i||(d=d.rotate(-c)),d}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&ee(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Ms||(Ms={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(Ms||(Ms={}));var CI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ol extends Xe.ToolItem{onRender(){if(X(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,s=CI(e,["class"]);fe(this.container,Qi(s)),t&&X(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:s,rotate:r}=t,i=ps(t.padding);let o=Eb(e,s).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const a=e.cell;if(a.isNode()){const c=a.getAngle();if(c)if(r){const u=a.getBBox().getCenter();Zu(this.container,c,u.x,u.y,{absolute:!0})}else o=o.bbox(c)}return fe(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(ol||(ol={}));class ho extends Xe.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.options.createHandle,o=this.options.processHandle,a=i({index:t,graph:this.graph,guard:c=>this.guard(c),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(r.x,r.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.handles[t];i&&i.updatePosition(r.x,r.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,s=this.vertices,r=e>0?s[e-1]:t.sourceAnchor,i=e<s.length-1?s[e+1]:t.targetAnchor;return{prev:O.create(r),next:O.create(i)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:s,y:r}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:s,y:r}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:s,x:r,y:i}=this.getMouseEventArgs(e);this.eventData(s,{start:{x:r,y:i}}),t.notifyMouseDown(s,r,i)}}onHandleChanging({handle:e,e:t}){const s=this.cellView,r=e.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(t),c={x:o,y:a};this.snapVertex(c,r),s.cell.setVertexAt(r,c,{ui:!0,toolId:this.cid}),e.updatePosition(c.x,c.y),this.options.stopPropagation||s.notifyMouseMove(i,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,s=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}s.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:i,x:o,y:a}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){s.notifyMouseUp(i,o,a);const{start:c}=this.eventData(i);if(c){const{x:u,y:d}=c;u===o&&d===a&&s.onClick(i,o,a)}}s.checkMouseleave(i),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}snapVertex(e,t){const s=this.options.snapRadius||0;if(s>0){const r=this.getNeighborPoints(t),i=r.prev,o=r.next;Math.abs(e.x-i.x)<s?e.x=i.x:Math.abs(e.x-o.x)<s&&(e.x=o.x),Math.abs(e.y-i.y)<s?e.y=r.prev.y:Math.abs(e.y-o.y)<s&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const s=e.options.index,r=this.cellView;r.cell.removeVertexAt(s,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),s=this.options.addable&&this.cellView.can("vertexAddable"),r=this.options.modifiers?bs.isMatch(e,this.options.modifiers):!0;return!t&&s&&r}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=t.getVertexIndex(r.x,r.y);this.snapVertex(r,i),t.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[i];this.eventData(s,{vertexAdded:!0}),o.onMouseDown(s)}onRemove(){this.resetHandles()}}(function(n){class e extends be{get graph(){return this.options.graph}constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=be.createElement("circle",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(s,r){this.setAttrs({cx:s,cy:r})}onMouseDown(s){this.options.guard(s)||(s.stopPropagation(),s.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data),this.emit("change",{e:s,handle:this}))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(s){this.emit("remove",{e:s,handle:this})}}n.Handle=e})(ho||(ho={})),function(n){const e=Yt.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(ho||(ho={}));class fo extends Xe.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){X(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let s=0,r=t.length;s<r-1;s+=1){const i=t[s],o=t[s+1],a=this.renderHandle(i,o,s);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,s){const r=this.options.createHandle({index:s,graph:this.graph,guard:i=>this.guard(i),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(r),this.updateHandle(r,e,t),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let s=0,r=t.length;s<r;s+=1)t[s].options.index+=e}resetAnchor(e,t){const s=this.cellView.cell,r={ui:!0,toolId:this.cid};t?s.prop([e,"anchor"],t,r):s.removeProp([e,"anchor"],r)}snapHandle(e,t,s){const r=e.options.axis,i=e.options.index,c=this.cellView.cell.getVertices(),u=c[i-2]||s.sourceAnchor,d=c[i+1]||s.targetAnchor,f=this.options.snapRadius;return Math.abs(t[r]-u[r])<f?t[r]=u[r]:Math.abs(t[r]-d[r])<f&&(t[r]=d[r]),t}onHandleChanging({handle:e,e:t}){const s=this.graph,r=this.options,i=this.cellView,o=r.anchor,a=e.options.axis,c=e.options.index-1,u=this.getEventData(t),d=this.normalizeEvent(t),f=s.snapToGrid(d.clientX,d.clientY),h=this.snapHandle(e,f.clone(),u),p=_e(this.vertices);let g=p[c],m=p[c+1];const y=i.sourceView,b=i.sourceBBox;let w=!1,x=!1;if(g?c===0?b.containsPoint(g)?(p.shift(),this.shiftHandleIndexes(-1),w=!0):(g[a]=h[a],x=!0):g[a]=h[a]:(g=i.sourceAnchor.toJSON(),g[a]=h[a],b.containsPoint(g)?w=!0:(p.unshift(g),this.shiftHandleIndexes(1),x=!0)),typeof o=="function"&&y){if(w){const P=u.sourceAnchor.clone();P[a]=h[a];const A=ee(o,i,P,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",A)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const v=i.targetView,S=i.targetBBox;let E=!1,C=!1;if(m?c===p.length-2?S.containsPoint(m)?(p.pop(),E=!0):(m[a]=h[a],C=!0):m[a]=h[a]:(m=i.targetAnchor.toJSON(),m[a]=h[a],S.containsPoint(m)?E=!0:(p.push(m),C=!0)),typeof o=="function"&&v){if(E){const P=u.targetAnchor.clone();P[a]=h[a];const A=ee(o,i,P,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",A)}C&&this.resetAnchor("target",u.targetAnchorDef)}O.equalPoints(p,this.vertices)||this.cellView.cell.setVertices(p,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,m,0),r.stopPropagation||i.notifyMouseMove(d,f.x,f.y)}onHandleChange({handle:e,e:t}){const s=this.options,r=this.handles,i=this.cellView,o=e.options.index;if(Array.isArray(r)){for(let a=0,c=r.length;a<c;a+=1)a!==o&&r[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:_e(this.cell.prop(["source","anchor"])),targetAnchorDef:_e(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!s.stopPropagation){const a=this.normalizeEvent(t),c=this.graph.snapToGrid(a.clientX,a.clientY);i.notifyMouseDown(a,c.x,c.y)}}}onHandleChanged({e}){const t=this.options,s=this.cellView;t.removeRedundancies&&s.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||s.notifyMouseUp(r,i.x,i.y),s.checkMouseleave(r),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}updateHandle(e,t,s,r=0){const i=this.options.precision||0,o=Math.abs(t.x-s.x)<i,a=Math.abs(t.y-s.y)<i;if(o||a){const c=new Y(t,s);if(c.length()<this.options.threshold)e.hide();else{const d=c.getCenter(),f=o?"x":"y";d[f]+=r||0;const h=c.vector().vectorAngle(new O(1,0));e.updatePosition(d.x,d.y,h,this.cellView),e.show(),e.options.axis=f}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends be{constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=be.createElement("rect",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(s,r,i,o){const a=o.getClosestPoint(new O(s,r))||new O(s,r);let c=it().translate(a.x,a.y);if(a.equals({x:s,y:r}))c=c.rotate(i);else{let d=new Y(s,r,a.x,a.y).vector().vectorAngle(new O(1,0));d!==0&&(d+=90),c=c.rotate(d)}this.setAttrs({transform:$r(c),cursor:i%180===0?"row-resize":"col-resize"})}onMouseDown(s){this.options.guard(s)||(this.trigger("change",{e:s,handle:this}),s.stopPropagation(),s.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=e})(fo||(fo={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new n.Handle(e),anchor:Sb})}(fo||(fo={}));class al extends Xe.ToolItem{get type(){return this.options.type}onRender(){X(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const s=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(s),a=r.cell.prop([s,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const c=a?i.customAnchorAttrs:i.defaultAnchorAttrs;c&&Object.keys(c).forEach(u=>{t.setAttribute(u,c[u])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const s=this.type,r=this.cellView,i=r.getTerminalView(s);if(i){const o=i.cell,a=r.getTerminalMagnet(s);let c=this.options.areaPadding||0;Number.isFinite(c)||(c=0);let u,d,f;i.isEdgeElement(a)?(u=i.getBBox(),d=0,f=u.getCenter()):(u=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),f=u.getCenter(),d&&f.rotate(-d,o.getBBox().getCenter())),u.inflate(c),fe(t,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${f.x}, ${f.y}) rotate(${d})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(e){const t=this.type,s=this.cell;e?s.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):s.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,s=this.cellView,r=s.getTerminalView(t);if(r==null)return;const i=this.normalizeEvent(e),o=r.cell,a=s.getTerminalMagnet(t);let c=this.graph.coord.clientToLocalPoint(i.clientX,i.clientY);const u=this.options.snap;if(typeof u=="function"){const h=ee(u,s,c,r,a,t,s,this);c=O.create(h)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const h=r.getClosestPoint(c);h&&(c=h)}else{const h=r.getUnrotatedBBoxOfElement(a),p=o.getAngle(),g=o.getBBox().getCenter(),m=c.clone().rotate(p,g);h.containsPoint(m)||(c=h.getNearestPointToPoint(m).rotate(-p,g))}let d;const f=this.options.anchor;typeof f=="function"&&(d=ee(f,s,c,r,a,t,s,this)),this.resetAnchor(d),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:Sb,snap(e,t,s,r,i,o){const a=o.options.snapRadius||0,c=r==="source",u=c?0:-1,d=this.cell.getVertexAt(u)||this.getTerminalAnchor(c?"target":"source");return d&&(Math.abs(d.x-e.x)<a&&(e.x=d.x),Math.abs(d.y-e.y)<a&&(e.y=d.y)),e}})})(al||(al={}));const SI=al.define({name:"source-anchor",type:"source"}),EI=al.define({name:"target-anchor",type:"target"});var OI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ll extends Xe.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,s=OI(e,["class"]);this.setAttrs(s,this.container),t&&X(this.container,t)}}onRender(){X(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,s=t.getTangentAtRatio(e),r=s?s.start:t.getPointAtRatio(e),i=s&&s.vector().vectorAngle(new O(1,0))||0;if(!r)return this;const o=it().translate(r.x,r.y).rotate(i);return zr(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const s=this.graph.snapToGrid(e.clientX,e.clientY),r=t.prepareArrowheadDragging(this.type,{x:s.x,y:s.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,r),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,s.x,s.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.cellView,r=this.graph.snapToGrid(t.clientX,t.clientY);s.onMouseUp(t,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",s.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(ll||(ll={}));const MI=ll.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),PI=ll.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Jr extends Xe.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Xe.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:e,editor:t}=this;if(!t)return;const{style:s}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();const{attrs:r}=this.options;s.fontSize=`${r.fontSize}px`,s.fontFamily=r.fontFamily,s.color=r.color,s.backgroundColor=r.backgroundColor;const i=this.getCellText()||"";return t.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:s}=this;if(!s)return;let r=O.create(),i=20,o="",{x:a,y:c}=this.options;const{width:u,height:d}=this.options;if(typeof a<"u"&&typeof c<"u"){const p=t.getBBox();a=dn(a,p.width),c=dn(c,p.height),r=p.topLeft.translate(a,c),i=p.width-a*2}else{const p=t.getBBox();r=p.center,i=p.width-4,o="translate(-50%, -50%)"}const f=e.scale(),{style:h}=s;r=e.localToGraph(r),h.left=`${r.x}px`,h.top=`${r.y}px`,h.transform=`scale(${f.sx}, ${f.sy}) ${o}`,h.minWidth=`${i}px`,typeof u=="number"&&(h.width=`${u}px`),typeof d=="number"&&(h.height=`${d}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let s=O.create(),r=20;const{style:i}=t,o=this.event.target,a=o.parentElement;if(a&&Pn(a,this.prefixClassName("edge-label"))){const d=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(d,10);const f=a.getAttribute("transform"),{translation:h}=Qa(f);s=new O(h.tx,h.ty),r=Se.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=e.clientToLocal(O.create(this.event.clientX,this.event.clientY));const f=this.cellView.path.closestPointLength(s);this.distance=f,this.labelIndex=-1}s=e.localToGraph(s);const u=e.scale();i.left=`${s.x}px`,i.top=`${s.y}px`,i.minWidth=`${r}px`,i.transform=`scale(${u.sx}, ${u.sy}) translate(-50%, -50%)`}onDocumentMouseUp(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){this.editor||(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return ee(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){ee(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const s=this.cell;if(this.labelIndex===-1){if(e){const r={position:{distance:this.distance},attrs:{}};Ir(r,`attrs/${t}`,e),s.appendLabel(r)}}else e!==null?s.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&s.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})})(Jr||(Jr={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(Jr||(Jr={}));var Ob=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},Xr;(function(n){n.presets={boundary:ol,button:Ms,"button-remove":Ms.Remove,"node-editor":Jr.NodeEditor},n.registry=Fe.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let s=Xe.ToolItem;const{inherit:r}=t,i=Ob(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(Xr||(Xr={}));var Kr;(function(n){n.presets={boundary:ol,vertices:ho,segments:fo,button:Ms,"button-remove":Ms.Remove,"source-anchor":SI,"target-anchor":EI,"source-arrowhead":MI,"target-arrowhead":PI,"edge-editor":Jr.EdgeEditor},n.registry=Fe.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let s=Xe.ToolItem;const{inherit:r}=t,i=Ob(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(Kr||(Kr={}));const NI=Kn("center"),AI=Kn("topCenter"),_I=Kn("bottomCenter"),TI=Kn("leftMiddle"),kI=Kn("rightMiddle"),VI=Kn("topLeft"),DI=Kn("topRight"),RI=Kn("bottomLeft"),LI=Kn("bottomRight");function Kn(n){return function(e,t,s,r={}){const i=r.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=i[n];o.x+=dn(r.dx,i.width),o.y+=dn(r.dy,i.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function cl(n){return function(e,t,s,r){if(s instanceof Element){const i=this.graph.findViewByElem(s);let o;if(i)if(i.isEdgeElement(s)){const a=r.fixedAt!=null?r.fixedAt:"50%";o=Mb(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new O;return n.call(this,e,t,o,r)}return n.apply(this,arguments)}}function Mb(n,e){const t=qn(e),s=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const II=cl(function(n,e,t,s){const r=ye.normalize(n.cell.getAngle()),i=n.getBBoxOfElement(e),o=i.getCenter(),a=i.getTopLeft(),c=i.getBottomRight();let u=s.padding;if(Number.isFinite(u)||(u=0),a.y+u<=t.y&&t.y<=c.y-u){const d=t.y-o.y;o.x+=r===0||r===180?0:d*1/Math.tan(ye.toRad(r)),o.y+=d}else if(a.x+u<=t.x&&t.x<=c.x-u){const d=t.x-o.x;o.y+=r===90||r===270?0:d*Math.tan(ye.toRad(r)),o.x+=d}return o}),BI=function(n,e,t,s,r){const i=n.cell.getConnectionPoint(this.cell,r);return(s.dx||s.dy)&&i.translate(s.dx||0,s.dy||0),i},jI=cl(function(n,e,t,s){let r,i=0,o;const a=n.cell;s.rotate?(r=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),i=a.getAngle()):r=n.getBBoxOfElement(e);const c=s.padding;c!=null&&Number.isFinite(c)&&r.inflate(c),s.rotate&&t.rotate(i,o);const u=r.getNearestSideToPoint(t);let d;switch(u){case"left":d=r.getLeftMiddle();break;case"right":d=r.getRightMiddle();break;case"top":d=r.getTopCenter();break;case"bottom":d=r.getBottomCenter();break}const f=s.direction;return f==="H"?(u==="top"||u==="bottom")&&(t.x<=r.x+r.width?d=r.getLeftMiddle():d=r.getRightMiddle()):f==="V"&&(t.y<=r.y+r.height?d=r.getTopCenter():d=r.getBottomCenter()),s.rotate?d.rotate(-i,o):d}),$I=Object.freeze(Object.defineProperty({__proto__:null,bottom:_I,bottomLeft:RI,bottomRight:LI,center:NI,left:TI,midSide:jI,nodeCenter:BI,orth:II,right:kI,top:AI,topLeft:VI,topRight:DI},Symbol.toStringTag,{value:"Module"}));var Zr;(function(n){n.presets=$I,n.registry=Fe.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(Zr||(Zr={}));const zI=function(n,e,t,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},FI=function(n,e,t,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},Pb=function(n,e,t,s){const r=n.getClosestPoint(t);return r??new O},UI=cl(Pb),HI=cl(function(n,e,t,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new Y(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),c=new Y(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),u=a.intersect(i,{segmentSubdivisions:o}),d=c.intersect(i,{segmentSubdivisions:o}),f=[];return u&&f.push(...u),d&&f.push(...d),f.length>0?t.closest(f):s.fallbackAt!=null?Mb(n,s.fallbackAt):ee(Pb,this,n,e,t,s)}),GI=Object.freeze(Object.defineProperty({__proto__:null,closest:UI,length:FI,orth:HI,ratio:zI},Symbol.toStringTag,{value:"Module"}));var Qr;(function(n){n.presets=GI,n.registry=Fe.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(Qr||(Qr={}));function ul(n,e,t){let s;if(typeof t=="object"){if(Number.isFinite(t.y)){const i=new Y(e,n),{start:o,end:a}=i.parallel(t.y);e=o,n=a}s=t.x}else s=t;if(s==null||!Number.isFinite(s))return n;const r=n.distance(e);return s===0&&r>0?n:n.move(e,-Math.min(s,r-1))}function dl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function WI(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const Nb=function(n,e,t,s){const r=e.getBBoxOfElement(t);s.stroked&&r.inflate(dl(t)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return ul(o,n.start,s.offset)},YI=function(n,e,t,s,r){const i=e.cell,o=i.isNode()?i.getAngle():0;if(o===0)return ee(Nb,this,n,e,t,s,r);const a=e.getUnrotatedBBoxOfElement(t);s.stroked&&a.inflate(dl(t)/2);const c=a.getCenter(),u=n.clone().rotate(o,c),d=u.setLength(1e6).intersect(a),f=d&&d.length?u.start.closest(d).rotate(-o,c):n.end;return ul(f,n.start,s.offset)},qI=function(n,e,t,s){let r,i;const o=n.end,a=s.selector;if(typeof a=="string"?r=e.findOne(a):Array.isArray(a)?r=Ru(t,a):r=WI(t),!ms(r)){if(r===t||!ms(t))return o;r=t}const c=e.getShapeOfElement(r),u=e.getMatrixOfElement(r),d=e.getRootTranslatedMatrix(),f=e.getRootRotatedMatrix(),h=d.multiply(f).multiply(u),p=h.inverse(),g=Se.transformLine(n,p),m=g.start.clone(),y=e.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=c.bbox());const v=y.shapeBBox;if(v!=null&&v.containsPoint(m))return o}s.extrapolate===!0&&g.setLength(1e6);let b;if(ne.isPath(c)){const v=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:v})),b={precision:v,segmentSubdivisions:y.segmentSubdivisions},i=g.intersect(c,b)}else i=g.intersect(c);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(F.isRectangle(c)?i=c.getNearestPointToPoint(m):pn.isEllipse(c)?i=c.intersectsWithLineFromCenterToPoint(m):i=c.closestPoint(m,b));const w=i?Se.transformPoint(i,h):o;let x=s.offset||0;return s.stroked!==!1&&(typeof x=="object"?(x=Object.assign({},x),x.x==null&&(x.x=0),x.x+=dl(r)/2):x+=dl(r)/2),ul(w,n.start,x)};function JI(n,e,t=0){const{start:s,end:r}=n;let i,o,a,c;switch(e){case"left":c="x",i=r,o=s,a=-1;break;case"right":c="x",i=s,o=r,a=1;break;case"top":c="y",i=r,o=s,a=-1;break;case"bottom":c="y",i=s,o=r,a=1;break;default:return}s[c]<r[c]?i[c]=o[c]:o[c]=i[c],Number.isFinite(t)&&(i[c]+=a*t,o[c]+=a*t)}const XI=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,s){const{alignOffset:r,align:i}=s;return i&&JI(n,i,r),ul(n.end,n.start,s.offset)},bbox:Nb,boundary:qI,rect:YI},Symbol.toStringTag,{value:"Module"}));var ei;(function(n){n.presets=XI,n.registry=Fe.create({type:"connection point"}),n.registry.register(n.presets,!0)})(ei||(ei={}));const KI=function(n){return[...n]},ZI=function(n,e,t){const s=e.side||"bottom",r=ps(e.padding||40),i=t.sourceBBox,o=t.targetBBox,a=i.getCenter(),c=o.getCenter();let u,d,f;switch(s){case"top":f=-1,u="y",d="height";break;case"left":f=-1,u="x",d="width";break;case"right":f=1,u="x",d="width";break;case"bottom":default:f=1,u="y",d="height";break}return a[u]+=f*(i[d]/2+r[s]),c[u]+=f*(o[d]/2+r[s]),f*(a[u]-c[u])>0?c[u]=a[u]:a[u]=c[u],[a.toJSON(),...n,c.toJSON()]};function hl(n){return new F(n.x,n.y,0,0)}function fl(n={}){const e=ps(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Ab(n,e={}){return n.sourceBBox.clone().moveAndExpand(fl(e))}function _b(n,e={}){return n.targetBBox.clone().moveAndExpand(fl(e))}function QI(n,e={}){return n.sourceAnchor?n.sourceAnchor:Ab(n,e).getCenter()}function eB(n,e={}){return n.targetAnchor?n.targetAnchor:_b(n,e).getCenter()}const Tb=function(n,e,t){let s=Ab(t,e),r=_b(t,e);const i=QI(t,e),o=eB(t,e);s=s.union(hl(i)),r=r.union(hl(o));const a=n.map(d=>O.create(d));a.unshift(i),a.push(o);let c=null;const u=[];for(let d=0,f=a.length-1;d<f;d+=1){let h=null;const p=a[d],g=a[d+1],m=qt.getBearing(p,g)!=null;if(d===0)d+1===f?s.intersectsWithRect(r.clone().inflate(1))?h=qt.insideNode(p,g,s,r):m||(h=qt.nodeToNode(p,g,s,r)):s.containsPoint(g)?h=qt.insideNode(p,g,s,hl(g).moveAndExpand(fl(e))):m||(h=qt.nodeToVertex(p,g,s));else if(d+1===f){const y=m&&qt.getBearing(g,p)===c;r.containsPoint(p)||y?h=qt.insideNode(p,g,hl(p).moveAndExpand(fl(e)),r,c):m||(h=qt.vertexToNode(p,g,r,c))}else m||(h=qt.vertexToVertex(p,g,c));h?(u.push(...h.points),c=h.direction):c=qt.getBearing(p,g),d+1<f&&u.push(g)}return u};var qt;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function s(f,h,p){let g=new O(f.x,h.y);return p.containsPoint(g)&&(g=new O(h.x,f.y)),g}function r(f,h){return f[h==="W"||h==="E"?"width":"height"]}n.getBBoxSize=r;function i(f,h){return f.x===h.x?f.y>h.y?"N":"S":f.y===h.y?f.x>h.x?"W":"E":null}n.getBearing=i;function o(f,h,p){const g=new O(f.x,h.y),m=new O(h.x,f.y),y=i(f,g),b=i(f,m),w=p?e[p]:null,x=y===p||y!==w&&(b===w||b!==p)?g:m;return{points:[x],direction:i(x,h)}}n.vertexToVertex=o;function a(f,h,p){const g=s(f,h,p);return{points:[g],direction:i(g,h)}}n.nodeToVertex=a;function c(f,h,p,g){const m=[new O(f.x,h.y),new O(h.x,f.y)],y=m.filter(x=>!p.containsPoint(x)),b=y.filter(x=>i(x,f)!==g);let w;if(b.length>0)return w=b.filter(x=>i(f,x)===g).pop(),w=w||b[0],{points:[w],direction:i(w,h)};{w=hP(m,y)[0];const x=O.create(h).move(w,-r(p,g)/2);return{points:[s(x,f,p),x],direction:i(x,h)}}}n.vertexToNode=c;function u(f,h,p,g){let m=a(h,f,g);const y=m.points[0];if(p.containsPoint(y)){m=a(f,h,p);const b=m.points[0];if(g.containsPoint(b)){const w=O.create(f).move(b,-r(p,i(f,b))/2),x=O.create(h).move(y,-r(g,i(h,y))/2),v=new Y(w,x).getCenter(),S=a(f,v,p),E=o(v,h,S.direction);m.points=[S.points[0],E.points[0]],m.direction=E.direction}}return m}n.nodeToNode=u;function d(f,h,p,g,m){const y=p.union(g).inflate(1),b=y.getCenter(),w=b.distance(h)>b.distance(f),x=w?h:f,v=w?f:h;let S,E,C;m?(S=O.fromPolar(y.width+y.height,t[m],x),S=y.getNearestPointToPoint(S).move(S,-1)):S=y.getNearestPointToPoint(x).move(x,1),E=s(S,v,y);let P;S.round().equals(E.round())?(E=O.fromPolar(y.width+y.height,ye.toRad(S.theta(x))+Math.PI/2,v),E=y.getNearestPointToPoint(E).move(v,1).round(),C=s(S,E,y),P=w?[E,C,S]:[S,C,E]):P=w?[E,S]:[S,E];const A=i(w?S:E,h);return{points:P,direction:A}}n.insideNode=d})(qt||(qt={}));const tB={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Ps(this.step,this)},directions(){const n=Ps(this.step,this),e=Ps(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=Ps(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Ps(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Tb,draggingRouter:null,snapToGrid:!0};function Ps(n,e){return typeof n=="function"?n.call(e):n}function nB(n){const e=Object.keys(n).reduce((t,s)=>{const r=t;return s==="fallbackRouter"||s==="draggingRouter"||s==="fallbackRoute"?r[s]=n[s]:r[s]=Ps(n[s],n),t},{});if(e.padding){const t=ps(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const s=new O(0,0),r=new O(t.offsetX,t.offsetY);t.angle=ye.normalize(s.theta(r))}),e}const kb=1,Vb=2;class sB{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=kb,this.values[e]=t;const s=HP(this.items,e,r=>this.values[r]);this.items.splice(s,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Vb),e}isOpen(e){return this.hash[e]===kb}isClose(e){return this.hash[e]===Vb}isEmpty(){return this.items.length===0}}class rB{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const s=this.options,r=s.excludeTerminals.reduce((u,d)=>{const f=t[d];if(f){const h=e.getCell(f.cell);h&&u.push(h)}return u},[]);let i=[];const o=e.getCell(t.getSourceCellId());o&&(i=Ep(i,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(i=Ep(i,a.getAncestors().map(u=>u.id)));const c=this.mapGridSize;return e.getNodes().reduce((u,d)=>{const f=r.some(y=>y.id===d.id),h=d.shape?s.excludeShapes.includes(d.shape):!1,p=s.excludeNodes.some(y=>typeof y=="string"?d.id===y:y===d),g=i.includes(d.id),m=h||f||p||g;if(d.isVisible()&&!m){const y=d.getBBox().moveAndExpand(s.paddingBox),b=y.getOrigin().snapToGrid(c),w=y.getCorner().snapToGrid(c);for(let x=b.x;x<=w.x;x+=c)for(let v=b.y;v<=w.y;v+=c){const S=new O(x,v).toString();u[S]==null&&(u[S]=[]),u[S].push(y)}}return u},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),s=this.map[t];return s?s.every(r=>!r.containsPoint(e)):!0}}function Db(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Rb(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Lb(n,e){return n.sourceAnchor?n.sourceAnchor:Db(n,e).getCenter()}function iB(n,e){return n.targetAnchor?n.targetAnchor:Rb(n,e).getCenter()}function dd(n,e,t,s,r){const i=360/t,o=n.theta(oB(n,e,s,r)),a=ye.normalize(o+i/2);return i*Math.floor(a/i)}function oB(n,e,t,s){const r=s.step,i=e.x-n.x,o=e.y-n.y,a=i/t.x,c=o/t.y,u=a*r,d=c*r;return new O(n.x+u,n.y+d)}function Ib(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function aB(n,e){const t=e.step;return e.directions.forEach(s=>{s.gridOffsetX=s.offsetX/t*n.x,s.gridOffsetY=s.offsetY/t*n.y}),e.directions}function lB(n,e,t){return{source:e.clone(),x:Bb(t.x-e.x,n),y:Bb(t.y-e.y,n)}}function Bb(n,e){if(!n)return e;const t=Math.abs(n),s=Math.round(t/e);if(!s)return t;const r=s*e,o=(t-r)/s;return e+o}function cB(n,e){const t=e.source,s=Ce.snapToGrid(n.x-t.x,e.x)+t.x,r=Ce.snapToGrid(n.y-t.y,e.y)+t.y;return new O(s,r)}function po(n,e){return n.round(e)}function pl(n,e,t){return po(cB(n.clone(),e),t)}function go(n){return n.toString()}function hd(n){return new O(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function jb(n,e){let t=1/0;for(let s=0,r=e.length;s<r;s+=1){const i=n.manhattanDistance(e[s]);i<t&&(t=i)}return t}function $b(n,e,t,s,r){const i=r.precision,o=r.directionMap,a=n.diff(e.getCenter()),c=Object.keys(o).reduce((u,d)=>{if(t.includes(d)){const f=o[d],h=new O(n.x+f.x*(Math.abs(a.x)+e.width),n.y+f.y*(Math.abs(a.y)+e.height)),g=new Y(n,h).intersect(e)||[];let m,y=null;for(let b=0;b<g.length;b+=1){const w=g[b],x=n.squaredDistance(w);(m==null||x>m)&&(m=x,y=w)}if(y){let b=pl(y,s,i);e.containsPoint(b)&&(b=pl(b.translate(f.x*s.x,f.y*s.y),s,i)),u.push(b)}}return u},[]);return e.containsPoint(n)||c.push(pl(n,s,i)),c}function uB(n,e,t,s,r){const i=[];let o=hd(r.diff(t)),a=go(t),c=n[a],u;for(;c;){u=e[a];const h=hd(u.diff(c));h.equals(o)||(i.unshift(u),o=h),a=go(c),c=n[a]}const d=e[a];return hd(d.diff(s)).equals(o)||i.unshift(d),i}function dB(n,e,t,s,r){const i=r.precision;let o,a;F.isRectangle(e)?o=po(Lb(n,r).clone(),i):o=po(e.clone(),i),F.isRectangle(t)?a=po(iB(n,r).clone(),i):a=po(t.clone(),i);const c=lB(r.step,o,a),u=o,d=a;let f,h;if(F.isRectangle(e)?f=$b(u,e,r.startDirections,c,r):f=[u],F.isRectangle(t)?h=$b(a,t,r.endDirections,c,r):h=[d],f=f.filter(p=>s.isAccessible(p)),h=h.filter(p=>s.isAccessible(p)),f.length>0&&h.length>0){const p=new sB,g={},m={},y={};for(let T=0,k=f.length;T<k;T+=1){const V=f[T],R=go(V);p.add(R,jb(V,h)),g[R]=V,y[R]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,v;const S=aB(c,r),E=S.length,C=h.reduce((T,k)=>{const V=go(k);return T.push(V),T},[]),P=O.equalPoints(f,h);let A=r.maxLoopCount;for(;!p.isEmpty()&&A>0;){const T=p.pop(),k=g[T],V=m[T],R=y[T],j=k.equals(u),N=V==null;let M;if(N?w?j?M=null:M=dd(u,k,E,c,r):M=b:M=dd(V,k,E,c,r),!(N&&P)&&C.indexOf(T)>=0)return r.previousDirectionAngle=M,uB(m,g,k,u,d);for(let B=0;B<E;B+=1){x=S[B];const G=x.angle;if(v=Ib(M,G),!(w&&j)&&v>r.maxDirectionChange)continue;const se=pl(k.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),c,i),I=go(se);if(p.isClose(I)||!s.isAccessible(se))continue;if(C.indexOf(I)>=0&&!se.equals(d)){const re=dd(se,d,E,c,r);if(Ib(G,re)>r.maxDirectionChange)continue}const _=x.cost,H=j?0:r.penalties[v],K=R+_+H;(!p.isOpen(I)||K<y[I])&&(g[I]=se,m[I]=k,y[I]=K,p.add(I,K+jb(se,h)))}A-=1}}return r.fallbackRoute?ee(r.fallbackRoute,this,u,d,r):null}function hB(n,e=10){if(n.length<=1)return n;for(let t=0,s=n.length;t<s-1;t+=1){const r=n[t],i=n[t+1];if(r.x===i.x){const o=e*Math.round(r.x/e);r.x!==o&&(r.x=o,i.x=o)}else if(r.y===i.y){const o=e*Math.round(r.y/e);r.y!==o&&(r.y=o,i.y=o)}}return n}const fB=function(n,e,t){const s=nB(e),r=Db(t,s),i=Rb(t,s),o=Lb(t,s),a=new rB(s).build(t.graph.model,t.cell),c=n.map(p=>O.create(p)),u=[];let d=o,f,h;for(let p=0,g=c.length;p<=g;p+=1){let m=null;if(f=h||r,h=c[p],h==null){h=i;const b=t.cell;if((b.getSourceCellId()==null||b.getTargetCellId()==null)&&typeof s.draggingRouter=="function"){const x=f===r?o:f,v=h.getOrigin();m=ee(s.draggingRouter,t,x,v,s)}}if(m==null&&(m=dB(t,f,h,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),ee(s.fallbackRouter,this,n,s,t);const y=m[0];y&&y.equals(d)&&m.shift(),d=m[m.length-1]||d,u.push(...m)}return s.snapToGrid?hB(u,t.graph.grid.getGridSize()):u},zb=function(n,e,t){return ee(fB,this,n,Object.assign(Object.assign({},tB),e),t)},pB={maxDirectionChange:45,directions(){const n=Ps(this.step,this),e=Ps(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const s=n.theta(e),r=[];let i={x:e.x,y:n.y},o={x:n.x,y:e.y};if(s%180>90){const x=i;i=o,o=x}const a=s%90<45?i:o,c=new Y(n,a),u=90*Math.ceil(s/90),d=O.fromPolar(c.squaredLength(),ye.toRad(u+135),a),f=new Y(e,d),h=c.intersectsWithLine(f),p=h||e,g=h?p:n,m=360/t.directions.length,y=g.theta(e),b=ye.normalize(y+m/2),w=m*Math.floor(b/m);return t.previousDirectionAngle=w,p&&r.push(p.round()),r.push(e),r}},gB=function(n,e,t){return ee(zb,this,n,Object.assign(Object.assign({},pB),e),t)},mB=function(n,e,t){const s=e.offset||32,r=e.min==null?16:e.min;let i=0,o=e.direction;const a=t.sourceBBox,c=t.targetBBox,u=a.getCenter(),d=c.getCenter();if(typeof s=="number"&&(i=s),o==null){let b=c.left-a.right,w=c.top-a.bottom;b>=0&&w>=0?o=b>=w?"L":"T":b<=0&&w>=0?(b=a.left-c.right,b>=0?o=b>=w?"R":"T":o="T"):b>=0&&w<=0?(w=a.top-c.bottom,w>=0?o=b>=w?"L":"B":o="L"):(b=a.left-c.right,w=a.top-c.bottom,b>=0&&w>=0?o=b>=w?"R":"B":b<=0&&w>=0?o="B":b>=0&&w<=0?o="R":o=Math.abs(b)>Math.abs(w)?"R":"B")}o==="H"?o=d.x-u.x>=0?"L":"R":o==="V"&&(o=d.y-u.y>=0?"T":"B"),s==="center"&&(o==="L"?i=(c.left-a.right)/2:o==="R"?i=(a.left-c.right)/2:o==="T"?i=(c.top-a.bottom)/2:o==="B"&&(i=(a.top-c.bottom)/2));let f,h,p;const g=o==="L"||o==="R";if(g){if(d.y===u.y)return[...n];p=o==="L"?1:-1,f="x",h="width"}else{if(d.x===u.x)return[...n];p=o==="T"?1:-1,f="y",h="height"}const m=u.clone(),y=d.clone();if(m[f]+=p*(a[h]/2+i),y[f]-=p*(c[h]/2+i),g){const b=m.x,w=y.x,x=a.width/2+r,v=c.width/2+r;d.x>u.x?w<=b&&(m.x=Math.max(w,u.x+x),y.x=Math.min(b,d.x-v)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,d.x+v))}else{const b=m.y,w=y.y,x=a.height/2+r,v=c.height/2+r;d.y>u.y?w<=b&&(m.y=Math.max(w,u.y+x),y.y=Math.min(b,d.y-v)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,d.y+v))}return[m.toJSON(),...n,y.toJSON()]};function ti(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const s=O.create(n[1]).move(n[2],t),r=O.create(n[1]).move(n[0],t);return[s.toJSON(),...n,r.toJSON()]}{const s=n[1];return[Object.assign({},s),...n,Object.assign({},s)]}}return n}const yB=Object.freeze(Object.defineProperty({__proto__:null,er:mB,loop:function(n,e,t){const s=e.width||50,i=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,c=t.targetAnchor,u=t.sourceBBox,d=t.targetBBox;if(a.equals(c)){const f=b=>{const w=ye.toRad(b),x=Math.sin(w),v=Math.cos(w),S=new O(a.x+v*s,a.y+x*s),E=new O(S.x-v*i,S.y-x*i),C=E.clone().rotate(-90,S),P=E.clone().rotate(90,S);return[C.toJSON(),S.toJSON(),P.toJSON()]},h=b=>{const w=a.clone().move(b,-1),x=new Y(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},p=[0,90,180,270,45,135,225,315];if(typeof o=="number")return ti(f(o),e.merge);const g=u.getCenter();if(g.equals(a))return ti(f(0),e.merge);const m=g.angleBetween(a,g.clone().translate(1,0));let y=f(m);if(h(y[1]))return ti(y,e.merge);for(let b=1,w=p.length;b<w;b+=1)if(y=f(m+p[b]),h(y[1]))return ti(y,e.merge);return ti(y,e.merge)}{const f=new Y(a,c);let h=f.parallel(-s),p=h.getCenter(),g=h.start.clone().move(h.end,i),m=h.end.clone().move(h.start,i);const y=f.parallel(-1),b=new Y(y.start,p),w=new Y(y.end,p);if((u.containsPoint(p)||d.containsPoint(p)||u.intersectsWithLine(b)||u.intersectsWithLine(w)||d.intersectsWithLine(b)||d.intersectsWithLine(w))&&(h=f.parallel(s),p=h.getCenter(),g=h.start.clone().move(h.end,i),m=h.end.clone().move(h.start,i)),e.merge){const x=new Y(a,c),v=new Y(p,x.center).setLength(Number.MAX_SAFE_INTEGER),S=u.intersectsWithLine(v),E=d.intersectsWithLine(v),C=S?Array.isArray(S)?S:[S]:[];E&&(Array.isArray(E)?C.push(...E):C.push(E));const P=x.center.closest(C);P?(t.sourceAnchor=P.clone(),t.targetAnchor=P.clone()):(t.sourceAnchor=x.center.clone(),t.targetAnchor=x.center.clone())}return ti([g.toJSON(),p.toJSON(),m.toJSON()],e.merge)}},manhattan:zb,metro:gB,normal:KI,oneSide:ZI,orth:Tb},Symbol.toStringTag,{value:"Module"}));var Ns;(function(n){n.presets=yB,n.registry=Fe.create({type:"router"}),n.registry.register(n.presets,!0)})(Ns||(Ns={}));const bB=function(n,e,t,s={}){const r=[n,...t,e],i=new ze(r),o=new ne(i);return s.raw?o:o.serialize()},wB=function(n,e,t,s={}){const r=t.length===3?0:1,i=O.create(t[0+r]),o=O.create(t[2+r]),a=O.create(t[1+r]);if(!O.equals(n,e)){const u=new O((n.x+e.x)/2,(n.y+e.y)/2),d=u.angleBetween(O.create(n).rotate(90,u),a);d>1&&(i.rotate(180-d,u),o.rotate(180-d,u),a.rotate(180-d,u))}const c=`
116
116
  M ${n.x} ${n.y}
117
117
  Q ${i.x} ${i.y} ${a.x} ${a.y}
118
118
  Q ${o.x} ${o.y} ${e.x} ${e.y}
119
- `;return s.raw?ee.parse(c):c},lB=function(n,e,t,s={}){const r=new ee;r.appendSegment(ee.createSegment("M",n));const i=1/3,o=2/3,a=s.radius||10;let c,u;for(let d=0,h=t.length;d<h;d+=1){const f=O.create(t[d]),p=t[d-1]||n,g=t[d+1]||e;c=u||f.distance(p)/2,u=f.distance(g)/2;const m=-Math.min(a,c),y=-Math.min(a,u),b=f.clone().move(p,m).round(),w=f.clone().move(g,y).round(),x=new O(i*b.x+o*f.x,o*f.y+i*b.y),v=new O(i*w.x+o*f.x,o*f.y+i*w.y);r.appendSegment(ee.createSegment("L",b)),r.appendSegment(ee.createSegment("C",x,v,w))}return r.appendSegment(ee.createSegment("L",e)),s.raw?r:r.serialize()},cB=function(n,e,t,s={}){let r,i=s.direction;if(t&&t.length!==0){const o=[n,...t,e],a=Ve.throughPoints(o);r=new ee(a)}else if(r=new ee,r.appendSegment(ee.createSegment("M",n)),i||(i=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),i==="H"){const o=(n.x+e.x)/2;r.appendSegment(ee.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;r.appendSegment(ee.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return s.raw?r:r.serialize()},_b=1,ul=1/3,dl=2/3;function uB(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let s=0;s<t.length;s+=1)t[s].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function id(n,e,t=[]){const s=[n,...t,e],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new q(i,a))}),r}function dB(n,e){const t=[];return e.forEach(s=>{const r=n.intersectsWithLine(s);r&&t.push(r)}),t}function kb(n,e){return new q(n,e).squaredLength()}function hB(n,e,t){return e.reduce((s,r,i)=>{if(hl.includes(r))return s;const o=s.pop()||n,a=O.create(r).move(o.start,-t);let c=O.create(r).move(o.start,+t);const u=e[i+1];if(u!=null){const f=c.distance(u);f<=t&&(c=u.move(o.start,f),hl.push(u))}else if(a.distance(o.end)<t*2+_b)return s.push(o),s;if(c.distance(o.start)<t*2+_b)return s.push(o),s;const h=new q(a,c);return fo.push(h),s.push(new q(o.start,a),h,new q(c,o.end)),s},[])}function Db(n,e,t,s){const r=new ee;let i;return i=ee.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(fo.includes(o)){let c,u,d,h;if(t==="arc"){c=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(c+=180);const p=o.getCenter(),g=new q(p,o.end).rotate(c,p);let m;m=new q(o.start,p),d=m.pointAt(2/3).rotate(c,o.start),h=g.pointAt(1/3).rotate(-c,g.end),i=ee.createSegment("C",d,h,g.end),r.appendSegment(i),m=new q(p,o.end),d=g.pointAt(1/3).rotate(c,g.end),h=m.pointAt(1/3).rotate(-c,o.end),i=ee.createSegment("C",d,h,o.end),r.appendSegment(i)}else if(t==="gap")i=ee.createSegment("M",o.end),r.appendSegment(i);else if(t==="cubic"){c=o.start.theta(o.end);const f=e*.6;let p=e*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(p*=-1),d=new O(o.start.x+f,o.start.y+p).rotate(c,o.start),h=new O(o.end.x-f,o.end.y+p).rotate(c,o.end),i=ee.createSegment("C",d,h,o.end),r.appendSegment(i)}}else{const c=n[a+1];s===0||!c||fo.includes(c)?(i=ee.createSegment("L",o.end),r.appendSegment(i)):fB(s,r,o.end,o.start,c.end)}}),r}function fB(n,e,t,s,r){const i=t.distance(s)/2,o=t.distance(r)/2,a=-Math.min(n,i),c=-Math.min(n,o),u=t.clone().move(s,a).round(),d=t.clone().move(r,c).round(),h=new O(ul*u.x+dl*t.x,dl*t.y+ul*u.y),f=new O(ul*d.x+dl*t.x,dl*t.y+ul*d.y);let p;p=ee.createSegment("L",u),e.appendSegment(p),p=ee.createSegment("C",h,f,d),e.appendSegment(p)}let fo,hl;const pB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,s={}){fo=[],hl=[],uB(this);const r=s.size||5,i=s.type||"arc",o=s.radius||0,a=s.ignoreConnectors||["smooth"],c=this.graph,d=c.model.getEdges();if(d.length===1)return Db(id(n,e,t),r,i,o);const h=this.cell,f=d.indexOf(h),p=c.options.connecting.connector||{},g=d.filter((v,S)=>{const E=v.getConnector()||p;return a.includes(E.name)?!1:S>f?E.name!=="jumpover":!0}),m=g.map(v=>c.findViewByCell(v)),y=id(n,e,t),b=m.map(v=>v==null?[]:v===this?y:id(v.sourcePoint,v.targetPoint,v.routePoints)),w=[];y.forEach(v=>{const S=g.reduce((E,C,M)=>{if(C!==h){const N=dB(v,b[M]);E.push(...N)}return E},[]).sort((E,C)=>kb(v.start,E)-kb(v.start,C));S.length>0?w.push(...hB(v,S,r)):w.push(v)});const x=Db(w,r,i,o);return fo=[],hl=[],s.raw?x:x.serialize()},loop:aB,normal:oB,rounded:lB,smooth:cB},Symbol.toStringTag,{value:"Module"}));var nr;(function(n){n.presets=pB,n.registry=ze.create({type:"connector"}),n.registry.register(n.presets,!0)})(nr||(nr={}));var gB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Rb extends Te{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(Ne(e)),this.changed={}}mutate(e,t={}){const s=t.unset===!0,r=t.silent===!0,i=[],o=this.changing;this.changing=!0,o||(this.previous=Ne(this.data),this.changed={});const a=this.data,c=this.previous,u=this.changed;if(Object.keys(e).forEach(d=>{const h=d,f=e[h];xn(a[h],f)||i.push(h),xn(c[h],f)?delete u[h]:u[h]=f,s?delete a[h]:a[h]=f}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=t,i.forEach(d=>{this.emit("change:*",{key:d,options:t,store:this,current:a[d],previous:c[d]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:c,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const s=this.data[e];return s??t}getPrevious(e){if(this.previous){const t=this.previous[e];return t??void 0}}set(e,t,s){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},s)),this}remove(e,t){const r={};let i;if(typeof e=="string")r[e]=void 0,i=t;else if(Array.isArray(e))e.forEach(o=>r[o]=void 0),i=t;else{for(const o in this.data)r[o]=void 0;i=e}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(e){return Pu(this.data,e,"/")}setByPath(e,t,s={}){const r="/",i=Array.isArray(e)?[...e]:e.split(r),o=Array.isArray(e)?e.join(r):e,a=i[0],c=i.length;if(s.propertyPath=o,s.propertyValue=t,s.propertyPathArray=i,c===1)this.set(a,t,s);else{const u={};let d=u,h=a;for(let g=1;g<c;g+=1){const m=i[g],y=Number.isFinite(Number(m));d=d[h]=y?[]:{},h=m}Ir(u,i,t,r);const f=Ne(this.data);s.rewrite&&Fm(f,e,r);const p=Ye(f,u);this.set(a,p[a],s)}return this}removeByPath(e,t){const s=Array.isArray(e)?e:e.split("/"),r=s[0];if(s.length===1)this.remove(r,t);else{const i=s.slice(1),o=Ne(this.get(r));o&&Fm(o,i),this.set(r,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?Ne(this.changed):null;const t=this.changing?this.previous:this.data,s={};let r;for(const i in e){const o=e[i];xn(t[i],o)||(s[i]=o,r=!0)}return r?Ne(s):null}toJSON(){return Ne(this.data)}clone(){const e=this.constructor;return new e(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}gB([Te.dispose()],Rb.prototype,"dispose",null);class po{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,s={},r="/"){const i=this.cell.getPropByPath(e),o=q2(s,po.defaultOptions),a=this.getTiming(o.timing),c=this.getInterp(o.interp,i,t);let u=0;const d=Array.isArray(e)?e.join(r):e,h=Array.isArray(e)?e:e.split(r),f=()=>{const p=new Date().getTime();u===0&&(u=p);let m=(p-u)/o.duration;m<1?this.ids[d]=requestAnimationFrame(f):m=1;const y=c(a(m));this.cell.setPropByPath(h,y),s.progress&&s.progress(Object.assign({progress:m,currentValue:y},this.getArgs(d))),m===1&&(this.cell.notify("transition:complete",this.getArgs(d)),s.complete&&s.complete(this.getArgs(d)),this.cell.notify("transition:finish",this.getArgs(d)),s.finish&&s.finish(this.getArgs(d)),this.clean(d))};return setTimeout(()=>{this.stop(e,void 0,r),this.cache[d]={startValue:i,targetValue:t,options:o},this.ids[d]=requestAnimationFrame(f),this.cell.notify("transition:start",this.getArgs(d)),s.start&&s.start(this.getArgs(d))},s.delay),this.stop.bind(this,e,r,s)}stop(e,t={},s="/"){const r=Array.isArray(e)?e:e.split(s);return Object.keys(this.ids).filter(i=>xn(r,i.split(s).slice(0,r.length))).forEach(i=>{cancelAnimationFrame(this.ids[i]);const o=this.cache[i],a=this.getArgs(i),c=Object.assign(Object.assign({},o.options),t),u=c.jumpedToEnd;u&&o.targetValue!=null&&(this.cell.setPropByPath(i,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),c.complete&&c.complete(Object.assign({},a)));const d=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},d)),c.stop&&c.stop(Object.assign({},d)),this.cell.notify("transition:finish",Object.assign({},a)),c.finish&&c.finish(Object.assign({},a)),this.clean(i)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?Qs[e]:e}getInterp(e,t,s){return e?e(t,s):typeof s=="number"?er.number(t,s):typeof s=="string"?s[0]==="#"?er.color(t,s):er.unit(t,s):er.object(t,s)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(po||(po={}));var mB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},Lb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class pe extends Te{static config(e){const{markup:t,propHooks:s,attrHooks:r}=e,i=Lb(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),s&&(this.propHooks=this.propHooks.slice(),Array.isArray(s)?this.propHooks.push(...s):typeof s=="function"?this.propHooks.push(s):Object.values(s).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),r&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),r)),this.defaults=Ye({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:Ne(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((s,r)=>r?Q(r,e,s):s,t)}get[Symbol.toStringTag](){return pe.toStringTag}constructor(e={}){super();const s=this.constructor.getDefaults(!0),r=Ye({},this.preprocess(s),this.preprocess(e));this.id=r.id||Fa(),this.store=new Rb(r),this.animation=new po(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const s=e.id,i=this.constructor.applyPropHooks(this,e);return s==null&&t!==!0&&(i.id=Fa()),i}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:s,previous:r,options:i}=e;this.notify("change:*",{key:t,options:i,current:s,previous:r,cell:this}),this.notify(`change:${t}`,{options:i,current:s,previous:r,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:s,previous:r,options:i,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const s=this.model;return s&&(s.notify(`cell:${e}`,t),this.isNode()?s.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&s.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,s){if(typeof e=="string")this.store.set(e,t,s);else{const r=this.preprocess(e,!0);this.store.set(Ye({},this.getProp(),r),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,s={}){return this.model&&(e==="children"?this._children=t?t.map(r=>this.model.getCell(r)).filter(r=>r!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,s),this}removePropByPath(e,t={}){const s=Array.isArray(e)?e:e.split("/");return s[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(s,t),this}prop(e,t,s){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,s||{}):this.setPropByPath(e,t,s||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let s=t.getMaxZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this],s=s-r.length+1;const i=t.total();let o=t.indexOf(this)!==i-r.length;o||(o=r.some((a,c)=>a.getZIndex()!==s+c)),o&&this.batchUpdate("to-front",()=>{s+=r.length,r.forEach((a,c)=>{a.setZIndex(s+c,e)})})}return this}toBack(e={}){const t=this.model;if(t){let s=t.getMinZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this];let i=t.indexOf(this)!==0;i||(i=r.some((o,a)=>o.getZIndex()!==s+a)),i&&this.batchUpdate("to-back",()=>{s-=r.length,r.forEach((o,a)=>{o.setZIndex(s+a,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const s=r=>this.store.set("attrs",r,t);if(t.overwrite===!0)s(e);else{const r=this.getAttrs();t.deep===!1?s(Object.assign(Object.assign({},r),e)):s(Ye({},r,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const s=this.constructor.getAttrHooks()||{};let r=s[e]||Pn.registry.get(e);if(!r){const i=sa(e);r=s[i]||Pn.registry.get(i)}return r||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,s={}){return this.setPropByPath(this.prefixAttrPath(e),t,s),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,s){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,s||{}):this.setAttrByPath(e,t,s||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const s=typeof e=="boolean"?e:!this.isVisible(),r=typeof e=="boolean"?t:e;return s?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const s=r=>this.store.set("data",r,t);if(t.overwrite===!0)s(e);else{const r=this.getData();t.deep===!1?s(typeof e=="object"?Object.assign(Object.assign({},r),e):e):s(Ye({},r,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(s=>{var r;return(r=this.model)===null||r===void 0?void 0:r.getCell(s)}).filter(s=>s!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let s=this.getParent();for(;s;)t.push(s),s=e.deep!==!1?s.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],s=this.getChildren()||[];for(;s.length>0;){const r=s.shift(),i=r.getChildren();t.push(r),i&&s.push(...i)}return t}{const t=this.getChildren()||[];return t.forEach(s=>{t.push(...s.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let s=this.getParent();for(;s;){if(s===e)return!0;s=s.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return pe.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(s=>s.id),t):this.store.remove("children",t),this}unembed(e,t={}){const s=this.children;if(s!=null&&e!=null){const r=this.getChildIndex(e);r!==-1&&(s.splice(r,1),e.setParent(null,t),this.setChildren(s,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return pe.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,s={}){return e.insertChild(this,t,s),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,s={}){if(e!=null&&e!==this){const r=e.getParent(),i=this!==r;let o=t;if(o==null&&(o=this.getChildCount(),i||(o-=1)),r){const c=r.getChildren();if(c){const u=c.indexOf(e);u>=0&&(e.setParent(null,s),c.splice(u,1),r.setChildren(c,s))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,s),this.setChildren(a,s),i&&this.model){const c=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);c&&c.forEach(d=>d.updateParent(s)),u&&u.forEach(d=>d.updateParent(s))}this.model&&this.model.addCell(e,s)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const s=t.getChildIndex(this);t.removeChildAt(s,e)}return this}removeChild(e,t={}){const s=this.getChildIndex(e);return this.removeChildAt(s,t)}removeChildAt(e,t={}){const s=this.getChildAt(e);return this.children!=null&&s!=null&&(this.unembed(s,t),s.remove(t)),s}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(s=>s.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,s={},r="/"){return this.animation.start(e,t,s,r)}stopTransition(e,t,s="/"){return this.animation.stop(e,t,s),this}getTransitions(){return this.animation.get()}translate(e,t,s){return this}scale(e,t,s,r){return this}addTools(e,t,s){const r=Array.isArray(e)?e:[e],i=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof s=="object"?s:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let a=Ne(this.getTools());if(a==null||i==null||a.name===i)return a==null&&(a={}),a.items||(a.items=[]),a.name=i,a.items=[...a.items,...r],this.setTools(Object.assign({},a),o)}setTools(e,t={}){return e==null?this.removeTools():this.store.set("tools",pe.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(s=>typeof s=="string"?s===e:s.name===e)}removeTool(e,t={}){const s=Ne(this.getTools());if(s){let r=!1;const i=s.items.slice(),o=a=>{i.splice(a,1),r=!0};if(typeof e=="number")o(e);else for(let a=i.length-1;a>=0;a-=1){const c=i[a];(typeof c=="string"?c===e:c.name===e)&&o(a)}r&&(s.items=i,this.setTools(s,t))}return this}getBBox(e){return new U}getConnectionPoint(e,t){return new O}toJSON(e={}){const t=Object.assign({},this.store.get()),s=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${g.name||s.call(g)}"`)}const i=this.constructor,o=e.diff===!0,a=t.attrs||{},c=i.getDefaults(!0),u=o?this.preprocess(c,!0):c,d=u.attrs||{},h={};Object.entries(t).forEach(([g,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!wn(m))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${s.call(m)}" type of key "${g}" on ${r} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const y=u[g];xn(m,y)&&delete t[g]}}),Object.keys(a).forEach(g=>{const m=a[g],y=d[g];Object.keys(m).forEach(b=>{const w=m[b],x=y?y[b]:null;w!=null&&typeof w=="object"&&!Array.isArray(w)?Object.keys(w).forEach(v=>{const S=w[v];if(y==null||x==null||!Ie(x)||!xn(x[v],S)){h[g]==null&&(h[g]={}),h[g][b]==null&&(h[g][b]={});const E=h[g][b];E[v]=S}}):(y==null||!xn(x,w))&&(h[g]==null&&(h[g]={}),h[g][b]=w)})});const f=Object.assign(Object.assign({},t),{attrs:dp(h)?void 0:h});f.attrs==null&&delete f.attrs;const p=f;return p.angle===0&&delete p.angle,Ne(p)}clone(e={}){if(!e.deep){const s=Object.assign({},this.store.get());e.keepId||delete s.id,delete s.parent,delete s.children;const r=this.constructor;return new r(s)}return pe.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},s=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),s&&s.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},s=this.model){return s&&s.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,s){const r=this.model;this.startBatch(e,s,r);const i=t();return this.stopBatch(e,s,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}pe.defaults={},pe.attrHooks={},pe.propHooks=[],mB([Te.dispose()],pe.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(pe||(pe={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"}n.isCell=e}(pe||(pe={})),function(n){function e(...i){const o=i.filter(c=>c!=null).map(c=>c.getAncestors()).sort((c,u)=>c.length-u.length);return o.shift().find(c=>o.every(u=>u.includes(c)))||null}n.getCommonAncestor=e;function t(i,o={}){let a=null;for(let c=0,u=i.length;c<u;c+=1){const d=i[c];let h=d.getBBox(o);if(h){if(d.isNode()){const f=d.getAngle();f!=null&&f!==0&&(h=h.bbox(f))}a=a==null?h:a.union(h)}}return a}n.getCellsBBox=t;function s(i){const o=[i,...i.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=s;function r(i){const o=gp(i),a=o.reduce((c,u)=>(c[u.id]=u.clone(),c),{});return o.forEach(c=>{const u=a[c.id];if(u.isEdge()){const f=u.getSourceCellId(),p=u.getTargetCellId();f&&a[f]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[f].id})),p&&a[p]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[p].id}))}const d=c.getParent();d&&a[d.id]&&u.setParent(a[d.id]);const h=c.getChildren();if(h&&h.length){const f=h.reduce((p,g)=>(a[g.id]&&p.push(a[g.id]),p),[]);f.length>0&&u.setChildren(f)}}),a}n.cloneCells=r}(pe||(pe={})),function(n){n.config({propHooks(e){var{tools:t}=e,s=Lb(e,["tools"]);return t&&(s.tools=n.normalizeTools(t)),s}})}(pe||(pe={}));var ti;(function(n){let e,t;function s(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=s;function r(o){e=o}n.setEdgeRegistry=r;function i(o){t=o}n.setNodeRegistry=i})(ti||(ti={}));class yB{constructor(e){this.ports=[],this.groups={},this.init(Ne(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const s=this.getPortsByGroup(e),r=e?this.getGroup(e):null,i=r?r.position:null,o=i?i.name:null;let a;if(o!=null){const h=tr.registry.get(o);if(h==null)return tr.registry.onNotFound(o);a=h}else a=tr.presets.left;const c=s.map(h=>h&&h.position&&h.position.args||{}),u=i&&i.args||{};return a(c,t,u).map((h,f)=>{const p=s[f];return{portLayout:h,portId:p.id,portSize:p.size,portAttrs:p.attrs,labelSize:p.label.size,labelLayout:this.getPortLabelLayout(p,O.create(h.position),t)}})}init(e){const{groups:t,items:s}=e;t!=null&&Object.keys(t).forEach(r=>{this.groups[r]=this.parseGroup(t[r])}),Array.isArray(s)&&s.forEach(r=>{this.ports.push(this.parsePort(r))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),s=this.getGroup(e.group)||{};return t.markup=t.markup||s.markup,t.attrs=Ye({},s.attrs,t.attrs),t.position=this.createPosition(s,t),t.label=Ye({},s.label,this.getLabel(t)),t.zIndex=this.getZIndex(s,t),t.size=Object.assign(Object.assign({},s.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return Ye({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const s=e.label||{};return s.position=this.getPortLabelPosition(s.position,t),s}getPortLabelLayout(e,t,s){const r=e.label.position.name||"left",i=e.label.position.args||{},o=Wr.registry.get(r)||Wr.presets.left;return o?o(t,s,i):null}}var fl=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let Ue=class a0 extends pe{get[Symbol.toStringTag](){return a0.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:s,y:r,width:i,height:o}=e,a=fl(e,["x","y","width","height"]);if(s!=null||r!=null){const c=a.position;a.position=Object.assign(Object.assign({},c),{x:s??(c?c.x:0),y:r??(c?c.y:0)})}if(i!=null||o!=null){const c=a.size;a.size=Object.assign(Object.assign({},c),{width:i??(c?c.width:0),height:o??(c?c.height:0)})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,s){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,s):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,s){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,s),this}resize(e,t,s={}){this.startBatch("resize",s);const r=s.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":t=i.height;break;case"top":case"bottom":e=i.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[r];const c=me.normalize(this.getAngle()||0);s.absolute&&(a+=Math.floor((c+45)/90),a%=4);const u=this.getBBox();let d;a===0?d=u.getBottomLeft():a===1?d=u.getCorner():a===2?d=u.getTopRight():d=u.getOrigin();const h=d.clone().rotate(-c,u.getCenter()),f=Math.sqrt(e*e+t*t)/2;let p=a*Math.PI/2;p+=Math.atan(a%2===0?t/e:e/t),p-=me.toRad(c);const m=O.fromPolar(f,p,h).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},s),this.setPosition(m.x,m.y,s)}else this.store.set("size",{width:e,height:t},s);return this.stopBatch("resize",s),this}scale(e,t,s,r={}){const i=this.getBBox().scale(e,t,s??void 0);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this}position(e,t,s){return typeof e=="number"?this.setPosition(e,t,s):this.getPosition(e)}getPosition(e={}){if(e.relative){const s=this.getParent();if(s!=null&&s.isNode()){const r=this.getPosition(),i=s.getPosition();return{x:r.x-i.x,y:r.y-i.y}}}const t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,s={}){let r,i,o;if(typeof e=="object"?(r=e.x,i=e.y,o=t||{}):(r=e,i=t,o=s||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const c=a.getPosition();r+=c.x,i+=c.y}}if(o.deep){const a=this.getPosition();this.translate(r-a.x,i-a.y,o)}else this.store.set("position",{x:r,y:i},o);return this}translate(e=0,t=0,s={}){if(e===0&&t===0)return this;s.translateBy=s.translateBy||this.id;const r=this.getPosition();if(s.restrict!=null&&s.translateBy===this.id){const o=this.getBBox({deep:!0}),a=s.restrict,c=r.x-o.x,u=r.y-o.y,d=Math.max(a.x+c,Math.min(a.x+a.width+c-o.width,r.x+e)),h=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,r.y+t));e=d-r.x,t=h-r.y}const i={x:r.x+e,y:r.y+t};return s.tx=e,s.ty=t,s.transition?(typeof s.transition!="object"&&(s.transition={}),this.transition("position",i,Object.assign(Object.assign({},s.transition),{interp:er.object})),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,s)})):(this.startBatch("translate",s),this.store.set("position",i,s),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,s)}),this.stopBatch("translate",s)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const s=this.getAngle();if(t.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(s-e,t.center);const a=o.x-r.width/2-i.x,c=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(i.x+a,i.y+c,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(s+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),pe.getCellsBBox(t)}return U.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const s=this.getBBox(),r=s.getCenter(),i=e.getTerminal(t);if(i==null)return r;const o=i.port;if(!o||!this.hasPort(o))return r;const a=this.getPort(o);if(!a||!a.group)return r;const u=this.getPortsPosition(a.group)[o].position,d=O.create(u).translate(s.getOrigin()),h=this.getAngle();return h&&d.rotate(-h,r),d}fit(e={}){const s=(this.getChildren()||[]).filter(u=>u.isNode());if(s.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&s.forEach(u=>u.fit(e));let{x:r,y:i,width:o,height:a}=pe.getCellsBBox(s);const c=ms(e.padding);return r-=c.left,i-=c.top,o+=c.left+c.right,a+=c.bottom+c.top,this.store.set({position:{x:r,y:i},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||_e.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",_e.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||_e.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",_e.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||_e.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",_e.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return Ne(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return Ne(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(s=>s.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new U(0,0,t.width,t.height)).reduce((r,i)=>{const o=i.portLayout;return r[i.portId]={position:Object.assign({},o.position),angle:o.angle||0},r},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,s,r){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),c=s;return this.setPropByPath(a,c,r)}const i=this.prefixPortPath(e),o=t;return this.setPropByPath(i,o,s)}removePortProp(e,t,s){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),s):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,s,r){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):s==null?this.removePortProp(e,t,r):this.setPortProp(e,t,s,r):this.setPortProp(e,t,s)}prefixPortPath(e,t){const s=this.getPortIndex(e);if(s===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${s}`]:Array.isArray(t)?["ports","items",`${s}`,...t]:`ports/items/${s}/${t}`}addPort(e,t){const s=[...this.ports.items];return s.push(e),this.setPropByPath("ports/items",s,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,s){const r=[...this.ports.items];return r.splice(e,0,t),this.setPropByPath("ports/items",r,s),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const s=[...this.ports.items];s.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",s,t)}return this}removePorts(e,t){let s;if(Array.isArray(e)){if(s=t||{},e.length){s.rewrite=!0;const i=[...this.ports.items].filter(o=>!e.some(a=>{const c=typeof a=="string"?a:a.id;return o.id===c}));this.setPropByPath("ports/items",i,s)}}else s=e||{},s.rewrite=!0,this.setPropByPath("ports/items",[],s);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const s={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(s[o.id]=!0)});const i=this.model;i&&!dp(s)&&(i.getConnectedEdges(this,{incoming:!0}).forEach(c=>{const u=c.getTargetPortId();u&&s[u]&&c.remove()}),i.getConnectedEdges(this,{outgoing:!0}).forEach(c=>{const u=c.getSourcePortId();u&&s[u]&&c.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(s=>{typeof s!="object"&&t.push(`Invalid port ${s}.`),s.id==null&&(s.id=this.generatePortId()),e[s.id]&&t.push("Duplicitied port id."),e[s.id]=!0}),t}generatePortId(){return Fa()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new yB(this.ports);const s=this.port.getPorts(),r=t?s.filter(o=>t.find(a=>a.id===o.id)?null:o):[...s],i=t?t.filter(o=>s.find(a=>a.id===o.id)?null:o):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})}};Ue.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.size=="function"&&typeof r.position=="function"}n.isNode=e}(Ue||(Ue={})),function(n){n.config({propHooks(e){var{ports:t}=e,s=fl(e,["ports"]);return t&&(s.ports=Array.isArray(t)?{items:t}:t),s}})}(Ue||(Ue={})),function(n){n.registry=ze.create({type:"node",process(e,t){if(ti.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r}=t,i=fl(t,["inherit"]);if(r)if(typeof r=="string"){const a=this.get(r);a==null?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),ti.setNodeRegistry(n.registry)}(Ue||(Ue={})),function(n){let e=0;function t(i){return i?Au(i):(e+=1,`CustomNode${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=fl(i,["constructorName","overwrite"]),u=Mu(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"rect",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(Ue||(Ue={}));var pl=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let Be=class l0 extends pe{get[Symbol.toStringTag](){return l0.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:s,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:c,targetPort:u,targetPoint:d}=e,f=pl(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),p=g=>typeof g=="string"||typeof g=="number";if(s!=null)if(pe.isCell(s))f.source={cell:s.id};else if(p(s))f.source={cell:s};else if(O.isPoint(s))f.source=s.toJSON();else if(Array.isArray(s))f.source={x:s[0],y:s[1]};else{const g=s.cell;pe.isCell(g)?f.source=Object.assign(Object.assign({},s),{cell:g.id}):f.source=s}if(r!=null||i!=null){let g=f.source;if(r!=null){const m=p(r)?r:r.id;g?g.cell=m:g=f.source={cell:m}}i!=null&&g&&(g.port=i)}else o!=null&&(f.source=O.create(o).toJSON());if(a!=null)if(pe.isCell(a))f.target={cell:a.id};else if(p(a))f.target={cell:a};else if(O.isPoint(a))f.target=a.toJSON();else if(Array.isArray(a))f.target={x:a[0],y:a[1]};else{const g=a.cell;pe.isCell(g)?f.target=Object.assign(Object.assign({},a),{cell:g.id}):f.target=a}if(c!=null||u!=null){let g=f.target;if(c!=null){const m=p(c)?c:c.id;g?g.cell=m:g=f.target={cell:m}}u!=null&&g&&(g.port=u)}else d!=null&&(f.target=O.create(d).toJSON());return super.preprocess(f,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,s={}){return this.setTerminal("source",e,t,s)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,s={}){return this.setTerminal("target",e,t,s)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,s,r={}){if(pe.isCell(t))return this.store.set(e,Ye({},s,{cell:t.id}),r),this;const i=t;return O.isPoint(t)||i.x!=null&&i.y!=null?(this.store.set(e,Ye({},s,{x:i.x,y:i.y}),r),this):(this.store.set(e,Ne(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(O.isPointLike(t))return O.create(t);const s=this.getTerminalCell(e);return s?s.getConnectionPoint(this,e):new O}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const s={};for(;t&&t.isEdge();){if(s[t.id])return null;s[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,s){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},s),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,s){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},s),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return Ne(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,s={}){const r=this.getLabels(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(e)),this.setLabels(r,s)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getLabels();r[e]=this.parseLabel(t),this.setLabels(r,s)}return this}removeLabelAt(e,t={}){const s=this.getLabels(),r=e!=null&&Number.isFinite(e)?e:-1,i=s.splice(r,1);return this.setLabels(s,t),i.length?i[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>i===o||xn(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>i===o||xn(i,o))?null:i):e?[...e]:[];s.length>0&&this.notify("labels:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("labels:removed",{removed:r,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const s=Array.isArray(e)?e:[e];return this.store.set("vertices",s.map(r=>O.toJSON(r)),t),this}insertVertex(e,t,s={}){const r=this.getVertices(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,O.toJSON(e)),this.setVertices(r,s)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getVertices();r[e]=t,this.setVertices(r,s)}return this}removeVertexAt(e,t={}){const s=this.getVertices(),r=e!=null&&Number.isFinite(e)?e:-1;return s.splice(r,1),this.setVertices(s,t)}onVertexsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>O.equals(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>O.equals(i,o))?null:i):e?[...e]:[];s.length>0&&this.notify("vertexs:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("vertexs:removed",{removed:r,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||_e.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,s={}){return s.translateBy=s.translateBy||this.id,s.tx=e,s.ty=t,this.applyToPoints(r=>({x:(r.x||0)+e,y:(r.y||0)+t}),s)}scale(e,t,s,r={}){return this.applyToPoints(i=>O.create(i).scale(e,t,s).toJSON(),r)}applyToPoints(e,t={}){const s={},r=this.getSource(),i=this.getTarget();O.isPointLike(r)&&(s.source=e(r)),O.isPointLike(i)&&(s.target=e(i));const o=this.getVertices();return o.length>0&&(s.vertices=o.map(e)),this.store.set(s,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>O.create(t)),this.getTargetPoint()];return new $e(e)}updateParent(e){let t=null;const s=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return s&&r&&(s===r||s.isDescendantOf(r)?t=r:r.isDescendantOf(s)?t=s:t=pe.getCommonAncestor(s,r)),i&&t&&t.id!==i.id&&i.unembed(this,e),t&&(!i||i.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),s=this.getTarget(),r=t.cell,i=s.cell;if(!r||!i)return!1;let o=r===i;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),c=this.getTargetCell();a&&c&&(o=a.isAncestorOf(c,e)||c.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};Be.defaults={},function(n){function e(t,s){const r=t,i=s;return r.cell===i.cell?r.port===i.port||r.port==null&&i.port==null:!1}n.equalTerminals=e}(Be||(Be={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}(Be||(Be={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.disconnect=="function"&&typeof r.getSource=="function"&&typeof r.getTarget=="function"}n.isEdge=e}(Be||(Be={})),function(n){n.registry=ze.create({type:"edge",process(e,t){if(ti.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r="edge"}=t,i=pl(t,["inherit"]);if(typeof r=="string"){const a=this.get(r||"edge");a==null&&r?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),ti.setEdgeRegistry(n.registry)}(Be||(Be={})),function(n){let e=0;function t(i){return i?Au(i):(e+=1,`CustomEdge${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=pl(i,["constructorName","overwrite"]),u=Mu(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"edge",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(Be||(Be={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:s,vertices:r}=t,i=pl(t,["label","vertices"]);if(s){i.labels==null&&(i.labels=[]);const o=typeof s=="string"?n.parseStringLabel(s):s;i.labels.push(o)}return r&&Array.isArray(r)&&(i.vertices=r.map(o=>O.create(o).toJSON())),i}}),n.registry.register(e,n)}(Be||(Be={}));var bB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class gl extends Te{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,s){let r,i;typeof t=="number"?(r=t,i=Object.assign({merge:!1},s)):(r=this.length,i=Object.assign({merge:!1},t)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&i.sort!==!1,c=this.comparator||null;let u=!1;const d=[],h=[];return o.forEach(f=>{const p=this.get(f);p?i.merge&&!f.isSameStore(p)&&(p.setProp(f.getProp(),s),h.push(p),a&&!u&&(c==null||typeof c=="function"?u=p.hasChanged():typeof c=="string"?u=p.hasChanged(c):u=c.some(g=>p.hasChanged(g)))):(d.push(f),this.reference(f))}),d.length&&(a&&(u=!0),this.cells.splice(r,0,...d),this.length=this.cells.length),u&&this.sort({silent:!0}),i.silent||(d.forEach((f,p)=>{const g={cell:f,index:r+p,options:i};this.trigger("added",g),i.dryrun||f.notify("added",Object.assign({},g))}),u&&this.trigger("sorted"),(d.length||h.length)&&this.trigger("updated",{added:d,merged:h,removed:[],options:i})),this}remove(e,t={}){const s=Array.isArray(e)?e:[e],r=this.removeCells(s,t);return!t.silent&&r.length>0&&this.trigger("updated",{options:t,removed:r,added:[],merged:[]}),Array.isArray(e)?r:r[0]}removeCells(e,t){const s=[];for(let r=0;r<e.length;r+=1){const i=this.get(e[r]);if(i==null)continue;const o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],s.push(i),this.unreference(i),t.dryrun||i.remove(),t.silent||(this.trigger("removed",{cell:i,index:o,options:t}),t.dryrun||i.notify("removed",{cell:i,index:o,options:t}))}return s}reset(e,t={}){const s=this.cells.slice();if(s.forEach(r=>this.unreference(r)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const r=this.cells.slice();this.trigger("reseted",{options:t,previous:s,current:r});const i=[],o=[];r.forEach(a=>{s.some(u=>u.id===a.id)||i.push(a)}),s.forEach(a=>{r.some(u=>u.id===a.id)||o.push(a)}),this.trigger("updated",{options:t,added:i,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Ac(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const s=t.cell;this.trigger(`cell:${e}`,t),s&&(s.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:s})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}bB([gl.dispose()],gl.prototype,"dispose",null);var wB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Qe extends Te{get[Symbol.toStringTag](){return Qe.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new gl(e),this.setup()}notify(e,t){this.trigger(e,t);const s=this.graph;return s&&(e==="sorted"||e==="reseted"||e==="updated"?s.trigger(`model:${e}`,t):s.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const s=t.cell;this.onCellRemoved(s,t.options),this.notify("cell:removed",t),s.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:s}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const s=e.id;if(e.isEdge()){delete this.edges[s];const r=e.getSource(),i=e.getTarget();if(r&&r.cell){const o=this.outgoings[r.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[r.cell])}if(i&&i.cell){const o=this.incomings[i.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[i.cell])}}else delete this.nodes[s];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const s=t==="source"?this.outgoings:this.incomings,r=e.previous(t);if(r&&r.cell){const o=pe.isCell(r.cell)?r.cell.id:r.cell,a=s[o],c=a?a.indexOf(e.id):-1;c>=0&&(a.splice(c,1),a.length===0&&delete s[o])}const i=e.getTerminal(t);if(i&&i.cell){const o=pe.isCell(i.cell)?i.cell.id:i.cell,a=s[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),s[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(s=>this.prepareCell(s,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(s=>this.prepareCell(s,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const s=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const r=t.sort((i,o)=>{const a=i.isEdge()?1:2,c=o.isEdge()?1:2;return a-c});for(;r.length>0;){const i=r.shift();i&&i.remove(s)}},s),this}addNode(e,t={}){const s=Ue.isNode(e)?e:this.createNode(e);return this.addCell(s,t),s}updateNode(e,t={}){const s=this.createNode(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}createNode(e){return Ue.create(e)}addEdge(e,t={}){const s=Be.isEdge(e)?e:this.createEdge(e);return this.addCell(s,t),s}createEdge(e){return Be.create(e)}updateEdge(e,t={}){const s=this.createEdge(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(s=>this.addCell(s,t)),this.addings.delete(e)),this)}addCells(e,t={}){const s=e.length;if(s===0)return this;const r=Object.assign(Object.assign({},t),{position:s-1,maxPosition:s-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:e})),e.forEach(i=>{this.addCell(i,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:e})),this}updateCell(e,t={}){const s=e.id&&this.getCell(e.id);return s?this.batchUpdate("update",()=>(Object.entries(e).forEach(([r,i])=>s.setProp(r,i,t)),!0),e):!1}removeCell(e,t={}){const s=typeof e=="string"?this.getCell(e):e;return s&&this.has(s)?this.collection.remove(s,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);const s=e.clone({keepId:!0});return this.addCell(s),this.getConnectedEdges(e).forEach(i=>{const o=i.getSourceCell(),a=i.getTargetCell();o===e&&i.setSource(Object.assign(Object.assign({},i.getSource()),{cell:t})),a===e&&i.setTarget(Object.assign(Object.assign({},i.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),s}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(s=>this.removeCell(s,t))):[]}removeConnectedEdges(e,t={}){const s=this.getConnectedEdges(e);return s.forEach(r=>{r.remove(t)}),s}disconnectConnectedEdges(e,t={}){const s=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(r=>{const i=r.getSourceCellId(),o=r.getTargetCellId();i===s&&r.setSource({x:0,y:0},t),o===s&&r.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,s=this.outgoings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,s=this.incomings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getConnectedEdges(e,t={}){const s=[],r=typeof e=="string"?this.getCell(e):e;if(r==null)return s;const i={},o=t.indirect;let a=t.incoming,c=t.outgoing;a==null&&c==null&&(a=c=!0);const u=(d,h)=>{const f=h?this.getOutgoingEdges(d):this.getIncomingEdges(d);if(f!=null&&f.forEach(p=>{i[p.id]||(s.push(p),i[p.id]=!0,o&&(a&&u(p,!1),c&&u(p,!0)))}),o&&d.isEdge()){const p=h?d.getTargetCell():d.getSourceCell();p&&p.isEdge()&&(i[p.id]||(s.push(p),u(p,h)))}};if(c&&u(r,!0),a&&u(r,!1),t.deep){const d=r.getDescendants({deep:!0}),h={};d.forEach(p=>{p.isNode()&&(h[p.id]=!0)});const f=(p,g)=>{const m=g?this.getOutgoingEdges(p.id):this.getIncomingEdges(p.id);m!=null&&m.forEach(y=>{if(!i[y.id]){const b=y.getSourceCell(),w=y.getTargetCell();if(!t.enclosed&&b&&h[b.id]&&w&&h[w.id])return;s.push(y),i[y.id]=!0}})};d.forEach(p=>{p.isEdge()||(c&&f(p,!0),a&&f(p,!1))})}return s}isBoundary(e,t){const s=typeof e=="string"?this.getCell(e):e,r=t?this.getIncomingEdges(s):this.getOutgoingEdges(s);return r==null||r.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(s=>{if(this.isBoundary(s,e)){const r=this.getCell(s);r&&t.push(r)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let s=t.incoming,r=t.outgoing;s==null&&r==null&&(s=r=!0);const o=this.getConnectedEdges(e,t).reduce((a,c)=>{const u=c.hasLoop(t),d=c.getSourceCell(),h=c.getTargetCell();return s&&d&&d.isNode()&&!a[d.id]&&(u||d!==e&&(!t.deep||!d.isDescendantOf(e)))&&(a[d.id]=d),r&&h&&h.isNode()&&!a[h.id]&&(u||h!==e&&(!t.deep||!h.isDescendantOf(e)))&&(a[h.id]=h),a},{});if(e.isEdge()){if(s){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(r){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,s={}){let r=s.incoming,i=s.outgoing;return r==null&&i==null&&(r=i=!0),this.getConnectedEdges(e,s).some(o=>{const a=o.getSourceCell(),c=o.getTargetCell();return!!(r&&a&&a.id===t.id||i&&c&&c.id===t.id)})}getSuccessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{outgoing:!0})),s}isSuccessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{outgoing:!0})),r}getPredecessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{incoming:!0})),s}isPredecessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{incoming:!0})),r}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(s=>{s&&(Array.isArray(s)?t.push(...s):t.push(s))}),pe.getCommonAncestor(...t)}getSubGraph(e,t={}){const s=[],r={},i=[],o=[],a=c=>{r[c.id]||(s.push(c),r[c.id]=c,c.isEdge()&&o.push(c),c.isNode()&&i.push(c))};return e.forEach(c=>{a(c),t.deep&&c.getDescendants({deep:!0}).forEach(d=>a(d))}),o.forEach(c=>{const u=c.getSourceCell(),d=c.getTargetCell();u&&!r[u.id]&&(s.push(u),r[u.id]=u,u.isNode()&&i.push(u)),d&&!r[d.id]&&(s.push(d),r[d.id]=d,d.isNode()&&i.push(d))}),i.forEach(c=>{this.getConnectedEdges(c,t).forEach(d=>{const h=d.getSourceCell(),f=d.getTargetCell();!r[d.id]&&h&&r[h.id]&&f&&r[f.id]&&(s.push(d),r[d.id]=d)})}),s}cloneSubGraph(e,t={}){const s=this.getSubGraph(e,t);return this.cloneCells(s)}cloneCells(e){return pe.cloneCells(e)}getNodesFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(r=>r.getBBox().containsPoint(s))}getNodesInArea(e,t,s,r,i){const o=typeof e=="number"?new U(e,t,s,r):U.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getNodes().filter(u=>{const d=u.getBBox();return c?o.containsRect(d):o.isIntersectWithRect(d)})}getEdgesInArea(e,t,s,r,i){const o=typeof e=="number"?new U(e,t,s,r):U.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getEdges().filter(u=>{const d=u.getBBox();return d.width===0?d.inflate(1,0):d.height===0&&d.inflate(0,1),c?o.containsRect(d):o.isIntersectWithRect(d)})}getNodesUnderNode(e,t={}){const s=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(s):this.getNodesFromPoint(s[t.by])).filter(i=>e.id!==i.id&&!i.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return pe.getCellsBBox(e,t)}search(e,t,s={}){s.breadthFirst?this.breadthFirstSearch(e,t,s):this.depthFirstSearch(e,t,s)}breadthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.shift();if(a==null||i[a.id]||(i[a.id]=!0,Q(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,s).forEach(u=>{o[u.id]=o[a.id]+1,r.push(u)})}}depthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.pop();if(a==null||i[a.id]||(i[a.id]=!0,Q(t,this,a,o[a.id])===!1))continue;const c=this.getNeighbors(a,s),u=r.length;c.forEach(d=>{o[d.id]=o[a.id]+1,r.splice(u,0,d)})}}getShortestPath(e,t,s={}){const r={};this.getEdges().forEach(u=>{const d=u.getSourceCellId(),h=u.getTargetCellId();d&&h&&(r[d]||(r[d]=[]),r[h]||(r[h]=[]),r[d].push(h),s.directed||r[h].push(d))});const i=typeof e=="string"?e:e.id,o=Wu.run(r,i,s.weight),a=[];let c=typeof t=="string"?t:t.id;for(o[c]&&a.push(c);c=o[c];)a.unshift(c);return a}translate(e,t,s){return this.getCells().filter(r=>!r.hasParent()).forEach(r=>r.translate(e,t,s)),this}resize(e,t,s){return this.resizeCells(e,t,this.getCells(),s)}resizeCells(e,t,s,r={}){const i=this.getCellsBBox(s);if(i){const o=Math.max(e/i.width,0),a=Math.max(t/i.height,0),c=i.getOrigin();s.forEach(u=>u.scale(o,a,c,r))}return this}toJSON(e={}){return Qe.toJSON(this.getCells(),e)}parseJSON(e){return Qe.fromJSON(e)}fromJSON(e,t={}){const s=this.parseJSON(e);return this.resetCells(s,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,s={}){this.startBatch(e,s);const r=t();return this.stopBatch(e,s),r}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(s=>this.batches[s]>0)}dispose(){this.collection.dispose()}}wB([Qe.dispose()],Qe.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.addNode=="function"&&typeof r.addEdge=="function"&&r.collection!=null}n.isModel=e}(Qe||(Qe={})),function(n){function e(s,r={}){return{cells:s.map(i=>i.toJSON(r))}}n.toJSON=e;function t(s){const r=[];return Array.isArray(s)?r.push(...s):(s.cells&&r.push(...s.cells),s.nodes&&s.nodes.forEach(i=>{i.shape==null&&(i.shape="rect"),r.push(i)}),s.edges&&s.edges.forEach(i=>{i.shape==null&&(i.shape="edge"),r.push(i)})),r.map(i=>{const o=i.shape;if(o){if(Ue.registry.exist(o))return Ue.create(i);if(Be.registry.exist(o))return Be.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(Qe||(Qe={}));var xB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let _s=class extends Ue{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(e){const{label:t}=e,s=xB(e,["label"]);return t&&Ir(s,"attrs/text/text",t),s},visible:!0})})(_s||(_s={}));var vB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function CB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function SB(n="xlink:href"){return t=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=t,o=vB(t,["imageUrl","imageWidth","imageHeight"]);if(s!=null||r!=null||i!=null){const a=()=>{if(o.attrs){const c=o.attrs.image;s!=null&&(c[n]=s),r!=null&&(c.width=r),i!=null&&(c.height=i),o.attrs.image=c}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function ni(n,e,t={}){const s={constructorName:n,markup:CB(n,t.selector),attrs:{[n]:Object.assign({},_s.bodyAttr)}};return(t.parent||_s).define(Ye(s,e,{shape:n}))}ni("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const EB=Be.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});ni("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var OB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class si extends _s{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",si.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(s=>Array.isArray(s)?s.join(","):O.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:s}=t,r=OB(t,["points"]);if(s){const i=e(s);i&&Ir(r,"attrs/body/refPoints",i)}return r}})})(si||(si={})),ni("polygon",{},{parent:si}),ni("polyline",{},{parent:si});var MB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};_s.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:e}=n,t=MB(n,["path"]);return e&&Ir(t,"attrs/body/refD",e),t}});var PB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};_s.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},ys.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:st.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},_s.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=PB(n,["text"]);return e&&Ir(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,refBBox:s,elem:r,attrs:i}){if(r instanceof HTMLElement)r.textContent=n;else{const o=i.style||{},a={text:n,width:-5,height:"100%"},c=Object.assign({textVerticalAnchor:"middle"},o),u=Pn.presets.textWrap;return Q(u.set,this,a,{cell:e,view:t,elem:r,refBBox:s,attrs:c}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),ni("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:SB()},{selector:"image"}),ni("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class fn extends Fe{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return fn.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const s=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?De(t,s):K(t,s)}else{const s=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(s):this.addClass(s)}}isNodeView(){return!0}confirmUpdate(e,t={}){let s=e;return this.hasAction(s,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","resize","translate","rotate","ports","tools"])):(s=this.handleAction(s,"resize",()=>this.resize(),"update"),s=this.handleAction(s,"update",()=>this.update(),"ports"),s=this.handleAction(s,"translate",()=>this.translate()),s=this.handleAction(s,"rotate",()=>this.rotate()),s=this.handleAction(s,"ports",()=>this.renderPorts()),s=this.handleAction(s,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),s}update(e){this.cleanCache(),this.removePorts();const t=this.cell,s=t.getSize(),r=t.getAttrs();this.updateAttrs(this.container,r,{attrs:e===r?null:e,rootBBox:new U(0,0,s.width,s.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const s=e?this.portsCache[e]:null;if(!s)return null;const r=s.portContentElement,i=s.portContentSelectors||{};return this.findOne(t,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{Ft(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const s=this.cell.getParsedPorts(),r=up(s,"zIndex"),i="auto";r[i]&&r[i].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(r).forEach(o=>{if(o!==i){const a=parseInt(o,10);this.appendPorts(r[o],a,t)}}),this.updatePorts()}appendPorts(e,t,s){const r=e.map(i=>this.getPortElement(i));s[t]||t<0?Vu(s[Math.max(t,0)],r):_t(this.container,r)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=_e.renderMarkup(this.cell.getPortContainerMarkup());const s=t.elem;if(s==null)throw new Error("Invalid port container markup.");t=_e.renderMarkup(this.getPortMarkup(e));const r=t.elem,i=t.selectors;if(r==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},r);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),K(s,o),K(s,"x6-port"),K(r,"x6-port-body"),s.appendChild(r);let a=i,c,u;if(this.existPortLabel(e)){if(t=_e.renderMarkup(this.getPortLabelMarkup(e.label)),c=t.elem,u=t.selectors,c==null)throw new Error("Invalid port label markup.");if(i&&u){for(const h in u)if(i[h]&&h!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},i),u)}K(c,"x6-port-label"),s.appendChild(c)}return this.portsCache[e.id]={portElement:s,portSelectors:a,portLabelElement:c,portLabelSelectors:u,portContentElement:r,portContentSelectors:i},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:s,selectors:a,labelContainer:c,labelSelectors:u,contentContainer:r,contentSelectors:i}),s}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(s=>this.updatePortGroup(s))}updatePortGroup(e){const t=U.fromSize(this.cell.getSize()),s=this.cell.getPortsLayoutByGroup(e,t);for(let r=0,i=s.length;r<i;r+=1){const o=s[r],a=o.portId,c=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(c.portElement,u),o.portAttrs!=null){const h={selectors:c.portSelectors||{}};o.portSize&&(h.rootBBox=U.fromSize(o.portSize)),this.updateAttrs(c.portElement,o.portAttrs,h)}const d=o.labelLayout;if(d&&c.portLabelElement&&(this.applyPortTransform(c.portLabelElement,d,-(u.angle||0)),d.attrs)){const h={selectors:c.portLabelSelectors||{}};o.labelSize&&(h.rootBBox=U.fromSize(o.labelSize)),this.updateAttrs(c.portLabelElement,d.attrs,h)}}}applyPortTransform(e,t,s=0){const r=t.angle,i=t.position,o=rt().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);$r(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,node:i,cell:o}:{e,x:t,y:s,view:r,node:i,cell:o}}getPortEventArgs(e,t,s){const r=this,i=r.cell,o=i;return s?{e,x:s.x,y:s.y,view:r,node:i,cell:o,port:t}:{e,view:r,node:i,cell:o,port:t}}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("node:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("node:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("node:mouseup",this.getEventArgs(e,t,s))}notifyPortEvent(e,t,s){const r=this.findAttr("port",t.target);if(r){const i=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,r,s)),t.type=i}}onClick(e,t,s){super.onClick(e,t,s),this.notify("node:click",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:click",e,{x:t,y:s})}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("node:dblclick",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:s})}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("node:contextmenu",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:s})}onMouseDown(e,t,s){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,s),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:s}),this.startNodeDragging(e,t,s))}onMouseMove(e,t,s){const r=this.getEventData(e),i=r.action;if(i==="magnet")this.dragMagnet(e,t,s);else{if(i==="move"){const a=r.targetView||this;a.dragNode(e,t,s),a.notify("node:moving",{e,x:t,y:s,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,s),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:s})}this.setEventData(e,r)}onMouseUp(e,t,s){const r=this.getEventData(e),i=r.action;i==="magnet"?this.stopMagnetDragging(e,t,s):(this.notifyMouseUp(e,t,s),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:s}),i==="move"&&(r.targetView||this).stopNodeDragging(e,t,s));const o=r.targetMagnet;o&&this.onMagnetClick(e,o,t,s),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onMagnetClick(e,t,s,r){const i=this.graph;i.view.getMouseMovedCount(e)>i.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetDblClick(e,t,s,r){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetContextMenu(e,t,s,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){this.startMagnetDragging(e,s,r)}onCustomEvent(e,t,s,r){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}prepareEmbedding(e){const t=this.graph,r=this.getEventData(e).cell||this.cell,i=t.findViewByCell(r),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:r,view:i,cell:r,x:o.x,y:o.y,currentParent:r.getParent()})}processEmbedding(e,t){const s=t.cell||this.cell,r=t.graph||this.graph,i=r.options.embedding,o=i.findParent;let a=typeof o=="function"?Q(o,r,{view:this,node:this.cell}).filter(f=>pe.isCell(f)&&this.cell.id!==f.id&&!f.isDescendantOf(this.cell)):r.model.getNodesUnderNode(s,{by:o});if(i.frontOnly&&a.length>0){const f=up(a,"zIndex"),p=mP(Object.keys(f).map(g=>parseInt(g,10)));p&&(a=f[p])}a=a.filter(f=>f.visible);let c=null;const u=t.candidateEmbedView,d=i.validate;for(let f=a.length-1;f>=0;f-=1){const p=a[f];if(u&&u.cell.id===p.id){c=u;break}else{const g=p.findView(r);if(d&&Q(d,r,{child:this.cell,parent:g.cell,childView:this,parentView:g})){c=g;break}}}this.clearEmbedding(t),c&&c.highlight(null,{type:"embedding"}),t.candidateEmbedView=c;const h=r.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:s,node:s,view:r.findViewByCell(s),x:h.x,y:h.y,currentParent:s.getParent(),candidateParent:c?c.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const s=t.cell||this.cell,r=t.graph||this.graph,i=r.findViewByCell(s),o=s.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(s,void 0,{ui:!0})):o&&o.unembed(s,{ui:!0}),r.model.getConnectedEdges(s,{deep:!0}).forEach(c=>{c.updateParent({ui:!0})}),i&&a){const c=r.snapToGrid(e.clientX,e.clientY);i.notify("node:embedded",{e,cell:s,x:c.x,y:c.y,node:s,view:r.findViewByCell(s),previousParent:o,currentParent:s.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,s){if(t.getAttribute("magnet")!=="passive"){const r=this.graph.options.connecting.validateMagnet;return r?Q(r,this.graph,{e:s,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,s){if(!this.can("magnetConnectable"))return;e.stopPropagation();const r=e.currentTarget,i=this.graph;this.setEventData(e,{targetMagnet:r}),this.validateMagnet(this,r,e)?(i.options.magnetThreshold<=0&&this.startConnectting(e,r,t,s),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,s),i.view.delegateDragEvents(e,this)}startConnectting(e,t,s,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(t,s,r);i.setEventData(e,i.prepareArrowheadDragging("target",{x:s,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:i}),i.notifyMouseDown(e,s,r)}getDefaultEdge(e,t){let s;const r=this.graph.options.connecting.createEdge;return r&&(s=Q(r,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),s}createEdgeFromMagnet(e,t,s){const r=this.graph,i=r.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,s,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:s})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(e,t,s){const r=this.getEventData(e),i=r.edgeView;if(i)i.onMouseMove(e,t,s),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,c=this.getEventTarget(e),u=r.targetMagnet;if(a==="onleave"){if(u===c||u.contains(c))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,u,t,s)}}stopMagnetDragging(e,t,s){const i=this.eventData(e).edgeView;i&&(i.onMouseUp(e,t,s),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,s){this.notify("node:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,s,r,i){let o=[i];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const c=a.getSelectedCells();c.includes(i)&&(o=c.filter(u=>u.isNode()))}o.forEach(c=>{this.notify(e,{e:t,x:s,y:r,cell:c,node:c,view:c.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?Q(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}startNodeDragging(e,t,s){const r=this.getDelegatedView();if(r==null||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,s);this.setEventData(e,{targetView:r,action:"move"});const i=O.create(r.cell.getPosition());r.setEventData(e,{moving:!1,offset:i.diff(t,s),restrict:this.getRestrictArea(r)})}dragNode(e,t,s){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(e),c=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,s,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const d=ve.snapToGrid(t+c.x,o),h=ve.snapToGrid(s+c.y,o);r.setPosition(d,h,{restrict:u,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,s){const r=this.getEventData(e);r.embedding&&this.finalizeEmbedding(e,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,s,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");s&&s.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.findPortElem=="function"&&typeof r.resize=="function"&&typeof r.rotate=="function"&&typeof r.translate=="function"}n.isNodeView=e})(fn||(fn={})),fn.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),fn.registry.register("node",fn,!0);var AB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Zn extends Fe{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return Zn.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const s=this.cell.getSource();return new U(s.x,s.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new U(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const s=this.cell.getTarget();return new U(s.x,s.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new U(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let s=e;if(this.hasAction(s,"source")){if(!this.updateTerminalProperties("source"))return s;s=this.removeAction(s,"source")}if(this.hasAction(s,"target")){if(!this.updateTerminalProperties("target"))return s;s=this.removeAction(s,"target")}return this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","labels","tools"]),s):(s=this.handleAction(s,"update",()=>this.update(t)),s=this.handleAction(s,"labels",()=>this.onLabelsChange(t)),s=this.handleAction(s,"tools",()=>this.renderTools()),s)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let s=0,r=t.length;s<r;s+=1){const i=t[s],o=this.labelCache[s],a=this.labelSelectors[s],c=this.graph.options.onEdgeLabelRendered;if(c){const u=c({edge:e,label:i,container:o,selectors:a});u&&(this.labelDestroyFn[s]=u)}}}}destroyCustomizeLabels(){const e=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let t=0,s=e.length;t<s;t+=1){const r=this.labelDestroyFn[t],i=this.labelCache[t],o=this.labelSelectors[t];r&&i&&o&&r({edge:this.cell,label:e[t],container:i,selectors:o})}this.labelDestroyFn={}}renderLabels(){const e=this.cell,t=e.getLabels(),s=t.length;let r=this.labelContainer;if(this.labelCache={},this.labelSelectors={},s<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=dn("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let i=0,o=t.length;i<o;i+=1){const a=t[i],c=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,d;if(c)u=c.node,d=c.selectors;else{const f=e.getDefaultLabel(),p=this.normalizeLabelMarkup(this.parseLabelMarkup(f.markup));u=p.node,d=p.selectors}u.setAttribute("data-index",`${i}`),r.appendChild(u);const h=this.rootSelector;if(d[h])throw new Error("Ambiguous label root selector.");d[h]=u,this.labelCache[i]=u,this.labelSelectors[i]=d}return r.parentNode==null&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const s=e.propertyPathArray||[],r=s.length;if(r>1){const i=s[1];if(t[i]){if(r===2)return typeof e.propertyValue=="object"&&ua(e.propertyValue,"markup");if(s[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=se.createVectors(e),s=document.createDocumentFragment();for(let r=0,i=t.length;r<i;r+=1){const o=t[r].node;s.appendChild(o)}return{fragment:s,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let s;const r=t.childNodes;return r.length>1||r[0].nodeName.toUpperCase()!=="G"?s=se.create("g").append(t):s=se.create(r[0]),s.addClass(this.prefixClassName("edge-label")),{node:s.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,s=this.can("edgeLabelMovable"),r=e.getDefaultLabel();for(let i=0,o=t.length;i<o;i+=1){const a=this.labelCache[i],c=this.labelSelectors[i];a.setAttribute("cursor",s?"move":"default");const u=t[i],d=Ye({},r.attrs,u.attrs);this.updateAttrs(a,d,{selectors:c,rootBBox:u.size?U.fromSize(u.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs(),s=AB(t,["text"]);return s!=null&&this.updateAttrs(this.container,s,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,s=t.getVertices(),r=[this.sourceAnchor,...s,this.targetAnchor],i=r.length,o=new $e(r);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),c=a.length;return i===c?0:(t.setVertices(a.slice(1,c-1),e),i-c)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return O.create(this.sourceAnchor);case"target":return O.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return O.create(this.sourcePoint);case"target":return O.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const s=this.sourceView;return s?this.sourceMagnet||s.container:null}case"target":{if(t.raw)return this.targetMagnet;const s=this.targetView;return s?this.targetMagnet||s.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const s=e.tx||0,r=e.ty||0;this.routePoints=new $e(this.routePoints).translate(s,r).points,this.translateConnectionPoints(s,r),this.path.translate(s,r)}else{const s=t.getVertices(),r=this.findAnchors(s);this.sourceAnchor=r.source,this.targetAnchor=r.target,this.routePoints=this.findRoutePoints(s);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(e){const t=this.cell,s=t.source,r=t.target,i=e[0],o=e[e.length-1];return r.priority&&!s.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(e,t,s,r){let i,o;const a=this.cell,c=a[e],u=a[s],d=this.getTerminalView(e),h=this.getTerminalView(s),f=this.getTerminalMagnet(e),p=this.getTerminalMagnet(s);if(d){let g;t?g=O.create(t):h?g=p:g=O.create(u),i=this.getAnchor(c.anchor,d,f,g,e)}else i=O.create(c);if(h){const g=O.create(r||i);o=this.getAnchor(u.anchor,h,p,g,s)}else o=O.isPointLike(u)?O.create(u):new O;return{[e]:i,[s]:o}}getAnchor(e,t,s,r,i){const o=t.isEdgeElement(s),a=this.graph.options.connecting;let c=typeof e=="string"?{name:e}:e;if(!c){const h=o?(i==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(i==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;c=typeof h=="string"?{name:h}:h}if(!c)throw new Error("Anchor should be specified.");let u;const d=c.name;if(o){const h=Zr.registry.get(d);if(typeof h!="function")return Zr.registry.onNotFound(d);u=Q(h,this,t,s,r,c.args||{},i)}else{const h=Kr.registry.get(d);if(typeof h!="function")return Kr.registry.onNotFound(d);u=Q(h,this,t,s,r,c.args||{},i)}return u?u.round(this.POINT_ROUNDING):new O}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Ts.presets.normal,s=this.cell.getRouter()||t;let r;if(typeof s=="function")r=Q(s,this,e,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ts.registry.get(i):Ts.presets.normal;if(typeof a!="function")return Ts.registry.onNotFound(i);r=Q(a,this,e,o,this)}return r==null?e.map(i=>O.create(i)):r.map(i=>O.create(i))}findConnectionPoints(e,t,s){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),c=this.sourceView,u=this.targetView,d=e[0],h=e[e.length-1];let f;if(c&&!c.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||c.container,m=d||s,y=new q(m,t),b=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;f=this.getConnectionPoint(b,c,g,y,"source")}else f=t;let p;if(u&&!u.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||u.container,m=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,y=h||t,b=new q(y,s);p=this.getConnectionPoint(m,u,g,b,"target")}else p=s;return{source:f,target:p}}getConnectionPoint(e,t,s,r,i){const o=r.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,c=typeof e=="string"?{}:e.args,u=Qr.registry.get(a);if(typeof u!="function")return Qr.registry.onNotFound(a);const d=Q(u,this,r,t,s,c||{},i);return d?d.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,s){const r=h=>{const f=this.cell.getAttrs(),p=Object.keys(f);for(let g=0,m=p.length;g<m;g+=1){const y=f[p[g]];if(y[`${h}Marker`]||y[`${h}-marker`]){const b=y.strokeWidth||y["stroke-width"];if(b)return parseFloat(b);break}}return null},i=e[0],o=e[e.length-1];let a,c;const u=r("source");u&&(a=t.clone().move(i||s,-u));const d=r("target");return d&&(c=s.clone().move(o||t,-d)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=c||s.clone(),{source:a,target:c}}findPath(e,t,s){const r=this.cell.getConnector()||this.graph.options.connecting.connector;let i,o,a;if(typeof r=="string"?i=r:(i=r.name,o=r.args),i){const u=nr.registry.get(i);if(typeof u!="function")return nr.registry.onNotFound(i);a=u}else a=nr.presets.normal;const c=Q(a,this,t,s,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof c=="string"?ee.parse(c):c}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,s=t.getLabels();if(s.length===0)return this;const r=t.getDefaultLabel(),i=this.normalizeLabelPosition(r.position);for(let o=0,a=s.length;o<a;o+=1){const c=s[o],u=this.labelCache[o];if(!u)continue;const d=this.normalizeLabelPosition(c.position),h=Ye({},i,d),f=this.getLabelTransformationMatrix(h);u.setAttribute("transform",jr(f))}return this}updateTerminalProperties(e){const t=this.cell,s=this.graph,r=t[e],i=r&&r.cell,o=`${e}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=s.getCellById(i);if(!a)throw new Error(`Edge's ${e} node with id "${i}" not exists`);const c=a.findView(s);return c?(this[o]=c,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,s=this.getTerminalView(e);if(s){let r=s.getMagnetFromEdgeTerminal(this.cell[e]);r===s.container&&(r=null),this[t]=r}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:Ye({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return ua(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return ua(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return ua(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(qn(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,s,r){const i={distance:0};let o=0,a;typeof s=="number"?(o=s,a=r):a=s,a!=null&&(i.options=a);const c=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),d=a&&a.absoluteDistance&&a.reverseDistance,h=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},p=new O(e,t),g=h.closestPointT(p,f),m=this.getConnectionLength()||0;let y=h.lengthAtT(g,f);u&&(y=m>0?y/m:0),d&&(y=-1*(m-y)||1),i.distance=y;let b;c||(b=h.tangentAtT(g));let w;if(b)w=b.pointOffset(p);else{const x=h.pointAtT(g),v=p.diff(x);w={x:v.x,y:v.y}}return i.offset=w,i.angle=o,i}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),s=t.options||{},r=t.angle||0,i=t.distance,o=i>0&&i<=1;let a=0;const c={x:0,y:0},u=t.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(c.x=u.x),u.y!=null&&(c.y=u.y)));const d=c.x!==0||c.y!==0||a===0,h=s.keepGradient,f=s.ensureLegibility,p=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},m=o?i*this.getConnectionLength():i,y=p.tangentAtLength(m,g);let b,w=r;if(y){if(d)b=y.start,b.translate(c);else{const x=y.clone();x.rotate(-90,y.start),x.setLength(a),b=x.end}h&&(w=y.angle()+r,f&&(w=me.normalize((w+90)%180-90)))}else b=p.start,d&&b.translate(c);return rt().translate(b.x,b.y).rotate(w)}getVertexIndex(e,t){const r=this.cell.getVertices(),i=this.getClosestPointLength(new O(e,t));let o=0;if(i!=null)for(const a=r.length;o<a;o+=1){const c=r[o],u=this.getClosestPointLength(c);if(u!=null&&i<u)break}return o}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,edge:i,cell:o}:{e,x:t,y:s,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(e,t,s){this.notify("edge:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("edge:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("edge:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("edge:mouseup",this.getEventArgs(e,t,s))}onClick(e,t,s){super.onClick(e,t,s),this.notify("edge:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("edge:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("edge:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startEdgeDragging(e,t,s)}onMouseMove(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.dragLabel(e,t,s);break}case"drag-arrowhead":{this.dragArrowhead(e,t,s);break}case"drag-edge":{this.dragEdge(e,t,s);break}}return this.notifyMouseMove(e,t,s),r}onMouseUp(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.stopLabelDragging(e,t,s);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,s);break}case"drag-edge":{this.stopEdgeDragging(e,t,s);break}}return this.notifyMouseUp(e,t,s),this.checkMouseleave(e),r}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){if(cy(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r)))}this.notifyMouseDown(e,s,r)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}onLabelMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startLabelDragging(e,t,s),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,s){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,s);return}this.setEventData(e,{x:t,y:s,moving:!1,action:"drag-edge"})}dragEdge(e,t,s){const r=this.getEventData(e);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-r.x,s-r.y,{ui:!0}),this.setEventData(e,{x:t,y:s}),this.notify("edge:moving",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,s){const r=this.getEventData(e);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(e,t){const s=this.getTerminalMagnet(e),r={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:s,initialTerminal:bc(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let s,r=0,i=0;e==="source"?(r=2,s="target"):(i=2,s="source");const o=this.cell[s],a=o.cell;if(a){let c;const u=t[r]=this.graph.findViewByCell(a);u&&(c=u.getMagnetFromEdgeTerminal(o),c===u.container&&(c=void 0)),t[r+1]=c}return(c,u)=>(t[i]=c,t[i+1]=c.container===u?void 0:u,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,s,r,i,o,a){const c=this.graph.options.connecting,u=c.allowLoop,d=c.allowNode,h=c.allowEdge,f=c.allowPort,p=c.allowMulti,g=c.validateConnection,m=o?o.cell:null,y=i==="target"?s:e,b=i==="target"?r:t;let w=!0;const x=v=>{const S=i==="source"?a?a.port:null:m?m.getSourcePortId():null,E=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return Q(v,this.graph,{edge:m,edgeView:o,sourceView:e,targetView:s,sourcePort:S,targetPort:E,sourceMagnet:t,targetMagnet:r,sourceCell:e?e.cell:null,targetCell:s?s.cell:null,type:i})};if(u!=null&&(typeof u=="boolean"?!u&&e===s&&(w=!1):w=x(u)),w&&f!=null&&(typeof f=="boolean"?!f&&b&&(w=!1):w=x(f)),w&&h!=null&&(typeof h=="boolean"?!h&&Zn.isEdgeView(y)&&(w=!1):w=x(h)),w&&d!=null&&b==null&&(typeof d=="boolean"?!d&&fn.isNodeView(y)&&(w=!1):w=x(d)),w&&p!=null&&o){const v=o.cell,S=i==="source"?a:v.getSource(),E=i==="target"?a:v.getTarget(),C=a?this.graph.getCellById(a.cell):null;if(S&&E&&S.cell&&E.cell&&C)if(typeof p=="function")w=x(p);else{const M=this.graph.model.getConnectedEdges(C,{outgoing:i==="source",incoming:i==="target"});M.length&&(p==="withPort"?M.some(_=>{const T=_.getSource(),k=_.getTarget();return T&&k&&T.cell===S.cell&&k.cell===E.cell&&T.port!=null&&T.port===S.port&&k.port!=null&&k.port===E.port})&&(w=!1):p||M.some(_=>{const T=_.getSource(),k=_.getTarget();return T&&k&&T.cell===S.cell&&k.cell===E.cell})&&(w=!1))}}return w&&g!=null&&(w=x(g)),w}allowConnectToBlank(e){const t=this.graph,r=t.options.connecting.allowBlank;if(typeof r!="function")return!!r;const i=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),c=t.findViewByCell(o),u=t.findViewByCell(a);return Q(r,t,{edge:e,edgeView:i,sourceCell:o,targetCell:a,sourceView:c,targetView:u,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(e,t,s){const r=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const i=r.options.connecting.validateEdge;return i?Q(i,r,{edge:e,type:t,previous:s}):!0}arrowheadDragging(e,t,s,r){r.x=t,r.y=s,r.currentTarget!==e&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(e),r.currentView?(r.currentMagnet=r.currentView.findMagnet(e),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,t,s,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=e,this.cell.prop(r.terminalType,{x:t,y:s},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(e,t,s){const r=e.currentView,i=e.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=e.terminalType,a=r.getEdgeTerminal(i,t,s,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,s){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a=typeof i=="object"&&i.radius||50,c=typeof i=="object"&&i.anchor||"center",u=r.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=r.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(S=>S!==this);u.push(...v)}const d=s.closestView||null,h=s.closestMagnet||null;s.closestView=null,s.closestMagnet=null;let f,p=Number.MAX_SAFE_INTEGER;const g=new O(e,t);u.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())f=c==="center"?v.cell.getBBox().getCenter().distance(g):v.cell.getBBox().getNearestPointToPoint(g).distance(g);else if(v.isEdgeView()){const S=v.getClosestPoint(g);S?f=S.distance(g):f=Number.MAX_SAFE_INTEGER}f<a&&f<p&&(h===v.container||this.validateConnection(...s.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,e,t,this.cell,s.terminalType)))&&(p=f,s.closestView=v,s.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(S=>{if(S.getAttribute("magnet")!=="false"){const E=v.getBBoxOfElement(S);f=g.distance(E.getCenter()),f<a&&f<p&&(h===S||this.validateConnection(...s.getValidateConnectionArgs(v,S),v.getEdgeTerminal(S,e,t,this.cell,s.terminalType)))&&(p=f,s.closestView=v,s.closestMagnet=S)}})});let m;const y=s.terminalType,b=s.closestView,w=s.closestMagnet,x=h!==w;if(d&&x&&d.unhighlight(h,{type:"magnetAdsorbed"}),b){if(!x)return;b.highlight(w,{type:"magnetAdsorbed"}),m=b.getEdgeTerminal(w,e,t,this.cell,y)}else m={x:e,y:t};this.cell.setTerminal(y,m,{},Object.assign(Object.assign({},s.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,s=e.closestMagnet;t&&s&&(t.unhighlight(s,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(s)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const s=e.terminalType,r=e.initialTerminal,i=this.cell[s];if(i&&!Be.equalTerminals(r,i)){const a=this.graph,c=r,u=c.cell?a.getCellById(c.cell):null,d=c.port,h=u?a.findViewByCell(u):null,f=u||e.isNewEdge?null:O.create(r).toJSON(),p=i,g=p.cell?a.getCellById(p.cell):null,m=p.port,y=g?a.findViewByCell(g):null,b=g?null:O.create(i).toJSON();this.notify("edge:connected",{e:t,previousCell:u,previousPort:d,previousView:h,previousPoint:f,currentCell:g,currentView:y,currentPort:m,currentPoint:b,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:s,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,s=t.model.getCells();e.marked={};for(let r=0,i=s.length;r<i;r+=1){const o=t.findViewByCell(s[r]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const c=a.filter(u=>this.validateConnection(...e.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,e.x,e.y,this.cell,e.terminalType)));if(c.length>0){for(let u=0,d=c.length;u<d;u+=1)o.highlight(c[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=c}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(s=>{const r=this.graph.findViewByCell(s);r&&(t[s].forEach(o=>{r.unhighlight(o,{type:"magnetAvailable"})}),r.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,s){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,s);return}const i=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:t,y:s});this.setEventData(e,o)}dragArrowhead(e,t,s){const r=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,s,r):this.arrowheadDragging(this.getEventTarget(e),t,s,r)}stopArrowheadDragging(e,t,s){const r=this.graph,i=this.getEventData(e);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,t,s),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,e)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(e,t,s){if(this.can("edgeLabelMovable")){const r=e.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),a=this.getLabelPositionArgs(i),c=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,c);this.setEventData(e,{index:i,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,s){const r=this.getEventData(e),i=this.cell.getLabelAt(r.index),o=Ye({},i,{position:this.getLabelPosition(t,s,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)}stopLabelDragging(e,t,s){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.getConnection=="function"}n.isEdgeView=e})(Zn||(Zn={})),Zn.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),Zn.registry.register("edge",Zn,!0);var NB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class An extends ye{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:s}=_e.parseJSONMarkup(An.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=An.snapshoot(this.container),K(this.container,this.prefixClassName("graph")),_t(this.container,s),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&pe.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onDblClick(t,r.x,r.y):this.graph.trigger("blank:dblclick",{e:t,x:r.x,y:r.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onClick(t,r.x,r.y):this.graph.trigger("blank:click",{e:t,x:r.x,y:r.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=Q(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.isPreventDefaultContextMenu(s)&&e.preventDefault(),this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onContextMenu(t,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:t,x:r.x,y:r.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const s=this.constructor;this.delegateDocumentEvents(s.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;this.options.preventDefaultMouseDown&&e.preventDefault();const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onMouseDown(t,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:r.x,y:r.y})),this.delegateDragEvents(t,s)}onMouseMove(e){const t=this.getEventData(e),s=t.startPosition;if(s&&s.x===e.clientX&&s.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const i=this.normalizeEvent(e),o=this.graph.snapToGrid(i.clientX,i.clientY),a=t.currentView;a?a.onMouseMove(i,o.x,o.y):this.graph.trigger("blank:mousemove",{e:i,x:o.x,y:o.y}),this.setEventData(i,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY),i=this.getEventData(e).currentView;if(i?i.onMouseUp(t,s.x,s.y):this.graph.trigger("blank:mouseup",{e:t,x:s.x,y:s.y}),!e.isPropagationStopped()){const o=new Mn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseEnter(t)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseLeave(t)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=t.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));s?s.onMouseWheel(t,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:i.x,y:i.y})}onCustomEvent(e){const t=e.currentTarget,s=t.getAttribute("event")||t.getAttribute("data-event");if(s){const r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,s,o.x,o.y)}}}handleMagnetEvent(e,t){const s=e.currentTarget,r=s.getAttribute("magnet");if(r&&r.toLowerCase()!=="false"){const i=this.findView(s);if(i){const o=this.normalizeEvent(e);if(this.guard(o,i))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);Q(t,this.graph,i,o,s,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetMouseDown(s,r,i,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetDblClick(s,r,i,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(s,r,i,o,a)=>{s.onMagnetContextMenu(r,i,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,s=this.findView(t);if(s){const r=this.normalizeEvent(e);if(this.guard(r,s))return;const i=this.graph.snapToGrid(r.clientX,r.clientY);s.onLabelMouseDown(r,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}NB([ye.dispose()],An.prototype,"dispose",null),function(n){const e=`${Gt.prefixCls}-graph`;n.markup=[{ns:st.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:st.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:st.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":st.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(s){const r=s.cloneNode();return s.childNodes.forEach(i=>r.appendChild(i)),()=>{for(Ji(s);s.attributes.length>0;)s.removeAttribute(s.attributes[0].name);for(let i=0,o=r.attributes.length;i<o;i+=1){const a=r.attributes[i];s.setAttribute(a.name,a.value)}r.childNodes.forEach(i=>s.appendChild(i))}}n.snapshoot=t}(An||(An={})),function(n){const e=Gt.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(An||(An={}));const TB=`.x6-graph {
119
+ `;return s.raw?ne.parse(c):c},xB=function(n,e,t,s={}){const r=new ne;r.appendSegment(ne.createSegment("M",n));const i=1/3,o=2/3,a=s.radius||10;let c,u;for(let d=0,f=t.length;d<f;d+=1){const h=O.create(t[d]),p=t[d-1]||n,g=t[d+1]||e;c=u||h.distance(p)/2,u=h.distance(g)/2;const m=-Math.min(a,c),y=-Math.min(a,u),b=h.clone().move(p,m).round(),w=h.clone().move(g,y).round(),x=new O(i*b.x+o*h.x,o*h.y+i*b.y),v=new O(i*w.x+o*h.x,o*h.y+i*w.y);r.appendSegment(ne.createSegment("L",b)),r.appendSegment(ne.createSegment("C",x,v,w))}return r.appendSegment(ne.createSegment("L",e)),s.raw?r:r.serialize()},vB=function(n,e,t,s={}){let r,i=s.direction;if(t&&t.length!==0){const o=[n,...t,e],a=Be.throughPoints(o);r=new ne(a)}else if(r=new ne,r.appendSegment(ne.createSegment("M",n)),i||(i=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),i==="H"){const o=(n.x+e.x)/2;r.appendSegment(ne.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;r.appendSegment(ne.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return s.raw?r:r.serialize()},Fb=1,gl=1/3,ml=2/3;function CB(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let s=0;s<t.length;s+=1)t[s].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function fd(n,e,t=[]){const s=[n,...t,e],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new Y(i,a))}),r}function SB(n,e){const t=[];return e.forEach(s=>{const r=n.intersectsWithLine(s);r&&t.push(r)}),t}function Ub(n,e){return new Y(n,e).squaredLength()}function EB(n,e,t){return e.reduce((s,r,i)=>{if(yl.includes(r))return s;const o=s.pop()||n,a=O.create(r).move(o.start,-t);let c=O.create(r).move(o.start,+t);const u=e[i+1];if(u!=null){const h=c.distance(u);h<=t&&(c=u.move(o.start,h),yl.push(u))}else if(a.distance(o.end)<t*2+Fb)return s.push(o),s;if(c.distance(o.start)<t*2+Fb)return s.push(o),s;const f=new Y(a,c);return mo.push(f),s.push(new Y(o.start,a),f,new Y(c,o.end)),s},[])}function Hb(n,e,t,s){const r=new ne;let i;return i=ne.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(mo.includes(o)){let c,u,d,f;if(t==="arc"){c=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(c+=180);const p=o.getCenter(),g=new Y(p,o.end).rotate(c,p);let m;m=new Y(o.start,p),d=m.pointAt(2/3).rotate(c,o.start),f=g.pointAt(1/3).rotate(-c,g.end),i=ne.createSegment("C",d,f,g.end),r.appendSegment(i),m=new Y(p,o.end),d=g.pointAt(1/3).rotate(c,g.end),f=m.pointAt(1/3).rotate(-c,o.end),i=ne.createSegment("C",d,f,o.end),r.appendSegment(i)}else if(t==="gap")i=ne.createSegment("M",o.end),r.appendSegment(i);else if(t==="cubic"){c=o.start.theta(o.end);const h=e*.6;let p=e*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(p*=-1),d=new O(o.start.x+h,o.start.y+p).rotate(c,o.start),f=new O(o.end.x-h,o.end.y+p).rotate(c,o.end),i=ne.createSegment("C",d,f,o.end),r.appendSegment(i)}}else{const c=n[a+1];s===0||!c||mo.includes(c)?(i=ne.createSegment("L",o.end),r.appendSegment(i)):OB(s,r,o.end,o.start,c.end)}}),r}function OB(n,e,t,s,r){const i=t.distance(s)/2,o=t.distance(r)/2,a=-Math.min(n,i),c=-Math.min(n,o),u=t.clone().move(s,a).round(),d=t.clone().move(r,c).round(),f=new O(gl*u.x+ml*t.x,ml*t.y+gl*u.y),h=new O(gl*d.x+ml*t.x,ml*t.y+gl*d.y);let p;p=ne.createSegment("L",u),e.appendSegment(p),p=ne.createSegment("C",f,h,d),e.appendSegment(p)}let mo,yl;const MB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,s={}){mo=[],yl=[],CB(this);const r=s.size||5,i=s.type||"arc",o=s.radius||0,a=s.ignoreConnectors||["smooth"],c=this.graph,d=c.model.getEdges();if(d.length===1)return Hb(fd(n,e,t),r,i,o);const f=this.cell,h=d.indexOf(f),p=c.options.connecting.connector||{},g=d.filter((v,S)=>{const E=v.getConnector()||p;return a.includes(E.name)?!1:S>h?E.name!=="jumpover":!0}),m=g.map(v=>c.findViewByCell(v)),y=fd(n,e,t),b=m.map(v=>v==null?[]:v===this?y:fd(v.sourcePoint,v.targetPoint,v.routePoints)),w=[];y.forEach(v=>{const S=g.reduce((E,C,P)=>{if(C!==f){const A=SB(v,b[P]);E.push(...A)}return E},[]).sort((E,C)=>Ub(v.start,E)-Ub(v.start,C));S.length>0?w.push(...EB(v,S,r)):w.push(v)});const x=Hb(w,r,i,o);return mo=[],yl=[],s.raw?x:x.serialize()},loop:wB,normal:bB,rounded:xB,smooth:vB},Symbol.toStringTag,{value:"Module"}));var er;(function(n){n.presets=MB,n.registry=Fe.create({type:"connector"}),n.registry.register(n.presets,!0)})(er||(er={}));var PB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Gb extends Te{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(_e(e)),this.changed={}}mutate(e,t={}){const s=t.unset===!0,r=t.silent===!0,i=[],o=this.changing;this.changing=!0,o||(this.previous=_e(this.data),this.changed={});const a=this.data,c=this.previous,u=this.changed;if(Object.keys(e).forEach(d=>{const f=d,h=e[f];Cn(a[f],h)||i.push(f),Cn(c[f],h)?delete u[f]:u[f]=h,s?delete a[f]:a[f]=h}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=t,i.forEach(d=>{this.emit("change:*",{key:d,options:t,store:this,current:a[d],previous:c[d]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:c,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const s=this.data[e];return s??t}getPrevious(e){if(this.previous){const t=this.previous[e];return t??void 0}}set(e,t,s){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},s)),this}remove(e,t){const r={};let i;if(typeof e=="string")r[e]=void 0,i=t;else if(Array.isArray(e))e.forEach(o=>r[o]=void 0),i=t;else{for(const o in this.data)r[o]=void 0;i=e}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(e){return Ru(this.data,e,"/")}setByPath(e,t,s={}){const r="/",i=Array.isArray(e)?[...e]:e.split(r),o=Array.isArray(e)?e.join(r):e,a=i[0],c=i.length;if(s.propertyPath=o,s.propertyValue=t,s.propertyPathArray=i,c===1)this.set(a,t,s);else{const u={};let d=u,f=a;for(let g=1;g<c;g+=1){const m=i[g],y=Number.isFinite(Number(m));d=d[f]=y?[]:{},f=m}Ir(u,i,t,r);const h=_e(this.data);s.rewrite&&Qm(h,e,r);const p=We(h,u);this.set(a,p[a],s)}return this}removeByPath(e,t){const s=Array.isArray(e)?e:e.split("/"),r=s[0];if(s.length===1)this.remove(r,t);else{const i=s.slice(1),o=_e(this.get(r));o&&Qm(o,i),this.set(r,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?_e(this.changed):null;const t=this.changing?this.previous:this.data,s={};let r;for(const i in e){const o=e[i];Cn(t[i],o)||(s[i]=o,r=!0)}return r?_e(s):null}toJSON(){return _e(this.data)}clone(){const e=this.constructor;return new e(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}PB([Te.dispose()],Gb.prototype,"dispose",null);class yo{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,s={},r="/"){const i=this.cell.getPropByPath(e),o=oP(s,yo.defaultOptions),a=this.getTiming(o.timing),c=this.getInterp(o.interp,i,t);let u=0;const d=Array.isArray(e)?e.join(r):e,f=Array.isArray(e)?e:e.split(r),h=()=>{const p=new Date().getTime();u===0&&(u=p);let m=(p-u)/o.duration;m<1?this.ids[d]=requestAnimationFrame(h):m=1;const y=c(a(m));this.cell.setPropByPath(f,y),s.progress&&s.progress(Object.assign({progress:m,currentValue:y},this.getArgs(d))),m===1&&(this.cell.notify("transition:complete",this.getArgs(d)),s.complete&&s.complete(this.getArgs(d)),this.cell.notify("transition:finish",this.getArgs(d)),s.finish&&s.finish(this.getArgs(d)),this.clean(d))};return setTimeout(()=>{this.stop(e,void 0,r),this.cache[d]={startValue:i,targetValue:t,options:o},this.ids[d]=requestAnimationFrame(h),this.cell.notify("transition:start",this.getArgs(d)),s.start&&s.start(this.getArgs(d))},s.delay),this.stop.bind(this,e,r,s)}stop(e,t={},s="/"){const r=Array.isArray(e)?e:e.split(s);return Object.keys(this.ids).filter(i=>Cn(r,i.split(s).slice(0,r.length))).forEach(i=>{cancelAnimationFrame(this.ids[i]);const o=this.cache[i],a=this.getArgs(i),c=Object.assign(Object.assign({},o.options),t),u=c.jumpedToEnd;u&&o.targetValue!=null&&(this.cell.setPropByPath(i,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),c.complete&&c.complete(Object.assign({},a)));const d=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},d)),c.stop&&c.stop(Object.assign({},d)),this.cell.notify("transition:finish",Object.assign({},a)),c.finish&&c.finish(Object.assign({},a)),this.clean(i)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?Ks[e]:e}getInterp(e,t,s){return e?e(t,s):typeof s=="number"?Zs.number(t,s):typeof s=="string"?s[0]==="#"?Zs.color(t,s):Zs.unit(t,s):Zs.object(t,s)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(yo||(yo={}));var NB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},Wb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class pe extends Te{static config(e){const{markup:t,propHooks:s,attrHooks:r}=e,i=Wb(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),s&&(this.propHooks=this.propHooks.slice(),Array.isArray(s)?this.propHooks.push(...s):typeof s=="function"?this.propHooks.push(s):Object.values(s).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),r&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),r)),this.defaults=We({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:_e(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((s,r)=>r?ee(r,e,s):s,t)}get[Symbol.toStringTag](){return pe.toStringTag}constructor(e={}){super();const s=this.constructor.getDefaults(!0),r=We({},this.preprocess(s),this.preprocess(e));this.id=r.id||Ya(),this.store=new Gb(r),this.animation=new yo(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const s=e.id,i=this.constructor.applyPropHooks(this,e);return s==null&&t!==!0&&(i.id=Ya()),i}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:s,previous:r,options:i}=e;this.notify("change:*",{key:t,options:i,current:s,previous:r,cell:this}),this.notify(`change:${t}`,{options:i,current:s,previous:r,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:s,previous:r,options:i,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const s=this.model;return s&&(s.notify(`cell:${e}`,t),this.isNode()?s.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&s.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,s){if(typeof e=="string")this.store.set(e,t,s);else{const r=this.preprocess(e,!0);this.store.set(We({},this.getProp(),r),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,s={}){return this.model&&(e==="children"?this._children=t?t.map(r=>this.model.getCell(r)).filter(r=>r!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,s),this}removePropByPath(e,t={}){const s=Array.isArray(e)?e:e.split("/");return s[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(s,t),this}prop(e,t,s){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,s||{}):this.setPropByPath(e,t,s||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let s=t.getMaxZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this],s=s-r.length+1;const i=t.total();let o=t.indexOf(this)!==i-r.length;o||(o=r.some((a,c)=>a.getZIndex()!==s+c)),o&&this.batchUpdate("to-front",()=>{s+=r.length,r.forEach((a,c)=>{a.setZIndex(s+c,e)})})}return this}toBack(e={}){const t=this.model;if(t){let s=t.getMinZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this];let i=t.indexOf(this)!==0;i||(i=r.some((o,a)=>o.getZIndex()!==s+a)),i&&this.batchUpdate("to-back",()=>{s-=r.length,r.forEach((o,a)=>{o.setZIndex(s+a,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const s=r=>this.store.set("attrs",r,t);if(t.overwrite===!0)s(e);else{const r=this.getAttrs();t.deep===!1?s(Object.assign(Object.assign({},r),e)):s(We({},r,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const s=this.constructor.getAttrHooks()||{};let r=s[e]||An.registry.get(e);if(!r){const i=oa(e);r=s[i]||An.registry.get(i)}return r||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,s={}){return this.setPropByPath(this.prefixAttrPath(e),t,s),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,s){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,s||{}):this.setAttrByPath(e,t,s||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const s=typeof e=="boolean"?e:!this.isVisible(),r=typeof e=="boolean"?t:e;return s?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const s=r=>this.store.set("data",r,t);if(t.overwrite===!0)s(e);else{const r=this.getData();t.deep===!1?s(typeof e=="object"?Object.assign(Object.assign({},r),e):e):s(We({},r,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(s=>{var r;return(r=this.model)===null||r===void 0?void 0:r.getCell(s)}).filter(s=>s!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let s=this.getParent();for(;s;)t.push(s),s=e.deep!==!1?s.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],s=this.getChildren()||[];for(;s.length>0;){const r=s.shift(),i=r.getChildren();t.push(r),i&&s.push(...i)}return t}{const t=this.getChildren()||[];return t.forEach(s=>{t.push(...s.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let s=this.getParent();for(;s;){if(s===e)return!0;s=s.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return pe.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(s=>s.id),t):this.store.remove("children",t),this}unembed(e,t={}){const s=this.children;if(s!=null&&e!=null){const r=this.getChildIndex(e);r!==-1&&(s.splice(r,1),e.setParent(null,t),this.setChildren(s,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return pe.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,s={}){return e.insertChild(this,t,s),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,s={}){if(e!=null&&e!==this){const r=e.getParent(),i=this!==r;let o=t;if(o==null&&(o=this.getChildCount(),i||(o-=1)),r){const c=r.getChildren();if(c){const u=c.indexOf(e);u>=0&&(e.setParent(null,s),c.splice(u,1),r.setChildren(c,s))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,s),this.setChildren(a,s),i&&this.model){const c=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);c&&c.forEach(d=>d.updateParent(s)),u&&u.forEach(d=>d.updateParent(s))}this.model&&this.model.addCell(e,s)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const s=t.getChildIndex(this);t.removeChildAt(s,e)}return this}removeChild(e,t={}){const s=this.getChildIndex(e);return this.removeChildAt(s,t)}removeChildAt(e,t={}){const s=this.getChildAt(e);return this.children!=null&&s!=null&&(this.unembed(s,t),s.remove(t)),s}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(s=>s.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,s={},r="/"){return this.animation.start(e,t,s,r)}stopTransition(e,t,s="/"){return this.animation.stop(e,t,s),this}getTransitions(){return this.animation.get()}translate(e,t,s){return this}scale(e,t,s,r){return this}addTools(e,t,s){const r=Array.isArray(e)?e:[e],i=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof s=="object"?s:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let a=_e(this.getTools());if(a==null||i==null||a.name===i)return a==null&&(a={}),a.items||(a.items=[]),a.name=i,a.items=[...a.items,...r],this.setTools(Object.assign({},a),o)}setTools(e,t={}){return e==null?this.removeTools():this.store.set("tools",pe.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(s=>typeof s=="string"?s===e:s.name===e)}removeTool(e,t={}){const s=_e(this.getTools());if(s){let r=!1;const i=s.items.slice(),o=a=>{i.splice(a,1),r=!0};if(typeof e=="number")o(e);else for(let a=i.length-1;a>=0;a-=1){const c=i[a];(typeof c=="string"?c===e:c.name===e)&&o(a)}r&&(s.items=i,this.setTools(s,t))}return this}getBBox(e){return new F}getConnectionPoint(e,t){return new O}toJSON(e={}){const t=Object.assign({},this.store.get()),s=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${g.name||s.call(g)}"`)}const i=this.constructor,o=e.diff===!0,a=t.attrs||{},c=i.getDefaults(!0),u=o?this.preprocess(c,!0):c,d=u.attrs||{},f={};Object.entries(t).forEach(([g,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!vn(m))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${s.call(m)}" type of key "${g}" on ${r} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const y=u[g];Cn(m,y)&&delete t[g]}}),Object.keys(a).forEach(g=>{const m=a[g],y=d[g];Object.keys(m).forEach(b=>{const w=m[b],x=y?y[b]:null;w!=null&&typeof w=="object"&&!Array.isArray(w)?Object.keys(w).forEach(v=>{const S=w[v];if(y==null||x==null||!Ie(x)||!Cn(x[v],S)){f[g]==null&&(f[g]={}),f[g][b]==null&&(f[g][b]={});const E=f[g][b];E[v]=S}}):(y==null||!Cn(x,w))&&(f[g]==null&&(f[g]={}),f[g][b]=w)})});const h=Object.assign(Object.assign({},t),{attrs:vp(f)?void 0:f});h.attrs==null&&delete h.attrs;const p=h;return p.angle===0&&delete p.angle,_e(p)}clone(e={}){if(!e.deep){const s=Object.assign({},this.store.get());e.keepId||delete s.id,delete s.parent,delete s.children;const r=this.constructor;return new r(s)}return pe.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},s=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),s&&s.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},s=this.model){return s&&s.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,s){const r=this.model;this.startBatch(e,s,r);const i=t();return this.stopBatch(e,s,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}pe.defaults={},pe.attrHooks={},pe.propHooks=[],NB([Te.dispose()],pe.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(pe||(pe={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"}n.isCell=e}(pe||(pe={})),function(n){function e(...i){const o=i.filter(c=>c!=null).map(c=>c.getAncestors()).sort((c,u)=>c.length-u.length);return o.shift().find(c=>o.every(u=>u.includes(c)))||null}n.getCommonAncestor=e;function t(i,o={}){let a=null;for(let c=0,u=i.length;c<u;c+=1){const d=i[c];let f=d.getBBox(o);if(f){if(d.isNode()){const h=d.getAngle();h!=null&&h!==0&&(f=f.bbox(h))}a=a==null?f:a.union(f)}}return a}n.getCellsBBox=t;function s(i){const o=[i,...i.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=s;function r(i){const o=Op(i),a=o.reduce((c,u)=>(c[u.id]=u.clone(),c),{});return o.forEach(c=>{const u=a[c.id];if(u.isEdge()){const h=u.getSourceCellId(),p=u.getTargetCellId();h&&a[h]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[h].id})),p&&a[p]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[p].id}))}const d=c.getParent();d&&a[d.id]&&u.setParent(a[d.id]);const f=c.getChildren();if(f&&f.length){const h=f.reduce((p,g)=>(a[g.id]&&p.push(a[g.id]),p),[]);h.length>0&&u.setChildren(h)}}),a}n.cloneCells=r}(pe||(pe={})),function(n){n.config({propHooks(e){var{tools:t}=e,s=Wb(e,["tools"]);return t&&(s.tools=n.normalizeTools(t)),s}})}(pe||(pe={}));var ni;(function(n){let e,t;function s(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=s;function r(o){e=o}n.setEdgeRegistry=r;function i(o){t=o}n.setNodeRegistry=i})(ni||(ni={}));class AB{constructor(e){this.ports=[],this.groups={},this.init(_e(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const s=this.getPortsByGroup(e),r=e?this.getGroup(e):null,i=r?r.position:null,o=i?i.name:null;let a;if(o!=null){const f=Qs.registry.get(o);if(f==null)return Qs.registry.onNotFound(o);a=f}else a=Qs.presets.left;const c=s.map(f=>f&&f.position&&f.position.args||{}),u=i&&i.args||{};return a(c,t,u).map((f,h)=>{const p=s[h];return{portLayout:f,portId:p.id,portSize:p.size,portAttrs:p.attrs,labelSize:p.label.size,labelLayout:this.getPortLabelLayout(p,O.create(f.position),t)}})}init(e){const{groups:t,items:s}=e;t!=null&&Object.keys(t).forEach(r=>{this.groups[r]=this.parseGroup(t[r])}),Array.isArray(s)&&s.forEach(r=>{this.ports.push(this.parsePort(r))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),s=this.getGroup(e.group)||{};return t.markup=t.markup||s.markup,t.attrs=We({},s.attrs,t.attrs),t.position=this.createPosition(s,t),t.label=We({},s.label,this.getLabel(t)),t.zIndex=this.getZIndex(s,t),t.size=Object.assign(Object.assign({},s.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return We({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const s=e.label||{};return s.position=this.getPortLabelPosition(s.position,t),s}getPortLabelLayout(e,t,s){const r=e.label.position.name||"left",i=e.label.position.args||{},o=qr.registry.get(r)||qr.presets.left;return o?o(t,s,i):null}}var bl=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let He=class w0 extends pe{get[Symbol.toStringTag](){return w0.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:s,y:r,width:i,height:o}=e,a=bl(e,["x","y","width","height"]);if(s!=null||r!=null){const c=a.position;a.position=Object.assign(Object.assign({},c),{x:s??(c?c.x:0),y:r??(c?c.y:0)})}if(i!=null||o!=null){const c=a.size;a.size=Object.assign(Object.assign({},c),{width:i??(c?c.width:0),height:o??(c?c.height:0)})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,s){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,s):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,s){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,s),this}resize(e,t,s={}){this.startBatch("resize",s);const r=s.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":t=i.height;break;case"top":case"bottom":e=i.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[r];const c=ye.normalize(this.getAngle()||0);s.absolute&&(a+=Math.floor((c+45)/90),a%=4);const u=this.getBBox();let d;a===0?d=u.getBottomLeft():a===1?d=u.getCorner():a===2?d=u.getTopRight():d=u.getOrigin();const f=d.clone().rotate(-c,u.getCenter()),h=Math.sqrt(e*e+t*t)/2;let p=a*Math.PI/2;p+=Math.atan(a%2===0?t/e:e/t),p-=ye.toRad(c);const m=O.fromPolar(h,p,f).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},s),this.setPosition(m.x,m.y,s)}else this.store.set("size",{width:e,height:t},s);return this.stopBatch("resize",s),this}scale(e,t,s,r={}){const i=this.getBBox().scale(e,t,s??void 0);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this}position(e,t,s){return typeof e=="number"?this.setPosition(e,t,s):this.getPosition(e)}getPosition(e={}){if(e.relative){const s=this.getParent();if(s!=null&&s.isNode()){const r=this.getPosition(),i=s.getPosition();return{x:r.x-i.x,y:r.y-i.y}}}const t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,s={}){let r,i,o;if(typeof e=="object"?(r=e.x,i=e.y,o=t||{}):(r=e,i=t,o=s||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const c=a.getPosition();r+=c.x,i+=c.y}}if(o.deep){const a=this.getPosition();this.translate(r-a.x,i-a.y,o)}else this.store.set("position",{x:r,y:i},o);return this}translate(e=0,t=0,s={}){if(e===0&&t===0)return this;s.translateBy=s.translateBy||this.id;const r=this.getPosition();if(s.restrict!=null&&s.translateBy===this.id){const o=this.getBBox({deep:!0}),a=s.restrict,c=r.x-o.x,u=r.y-o.y,d=Math.max(a.x+c,Math.min(a.x+a.width+c-o.width,r.x+e)),f=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,r.y+t));e=d-r.x,t=f-r.y}const i={x:r.x+e,y:r.y+t};return s.tx=e,s.ty=t,s.transition?(typeof s.transition!="object"&&(s.transition={}),this.transition("position",i,Object.assign(Object.assign({},s.transition),{interp:Zs.object})),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,s)})):(this.startBatch("translate",s),this.store.set("position",i,s),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,s)}),this.stopBatch("translate",s)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const s=this.getAngle();if(t.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(s-e,t.center);const a=o.x-r.width/2-i.x,c=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(i.x+a,i.y+c,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(s+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),pe.getCellsBBox(t)}return F.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const s=this.getBBox(),r=s.getCenter(),i=e.getTerminal(t);if(i==null)return r;const o=i.port;if(!o||!this.hasPort(o))return r;const a=this.getPort(o);if(!a||!a.group)return r;const u=this.getPortsPosition(a.group)[o].position,d=O.create(u).translate(s.getOrigin()),f=this.getAngle();return f&&d.rotate(-f,r),d}fit(e={}){const s=(this.getChildren()||[]).filter(u=>u.isNode());if(s.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&s.forEach(u=>u.fit(e));let{x:r,y:i,width:o,height:a}=pe.getCellsBBox(s);const c=ps(e.padding);return r-=c.left,i-=c.top,o+=c.left+c.right,a+=c.bottom+c.top,this.store.set({position:{x:r,y:i},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||ke.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",ke.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||ke.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",ke.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||ke.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",ke.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return _e(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return _e(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(s=>s.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new F(0,0,t.width,t.height)).reduce((r,i)=>{const o=i.portLayout;return r[i.portId]={position:Object.assign({},o.position),angle:o.angle||0},r},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,s,r){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),c=s;return this.setPropByPath(a,c,r)}const i=this.prefixPortPath(e),o=t;return this.setPropByPath(i,o,s)}removePortProp(e,t,s){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),s):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,s,r){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):s==null?this.removePortProp(e,t,r):this.setPortProp(e,t,s,r):this.setPortProp(e,t,s)}prefixPortPath(e,t){const s=this.getPortIndex(e);if(s===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${s}`]:Array.isArray(t)?["ports","items",`${s}`,...t]:`ports/items/${s}/${t}`}addPort(e,t){const s=[...this.ports.items];return s.push(e),this.setPropByPath("ports/items",s,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,s){const r=[...this.ports.items];return r.splice(e,0,t),this.setPropByPath("ports/items",r,s),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const s=[...this.ports.items];s.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",s,t)}return this}removePorts(e,t){let s;if(Array.isArray(e)){if(s=t||{},e.length){s.rewrite=!0;const i=[...this.ports.items].filter(o=>!e.some(a=>{const c=typeof a=="string"?a:a.id;return o.id===c}));this.setPropByPath("ports/items",i,s)}}else s=e||{},s.rewrite=!0,this.setPropByPath("ports/items",[],s);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const s={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(s[o.id]=!0)});const i=this.model;i&&!vp(s)&&(i.getConnectedEdges(this,{incoming:!0}).forEach(c=>{const u=c.getTargetPortId();u&&s[u]&&c.remove()}),i.getConnectedEdges(this,{outgoing:!0}).forEach(c=>{const u=c.getSourcePortId();u&&s[u]&&c.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(s=>{typeof s!="object"&&t.push(`Invalid port ${s}.`),s.id==null&&(s.id=this.generatePortId()),e[s.id]&&t.push("Duplicitied port id."),e[s.id]=!0}),t}generatePortId(){return Ya()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new AB(this.ports);const s=this.port.getPorts(),r=t?s.filter(o=>t.find(a=>a.id===o.id)?null:o):[...s],i=t?t.filter(o=>s.find(a=>a.id===o.id)?null:o):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})}};He.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.size=="function"&&typeof r.position=="function"}n.isNode=e}(He||(He={})),function(n){n.config({propHooks(e){var{ports:t}=e,s=bl(e,["ports"]);return t&&(s.ports=Array.isArray(t)?{items:t}:t),s}})}(He||(He={})),function(n){n.registry=Fe.create({type:"node",process(e,t){if(ni.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r}=t,i=bl(t,["inherit"]);if(r)if(typeof r=="string"){const a=this.get(r);a==null?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),ni.setNodeRegistry(n.registry)}(He||(He={})),function(n){let e=0;function t(i){return i?Lu(i):(e+=1,`CustomNode${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=bl(i,["constructorName","overwrite"]),u=Du(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"rect",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(He||(He={}));var wl=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let je=class x0 extends pe{get[Symbol.toStringTag](){return x0.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:s,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:c,targetPort:u,targetPoint:d}=e,h=wl(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),p=g=>typeof g=="string"||typeof g=="number";if(s!=null)if(pe.isCell(s))h.source={cell:s.id};else if(p(s))h.source={cell:s};else if(O.isPoint(s))h.source=s.toJSON();else if(Array.isArray(s))h.source={x:s[0],y:s[1]};else{const g=s.cell;pe.isCell(g)?h.source=Object.assign(Object.assign({},s),{cell:g.id}):h.source=s}if(r!=null||i!=null){let g=h.source;if(r!=null){const m=p(r)?r:r.id;g?g.cell=m:g=h.source={cell:m}}i!=null&&g&&(g.port=i)}else o!=null&&(h.source=O.create(o).toJSON());if(a!=null)if(pe.isCell(a))h.target={cell:a.id};else if(p(a))h.target={cell:a};else if(O.isPoint(a))h.target=a.toJSON();else if(Array.isArray(a))h.target={x:a[0],y:a[1]};else{const g=a.cell;pe.isCell(g)?h.target=Object.assign(Object.assign({},a),{cell:g.id}):h.target=a}if(c!=null||u!=null){let g=h.target;if(c!=null){const m=p(c)?c:c.id;g?g.cell=m:g=h.target={cell:m}}u!=null&&g&&(g.port=u)}else d!=null&&(h.target=O.create(d).toJSON());return super.preprocess(h,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,s={}){return this.setTerminal("source",e,t,s)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,s={}){return this.setTerminal("target",e,t,s)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,s,r={}){if(pe.isCell(t))return this.store.set(e,We({},s,{cell:t.id}),r),this;const i=t;return O.isPoint(t)||i.x!=null&&i.y!=null?(this.store.set(e,We({},s,{x:i.x,y:i.y}),r),this):(this.store.set(e,_e(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(O.isPointLike(t))return O.create(t);const s=this.getTerminalCell(e);return s?s.getConnectionPoint(this,e):new O}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const s={};for(;t&&t.isEdge();){if(s[t.id])return null;s[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,s){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},s),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,s){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},s),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return _e(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,s={}){const r=this.getLabels(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(e)),this.setLabels(r,s)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getLabels();r[e]=this.parseLabel(t),this.setLabels(r,s)}return this}removeLabelAt(e,t={}){const s=this.getLabels(),r=e!=null&&Number.isFinite(e)?e:-1,i=s.splice(r,1);return this.setLabels(s,t),i.length?i[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>i===o||Cn(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>i===o||Cn(i,o))?null:i):e?[...e]:[];s.length>0&&this.notify("labels:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("labels:removed",{removed:r,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const s=Array.isArray(e)?e:[e];return this.store.set("vertices",s.map(r=>O.toJSON(r)),t),this}insertVertex(e,t,s={}){const r=this.getVertices(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,O.toJSON(e)),this.setVertices(r,s)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getVertices();r[e]=t,this.setVertices(r,s)}return this}removeVertexAt(e,t={}){const s=this.getVertices(),r=e!=null&&Number.isFinite(e)?e:-1;return s.splice(r,1),this.setVertices(s,t)}onVertexsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>O.equals(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>O.equals(i,o))?null:i):e?[...e]:[];s.length>0&&this.notify("vertexs:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("vertexs:removed",{removed:r,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||ke.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,s={}){return s.translateBy=s.translateBy||this.id,s.tx=e,s.ty=t,this.applyToPoints(r=>({x:(r.x||0)+e,y:(r.y||0)+t}),s)}scale(e,t,s,r={}){return this.applyToPoints(i=>O.create(i).scale(e,t,s).toJSON(),r)}applyToPoints(e,t={}){const s={},r=this.getSource(),i=this.getTarget();O.isPointLike(r)&&(s.source=e(r)),O.isPointLike(i)&&(s.target=e(i));const o=this.getVertices();return o.length>0&&(s.vertices=o.map(e)),this.store.set(s,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>O.create(t)),this.getTargetPoint()];return new ze(e)}updateParent(e){let t=null;const s=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return s&&r&&(s===r||s.isDescendantOf(r)?t=r:r.isDescendantOf(s)?t=s:t=pe.getCommonAncestor(s,r)),i&&t&&t.id!==i.id&&i.unembed(this,e),t&&(!i||i.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),s=this.getTarget(),r=t.cell,i=s.cell;if(!r||!i)return!1;let o=r===i;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),c=this.getTargetCell();a&&c&&(o=a.isAncestorOf(c,e)||c.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};je.defaults={},function(n){function e(t,s){const r=t,i=s;return r.cell===i.cell?r.port===i.port||r.port==null&&i.port==null:!1}n.equalTerminals=e}(je||(je={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}(je||(je={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.disconnect=="function"&&typeof r.getSource=="function"&&typeof r.getTarget=="function"}n.isEdge=e}(je||(je={})),function(n){n.registry=Fe.create({type:"edge",process(e,t){if(ni.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r="edge"}=t,i=wl(t,["inherit"]);if(typeof r=="string"){const a=this.get(r||"edge");a==null&&r?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),ni.setEdgeRegistry(n.registry)}(je||(je={})),function(n){let e=0;function t(i){return i?Lu(i):(e+=1,`CustomEdge${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=wl(i,["constructorName","overwrite"]),u=Du(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"edge",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(je||(je={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:s,vertices:r}=t,i=wl(t,["label","vertices"]);if(s){i.labels==null&&(i.labels=[]);const o=typeof s=="string"?n.parseStringLabel(s):s;i.labels.push(o)}return r&&Array.isArray(r)&&(i.vertices=r.map(o=>O.create(o).toJSON())),i}}),n.registry.register(e,n)}(je||(je={}));var _B=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class xl extends Te{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,s){let r,i;typeof t=="number"?(r=t,i=Object.assign({merge:!1},s)):(r=this.length,i=Object.assign({merge:!1},t)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&i.sort!==!1,c=this.comparator||null;let u=!1;const d=[],f=[];return o.forEach(h=>{const p=this.get(h);p?i.merge&&!h.isSameStore(p)&&(p.setProp(h.getProp(),s),f.push(p),a&&!u&&(c==null||typeof c=="function"?u=p.hasChanged():typeof c=="string"?u=p.hasChanged(c):u=c.some(g=>p.hasChanged(g)))):(d.push(h),this.reference(h))}),d.length&&(a&&(u=!0),this.cells.splice(r,0,...d),this.length=this.cells.length),u&&this.sort({silent:!0}),i.silent||(d.forEach((h,p)=>{const g={cell:h,index:r+p,options:i};this.trigger("added",g),i.dryrun||h.notify("added",Object.assign({},g))}),u&&this.trigger("sorted"),(d.length||f.length)&&this.trigger("updated",{added:d,merged:f,removed:[],options:i})),this}remove(e,t={}){const s=Array.isArray(e)?e:[e],r=this.removeCells(s,t);return!t.silent&&r.length>0&&this.trigger("updated",{options:t,removed:r,added:[],merged:[]}),Array.isArray(e)?r:r[0]}removeCells(e,t){const s=[];for(let r=0;r<e.length;r+=1){const i=this.get(e[r]);if(i==null)continue;const o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],s.push(i),this.unreference(i),t.dryrun||i.remove(),t.silent||(this.trigger("removed",{cell:i,index:o,options:t}),t.dryrun||i.notify("removed",{cell:i,index:o,options:t}))}return s}reset(e,t={}){const s=this.cells.slice();if(s.forEach(r=>this.unreference(r)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const r=this.cells.slice();this.trigger("reseted",{options:t,previous:s,current:r});const i=[],o=[];r.forEach(a=>{s.some(u=>u.id===a.id)||i.push(a)}),s.forEach(a=>{r.some(u=>u.id===a.id)||o.push(a)}),this.trigger("updated",{options:t,added:i,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Dc(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const s=t.cell;this.trigger(`cell:${e}`,t),s&&(s.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:s})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}_B([xl.dispose()],xl.prototype,"dispose",null);var TB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class et extends Te{get[Symbol.toStringTag](){return et.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new xl(e),this.setup()}notify(e,t){this.trigger(e,t);const s=this.graph;return s&&(e==="sorted"||e==="reseted"||e==="updated"?s.trigger(`model:${e}`,t):s.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const s=t.cell;this.onCellRemoved(s,t.options),this.notify("cell:removed",t),s.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:s}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const s=e.id;if(e.isEdge()){delete this.edges[s];const r=e.getSource(),i=e.getTarget();if(r&&r.cell){const o=this.outgoings[r.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[r.cell])}if(i&&i.cell){const o=this.incomings[i.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[i.cell])}}else delete this.nodes[s];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const s=t==="source"?this.outgoings:this.incomings,r=e.previous(t);if(r&&r.cell){const o=pe.isCell(r.cell)?r.cell.id:r.cell,a=s[o],c=a?a.indexOf(e.id):-1;c>=0&&(a.splice(c,1),a.length===0&&delete s[o])}const i=e.getTerminal(t);if(i&&i.cell){const o=pe.isCell(i.cell)?i.cell.id:i.cell,a=s[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),s[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(s=>this.prepareCell(s,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(s=>this.prepareCell(s,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const s=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const r=t.sort((i,o)=>{const a=i.isEdge()?1:2,c=o.isEdge()?1:2;return a-c});for(;r.length>0;){const i=r.shift();i&&i.remove(s)}},s),this}addNode(e,t={}){const s=He.isNode(e)?e:this.createNode(e);return this.addCell(s,t),s}updateNode(e,t={}){const s=this.createNode(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}createNode(e){return He.create(e)}addEdge(e,t={}){const s=je.isEdge(e)?e:this.createEdge(e);return this.addCell(s,t),s}createEdge(e){return je.create(e)}updateEdge(e,t={}){const s=this.createEdge(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(s=>this.addCell(s,t)),this.addings.delete(e)),this)}addCells(e,t={}){const s=e.length;if(s===0)return this;const r=Object.assign(Object.assign({},t),{position:s-1,maxPosition:s-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:e})),e.forEach(i=>{this.addCell(i,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:e})),this}updateCell(e,t={}){const s=e.id&&this.getCell(e.id);return s?this.batchUpdate("update",()=>(Object.entries(e).forEach(([r,i])=>s.setProp(r,i,t)),!0),e):!1}removeCell(e,t={}){const s=typeof e=="string"?this.getCell(e):e;return s&&this.has(s)?this.collection.remove(s,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);const s=e.clone({keepId:!0});return this.addCell(s),this.getConnectedEdges(e).forEach(i=>{const o=i.getSourceCell(),a=i.getTargetCell();o===e&&i.setSource(Object.assign(Object.assign({},i.getSource()),{cell:t})),a===e&&i.setTarget(Object.assign(Object.assign({},i.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),s}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(s=>this.removeCell(s,t))):[]}removeConnectedEdges(e,t={}){const s=this.getConnectedEdges(e);return s.forEach(r=>{r.remove(t)}),s}disconnectConnectedEdges(e,t={}){const s=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(r=>{const i=r.getSourceCellId(),o=r.getTargetCellId();i===s&&r.setSource({x:0,y:0},t),o===s&&r.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,s=this.outgoings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,s=this.incomings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getConnectedEdges(e,t={}){const s=[],r=typeof e=="string"?this.getCell(e):e;if(r==null)return s;const i={},o=t.indirect;let a=t.incoming,c=t.outgoing;a==null&&c==null&&(a=c=!0);const u=(d,f)=>{const h=f?this.getOutgoingEdges(d):this.getIncomingEdges(d);if(h!=null&&h.forEach(p=>{i[p.id]||(s.push(p),i[p.id]=!0,o&&(a&&u(p,!1),c&&u(p,!0)))}),o&&d.isEdge()){const p=f?d.getTargetCell():d.getSourceCell();p&&p.isEdge()&&(i[p.id]||(s.push(p),u(p,f)))}};if(c&&u(r,!0),a&&u(r,!1),t.deep){const d=r.getDescendants({deep:!0}),f={};d.forEach(p=>{p.isNode()&&(f[p.id]=!0)});const h=(p,g)=>{const m=g?this.getOutgoingEdges(p.id):this.getIncomingEdges(p.id);m!=null&&m.forEach(y=>{if(!i[y.id]){const b=y.getSourceCell(),w=y.getTargetCell();if(!t.enclosed&&b&&f[b.id]&&w&&f[w.id])return;s.push(y),i[y.id]=!0}})};d.forEach(p=>{p.isEdge()||(c&&h(p,!0),a&&h(p,!1))})}return s}isBoundary(e,t){const s=typeof e=="string"?this.getCell(e):e,r=t?this.getIncomingEdges(s):this.getOutgoingEdges(s);return r==null||r.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(s=>{if(this.isBoundary(s,e)){const r=this.getCell(s);r&&t.push(r)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let s=t.incoming,r=t.outgoing;s==null&&r==null&&(s=r=!0);const o=this.getConnectedEdges(e,t).reduce((a,c)=>{const u=c.hasLoop(t),d=c.getSourceCell(),f=c.getTargetCell();return s&&d&&d.isNode()&&!a[d.id]&&(u||d!==e&&(!t.deep||!d.isDescendantOf(e)))&&(a[d.id]=d),r&&f&&f.isNode()&&!a[f.id]&&(u||f!==e&&(!t.deep||!f.isDescendantOf(e)))&&(a[f.id]=f),a},{});if(e.isEdge()){if(s){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(r){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,s={}){let r=s.incoming,i=s.outgoing;return r==null&&i==null&&(r=i=!0),this.getConnectedEdges(e,s).some(o=>{const a=o.getSourceCell(),c=o.getTargetCell();return!!(r&&a&&a.id===t.id||i&&c&&c.id===t.id)})}getSuccessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{outgoing:!0})),s}isSuccessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{outgoing:!0})),r}getPredecessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{incoming:!0})),s}isPredecessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{incoming:!0})),r}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(s=>{s&&(Array.isArray(s)?t.push(...s):t.push(s))}),pe.getCommonAncestor(...t)}getSubGraph(e,t={}){const s=[],r={},i=[],o=[],a=c=>{r[c.id]||(s.push(c),r[c.id]=c,c.isEdge()&&o.push(c),c.isNode()&&i.push(c))};return e.forEach(c=>{a(c),t.deep&&c.getDescendants({deep:!0}).forEach(d=>a(d))}),o.forEach(c=>{const u=c.getSourceCell(),d=c.getTargetCell();u&&!r[u.id]&&(s.push(u),r[u.id]=u,u.isNode()&&i.push(u)),d&&!r[d.id]&&(s.push(d),r[d.id]=d,d.isNode()&&i.push(d))}),i.forEach(c=>{this.getConnectedEdges(c,t).forEach(d=>{const f=d.getSourceCell(),h=d.getTargetCell();!r[d.id]&&f&&r[f.id]&&h&&r[h.id]&&(s.push(d),r[d.id]=d)})}),s}cloneSubGraph(e,t={}){const s=this.getSubGraph(e,t);return this.cloneCells(s)}cloneCells(e){return pe.cloneCells(e)}getNodesFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(r=>r.getBBox().containsPoint(s))}getNodesInArea(e,t,s,r,i){const o=typeof e=="number"?new F(e,t,s,r):F.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getNodes().filter(u=>{const d=u.getBBox();return c?o.containsRect(d):o.isIntersectWithRect(d)})}getEdgesInArea(e,t,s,r,i){const o=typeof e=="number"?new F(e,t,s,r):F.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getEdges().filter(u=>{const d=u.getBBox();return d.width===0?d.inflate(1,0):d.height===0&&d.inflate(0,1),c?o.containsRect(d):o.isIntersectWithRect(d)})}getNodesUnderNode(e,t={}){const s=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(s):this.getNodesFromPoint(s[t.by])).filter(i=>e.id!==i.id&&!i.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return pe.getCellsBBox(e,t)}search(e,t,s={}){s.breadthFirst?this.breadthFirstSearch(e,t,s):this.depthFirstSearch(e,t,s)}breadthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.shift();if(a==null||i[a.id]||(i[a.id]=!0,ee(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,s).forEach(u=>{o[u.id]=o[a.id]+1,r.push(u)})}}depthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.pop();if(a==null||i[a.id]||(i[a.id]=!0,ee(t,this,a,o[a.id])===!1))continue;const c=this.getNeighbors(a,s),u=r.length;c.forEach(d=>{o[d.id]=o[a.id]+1,r.splice(u,0,d)})}}getShortestPath(e,t,s={}){const r={};this.getEdges().forEach(u=>{const d=u.getSourceCellId(),f=u.getTargetCellId();d&&f&&(r[d]||(r[d]=[]),r[f]||(r[f]=[]),r[d].push(f),s.directed||r[f].push(d))});const i=typeof e=="string"?e:e.id,o=td.run(r,i,s.weight),a=[];let c=typeof t=="string"?t:t.id;for(o[c]&&a.push(c);c=o[c];)a.unshift(c);return a}translate(e,t,s){return this.getCells().filter(r=>!r.hasParent()).forEach(r=>r.translate(e,t,s)),this}resize(e,t,s){return this.resizeCells(e,t,this.getCells(),s)}resizeCells(e,t,s,r={}){const i=this.getCellsBBox(s);if(i){const o=Math.max(e/i.width,0),a=Math.max(t/i.height,0),c=i.getOrigin();s.forEach(u=>u.scale(o,a,c,r))}return this}toJSON(e={}){return et.toJSON(this.getCells(),e)}parseJSON(e){return et.fromJSON(e)}fromJSON(e,t={}){const s=this.parseJSON(e);return this.resetCells(s,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,s={}){this.startBatch(e,s);const r=t();return this.stopBatch(e,s),r}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(s=>this.batches[s]>0)}dispose(){this.collection.dispose()}}TB([et.dispose()],et.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.addNode=="function"&&typeof r.addEdge=="function"&&r.collection!=null}n.isModel=e}(et||(et={})),function(n){function e(s,r={}){return{cells:s.map(i=>i.toJSON(r))}}n.toJSON=e;function t(s){const r=[];return Array.isArray(s)?r.push(...s):(s.cells&&r.push(...s.cells),s.nodes&&s.nodes.forEach(i=>{i.shape==null&&(i.shape="rect"),r.push(i)}),s.edges&&s.edges.forEach(i=>{i.shape==null&&(i.shape="edge"),r.push(i)})),r.map(i=>{const o=i.shape;if(o){if(He.registry.exist(o))return He.create(i);if(je.registry.exist(o))return je.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(et||(et={}));var kB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let As=class extends He{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(e){const{label:t}=e,s=kB(e,["label"]);return t&&Ir(s,"attrs/text/text",t),s},visible:!0})})(As||(As={}));var VB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function DB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function RB(n="xlink:href"){return t=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=t,o=VB(t,["imageUrl","imageWidth","imageHeight"]);if(s!=null||r!=null||i!=null){const a=()=>{if(o.attrs){const c=o.attrs.image;s!=null&&(c[n]=s),r!=null&&(c.width=r),i!=null&&(c.height=i),o.attrs.image=c}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function si(n,e,t={}){const s={constructorName:n,markup:DB(n,t.selector),attrs:{[n]:Object.assign({},As.bodyAttr)}};return(t.parent||As).define(We(s,e,{shape:n}))}si("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const LB=je.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});si("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var IB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ri extends As{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",ri.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(s=>Array.isArray(s)?s.join(","):O.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:s}=t,r=IB(t,["points"]);if(s){const i=e(s);i&&Ir(r,"attrs/body/refPoints",i)}return r}})})(ri||(ri={})),si("polygon",{},{parent:ri}),si("polyline",{},{parent:ri});var BB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};As.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:e}=n,t=BB(n,["path"]);return e&&Ir(t,"attrs/body/refD",e),t}});var jB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};As.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},gs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:rt.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},As.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=jB(n,["text"]);return e&&Ir(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,refBBox:s,elem:r,attrs:i}){if(r instanceof HTMLElement)r.textContent=n;else{const o=i.style||{},a={text:n,width:-5,height:"100%"},c=Object.assign({textVerticalAnchor:"middle"},o),u=An.presets.textWrap;return ee(u.set,this,a,{cell:e,view:t,elem:r,refBBox:s,attrs:c}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),si("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:RB()},{selector:"image"}),si("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class gn extends Ue{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return gn.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const s=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?De(t,s):X(t,s)}else{const s=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(s):this.addClass(s)}}isNodeView(){return!0}confirmUpdate(e,t={}){let s=e;return this.hasAction(s,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","resize","translate","rotate","ports","tools"])):(s=this.handleAction(s,"resize",()=>this.resize(),"update"),s=this.handleAction(s,"update",()=>this.update(),"ports"),s=this.handleAction(s,"translate",()=>this.translate()),s=this.handleAction(s,"rotate",()=>this.rotate()),s=this.handleAction(s,"ports",()=>this.renderPorts()),s=this.handleAction(s,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),s}update(e){this.cleanCache(),this.removePorts();const t=this.cell,s=t.getSize(),r=t.getAttrs();this.updateAttrs(this.container,r,{attrs:e===r?null:e,rootBBox:new F(0,0,s.width,s.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const s=e?this.portsCache[e]:null;if(!s)return null;const r=s.portContentElement,i=s.portContentSelectors||{};return this.findOne(t,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{Ht(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const s=this.cell.getParsedPorts(),r=xp(s,"zIndex"),i="auto";r[i]&&r[i].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(r).forEach(o=>{if(o!==i){const a=parseInt(o,10);this.appendPorts(r[o],a,t)}}),this.updatePorts()}appendPorts(e,t,s){const r=e.map(i=>this.getPortElement(i));s[t]||t<0?Gu(s[Math.max(t,0)],r):kt(this.container,r)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=ke.renderMarkup(this.cell.getPortContainerMarkup());const s=t.elem;if(s==null)throw new Error("Invalid port container markup.");t=ke.renderMarkup(this.getPortMarkup(e));const r=t.elem,i=t.selectors;if(r==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},r);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),X(s,o),X(s,"x6-port"),X(r,"x6-port-body"),s.appendChild(r);let a=i,c,u;if(this.existPortLabel(e)){if(t=ke.renderMarkup(this.getPortLabelMarkup(e.label)),c=t.elem,u=t.selectors,c==null)throw new Error("Invalid port label markup.");if(i&&u){for(const f in u)if(i[f]&&f!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},i),u)}X(c,"x6-port-label"),s.appendChild(c)}return this.portsCache[e.id]={portElement:s,portSelectors:a,portLabelElement:c,portLabelSelectors:u,portContentElement:r,portContentSelectors:i},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:s,selectors:a,labelContainer:c,labelSelectors:u,contentContainer:r,contentSelectors:i}),s}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(s=>this.updatePortGroup(s))}updatePortGroup(e){const t=F.fromSize(this.cell.getSize()),s=this.cell.getPortsLayoutByGroup(e,t);for(let r=0,i=s.length;r<i;r+=1){const o=s[r],a=o.portId,c=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(c.portElement,u),o.portAttrs!=null){const f={selectors:c.portSelectors||{}};o.portSize&&(f.rootBBox=F.fromSize(o.portSize)),this.updateAttrs(c.portElement,o.portAttrs,f)}const d=o.labelLayout;if(d&&c.portLabelElement&&(this.applyPortTransform(c.portLabelElement,d,-(u.angle||0)),d.attrs)){const f={selectors:c.portLabelSelectors||{}};o.labelSize&&(f.rootBBox=F.fromSize(o.labelSize)),this.updateAttrs(c.portLabelElement,d.attrs,f)}}}applyPortTransform(e,t,s=0){const r=t.angle,i=t.position,o=it().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);zr(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,node:i,cell:o}:{e,x:t,y:s,view:r,node:i,cell:o}}getPortEventArgs(e,t,s){const r=this,i=r.cell,o=i;return s?{e,x:s.x,y:s.y,view:r,node:i,cell:o,port:t}:{e,view:r,node:i,cell:o,port:t}}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("node:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("node:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("node:mouseup",this.getEventArgs(e,t,s))}notifyPortEvent(e,t,s){const r=this.findAttr("port",t.target);if(r){const i=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,r,s)),t.type=i}}onClick(e,t,s){super.onClick(e,t,s),this.notify("node:click",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:click",e,{x:t,y:s})}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("node:dblclick",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:s})}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("node:contextmenu",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:s})}onMouseDown(e,t,s){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,s),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:s}),this.startNodeDragging(e,t,s))}onMouseMove(e,t,s){const r=this.getEventData(e),i=r.action;if(i==="magnet")this.dragMagnet(e,t,s);else{if(i==="move"){const a=r.targetView||this;a.dragNode(e,t,s),a.notify("node:moving",{e,x:t,y:s,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,s),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:s})}this.setEventData(e,r)}onMouseUp(e,t,s){const r=this.getEventData(e),i=r.action;i==="magnet"?this.stopMagnetDragging(e,t,s):(this.notifyMouseUp(e,t,s),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:s}),i==="move"&&(r.targetView||this).stopNodeDragging(e,t,s));const o=r.targetMagnet;o&&this.onMagnetClick(e,o,t,s),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onMagnetClick(e,t,s,r){const i=this.graph;i.view.getMouseMovedCount(e)>i.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetDblClick(e,t,s,r){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetContextMenu(e,t,s,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){this.startMagnetDragging(e,s,r)}onCustomEvent(e,t,s,r){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}prepareEmbedding(e){const t=this.graph,r=this.getEventData(e).cell||this.cell,i=t.findViewByCell(r),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:r,view:i,cell:r,x:o.x,y:o.y,currentParent:r.getParent()})}processEmbedding(e,t){const s=t.cell||this.cell,r=t.graph||this.graph,i=r.options.embedding,o=i.findParent;let a=typeof o=="function"?ee(o,r,{view:this,node:this.cell}).filter(h=>pe.isCell(h)&&this.cell.id!==h.id&&!h.isDescendantOf(this.cell)):r.model.getNodesUnderNode(s,{by:o});if(i.frontOnly&&a.length>0){const h=xp(a,"zIndex"),p=NP(Object.keys(h).map(g=>parseInt(g,10)));p&&(a=h[p])}a=a.filter(h=>h.visible);let c=null;const u=t.candidateEmbedView,d=i.validate;for(let h=a.length-1;h>=0;h-=1){const p=a[h];if(u&&u.cell.id===p.id){c=u;break}else{const g=p.findView(r);if(d&&ee(d,r,{child:this.cell,parent:g.cell,childView:this,parentView:g})){c=g;break}}}this.clearEmbedding(t),c&&c.highlight(null,{type:"embedding"}),t.candidateEmbedView=c;const f=r.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:s,node:s,view:r.findViewByCell(s),x:f.x,y:f.y,currentParent:s.getParent(),candidateParent:c?c.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const s=t.cell||this.cell,r=t.graph||this.graph,i=r.findViewByCell(s),o=s.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(s,void 0,{ui:!0})):o&&o.unembed(s,{ui:!0}),r.model.getConnectedEdges(s,{deep:!0}).forEach(c=>{c.updateParent({ui:!0})}),i&&a){const c=r.snapToGrid(e.clientX,e.clientY);i.notify("node:embedded",{e,cell:s,x:c.x,y:c.y,node:s,view:r.findViewByCell(s),previousParent:o,currentParent:s.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,s){if(t.getAttribute("magnet")!=="passive"){const r=this.graph.options.connecting.validateMagnet;return r?ee(r,this.graph,{e:s,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,s){if(!this.can("magnetConnectable"))return;e.stopPropagation();const r=e.currentTarget,i=this.graph;this.setEventData(e,{targetMagnet:r}),this.validateMagnet(this,r,e)?(i.options.magnetThreshold<=0&&this.startConnectting(e,r,t,s),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,s),i.view.delegateDragEvents(e,this)}startConnectting(e,t,s,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(t,s,r);i.setEventData(e,i.prepareArrowheadDragging("target",{x:s,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:i}),i.notifyMouseDown(e,s,r)}getDefaultEdge(e,t){let s;const r=this.graph.options.connecting.createEdge;return r&&(s=ee(r,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),s}createEdgeFromMagnet(e,t,s){const r=this.graph,i=r.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,s,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:s})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(e,t,s){const r=this.getEventData(e),i=r.edgeView;if(i)i.onMouseMove(e,t,s),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,c=this.getEventTarget(e),u=r.targetMagnet;if(a==="onleave"){if(u===c||u.contains(c))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,u,t,s)}}stopMagnetDragging(e,t,s){const i=this.eventData(e).edgeView;i&&(i.onMouseUp(e,t,s),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,s){this.notify("node:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,s,r,i){let o=[i];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const c=a.getSelectedCells();c.includes(i)&&(o=c.filter(u=>u.isNode()))}o.forEach(c=>{this.notify(e,{e:t,x:s,y:r,cell:c,node:c,view:c.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?ee(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}startNodeDragging(e,t,s){const r=this.getDelegatedView();if(r==null||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,s);this.setEventData(e,{targetView:r,action:"move"});const i=O.create(r.cell.getPosition());r.setEventData(e,{moving:!1,offset:i.diff(t,s),restrict:this.getRestrictArea(r)})}dragNode(e,t,s){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(e),c=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,s,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const d=Ce.snapToGrid(t+c.x,o),f=Ce.snapToGrid(s+c.y,o);r.setPosition(d,f,{restrict:u,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,s){const r=this.getEventData(e);r.embedding&&this.finalizeEmbedding(e,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,s,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");s&&s.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.findPortElem=="function"&&typeof r.resize=="function"&&typeof r.rotate=="function"&&typeof r.translate=="function"}n.isNodeView=e})(gn||(gn={})),gn.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),gn.registry.register("node",gn,!0);var $B=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Zn extends Ue{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return Zn.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const s=this.cell.getSource();return new F(s.x,s.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new F(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const s=this.cell.getTarget();return new F(s.x,s.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new F(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let s=e;if(this.hasAction(s,"source")){if(!this.updateTerminalProperties("source"))return s;s=this.removeAction(s,"source")}if(this.hasAction(s,"target")){if(!this.updateTerminalProperties("target"))return s;s=this.removeAction(s,"target")}return this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","labels","tools"]),s):(s=this.handleAction(s,"update",()=>this.update(t)),s=this.handleAction(s,"labels",()=>this.onLabelsChange(t)),s=this.handleAction(s,"tools",()=>this.renderTools()),s)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let s=0,r=t.length;s<r;s+=1){const i=t[s],o=this.labelCache[s],a=this.labelSelectors[s],c=this.graph.options.onEdgeLabelRendered;if(c){const u=c({edge:e,label:i,container:o,selectors:a});u&&(this.labelDestroyFn[s]=u)}}}}destroyCustomizeLabels(){const e=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let t=0,s=e.length;t<s;t+=1){const r=this.labelDestroyFn[t],i=this.labelCache[t],o=this.labelSelectors[t];r&&i&&o&&r({edge:this.cell,label:e[t],container:i,selectors:o})}this.labelDestroyFn={}}renderLabels(){const e=this.cell,t=e.getLabels(),s=t.length;let r=this.labelContainer;if(this.labelCache={},this.labelSelectors={},s<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=fn("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let i=0,o=t.length;i<o;i+=1){const a=t[i],c=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,d;if(c)u=c.node,d=c.selectors;else{const h=e.getDefaultLabel(),p=this.normalizeLabelMarkup(this.parseLabelMarkup(h.markup));u=p.node,d=p.selectors}u.setAttribute("data-index",`${i}`),r.appendChild(u);const f=this.rootSelector;if(d[f])throw new Error("Ambiguous label root selector.");d[f]=u,this.labelCache[i]=u,this.labelSelectors[i]=d}return r.parentNode==null&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const s=e.propertyPathArray||[],r=s.length;if(r>1){const i=s[1];if(t[i]){if(r===2)return typeof e.propertyValue=="object"&&fa(e.propertyValue,"markup");if(s[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=oe.createVectors(e),s=document.createDocumentFragment();for(let r=0,i=t.length;r<i;r+=1){const o=t[r].node;s.appendChild(o)}return{fragment:s,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let s;const r=t.childNodes;return r.length>1||r[0].nodeName.toUpperCase()!=="G"?s=oe.create("g").append(t):s=oe.create(r[0]),s.addClass(this.prefixClassName("edge-label")),{node:s.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,s=this.can("edgeLabelMovable"),r=e.getDefaultLabel();for(let i=0,o=t.length;i<o;i+=1){const a=this.labelCache[i],c=this.labelSelectors[i];a.setAttribute("cursor",s?"move":"default");const u=t[i],d=We({},r.attrs,u.attrs);this.updateAttrs(a,d,{selectors:c,rootBBox:u.size?F.fromSize(u.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs(),s=$B(t,["text"]);return s!=null&&this.updateAttrs(this.container,s,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,s=t.getVertices(),r=[this.sourceAnchor,...s,this.targetAnchor],i=r.length,o=new ze(r);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),c=a.length;return i===c?0:(t.setVertices(a.slice(1,c-1),e),i-c)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return O.create(this.sourceAnchor);case"target":return O.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return O.create(this.sourcePoint);case"target":return O.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const s=this.sourceView;return s?this.sourceMagnet||s.container:null}case"target":{if(t.raw)return this.targetMagnet;const s=this.targetView;return s?this.targetMagnet||s.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const s=e.tx||0,r=e.ty||0;this.routePoints=new ze(this.routePoints).translate(s,r).points,this.translateConnectionPoints(s,r),this.path.translate(s,r)}else{const s=t.getVertices(),r=this.findAnchors(s);this.sourceAnchor=r.source,this.targetAnchor=r.target,this.routePoints=this.findRoutePoints(s);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(e){const t=this.cell,s=t.source,r=t.target,i=e[0],o=e[e.length-1];return r.priority&&!s.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(e,t,s,r){let i,o;const a=this.cell,c=a[e],u=a[s],d=this.getTerminalView(e),f=this.getTerminalView(s),h=this.getTerminalMagnet(e),p=this.getTerminalMagnet(s);if(d){let g;t?g=O.create(t):f?g=p:g=O.create(u),i=this.getAnchor(c.anchor,d,h,g,e)}else i=O.create(c);if(f){const g=O.create(r||i);o=this.getAnchor(u.anchor,f,p,g,s)}else o=O.isPointLike(u)?O.create(u):new O;return{[e]:i,[s]:o}}getAnchor(e,t,s,r,i){const o=t.isEdgeElement(s),a=this.graph.options.connecting;let c=typeof e=="string"?{name:e}:e;if(!c){const f=o?(i==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(i==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;c=typeof f=="string"?{name:f}:f}if(!c)throw new Error("Anchor should be specified.");let u;const d=c.name;if(o){const f=Qr.registry.get(d);if(typeof f!="function")return Qr.registry.onNotFound(d);u=ee(f,this,t,s,r,c.args||{},i)}else{const f=Zr.registry.get(d);if(typeof f!="function")return Zr.registry.onNotFound(d);u=ee(f,this,t,s,r,c.args||{},i)}return u?u.round(this.POINT_ROUNDING):new O}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Ns.presets.normal,s=this.cell.getRouter()||t;let r;if(typeof s=="function")r=ee(s,this,e,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ns.registry.get(i):Ns.presets.normal;if(typeof a!="function")return Ns.registry.onNotFound(i);r=ee(a,this,e,o,this)}return r==null?e.map(i=>O.create(i)):r.map(i=>O.create(i))}findConnectionPoints(e,t,s){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),c=this.sourceView,u=this.targetView,d=e[0],f=e[e.length-1];let h;if(c&&!c.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||c.container,m=d||s,y=new Y(m,t),b=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;h=this.getConnectionPoint(b,c,g,y,"source")}else h=t;let p;if(u&&!u.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||u.container,m=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,y=f||t,b=new Y(y,s);p=this.getConnectionPoint(m,u,g,b,"target")}else p=s;return{source:h,target:p}}getConnectionPoint(e,t,s,r,i){const o=r.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,c=typeof e=="string"?{}:e.args,u=ei.registry.get(a);if(typeof u!="function")return ei.registry.onNotFound(a);const d=ee(u,this,r,t,s,c||{},i);return d?d.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,s){const r=f=>{const h=this.cell.getAttrs(),p=Object.keys(h);for(let g=0,m=p.length;g<m;g+=1){const y=h[p[g]];if(y[`${f}Marker`]||y[`${f}-marker`]){const b=y.strokeWidth||y["stroke-width"];if(b)return parseFloat(b);break}}return null},i=e[0],o=e[e.length-1];let a,c;const u=r("source");u&&(a=t.clone().move(i||s,-u));const d=r("target");return d&&(c=s.clone().move(o||t,-d)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=c||s.clone(),{source:a,target:c}}findPath(e,t,s){const r=this.cell.getConnector()||this.graph.options.connecting.connector;let i,o,a;if(typeof r=="string"?i=r:(i=r.name,o=r.args),i){const u=er.registry.get(i);if(typeof u!="function")return er.registry.onNotFound(i);a=u}else a=er.presets.normal;const c=ee(a,this,t,s,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof c=="string"?ne.parse(c):c}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,s=t.getLabels();if(s.length===0)return this;const r=t.getDefaultLabel(),i=this.normalizeLabelPosition(r.position);for(let o=0,a=s.length;o<a;o+=1){const c=s[o],u=this.labelCache[o];if(!u)continue;const d=this.normalizeLabelPosition(c.position),f=We({},i,d),h=this.getLabelTransformationMatrix(f);u.setAttribute("transform",$r(h))}return this}updateTerminalProperties(e){const t=this.cell,s=this.graph,r=t[e],i=r&&r.cell,o=`${e}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=s.getCellById(i);if(!a)throw new Error(`Edge's ${e} node with id "${i}" not exists`);const c=a.findView(s);return c?(this[o]=c,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,s=this.getTerminalView(e);if(s){let r=s.getMagnetFromEdgeTerminal(this.cell[e]);r===s.container&&(r=null),this[t]=r}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:We({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return fa(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return fa(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return fa(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(qn(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,s,r){const i={distance:0};let o=0,a;typeof s=="number"?(o=s,a=r):a=s,a!=null&&(i.options=a);const c=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),d=a&&a.absoluteDistance&&a.reverseDistance,f=this.path,h={segmentSubdivisions:this.getConnectionSubdivisions()},p=new O(e,t),g=f.closestPointT(p,h),m=this.getConnectionLength()||0;let y=f.lengthAtT(g,h);u&&(y=m>0?y/m:0),d&&(y=-1*(m-y)||1),i.distance=y;let b;c||(b=f.tangentAtT(g));let w;if(b)w=b.pointOffset(p);else{const x=f.pointAtT(g),v=p.diff(x);w={x:v.x,y:v.y}}return i.offset=w,i.angle=o,i}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),s=t.options||{},r=t.angle||0,i=t.distance,o=i>0&&i<=1;let a=0;const c={x:0,y:0},u=t.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(c.x=u.x),u.y!=null&&(c.y=u.y)));const d=c.x!==0||c.y!==0||a===0,f=s.keepGradient,h=s.ensureLegibility,p=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},m=o?i*this.getConnectionLength():i,y=p.tangentAtLength(m,g);let b,w=r;if(y){if(d)b=y.start,b.translate(c);else{const x=y.clone();x.rotate(-90,y.start),x.setLength(a),b=x.end}f&&(w=y.angle()+r,h&&(w=ye.normalize((w+90)%180-90)))}else b=p.start,d&&b.translate(c);return it().translate(b.x,b.y).rotate(w)}getVertexIndex(e,t){const r=this.cell.getVertices(),i=this.getClosestPointLength(new O(e,t));let o=0;if(i!=null)for(const a=r.length;o<a;o+=1){const c=r[o],u=this.getClosestPointLength(c);if(u!=null&&i<u)break}return o}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,edge:i,cell:o}:{e,x:t,y:s,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(e,t,s){this.notify("edge:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("edge:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("edge:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("edge:mouseup",this.getEventArgs(e,t,s))}onClick(e,t,s){super.onClick(e,t,s),this.notify("edge:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("edge:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("edge:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startEdgeDragging(e,t,s)}onMouseMove(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.dragLabel(e,t,s);break}case"drag-arrowhead":{this.dragArrowhead(e,t,s);break}case"drag-edge":{this.dragEdge(e,t,s);break}}return this.notifyMouseMove(e,t,s),r}onMouseUp(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.stopLabelDragging(e,t,s);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,s);break}case"drag-edge":{this.stopEdgeDragging(e,t,s);break}}return this.notifyMouseUp(e,t,s),this.checkMouseleave(e),r}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){if(xy(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r)))}this.notifyMouseDown(e,s,r)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}onLabelMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startLabelDragging(e,t,s),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,s){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,s);return}this.setEventData(e,{x:t,y:s,moving:!1,action:"drag-edge"})}dragEdge(e,t,s){const r=this.getEventData(e);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-r.x,s-r.y,{ui:!0}),this.setEventData(e,{x:t,y:s}),this.notify("edge:moving",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,s){const r=this.getEventData(e);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(e,t){const s=this.getTerminalMagnet(e),r={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:s,initialTerminal:Ec(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let s,r=0,i=0;e==="source"?(r=2,s="target"):(i=2,s="source");const o=this.cell[s],a=o.cell;if(a){let c;const u=t[r]=this.graph.findViewByCell(a);u&&(c=u.getMagnetFromEdgeTerminal(o),c===u.container&&(c=void 0)),t[r+1]=c}return(c,u)=>(t[i]=c,t[i+1]=c.container===u?void 0:u,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,s,r,i,o,a){const c=this.graph.options.connecting,u=c.allowLoop,d=c.allowNode,f=c.allowEdge,h=c.allowPort,p=c.allowMulti,g=c.validateConnection,m=o?o.cell:null,y=i==="target"?s:e,b=i==="target"?r:t;let w=!0;const x=v=>{const S=i==="source"?a?a.port:null:m?m.getSourcePortId():null,E=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return ee(v,this.graph,{edge:m,edgeView:o,sourceView:e,targetView:s,sourcePort:S,targetPort:E,sourceMagnet:t,targetMagnet:r,sourceCell:e?e.cell:null,targetCell:s?s.cell:null,type:i})};if(u!=null&&(typeof u=="boolean"?!u&&e===s&&(w=!1):w=x(u)),w&&h!=null&&(typeof h=="boolean"?!h&&b&&(w=!1):w=x(h)),w&&f!=null&&(typeof f=="boolean"?!f&&Zn.isEdgeView(y)&&(w=!1):w=x(f)),w&&d!=null&&b==null&&(typeof d=="boolean"?!d&&gn.isNodeView(y)&&(w=!1):w=x(d)),w&&p!=null&&o){const v=o.cell,S=i==="source"?a:v.getSource(),E=i==="target"?a:v.getTarget(),C=a?this.graph.getCellById(a.cell):null;if(S&&E&&S.cell&&E.cell&&C)if(typeof p=="function")w=x(p);else{const P=this.graph.model.getConnectedEdges(C,{outgoing:i==="source",incoming:i==="target"});P.length&&(p==="withPort"?P.some(T=>{const k=T.getSource(),V=T.getTarget();return k&&V&&k.cell===S.cell&&V.cell===E.cell&&k.port!=null&&k.port===S.port&&V.port!=null&&V.port===E.port})&&(w=!1):p||P.some(T=>{const k=T.getSource(),V=T.getTarget();return k&&V&&k.cell===S.cell&&V.cell===E.cell})&&(w=!1))}}return w&&g!=null&&(w=x(g)),w}allowConnectToBlank(e){const t=this.graph,r=t.options.connecting.allowBlank;if(typeof r!="function")return!!r;const i=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),c=t.findViewByCell(o),u=t.findViewByCell(a);return ee(r,t,{edge:e,edgeView:i,sourceCell:o,targetCell:a,sourceView:c,targetView:u,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(e,t,s){const r=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const i=r.options.connecting.validateEdge;return i?ee(i,r,{edge:e,type:t,previous:s}):!0}arrowheadDragging(e,t,s,r){r.x=t,r.y=s,r.currentTarget!==e&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(e),r.currentView?(r.currentMagnet=r.currentView.findMagnet(e),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,t,s,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=e,this.cell.prop(r.terminalType,{x:t,y:s},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(e,t,s){const r=e.currentView,i=e.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=e.terminalType,a=r.getEdgeTerminal(i,t,s,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,s){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a=typeof i=="object"&&i.radius||50,c=typeof i=="object"&&i.anchor||"center",u=r.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=r.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(S=>S!==this);u.push(...v)}const d=s.closestView||null,f=s.closestMagnet||null;s.closestView=null,s.closestMagnet=null;let h,p=Number.MAX_SAFE_INTEGER;const g=new O(e,t);u.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())h=c==="center"?v.cell.getBBox().getCenter().distance(g):v.cell.getBBox().getNearestPointToPoint(g).distance(g);else if(v.isEdgeView()){const S=v.getClosestPoint(g);S?h=S.distance(g):h=Number.MAX_SAFE_INTEGER}h<a&&h<p&&(f===v.container||this.validateConnection(...s.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,e,t,this.cell,s.terminalType)))&&(p=h,s.closestView=v,s.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(S=>{if(S.getAttribute("magnet")!=="false"){const E=v.getBBoxOfElement(S);h=g.distance(E.getCenter()),h<a&&h<p&&(f===S||this.validateConnection(...s.getValidateConnectionArgs(v,S),v.getEdgeTerminal(S,e,t,this.cell,s.terminalType)))&&(p=h,s.closestView=v,s.closestMagnet=S)}})});let m;const y=s.terminalType,b=s.closestView,w=s.closestMagnet,x=f!==w;if(d&&x&&d.unhighlight(f,{type:"magnetAdsorbed"}),b){if(!x)return;b.highlight(w,{type:"magnetAdsorbed"}),m=b.getEdgeTerminal(w,e,t,this.cell,y)}else m={x:e,y:t};this.cell.setTerminal(y,m,{},Object.assign(Object.assign({},s.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,s=e.closestMagnet;t&&s&&(t.unhighlight(s,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(s)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const s=e.terminalType,r=e.initialTerminal,i=this.cell[s];if(i&&!je.equalTerminals(r,i)){const a=this.graph,c=r,u=c.cell?a.getCellById(c.cell):null,d=c.port,f=u?a.findViewByCell(u):null,h=u||e.isNewEdge?null:O.create(r).toJSON(),p=i,g=p.cell?a.getCellById(p.cell):null,m=p.port,y=g?a.findViewByCell(g):null,b=g?null:O.create(i).toJSON();this.notify("edge:connected",{e:t,previousCell:u,previousPort:d,previousView:f,previousPoint:h,currentCell:g,currentView:y,currentPort:m,currentPoint:b,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:s,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,s=t.model.getCells();e.marked={};for(let r=0,i=s.length;r<i;r+=1){const o=t.findViewByCell(s[r]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const c=a.filter(u=>this.validateConnection(...e.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,e.x,e.y,this.cell,e.terminalType)));if(c.length>0){for(let u=0,d=c.length;u<d;u+=1)o.highlight(c[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=c}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(s=>{const r=this.graph.findViewByCell(s);r&&(t[s].forEach(o=>{r.unhighlight(o,{type:"magnetAvailable"})}),r.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,s){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,s);return}const i=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:t,y:s});this.setEventData(e,o)}dragArrowhead(e,t,s){const r=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,s,r):this.arrowheadDragging(this.getEventTarget(e),t,s,r)}stopArrowheadDragging(e,t,s){const r=this.graph,i=this.getEventData(e);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,t,s),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,e)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(e,t,s){if(this.can("edgeLabelMovable")){const r=e.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),a=this.getLabelPositionArgs(i),c=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,c);this.setEventData(e,{index:i,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,s){const r=this.getEventData(e),i=this.cell.getLabelAt(r.index),o=We({},i,{position:this.getLabelPosition(t,s,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)}stopLabelDragging(e,t,s){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.getConnection=="function"}n.isEdgeView=e})(Zn||(Zn={})),Zn.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),Zn.registry.register("edge",Zn,!0);var zB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class _n extends be{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:s}=ke.parseJSONMarkup(_n.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=_n.snapshoot(this.container),X(this.container,this.prefixClassName("graph")),kt(this.container,s),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&pe.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onDblClick(t,r.x,r.y):this.graph.trigger("blank:dblclick",{e:t,x:r.x,y:r.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onClick(t,r.x,r.y):this.graph.trigger("blank:click",{e:t,x:r.x,y:r.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=ee(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.isPreventDefaultContextMenu(s)&&e.preventDefault(),this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onContextMenu(t,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:t,x:r.x,y:r.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const s=this.constructor;this.delegateDocumentEvents(s.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;this.options.preventDefaultMouseDown&&e.preventDefault();const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onMouseDown(t,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:r.x,y:r.y})),this.delegateDragEvents(t,s)}onMouseMove(e){const t=this.getEventData(e),s=t.startPosition;if(s&&s.x===e.clientX&&s.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const i=this.normalizeEvent(e),o=this.graph.snapToGrid(i.clientX,i.clientY),a=t.currentView;a?a.onMouseMove(i,o.x,o.y):this.graph.trigger("blank:mousemove",{e:i,x:o.x,y:o.y}),this.setEventData(i,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY),i=this.getEventData(e).currentView;if(i?i.onMouseUp(t,s.x,s.y):this.graph.trigger("blank:mouseup",{e:t,x:s.x,y:s.y}),!e.isPropagationStopped()){const o=new Nn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseEnter(t)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseLeave(t)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=t.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));s?s.onMouseWheel(t,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:i.x,y:i.y})}onCustomEvent(e){const t=e.currentTarget,s=t.getAttribute("event")||t.getAttribute("data-event");if(s){const r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,s,o.x,o.y)}}}handleMagnetEvent(e,t){const s=e.currentTarget,r=s.getAttribute("magnet");if(r&&r.toLowerCase()!=="false"){const i=this.findView(s);if(i){const o=this.normalizeEvent(e);if(this.guard(o,i))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);ee(t,this.graph,i,o,s,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetMouseDown(s,r,i,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetDblClick(s,r,i,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(s,r,i,o,a)=>{s.onMagnetContextMenu(r,i,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,s=this.findView(t);if(s){const r=this.normalizeEvent(e);if(this.guard(r,s))return;const i=this.graph.snapToGrid(r.clientX,r.clientY);s.onLabelMouseDown(r,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}zB([be.dispose()],_n.prototype,"dispose",null),function(n){const e=`${Yt.prefixCls}-graph`;n.markup=[{ns:rt.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:rt.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:rt.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":rt.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(s){const r=s.cloneNode();return s.childNodes.forEach(i=>r.appendChild(i)),()=>{for(Zi(s);s.attributes.length>0;)s.removeAttribute(s.attributes[0].name);for(let i=0,o=r.attributes.length;i<o;i+=1){const a=r.attributes[i];s.setAttribute(a.name,a.value)}r.childNodes.forEach(i=>s.appendChild(i))}}n.snapshoot=t}(_n||(_n={})),function(n){const e=Yt.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(_n||(_n={}));const FB=`.x6-graph {
120
120
  position: relative;
121
121
  overflow: hidden;
122
122
  outline: none;
@@ -275,7 +275,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
275
275
  border: 1px solid #275fc5;
276
276
  border-radius: 2px;
277
277
  }
278
- `;class ot extends yt{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var _B=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class od extends ot{init(){zr("core",TB)}dispose(){Fr("core")}}_B([od.dispose()],od.prototype,"dispose",null);var kB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},go;(function(n){function e(t){const{grid:s,panning:r,mousewheel:i,embedding:o}=t,a=kB(t,["grid","panning","mousewheel","embedding"]),c=t.container;if(c!=null)a.width==null&&(a.width=c.clientWidth),a.height==null&&(a.height=c.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=Ye({},n.defaults,a),d={size:10,visible:!1};return typeof s=="number"?u.grid={size:s,visible:!1}:typeof s=="boolean"?u.grid=Object.assign(Object.assign({},d),{visible:s}):u.grid=Object.assign(Object.assign({},d),s),["panning","mousewheel","embedding"].forEach(f=>{const p=t[f];typeof p=="boolean"?u[f].enabled=p:u[f]=Object.assign(Object.assign({},u[f]),p)}),u}n.get=e})(go||(go={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Gt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Gt.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:e,sourceView:t,targetView:s}){return(e==="target"?s:t)!=null},createEdge(){return new EB}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(go||(go={}));var DB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},RB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ad extends ot{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const s=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(e)?e:[e];this.patterns.forEach((c,u)=>{const d=`pattern_${u}`,h=s.a||1,f=s.d||1,{update:p,markup:g}=c,m=RB(c,["update","markup"]),y=Object.assign(Object.assign(Object.assign({},m),i[u]),{sx:h,sy:f,ox:s.e||0,oy:s.f||0,width:t*h,height:t*f});r.has(d)||r.add(d,se.create("pattern",{id:d,patternUnits:"userSpaceOnUse"},se.createVectors(g)).node);const b=r.get(d);typeof p=="function"&&p(b.childNodes[0],y);let w=y.ox%y.width;w<0&&(w+=y.width);let x=y.oy%y.height;x<0&&(x+=y.height),fe(b,{x:w,y:x,width:y.width,height:y.height})});const o=new XMLSerializer().serializeToString(r.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new Cs),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Cs.presets.dot),e.args)];const s=Cs.registry.get(t);if(s){let r=e.args||[];return Array.isArray(r)||(r=[r]),Array.isArray(s)?s.map((i,o)=>Object.assign(Object.assign({},i),r[o])):[Object.assign(Object.assign({},s),r[0])]}return Cs.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}DB([ot.dispose()],ad.prototype,"dispose",null);class Ib extends ot{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),rt(this.viewportMatrix)}setMatrix(e){const t=rt(e),s=jr(t);this.viewport.setAttribute("transform",s),this.viewportMatrix=t,this.viewportTransformString=s}resize(e,t){let s=e===void 0?this.options.width:e,r=t===void 0?this.options.height:t;this.options.width=s,this.options.height=r,typeof s=="number"&&(s=Math.round(s)),typeof r=="number"&&(r=Math.round(r)),this.container.style.width=s==null?"":`${s}px`,this.container.style.height=r==null?"":`${r}px`;const i=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},i)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return Mc(e)||(e=this.container.clientWidth),Mc(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return FR(this.getMatrix())}scale(e,t=e,s=0,r=0){if(e=this.clampScale(e),t=this.clampScale(t),s||r){const o=this.getTranslation(),a=o.tx-s*(e-1),c=o.ty-r*(t-1);(a!==o.tx||c!==o.ty)&&this.translate(a,c)}const i=this.getMatrix();return i.a=e,i.d=t,this.setMatrix(i),this.graph.trigger("scale",{sx:e,sy:t,ox:s,oy:r}),this}clampScale(e){const t=this.graph.options.scaling;return wt(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let s=e,r=e;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,c=o.height/2;if(t.absolute||(s+=i.sx,r+=i.sy),t.scaleGrid&&(s=Math.round(s/t.scaleGrid)*t.scaleGrid,r=Math.round(r/t.scaleGrid)*t.scaleGrid),t.maxScale&&(s=Math.min(t.maxScale,s),r=Math.min(t.maxScale,r)),t.minScale&&(s=Math.max(t.minScale,s),r=Math.max(t.minScale,r)),t.center&&(a=t.center.x,c=t.center.y),s=this.clampScale(s),r=this.clampScale(r),a||c){const u=this.getTranslation(),d=a-(a-u.tx)*(s/i.sx),h=c-(c-u.ty)*(r/i.sy);(d!==u.tx||h!==u.ty)&&this.translate(d,h)}return this.scale(s,r),this}getRotation(){return UR(this.getMatrix())}rotate(e,t,s){if(t==null||s==null){const i=Ce.getBBox(this.stage);t=i.width/2,s=i.height/2}const r=this.getMatrix().translate(t,s).rotate(e).translate(-t,-s);return this.setMatrix(r),this}getTranslation(){return HR(this.getMatrix())}translate(e,t){const s=this.getMatrix();s.e=e||0,s.f=t||0,this.setMatrix(s);const r=this.getTranslation();return this.options.x=r.tx,this.options.y=r.ty,this.graph.trigger("translate",Object.assign({},r)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,s,r){if(typeof e=="object"){const x=e;e=x.gridWidth||1,t=x.gridHeight||1,s=x.padding||0,r=x}else e=e||1,t=t||1,s=s||0,r==null&&(r={});const i=ms(s),o=r.border||0,a=r.contentArea?U.create(r.contentArea):this.getContentArea(r);o>0&&a.inflate(o);const c=this.getScale(),u=this.getTranslation(),d=c.sx,h=c.sy;a.x*=d,a.y*=h,a.width*=d,a.height*=h;let f=Math.max(Math.ceil((a.width+a.x)/e),1)*e,p=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,m=0;(r.allowNewOrigin==="negative"&&a.x<0||r.allowNewOrigin==="positive"&&a.x>=0||r.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=i.left,f+=g),(r.allowNewOrigin==="negative"&&a.y<0||r.allowNewOrigin==="positive"&&a.y>=0||r.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/t)*t,m+=i.top,p+=m),f+=i.right,p+=i.bottom,f=Math.max(f,r.minWidth||0),p=Math.max(p,r.minHeight||0),f=Math.min(f,r.maxWidth||Number.MAX_SAFE_INTEGER),p=Math.min(p,r.maxHeight||Number.MAX_SAFE_INTEGER);const y=this.getComputedSize(),b=f!==y.width||p!==y.height;return(g!==u.tx||m!==u.ty)&&this.translate(g,m),b&&this.resize(f,p),new U(-g/d,-m/h,f/d,p/h)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let s,r;if(e.contentArea){const b=e.contentArea;s=this.graph.localToGraph(b),r=O.create(b)}else s=this.getContentBBox(e),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=ms(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,c=e.minScaleX||o,u=e.maxScaleX||a,d=e.minScaleY||o,h=e.maxScaleY||a;let f;if(e.viewportArea)f=e.viewportArea;else{const b=this.getComputedSize(),w=this.getTranslation();f={x:w.tx,y:w.ty,width:b.width,height:b.height}}f=U.create(f).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const p=this.getScale();let g=f.width/s.width*p.sx,m=f.height/s.height*p.sy;e.preserveAspectRatio!==!1&&(g=m=Math.min(g,m));const y=e.scaleGrid;if(y&&(g=y*Math.floor(g/y),m=y*Math.floor(m/y)),g=wt(g,c,u),m=wt(m,d,h),this.scale(g,m),t){const b=this.options,w=f.x-r.x*g-b.x,x=f.y-r.y*m-b.y;this.translate(w,x)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new U:Ce.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=U.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const s=U.create(e),r=this.graph;t.contentArea=s,t.viewportArea==null&&(t.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const i=s.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const s=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=s.width/2,a=s.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*r.sx,t=a-t*r.sy,(i.tx!==e||i.ty!==t)&&this.translate(e,t)}centerContent(e){const s=this.graph.getContentArea(e).getCenter();this.centerPoint(s.x,s.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,s){const r=this.getComputedSize();t=cn(t,Math.max(0,r.width)),t<0&&(t=r.width+t),s=cn(s,Math.max(0,r.height)),s<0&&(s=r.height+s);const i=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,c=s-e.y*o.sy;(i.tx!==a||i.ty!==c)&&this.translate(a,c)}positionRect(e,t){const s=U.create(e);switch(t){case"center":return this.positionPoint(s.getCenter(),"50%","50%");case"top":return this.positionPoint(s.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%");case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(s.getTopLeft(),0,0);default:return this}}positionCell(e,t){const s=e.getBBox();return this.positionRect(s,t)}positionContent(e,t){const s=this.graph.getContentArea(t);return this.positionRect(s,e)}}var LB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ld extends ot{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",s=e.position||"center";const r=this.graph.transform.getScale(),i=this.graph.translate();if(typeof s=="object"){const o=i.tx+r.sx*(s.x||0),a=i.ty+r.sy*(s.y||0);s=`${o}px ${a}px`}typeof t=="object"&&(t=U.fromSize(t).scale(r.sx,r.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=s}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const s=this.optionsCache;if(s&&s.image!==t.image)return;let r;const i=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const c=io.registry.get(a);if(typeof c=="function"){const d=t.quality||1;e.width*=d,e.height*=d;const h=c(e,t);if(!(h instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=h.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=h.width/e.width,o.height*=h.height/e.height):o===void 0&&(t.size={width:h.width/d,height:h.height/d})}else r=e.src,o===void 0&&(t.size={width:e.width,height:e.height});s!=null&&typeof t.size=="object"&&t.image===s.image&&t.repeat===s.repeat&&t.quality===s.quality&&(s.size=bc(t.size));const u=this.elem.style;u.backgroundImage=`url(${r})`,u.backgroundRepeat=a,u.opacity=i==null||i>=1?"":`${i}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=bc(t);const s=document.createElement("img");s.onload=()=>this.drawBackgroundImage(s,e),s.setAttribute("crossorigin","anonymous"),s.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}LB([ot.dispose()],ld.prototype,"dispose",null);var IB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class cd extends ot{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onSpaceKeyDown=this.onSpaceKeyDown.bind(this),this.onSpaceKeyUp=this.onSpaceKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),ut.on(this.graph.container,"mousedown",this.onRightMouseDown),ut.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Ny(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),ut.off(this.graph.container,"mousedown",this.onRightMouseDown),ut.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&xs.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),ut.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ut.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),s=t.clientX-this.clientX,r=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(s,r)}stopPanning(e){this.panning=!1,this.updateClassName(),ut.off(document.body,".panning"),ut.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),s=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(K(e,t),De(e,s)):(De(e,t),K(e,s)):(De(e,t),De(e,s))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.getPlugin("selection"),s=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!s)&&this.startPanning(e)}onRightMouseDown(e){const t=this.widgetOptions.eventTypes;t!=null&&t.includes("rightMouseDown")&&e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,s){this.graph.translateBy(-t,-s)}onSpaceKeyDown(e){e.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(e){e.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(e){const t=this.widgetOptions.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&((t=this.widgetOptions.eventTypes)===null||t===void 0?void 0:t.includes("mouseWheel"))}autoPanning(e,t){const r=this.graph.getGraphArea();let i=0,o=0;e<=r.left+10&&(i=-10),t<=r.top+10&&(o=-10),e>=r.right-10&&(i=10),t>=r.bottom-10&&(o=10),(i!==0||o!==0)&&this.graph.translateBy(-i,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}IB([ot.dispose()],cd.prototype,"dispose",null);var VB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ud extends ot{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Ny(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&xs.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&xs.isMatch(e,this.widgetOptions.modifiers)){const s=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*s*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/s)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.currentScale;let o=this.graph.transform.clampScale(i*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,c=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=wt(o,a,c),o!==i)if(this.widgetOptions.zoomAtMousePosition){const d=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:d.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}VB([yt.dispose()],ud.prototype,"dispose",null);var BB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Vb extends ot{init(){this.resetRenderArea=LP(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}BB([ot.dispose()],Vb.prototype,"dispose",null);class jB{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&Qn.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,s=this.queue.length,r=s-1;const i=e.priority;for(;t<=r;){const o=(r-t>>1)+t;i<=this.queue[o].priority?t=o+1:(s=o,r=o-1)}return s}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Qn;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(Qn||(Qn={}));var $B=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class et extends yt{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new jB,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(s=>s.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const s=this.views[e.id];s&&this.requestViewUpdate(s.view,et.FLAG_INSERT,t,Qn.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,s={},r=Qn.Update,i=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=s,(e.hasAction(t,["translate","resize","rotate"])||s.async===!1)&&(r=Qn.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(e,t,s);const d=s.queue;if(d){const h=d.indexOf(e.cell.id);h>=0&&d.splice(h,1),d.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(d=>{this.requestViewUpdate(d.view,d.flag,s,r,!1)}),i&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===et.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((s,r)=>s.isNode()&&r.isEdge()?-1:0),e.forEach(s=>{const r=s.id,i=this.views;let o=0,a=i[r];if(a)o=et.FLAG_INSERT;else{const c=this.createCellView(s);c&&(c.graph=this.graph,o=et.FLAG_INSERT|c.getBootstrapFlag(),a={view:c,flag:o,options:t,state:et.ViewState.CREATED},this.views[r]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,s={}){const r=e.cell,i=r.id,o=this.views[i];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,s),o.flag=a):o.state===et.ViewState.MOUNTED?(a=this.updateView(e,t,s),o.flag=a):o.state=et.ViewState.WAITING,a&&r.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:Qn.RenderEdge,cb:()=>{this.updateView(e,t,s)}})}removeViews(e){e.forEach(t=>{const s=t.id,r=this.views[s];r&&(this.willRemoveViews[s]=r,delete this.views[s],this.queue.queueJob({id:s,priority:this.getRenderPriority(r.view),cb:()=>{this.removeView(r.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===et.ViewState.WAITING){const{view:t,flag:s,options:r}=e;this.requestViewUpdate(t,s,r,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,s={}){if(e==null)return 0;if(Fe.isCellView(e)){if(t&et.FLAG_REMOVE)return this.removeView(e.cell),0;t&et.FLAG_INSERT&&(this.insertView(e),t^=et.FLAG_INSERT)}return t?e.confirmUpdate(t,s):0}insertView(e){const t=this.views[e.cell.id];if(t){const s=e.cell.getZIndex(),r=this.addZPivot(s);this.container.insertBefore(e.container,r),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=et.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,s=this.willRemoveViews[t.id];s&&e&&(s.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const s=this.model.getConnectedEdges(e);for(let i=0,o=s.length;i<o;i+=1){const a=s[i];if(t){const c=a.getSourceCell(),u=a.getTargetCell();if(c&&!c.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const r=this.views[e.id];r&&Je(r.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let s=t[e];if(s)return s;s=t[e]=document.createComment(`z-index:${e+1}`);let r=-1/0;for(const o in t){const a=+o;a<e&&a>r&&(r=a,e-1)}const i=this.container;if(r!==-1/0){const o=t[r];i.insertBefore(s,o.nextSibling)}else i.insertBefore(s,i.firstChild);return s}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},s=this.graph.options.createCellView;if(s){const i=Q(s,this.graph,e);if(i)return new i(e,t);if(i===null)return null}const r=e.view;if(r!=null&&typeof r=="string"){const i=Fe.registry.get(r);return i?new i(e,t):Fe.registry.onNotFound(r)}return e.isNode()?new fn(e,t):e.isEdge()?new Zn(e,t):null}getEffectedEdges(e){const t=[],s=e.cell,r=this.model.getConnectedEdges(s);for(let i=0,o=r.length;i<o;i+=1){const a=r[i],c=this.views[a.id];if(!c)continue;const u=c.view;if(!this.isViewMounted(u))continue;const d=["update"];a.getTargetCell()===s&&d.push("target"),a.getSourceCell()===s&&d.push("source"),t.push({id:a.id,view:u,flag:u.getFlag(d)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,s=t.getSourceCell(),r=t.getTargetCell();if(this.renderArea&&s&&r)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?Qn.RenderNode:Qn.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}$B([yt.dispose()],et.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(et||(et={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(et||(et={}));var zB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class dd extends ot{constructor(){super(...arguments),this.schedule=new et(this.graph)}requestViewUpdate(e,t,s={}){this.schedule.requestViewUpdate(e,t,s)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,s=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[0];if(s){const r=this.graph.view.findAttr("data-cell-id",s);if(r){const i=this.schedule.views;if(i[r])return i[r].view}}return null}findViewByCell(e){if(e==null)return null;const t=pe.isCell(e)?e.id:e,s=this.schedule.views;return s[t]?s[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>s!=null?Ce.getBBox(s.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(s=>this.findViewByCell(s)).filter(s=>{if(s!=null){const r=s.getClosestPoint(e);if(r)return r.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const s=U.create(e);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(t.nodeOnly&&!r.isNodeView())return!1;const i=Ce.getBBox(r.container,{target:this.view.stage});return i.width===0?i.inflate(1,0):i.height===0&&i.inflate(0,1),t.strict?s.containsRect(i):s.isIntersectWithRect(i)}return!1})}dispose(){this.schedule.dispose()}}zB([ot.dispose()],dd.prototype,"dispose",null);var Bb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class jb extends ot{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const s=e.name;if(t||(t=`filter-${s}-${this.cid}-${Nu(JSON.stringify(e))}`),!this.isDefined(t)){const r=Gr.registry.get(s);if(r==null)return Gr.registry.onNotFound(s);const i=r(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});se.create(_e.sanitize(i),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const s=e.type;if(t||(t=`gradient-${s}-${this.cid}-${Nu(JSON.stringify(e))}`),!this.isDefined(t)){const i=e.stops.map(c=>{const u=c.opacity!=null&&Number.isFinite(c.opacity)?c.opacity:1;return`<stop offset="${c.offset}" stop-color="${c.color}" stop-opacity="${u}"/>`}),o=`<${s}>${i.join("")}</${s}>`,a=Object.assign({id:t},e.attrs);se.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:s,refY:r,markerUnits:i,markerOrient:o,tagName:a,children:c}=e,u=Bb(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=t;if(d||(d=`marker-${this.cid}-${Nu(JSON.stringify(e))}`),!this.isDefined(d)){a!=="path"&&delete u.d;const h=se.create("marker",{refX:s,refY:r,id:d,overflow:"visible",orient:o??"auto",markerUnits:i||"userSpaceOnUse"},c?c.map(f=>{var{tagName:p}=f,g=Bb(f,["tagName"]);return se.create(`${p}`||"path",Xi(Object.assign(Object.assign({},u),g)))}):[se.create(a||"path",Xi(u))]);this.defs.appendChild(h.node)}return d}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class $b extends ot{getClientMatrix(){return rt(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new O(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const s=O.create(e,t);return Ce.transformPoint(s,this.graph.matrix())}localToClientPoint(e,t){const s=O.create(e,t);return Ce.transformPoint(s,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,s,r){const i=U.create(e,t,s,r);return Ce.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,s,r){const i=U.create(e,t,s,r);return Ce.transformRectangle(i,this.getClientMatrix())}localToPageRect(e,t,s,r){return(typeof e=="number"?this.localToGraphRect(e,t,s,r):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const s=O.create(e,t);return Ce.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const s=O.create(e,t);return Ce.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const s=O.create(e,t);return Ce.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const r=O.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(e,t,s,r){const i=U.create(e,t,s,r);return Ce.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,s,r){const i=U.create(e,t,s,r);return Ce.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,s,r){const i=U.create(e,t,s,r);return Ce.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,s,r){const i=U.create(e,t,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var FB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ml extends ot{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:s={}}){const r=this.resolveHighlighter(s);if(!r)return;const i=this.getHighlighterId(t,r);if(!this.highlights[i]){const o=r.highlighter;o.highlight(e,t,Object.assign({},r.args)),this.highlights[i]={cellView:e,magnet:t,highlighter:o,args:r.args}}}onCellUnhighlight({magnet:e,options:t={}}){const s=this.resolveHighlighter(t);if(!s)return;const r=this.getHighlighterId(e,s);this.unhighlight(r)}resolveHighlighter(e){const t=this.options;let s=e.highlighter;if(s==null){const a=e.type;s=a&&t.highlighting[a]||t.highlighting.default}if(s==null)return null;const r=typeof s=="string"?{name:s}:s,i=r.name,o=Xn.registry.get(i);return o==null?Xn.registry.onNotFound(i):(Xn.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(e,t){return Du(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}FB([ml.dispose()],ml.prototype,"dispose",null);var UB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class zb extends ot{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&Ja.bind(t,()=>{const s=t.offsetWidth,r=t.offsetHeight;this.resize(s,r)})}}resize(e,t){const s=this.getScroller();s?s.resize(e,t):this.graph.transform.resize(e,t)}dispose(){Ja.clear(this.graph.container)}}UB([ot.dispose()],zb.prototype,"dispose",null);var HB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class $ extends Te{get container(){return this.options.container}get[Symbol.toStringTag](){return $.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=go.get(e),this.css=new od(this),this.view=new An(this),this.defs=new jb(this),this.coord=new $b(this),this.transform=new Ib(this),this.highlight=new ml(this),this.grid=new ad(this),this.background=new ld(this),this.options.model?this.model=this.options.model:(this.model=new Qe,this.model.graph=this),this.renderer=new dd(this),this.panning=new cd(this),this.mousewheel=new ud(this),this.virtualRender=new Vb(this),this.size=new zb(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(s=>Ue.isNode(s)?s:this.createNode(s)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(s=>Be.isEdge(s)?s:this.createEdge(s)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,s={}){return this.model.isNeighbor(e,t,s)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,s={}){return this.model.isSuccessor(e,t,s)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,s={}){return this.model.isPredecessor(e,t,s)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,s,r,i){return this.model.getNodesInArea(e,t,s,r,i)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,s={}){return this.model.search(e,t,s),this}getShortestPath(e,t,s={}){return this.model.getShortestPath(e,t,s)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,s){const r=typeof e=="string"?e:"update",i=typeof e=="string"?t:e,o=typeof t=="function"?s:t;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return pe.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return U.isRectangleLike(e)?this.findViewsInArea(e):O.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(s)}findViewsInArea(e,t,s,r,i){const o=typeof e=="number"?{x:e,y:t,width:s,height:r}:e,a=typeof e=="number"?i:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e>"u"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const s=this.getPlugin("scroller");return s?s.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,s=0,r=0){return typeof e>"u"?this.transform.getScale():(this.transform.scale(e,t,s,r),this)}zoom(e,t){const s=this.getPlugin("scroller");if(s){if(typeof e>"u")return s.zoom();s.zoom(e,t)}else{if(typeof e>"u")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const s=this.getPlugin("scroller");return s?s.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const s=this.getPlugin("scroller");return s?s.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,s){return typeof e>"u"?this.transform.getRotation():(this.transform.rotate(e,t,s),this)}translate(e,t){return typeof e>"u"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const s=this.translate(),r=s.tx+e,i=s.ty+t;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,s,r){return this.transform.fitToContent(e,t,s,r)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,s){const r=this.getPlugin("scroller");return r?r.centerPoint(e,t,s):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const s=this.getPlugin("scroller");return s?s.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,s,r={}){const i=this.getPlugin("scroller");return i?i.positionPoint(e,t,s,r):this.transform.positionPoint(e,t,s),this}positionRect(e,t,s){const r=this.getPlugin("scroller");return r?r.positionRect(e,t,s):this.transform.positionRect(e,t),this}positionCell(e,t,s){const r=this.getPlugin("scroller");return r?r.positionCell(e,t,s):this.transform.positionCell(e,t),this}positionContent(e,t){const s=this.getPlugin("scroller");return s?s.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,s,r){return U.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.pageToLocalRect(e,t,s,r):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,s,r){return U.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToPageRect(e,t,s,r):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,s,r){return U.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToLocalRect(e,t,s,r):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,s,r){return U.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToClientRect(e,t,s,r):this.coord.localToClientPoint(e,t)}localToGraph(e,t,s,r){return U.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToGraphRect(e,t,s,r):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,s,r){return U.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.graphToLocalRect(e,t,s,r):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,s,r){return U.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToGraphRect(e,t,s,r):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const s=this.getPlugin("scroller");return s!=null&&(this.options.background==null||!t)?s.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.enable)===null||i===void 0||i.call(r)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.disable)===null||i===void 0||i.call(r)}),this}isPluginEnabled(e){var t;const s=this.getPlugin(e);return(t=s==null?void 0:s.isEnabled)===null||t===void 0?void 0:t.call(s)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{r.dispose(),this.installedPlugins.delete(r)}),this}dispose(e=!0){e&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(t=>{t.dispose()})}}HB([Te.dispose()],$.prototype,"dispose",null),function(n){n.View=An,n.Renderer=dd,n.MouseWheel=ud,n.DefsManager=jb,n.GridManager=ad,n.CoordManager=$b,n.TransformManager=Ib,n.HighlightManager=ml,n.BackgroundManager=ld,n.PanningManager=cd}($||($={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag];return s==null||s===n.toStringTag}n.isGraph=e}($||($={})),function(n){function e(t,s){const r=t instanceof HTMLElement?new n({container:t}):new n(t);return s!=null&&r.fromJSON(s),r}n.render=e}($||($={})),function(n){n.registerNode=Ue.registry.register,n.registerEdge=Be.registry.register,n.registerView=Fe.registry.register,n.registerAttr=Pn.registry.register,n.registerGrid=Cs.registry.register,n.registerFilter=Gr.registry.register,n.registerNodeTool=Jr.registry.register,n.registerEdgeTool=Xr.registry.register,n.registerBackground=io.registry.register,n.registerHighlighter=Xn.registry.register,n.registerPortLayout=tr.registry.register,n.registerPortLabelLayout=Wr.registry.register,n.registerMarker=Os.registry.register,n.registerRouter=Ts.registry.register,n.registerConnector=nr.registry.register,n.registerAnchor=Kr.registry.register,n.registerEdgeAnchor=Zr.registry.register,n.registerConnectionPoint=Qr.registry.register}($||($={})),function(n){n.unregisterNode=Ue.registry.unregister,n.unregisterEdge=Be.registry.unregister,n.unregisterView=Fe.registry.unregister,n.unregisterAttr=Pn.registry.unregister,n.unregisterGrid=Cs.registry.unregister,n.unregisterFilter=Gr.registry.unregister,n.unregisterNodeTool=Jr.registry.unregister,n.unregisterEdgeTool=Xr.registry.unregister,n.unregisterBackground=io.registry.unregister,n.unregisterHighlighter=Xn.registry.unregister,n.unregisterPortLayout=tr.registry.unregister,n.unregisterPortLabelLayout=Wr.registry.unregister,n.unregisterMarker=Os.registry.unregister,n.unregisterRouter=Ts.registry.unregister,n.unregisterConnector=nr.registry.unregister,n.unregisterAnchor=Kr.registry.unregister,n.unregisterEdgeAnchor=Zr.registry.unregister,n.unregisterConnectionPoint=Qr.registry.unregister}($||($={}));var GB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},YB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ri extends Ue{}(function(n){class e extends fn{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:s}){const r=n.shapeMaps[this.cell.shape];if(r){const{effect:i}=r;(!i||i.includes(s))&&this.renderHTMLComponent()}}confirmUpdate(s){const r=super.confirmUpdate(s);return this.handleAction(r,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const s=this.selectors&&this.selectors.foContent;if(s){Ji(s);const r=n.shapeMaps[this.cell.shape];if(!r)return;let{html:i}=r;typeof i=="function"&&(i=i(this.cell)),i&&(typeof i=="string"?s.innerHTML=i:_t(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}GB([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),fn.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(ri||(ri={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},_e.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ue.registry.register("html",n,!0)}(ri||(ri={})),function(n){n.shapeMaps={};function e(t){const{shape:s,html:r,effect:i,inherit:o}=t,a=YB(t,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},$.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(ri||(ri={}));var WB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Fb extends ye{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(e,t,s){super(),this.node=t,this.graph=s,this.options=Object.assign(Object.assign({},tt.defaultOptions),e),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const e=document.createElement("div");fe(e,"draggable","false");const t=e.cloneNode(!0);K(t,this.rotateClassName);const s=tt.POSITIONS.map(r=>{const i=e.cloneNode(!0);return K(i,this.resizeClassName),fe(i,"data-position",r),i});this.empty(),_t(this.container,[...s,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(tt.NODE_CLS),K(this.container,this.containerClassName),un(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),un(this.container,"no-resize",!this.options.resizable),un(this.container,"no-rotate",!this.options.rotatable),this.options.className&&K(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const s=me.normalize(this.node.getAngle()),r=s!==0?`rotate(${s}deg)`:"";return Je(this.container,{transform:r,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(tt.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=me.normalize(this.node.getAngle()),t=Math.floor(e*(tt.DIRECTIONS.length/360));if(t!==this.prevShift){const s=tt.DIRECTIONS.slice(t).concat(tt.DIRECTIONS.slice(0,t)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{De(o,tt.DIRECTIONS.map(c=>r(c)).join(" ")),K(o,r(s[a]))}),this.prevShift=t}}getTrueDirection(e){const t=me.normalize(this.node.getAngle());let s=tt.POSITIONS.indexOf(e);return s+=Math.floor(t*(tt.POSITIONS.length/360)),s%=tt.POSITIONS.length,tt.POSITIONS[s]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=fe(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const s=this.getTrueDirection(t);let r=0,i=0;t.split("-").forEach(u=>{r={left:-1,right:1}[u]||r,i={top:-1,bottom:1}[u]||i});const o=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],c=me.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:o,trueDirection:s,relativeDirection:t,angle:c,resizeX:r,resizeY:i,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY);this.setEventData(e,{center:t,action:"rotating",angle:me.normalize(this.node.getAngle()),start:O.create(r).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let s=this.getEventData(e);if(s.action){const r=this.normalizeEvent(e);let i=r.clientX,o=r.clientY;const a=this.graph.getPlugin("scroller"),c=this.options.restrictedResizing;if(c===!0||typeof c=="number"){const p=c===!0?0:c,g=a?Math.max(p,8):p,m=this.graph.container.getBoundingClientRect();i=wt(i,m.left+g,m.right-g),o=wt(o,m.top+g,m.bottom-g)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const u=this.graph.snapToGrid(i,o),d=this.graph.getGridSize(),h=this.node,f=this.options;if(s.action==="resizing"){s=s,s.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),s.resized=!0);const p=h.getBBox(),g=O.create(u).rotate(s.angle,p.getCenter()).diff(p[s.selector]);let m=s.resizeX?g.x*s.resizeX:p.width,y=s.resizeY?g.y*s.resizeY:p.height;const b=m,w=y;if(m=ve.snapToGrid(m,d),y=ve.snapToGrid(y,d),m=Math.max(m,f.minWidth||d),y=Math.max(y,f.minHeight||d),m=Math.min(m,f.maxWidth||1/0),y=Math.min(y,f.maxHeight||1/0),f.preserveAspectRatio){const v=p.width*y/p.height,S=p.height*m/p.width;m<v?y=S:m=v}const x=s.relativeDirection;if(f.allowReverse&&(b<=-m||w<=-y)){let v;x==="left"?b<=-m&&(v="right"):x==="right"?b<=-m&&(v="left"):x==="top"?w<=-y&&(v="bottom"):x==="bottom"?w<=-y&&(v="top"):x==="top-left"?b<=-m&&w<=-y?v="bottom-right":b<=-m?v="top-right":w<=-y&&(v="bottom-left"):x==="top-right"?b<=-m&&w<=-y?v="bottom-left":b<=-m?v="top-left":w<=-y&&(v="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?v="top-right":b<=-m?v="bottom-right":w<=-y&&(v="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?v="top-left":b<=-m?v="bottom-left":w<=-y&&(v="top-right"));const S=v;this.stopHandle();const E=this.container.querySelector(`.${this.resizeClassName}[data-position="${S}"]`);this.startHandle(E),this.prepareResizing(e,S),this.onMouseMove(e)}if(p.width!==m||p.height!==y){const v={ui:!0,direction:s.direction,relativeDirection:s.relativeDirection,trueDirection:s.trueDirection,minWidth:f.minWidth,minHeight:f.minHeight,maxWidth:f.maxWidth,maxHeight:f.maxHeight,preserveAspectRatio:f.preserveAspectRatio===!0};h.resize(m,y,v),this.notify("node:resizing",e,t)}}else if(s.action==="rotating"){s=s,s.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),s.rotated=!0);const p=h.getAngle(),g=s.start-O.create(u).theta(s.center);let m=s.angle+g;f.rotateGrid&&(m=ve.snapToGrid(m,f.rotateGrid)),m=me.normalize(m),p!==m&&(h.rotate(m,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch(t.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,K(this.container,`${this.containerClassName}-active`),e){K(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const s=tt.DIRECTIONS[tt.POSITIONS.indexOf(t)];K(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(De(this.container,`${this.containerClassName}-active`),this.handle){De(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=tt.DIRECTIONS[tt.POSITIONS.indexOf(e)];De(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(tt.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),s=this.getEventData(e);t&&(t.removeClass(`node-${s.action}`),s.action==="resizing"&&s.resized?this.notify("node:resized",e,t):s.action==="rotating"&&s.rotated&&this.notify("node:rotated",e,t))}notify(e,t,s,r={}){if(s){const i=s.graph,o=i.view.normalizeEvent(t),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(e,Object.assign({e:o,view:s,node:s.cell,cell:s.cell,x:a.x,y:a.y},r))}}dispose(){this.stopListening(),this.remove(),this.off()}}WB([ye.dispose()],Fb.prototype,"dispose",null);var tt;(function(n){n.NODE_CLS="has-widget-transform",n.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],n.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},n.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(tt||(tt={}));const qB=`.x6-widget-transform {
278
+ `;class at extends yt{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var UB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class pd extends at{init(){Fr("core",FB)}dispose(){Ur("core")}}UB([pd.dispose()],pd.prototype,"dispose",null);var HB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},bo;(function(n){function e(t){const{grid:s,panning:r,mousewheel:i,embedding:o}=t,a=HB(t,["grid","panning","mousewheel","embedding"]),c=t.container;if(c!=null)a.width==null&&(a.width=c.clientWidth),a.height==null&&(a.height=c.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=We({},n.defaults,a),d={size:10,visible:!1};return typeof s=="number"?u.grid={size:s,visible:!1}:typeof s=="boolean"?u.grid=Object.assign(Object.assign({},d),{visible:s}):u.grid=Object.assign(Object.assign({},d),s),["panning","mousewheel","embedding"].forEach(h=>{const p=t[h];typeof p=="boolean"?u[h].enabled=p:u[h]=Object.assign(Object.assign({},u[h]),p)}),u}n.get=e})(bo||(bo={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Yt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Yt.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:e,sourceView:t,targetView:s}){return(e==="target"?s:t)!=null},createEdge(){return new LB}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(bo||(bo={}));var GB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},WB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class gd extends at{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const s=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(e)?e:[e];this.patterns.forEach((c,u)=>{const d=`pattern_${u}`,f=s.a||1,h=s.d||1,{update:p,markup:g}=c,m=WB(c,["update","markup"]),y=Object.assign(Object.assign(Object.assign({},m),i[u]),{sx:f,sy:h,ox:s.e||0,oy:s.f||0,width:t*f,height:t*h});r.has(d)||r.add(d,oe.create("pattern",{id:d,patternUnits:"userSpaceOnUse"},oe.createVectors(g)).node);const b=r.get(d);typeof p=="function"&&p(b.childNodes[0],y);let w=y.ox%y.width;w<0&&(w+=y.width);let x=y.oy%y.height;x<0&&(x+=y.height),fe(b,{x:w,y:x,width:y.width,height:y.height})});const o=new XMLSerializer().serializeToString(r.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new xs),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},xs.presets.dot),e.args)];const s=xs.registry.get(t);if(s){let r=e.args||[];return Array.isArray(r)||(r=[r]),Array.isArray(s)?s.map((i,o)=>Object.assign(Object.assign({},i),r[o])):[Object.assign(Object.assign({},s),r[0])]}return xs.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}GB([at.dispose()],gd.prototype,"dispose",null);class Yb extends at{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),it(this.viewportMatrix)}setMatrix(e){const t=it(e),s=$r(t);this.viewport.setAttribute("transform",s),this.viewportMatrix=t,this.viewportTransformString=s}resize(e,t){let s=e===void 0?this.options.width:e,r=t===void 0?this.options.height:t;this.options.width=s,this.options.height=r,typeof s=="number"&&(s=Math.round(s)),typeof r=="number"&&(r=Math.round(r)),this.container.style.width=s==null?"":`${s}px`,this.container.style.height=r==null?"":`${r}px`;const i=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},i)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return kc(e)||(e=this.container.clientWidth),kc(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return eR(this.getMatrix())}scale(e,t=e,s=0,r=0){if(e=this.clampScale(e),t=this.clampScale(t),s||r){const o=this.getTranslation(),a=o.tx-s*(e-1),c=o.ty-r*(t-1);(a!==o.tx||c!==o.ty)&&this.translate(a,c)}const i=this.getMatrix();return i.a=e,i.d=t,this.setMatrix(i),this.graph.trigger("scale",{sx:e,sy:t,ox:s,oy:r}),this}clampScale(e){const t=this.graph.options.scaling;return xt(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let s=e,r=e;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,c=o.height/2;if(t.absolute||(s+=i.sx,r+=i.sy),t.scaleGrid&&(s=Math.round(s/t.scaleGrid)*t.scaleGrid,r=Math.round(r/t.scaleGrid)*t.scaleGrid),t.maxScale&&(s=Math.min(t.maxScale,s),r=Math.min(t.maxScale,r)),t.minScale&&(s=Math.max(t.minScale,s),r=Math.max(t.minScale,r)),t.center&&(a=t.center.x,c=t.center.y),s=this.clampScale(s),r=this.clampScale(r),a||c){const u=this.getTranslation(),d=a-(a-u.tx)*(s/i.sx),f=c-(c-u.ty)*(r/i.sy);(d!==u.tx||f!==u.ty)&&this.translate(d,f)}return this.scale(s,r),this}getRotation(){return tR(this.getMatrix())}rotate(e,t,s){if(t==null||s==null){const i=Se.getBBox(this.stage);t=i.width/2,s=i.height/2}const r=this.getMatrix().translate(t,s).rotate(e).translate(-t,-s);return this.setMatrix(r),this}getTranslation(){return nR(this.getMatrix())}translate(e,t){const s=this.getMatrix();s.e=e||0,s.f=t||0,this.setMatrix(s);const r=this.getTranslation();return this.options.x=r.tx,this.options.y=r.ty,this.graph.trigger("translate",Object.assign({},r)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,s,r){if(typeof e=="object"){const x=e;e=x.gridWidth||1,t=x.gridHeight||1,s=x.padding||0,r=x}else e=e||1,t=t||1,s=s||0,r==null&&(r={});const i=ps(s),o=r.border||0,a=r.contentArea?F.create(r.contentArea):this.getContentArea(r);o>0&&a.inflate(o);const c=this.getScale(),u=this.getTranslation(),d=c.sx,f=c.sy;a.x*=d,a.y*=f,a.width*=d,a.height*=f;let h=Math.max(Math.ceil((a.width+a.x)/e),1)*e,p=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,m=0;(r.allowNewOrigin==="negative"&&a.x<0||r.allowNewOrigin==="positive"&&a.x>=0||r.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=i.left,h+=g),(r.allowNewOrigin==="negative"&&a.y<0||r.allowNewOrigin==="positive"&&a.y>=0||r.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/t)*t,m+=i.top,p+=m),h+=i.right,p+=i.bottom,h=Math.max(h,r.minWidth||0),p=Math.max(p,r.minHeight||0),h=Math.min(h,r.maxWidth||Number.MAX_SAFE_INTEGER),p=Math.min(p,r.maxHeight||Number.MAX_SAFE_INTEGER);const y=this.getComputedSize(),b=h!==y.width||p!==y.height;return(g!==u.tx||m!==u.ty)&&this.translate(g,m),b&&this.resize(h,p),new F(-g/d,-m/f,h/d,p/f)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let s,r;if(e.contentArea){const b=e.contentArea;s=this.graph.localToGraph(b),r=O.create(b)}else s=this.getContentBBox(e),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=ps(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,c=e.minScaleX||o,u=e.maxScaleX||a,d=e.minScaleY||o,f=e.maxScaleY||a;let h;if(e.viewportArea)h=e.viewportArea;else{const b=this.getComputedSize(),w=this.getTranslation();h={x:w.tx,y:w.ty,width:b.width,height:b.height}}h=F.create(h).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const p=this.getScale();let g=h.width/s.width*p.sx,m=h.height/s.height*p.sy;e.preserveAspectRatio!==!1&&(g=m=Math.min(g,m));const y=e.scaleGrid;if(y&&(g=y*Math.floor(g/y),m=y*Math.floor(m/y)),g=xt(g,c,u),m=xt(m,d,f),this.scale(g,m),t){const b=this.options,w=h.x-r.x*g-b.x,x=h.y-r.y*m-b.y;this.translate(w,x)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new F:Se.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=F.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const s=F.create(e),r=this.graph;t.contentArea=s,t.viewportArea==null&&(t.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const i=s.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const s=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=s.width/2,a=s.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*r.sx,t=a-t*r.sy,(i.tx!==e||i.ty!==t)&&this.translate(e,t)}centerContent(e){const s=this.graph.getContentArea(e).getCenter();this.centerPoint(s.x,s.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,s){const r=this.getComputedSize();t=dn(t,Math.max(0,r.width)),t<0&&(t=r.width+t),s=dn(s,Math.max(0,r.height)),s<0&&(s=r.height+s);const i=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,c=s-e.y*o.sy;(i.tx!==a||i.ty!==c)&&this.translate(a,c)}positionRect(e,t){const s=F.create(e);switch(t){case"center":return this.positionPoint(s.getCenter(),"50%","50%");case"top":return this.positionPoint(s.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%");case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(s.getTopLeft(),0,0);default:return this}}positionCell(e,t){const s=e.getBBox();return this.positionRect(s,t)}positionContent(e,t){const s=this.graph.getContentArea(t);return this.positionRect(s,e)}}var YB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class md extends at{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",s=e.position||"center";const r=this.graph.transform.getScale(),i=this.graph.translate();if(typeof s=="object"){const o=i.tx+r.sx*(s.x||0),a=i.ty+r.sy*(s.y||0);s=`${o}px ${a}px`}typeof t=="object"&&(t=F.fromSize(t).scale(r.sx,r.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=s}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const s=this.optionsCache;if(s&&s.image!==t.image)return;let r;const i=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const c=lo.registry.get(a);if(typeof c=="function"){const d=t.quality||1;e.width*=d,e.height*=d;const f=c(e,t);if(!(f instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=f.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=f.width/e.width,o.height*=f.height/e.height):o===void 0&&(t.size={width:f.width/d,height:f.height/d})}else r=e.src,o===void 0&&(t.size={width:e.width,height:e.height});s!=null&&typeof t.size=="object"&&t.image===s.image&&t.repeat===s.repeat&&t.quality===s.quality&&(s.size=Ec(t.size));const u=this.elem.style;u.backgroundImage=`url(${r})`,u.backgroundRepeat=a,u.opacity=i==null||i>=1?"":`${i}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Ec(t);const s=document.createElement("img");s.onload=()=>this.drawBackgroundImage(s,e),s.setAttribute("crossorigin","anonymous"),s.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}YB([at.dispose()],md.prototype,"dispose",null);var qB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class yd extends at{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onSpaceKeyDown=this.onSpaceKeyDown.bind(this),this.onSpaceKeyUp=this.onSpaceKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),ut.on(this.graph.container,"mousedown",this.onRightMouseDown),ut.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new $y(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),ut.off(this.graph.container,"mousedown",this.onRightMouseDown),ut.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&bs.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),ut.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ut.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),s=t.clientX-this.clientX,r=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(s,r)}stopPanning(e){this.panning=!1,this.updateClassName(),ut.off(document.body,".panning"),ut.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),s=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(X(e,t),De(e,s)):(De(e,t),X(e,s)):(De(e,t),De(e,s))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.getPlugin("selection"),s=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!s)&&this.startPanning(e)}onRightMouseDown(e){const t=this.widgetOptions.eventTypes;t!=null&&t.includes("rightMouseDown")&&e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,s){this.graph.translateBy(-t,-s)}onSpaceKeyDown(e){e.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(e){e.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(e){const t=this.widgetOptions.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&((t=this.widgetOptions.eventTypes)===null||t===void 0?void 0:t.includes("mouseWheel"))}autoPanning(e,t){const r=this.graph.getGraphArea();let i=0,o=0;e<=r.left+10&&(i=-10),t<=r.top+10&&(o=-10),e>=r.right-10&&(i=10),t>=r.bottom-10&&(o=10),(i!==0||o!==0)&&this.graph.translateBy(-i,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}qB([at.dispose()],yd.prototype,"dispose",null);var JB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class bd extends at{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new $y(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&bs.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&bs.isMatch(e,this.widgetOptions.modifiers)){const s=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*s*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/s)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.currentScale;let o=this.graph.transform.clampScale(i*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,c=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=xt(o,a,c),o!==i)if(this.widgetOptions.zoomAtMousePosition){const d=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:d.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}JB([yt.dispose()],bd.prototype,"dispose",null);var XB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class qb extends at{init(){this.resetRenderArea=YP(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}XB([at.dispose()],qb.prototype,"dispose",null);class KB{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&Qn.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,s=this.queue.length,r=s-1;const i=e.priority;for(;t<=r;){const o=(r-t>>1)+t;i<=this.queue[o].priority?t=o+1:(s=o,r=o-1)}return s}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Qn;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(Qn||(Qn={}));var ZB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class tt extends yt{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new KB,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(s=>s.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const s=this.views[e.id];s&&this.requestViewUpdate(s.view,tt.FLAG_INSERT,t,Qn.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,s={},r=Qn.Update,i=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=s,(e.hasAction(t,["translate","resize","rotate"])||s.async===!1)&&(r=Qn.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(e,t,s);const d=s.queue;if(d){const f=d.indexOf(e.cell.id);f>=0&&d.splice(f,1),d.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(d=>{this.requestViewUpdate(d.view,d.flag,s,r,!1)}),i&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===tt.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((s,r)=>s.isNode()&&r.isEdge()?-1:0),e.forEach(s=>{const r=s.id,i=this.views;let o=0,a=i[r];if(a)o=tt.FLAG_INSERT;else{const c=this.createCellView(s);c&&(c.graph=this.graph,o=tt.FLAG_INSERT|c.getBootstrapFlag(),a={view:c,flag:o,options:t,state:tt.ViewState.CREATED},this.views[r]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,s={}){const r=e.cell,i=r.id,o=this.views[i];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,s),o.flag=a):o.state===tt.ViewState.MOUNTED?(a=this.updateView(e,t,s),o.flag=a):o.state=tt.ViewState.WAITING,a&&r.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:Qn.RenderEdge,cb:()=>{this.updateView(e,t,s)}})}removeViews(e){e.forEach(t=>{const s=t.id,r=this.views[s];r&&(this.willRemoveViews[s]=r,delete this.views[s],this.queue.queueJob({id:s,priority:this.getRenderPriority(r.view),cb:()=>{this.removeView(r.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===tt.ViewState.WAITING){const{view:t,flag:s,options:r}=e;this.requestViewUpdate(t,s,r,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,s={}){if(e==null)return 0;if(Ue.isCellView(e)){if(t&tt.FLAG_REMOVE)return this.removeView(e.cell),0;t&tt.FLAG_INSERT&&(this.insertView(e),t^=tt.FLAG_INSERT)}return t?e.confirmUpdate(t,s):0}insertView(e){const t=this.views[e.cell.id];if(t){const s=e.cell.getZIndex(),r=this.addZPivot(s);this.container.insertBefore(e.container,r),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=tt.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,s=this.willRemoveViews[t.id];s&&e&&(s.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const s=this.model.getConnectedEdges(e);for(let i=0,o=s.length;i<o;i+=1){const a=s[i];if(t){const c=a.getSourceCell(),u=a.getTargetCell();if(c&&!c.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const r=this.views[e.id];r&&Je(r.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let s=t[e];if(s)return s;s=t[e]=document.createComment(`z-index:${e+1}`);let r=-1/0;for(const o in t){const a=+o;a<e&&a>r&&(r=a,e-1)}const i=this.container;if(r!==-1/0){const o=t[r];i.insertBefore(s,o.nextSibling)}else i.insertBefore(s,i.firstChild);return s}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},s=this.graph.options.createCellView;if(s){const i=ee(s,this.graph,e);if(i)return new i(e,t);if(i===null)return null}const r=e.view;if(r!=null&&typeof r=="string"){const i=Ue.registry.get(r);return i?new i(e,t):Ue.registry.onNotFound(r)}return e.isNode()?new gn(e,t):e.isEdge()?new Zn(e,t):null}getEffectedEdges(e){const t=[],s=e.cell,r=this.model.getConnectedEdges(s);for(let i=0,o=r.length;i<o;i+=1){const a=r[i],c=this.views[a.id];if(!c)continue;const u=c.view;if(!this.isViewMounted(u))continue;const d=["update"];a.getTargetCell()===s&&d.push("target"),a.getSourceCell()===s&&d.push("source"),t.push({id:a.id,view:u,flag:u.getFlag(d)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,s=t.getSourceCell(),r=t.getTargetCell();if(this.renderArea&&s&&r)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?Qn.RenderNode:Qn.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}ZB([yt.dispose()],tt.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(tt||(tt={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(tt||(tt={}));var QB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class wd extends at{constructor(){super(...arguments),this.schedule=new tt(this.graph)}requestViewUpdate(e,t,s={}){this.schedule.requestViewUpdate(e,t,s)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,s=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[0];if(s){const r=this.graph.view.findAttr("data-cell-id",s);if(r){const i=this.schedule.views;if(i[r])return i[r].view}}return null}findViewByCell(e){if(e==null)return null;const t=pe.isCell(e)?e.id:e,s=this.schedule.views;return s[t]?s[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>s!=null?Se.getBBox(s.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(s=>this.findViewByCell(s)).filter(s=>{if(s!=null){const r=s.getClosestPoint(e);if(r)return r.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const s=F.create(e);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(t.nodeOnly&&!r.isNodeView())return!1;const i=Se.getBBox(r.container,{target:this.view.stage});return i.width===0?i.inflate(1,0):i.height===0&&i.inflate(0,1),t.strict?s.containsRect(i):s.isIntersectWithRect(i)}return!1})}dispose(){this.schedule.dispose()}}QB([at.dispose()],wd.prototype,"dispose",null);var Jb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Xb extends at{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const s=e.name;if(t||(t=`filter-${s}-${this.cid}-${Iu(JSON.stringify(e))}`),!this.isDefined(t)){const r=Wr.registry.get(s);if(r==null)return Wr.registry.onNotFound(s);const i=r(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});oe.create(ke.sanitize(i),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const s=e.type;if(t||(t=`gradient-${s}-${this.cid}-${Iu(JSON.stringify(e))}`),!this.isDefined(t)){const i=e.stops.map(c=>{const u=c.opacity!=null&&Number.isFinite(c.opacity)?c.opacity:1;return`<stop offset="${c.offset}" stop-color="${c.color}" stop-opacity="${u}"/>`}),o=`<${s}>${i.join("")}</${s}>`,a=Object.assign({id:t},e.attrs);oe.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:s,refY:r,markerUnits:i,markerOrient:o,tagName:a,children:c}=e,u=Jb(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=t;if(d||(d=`marker-${this.cid}-${Iu(JSON.stringify(e))}`),!this.isDefined(d)){a!=="path"&&delete u.d;const f=oe.create("marker",{refX:s,refY:r,id:d,overflow:"visible",orient:o??"auto",markerUnits:i||"userSpaceOnUse"},c?c.map(h=>{var{tagName:p}=h,g=Jb(h,["tagName"]);return oe.create(`${p}`||"path",Qi(Object.assign(Object.assign({},u),g)))}):[oe.create(a||"path",Qi(u))]);this.defs.appendChild(f.node)}return d}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Kb extends at{getClientMatrix(){return it(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new O(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const s=O.create(e,t);return Se.transformPoint(s,this.graph.matrix())}localToClientPoint(e,t){const s=O.create(e,t);return Se.transformPoint(s,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,s,r){const i=F.create(e,t,s,r);return Se.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,s,r){const i=F.create(e,t,s,r);return Se.transformRectangle(i,this.getClientMatrix())}localToPageRect(e,t,s,r){return(typeof e=="number"?this.localToGraphRect(e,t,s,r):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const s=O.create(e,t);return Se.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const s=O.create(e,t);return Se.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const s=O.create(e,t);return Se.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const r=O.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(e,t,s,r){const i=F.create(e,t,s,r);return Se.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,s,r){const i=F.create(e,t,s,r);return Se.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,s,r){const i=F.create(e,t,s,r);return Se.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,s,r){const i=F.create(e,t,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var ej=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class vl extends at{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:s={}}){const r=this.resolveHighlighter(s);if(!r)return;const i=this.getHighlighterId(t,r);if(!this.highlights[i]){const o=r.highlighter;o.highlight(e,t,Object.assign({},r.args)),this.highlights[i]={cellView:e,magnet:t,highlighter:o,args:r.args}}}onCellUnhighlight({magnet:e,options:t={}}){const s=this.resolveHighlighter(t);if(!s)return;const r=this.getHighlighterId(e,s);this.unhighlight(r)}resolveHighlighter(e){const t=this.options;let s=e.highlighter;if(s==null){const a=e.type;s=a&&t.highlighting[a]||t.highlighting.default}if(s==null)return null;const r=typeof s=="string"?{name:s}:s,i=r.name,o=Xn.registry.get(i);return o==null?Xn.registry.onNotFound(i):(Xn.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(e,t){return zu(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}ej([vl.dispose()],vl.prototype,"dispose",null);var tj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Zb extends at{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&el.bind(t,()=>{const s=t.offsetWidth,r=t.offsetHeight;this.resize(s,r)})}}resize(e,t){const s=this.getScroller();s?s.resize(e,t):this.graph.transform.resize(e,t)}dispose(){el.clear(this.graph.container)}}tj([at.dispose()],Zb.prototype,"dispose",null);var nj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class $ extends Te{get container(){return this.options.container}get[Symbol.toStringTag](){return $.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=bo.get(e),this.css=new pd(this),this.view=new _n(this),this.defs=new Xb(this),this.coord=new Kb(this),this.transform=new Yb(this),this.highlight=new vl(this),this.grid=new gd(this),this.background=new md(this),this.options.model?this.model=this.options.model:(this.model=new et,this.model.graph=this),this.renderer=new wd(this),this.panning=new yd(this),this.mousewheel=new bd(this),this.virtualRender=new qb(this),this.size=new Zb(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(s=>He.isNode(s)?s:this.createNode(s)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(s=>je.isEdge(s)?s:this.createEdge(s)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,s={}){return this.model.isNeighbor(e,t,s)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,s={}){return this.model.isSuccessor(e,t,s)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,s={}){return this.model.isPredecessor(e,t,s)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,s,r,i){return this.model.getNodesInArea(e,t,s,r,i)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,s={}){return this.model.search(e,t,s),this}getShortestPath(e,t,s={}){return this.model.getShortestPath(e,t,s)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,s){const r=typeof e=="string"?e:"update",i=typeof e=="string"?t:e,o=typeof t=="function"?s:t;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return pe.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return F.isRectangleLike(e)?this.findViewsInArea(e):O.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(s)}findViewsInArea(e,t,s,r,i){const o=typeof e=="number"?{x:e,y:t,width:s,height:r}:e,a=typeof e=="number"?i:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e>"u"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const s=this.getPlugin("scroller");return s?s.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,s=0,r=0){return typeof e>"u"?this.transform.getScale():(this.transform.scale(e,t,s,r),this)}zoom(e,t){const s=this.getPlugin("scroller");if(s){if(typeof e>"u")return s.zoom();s.zoom(e,t)}else{if(typeof e>"u")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const s=this.getPlugin("scroller");return s?s.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const s=this.getPlugin("scroller");return s?s.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,s){return typeof e>"u"?this.transform.getRotation():(this.transform.rotate(e,t,s),this)}translate(e,t){return typeof e>"u"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const s=this.translate(),r=s.tx+e,i=s.ty+t;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,s,r){return this.transform.fitToContent(e,t,s,r)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,s){const r=this.getPlugin("scroller");return r?r.centerPoint(e,t,s):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const s=this.getPlugin("scroller");return s?s.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,s,r={}){const i=this.getPlugin("scroller");return i?i.positionPoint(e,t,s,r):this.transform.positionPoint(e,t,s),this}positionRect(e,t,s){const r=this.getPlugin("scroller");return r?r.positionRect(e,t,s):this.transform.positionRect(e,t),this}positionCell(e,t,s){const r=this.getPlugin("scroller");return r?r.positionCell(e,t,s):this.transform.positionCell(e,t),this}positionContent(e,t){const s=this.getPlugin("scroller");return s?s.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,s,r){return F.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.pageToLocalRect(e,t,s,r):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,s,r){return F.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToPageRect(e,t,s,r):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,s,r){return F.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToLocalRect(e,t,s,r):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,s,r){return F.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToClientRect(e,t,s,r):this.coord.localToClientPoint(e,t)}localToGraph(e,t,s,r){return F.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToGraphRect(e,t,s,r):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,s,r){return F.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.graphToLocalRect(e,t,s,r):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,s,r){return F.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToGraphRect(e,t,s,r):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const s=this.getPlugin("scroller");return s!=null&&(this.options.background==null||!t)?s.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.enable)===null||i===void 0||i.call(r)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.disable)===null||i===void 0||i.call(r)}),this}isPluginEnabled(e){var t;const s=this.getPlugin(e);return(t=s==null?void 0:s.isEnabled)===null||t===void 0?void 0:t.call(s)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{r.dispose(),this.installedPlugins.delete(r)}),this}dispose(e=!0){e&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(t=>{t.dispose()})}}nj([Te.dispose()],$.prototype,"dispose",null),function(n){n.View=_n,n.Renderer=wd,n.MouseWheel=bd,n.DefsManager=Xb,n.GridManager=gd,n.CoordManager=Kb,n.TransformManager=Yb,n.HighlightManager=vl,n.BackgroundManager=md,n.PanningManager=yd}($||($={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag];return s==null||s===n.toStringTag}n.isGraph=e}($||($={})),function(n){function e(t,s){const r=t instanceof HTMLElement?new n({container:t}):new n(t);return s!=null&&r.fromJSON(s),r}n.render=e}($||($={})),function(n){n.registerNode=He.registry.register,n.registerEdge=je.registry.register,n.registerView=Ue.registry.register,n.registerAttr=An.registry.register,n.registerGrid=xs.registry.register,n.registerFilter=Wr.registry.register,n.registerNodeTool=Xr.registry.register,n.registerEdgeTool=Kr.registry.register,n.registerBackground=lo.registry.register,n.registerHighlighter=Xn.registry.register,n.registerPortLayout=Qs.registry.register,n.registerPortLabelLayout=qr.registry.register,n.registerMarker=Ss.registry.register,n.registerRouter=Ns.registry.register,n.registerConnector=er.registry.register,n.registerAnchor=Zr.registry.register,n.registerEdgeAnchor=Qr.registry.register,n.registerConnectionPoint=ei.registry.register}($||($={})),function(n){n.unregisterNode=He.registry.unregister,n.unregisterEdge=je.registry.unregister,n.unregisterView=Ue.registry.unregister,n.unregisterAttr=An.registry.unregister,n.unregisterGrid=xs.registry.unregister,n.unregisterFilter=Wr.registry.unregister,n.unregisterNodeTool=Xr.registry.unregister,n.unregisterEdgeTool=Kr.registry.unregister,n.unregisterBackground=lo.registry.unregister,n.unregisterHighlighter=Xn.registry.unregister,n.unregisterPortLayout=Qs.registry.unregister,n.unregisterPortLabelLayout=qr.registry.unregister,n.unregisterMarker=Ss.registry.unregister,n.unregisterRouter=Ns.registry.unregister,n.unregisterConnector=er.registry.unregister,n.unregisterAnchor=Zr.registry.unregister,n.unregisterEdgeAnchor=Qr.registry.unregister,n.unregisterConnectionPoint=ei.registry.unregister}($||($={}));var sj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},rj=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ii extends He{}(function(n){class e extends gn{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:s}){const r=n.shapeMaps[this.cell.shape];if(r){const{effect:i}=r;(!i||i.includes(s))&&this.renderHTMLComponent()}}confirmUpdate(s){const r=super.confirmUpdate(s);return this.handleAction(r,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const s=this.selectors&&this.selectors.foContent;if(s){Zi(s);const r=n.shapeMaps[this.cell.shape];if(!r)return;let{html:i}=r;typeof i=="function"&&(i=i(this.cell)),i&&(typeof i=="string"?s.innerHTML=i:kt(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}sj([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),gn.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(ii||(ii={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},ke.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),He.registry.register("html",n,!0)}(ii||(ii={})),function(n){n.shapeMaps={};function e(t){const{shape:s,html:r,effect:i,inherit:o}=t,a=rj(t,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},$.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(ii||(ii={}));var ij=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Qb extends be{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(e,t,s){super(),this.node=t,this.graph=s,this.options=Object.assign(Object.assign({},nt.defaultOptions),e),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const e=document.createElement("div");fe(e,"draggable","false");const t=e.cloneNode(!0);X(t,this.rotateClassName);const s=nt.POSITIONS.map(r=>{const i=e.cloneNode(!0);return X(i,this.resizeClassName),fe(i,"data-position",r),i});this.empty(),kt(this.container,[...s,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(nt.NODE_CLS),X(this.container,this.containerClassName),hn(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),hn(this.container,"no-resize",!this.options.resizable),hn(this.container,"no-rotate",!this.options.rotatable),this.options.className&&X(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const s=ye.normalize(this.node.getAngle()),r=s!==0?`rotate(${s}deg)`:"";return Je(this.container,{transform:r,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(nt.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=ye.normalize(this.node.getAngle()),t=Math.floor(e*(nt.DIRECTIONS.length/360));if(t!==this.prevShift){const s=nt.DIRECTIONS.slice(t).concat(nt.DIRECTIONS.slice(0,t)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{De(o,nt.DIRECTIONS.map(c=>r(c)).join(" ")),X(o,r(s[a]))}),this.prevShift=t}}getTrueDirection(e){const t=ye.normalize(this.node.getAngle());let s=nt.POSITIONS.indexOf(e);return s+=Math.floor(t*(nt.POSITIONS.length/360)),s%=nt.POSITIONS.length,nt.POSITIONS[s]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=fe(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const s=this.getTrueDirection(t);let r=0,i=0;t.split("-").forEach(u=>{r={left:-1,right:1}[u]||r,i={top:-1,bottom:1}[u]||i});const o=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],c=ye.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:o,trueDirection:s,relativeDirection:t,angle:c,resizeX:r,resizeY:i,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY);this.setEventData(e,{center:t,action:"rotating",angle:ye.normalize(this.node.getAngle()),start:O.create(r).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let s=this.getEventData(e);if(s.action){const r=this.normalizeEvent(e);let i=r.clientX,o=r.clientY;const a=this.graph.getPlugin("scroller"),c=this.options.restrictedResizing;if(c===!0||typeof c=="number"){const p=c===!0?0:c,g=a?Math.max(p,8):p,m=this.graph.container.getBoundingClientRect();i=xt(i,m.left+g,m.right-g),o=xt(o,m.top+g,m.bottom-g)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const u=this.graph.snapToGrid(i,o),d=this.graph.getGridSize(),f=this.node,h=this.options;if(s.action==="resizing"){s=s,s.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),s.resized=!0);const p=f.getBBox(),g=O.create(u).rotate(s.angle,p.getCenter()).diff(p[s.selector]);let m=s.resizeX?g.x*s.resizeX:p.width,y=s.resizeY?g.y*s.resizeY:p.height;const b=m,w=y;if(m=Ce.snapToGrid(m,d),y=Ce.snapToGrid(y,d),m=Math.max(m,h.minWidth||d),y=Math.max(y,h.minHeight||d),m=Math.min(m,h.maxWidth||1/0),y=Math.min(y,h.maxHeight||1/0),h.preserveAspectRatio){const v=p.width*y/p.height,S=p.height*m/p.width;m<v?y=S:m=v}const x=s.relativeDirection;if(h.allowReverse&&(b<=-m||w<=-y)){let v;x==="left"?b<=-m&&(v="right"):x==="right"?b<=-m&&(v="left"):x==="top"?w<=-y&&(v="bottom"):x==="bottom"?w<=-y&&(v="top"):x==="top-left"?b<=-m&&w<=-y?v="bottom-right":b<=-m?v="top-right":w<=-y&&(v="bottom-left"):x==="top-right"?b<=-m&&w<=-y?v="bottom-left":b<=-m?v="top-left":w<=-y&&(v="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?v="top-right":b<=-m?v="bottom-right":w<=-y&&(v="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?v="top-left":b<=-m?v="bottom-left":w<=-y&&(v="top-right"));const S=v;this.stopHandle();const E=this.container.querySelector(`.${this.resizeClassName}[data-position="${S}"]`);this.startHandle(E),this.prepareResizing(e,S),this.onMouseMove(e)}if(p.width!==m||p.height!==y){const v={ui:!0,direction:s.direction,relativeDirection:s.relativeDirection,trueDirection:s.trueDirection,minWidth:h.minWidth,minHeight:h.minHeight,maxWidth:h.maxWidth,maxHeight:h.maxHeight,preserveAspectRatio:h.preserveAspectRatio===!0};f.resize(m,y,v),this.notify("node:resizing",e,t)}}else if(s.action==="rotating"){s=s,s.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),s.rotated=!0);const p=f.getAngle(),g=s.start-O.create(u).theta(s.center);let m=s.angle+g;h.rotateGrid&&(m=Ce.snapToGrid(m,h.rotateGrid)),m=ye.normalize(m),p!==m&&(f.rotate(m,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch(t.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,X(this.container,`${this.containerClassName}-active`),e){X(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const s=nt.DIRECTIONS[nt.POSITIONS.indexOf(t)];X(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(De(this.container,`${this.containerClassName}-active`),this.handle){De(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=nt.DIRECTIONS[nt.POSITIONS.indexOf(e)];De(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(nt.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),s=this.getEventData(e);t&&(t.removeClass(`node-${s.action}`),s.action==="resizing"&&s.resized?this.notify("node:resized",e,t):s.action==="rotating"&&s.rotated&&this.notify("node:rotated",e,t))}notify(e,t,s,r={}){if(s){const i=s.graph,o=i.view.normalizeEvent(t),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(e,Object.assign({e:o,view:s,node:s.cell,cell:s.cell,x:a.x,y:a.y},r))}}dispose(){this.stopListening(),this.remove(),this.off()}}ij([be.dispose()],Qb.prototype,"dispose",null);var nt;(function(n){n.NODE_CLS="has-widget-transform",n.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],n.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},n.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(nt||(nt={}));const oj=`.x6-widget-transform {
279
279
  position: absolute;
280
280
  box-sizing: content-box !important;
281
281
  margin: -5px 0 0 -5px;
@@ -401,7 +401,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
401
401
  display: block;
402
402
  background-color: #808080;
403
403
  }
404
- `;$.prototype.createTransformWidget=function(n){const e=this.getPlugin("transform");return e&&e.createWidget(n),this},$.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var JB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class sr extends Te{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,zr(this.name,qB)}init(e){this.graph=e,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(s,r)=>{this.trigger(s,r),this.graph.trigger(s,r)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new Fb(t,e,this.graph):null}getTransformOptions(e){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const t=sr.parseOptionGroup(this.graph,e,this.options.resizing),s=sr.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof t.orthogonal=="boolean"?t.orthogonal:!0,restrictedResizing:!!t.restrict,autoScrollOnResizing:typeof t.autoScroll=="boolean"?t.autoScroll:!0,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:typeof t.allowReverse=="boolean"?t.allowReverse:!0,rotatable:!!s.enabled,rotateGrid:s.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Fr(this.name)}}JB([Te.dispose()],sr.prototype,"dispose",null),function(n){function e(t,s,r){const i={};return Object.keys(r||{}).forEach(o=>{const a=r[o];i[o]=typeof a=="function"?a.call(t,s):a}),i}n.parseOptionGroup=e}(sr||(sr={}));var Ub={exports:{}};(function(n){(function(e,t,s){if(!e)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},c,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function d(C,M,N){if(C.addEventListener){C.addEventListener(M,N,!1);return}C.attachEvent("on"+M,N)}function h(C){if(C.type=="keypress"){var M=String.fromCharCode(C.which);return C.shiftKey||(M=M.toLowerCase()),M}return r[C.which]?r[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function f(C,M){return C.sort().join(",")===M.sort().join(",")}function p(C){var M=[];return C.shiftKey&&M.push("shift"),C.altKey&&M.push("alt"),C.ctrlKey&&M.push("ctrl"),C.metaKey&&M.push("meta"),M}function g(C){if(C.preventDefault){C.preventDefault();return}C.returnValue=!1}function m(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function y(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function b(){if(!c){c={};for(var C in r)C>95&&C<112||r.hasOwnProperty(C)&&(c[r[C]]=C)}return c}function w(C,M,N){return N||(N=b()[C]?"keydown":"keypress"),N=="keypress"&&M.length&&(N="keydown"),N}function x(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function v(C,M){var N,_,T,k=[];for(N=x(C),T=0;T<N.length;++T)_=N[T],a[_]&&(_=a[_]),M&&M!="keypress"&&o[_]&&(_=o[_],k.push("shift")),y(_)&&k.push(_);return M=w(_,k,M),{key:_,modifiers:k,action:M}}function S(C,M){return C===null||C===t?!1:C===M?!0:S(C.parentNode,M)}function E(C){var M=this;if(C=C||t,!(M instanceof E))return new E(C);M.target=C,M._callbacks={},M._directMap={};var N={},_,T=!1,k=!1,R=!1;function V(I){I=I||{};var B=!1,ne;for(ne in N){if(I[ne]){B=!0;continue}N[ne]=0}B||(R=!1)}function A(I,B,ne,L,G,ie){var Z,ae,He=[],re=ne.type;if(!M._callbacks[I])return[];for(re=="keyup"&&y(I)&&(B=[I]),Z=0;Z<M._callbacks[I].length;++Z)if(ae=M._callbacks[I][Z],!(!L&&ae.seq&&N[ae.seq]!=ae.level)&&re==ae.action&&(re=="keypress"&&!ne.metaKey&&!ne.ctrlKey||f(B,ae.modifiers))){var at=!L&&ae.combo==G,nt=L&&ae.seq==L&&ae.level==ie;(at||nt)&&M._callbacks[I].splice(Z,1),He.push(ae)}return He}function P(I,B,ne,L){M.stopCallback(B,B.target||B.srcElement,ne,L)||I(B,ne)===!1&&(g(B),m(B))}M._handleKey=function(I,B,ne){var L=A(I,B,ne),G,ie={},Z=0,ae=!1;for(G=0;G<L.length;++G)L[G].seq&&(Z=Math.max(Z,L[G].level));for(G=0;G<L.length;++G){if(L[G].seq){if(L[G].level!=Z)continue;ae=!0,ie[L[G].seq]=1,P(L[G].callback,ne,L[G].combo,L[G].seq);continue}ae||P(L[G].callback,ne,L[G].combo)}var He=ne.type=="keypress"&&k;ne.type==R&&!y(I)&&!He&&V(ie),k=ae&&ne.type=="keydown"};function j(I){typeof I.which!="number"&&(I.which=I.keyCode);var B=h(I);if(B){if(I.type=="keyup"&&T===B){T=!1;return}M.handleKey(B,p(I),I)}}function z(){clearTimeout(_),_=setTimeout(V,1e3)}function Y(I,B,ne,L){N[I]=0;function G(re){return function(){R=re,++N[I],z()}}function ie(re){P(ne,re,I),L!=="keyup"&&(T=h(re)),setTimeout(V,10)}for(var Z=0;Z<B.length;++Z){var ae=Z+1===B.length,He=ae?ie:G(L||v(B[Z+1]).action);le(B[Z],He,L,I,Z)}}function le(I,B,ne,L,G){M._directMap[I+":"+ne]=B,I=I.replace(/\s+/g," ");var ie=I.split(" "),Z;if(ie.length>1){Y(I,ie,B,ne);return}Z=v(I,ne),M._callbacks[Z.key]=M._callbacks[Z.key]||[],A(Z.key,Z.modifiers,{type:Z.action},L,I,G),M._callbacks[Z.key][L?"unshift":"push"]({callback:B,modifiers:Z.modifiers,action:Z.action,seq:L,level:G,combo:I})}M._bindMultiple=function(I,B,ne){for(var L=0;L<I.length;++L)le(I[L],B,ne)},d(C,"keypress",j),d(C,"keydown",j),d(C,"keyup",j)}E.prototype.bind=function(C,M,N){var _=this;return C=C instanceof Array?C:[C],_._bindMultiple.call(_,C,M,N),_},E.prototype.unbind=function(C,M){var N=this;return N.bind.call(N,C,function(){},M)},E.prototype.trigger=function(C,M){var N=this;return N._directMap[C+":"+M]&&N._directMap[C+":"+M]({},C),N},E.prototype.reset=function(){var C=this;return C._callbacks={},C._directMap={},C},E.prototype.stopCallback=function(C,M){var N=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||S(M,N.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var _=C.composedPath()[0];_!==C.target&&(M=_)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},E.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},E.addKeycodes=function(C){for(var M in C)C.hasOwnProperty(M)&&(r[M]=C[M]);c=null},E.init=function(){var C=E(t);for(var M in C)M.charAt(0)!=="_"&&(E[M]=function(N){return function(){return C[N].apply(C,arguments)}}(M))},E.init(),e.Mousetrap=E,n.exports&&(n.exports=E)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(Ub);var XB=Ub.exports;const KB=U_(XB);var ZB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ii extends yt{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=ii.createMousetrap(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(e,t,s){this.mousetrap.bind(this.getKeys(e),t,s)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(t=>this.formatkey(t))}formatkey(e){const t=e.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),s=this.options.format;return s?Q(s,this.graph,t):t}isGraphEvent(e){const t=e.target,s=e.currentTarget;return t?t===this.target||s===this.target||t===document.body?!0:Iu(this.container,t):!1}isInputEvent(e){var t;const s=e.target,r=(t=s==null?void 0:s.tagName)===null||t===void 0?void 0:t.toLowerCase();let i=["input","textarea"].includes(r);return fe(s,"contenteditable")==="true"&&(i=!0),i}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),s=this.isInputEvent(e);if(t){if(s&&(e.key==="Backspace"||e.key==="Delete"))return!1;if(this.options.guard)return Q(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}ZB([yt.dispose()],ii.prototype,"dispose",null),function(n){function e(t){const s=new KB(t.target),r=s.stopCallback;return s.stopCallback=(i,o,a)=>t.isEnabledForEvent(i)?r?r.call(s,i,o,a):!1:!0,s}n.createMousetrap=e}(ii||(ii={})),$.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},$.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},$.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},$.prototype.toggleKeyboard=function(n){const e=this.getPlugin("keyboard");return e&&e.toggleEnabled(n),this},$.prototype.bindKey=function(n,e,t){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,e,t),this},$.prototype.unbindKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.unbindKey(n,e),this},$.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},$.prototype.triggerKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.trigger(n,e),this};var QB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Hb extends yt{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new ii(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,s){return this.keyboardImpl.on(e,t,s),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}QB([yt.dispose()],Hb.prototype,"dispose",null);var ej=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},tj=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Gb extends ye{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,s=tj(e,["graph"]);this.graph=t,this.options=Object.assign({},s),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new se("svg"),t=this.horizontal=new se("line"),s=this.vertical=new se("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),s.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),s.setAttribute("display","none"),e.append([t,s]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:s}){const r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){const i=e.cell.getPosition();this.offset={x:t-i.x,y:s-i.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?Q(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const s=this.graph.renderer.findViewByCell(e);if(s&&s.cell.isNode()){const r=e.getBBox(),i=r.bbox(e.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),c=me.normalize(e.getAngle()),u=this.options.tolerance||0;let d,h,f,p,g,m;const y={vertical:0,horizontal:0},b=t.direction,w=t.trueDirection,x=t.relativeDirection;w.indexOf("right")!==-1?y.vertical=a.x:y.vertical=o.x,w.indexOf("bottom")!==-1?y.horizontal=a.y:y.horizontal=o.y,this.model.getNodes().some(k=>{if(this.isIgnored(e,k))return!1;const R=k.getBBox().bbox(k.getAngle()),V=R.getTopLeft(),A=R.getBottomRight(),P={vertical:[V.x,A.x],horizontal:[V.y,A.y]},j={};return Object.keys(P).forEach(z=>{const Y=z,le=P[Y].map(I=>({position:I,distance:Math.abs(I-y[Y])})).filter(I=>I.distance<=u);j[Y]=Ac(le,I=>I.distance)}),d==null&&j.vertical.length>0&&(d=j.vertical[0].position,h=Math.min(i.y,R.y),f=Math.max(a.y,A.y)-h),p==null&&j.horizontal.length>0&&(p=j.horizontal[0].position,g=Math.min(i.x,R.x),m=Math.max(a.x,A.x)-g),d!=null&&p!=null}),this.hide();let v=0,S=0;(p!=null||d!=null)&&(d!=null&&(v=w.indexOf("right")!==-1?d-a.x:o.x-d),p!=null&&(S=w.indexOf("bottom")!==-1?p-a.y:o.y-p));let E=0,C=0;if(c%90===0)c===90||c===270?(E=S,C=v):(E=v,C=S);else{const k=c>=0&&c<90?1:c>=90&&c<180?4:c>=180&&c<270?3:2;p!=null&&d!=null&&(v<S?(S=0,p=void 0):(v=0,d=void 0));const R=me.toRad(c%90);v&&(E=k===3?v/Math.cos(R):v/Math.sin(R)),S&&(C=k===3?S/Math.cos(R):S/Math.sin(R));const V=k===1||k===3;switch(x){case"top":case"bottom":C=S?S/(V?Math.cos(R):Math.sin(R)):v/(V?Math.sin(R):Math.cos(R));break;case"left":case"right":E=v?v/(V?Math.cos(R):Math.sin(R)):S/(V?Math.sin(R):Math.cos(R));break}}switch(x){case"top":case"bottom":E=0;break;case"left":case"right":C=0;break}const M=this.graph.getGridSize();let N=Math.max(r.width+E,M),_=Math.max(r.height+C,M);t.minWidth&&t.minWidth>M&&(N=Math.max(N,t.minWidth)),t.minHeight&&t.minHeight>M&&(_=Math.max(_,t.minHeight)),t.maxWidth&&(N=Math.min(N,t.maxWidth)),t.maxHeight&&(_=Math.min(_,t.maxHeight)),t.preserveAspectRatio&&(C<E?_=N*(r.height/r.width):N=_*(r.width/r.height)),(N!==r.width||_!==r.height)&&(e.resize(N,_,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),f&&(f+=_-r.height),m&&(m+=N-r.width));const T=e.getBBox().bbox(c);d&&Math.abs(T.x-d)>1&&Math.abs(T.width+T.x-d)>1&&(d=void 0),p&&Math.abs(T.y-p)>1&&Math.abs(T.height+T.y-p)>1&&(p=void 0),this.update({verticalLeft:d,verticalTop:h,verticalHeight:f,horizontalTop:p,horizontalLeft:g,horizontalWidth:m})}}}snapOnMoving({view:e,e:t,x:s,y:r}){const i=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),c=o.getPosition(),u=new U(s-this.offset.x,r-this.offset.y,a.width,a.height),d=o.getAngle(),h=u.getCenter(),f=u.bbox(d),p=f.getTopLeft(),g=f.getBottomRight(),m=this.options.tolerance||0;let y,b,w,x,v,S,E=0,C=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(o,M))return!1;const N=M.getBBox().bbox(M.getAngle()),_=N.getCenter(),T=N.getTopLeft(),k=N.getBottomRight();return y==null&&(Math.abs(_.x-h.x)<m?(y=_.x,E=.5):Math.abs(T.x-p.x)<m?(y=T.x,E=0):Math.abs(T.x-g.x)<m?(y=T.x,E=1):Math.abs(k.x-g.x)<m?(y=k.x,E=1):Math.abs(k.x-p.x)<m&&(y=k.x),y!=null&&(b=Math.min(f.y,N.y),w=Math.max(g.y,k.y)-b)),x==null&&(Math.abs(_.y-h.y)<m?(x=_.y,C=.5):Math.abs(T.y-p.y)<m?x=T.y:Math.abs(T.y-g.y)<m?(x=T.y,C=1):Math.abs(k.y-g.y)<m?(x=k.y,C=1):Math.abs(k.y-p.y)<m&&(x=k.y),x!=null&&(v=Math.min(f.x,N.x),S=Math.max(g.x,k.x)-v)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(f.y=x-C*f.height),y!=null&&(f.x=y-E*f.width);const M=f.getCenter(),N=M.x-u.width/2,_=M.y-u.height/2,T=N-c.x,k=_-c.y;(T!==0||k!==0)&&(o.translate(T,k,{snapped:!0,restrict:this.getRestrictArea(i)}),S&&(S+=T),w&&(w+=k)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:v,horizontalWidth:S})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(s=>typeof s=="string"?e.shape===s:e.id===s.id):typeof t=="function"?Q(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new O(e.horizontalLeft,e.horizontalTop)),s=this.graph.localToGraph(new O(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${s.x}`:"100%",y2:`${s.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new O(e.verticalLeft,e.verticalTop)),s=this.graph.localToGraph(new O(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${s.x}`,y2:this.options.sharp?`${s.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}ej([ye.dispose()],Gb.prototype,"dispose",null);const nj=`.x6-widget-snapline {
404
+ `;$.prototype.createTransformWidget=function(n){const e=this.getPlugin("transform");return e&&e.createWidget(n),this},$.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var aj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class tr extends Te{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,Fr(this.name,oj)}init(e){this.graph=e,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(s,r)=>{this.trigger(s,r),this.graph.trigger(s,r)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new Qb(t,e,this.graph):null}getTransformOptions(e){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const t=tr.parseOptionGroup(this.graph,e,this.options.resizing),s=tr.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof t.orthogonal=="boolean"?t.orthogonal:!0,restrictedResizing:!!t.restrict,autoScrollOnResizing:typeof t.autoScroll=="boolean"?t.autoScroll:!0,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:typeof t.allowReverse=="boolean"?t.allowReverse:!0,rotatable:!!s.enabled,rotateGrid:s.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Ur(this.name)}}aj([Te.dispose()],tr.prototype,"dispose",null),function(n){function e(t,s,r){const i={};return Object.keys(r||{}).forEach(o=>{const a=r[o];i[o]=typeof a=="function"?a.call(t,s):a}),i}n.parseOptionGroup=e}(tr||(tr={}));var e0={exports:{}};(function(n){(function(e,t,s){if(!e)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},c,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function d(C,P,A){if(C.addEventListener){C.addEventListener(P,A,!1);return}C.attachEvent("on"+P,A)}function f(C){if(C.type=="keypress"){var P=String.fromCharCode(C.which);return C.shiftKey||(P=P.toLowerCase()),P}return r[C.which]?r[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function h(C,P){return C.sort().join(",")===P.sort().join(",")}function p(C){var P=[];return C.shiftKey&&P.push("shift"),C.altKey&&P.push("alt"),C.ctrlKey&&P.push("ctrl"),C.metaKey&&P.push("meta"),P}function g(C){if(C.preventDefault){C.preventDefault();return}C.returnValue=!1}function m(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function y(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function b(){if(!c){c={};for(var C in r)C>95&&C<112||r.hasOwnProperty(C)&&(c[r[C]]=C)}return c}function w(C,P,A){return A||(A=b()[C]?"keydown":"keypress"),A=="keypress"&&P.length&&(A="keydown"),A}function x(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function v(C,P){var A,T,k,V=[];for(A=x(C),k=0;k<A.length;++k)T=A[k],a[T]&&(T=a[T]),P&&P!="keypress"&&o[T]&&(T=o[T],V.push("shift")),y(T)&&V.push(T);return P=w(T,V,P),{key:T,modifiers:V,action:P}}function S(C,P){return C===null||C===t?!1:C===P?!0:S(C.parentNode,P)}function E(C){var P=this;if(C=C||t,!(P instanceof E))return new E(C);P.target=C,P._callbacks={},P._directMap={};var A={},T,k=!1,V=!1,R=!1;function j(I){I=I||{};var _=!1,H;for(H in A){if(I[H]){_=!0;continue}A[H]=0}_||(R=!1)}function N(I,_,H,K,q,re){var Z,ge,te=[],le=H.type;if(!P._callbacks[I])return[];for(le=="keyup"&&y(I)&&(_=[I]),Z=0;Z<P._callbacks[I].length;++Z)if(ge=P._callbacks[I][Z],!(!K&&ge.seq&&A[ge.seq]!=ge.level)&&le==ge.action&&(le=="keypress"&&!H.metaKey&&!H.ctrlKey||h(_,ge.modifiers))){var bt=!K&&ge.combo==q,st=K&&ge.seq==K&&ge.level==re;(bt||st)&&P._callbacks[I].splice(Z,1),te.push(ge)}return te}function M(I,_,H,K){P.stopCallback(_,_.target||_.srcElement,H,K)||I(_,H)===!1&&(g(_),m(_))}P._handleKey=function(I,_,H){var K=N(I,_,H),q,re={},Z=0,ge=!1;for(q=0;q<K.length;++q)K[q].seq&&(Z=Math.max(Z,K[q].level));for(q=0;q<K.length;++q){if(K[q].seq){if(K[q].level!=Z)continue;ge=!0,re[K[q].seq]=1,M(K[q].callback,H,K[q].combo,K[q].seq);continue}ge||M(K[q].callback,H,K[q].combo)}var te=H.type=="keypress"&&V;H.type==R&&!y(I)&&!te&&j(re),V=ge&&H.type=="keydown"};function D(I){typeof I.which!="number"&&(I.which=I.keyCode);var _=f(I);if(_){if(I.type=="keyup"&&k===_){k=!1;return}P.handleKey(_,p(I),I)}}function B(){clearTimeout(T),T=setTimeout(j,1e3)}function G(I,_,H,K){A[I]=0;function q(le){return function(){R=le,++A[I],B()}}function re(le){M(H,le,I),K!=="keyup"&&(k=f(le)),setTimeout(j,10)}for(var Z=0;Z<_.length;++Z){var ge=Z+1===_.length,te=ge?re:q(K||v(_[Z+1]).action);se(_[Z],te,K,I,Z)}}function se(I,_,H,K,q){P._directMap[I+":"+H]=_,I=I.replace(/\s+/g," ");var re=I.split(" "),Z;if(re.length>1){G(I,re,_,H);return}Z=v(I,H),P._callbacks[Z.key]=P._callbacks[Z.key]||[],N(Z.key,Z.modifiers,{type:Z.action},K,I,q),P._callbacks[Z.key][K?"unshift":"push"]({callback:_,modifiers:Z.modifiers,action:Z.action,seq:K,level:q,combo:I})}P._bindMultiple=function(I,_,H){for(var K=0;K<I.length;++K)se(I[K],_,H)},d(C,"keypress",D),d(C,"keydown",D),d(C,"keyup",D)}E.prototype.bind=function(C,P,A){var T=this;return C=C instanceof Array?C:[C],T._bindMultiple.call(T,C,P,A),T},E.prototype.unbind=function(C,P){var A=this;return A.bind.call(A,C,function(){},P)},E.prototype.trigger=function(C,P){var A=this;return A._directMap[C+":"+P]&&A._directMap[C+":"+P]({},C),A},E.prototype.reset=function(){var C=this;return C._callbacks={},C._directMap={},C},E.prototype.stopCallback=function(C,P){var A=this;if((" "+P.className+" ").indexOf(" mousetrap ")>-1||S(P,A.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var T=C.composedPath()[0];T!==C.target&&(P=T)}return P.tagName=="INPUT"||P.tagName=="SELECT"||P.tagName=="TEXTAREA"||P.isContentEditable},E.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},E.addKeycodes=function(C){for(var P in C)C.hasOwnProperty(P)&&(r[P]=C[P]);c=null},E.init=function(){var C=E(t);for(var P in C)P.charAt(0)!=="_"&&(E[P]=function(A){return function(){return C[A].apply(C,arguments)}}(P))},E.init(),e.Mousetrap=E,n.exports&&(n.exports=E)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(e0);var lj=e0.exports;const cj=tk(lj);var uj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class oi extends yt{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=oi.createMousetrap(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(e,t,s){this.mousetrap.bind(this.getKeys(e),t,s)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(t=>this.formatkey(t))}formatkey(e){const t=e.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),s=this.options.format;return s?ee(s,this.graph,t):t}isGraphEvent(e){const t=e.target,s=e.currentTarget;return t?t===this.target||s===this.target||t===document.body?!0:Hu(this.container,t):!1}isInputEvent(e){var t;const s=e.target,r=(t=s==null?void 0:s.tagName)===null||t===void 0?void 0:t.toLowerCase();let i=["input","textarea"].includes(r);return fe(s,"contenteditable")==="true"&&(i=!0),i}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),s=this.isInputEvent(e);if(t){if(s&&(e.key==="Backspace"||e.key==="Delete"))return!1;if(this.options.guard)return ee(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}uj([yt.dispose()],oi.prototype,"dispose",null),function(n){function e(t){const s=new cj(t.target),r=s.stopCallback;return s.stopCallback=(i,o,a)=>t.isEnabledForEvent(i)?r?r.call(s,i,o,a):!1:!0,s}n.createMousetrap=e}(oi||(oi={})),$.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},$.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},$.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},$.prototype.toggleKeyboard=function(n){const e=this.getPlugin("keyboard");return e&&e.toggleEnabled(n),this},$.prototype.bindKey=function(n,e,t){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,e,t),this},$.prototype.unbindKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.unbindKey(n,e),this},$.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},$.prototype.triggerKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.trigger(n,e),this};var dj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class t0 extends yt{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new oi(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,s){return this.keyboardImpl.on(e,t,s),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}dj([yt.dispose()],t0.prototype,"dispose",null);var hj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},fj=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class n0 extends be{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,s=fj(e,["graph"]);this.graph=t,this.options=Object.assign({},s),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new oe("svg"),t=this.horizontal=new oe("line"),s=this.vertical=new oe("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),s.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),s.setAttribute("display","none"),e.append([t,s]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:s}){const r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){const i=e.cell.getPosition();this.offset={x:t-i.x,y:s-i.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?ee(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const s=this.graph.renderer.findViewByCell(e);if(s&&s.cell.isNode()){const r=e.getBBox(),i=r.bbox(e.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),c=ye.normalize(e.getAngle()),u=this.options.tolerance||0;let d,f,h,p,g,m;const y={vertical:0,horizontal:0},b=t.direction,w=t.trueDirection,x=t.relativeDirection;w.indexOf("right")!==-1?y.vertical=a.x:y.vertical=o.x,w.indexOf("bottom")!==-1?y.horizontal=a.y:y.horizontal=o.y,this.model.getNodes().some(V=>{if(this.isIgnored(e,V))return!1;const R=V.getBBox().bbox(V.getAngle()),j=R.getTopLeft(),N=R.getBottomRight(),M={vertical:[j.x,N.x],horizontal:[j.y,N.y]},D={};return Object.keys(M).forEach(B=>{const G=B,se=M[G].map(I=>({position:I,distance:Math.abs(I-y[G])})).filter(I=>I.distance<=u);D[G]=Dc(se,I=>I.distance)}),d==null&&D.vertical.length>0&&(d=D.vertical[0].position,f=Math.min(i.y,R.y),h=Math.max(a.y,N.y)-f),p==null&&D.horizontal.length>0&&(p=D.horizontal[0].position,g=Math.min(i.x,R.x),m=Math.max(a.x,N.x)-g),d!=null&&p!=null}),this.hide();let v=0,S=0;(p!=null||d!=null)&&(d!=null&&(v=w.indexOf("right")!==-1?d-a.x:o.x-d),p!=null&&(S=w.indexOf("bottom")!==-1?p-a.y:o.y-p));let E=0,C=0;if(c%90===0)c===90||c===270?(E=S,C=v):(E=v,C=S);else{const V=c>=0&&c<90?1:c>=90&&c<180?4:c>=180&&c<270?3:2;p!=null&&d!=null&&(v<S?(S=0,p=void 0):(v=0,d=void 0));const R=ye.toRad(c%90);v&&(E=V===3?v/Math.cos(R):v/Math.sin(R)),S&&(C=V===3?S/Math.cos(R):S/Math.sin(R));const j=V===1||V===3;switch(x){case"top":case"bottom":C=S?S/(j?Math.cos(R):Math.sin(R)):v/(j?Math.sin(R):Math.cos(R));break;case"left":case"right":E=v?v/(j?Math.cos(R):Math.sin(R)):S/(j?Math.sin(R):Math.cos(R));break}}switch(x){case"top":case"bottom":E=0;break;case"left":case"right":C=0;break}const P=this.graph.getGridSize();let A=Math.max(r.width+E,P),T=Math.max(r.height+C,P);t.minWidth&&t.minWidth>P&&(A=Math.max(A,t.minWidth)),t.minHeight&&t.minHeight>P&&(T=Math.max(T,t.minHeight)),t.maxWidth&&(A=Math.min(A,t.maxWidth)),t.maxHeight&&(T=Math.min(T,t.maxHeight)),t.preserveAspectRatio&&(C<E?T=A*(r.height/r.width):A=T*(r.width/r.height)),(A!==r.width||T!==r.height)&&(e.resize(A,T,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),h&&(h+=T-r.height),m&&(m+=A-r.width));const k=e.getBBox().bbox(c);d&&Math.abs(k.x-d)>1&&Math.abs(k.width+k.x-d)>1&&(d=void 0),p&&Math.abs(k.y-p)>1&&Math.abs(k.height+k.y-p)>1&&(p=void 0),this.update({verticalLeft:d,verticalTop:f,verticalHeight:h,horizontalTop:p,horizontalLeft:g,horizontalWidth:m})}}}snapOnMoving({view:e,e:t,x:s,y:r}){const i=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),c=o.getPosition(),u=new F(s-this.offset.x,r-this.offset.y,a.width,a.height),d=o.getAngle(),f=u.getCenter(),h=u.bbox(d),p=h.getTopLeft(),g=h.getBottomRight(),m=this.options.tolerance||0;let y,b,w,x,v,S,E=0,C=0;if(this.model.getNodes().some(P=>{if(this.isIgnored(o,P))return!1;const A=P.getBBox().bbox(P.getAngle()),T=A.getCenter(),k=A.getTopLeft(),V=A.getBottomRight();return y==null&&(Math.abs(T.x-f.x)<m?(y=T.x,E=.5):Math.abs(k.x-p.x)<m?(y=k.x,E=0):Math.abs(k.x-g.x)<m?(y=k.x,E=1):Math.abs(V.x-g.x)<m?(y=V.x,E=1):Math.abs(V.x-p.x)<m&&(y=V.x),y!=null&&(b=Math.min(h.y,A.y),w=Math.max(g.y,V.y)-b)),x==null&&(Math.abs(T.y-f.y)<m?(x=T.y,C=.5):Math.abs(k.y-p.y)<m?x=k.y:Math.abs(k.y-g.y)<m?(x=k.y,C=1):Math.abs(V.y-g.y)<m?(x=V.y,C=1):Math.abs(V.y-p.y)<m&&(x=V.y),x!=null&&(v=Math.min(h.x,A.x),S=Math.max(g.x,V.x)-v)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(h.y=x-C*h.height),y!=null&&(h.x=y-E*h.width);const P=h.getCenter(),A=P.x-u.width/2,T=P.y-u.height/2,k=A-c.x,V=T-c.y;(k!==0||V!==0)&&(o.translate(k,V,{snapped:!0,restrict:this.getRestrictArea(i)}),S&&(S+=k),w&&(w+=V)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:v,horizontalWidth:S})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(s=>typeof s=="string"?e.shape===s:e.id===s.id):typeof t=="function"?ee(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new O(e.horizontalLeft,e.horizontalTop)),s=this.graph.localToGraph(new O(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${s.x}`:"100%",y2:`${s.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new O(e.verticalLeft,e.verticalTop)),s=this.graph.localToGraph(new O(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${s.x}`,y2:this.options.sharp?`${s.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}hj([be.dispose()],n0.prototype,"dispose",null);const pj=`.x6-widget-snapline {
405
405
  position: absolute;
406
406
  top: 0;
407
407
  right: 0;
@@ -414,7 +414,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
414
414
  stroke: #2ecc71;
415
415
  stroke-width: 1px;
416
416
  }
417
- `;$.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},$.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},$.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},$.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},$.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},$.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},$.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},$.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},$.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},$.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},$.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},$.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},$.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},$.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},$.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},$.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var sj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Yb extends yt{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),zr(this.name,nj)}init(e){this.snaplineImpl=new Gb(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),Fr(this.name)}}sj([yt.dispose()],Yb.prototype,"dispose",null);class rj{constructor(){this.cells=[]}copy(e,t,s={}){this.options=Object.assign({},s);const i=(Qe.isModel(t)?t:t.model).cloneSubGraph(e,s);this.cells=Ac(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(e,t,s={}){this.copy(e,t,s),($.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(i=>i.remove())})}paste(e,t={}){const s=Object.assign(Object.assign({},this.options),t),{offset:r,edgeProps:i,nodeProps:o}=s;let a=20,c=20;r&&(a=typeof r=="number"?r:r.dx,c=typeof r=="number"?r:r.dy),this.deserialize(s);const u=this.cells;u.forEach(h=>{h.model=null,h.removeProp("zIndex"),(a||c)&&h.translate(a,c),o&&h.isNode()&&h.prop(o),i&&h.isEdge()&&h.prop(i)});const d=$.isGraph(e)?e.model:e;return d.batchUpdate("paste",()=>{d.addCells(this.cells)}),this.copy(u,e,t),u}serialize(e){e.useLocalStorage!==!1&&mo.save(this.cells)}deserialize(e){if(e.useLocalStorage){const t=mo.fetch();t&&(this.cells=t)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],mo.clean()}}var mo;(function(n){const e=`${Gt.prefixCls}.clipboard.cells`;function t(i){if(window.localStorage){const o=i.map(a=>a.toJSON());localStorage.setItem(e,JSON.stringify(o))}}n.save=t;function s(){if(window.localStorage){const i=localStorage.getItem(e),o=i?JSON.parse(i):[];if(o)return Qe.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(e)}n.clean=r})(mo||(mo={})),$.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},$.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},$.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},$.prototype.toggleClipboard=function(n){const e=this.getPlugin("clipboard");return e&&e.toggleEnabled(n),this},$.prototype.isClipboardEmpty=function(n){const e=this.getPlugin("clipboard");return e?e.isEmpty(n):!0},$.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},$.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},$.prototype.copy=function(n,e){const t=this.getPlugin("clipboard");return t&&t.copy(n,e),this},$.prototype.cut=function(n,e){const t=this.getPlugin("clipboard");return t&&t.cut(n,e),this},$.prototype.paste=function(n,e){const t=this.getPlugin("clipboard");return t?t.paste(n,e):[]};var ij=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},oj=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Wb extends Te{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new rj,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return(!this.disabled||e)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options;return oj(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}ij([Te.dispose()],Wb.prototype,"dispose",null),$.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},$.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},$.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},$.prototype.toggleHistory=function(n){const e=this.getPlugin("history");return e&&e.toggleEnabled(n),this},$.prototype.undo=function(n){const e=this.getPlugin("history");return e&&e.undo(n),this},$.prototype.redo=function(n){const e=this.getPlugin("history");return e&&e.redo(n),this},$.prototype.undoAndCancel=function(n){const e=this.getPlugin("history");return e&&e.cancel(n),this},$.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},$.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},$.prototype.cleanHistory=function(n){const e=this.getPlugin("history");return e&&e.clean(n),this},$.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},$.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},$.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},$.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var qb=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class oi extends Te{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Le.getOptions(e),this.validator=new oi.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return this.options.enabled!==!0}validate(e,...t){return this.validator.validate(e,...t),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:e?e.batch:!1,data:{}}}revertCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},t),Pc(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},t),Pc(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,o)}this.freezed=!1}executeCommand(e,t,s){const r=this.model,i=r.getCell(e.data.id),o=e.event;if(Le.isAddEvent(o)&&t||Le.isRemoveEvent(o)&&!t)i&&i.remove(s);else if(Le.isAddEvent(o)&&!t||Le.isRemoveEvent(o)&&t){const a=e.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(Le.isChangeEvent(o)){const a=e.data,c=a.key;if(c&&i){const u=t?a.prev[c]:a.next[c];a.key==="attrs"&&this.ensureUndefinedAttrs(u,t?a.next[c]:a.prev[c])&&(s.dirty=!0),i.prop(c,u,s)}}else{const a=this.options.executeCommand;a&&Q(a,this,e,t,s)}}addCommand(e,t){if(this.freezed||this.disabled)return;const s=t,r=s.options||{};if(r.dryrun||Le.isAddEvent(e)&&this.options.ignoreAdd||Le.isRemoveEvent(e)&&this.options.ignoreRemove||Le.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&Q(i,this,e,t)===!1)return;e==="cell:change:*"&&(e=`cell:change:${s.key}`);const o=s.cell,a=Qe.isModel(o);let c;if(this.batchCommands){c=this.batchCommands[Math.max(this.lastBatchIndex,0)];const d=a&&!c.modelChange||c.data.id!==o.id,h=c.event!==e;if(this.lastBatchIndex>=0&&(d||h)){const f=this.batchCommands.findIndex(p=>(a&&p.modelChange||p.data.id===o.id)&&p.event===e);f<0||Le.isAddEvent(e)||Le.isRemoveEvent(e)?c=this.createCommand({batch:!0}):(c=this.batchCommands[f],this.batchCommands.splice(f,1)),this.batchCommands.push(c),this.lastBatchIndex=this.batchCommands.length-1}}else c=this.createCommand({batch:!1});if(Le.isAddEvent(e)||Le.isRemoveEvent(e)){const d=c.data;return c.event=e,c.options=r,d.id=o.id,d.props=Ne(o.toJSON()),o.isEdge()?d.edge=!0:o.isNode()&&(d.node=!0),this.push(c,r)}if(Le.isChangeEvent(e)){const d=t.key,h=c.data;return(!c.batch||!c.event)&&(c.event=e,c.options=r,h.key=d,h.prev==null&&(h.prev={}),h.prev[d]=Ne(o.previous(d)),a?c.modelChange=!0:h.id=o.id),h.next==null&&(h.next={}),h.next[d]=Ne(o.prop(d)),this.push(c,r)}const u=this.options.afterAddCommand;u&&Q(u,this,e,t,c),this.push(c,r)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const s=[];for(;t.length>0;){const r=t.shift(),i=r.event,o=r.data.id;if(i!=null&&(o!=null||r.modelChange)){if(Le.isAddEvent(i)){const a=t.findIndex(c=>Le.isRemoveEvent(c.event)&&c.data.id===o);if(a>=0){t=t.filter((c,u)=>a<u||c.data.id!==o);continue}}else if(Le.isRemoveEvent(i)){const a=t.findIndex(c=>Le.isAddEvent(c.event)&&c.data.id===o);if(a>=0){t.splice(a,1);continue}}else if(Le.isChangeEvent(i)){const a=r.data;if(xn(a.prev,a.next))continue}s.push(r)}}return s}notify(e,t,s){const r=t==null?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:r,options:s}),this.graph.trigger(`history:${e}`,{cmds:r,options:s}),this.emit("change",{cmds:r,options:s}),this.graph.trigger("history:change",{cmds:r,options:s})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],s=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const r=new Set(t.map(o=>o.event));if(r.size!==2||!r.has("cell:change:parent")||!r.has("cell:change:children")||!t.every(o=>{var a;return o.batch&&((a=o.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(s)||s.length!==1)return;const i=s[0];i.event!=="cell:change:position"||!(!((e=i.options)===null||e===void 0)&&e.ui)||(s.push(...t),this.undoStack.pop())}undoStackPush(e){if(this.stackSize===0){this.undoStack.push(e);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let s=!1;return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(r=>{e[r]===void 0&&t[r]!==void 0?(e[r]=void 0,s=!0):typeof e[r]=="object"&&typeof t[r]=="object"&&(s=this.ensureUndefinedAttrs(e[r],t[r]))}),s}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}qb([Te.dispose()],oi.prototype,"dispose",null),function(n){class e extends Te{constructor(s){super(),this.map={},this.command=s.history,this.cancelInvalid=s.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:s}){return Array.isArray(s)?s.every(r=>this.isValidCommand(r)):this.isValidCommand(s)}isValidCommand(s){if(s.options&&s.options.validation===!1)return!0;const r=s.event&&this.map[s.event]||[];let i=null;return r.forEach(o=>{let a=0;const c=u=>{const d=o[a];a+=1;try{if(d)d(u,s,c);else{i=u;return}}catch(h){c(h)}};c(i)}),i?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:i}),!1):!0}validate(s,...r){const i=Array.isArray(s)?s:s.split(/\s+/);return r.forEach(o=>{if(typeof o!="function")throw new Error(`${i.join(" ")} requires callback functions.`)}),i.forEach(o=>{this.map[o]==null&&(this.map[o]=[]),this.map[o].push(r)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}qb([Te.dispose()],e.prototype,"dispose",null),n.Validator=e}(oi||(oi={}));var Le;(function(n){function e(o){return o==="cell:added"}n.isAddEvent=e;function t(o){return o==="cell:removed"}n.isRemoveEvent=t;function s(o){return o!=null&&o.startsWith("cell:change:")}n.isChangeEvent=s;function r(o){const a=["cell:added","cell:removed","cell:change:*"],c=["batch:start","batch:stop"],u=o.eventNames?o.eventNames.filter(d=>!(n.isChangeEvent(d)||a.includes(d)||c.includes(d))):a;return Object.assign(Object.assign({enabled:!0},o),{eventNames:u,applyOptionsList:o.applyOptionsList||["propertyPath"],revertOptionsList:o.revertOptionsList||["propertyPath"]})}n.getOptions=r;function i(o){const a=[];for(let c=0,u=o.length;c<u;c+=1){const d=o[c];let h=null;if(n.isAddEvent(d.event)){const f=d.data.id;for(let p=0;p<c;p+=1)if(o[p].data.id===f){h=p;break}}h!==null?a.splice(h,0,d):a.push(d)}return a}n.sortBatchCommands=i})(Le||(Le={}));var aj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Jb extends ye{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Et.classNames.box)}get $boxes(){return fR(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new gl([],{comparator:Et.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:s,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a,snapped:c}=t,u=(s!==!0||r&&this.getPointerEventsValue(r)==="none")&&!this.translating&&!o,d=i&&a&&e.id===a;if(u&&(d||c)){this.translating=!0;const h=e.position(),f=e.previous("position"),p=h.x-f.x,g=h.y-f.y;(p!==0||g!==0)&&this.translateSelectedNodes(p,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const s=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(s,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const u=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(u,Object.assign(Object.assign({},t),{ui:!0})),this}const s=this.cells,r=this.filter(Array.isArray(e)?e:[e]),i={},o={};s.forEach(u=>i[u.id]=u),r.forEach(u=>o[u.id]=u);const a=[],c=[];return r.forEach(u=>{i[u.id]||a.push(u)}),s.forEach(u=>{o[u.id]||c.push(u)}),c.length&&this.unselect(c,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),c.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,s;const r=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&r.contains(e.target))t=e.offsetX,s=e.offsetY;else{const i=Yu(r),o=r.scrollLeft,a=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,s=e.clientY-i.top+window.pageYOffset+a}Je(this.container,{top:s,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:s,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Et.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(s=>Array.isArray(t)?t.some(r=>typeof r=="string"?s.shape===r:s.id===r.id):typeof t=="function"?Q(t,this.graph,s):!0)}stopSelecting(e){const t=this.graph,s=this.getEventData(e);switch(s.action){case"selecting":{let i=qR(this.container),o=JR(this.container);const a=Yu(this.container),c=t.pageToLocal(a.left,a.top),u=t.transform.getScale();i/=u.sx,o/=u.sy;const d=new U(c.x,c.y,i,o),h=this.getCellViewsInArea(d).map(f=>f.cell);this.reset(h,{batch:!0}),this.hideRubberband();break}case"translating":{const i=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const o=s;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,i.x,i.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const s=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:s});const r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(Et.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?Q(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let s=e.x-t.clientX,r=e.y-t.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=pe.getCellsBBox(o,{deep:!0})||U.create(),c=i.x-a.x,u=i.y-a.y,d=i.x+i.width-(a.x+a.width),h=i.y+i.height-(a.y+a.height);if(s<c&&(s=c),r<u&&(r=u),d<s&&(s=d),h<r&&(r=h),!this.options.following){const f=e.x-t.originX,p=e.y-t.originY;s=f<=c||f>=d?0:s,r=p<=u||p>=h?0:r}}return{dx:s,dy:r}}updateElementPosition(e,t,s){const r=Je(e,"left"),i=Je(e,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;Je(e,"left",o+t),Je(e,"top",a+s)}updateSelectedNodesPosition(e){const{dx:t,dy:s}=e;if(t||s)if(this.translateSelectedNodes(t,s),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const r=this.graph.transform.getScale();for(let i=0,o=this.$boxes,a=o.length;i<a;i+=1)this.updateElementPosition(o[i],t*r.sx,s*r.sy);this.updateElementPosition(this.selectionContainer,t*r.sx,s*r.sy)}}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");return s?s.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),s=this.getEventData(t);switch(s.action){case"selecting":{const i=s;i.moving!==!0&&(ws(this.container,this.graph.container),this.showRubberband(),i.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);i.scrollerX+=o,i.scrollerY+=a;const c=t.clientX-i.clientX+i.scrollerX,u=t.clientY-i.clientY+i.scrollerY,d=parseInt(Je(this.container,"left")||"0",10),h=parseInt(Je(this.container,"top")||"0",10);Je(this.container,{left:c<0?i.offsetX+c:d,top:u<0?i.offsetY+u:h,width:Math.abs(c),height:Math.abs(u)});break}case"translating":{const i=this.graph.snapToGrid(t.clientX,t.clientY),o=s,a=this.getSelectionOffset(i,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=i.x),a.dy&&(o.clientY=i.y),this.notifyBoxEvent("box:mousemove",e,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,s,r){const i={},o=[];if(s&&(i[s.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0})}),r&&r.translateBy){const a=this.graph.getCellById(r.translateBy);a&&(i[a.id]=!0,a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!i[a.id]){const c=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});a.translate(e,t,c),this.graph.model.getConnectedEdges(a).forEach(u=>{i[u.id]||(u.translate(e,t,c),i[u.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,s={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),r}notifyBoxEvent(e,t,s,r){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:s,y:r,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(Ft(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),Ft(this.$boxes),this.boxCount=0}hide(){De(this.container,this.prefixClassName(Et.classNames.rubberband)),De(this.container,this.prefixClassName(Et.classNames.selected))}showRubberband(){K(this.container,this.prefixClassName(Et.classNames.rubberband))}hideRubberband(){De(this.container,this.prefixClassName(Et.classNames.rubberband))}showSelected(){Bu(this.container,"style"),K(this.container,this.prefixClassName(Et.classNames.selected))}createContainer(){this.container=document.createElement("div"),K(this.container,this.prefixClassName(Et.classNames.root)),this.options.className&&K(this.container,this.options.className),this.selectionContainer=document.createElement("div"),K(this.selectionContainer,this.prefixClassName(Et.classNames.inner)),this.selectionContent=document.createElement("div"),K(this.selectionContent,this.prefixClassName(Et.classNames.content)),_t(this.selectionContainer,this.selectionContent),fe(this.selectionContainer,"data-selection-length",this.collection.length),uy(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(i=>this.canShowSelectionBox(i)).forEach(i=>{const o=this.graph.renderer.findViewByCell(i);if(o){const a=o.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),Je(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),fe(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=Q(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?ws(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(e){return typeof e=="string"?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const s=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;K(i,r),K(i,`${r}-${e.isNode()?"node":"edge"}`),fe(i,"data-cell-id",e.id),Je(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),ws(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,s=t.length;e<s;e+=1){const r=t[e],i=fe(r,"data-cell-id");Ft(r),this.boxCount-=1;const o=this.collection.get(i);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const s=this.collection.get(t);if(s)return this.graph.renderer.findViewByCell(s)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(s=>{this.listenCellRemoveEvent(s),this.createSelectionBox(s)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:s}){e.forEach(i=>{this.trigger("cell:selected",{cell:i,options:s}),i.isNode()?this.trigger("node:selected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:selected",{cell:i,options:s,edge:i})}),t.forEach(i=>{this.trigger("cell:unselected",{cell:i,options:s}),i.isNode()?this.trigger("node:unselected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:unselected",{cell:i,options:s,edge:i})});const r={added:e,removed:t,options:s,selected:this.cells.filter(i=>!!this.graph.getCellById(i.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}aj([ye.dispose()],Jb.prototype,"dispose",null);var Et;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(s){return s.getAncestors().length}n.depthComparator=t})(Et||(Et={}));const lj=`.x6-widget-selection {
417
+ `;$.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},$.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},$.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},$.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},$.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},$.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},$.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},$.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},$.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},$.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},$.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},$.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},$.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},$.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},$.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},$.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var gj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class s0 extends yt{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Fr(this.name,pj)}init(e){this.snaplineImpl=new n0(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),Ur(this.name)}}gj([yt.dispose()],s0.prototype,"dispose",null);class mj{constructor(){this.cells=[]}copy(e,t,s={}){this.options=Object.assign({},s);const i=(et.isModel(t)?t:t.model).cloneSubGraph(e,s);this.cells=Dc(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(e,t,s={}){this.copy(e,t,s),($.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(i=>i.remove())})}paste(e,t={}){const s=Object.assign(Object.assign({},this.options),t),{offset:r,edgeProps:i,nodeProps:o}=s;let a=20,c=20;r&&(a=typeof r=="number"?r:r.dx,c=typeof r=="number"?r:r.dy),this.deserialize(s);const u=this.cells;u.forEach(f=>{f.model=null,f.removeProp("zIndex"),(a||c)&&f.translate(a,c),o&&f.isNode()&&f.prop(o),i&&f.isEdge()&&f.prop(i)});const d=$.isGraph(e)?e.model:e;return d.batchUpdate("paste",()=>{d.addCells(this.cells)}),this.copy(u,e,t),u}serialize(e){e.useLocalStorage!==!1&&wo.save(this.cells)}deserialize(e){if(e.useLocalStorage){const t=wo.fetch();t&&(this.cells=t)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],wo.clean()}}var wo;(function(n){const e=`${Yt.prefixCls}.clipboard.cells`;function t(i){if(window.localStorage){const o=i.map(a=>a.toJSON());localStorage.setItem(e,JSON.stringify(o))}}n.save=t;function s(){if(window.localStorage){const i=localStorage.getItem(e),o=i?JSON.parse(i):[];if(o)return et.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(e)}n.clean=r})(wo||(wo={})),$.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},$.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},$.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},$.prototype.toggleClipboard=function(n){const e=this.getPlugin("clipboard");return e&&e.toggleEnabled(n),this},$.prototype.isClipboardEmpty=function(n){const e=this.getPlugin("clipboard");return e?e.isEmpty(n):!0},$.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},$.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},$.prototype.copy=function(n,e){const t=this.getPlugin("clipboard");return t&&t.copy(n,e),this},$.prototype.cut=function(n,e){const t=this.getPlugin("clipboard");return t&&t.cut(n,e),this},$.prototype.paste=function(n,e){const t=this.getPlugin("clipboard");return t?t.paste(n,e):[]};var yj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},bj=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class r0 extends Te{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new mj,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return(!this.disabled||e)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options;return bj(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}yj([Te.dispose()],r0.prototype,"dispose",null),$.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},$.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},$.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},$.prototype.toggleHistory=function(n){const e=this.getPlugin("history");return e&&e.toggleEnabled(n),this},$.prototype.undo=function(n){const e=this.getPlugin("history");return e&&e.undo(n),this},$.prototype.redo=function(n){const e=this.getPlugin("history");return e&&e.redo(n),this},$.prototype.undoAndCancel=function(n){const e=this.getPlugin("history");return e&&e.cancel(n),this},$.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},$.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},$.prototype.cleanHistory=function(n){const e=this.getPlugin("history");return e&&e.clean(n),this},$.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},$.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},$.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},$.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var i0=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ai extends Te{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Le.getOptions(e),this.validator=new ai.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return this.options.enabled!==!0}validate(e,...t){return this.validator.validate(e,...t),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:e?e.batch:!1,data:{}}}revertCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},t),Vc(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},t),Vc(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,o)}this.freezed=!1}executeCommand(e,t,s){const r=this.model,i=r.getCell(e.data.id),o=e.event;if(Le.isAddEvent(o)&&t||Le.isRemoveEvent(o)&&!t)i&&i.remove(s);else if(Le.isAddEvent(o)&&!t||Le.isRemoveEvent(o)&&t){const a=e.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(Le.isChangeEvent(o)){const a=e.data,c=a.key;if(c&&i){const u=t?a.prev[c]:a.next[c];a.key==="attrs"&&this.ensureUndefinedAttrs(u,t?a.next[c]:a.prev[c])&&(s.dirty=!0),i.prop(c,u,s)}}else{const a=this.options.executeCommand;a&&ee(a,this,e,t,s)}}addCommand(e,t){if(this.freezed||this.disabled)return;const s=t,r=s.options||{};if(r.dryrun||Le.isAddEvent(e)&&this.options.ignoreAdd||Le.isRemoveEvent(e)&&this.options.ignoreRemove||Le.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&ee(i,this,e,t)===!1)return;e==="cell:change:*"&&(e=`cell:change:${s.key}`);const o=s.cell,a=et.isModel(o);let c;if(this.batchCommands){c=this.batchCommands[Math.max(this.lastBatchIndex,0)];const d=a&&!c.modelChange||c.data.id!==o.id,f=c.event!==e;if(this.lastBatchIndex>=0&&(d||f)){const h=this.batchCommands.findIndex(p=>(a&&p.modelChange||p.data.id===o.id)&&p.event===e);h<0||Le.isAddEvent(e)||Le.isRemoveEvent(e)?c=this.createCommand({batch:!0}):(c=this.batchCommands[h],this.batchCommands.splice(h,1)),this.batchCommands.push(c),this.lastBatchIndex=this.batchCommands.length-1}}else c=this.createCommand({batch:!1});if(Le.isAddEvent(e)||Le.isRemoveEvent(e)){const d=c.data;return c.event=e,c.options=r,d.id=o.id,d.props=_e(o.toJSON()),o.isEdge()?d.edge=!0:o.isNode()&&(d.node=!0),this.push(c,r)}if(Le.isChangeEvent(e)){const d=t.key,f=c.data;return(!c.batch||!c.event)&&(c.event=e,c.options=r,f.key=d,f.prev==null&&(f.prev={}),f.prev[d]=_e(o.previous(d)),a?c.modelChange=!0:f.id=o.id),f.next==null&&(f.next={}),f.next[d]=_e(o.prop(d)),this.push(c,r)}const u=this.options.afterAddCommand;u&&ee(u,this,e,t,c),this.push(c,r)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const s=[];for(;t.length>0;){const r=t.shift(),i=r.event,o=r.data.id;if(i!=null&&(o!=null||r.modelChange)){if(Le.isAddEvent(i)){const a=t.findIndex(c=>Le.isRemoveEvent(c.event)&&c.data.id===o);if(a>=0){t=t.filter((c,u)=>a<u||c.data.id!==o);continue}}else if(Le.isRemoveEvent(i)){const a=t.findIndex(c=>Le.isAddEvent(c.event)&&c.data.id===o);if(a>=0){t.splice(a,1);continue}}else if(Le.isChangeEvent(i)){const a=r.data;if(Cn(a.prev,a.next))continue}s.push(r)}}return s}notify(e,t,s){const r=t==null?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:r,options:s}),this.graph.trigger(`history:${e}`,{cmds:r,options:s}),this.emit("change",{cmds:r,options:s}),this.graph.trigger("history:change",{cmds:r,options:s})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],s=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const r=new Set(t.map(o=>o.event));if(r.size!==2||!r.has("cell:change:parent")||!r.has("cell:change:children")||!t.every(o=>{var a;return o.batch&&((a=o.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(s)||s.length!==1)return;const i=s[0];i.event!=="cell:change:position"||!(!((e=i.options)===null||e===void 0)&&e.ui)||(s.push(...t),this.undoStack.pop())}undoStackPush(e){if(this.stackSize===0){this.undoStack.push(e);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let s=!1;return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(r=>{e[r]===void 0&&t[r]!==void 0?(e[r]=void 0,s=!0):typeof e[r]=="object"&&typeof t[r]=="object"&&(s=this.ensureUndefinedAttrs(e[r],t[r]))}),s}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}i0([Te.dispose()],ai.prototype,"dispose",null),function(n){class e extends Te{constructor(s){super(),this.map={},this.command=s.history,this.cancelInvalid=s.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:s}){return Array.isArray(s)?s.every(r=>this.isValidCommand(r)):this.isValidCommand(s)}isValidCommand(s){if(s.options&&s.options.validation===!1)return!0;const r=s.event&&this.map[s.event]||[];let i=null;return r.forEach(o=>{let a=0;const c=u=>{const d=o[a];a+=1;try{if(d)d(u,s,c);else{i=u;return}}catch(f){c(f)}};c(i)}),i?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:i}),!1):!0}validate(s,...r){const i=Array.isArray(s)?s:s.split(/\s+/);return r.forEach(o=>{if(typeof o!="function")throw new Error(`${i.join(" ")} requires callback functions.`)}),i.forEach(o=>{this.map[o]==null&&(this.map[o]=[]),this.map[o].push(r)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}i0([Te.dispose()],e.prototype,"dispose",null),n.Validator=e}(ai||(ai={}));var Le;(function(n){function e(o){return o==="cell:added"}n.isAddEvent=e;function t(o){return o==="cell:removed"}n.isRemoveEvent=t;function s(o){return o!=null&&o.startsWith("cell:change:")}n.isChangeEvent=s;function r(o){const a=["cell:added","cell:removed","cell:change:*"],c=["batch:start","batch:stop"],u=o.eventNames?o.eventNames.filter(d=>!(n.isChangeEvent(d)||a.includes(d)||c.includes(d))):a;return Object.assign(Object.assign({enabled:!0},o),{eventNames:u,applyOptionsList:o.applyOptionsList||["propertyPath"],revertOptionsList:o.revertOptionsList||["propertyPath"]})}n.getOptions=r;function i(o){const a=[];for(let c=0,u=o.length;c<u;c+=1){const d=o[c];let f=null;if(n.isAddEvent(d.event)){const h=d.data.id;for(let p=0;p<c;p+=1)if(o[p].data.id===h){f=p;break}}f!==null?a.splice(f,0,d):a.push(d)}return a}n.sortBatchCommands=i})(Le||(Le={}));var wj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class o0 extends be{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Ot.classNames.box)}get $boxes(){return OD(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new xl([],{comparator:Ot.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:s,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a,snapped:c}=t,u=(s!==!0||r&&this.getPointerEventsValue(r)==="none")&&!this.translating&&!o,d=i&&a&&e.id===a;if(u&&(d||c)){this.translating=!0;const f=e.position(),h=e.previous("position"),p=f.x-h.x,g=f.y-h.y;(p!==0||g!==0)&&this.translateSelectedNodes(p,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const s=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(s,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const u=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(u,Object.assign(Object.assign({},t),{ui:!0})),this}const s=this.cells,r=this.filter(Array.isArray(e)?e:[e]),i={},o={};s.forEach(u=>i[u.id]=u),r.forEach(u=>o[u.id]=u);const a=[],c=[];return r.forEach(u=>{i[u.id]||a.push(u)}),s.forEach(u=>{o[u.id]||c.push(u)}),c.length&&this.unselect(c,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),c.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,s;const r=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&r.contains(e.target))t=e.offsetX,s=e.offsetY;else{const i=ed(r),o=r.scrollLeft,a=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,s=e.clientY-i.top+window.pageYOffset+a}Je(this.container,{top:s,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:s,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Ot.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(s=>Array.isArray(t)?t.some(r=>typeof r=="string"?s.shape===r:s.id===r.id):typeof t=="function"?ee(t,this.graph,s):!0)}stopSelecting(e){const t=this.graph,s=this.getEventData(e);switch(s.action){case"selecting":{let i=oR(this.container),o=aR(this.container);const a=ed(this.container),c=t.pageToLocal(a.left,a.top),u=t.transform.getScale();i/=u.sx,o/=u.sy;const d=new F(c.x,c.y,i,o),f=this.getCellViewsInArea(d).map(h=>h.cell);this.reset(f,{batch:!0}),this.hideRubberband();break}case"translating":{const i=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const o=s;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,i.x,i.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const s=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:s});const r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(Ot.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?ee(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let s=e.x-t.clientX,r=e.y-t.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=pe.getCellsBBox(o,{deep:!0})||F.create(),c=i.x-a.x,u=i.y-a.y,d=i.x+i.width-(a.x+a.width),f=i.y+i.height-(a.y+a.height);if(s<c&&(s=c),r<u&&(r=u),d<s&&(s=d),f<r&&(r=f),!this.options.following){const h=e.x-t.originX,p=e.y-t.originY;s=h<=c||h>=d?0:s,r=p<=u||p>=f?0:r}}return{dx:s,dy:r}}updateElementPosition(e,t,s){const r=Je(e,"left"),i=Je(e,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;Je(e,"left",o+t),Je(e,"top",a+s)}updateSelectedNodesPosition(e){const{dx:t,dy:s}=e;if(t||s)if(this.translateSelectedNodes(t,s),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const r=this.graph.transform.getScale();for(let i=0,o=this.$boxes,a=o.length;i<a;i+=1)this.updateElementPosition(o[i],t*r.sx,s*r.sy);this.updateElementPosition(this.selectionContainer,t*r.sx,s*r.sy)}}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");return s?s.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),s=this.getEventData(t);switch(s.action){case"selecting":{const i=s;i.moving!==!0&&(ys(this.container,this.graph.container),this.showRubberband(),i.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);i.scrollerX+=o,i.scrollerY+=a;const c=t.clientX-i.clientX+i.scrollerX,u=t.clientY-i.clientY+i.scrollerY,d=parseInt(Je(this.container,"left")||"0",10),f=parseInt(Je(this.container,"top")||"0",10);Je(this.container,{left:c<0?i.offsetX+c:d,top:u<0?i.offsetY+u:f,width:Math.abs(c),height:Math.abs(u)});break}case"translating":{const i=this.graph.snapToGrid(t.clientX,t.clientY),o=s,a=this.getSelectionOffset(i,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=i.x),a.dy&&(o.clientY=i.y),this.notifyBoxEvent("box:mousemove",e,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,s,r){const i={},o=[];if(s&&(i[s.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0})}),r&&r.translateBy){const a=this.graph.getCellById(r.translateBy);a&&(i[a.id]=!0,a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!i[a.id]){const c=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});a.translate(e,t,c),this.graph.model.getConnectedEdges(a).forEach(u=>{i[u.id]||(u.translate(e,t,c),i[u.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,s={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),r}notifyBoxEvent(e,t,s,r){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:s,y:r,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(Ht(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),Ht(this.$boxes),this.boxCount=0}hide(){De(this.container,this.prefixClassName(Ot.classNames.rubberband)),De(this.container,this.prefixClassName(Ot.classNames.selected))}showRubberband(){X(this.container,this.prefixClassName(Ot.classNames.rubberband))}hideRubberband(){De(this.container,this.prefixClassName(Ot.classNames.rubberband))}showSelected(){Wu(this.container,"style"),X(this.container,this.prefixClassName(Ot.classNames.selected))}createContainer(){this.container=document.createElement("div"),X(this.container,this.prefixClassName(Ot.classNames.root)),this.options.className&&X(this.container,this.options.className),this.selectionContainer=document.createElement("div"),X(this.selectionContainer,this.prefixClassName(Ot.classNames.inner)),this.selectionContent=document.createElement("div"),X(this.selectionContent,this.prefixClassName(Ot.classNames.content)),kt(this.selectionContainer,this.selectionContent),fe(this.selectionContainer,"data-selection-length",this.collection.length),vy(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(i=>this.canShowSelectionBox(i)).forEach(i=>{const o=this.graph.renderer.findViewByCell(i);if(o){const a=o.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),Je(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),fe(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=ee(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?ys(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(e){return typeof e=="string"?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const s=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;X(i,r),X(i,`${r}-${e.isNode()?"node":"edge"}`),fe(i,"data-cell-id",e.id),Je(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),ys(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,s=t.length;e<s;e+=1){const r=t[e],i=fe(r,"data-cell-id");Ht(r),this.boxCount-=1;const o=this.collection.get(i);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const s=this.collection.get(t);if(s)return this.graph.renderer.findViewByCell(s)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(s=>{this.listenCellRemoveEvent(s),this.createSelectionBox(s)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:s}){e.forEach(i=>{this.trigger("cell:selected",{cell:i,options:s}),i.isNode()?this.trigger("node:selected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:selected",{cell:i,options:s,edge:i})}),t.forEach(i=>{this.trigger("cell:unselected",{cell:i,options:s}),i.isNode()?this.trigger("node:unselected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:unselected",{cell:i,options:s,edge:i})});const r={added:e,removed:t,options:s,selected:this.cells.filter(i=>!!this.graph.getCellById(i.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}wj([be.dispose()],o0.prototype,"dispose",null);var Ot;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(s){return s.getAncestors().length}n.depthComparator=t})(Ot||(Ot={}));const xj=`.x6-widget-selection {
418
418
  position: absolute;
419
419
  top: 0;
420
420
  left: 0;
@@ -479,8 +479,8 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
479
479
  font-size: 10px;
480
480
  background-color: #6a6b8a;
481
481
  }
482
- `;$.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},$.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},$.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},$.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},$.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},$.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},$.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},$.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},$.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},$.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},$.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},$.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},$.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},$.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},$.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},$.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},$.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},$.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},$.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},$.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},$.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},$.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},$.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},$.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},$.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},$.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},$.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},$.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},$.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},$.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},$.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t&&t.unselect(n,e),this};var cj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ai extends Te{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},ai.defaultOptions),e),zr(this.name,lj)}init(e){this.graph=e,this.selectionImpl=new Jb(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return e!=null?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return e!=null?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const s=this.getCells(e);return s.length&&(this.isMultiple()?this.selectionImpl.select(s,t):this.reset(s.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),s=this.graph.getPlugin("scroller"),r=s&&s.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&xs.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&xs.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const s=this.options;let r=this.disabled;!r&&this.movedMap.has(t)&&(r=s.selectCellOnMoved===!1,r||(r=s.selectNodeOnMoved===!1&&t.isNode()),r||(r=s.selectEdgeOnMoved===!1&&t.isEdge())),r||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Fr(this.name)}}cj([Te.dispose()],ai.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]}}(ai||(ai={}));const uj=[{label:"直线",value:"line"},{label:"管道",value:"pipe"}],Xb=[{label:"Block",value:"block"},{label:"Classic",value:"classic"},{label:"Diamond",value:"diamond"},{label:"Cross",value:"cross"},{label:"Async",value:"async"},{label:"Circle",value:"circle"},{label:"CirclePlus",value:"circlePlus"},{label:"Ellipse",value:"ellipse"}],hd="stop",Kb=[{label:"停止",value:hd},{label:"正向",value:"forward-pipe"},{label:"反向",value:"reverse-pipe"}],dj=()=>new sr({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),hj=()=>new Hb,fj=()=>new Yb,pj=()=>new Wb({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),gj=["tools","ports"],mj=()=>new oi({beforeAddCommand:(n,e)=>{if(gj.includes(e.key))return!1}}),yj=()=>new ai({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),bj=n=>{const e=n.getSelectedCells();e.length&&n.removeCells(e)},wj=n=>{const e=n.getSelectedCells();e.length&&n.copy(e)},xj=n=>{if(!n.isClipboardEmpty()){const e=n.paste({offset:32});n.cleanSelection(),n.select(e)}},vj=n=>{n.canUndo()&&n.undo()},Cj=n=>{n.canRedo()&&n.redo()},Sj=n=>{n.addTools([{name:"vertices",args:{snapRadius:3,attrs:{r:3,fill:"#239edd",cursor:"move","stroke-width":2},modifiers:["shift"]}},{name:"segments",args:{attrs:{stroke:"#239edd",strokeWidth:2,strokeDasharray:"5 5"}}},{name:"source-arrowhead",args:{attrs:{stroke:"#239edd"}}},{name:"target-arrowhead",args:{attrs:{stroke:"#239edd"}}}])},Zb=()=>Wn.attrs.line2.strokeDasharray===0?"line":"pipe",fd=n=>n!=="none"?n+" 30s infinite linear":"",pd=()=>Math.random(),Qb="--",yl=/\$\{(.*?)\}/g,Ej={min:0,max:0,direction:hd},Oj={class:"control"},Mj={class:"row-column"},Pj={class:"row-column"},e0=En(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object},setup(n){var j,z,Y,le;const e=n,t=l.ref((j=e.payload.attrs.label)!=null&&j.textAnchor?"0":"1"),s=l.ref([]),r=l.ref([]),i=async()=>{s.value=await Rm()},o=l.ref();let a=l.reactive({});const c=()=>{a=s.value.find(I=>I.deviceCode===o.value),a&&u()},u=async()=>{r.value=await Lm(a.deviceCode)},d=I=>I.replace(yl,Qb),h=I=>{bk.confirm(`是否确定要添加${a.deviceName}-${I.name}?
483
- 添加后为:--${I.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const B=I.unit??"",ne=e.payload.data.content;e.payload.data.content=f.value=ne+"${"+a.deviceName+"."+I.name+"}"+B;const L=ne.match(yl),G=(L==null?void 0:L.length)||0;e.payload.data.fields.push({index:G,deviceName:a.deviceName,deviceCode:a.deviceCode,field:I.dataField}),e.payload.label=d(e.payload.data.content)})},f=l.ref(e.payload.data.content||null),p=l.ref(e.payload.attrs.body.fill||null),g=l.ref(e.payload.attrs.body.stroke||null),m=l.ref(e.payload.attrs.body.strokeWidth||null),y=l.ref(e.payload.attrs.body.rx||null),b=l.ref(e.payload.attrs.body.ry||null),w=l.ref(e.payload.attrs.text.fill||null),x=l.ref(e.payload.attrs.text.fontSize||null),v=l.ref(((z=e.payload.attrs.label)==null?void 0:z.textAnchor)||null),S=l.ref(((Y=e.payload.attrs.label)==null?void 0:Y.x)||null),E=l.ref(((le=e.payload.attrs.label)==null?void 0:le.y)||null),C=()=>{e.payload.attr("body/fill",p.value),e.payload.attr("body/stroke",g.value),e.payload.attr("body/strokeWidth",m.value),e.payload.attr("body/rx",y.value),e.payload.attr("body/ry",b.value),e.payload.attr("text/fill",w.value),e.payload.attr("text/fontSize",x.value),e.payload.attr("label/textAnchor",v.value),e.payload.attr("label/x",S.value),e.payload.attr("label/y",E.value)},M=l.ref(null),N=()=>{if(e.payload.data.content.length>f.value.length&&e.payload.data.content.endsWith("}")){const I=e.payload.data.content.match(yl);if(I){const B=I.length-1;e.payload.data.fields.splice(B,1),f.value=e.payload.data.content.substring(0,e.payload.data.content.lastIndexOf("${"))}}e.payload.data.content=f.value,e.payload.label=d(f.value)},_=()=>{if(M.value){const I=M.value.$refs.textarea;I.focus();const B=f.value.length;I.setSelectionRange(B,B)}},T=l.ref([]),k=()=>{T.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(I=>({id:I.id,attrs:I.attrs,args:{x:Number(I.args.x.replace("%","")),y:Number(I.args.y.replace("%",""))}}))))},R=()=>{const I=Cu;I.attrs.text.text=`${e.payload.getPorts().length+1}`,I.args.x="50%",I.args.y="50%",e.payload.addPorts([{group:"ports",...I}]),k()},V=()=>{qi("#drawing-board",!0)},A=(I,B,ne)=>{e.payload.portProp(I,"args/"+B,ne+"%"),k()},P=I=>{e.payload.removePort(I),k()};return l.onMounted(()=>{k(),i(),document.addEventListener("selectionchange",()=>{document.activeElement.tagName==="TEXTAREA"&&_()})}),(I,B)=>{const ne=l.resolveComponent("el-input"),L=l.resolveComponent("el-alert"),G=l.resolveComponent("el-option"),ie=l.resolveComponent("el-select"),Z=l.resolveComponent("el-table-column"),ae=l.resolveComponent("el-table"),He=l.resolveComponent("el-collapse-item"),re=l.resolveComponent("el-col"),at=l.resolveComponent("el-color-picker"),nt=l.resolveComponent("el-row"),Mt=l.resolveComponent("el-input-number"),Tn=l.resolveComponent("el-button"),es=l.resolveComponent("el-slider"),J=l.resolveComponent("el-icon"),ci=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Oj,[l.createVNode(ci,{modelValue:t.value,"onUpdate:modelValue":B[12]||(B[12]=oe=>t.value=oe),accordion:""},{default:l.withCtx(()=>[n.payload.data.type==="text"?(l.openBlock(),l.createBlock(He,{key:0,title:"文本内容",name:"0"},{default:l.withCtx(()=>[l.createVNode(ne,{ref_key:"inputRef",ref:M,type:"textarea",modelValue:f.value,"onUpdate:modelValue":B[0]||(B[0]=oe=>f.value=oe),onInput:N,onFocus:_,rows:10},null,8,["modelValue"]),l.createVNode(L,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),l.createVNode(ie,{modelValue:o.value,"onUpdate:modelValue":B[1]||(B[1]=oe=>o.value=oe),placeholder:"请选择设备",onChange:c,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,oe=>(l.openBlock(),l.createBlock(G,{key:oe.deviceCode,label:oe.deviceName,value:oe.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(ae,{data:r.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:h},{default:l.withCtx(()=>[l.createVNode(Z,{type:"index",label:"序号",width:"50",align:"center"}),l.createVNode(Z,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),l.createVNode(Z,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),l.createVNode(Z,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(He,{title:"图形设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Mj,[l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[13]||(B[13]=[l.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(at,{modelValue:p.value,"onUpdate:modelValue":B[2]||(B[2]=oe=>p.value=oe),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[14]||(B[14]=[l.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(at,{modelValue:g.value,"onUpdate:modelValue":B[3]||(B[3]=oe=>g.value=oe),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[15]||(B[15]=[l.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(Mt,{modelValue:m.value,"onUpdate:modelValue":B[4]||(B[4]=oe=>m.value=oe),size:"small","controls-position":"right",onChange:C,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[16]||(B[16]=[l.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(Mt,{modelValue:y.value,"onUpdate:modelValue":B[5]||(B[5]=oe=>y.value=oe),size:"small","controls-position":"right",onChange:C,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[17]||(B[17]=[l.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(Mt,{modelValue:b.value,"onUpdate:modelValue":B[6]||(B[6]=oe=>b.value=oe),size:"small","controls-position":"right",onChange:C,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(l.openBlock(),l.createBlock(He,{key:1,title:"文字设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Pj,[l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[18]||(B[18]=[l.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(at,{modelValue:w.value,"onUpdate:modelValue":B[7]||(B[7]=oe=>w.value=oe),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[19]||(B[19]=[l.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(Mt,{modelValue:x.value,"onUpdate:modelValue":B[8]||(B[8]=oe=>x.value=oe),size:"small","controls-position":"right",onChange:C,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[20]||(B[20]=[l.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(ie,{modelValue:v.value,"onUpdate:modelValue":B[9]||(B[9]=oe=>v.value=oe),size:"small",onChange:C},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(["start","middle","end"],oe=>l.createVNode(G,{key:oe,label:oe,value:oe},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[21]||(B[21]=[l.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(Mt,{modelValue:S.value,"onUpdate:modelValue":B[10]||(B[10]=oe=>S.value=oe),size:"small","controls-position":"right",onChange:C,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(nt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(re,{span:12},{default:l.withCtx(()=>B[22]||(B[22]=[l.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),l.createVNode(re,{span:12},{default:l.withCtx(()=>[l.createVNode(Mt,{modelValue:E.value,"onUpdate:modelValue":B[11]||(B[11]=oe=>E.value=oe),size:"small","controls-position":"right",onChange:C,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(He,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(Tn,{type:"primary",onClick:R,size:"small"},{default:l.withCtx(()=>B[23]||(B[23]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(Tn,{type:"primary",onClick:V,size:"small"},{default:l.withCtx(()=>B[24]||(B[24]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(ae,{data:T.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(Z,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:oe})=>[l.createTextVNode(l.toDisplayString(oe.attrs.text.text),1)]),_:1}),l.createVNode(Z,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:oe})=>[l.createVNode(es,{modelValue:oe.args.x,"onUpdate:modelValue":Wt=>oe.args.x=Wt,min:0,max:100,step:1,onInput:Wt=>A(oe.id,"x",Wt)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(Z,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:oe})=>[l.createVNode(es,{modelValue:oe.args.y,"onUpdate:modelValue":Wt=>oe.args.y=Wt,min:0,max:100,step:1,onInput:Wt=>A(oe.id,"y",Wt)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(Z,{label:"操作",align:"center"},{default:l.withCtx(({row:oe})=>[l.createVNode(Tn,{type:"danger",size:"small",onClick:Wt=>P(oe.id)},{default:l.withCtx(()=>[l.createVNode(J,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Sp))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-02b2bc1a"]]),Aj={class:"form-container"},Nj={class:"footer",style:{"margin-top":"10px"}},Tj=En({__name:"condition",props:{payload:{type:Array}},emits:["close"],setup(n,{emit:e}){const t=n,s=l.ref(t.payload),r=()=>{s.value.push(JSON.parse(JSON.stringify(Ej)))},i=u=>{s.value.splice(u,1)},o=e,a=()=>{o("close",s.value)},c=()=>{o("close",!1)};return(u,d)=>{const h=l.resolveComponent("el-button"),f=l.resolveComponent("el-input-number"),p=l.resolveComponent("el-table-column"),g=l.resolveComponent("el-option"),m=l.resolveComponent("el-select"),y=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",Aj,[l.createVNode(h,{type:"primary",size:"small",onClick:r,style:{"margin-bottom":"10px"}},{default:l.withCtx(()=>d[0]||(d[0]=[l.createTextVNode("添加条件")])),_:1}),l.createVNode(y,{data:s.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(p,{prop:"min",label:"最小值",width:"150",align:"center"},{default:l.withCtx(b=>[l.createVNode(f,{modelValue:b.row.min,"onUpdate:modelValue":w=>b.row.min=w,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(p,{prop:"max",label:"最大值",width:"150",align:"center"},{default:l.withCtx(b=>[l.createVNode(f,{modelValue:b.row.max,"onUpdate:modelValue":w=>b.row.max=w,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(p,{prop:"direction",label:"流向",align:"center"},{default:l.withCtx(b=>[l.createVNode(m,{modelValue:b.row.direction,"onUpdate:modelValue":w=>b.row.direction=w,size:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Kb),w=>(l.openBlock(),l.createBlock(g,{key:w.value,label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(p,{label:"操作",align:"center"},{default:l.withCtx(b=>[l.createVNode(h,{type:"danger",size:"small",onClick:w=>i(b.$index)},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createElementVNode("div",Nj,[l.createVNode(h,{type:"primary",onClick:a},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("保存")])),_:1}),l.createVNode(h,{onClick:c},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("取消")])),_:1})])])}}},[["__scopeId","data-v-f6d52a7c"]]),_j={class:"container"},kj={class:"row-column"},Dj={class:"row-column"},Rj={class:"row-column"},Lj={class:"row-column"},t0=En({__name:"index",props:{payload:Object},setup(n){var T,k,R,V,A,P,j,z,Y,le,I,B;const e=n,t=l.ref("0"),s=l.ref(e.payload.data.type),r=l.ref(e.payload.attrs.line2.stroke),i=l.ref(e.payload.attrs.line1.stroke),o=l.ref(e.payload.attrs.line1.strokeWidth),a=l.ref(e.payload.attrs.line2.strokeDasharray),c=l.ref(((k=(T=e.payload.attrs.line2)==null?void 0:T.style)==null?void 0:k.animation.split(" ")[0])??hd),u=l.reactive({name:((R=e.payload.attrs.line2.sourceMarker)==null?void 0:R.name)??null,args:((V=e.payload.attrs.line2.sourceMarker)==null?void 0:V.args)??{}}),d=l.reactive({name:((A=e.payload.attrs.line2.targetMarker)==null?void 0:A.name)??null,args:((P=e.payload.attrs.line2.targetMarker)==null?void 0:P.args)??{}}),h=()=>{e.payload.attr("line1/stroke",i.value),e.payload.attr("line2/stroke",r.value),e.payload.attr("line1/strokeWidth",o.value),e.payload.attr("line2/strokeWidth",o.value),e.payload.attr("line2/strokeDasharray",a.value),e.payload.attr("line2/sourceMarker/name",u.name),e.payload.attr("line2/sourceMarker/args",u.args),e.payload.attr("line2/targetMarker/name",d.name),e.payload.attr("line2/targetMarker/args",d.args),e.payload.attr("line2/style/animation",fd(c.value)),Wn.markup=e.payload.markup,Wn.attrs=e.payload.attrs,console.log("线-基础配置",Wn),console.log("线-当前配置",e.payload)},f=()=>{s.value==="line"?e.payload.attr("line2/strokeDasharray",0):s.value==="pipe"&&e.payload.attr("line2/strokeDasharray",5),e.payload.attr("line2/style/animation",fd("none")),Wn.markup=e.payload.markup,Wn.attrs=e.payload.attrs,e.payload.data.type=s.value,console.log("线-基础配置",Wn),console.log("线-当前配置",e.payload)},p=l.ref(e.payload.data.isCondition??!1),g=()=>{e.payload.data.isCondition=p.value},m=l.reactive({show:!1,payload:null}),y=()=>{m.show=!0,m.payload=e.payload.data.condition??[]},b=ne=>{m.show=!1,m.payload=null,ne&&(e.payload.data.condition=ne),console.log("条件线",e.payload.data)},w=l.ref([]),x=l.ref(((Y=(z=(j=e.payload.data)==null?void 0:j.fields)==null?void 0:z[0])==null?void 0:Y.deviceCode)??""),v=l.ref(((B=(I=(le=e.payload.data)==null?void 0:le.fields)==null?void 0:I[0])==null?void 0:B.field)??""),S=async()=>{w.value=await Rm(),x.value&&C()};let E=l.reactive({});const C=()=>{E=w.value.find(ne=>ne.deviceCode===x.value),E?(N(),e.payload.data.fields=[{index:0,deviceName:E.deviceName,deviceCode:E.deviceCode,field:v.value??""}],v.value=e.payload.data.fields[0].field):(v.value="",e.payload.data.fields=[]),console.log("管道配置",e.payload)},M=l.ref([]),N=async()=>{M.value=await Lm(E.deviceCode)},_=()=>{e.payload.data.fields=[{index:0,deviceName:E.deviceName,deviceCode:E.deviceCode,field:v.value??""}],console.log("管道配置",e.payload)};return l.onMounted(()=>{S()}),(ne,L)=>{const G=l.resolveComponent("el-col"),ie=l.resolveComponent("el-option"),Z=l.resolveComponent("el-select"),ae=l.resolveComponent("el-row"),He=l.resolveComponent("el-color-picker"),re=l.resolveComponent("el-input-number"),at=l.resolveComponent("el-collapse-item"),nt=l.resolveComponent("el-switch"),Mt=l.resolveComponent("el-button"),Tn=l.resolveComponent("el-collapse"),es=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",_j,[l.createVNode(Tn,{modelValue:t.value,"onUpdate:modelValue":L[17]||(L[17]=J=>t.value=J),accordion:""},{default:l.withCtx(()=>[l.createVNode(at,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",kj,[l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[19]||(L[19]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:s.value,"onUpdate:modelValue":L[0]||(L[0]=J=>s.value=J),placeholder:"请选择线段类型",clearable:"",size:"small",onChange:f},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(uj),J=>(l.openBlock(),l.createBlock(ie,{key:J.value,label:J.label,value:J.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[20]||(L[20]=[l.createElementVNode("div",{class:"row-label"},"颜色1",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(He,{modelValue:r.value,"onUpdate:modelValue":L[1]||(L[1]=J=>r.value=J),"show-alpha":!0,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),s.value==="pipe"?(l.openBlock(),l.createBlock(ae,{key:0,gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[21]||(L[21]=[l.createElementVNode("div",{class:"row-label"},"颜色2",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(He,{modelValue:i.value,"onUpdate:modelValue":L[2]||(L[2]=J=>i.value=J),"show-alpha":!0,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1})):l.createCommentVNode("",!0),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[22]||(L[22]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:o.value,"onUpdate:modelValue":L[3]||(L[3]=J=>o.value=J),size:"small","controls-position":"right",onChange:h,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),s.value==="pipe"?(l.openBlock(),l.createBlock(at,{key:0,title:"管道设置",name:"3"},{default:l.withCtx(()=>[l.createElementVNode("div",Dj,[l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[23]||(L[23]=[l.createElementVNode("div",{class:"row-label"},"管道间隔",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:a.value,"onUpdate:modelValue":L[4]||(L[4]=J=>a.value=J),size:"small","controls-position":"right",onChange:h,min:5,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[24]||(L[24]=[l.createElementVNode("div",{class:"row-label"},"默认流动方向",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:c.value,"onUpdate:modelValue":L[5]||(L[5]=J=>c.value=J),placeholder:"请选择管道方向",size:"small",onChange:h},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Kb),J=>(l.openBlock(),l.createBlock(ie,{key:J.value,label:J.label,value:J.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[25]||(L[25]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:x.value,"onUpdate:modelValue":L[6]||(L[6]=J=>x.value=J),placeholder:"请选择设备",onChange:C,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,J=>(l.openBlock(),l.createBlock(ie,{key:J.deviceCode,label:J.deviceName,value:J.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(Z,{modelValue:v.value,"onUpdate:modelValue":L[7]||(L[7]=J=>v.value=J),placeholder:"请选择字段",onChange:_,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(M.value,J=>(l.openBlock(),l.createBlock(ie,{key:J.dataField,label:J.name,value:J.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[26]||(L[26]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(nt,{modelValue:p.value,"onUpdate:modelValue":L[8]||(L[8]=J=>p.value=J),"active-value":!0,"inactive-value":!1,size:"small",onChange:g},null,8,["modelValue"]),l.createVNode(Mt,{type:"primary",size:"small",onClick:y,style:{"margin-left":"10px"}},{default:l.withCtx(()=>L[27]||(L[27]=[l.createTextVNode("配置")])),_:1})]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(at,{title:"箭头1设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Rj,[l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[28]||(L[28]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:u.name,"onUpdate:modelValue":L[9]||(L[9]=J=>u.name=J),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:h},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Xb),J=>(l.openBlock(),l.createBlock(ie,{key:J.value,label:J.label,value:J.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[29]||(L[29]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:u.args.width,"onUpdate:modelValue":L[10]||(L[10]=J=>u.args.width=J),size:"small","controls-position":"right",onChange:h,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[30]||(L[30]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:u.args.height,"onUpdate:modelValue":L[11]||(L[11]=J=>u.args.height=J),size:"small","controls-position":"right",onChange:h,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[31]||(L[31]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:u.args.offset,"onUpdate:modelValue":L[12]||(L[12]=J=>u.args.offset=J),size:"small","controls-position":"right",onChange:h,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(at,{title:"箭头2设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Lj,[l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[32]||(L[32]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:d.name,"onUpdate:modelValue":L[13]||(L[13]=J=>d.name=J),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:h},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Xb),J=>(l.openBlock(),l.createBlock(ie,{key:J.value,label:J.label,value:J.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[33]||(L[33]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:d.args.width,"onUpdate:modelValue":L[14]||(L[14]=J=>d.args.width=J),size:"small","controls-position":"right",onChange:h,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[34]||(L[34]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:d.args.height,"onUpdate:modelValue":L[15]||(L[15]=J=>d.args.height=J),size:"small","controls-position":"right",onChange:h,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(ae,{gutter:20},{default:l.withCtx(()=>[l.createVNode(G,{span:12},{default:l.withCtx(()=>L[35]||(L[35]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(G,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:d.args.offset,"onUpdate:modelValue":L[16]||(L[16]=J=>d.args.offset=J),size:"small","controls-position":"right",onChange:h,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(es,{modelValue:m.show,"onUpdate:modelValue":L[18]||(L[18]=J=>m.show=J),width:"500px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[m.show?(l.openBlock(),l.createBlock(Tj,{key:0,payload:m.payload,onClose:b},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-330709a3"]]),Ij={class:"form-container"},Vj=En({__name:"Shortcuts",setup(n){const e=l.ref([{name:"复制",windowsKey:"Ctrl + C",macKey:"Command + C"},{name:"粘贴",windowsKey:"Ctrl + V",macKey:"Command + V"},{name:"撤销",windowsKey:"Ctrl + Z",macKey:"Command + Z"},{name:"重做",windowsKey:"Ctrl + Y",macKey:"Command + Y"},{name:"框选",windowsKey:"Alt + LMB",macKey:"option + LMB"},{name:"多选",windowsKey:"Alt + LMB",macKey:"Command + LMB"}]);return(t,s)=>{const r=l.resolveComponent("el-table-column"),i=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",Ij,[l.createVNode(i,{data:e.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(r,{prop:"name",label:"名称"}),l.createVNode(r,{prop:"windowsKey",label:"windows"}),l.createVNode(r,{prop:"macKey",label:"mac"})]),_:1},8,["data"])])}}},[["__scopeId","data-v-99982d47"]]),Bj=`.x6-widget-dnd {
482
+ `;$.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},$.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},$.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},$.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},$.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},$.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},$.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},$.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},$.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},$.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},$.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},$.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},$.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},$.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},$.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},$.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},$.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},$.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},$.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},$.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},$.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},$.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},$.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},$.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},$.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},$.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},$.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},$.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},$.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},$.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},$.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t&&t.unselect(n,e),this};var vj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class li extends Te{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},li.defaultOptions),e),Fr(this.name,xj)}init(e){this.graph=e,this.selectionImpl=new o0(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return e!=null?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return e!=null?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const s=this.getCells(e);return s.length&&(this.isMultiple()?this.selectionImpl.select(s,t):this.reset(s.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),s=this.graph.getPlugin("scroller"),r=s&&s.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&bs.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&bs.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const s=this.options;let r=this.disabled;!r&&this.movedMap.has(t)&&(r=s.selectCellOnMoved===!1,r||(r=s.selectNodeOnMoved===!1&&t.isNode()),r||(r=s.selectEdgeOnMoved===!1&&t.isEdge())),r||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Ur(this.name)}}vj([Te.dispose()],li.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]}}(li||(li={}));const xd="line",vd="pipe",Cd="arrow",Cj=[{label:"直线",value:xd},{label:"管道",value:vd},{label:"箭头",value:Cd}],Cl=[{label:"Block",value:"block"},{label:"Classic",value:"classic"},{label:"Diamond",value:"diamond"},{label:"Cross",value:"cross"},{label:"Async",value:"async"},{label:"Circle",value:"circle"},{label:"CirclePlus",value:"circlePlus"},{label:"Ellipse",value:"ellipse"}],ci="stop",a0=[{label:"停止",value:ci},{label:"正向",value:"forward-pipe"},{label:"反向",value:"reverse-pipe"}],nr="flashing",ui="arrowForward",Sd="arrowBackward",Sj=[{label:"正向",value:ui},{label:"反向",value:Sd}],Ej=()=>new tr({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),Oj=()=>new t0,Mj=()=>new s0,Pj=()=>new r0({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),Nj=["tools","ports"],Aj=()=>new ai({beforeAddCommand:(n,e)=>{if(Nj.includes(e.key))return!1}}),_j=()=>new li({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),Tj=n=>{const e=n.getSelectedCells();e.length&&n.removeCells(e)},kj=n=>{const e=n.getSelectedCells();e.length&&n.copy(e)},Vj=n=>{if(!n.isClipboardEmpty()){const e=n.paste({offset:32});n.cleanSelection(),n.select(e)}},Dj=n=>{n.canUndo()&&n.undo()},Rj=n=>{n.canRedo()&&n.redo()},Lj=n=>{n.addTools([{name:"vertices",args:{snapRadius:3,attrs:{r:3,fill:"#239edd",cursor:"move","stroke-width":2},modifiers:["shift"]}},{name:"segments",args:{attrs:{stroke:"#239edd",strokeWidth:2,strokeDasharray:"5 5"}}},{name:"source-arrowhead",args:{attrs:{stroke:"#239edd"}}},{name:"target-arrowhead",args:{attrs:{stroke:"#239edd"}}}])},l0=()=>{var n,e;return(n=Qe.attrs)!=null&&n.pipe?"pipe":(e=Qe.attrs)!=null&&e.arrow?"arrow":"line"},c0=n=>n!=="none"?n+" 30s infinite linear":"",Ed=()=>Math.random(),u0="--",Sl=/\$\{(.*?)\}/g,Ij={min:0,max:0,direction:ci},Bj={min:0,max:0,animation:nr,direction:ui,display:"block"},jj={class:"control"},$j={class:"row-column"},zj={class:"row-column"},d0=Ut(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object},setup(n){var D,B,G,se;const e=n,t=l.ref((D=e.payload.attrs.label)!=null&&D.textAnchor?"0":"1"),s=l.ref([]),r=l.ref([]),i=async()=>{s.value=await Nu()},o=l.ref();let a=l.reactive({});const c=()=>{a=s.value.find(I=>I.deviceCode===o.value),a&&u()},u=async()=>{r.value=await Au(a.deviceCode)},d=I=>I.replace(Sl,u0),f=I=>{_k.confirm(`是否确定要添加${a.deviceName}-${I.name}?
483
+ 添加后为:--${I.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const _=I.unit??"",H=e.payload.data.content;e.payload.data.content=h.value=H+"${"+a.deviceName+"."+I.name+"}"+_;const K=H.match(Sl),q=(K==null?void 0:K.length)||0;e.payload.data.fields.push({index:q,deviceName:a.deviceName,deviceCode:a.deviceCode,field:I.dataField}),e.payload.label=d(e.payload.data.content)})},h=l.ref(e.payload.data.content||null),p=l.ref(e.payload.attrs.body.fill||null),g=l.ref(e.payload.attrs.body.stroke||null),m=l.ref(e.payload.attrs.body.strokeWidth||null),y=l.ref(e.payload.attrs.body.rx||null),b=l.ref(e.payload.attrs.body.ry||null),w=l.ref(e.payload.attrs.text.fill||null),x=l.ref(e.payload.attrs.text.fontSize||null),v=l.ref(((B=e.payload.attrs.label)==null?void 0:B.textAnchor)||null),S=l.ref(((G=e.payload.attrs.label)==null?void 0:G.x)||null),E=l.ref(((se=e.payload.attrs.label)==null?void 0:se.y)||null),C=()=>{e.payload.attr("body/fill",p.value),e.payload.attr("body/stroke",g.value),e.payload.attr("body/strokeWidth",m.value),e.payload.attr("body/rx",y.value),e.payload.attr("body/ry",b.value),e.payload.attr("text/fill",w.value),e.payload.attr("text/fontSize",x.value),e.payload.attr("label/textAnchor",v.value),e.payload.attr("label/x",S.value),e.payload.attr("label/y",E.value)},P=l.ref(null),A=()=>{if(e.payload.data.content.length>h.value.length&&e.payload.data.content.endsWith("}")){const I=e.payload.data.content.match(Sl);if(I){const _=I.length-1;e.payload.data.fields.splice(_,1),h.value=e.payload.data.content.substring(0,e.payload.data.content.lastIndexOf("${"))}}e.payload.data.content=h.value,e.payload.label=d(h.value)},T=()=>{if(P.value){const I=P.value.$refs.textarea;I.focus();const _=h.value.length;I.setSelectionRange(_,_)}},k=l.ref([]),V=()=>{k.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(I=>({id:I.id,attrs:I.attrs,args:{x:Number(I.args.x.replace("%","")),y:Number(I.args.y.replace("%",""))}}))))},R=()=>{const I=_u;I.attrs.text.text=`${e.payload.getPorts().length+1}`,I.args.x="50%",I.args.y="50%",e.payload.addPorts([{group:"ports",...I}]),V()},j=()=>{Ki("#drawing-board",!0)},N=(I,_,H)=>{e.payload.portProp(I,"args/"+_,H+"%"),V()},M=I=>{e.payload.removePort(I),V()};return l.onMounted(()=>{V(),i(),document.addEventListener("selectionchange",()=>{document.activeElement.tagName==="TEXTAREA"&&T()})}),(I,_)=>{const H=l.resolveComponent("el-input"),K=l.resolveComponent("el-alert"),q=l.resolveComponent("el-option"),re=l.resolveComponent("el-select"),Z=l.resolveComponent("el-table-column"),ge=l.resolveComponent("el-table"),te=l.resolveComponent("el-collapse-item"),le=l.resolveComponent("el-col"),bt=l.resolveComponent("el-color-picker"),st=l.resolveComponent("el-row"),Pt=l.resolveComponent("el-input-number"),Q=l.resolveComponent("el-button"),sr=l.resolveComponent("el-slider"),rr=l.resolveComponent("el-icon"),hi=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",jj,[l.createVNode(hi,{modelValue:t.value,"onUpdate:modelValue":_[12]||(_[12]=ae=>t.value=ae),accordion:""},{default:l.withCtx(()=>[n.payload.data.type==="text"?(l.openBlock(),l.createBlock(te,{key:0,title:"文本内容",name:"0"},{default:l.withCtx(()=>[l.createVNode(H,{ref_key:"inputRef",ref:P,type:"textarea",modelValue:h.value,"onUpdate:modelValue":_[0]||(_[0]=ae=>h.value=ae),onInput:A,onFocus:T,rows:10},null,8,["modelValue"]),l.createVNode(K,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),l.createVNode(re,{modelValue:o.value,"onUpdate:modelValue":_[1]||(_[1]=ae=>o.value=ae),placeholder:"请选择设备",onChange:c,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,ae=>(l.openBlock(),l.createBlock(q,{key:ae.deviceCode,label:ae.deviceName,value:ae.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(ge,{data:r.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:f},{default:l.withCtx(()=>[l.createVNode(Z,{type:"index",label:"序号",width:"50",align:"center"}),l.createVNode(Z,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),l.createVNode(Z,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),l.createVNode(Z,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(te,{title:"图形设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",$j,[l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[13]||(_[13]=[l.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(bt,{modelValue:p.value,"onUpdate:modelValue":_[2]||(_[2]=ae=>p.value=ae),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[14]||(_[14]=[l.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(bt,{modelValue:g.value,"onUpdate:modelValue":_[3]||(_[3]=ae=>g.value=ae),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[15]||(_[15]=[l.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(Pt,{modelValue:m.value,"onUpdate:modelValue":_[4]||(_[4]=ae=>m.value=ae),size:"small","controls-position":"right",onChange:C,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[16]||(_[16]=[l.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(Pt,{modelValue:y.value,"onUpdate:modelValue":_[5]||(_[5]=ae=>y.value=ae),size:"small","controls-position":"right",onChange:C,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[17]||(_[17]=[l.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(Pt,{modelValue:b.value,"onUpdate:modelValue":_[6]||(_[6]=ae=>b.value=ae),size:"small","controls-position":"right",onChange:C,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(l.openBlock(),l.createBlock(te,{key:1,title:"文字设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",zj,[l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[18]||(_[18]=[l.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(bt,{modelValue:w.value,"onUpdate:modelValue":_[7]||(_[7]=ae=>w.value=ae),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[19]||(_[19]=[l.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(Pt,{modelValue:x.value,"onUpdate:modelValue":_[8]||(_[8]=ae=>x.value=ae),size:"small","controls-position":"right",onChange:C,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[20]||(_[20]=[l.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:v.value,"onUpdate:modelValue":_[9]||(_[9]=ae=>v.value=ae),size:"small",onChange:C},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(["start","middle","end"],ae=>l.createVNode(q,{key:ae,label:ae,value:ae},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[21]||(_[21]=[l.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(Pt,{modelValue:S.value,"onUpdate:modelValue":_[10]||(_[10]=ae=>S.value=ae),size:"small","controls-position":"right",onChange:C,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(st,{gutter:20},{default:l.withCtx(()=>[l.createVNode(le,{span:12},{default:l.withCtx(()=>_[22]||(_[22]=[l.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),l.createVNode(le,{span:12},{default:l.withCtx(()=>[l.createVNode(Pt,{modelValue:E.value,"onUpdate:modelValue":_[11]||(_[11]=ae=>E.value=ae),size:"small","controls-position":"right",onChange:C,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(te,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(Q,{type:"primary",onClick:R,size:"small"},{default:l.withCtx(()=>_[23]||(_[23]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(Q,{type:"primary",onClick:j,size:"small"},{default:l.withCtx(()=>_[24]||(_[24]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(ge,{data:k.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(Z,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:ae})=>[l.createTextVNode(l.toDisplayString(ae.attrs.text.text),1)]),_:1}),l.createVNode(Z,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:ae})=>[l.createVNode(sr,{modelValue:ae.args.x,"onUpdate:modelValue":Jt=>ae.args.x=Jt,min:0,max:100,step:1,onInput:Jt=>N(ae.id,"x",Jt)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(Z,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:ae})=>[l.createVNode(sr,{modelValue:ae.args.y,"onUpdate:modelValue":Jt=>ae.args.y=Jt,min:0,max:100,step:1,onInput:Jt=>N(ae.id,"y",Jt)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(Z,{label:"操作",align:"center"},{default:l.withCtx(({row:ae})=>[l.createVNode(Q,{type:"danger",size:"small",onClick:Jt=>M(ae.id)},{default:l.withCtx(()=>[l.createVNode(rr,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Vp))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-02b2bc1a"]]),Fj={class:"container"},Uj={class:"row-column"},Hj={class:"row-column"},Gj={class:"row-column"},Wj=Ut({__name:"default-line",props:{payload:Object},setup(n){var c,u,d,f;const e=n,t=l.ref("0"),s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.line.strokeWidth),i=l.reactive({name:((c=e.payload.attrs.line.sourceMarker)==null?void 0:c.name)??null,args:((u=e.payload.attrs.line.sourceMarker)==null?void 0:u.args)??{}}),o=l.reactive({name:((d=e.payload.attrs.line.targetMarker)==null?void 0:d.name)??null,args:((f=e.payload.attrs.line.targetMarker)==null?void 0:f.args)??{}}),a=()=>{e.payload.attr("line/stroke",s.value),e.payload.attr("line/strokeWidth",r.value),e.payload.attr("line/sourceMarker/name",i.name),e.payload.attr("line/sourceMarker/args",i.args),e.payload.attr("line/targetMarker/name",o.name),e.payload.attr("line/targetMarker/args",o.args),Qe.markup=e.payload.markup,Qe.attrs=e.payload.attrs};return(h,p)=>{const g=l.resolveComponent("el-col"),m=l.resolveComponent("el-color-picker"),y=l.resolveComponent("el-row"),b=l.resolveComponent("el-input-number"),w=l.resolveComponent("el-collapse-item"),x=l.resolveComponent("el-option"),v=l.resolveComponent("el-select"),S=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Fj,[l.createVNode(S,{modelValue:t.value,"onUpdate:modelValue":p[10]||(p[10]=E=>t.value=E),accordion:""},{default:l.withCtx(()=>[l.createVNode(w,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",Uj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[11]||(p[11]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=E=>s.value=E),"show-alpha":!0,size:"small",onChange:a},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[12]||(p[12]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:r.value,"onUpdate:modelValue":p[1]||(p[1]=E=>r.value=E),size:"small","controls-position":"right",onChange:a,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(w,{title:"箭头1设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Hj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[13]||(p[13]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(v,{modelValue:i.name,"onUpdate:modelValue":p[2]||(p[2]=E=>i.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Cl),E=>(l.openBlock(),l.createBlock(x,{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[14]||(p[14]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.width,"onUpdate:modelValue":p[3]||(p[3]=E=>i.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[15]||(p[15]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.height,"onUpdate:modelValue":p[4]||(p[4]=E=>i.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[16]||(p[16]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.offset,"onUpdate:modelValue":p[5]||(p[5]=E=>i.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(w,{title:"箭头2设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Gj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[17]||(p[17]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(v,{modelValue:o.name,"onUpdate:modelValue":p[6]||(p[6]=E=>o.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Cl),E=>(l.openBlock(),l.createBlock(x,{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[18]||(p[18]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.width,"onUpdate:modelValue":p[7]||(p[7]=E=>o.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[19]||(p[19]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.height,"onUpdate:modelValue":p[8]||(p[8]=E=>o.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[20]||(p[20]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.offset,"onUpdate:modelValue":p[9]||(p[9]=E=>o.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-060936eb"]]),Yj={class:"form-container"},qj={class:"footer",style:{"margin-top":"10px"}},h0=Ut({__name:"condition",props:{payload:{type:Array},type:{type:String}},emits:["close"],setup(n,{emit:e}){const t=n,s=l.ref(t.payload),r=()=>{s.value.push(JSON.parse(JSON.stringify(t.type==="pipe"?Ij:Bj)))},i=u=>{s.value.splice(u,1)},o=e,a=()=>{o("close",s.value)},c=()=>{o("close",!1)};return(u,d)=>{const f=l.resolveComponent("el-button"),h=l.resolveComponent("el-input-number"),p=l.resolveComponent("el-table-column"),g=l.resolveComponent("el-option"),m=l.resolveComponent("el-select"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",Yj,[l.createVNode(f,{type:"primary",size:"small",onClick:r,style:{"margin-bottom":"10px"}},{default:l.withCtx(()=>d[0]||(d[0]=[l.createTextVNode("添加条件")])),_:1}),l.createVNode(b,{data:s.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(p,{prop:"min",label:"最小值",width:"150",align:"center"},{default:l.withCtx(w=>[l.createVNode(h,{modelValue:w.row.min,"onUpdate:modelValue":x=>w.row.min=x,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(p,{prop:"max",label:"最大值",width:"150",align:"center"},{default:l.withCtx(w=>[l.createVNode(h,{modelValue:w.row.max,"onUpdate:modelValue":x=>w.row.max=x,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),n.type==="pipe"?(l.openBlock(),l.createBlock(p,{key:0,prop:"direction",label:"流向",align:"center"},{default:l.withCtx(w=>[l.createVNode(m,{modelValue:w.row.direction,"onUpdate:modelValue":x=>w.row.direction=x,size:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a0),x=>(l.openBlock(),l.createBlock(g,{key:x.value,label:x.label,value:x.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:1,prop:"direction",label:"方向",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.direction,"onUpdate:modelValue":x=>w.row.direction=x,"active-value":l.unref(ui),"active-text":"正向","inactive-value":l.unref(Sd),"inactive-text":"反向",size:"small"},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:2,prop:"direction",label:"动作",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.animation,"onUpdate:modelValue":x=>w.row.animation=x,"active-value":l.unref(nr),"active-text":"闪烁","inactive-value":l.unref(ci),"inactive-text":"静止",size:"small"},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:3,prop:"display",label:"显示",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.display,"onUpdate:modelValue":x=>w.row.display=x,"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(p,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(f,{type:"danger",size:"small",onClick:x=>i(w.$index)},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createElementVNode("div",qj,[l.createVNode(f,{type:"primary",onClick:a},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("保存")])),_:1}),l.createVNode(f,{onClick:c},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("取消")])),_:1})])])}}},[["__scopeId","data-v-93fe286b"]]),Jj={class:"container"},Xj={class:"row-column"},Kj={class:"row-column"},Zj={class:"row-column"},Qj={class:"row-column"},e3=Ut({__name:"pipe-line",props:{payload:Object},setup(n){var A,T,k,V,R,j,N,M,D,B,G,se;const e=n,t=l.ref("0"),s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.pipe.stroke),i=l.ref(e.payload.attrs.line.strokeWidth),o=l.ref(e.payload.attrs.pipe.strokeDasharray),a=l.ref(((T=(A=e.payload.attrs.pipe)==null?void 0:A.style)==null?void 0:T.animation.split(" ")[0])??ci),c=l.reactive({name:((k=e.payload.attrs.pipe.sourceMarker)==null?void 0:k.name)??null,args:((V=e.payload.attrs.pipe.sourceMarker)==null?void 0:V.args)??{}}),u=l.reactive({name:((R=e.payload.attrs.pipe.targetMarker)==null?void 0:R.name)??null,args:((j=e.payload.attrs.pipe.targetMarker)==null?void 0:j.args)??{}}),d=()=>{e.payload.attr("line/stroke",s.value),e.payload.attr("pipe/stroke",r.value),e.payload.attr("line/strokeWidth",i.value),e.payload.attr("pipe/strokeWidth",i.value),e.payload.attr("pipe/strokeDasharray",o.value),e.payload.attr("pipe/sourceMarker/name",c.name),e.payload.attr("pipe/sourceMarker/args",c.args),e.payload.attr("pipe/targetMarker/name",u.name),e.payload.attr("pipe/targetMarker/args",u.args),e.payload.attr("pipe/style/animation",c0(a.value)),Qe.markup=e.payload.markup,Qe.attrs=e.payload.attrs,console.log("线-基础配置",Qe),console.log("线-当前配置",e.payload)},f=l.ref(e.payload.data.isCondition??!1),h=()=>{e.payload.data.isCondition=f.value},p=l.reactive({show:!1,payload:null}),g=()=>{p.show=!0,p.payload=e.payload.data.condition??[]},m=I=>{p.show=!1,p.payload=null,I&&(e.payload.data.condition=I),console.log("条件线",e.payload.data)},y=l.ref([]),b=l.ref(((D=(M=(N=e.payload.data)==null?void 0:N.fields)==null?void 0:M[0])==null?void 0:D.deviceCode)??""),w=l.ref(((se=(G=(B=e.payload.data)==null?void 0:B.fields)==null?void 0:G[0])==null?void 0:se.field)??""),x=async()=>{y.value=await Nu(),b.value&&S()};let v=l.reactive({});const S=()=>{v=y.value.find(I=>I.deviceCode===b.value),v?(C(),e.payload.data.fields=[{index:0,deviceName:v.deviceName,deviceCode:v.deviceCode,field:w.value??""}],w.value=e.payload.data.fields[0].field):(w.value="",e.payload.data.fields=[]),console.log("管道配置",e.payload)},E=l.ref([]),C=async()=>{E.value=await Au(v.deviceCode)},P=()=>{e.payload.data.fields=[{index:0,deviceName:v.deviceName,deviceCode:v.deviceCode,field:w.value??""}],console.log("管道配置",e.payload)};return l.onMounted(()=>{x()}),(I,_)=>{const H=l.resolveComponent("el-col"),K=l.resolveComponent("el-color-picker"),q=l.resolveComponent("el-row"),re=l.resolveComponent("el-input-number"),Z=l.resolveComponent("el-collapse-item"),ge=l.resolveComponent("el-option"),te=l.resolveComponent("el-select"),le=l.resolveComponent("el-switch"),bt=l.resolveComponent("el-button"),st=l.resolveComponent("el-collapse"),Pt=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Jj,[l.createVNode(st,{modelValue:t.value,"onUpdate:modelValue":_[16]||(_[16]=Q=>t.value=Q),accordion:""},{default:l.withCtx(()=>[l.createVNode(Z,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",Xj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[18]||(_[18]=[l.createElementVNode("div",{class:"row-label"},"颜色1",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(K,{modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=Q=>s.value=Q),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[19]||(_[19]=[l.createElementVNode("div",{class:"row-label"},"颜色2",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(K,{modelValue:r.value,"onUpdate:modelValue":_[1]||(_[1]=Q=>r.value=Q),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[20]||(_[20]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:i.value,"onUpdate:modelValue":_[2]||(_[2]=Q=>i.value=Q),size:"small","controls-position":"right",onChange:d,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(Z,{title:"管道设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Kj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[21]||(_[21]=[l.createElementVNode("div",{class:"row-label"},"管道间隔",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:o.value,"onUpdate:modelValue":_[3]||(_[3]=Q=>o.value=Q),size:"small","controls-position":"right",onChange:d,min:5,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[22]||(_[22]=[l.createElementVNode("div",{class:"row-label"},"默认流动方向",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:a.value,"onUpdate:modelValue":_[4]||(_[4]=Q=>a.value=Q),placeholder:"请选择管道方向",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a0),Q=>(l.openBlock(),l.createBlock(ge,{key:Q.value,label:Q.label,value:Q.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[23]||(_[23]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:b.value,"onUpdate:modelValue":_[5]||(_[5]=Q=>b.value=Q),placeholder:"请选择设备",onChange:S,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value,Q=>(l.openBlock(),l.createBlock(ge,{key:Q.deviceCode,label:Q.deviceName,value:Q.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(te,{modelValue:w.value,"onUpdate:modelValue":_[6]||(_[6]=Q=>w.value=Q),placeholder:"请选择字段",onChange:P,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E.value,Q=>(l.openBlock(),l.createBlock(ge,{key:Q.dataField,label:Q.name,value:Q.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[24]||(_[24]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(le,{modelValue:f.value,"onUpdate:modelValue":_[7]||(_[7]=Q=>f.value=Q),"active-value":!0,"inactive-value":!1,size:"small",onChange:h},null,8,["modelValue"]),l.createVNode(bt,{type:"primary",size:"small",onClick:g,style:{"margin-left":"10px"}},{default:l.withCtx(()=>_[25]||(_[25]=[l.createTextVNode("配置")])),_:1})]),_:1})]),_:1})])]),_:1}),l.createVNode(Z,{title:"箭头1设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Zj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[26]||(_[26]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:c.name,"onUpdate:modelValue":_[8]||(_[8]=Q=>c.name=Q),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Cl),Q=>(l.openBlock(),l.createBlock(ge,{key:Q.value,label:Q.label,value:Q.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[27]||(_[27]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:c.args.width,"onUpdate:modelValue":_[9]||(_[9]=Q=>c.args.width=Q),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[28]||(_[28]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:c.args.height,"onUpdate:modelValue":_[10]||(_[10]=Q=>c.args.height=Q),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[29]||(_[29]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:c.args.offset,"onUpdate:modelValue":_[11]||(_[11]=Q=>c.args.offset=Q),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(Z,{title:"箭头2设置",name:"3"},{default:l.withCtx(()=>[l.createElementVNode("div",Qj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[30]||(_[30]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:u.name,"onUpdate:modelValue":_[12]||(_[12]=Q=>u.name=Q),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Cl),Q=>(l.openBlock(),l.createBlock(ge,{key:Q.value,label:Q.label,value:Q.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[31]||(_[31]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:u.args.width,"onUpdate:modelValue":_[13]||(_[13]=Q=>u.args.width=Q),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[32]||(_[32]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:u.args.height,"onUpdate:modelValue":_[14]||(_[14]=Q=>u.args.height=Q),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(H,{span:12},{default:l.withCtx(()=>_[33]||(_[33]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(H,{span:12},{default:l.withCtx(()=>[l.createVNode(re,{modelValue:u.args.offset,"onUpdate:modelValue":_[15]||(_[15]=Q=>u.args.offset=Q),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(Pt,{modelValue:p.show,"onUpdate:modelValue":_[17]||(_[17]=Q=>p.show=Q),width:"500px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[p.show?(l.openBlock(),l.createBlock(h0,{key:0,payload:p.payload,type:"pipe",onClose:m},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-607d9ef1"]]),t3={class:"container"},n3={class:"row-column"},s3={class:"row-column"},r3={class:"row-column"},i3={__name:"arrow-line",props:{payload:{type:Object}},setup(n){var T,k,V,R,j,N;const e=n,t=l.ref("0");console.log(e.payload);const s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.line.strokeWidth),i=e.payload.markup.length-1,o=l.ref(e.payload.markup.length-1),a=l.ref(e.payload.attrs.arrow.fill),c=l.ref(e.payload.attrs.arrow.d===Ga?ui:Sd),u=l.ref(e.payload.attrs.arrow.style.animation.split(" ")[0]===nr?nr:ci),d=l.ref(e.payload.attrs.arrow.display),f=()=>{if(e.payload.attr("line/stroke",s.value),e.payload.attr("line/strokeWidth",r.value),e.payload.attr("arrow/fill",a.value),e.payload.attr("arrow/stroke",a.value),o.value!==i){e.payload.markup=e.payload.markup.slice(0,1);for(let M=0;M<o.value;M++)e.payload.markup.push({tagName:"path",groupSelector:"arrow",selector:"arrow"+(M+1)}),e.payload.attr("arrow"+(M+1),{atConnectionRatio:1/(o.value+1)*(M+1)})}e.payload.attr("arrow/d",c.value===ui?Ga:Jm),e.payload.attr("arrow/style/animation",u.value===nr?"flashing 2s infinite linear":""),e.payload.attr("arrow/display",d.value),console.log(e.payload.markup),Qe.markup=e.payload.markup,Qe.attrs=e.payload.attrs},h=l.ref([]),p=l.ref(((V=(k=(T=e.payload.data)==null?void 0:T.fields)==null?void 0:k[0])==null?void 0:V.deviceCode)??""),g=l.ref(((N=(j=(R=e.payload.data)==null?void 0:R.fields)==null?void 0:j[0])==null?void 0:N.field)??""),m=async()=>{h.value=await Nu(),p.value&&b()};let y=l.reactive({});const b=()=>{y=h.value.find(M=>M.deviceCode===p.value),y?(x(),e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],g.value=e.payload.data.fields[0].field):(g.value="",e.payload.data.fields=[]),console.log("箭头线-配置",e.payload)},w=l.ref([]),x=async()=>{w.value=await Au(y.deviceCode)},v=()=>{e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],console.log("箭头线-配置",e.payload)},S=l.ref(e.payload.data.isCondition??!1),E=()=>{e.payload.data.isCondition=S.value},C=l.reactive({show:!1,payload:null}),P=()=>{C.show=!0,C.payload=e.payload.data.condition??[]},A=M=>{C.show=!1,C.payload=null,M&&(e.payload.data.condition=M),console.log("条件线",e.payload.data)};return l.onMounted(()=>{m()}),(M,D)=>{const B=l.resolveComponent("el-col"),G=l.resolveComponent("el-color-picker"),se=l.resolveComponent("el-row"),I=l.resolveComponent("el-input-number"),_=l.resolveComponent("el-collapse-item"),H=l.resolveComponent("el-option"),K=l.resolveComponent("el-select"),q=l.resolveComponent("el-switch"),re=l.resolveComponent("el-button"),Z=l.resolveComponent("el-collapse"),ge=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",t3,[l.createVNode(Z,{modelValue:t.value,"onUpdate:modelValue":D[10]||(D[10]=te=>t.value=te),accordion:""},{default:l.withCtx(()=>[l.createVNode(_,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",n3,[l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[12]||(D[12]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(G,{modelValue:s.value,"onUpdate:modelValue":D[0]||(D[0]=te=>s.value=te),"show-alpha":!0,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[13]||(D[13]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(I,{modelValue:r.value,"onUpdate:modelValue":D[1]||(D[1]=te=>r.value=te),size:"small","controls-position":"right",onChange:f,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(_,{title:"箭头设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",s3,[l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[14]||(D[14]=[l.createElementVNode("div",{class:"row-label"},"箭头数量",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(I,{modelValue:o.value,"onUpdate:modelValue":D[2]||(D[2]=te=>o.value=te),size:"small","controls-position":"right",onChange:f,min:1,max:20,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[15]||(D[15]=[l.createElementVNode("div",{class:"row-label"},"箭头颜色",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(G,{modelValue:a.value,"onUpdate:modelValue":D[3]||(D[3]=te=>a.value=te),"show-alpha":!0,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[16]||(D[16]=[l.createElementVNode("div",{class:"row-label"},"默认箭头方向",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(K,{modelValue:c.value,"onUpdate:modelValue":D[4]||(D[4]=te=>c.value=te),size:"small",onChange:f},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Sj),te=>(l.openBlock(),l.createBlock(H,{key:te.value,label:te.label,value:te.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[17]||(D[17]=[l.createElementVNode("div",{class:"row-label"},"默认箭头动作",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.value,"onUpdate:modelValue":D[5]||(D[5]=te=>u.value=te),"active-value":l.unref(nr),"active-text":"闪烁","inactive-value":l.unref(ci),"inactive-text":"静止",size:"small",onChange:f},null,8,["modelValue","active-value","inactive-value"])]),_:1})]),_:1}),l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[18]||(D[18]=[l.createElementVNode("div",{class:"row-label"},"默认箭头显示",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:d.value,"onUpdate:modelValue":D[6]||(D[6]=te=>d.value=te),"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(_,{title:"动态设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",r3,[l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[19]||(D[19]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(K,{modelValue:p.value,"onUpdate:modelValue":D[7]||(D[7]=te=>p.value=te),placeholder:"请选择设备",onChange:b,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,te=>(l.openBlock(),l.createBlock(H,{key:te.deviceCode,label:te.deviceName,value:te.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(K,{modelValue:g.value,"onUpdate:modelValue":D[8]||(D[8]=te=>g.value=te),placeholder:"请选择字段",onChange:v,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,te=>(l.openBlock(),l.createBlock(H,{key:te.dataField,label:te.name,value:te.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(se,{gutter:20},{default:l.withCtx(()=>[l.createVNode(B,{span:12},{default:l.withCtx(()=>D[20]||(D[20]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(B,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:S.value,"onUpdate:modelValue":D[9]||(D[9]=te=>S.value=te),"active-value":!0,"inactive-value":!1,size:"small",onChange:E},null,8,["modelValue"]),l.createVNode(re,{type:"primary",size:"small",onClick:P,style:{"margin-left":"10px"}},{default:l.withCtx(()=>D[21]||(D[21]=[l.createTextVNode("配置")])),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(ge,{modelValue:C.show,"onUpdate:modelValue":D[11]||(D[11]=te=>C.show=te),width:"800px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[C.show?(l.openBlock(),l.createBlock(h0,{key:0,payload:C.payload,type:"arrow",onClose:A},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},o3={class:"container"},a3={class:"row-column",style:{padding:"0 1px 10px"}},f0=Ut({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref(e.payload.data.type),s=()=>{e.payload.data.type=t.value,t.value===xd&&(Qe.attrs=Ym.attrs,Qe.markup=Ym.markup),t.value===vd&&(Qe.attrs=qm.attrs,Qe.markup=qm.markup),t.value===Cd&&(Qe.attrs=Wa.attrs,Qe.markup=Wa.markup),e.payload.attrs=null,e.payload.attr(Qe.attrs),e.payload.markup=Qe.markup,i()},r=l.shallowRef(null),i=()=>{r.value=null,t.value===xd&&(r.value=Wj),t.value===vd&&(r.value=e3),t.value===Cd&&(r.value=i3)};return l.onMounted(()=>{i()}),(o,a)=>{const c=l.resolveComponent("el-col"),u=l.resolveComponent("el-option"),d=l.resolveComponent("el-select"),f=l.resolveComponent("el-row");return l.openBlock(),l.createElementBlock("div",o3,[l.createElementVNode("div",a3,[l.createVNode(f,{gutter:20},{default:l.withCtx(()=>[l.createVNode(c,{span:12},{default:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("div",{class:"row-label"},"线段类型",-1)])),_:1}),l.createVNode(c,{span:12},{default:l.withCtx(()=>[l.createVNode(d,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=h=>t.value=h),placeholder:"请选择线段类型",clearable:"",size:"small",onChange:s},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Cj),h=>(l.openBlock(),l.createBlock(u,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.value),{payload:n.payload},null,8,["payload"]))])}}},[["__scopeId","data-v-b801c80f"]]),l3={class:"form-container"},c3=Ut({__name:"Shortcuts",setup(n){const e=l.ref([{name:"复制",windowsKey:"Ctrl + C",macKey:"Command + C"},{name:"粘贴",windowsKey:"Ctrl + V",macKey:"Command + V"},{name:"撤销",windowsKey:"Ctrl + Z",macKey:"Command + Z"},{name:"重做",windowsKey:"Ctrl + Y",macKey:"Command + Y"},{name:"框选",windowsKey:"Alt + LMB",macKey:"option + LMB"},{name:"多选",windowsKey:"Alt + LMB",macKey:"Command + LMB"}]);return(t,s)=>{const r=l.resolveComponent("el-table-column"),i=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",l3,[l.createVNode(i,{data:e.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(r,{prop:"name",label:"名称"}),l.createVNode(r,{prop:"windowsKey",label:"windows"}),l.createVNode(r,{prop:"macKey",label:"mac"})]),_:1},8,["data"])])}}},[["__scopeId","data-v-99982d47"]]),u3=`.x6-widget-dnd {
484
484
  position: absolute;
485
485
  top: -10000px;
486
486
  left: -10000px;
@@ -500,7 +500,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
500
500
  background: transparent;
501
501
  box-shadow: none;
502
502
  }
503
- `;var jj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class ks extends ye{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},ks.defaults),e),this.init()}init(){zr(this.name,Bj),this.container=document.createElement("div"),K(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new $(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),_t(this.container,this.draggingGraph.container)}start(e,t){const s=t;s.preventDefault(),this.targetModel.startBatch("dnd"),K(this.container,"dragging"),ws(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,s.clientX,s.clientY);const r=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:e,cell:e,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(ks.documentEvents,s.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,s){const r=this.draggingGraph,i=r.model,o=this.options.getDragNode(e,{sourceNode:e,draggingGraph:r,targetGraph:this.targetGraph});o.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const d=this.targetGraph.transform.getScale();r.scale(d.sx,d.sy),a*=Math.max(d.sx,d.sy)}else r.scale(1,1);this.clearDragging(),i.resetCells([o]);const c=r.findViewByCell(o);c.undelegateEvents(),c.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const u=c.getBBox();this.geometryBBox=c.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(u.getTopLeft()),this.draggingNode=o,this.draggingView=c,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,s)}updateGraphPosition(e,t){const s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,c={left:e-i.x-o.width/2-a+r,top:t-i.y-o.height/2-a+s};return this.draggingGraph&&Je(this.container,{left:`${c.left}px`,top:`${c.top}px`}),c}updateNodePosition(e,t){const s=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return s.x-=r.width/2,s.y-=r.height/2,this.draggingNode.position(s.x,s.y),s}snap({cell:e,current:t,options:s}){const r=e;if(s.snapped){const i=this.draggingBBox;r.position(i.x+s.tx,i.y+s.ty,{silent:!0}),this.draggingView.translate(),r.position(t.x,t.y,{silent:!0}),this.snapOffset={x:s.tx,y:s.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const s=this.normalizeEvent(e),r=s.clientX,i=s.clientY;this.updateGraphPosition(r,i);const o=this.updateNodePosition(r,i),a=this.targetGraph.options.embedding.enabled,c=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(a){t.setEventData(s,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const u=t.getEventData(s);c?t.processEmbedding(s,u):t.clearEmbedding(u),this.candidateEmbedView=u.candidateEmbedView}this.isSnaplineEnabled()&&(c?this.snapline.snapOnMoving({e:s,view:t,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const s=this.normalizeEvent(e),r=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,c=i.y;o&&(a+=o.x,c+=o.y),t.position(a,c,{silent:!0});const u=this.drop(t,{x:s.clientX,y:s.clientY}),d=h=>{h?(this.onDropped(t),this.targetGraph.options.embedding.enabled&&r&&(r.setEventData(s,{cell:h,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),r.finalizeEmbedding(s,r.getEventData(s)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Su(u)?(this.undelegateDocumentEvents(),u.then(d)):d(u)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(e){this.draggingNode===e&&(this.clearDragging(),De(this.container,"dragging"),Ft(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,s=null;const r=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(s=this.getDropArea(this.options.dndContainer));const o=s&&s.containsPoint(e);if(i)if(i.options.autoResize)t=this.getDropArea(i.container);else{const a=this.getDropArea(i.container);t=this.getDropArea(r.container).intersectsWithRect(a)}else t=this.getDropArea(r.container);return!o&&t&&t.containsPoint(e)}getDropArea(e){const t=Yu(e),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return U.create({x:t.left+parseInt(Je(e,"border-left-width"),10)-r,y:t.top+parseInt(Je(e,"border-top-width"),10)-s,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const s=this.targetGraph,r=s.model,i=s.clientToLocal(t),o=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:o,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),c=a.getBBox();i.x+=c.x-c.width/2,i.y+=c.y-c.height/2;const u=this.snapOffset?1:s.getGridSize();a.position(ve.snapToGrid(i.x,u),ve.snapToGrid(i.y,u)),a.removeZIndex();const d=this.options.validateNode,h=d?d(a,{sourceNode:o,draggingNode:e,droppingNode:a,targetGraph:s,draggingGraph:this.draggingGraph}):!0;return typeof h=="boolean"?h?(r.addCell(a,{stencil:this.cid}),a):null:ZD(h).then(f=>f?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Fr(this.name)}}jj([ye.dispose()],ks.prototype,"dispose",null),function(n){n.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},n.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(ks||(ks={}));function $j(n,e={}){const t=Qe.isModel(n)?n:new Qe().resetCells(n,{sort:!1,dryrun:!0}),s=t.getNodes(),r=e.columns||1,i=Math.ceil(s.length/r),o=e.dx||0,a=e.dy||0,c=e.center!==!1,u=e.resizeToFit===!0,d=e.marginX||0,h=e.marginY||0,f=[];let p=e.columnWidth;if(p==="compact")for(let w=0;w<r;w+=1){const x=Nn.getNodesInColumn(s,w,r);f.push(Nn.getMaxDim(x,"width")+o)}else{(p==null||p==="auto")&&(p=Nn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)f.push(p)}const g=Nn.accumulate(f,d),m=[];let y=e.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Nn.getNodesInRow(s,w,r);m.push(Nn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Nn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Nn.accumulate(m,h);t.startBatch("layout"),s.forEach((w,x)=>{const v=x%r,S=Math.floor(x/r),E=f[v],C=m[S];let M=0,N=0,_=w.getSize();if(u){let T=E-2*o,k=C-2*a;const R=_.height*(_.width?T/_.width:1),V=_.width*(_.height?k/_.height:1);C<R?T=V:k=R,_={width:T,height:k},w.setSize(_,e)}c&&(M=(E-_.width)/2,N=(C-_.height)/2),w.position(g[v]+o+M,b[S]+a+N,e)}),t.stopBatch("layout")}var Nn;(function(n){function e(i,o){return i.reduce((a,c)=>Math.max(c==null?void 0:c.getSize()[o],a),0)}n.getMaxDim=e;function t(i,o,a){const c=[];for(let u=a*o,d=u+a;u<d;u+=1)i[u]&&c.push(i[u]);return c}n.getNodesInRow=t;function s(i,o,a){const c=[];for(let u=o,d=i.length;u<d;u+=a)i[u]&&c.push(i[u]);return c}n.getNodesInColumn=s;function r(i,o){return i.reduce((a,c,u)=>(a.push(a[u]+c),a),[o||0])}n.accumulate=r})(Nn||(Nn={}));const zj=`.x6-widget-dnd {
503
+ `;var d3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class _s extends be{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},_s.defaults),e),this.init()}init(){Fr(this.name,u3),this.container=document.createElement("div"),X(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new $(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),kt(this.container,this.draggingGraph.container)}start(e,t){const s=t;s.preventDefault(),this.targetModel.startBatch("dnd"),X(this.container,"dragging"),ys(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,s.clientX,s.clientY);const r=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:e,cell:e,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(_s.documentEvents,s.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,s){const r=this.draggingGraph,i=r.model,o=this.options.getDragNode(e,{sourceNode:e,draggingGraph:r,targetGraph:this.targetGraph});o.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const d=this.targetGraph.transform.getScale();r.scale(d.sx,d.sy),a*=Math.max(d.sx,d.sy)}else r.scale(1,1);this.clearDragging(),i.resetCells([o]);const c=r.findViewByCell(o);c.undelegateEvents(),c.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const u=c.getBBox();this.geometryBBox=c.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(u.getTopLeft()),this.draggingNode=o,this.draggingView=c,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,s)}updateGraphPosition(e,t){const s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,c={left:e-i.x-o.width/2-a+r,top:t-i.y-o.height/2-a+s};return this.draggingGraph&&Je(this.container,{left:`${c.left}px`,top:`${c.top}px`}),c}updateNodePosition(e,t){const s=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return s.x-=r.width/2,s.y-=r.height/2,this.draggingNode.position(s.x,s.y),s}snap({cell:e,current:t,options:s}){const r=e;if(s.snapped){const i=this.draggingBBox;r.position(i.x+s.tx,i.y+s.ty,{silent:!0}),this.draggingView.translate(),r.position(t.x,t.y,{silent:!0}),this.snapOffset={x:s.tx,y:s.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const s=this.normalizeEvent(e),r=s.clientX,i=s.clientY;this.updateGraphPosition(r,i);const o=this.updateNodePosition(r,i),a=this.targetGraph.options.embedding.enabled,c=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(a){t.setEventData(s,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const u=t.getEventData(s);c?t.processEmbedding(s,u):t.clearEmbedding(u),this.candidateEmbedView=u.candidateEmbedView}this.isSnaplineEnabled()&&(c?this.snapline.snapOnMoving({e:s,view:t,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const s=this.normalizeEvent(e),r=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,c=i.y;o&&(a+=o.x,c+=o.y),t.position(a,c,{silent:!0});const u=this.drop(t,{x:s.clientX,y:s.clientY}),d=f=>{f?(this.onDropped(t),this.targetGraph.options.embedding.enabled&&r&&(r.setEventData(s,{cell:f,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),r.finalizeEmbedding(s,r.getEventData(s)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Tu(u)?(this.undelegateDocumentEvents(),u.then(d)):d(u)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(e){this.draggingNode===e&&(this.clearDragging(),De(this.container,"dragging"),Ht(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,s=null;const r=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(s=this.getDropArea(this.options.dndContainer));const o=s&&s.containsPoint(e);if(i)if(i.options.autoResize)t=this.getDropArea(i.container);else{const a=this.getDropArea(i.container);t=this.getDropArea(r.container).intersectsWithRect(a)}else t=this.getDropArea(r.container);return!o&&t&&t.containsPoint(e)}getDropArea(e){const t=ed(e),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return F.create({x:t.left+parseInt(Je(e,"border-left-width"),10)-r,y:t.top+parseInt(Je(e,"border-top-width"),10)-s,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const s=this.targetGraph,r=s.model,i=s.clientToLocal(t),o=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:o,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),c=a.getBBox();i.x+=c.x-c.width/2,i.y+=c.y-c.height/2;const u=this.snapOffset?1:s.getGridSize();a.position(Ce.snapToGrid(i.x,u),Ce.snapToGrid(i.y,u)),a.removeZIndex();const d=this.options.validateNode,f=d?d(a,{sourceNode:o,draggingNode:e,droppingNode:a,targetGraph:s,draggingGraph:this.draggingGraph}):!0;return typeof f=="boolean"?f?(r.addCell(a,{stencil:this.cid}),a):null:uD(f).then(h=>h?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Ur(this.name)}}d3([be.dispose()],_s.prototype,"dispose",null),function(n){n.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},n.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(_s||(_s={}));function h3(n,e={}){const t=et.isModel(n)?n:new et().resetCells(n,{sort:!1,dryrun:!0}),s=t.getNodes(),r=e.columns||1,i=Math.ceil(s.length/r),o=e.dx||0,a=e.dy||0,c=e.center!==!1,u=e.resizeToFit===!0,d=e.marginX||0,f=e.marginY||0,h=[];let p=e.columnWidth;if(p==="compact")for(let w=0;w<r;w+=1){const x=Tn.getNodesInColumn(s,w,r);h.push(Tn.getMaxDim(x,"width")+o)}else{(p==null||p==="auto")&&(p=Tn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)h.push(p)}const g=Tn.accumulate(h,d),m=[];let y=e.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Tn.getNodesInRow(s,w,r);m.push(Tn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Tn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Tn.accumulate(m,f);t.startBatch("layout"),s.forEach((w,x)=>{const v=x%r,S=Math.floor(x/r),E=h[v],C=m[S];let P=0,A=0,T=w.getSize();if(u){let k=E-2*o,V=C-2*a;const R=T.height*(T.width?k/T.width:1),j=T.width*(T.height?V/T.height:1);C<R?k=j:V=R,T={width:k,height:V},w.setSize(T,e)}c&&(P=(E-T.width)/2,A=(C-T.height)/2),w.position(g[v]+o+P,b[S]+a+A,e)}),t.stopBatch("layout")}var Tn;(function(n){function e(i,o){return i.reduce((a,c)=>Math.max(c==null?void 0:c.getSize()[o],a),0)}n.getMaxDim=e;function t(i,o,a){const c=[];for(let u=a*o,d=u+a;u<d;u+=1)i[u]&&c.push(i[u]);return c}n.getNodesInRow=t;function s(i,o,a){const c=[];for(let u=o,d=i.length;u<d;u+=a)i[u]&&c.push(i[u]);return c}n.getNodesInColumn=s;function r(i,o){return i.reduce((a,c,u)=>(a.push(a[u]+c),a),[o||0])}n.accumulate=r})(Tn||(Tn={}));const f3=`.x6-widget-dnd {
504
504
  position: absolute;
505
505
  top: -10000px;
506
506
  left: -10000px;
@@ -735,4 +735,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
735
735
  font-size: 12px;
736
736
  background: 0 0;
737
737
  }
738
- `;var Fj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class li extends ye{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(e={}){super(),this.name="stencil",zr(this.name,zj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},li.defaultOptions),e),this.init()}init(){this.dnd=new ks(this.options),this.onSearch=op(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(e,t){return Array.isArray(e)?this.loadGroup(e,t):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s)}),this}unload(e,t){return Array.isArray(e)?this.loadGroup(e,t,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s,!0)}),this}toggleGroup(e){return this.isGroupCollapsed(e)?this.expandGroup(e):this.collapseGroup(e),this}collapseGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&!this.isGroupCollapsed(e)&&(this.trigger("group:collapse",{name:e}),K(t,"collapsed"))}return this}expandGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&this.isGroupCollapsed(e)&&(this.trigger("group:expand",{name:e}),De(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return On(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&On(t,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(e=>this.collapseGroup(e)),this}expandGroups(){return Object.keys(this.groups).forEach(e=>this.expandGroup(e)),this}resizeGroup(e,t){const s=this.graphs[e];return s&&s.resize(t.width,t.height),this}addGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups?this.options.groups.push(...t):this.options.groups=t,t.forEach(s=>this.initGroup(s))}removeGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!t.includes(s.name)),t.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];Ft(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),K(this.container,this.prefixClassName(Ot.base)),fe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),K(this.content,this.prefixClassName(Ot.content)),ws(this.content,this.container)}initSearch(){this.options.search&&(K(this.container,"searchable"),_t(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");K(s,this.prefixClassName(Ot.group)),fe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&K(s,"collapsable"),un(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");K(r,this.prefixClassName(Ot.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");K(i,this.prefixClassName(Ot.groupContent));const o=e.graphOptions,a=new $(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new Qe,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),_t(i,a.container),_t(s,[r,i]),ws(s,this.content),this.groups[e.name]=s,this.graphs[e.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(e=>{this.initGroup(e)});else{const e=this.options.stencilGraphOptions||{},t=new $(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new Qe,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));_t(this.content,t.container),this.graphs[yo.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(K(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?K(this.container,"collapsed"):De(this.container,"collapsed")):De(this.container,"collapsable")}setTitle(){const e=document.createElement("div");K(e,this.prefixClassName(Ot.title)),e.innerHTML=this.options.title,ws(e,this.container)}renderSearch(){const e=document.createElement("div");K(e,this.prefixClassName(Ot.search));const t=document.createElement("input");return fe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),K(t,this.prefixClassName(Ot.searchText)),_t(e,t),e}startListening(){const e=this.prefixClassName(Ot.title),t=this.prefixClassName(Ot.searchText),s=this.prefixClassName(Ot.groupTitle);this.delegateEvents({[`click .${e}`]:"onTitleClick",[`touchstart .${e}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${t}`]:"onSearch",[`focusin .${t}`]:"onSearchFocusIn",[`focusout .${t}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(e){e.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(e){e.off("cell:mousedown",this.onDragStart,this)}loadGroup(e,t,s){const r=this.getModel(t);if(r){const c=e.map(u=>Ue.isNode(u)?u:Ue.create(u));s===!0?r.removeCells(c):r.resetCells(c)}const i=this.getGroup(t);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&Q(a,this,r,i),!o){const c=this.getGraph(t);c.fitToContent({minWidth:c.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(e){const{e:t,node:s}=e,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,t)}filter(e,t){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===yo.defaultGroupName?null:i,c=o.model.getNodes().filter(f=>{let p=!1;typeof t=="function"?p=Q(t,this,f,e,a,this):typeof t=="boolean"?p=t:p=this.isCellMatched(f,e,t,e.toLowerCase()!==e);const g=o.renderer.findViewByCell(f);return g&&un(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,h=new Qe;return h.resetCells(c),d.layout&&Q(d.layout,this,h,this.getGroup(i)),this.groups[i]&&un(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);un(this.container,"not-found",!s)}isCellMatched(e,t,s,r){return t&&s?Object.keys(s).some(i=>{if(i==="*"||e.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(c=>{let u=e.getPropByPath(c);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(t)>=0):!1})}return!1}):!0}onSearch(e){this.filter(e.target.value,this.options.search)}onSearchFocusIn(){K(this.container,"is-focused")}onSearchFocusOut(){De(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(un(this.container,"collapsed"),On(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Ot.group)}`);t&&this.toggleGroup(fe(t,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||On(o,"collapsed")});un(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||yo.defaultGroupName]}getGroup(e){const t=this.options.groups;return e!=null&&t&&t.length?t.find(s=>s.name===e):null}getGroupByNode(e){const t=this.options.groups;return t?t.find(s=>{const r=this.getModel(s.name);return r?r.has(e.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(e=>{const t=this.graphs[e];this.unregisterGraphEvents(t),t.dispose()}),Object.keys(this.groups).forEach(e=>{const t=this.groups[e];Ft(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Fr(this.name)}}Fj([ye.dispose()],li.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(e,t){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};$j(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},ks.defaults)}(li||(li={}));var Ot;(function(n){n.base="widget-stencil",n.title=`${n.base}-title`,n.search=`${n.base}-search`,n.searchText=`${n.search}-text`,n.content=`${n.base}-content`,n.group=`${n.base}-group`,n.groupTitle=`${n.group}-title`,n.groupContent=`${n.group}-content`})(Ot||(Ot={}));var yo;(function(n){n.defaultGroupName="__default__"})(yo||(yo={})),$.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},$.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},$.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},$.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},$.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},$.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var Uj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class n0 extends Te{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{Js.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{Js.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{Js.downloadDataUri(Js.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=se.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=t.preserveDimensions;if(c){const h=typeof c=="boolean"?a:c;r.attr({width:h.width,height:h.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),t.copyStyles!==!1){const h=s.ownerDocument,f=Array.from(s.querySelectorAll("*")),p=Array.from(i.querySelectorAll("*")),g=h.styleSheets.length,m=[];for(let w=g-1;w>=0;w-=1)m[w]=h.styleSheets[w],h.styleSheets[w].disabled=!0;const y={};f.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S={};Object.keys(v).forEach(E=>{S[E]=v.getPropertyValue(E)}),y[x]=S}),g!==h.styleSheets.length&&m.forEach((w,x)=>{h.styleSheets[x]=w});for(let w=0;w<g;w+=1)h.styleSheets[w].disabled=!1;const b={};f.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S=y[x],E={};Object.keys(v).forEach(C=>{!Mc(C)&&v.getPropertyValue(C)!==S[C]&&(E[C]=v.getPropertyValue(C))}),b[x]=E}),p.forEach((w,x)=>{Je(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const h=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(se.create("style",{type:"text/css"},[h]))}const d=()=>{const h=t.beforeSerialize;if(typeof h=="function"){const p=Q(h,this.graph,i);p instanceof SVGSVGElement&&(i=p)}const f=new XMLSerializer().serializeToString(i).replace(/&nbsp;/g," ");this.notify("after:export",t),e(f)};if(t.serializeImages){const h=r.find("image").map(f=>new Promise(p=>{const g=f.attr("xlink:href")||f.attr("href");Js.imageToDataUri(g,(m,y)=>{!m&&y&&f.attr("xlink:href",y),p()})}));Promise.all(h).then(d)}else d()}toDataURL(e,t){let s=t.viewBox||this.graph.getContentBBox();const r=ms(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const i=new U(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const d=s.width+r.left+r.right,h=s.height+r.top+r.bottom;i.scale(d/t.width,h/t.height)}s=U.create(s).moveAndExpand(i);const o=typeof t.width=="number"&&typeof t.height=="number"?{width:t.width,height:t.height}:s;let a=t.ratio?parseFloat(t.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const c={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const d=document.createElement("canvas"),h=d.getContext("2d");d.width=c.width,d.height=c.height;const f=c.width-1,p=c.height-1;h.fillStyle="rgb(1,1,1)",h.fillRect(f,p,1,1);const g=h.getImageData(f,p,1,1).data;if(g[0]!==1||g[1]!==1||g[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=c.width,d.height=c.height;const h=d.getContext("2d");h.fillStyle=t.backgroundColor||"white",h.fillRect(0,0,c.width,c.height);try{h.drawImage(u,0,0,c.width,c.height);const f=d.toDataURL(t.type,t.quality);e(f)}catch{}},this.toSVG(d=>{u.src=`data:image/svg+xml,${encodeURIComponent(d)}`},Object.assign(Object.assign({},t),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},c)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}Uj([Te.dispose()],n0.prototype,"dispose",null);const Hj={class:"control-box"},Gj=En({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref("3"),s=l.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(u=>({id:u.id,attrs:u.attrs,args:{x:Number(u.args.x.replace("%","")),y:Number(u.args.y.replace("%",""))}}))))},i=()=>{const u=Cu;u.attrs.text.text=`${e.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",e.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{qi("#drawing-board",!0)},a=(u,d,h)=>{e.payload.portProp(u,"args/"+d,h+"%"),r()},c=u=>{e.payload.removePort(u),r()};return l.onMounted(()=>{r()}),(u,d)=>{const h=l.resolveComponent("el-button"),f=l.resolveComponent("el-table-column"),p=l.resolveComponent("el-slider"),g=l.resolveComponent("el-icon"),m=l.resolveComponent("el-table"),y=l.resolveComponent("el-collapse-item"),b=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Hj,[l.createVNode(b,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=w=>t.value=w),accordion:""},{default:l.withCtx(()=>[l.createVNode(y,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(h,{type:"primary",onClick:i,size:"small"},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(h,{type:"primary",onClick:o,size:"small"},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(f,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:w})=>[l.createTextVNode(l.toDisplayString(w.attrs.text.text),1)]),_:1}),l.createVNode(f,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.x,"onUpdate:modelValue":x=>w.args.x=x,min:0,max:100,step:1,onInput:x=>a(w.id,"x",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(f,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.y,"onUpdate:modelValue":x=>w.args.y=x,min:0,max:100,step:1,onInput:x=>a(w.id,"y",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(f,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(h,{type:"danger",size:"small",onClick:x=>c(w.id)},{default:l.withCtx(()=>[l.createVNode(g,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Sp))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),bl=[{shape:"rect",width:60,height:5,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:0}},data:{type:"base-shape"}},{shape:"rect",width:60,height:20,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape",label:"母线"}},{shape:"circle",width:40,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape"}},{shape:"ellipse",width:60,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff"}},data:{type:"base-shape"}}],s0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},gd=Object.assign({name:"wiring-diagram-preview"},{__name:"index",props:{id:{type:String,default:""},background:{type:Object,default:()=>({})},grid:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})}},setup(n){const e=n,t=l.ref(),s=()=>{const y=document.getElementById("preview-container");t.value=new $({container:y,autoResize:!0,panning:!0,mousewheel:!0,connecting:{router:"orth",connectionPoint:{name:"anchor"},anchor:"center"},interacting:{nodeMovable:!1,magnetConnectable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1}}),t.value.on("blank:dblclick",()=>{d()})},r=async()=>{let y,b,w;if(e.id){const{background:x,grid:v,data:S}=await Im(e.id);y=x,b=v,w=S}else y=e.background,b={},w=e.data;t.value.drawBackground(y),t.value.drawGrid(b),t.value.fromJSON(w),c()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=()=>{o.value=t.value.getCells().filter(y=>{var b,w;return((b=y==null?void 0:y.data)==null?void 0:b.type)==="text"||((w=y==null?void 0:y.data)==null?void 0:w.type)==="pipe"}),o.value.forEach(y=>{var b,w;(w=(b=y==null?void 0:y.data)==null?void 0:b.fields)!=null&&w.length&&y.data.fields.forEach(x=>{x.field&&a.value.push({id:y==null?void 0:y.id,fields:y==null?void 0:y.data.fields})})}),console.log("所有字段",a.value),d()},u=l.ref(!0),d=async()=>{if(!a.value.length)return;if(!u.value){We.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),u.value=!1;let y=await GD(a.value).catch(()=>{u.value=!0});u.value=!0,y==null||y.forEach(b=>{var x,v;const w=t.value.getCellById(b.id);w.data.type==="text"&&(w.label=h(w.data.content,b.fields)),w.data.type==="pipe"&&(console.log("管道详情",w,(x=b.fields)==null?void 0:x[0].value),f(w,(v=b.fields)==null?void 0:v[0].value))}),i.value=setTimeout(()=>{d()},1e4)},h=(y,b)=>{let w=0;return y.replace(yl,(x,v)=>{const S=b.find(E=>E.index===w);return w++,S?S.value:Qb})},f=(y,b)=>{if(!y.data.isCondition)return!1;for(let w=0;w<y.data.condition.length;w++)if(b>y.data.condition[w].min&&b<=y.data.condition[w].max)return y.attr("line2/style/animation",fd(y.data.condition[w].direction)),!1},p=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},g=l.shallowRef(),m=()=>{new ResizeObserver(()=>{p()}).observe(g.value)};return l.onMounted(()=>{s(),r(),setTimeout(()=>{qi("#preview-container",!1),p()},100),m()}),l.onUnmounted(()=>{clearInterval(i.value)}),(y,b)=>(l.openBlock(),l.createElementBlock("div",{id:"preview-container",ref_key:"previewRef",ref:g,onDblclick:p},null,544))}}),Yj={class:"form-container"},Wj={class:"footer"},qj=En({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=n,s=e,r=l.reactive({groupName:"",sort:1,isShow:1}),i=l.reactive({groupName:[{required:!0,message:"请输入分组名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}],isShow:[{required:!0,message:"请选择是否显示",trigger:"change"}]}),o=l.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?za("/cny/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(We.success("保存成功"),s("close",!0)):We.error((d==null?void 0:d.msg)||"保存失败")}):za("/cny/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(We.success("保存成功"),s("close",!0)):We.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},c=()=>{s("close",!1)};return l.onMounted(()=>{var u;(u=t.payload)!=null&&u.id&&(r.id=t.payload.id,r.groupName=t.payload.groupName,r.sort=t.payload.sort,r.isShow=t.payload.isShow)}),(u,d)=>{const h=l.resolveComponent("el-input"),f=l.resolveComponent("el-form-item"),p=l.resolveComponent("el-input-number"),g=l.resolveComponent("el-switch"),m=l.resolveComponent("el-button"),y=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Yj,[l.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(f,{label:"分组名称",prop:"groupName"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:r.groupName,"onUpdate:modelValue":d[0]||(d[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),l.createVNode(f,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:r.sort,"onUpdate:modelValue":d[1]||(d[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(f,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(g,{modelValue:r.isShow,"onUpdate:modelValue":d[2]||(d[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createElementVNode("div",Wj,[l.createVNode(m,{type:"primary",onClick:a},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(m,{onClick:c},{default:l.withCtx(()=>d[4]||(d[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-a2a7ce25"]]),Jj={class:"form-container"},Xj={class:"footer"},Kj=En({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=e,s=n,r=l.shallowRef(null),i=l.reactive({groupId:"",id:"",imageName:"",sort:0,isShow:1,imageUrl:""}),o={imageName:[{required:!0,message:"请输入图片名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}]},a=l.ref(""),c=h=>{if(h.raw.type.indexOf("image")===-1){We.error("请上传图片格式的文件");return}const f=new FormData;f.append("file",h.raw),HD("/cny/file/fileUpload",f).then(p=>{p!=null&&p.isOk?(a.value=gs.defaults.baseURL+"/cny/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):We.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(h=>{if(h)za("/cny/custom/savePicture",i).then(f=>{f!=null&&f.isOk?(We.success("保存成功"),t("close",!0)):We.error((f==null?void 0:f.msg)||"保存失败")});else return!1})},d=()=>{t("close",!1)};return l.onMounted(()=>{var h;(h=s.payload)!=null&&h.id&&(i.id=s.payload.id,i.imageName=s.payload.imageName,i.sort=s.payload.sort,i.isShow=s.payload.isShow,i.imageUrl=s.payload.imageUrl,a.value=i.imageUrl),i.groupId=s.payload.groupId}),(h,f)=>{const p=l.resolveComponent("el-input"),g=l.resolveComponent("el-form-item"),m=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-image"),w=l.resolveComponent("el-icon"),x=l.resolveComponent("el-upload"),v=l.resolveComponent("el-button"),S=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Jj,[l.createVNode(S,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(g,{label:"图片名称",prop:"imageName"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:i.imageName,"onUpdate:modelValue":f[0]||(f[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":f[1]||(f[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":f[2]||(f[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"上传",prop:"image"},{default:l.withCtx(()=>[l.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":c,"auto-upload":!1},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(l.openBlock(),l.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:l.withCtx(()=>[l.createVNode(l.unref(lA))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",Xj,[l.createVNode(v,{type:"primary",onClick:u},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(v,{onClick:d},{default:l.withCtx(()=>f[4]||(f[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-c7d87a18"]]),Zj={class:"form-container"},Qj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},e3=["src"],t3=En({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Wi("/cny/custom/groupList").then(f=>{e.items=f.data})},s=l.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=f=>{s.show=!0,s.title="编辑图片分组",s.payload={id:f.id,groupName:f.groupName,sort:f.sort,isShow:f.isShow}},o=f=>{Dm("/cny/custom/removeGroup/"+f).then(p=>{p.code===200?(We.success("删除成功"),t()):We.error(p.msg||"删除失败")})},a=l.reactive({show:!1,title:"新增图片",payload:null}),c=f=>{a.show=!0,a.title="新增图片",a.payload={groupId:f}},u=f=>{a.show=!0,a.title="编辑图片",a.payload={id:f.id,groupId:f.groupId,imageName:f.imageName,sort:f.sort,isShow:f.isShow,imageUrl:f.imageUrl}},d=f=>{Dm("/cny/custom/removePicture/"+f).then(p=>{p.code===200?(We.success("删除成功"),t()):We.error(p.msg||"删除失败")})},h=f=>{s.show=!1,a.show=!1,f&&t()};return l.onMounted(()=>{t()}),(f,p)=>{const g=l.resolveComponent("el-button"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-table"),b=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Zj,[l.createVNode(g,{type:"primary",onClick:r,size:"small"},{default:l.withCtx(()=>p[2]||(p[2]=[l.createTextVNode("新增图片分组")])),_:1}),l.createVNode(y,{data:e.items,border:"",height:"500"},{default:l.withCtx(()=>[l.createVNode(m,{type:"expand"},{default:l.withCtx(w=>[l.createElementVNode("div",Qj,[l.createVNode(g,{type:"primary",size:"small",onClick:x=>c(w.row.id)},{default:l.withCtx(()=>p[3]||(p[3]=[l.createTextVNode("新增图片")])),_:2},1032,["onClick"]),l.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:l.withCtx(()=>[l.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),l.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:l.withCtx(x=>[l.createElementVNode("img",{src:x.row.imageUrl,alt:"",style:{width:"64px",height:"64px"}},null,8,e3)]),_:1}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(x=>[l.createTextVNode(l.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:v=>d(x.row.id)},{default:l.withCtx(()=>p[5]||(p[5]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),l.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(w=>[l.createTextVNode(l.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(g,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:l.withCtx(()=>p[6]||(p[6]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:l.withCtx(()=>p[7]||(p[7]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":p[0]||(p[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[s.show?(l.openBlock(),l.createBlock(qj,{key:0,payload:s.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),l.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":p[1]||(p[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[a.show?(l.openBlock(),l.createBlock(Kj,{key:0,payload:a.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-75a537f2"]]),n3={class:"page-container"},s3={class:"tool-bar"},r3={class:"action"},i3={class:"el-dropdown-link"},o3={class:"action",style:{"margin-right":"50px"}},a3={class:"board"},l3={class:"drawing-board-box"},c3={id:"controls"},u3={key:0,class:"controls-label"},d3={style:{width:"100%",height:"100%",background:"black"}},r0=En(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""}},emits:["getJson"],setup(n,{emit:e}){const t=n,s=l.ref(),r=l.reactive({label:"",component:l.shallowRef(null)}),i=l.ref(null),o=l.ref(null),a=()=>{const k=document.getElementById("drawing-board");s.value=new $({container:k,autoResize:!0,panning:!0,mousewheel:!0,connecting:{snap:!0,allowEdge:!0,highlight:!0,router:"orth",connectionPoint:{name:"anchor"},anchor:"center",createEdge(){return s.value.createEdge({inherit:"edge",...Wn,data:{type:Zb()},zIndex:0})}}}),s.value.use(dj()),s.value.use(hj()),s.value.use(fj()),s.value.use(pj()),s.value.use(mj()),s.value.use(yj()),s.value.bindKey(["delete","backspace"],()=>{bj(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{wj(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{xj(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{vj(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Cj(s.value)});let R=null;s.value.on("edge:click",({cell:V})=>{o.value=V,r.component=t0,r.label="线段属性",i.value=pd()}),s.value.on("edge:mouseenter",({cell:V})=>{clearTimeout(R),V.toFront(),Sj(V)}),s.value.on("edge:mouseleave",({cell:V})=>{R=setTimeout(()=>{V.toBack(),V.removeTools()},300)}),s.value.on("node:mouseenter",()=>{qi("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{qi("#drawing-board",!1)}),s.value.use(new n0),s.value.on("blank:click",({e:V,x:A,y:P})=>{o.value=s,r.component=XD,r.label="画布属性",i.value=pd()}),s.value.on("cell:click",({cell:V})=>{var A,P;if(o.value=V,i.value=pd(),((A=V.data)==null?void 0:A.type)==="text"){r.component=e0,r.label="文本属性";return}if(((P=V.data)==null?void 0:P.type)==="base-shape"){r.component=e0,r.label="基础图形属性";return}if((V==null?void 0:V.shape)==="edge"){r.component=t0,r.label="连线属性";return}if((V==null?void 0:V.shape)==="image"){r.component=Gj,r.label="图片属性";return}r.component=null,r.label=null})},c=l.ref(),u=()=>{c.value=new li({target:s.value,...YD,groups:[{name:"基础组件",graphPadding:30}],search(V,A){var P;return((P=V.label)==null?void 0:P.indexOf(A))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:V=>{const A=V.clone({keepId:!0});return A.label!=="文本"&&(A.label=""),A}});const k=s.value.createNode({...WD}),R=bl.map(V=>(V.ports=s0,s.value.createNode(V)));c.value.load([k,...R],"基础组件"),Wi("/cny/custom/groupList").then(V=>{const A=(V==null?void 0:V.data)||[];A==null||A.forEach(P=>{c.value.addGroup({name:P==null?void 0:P.groupName,graphPadding:30});const j=P==null?void 0:P.pictureList.map(z=>{const Y={shape:"image",imageUrl:z==null?void 0:z.imageUrl,ports:s0,width:64,height:64,label:z.imageName};return s.value.createNode(Y)});c.value.load(j,P==null?void 0:P.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{c.value.container.querySelectorAll(".x6-node").forEach((A,P)=>{if(P>bl.length){const j=A.querySelector("text");A.style.position="relative",j&&(j.style.display="none",j.setAttribute("x","0%"),j.setAttribute("y","40"),j.style.fontSize="12px",j.style.fill="#ffffff")}A.addEventListener("mouseenter",j=>{if(P>bl.length){const z=A.querySelector("text");z&&(z.style.display="block")}}),A.addEventListener("mouseleave",j=>{if(P>bl.length){const z=A.querySelector("text");z&&(z.style.display="none")}})})},200)})},d=k=>{switch(k){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),We.warning("关闭对齐线")):(s.value.enableSnapline(),We.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),We.warning("关闭框选")):(s.value.enableSelection(),We.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},h=l.ref(!1),f=l.ref(null),p=()=>{h.value=!0;const k=new Date;s.value.startBatch(k),s.value.disablePanning(),s.value.once("blank:mousedown",({e:R,x:V,y:A})=>{h.value&&(f.value=s.value.addEdge({source:{x:V,y:A},target:{x:V,y:A},...Wn,data:{type:Zb(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:R,x:V,y:A})=>{h.value&&f.value.setTarget({x:V,y:A})}),s.value.on("blank:mouseup",({e:R,x:V,y:A})=>{h.value=!1,s.value.enablePanning(),s.value.stopBatch(k)})},g=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=l.reactive({show:!1}),y=()=>{m.show=!0},b=l.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(Vm),s.value.drawGrid(Bm),We.success("清空成功")},v=()=>{const k=W().format("YYYYMMDDHHmmss");s.value.exportPNG(k,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},S=e,E=l.reactive({show:!1,background:null,grid:null,data:null}),C=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},M=()=>{S("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},N=async()=>{if(!t.id){s.value.drawBackground(Vm),s.value.drawGrid(Bm),s.value.fromJSON({cells:[]});return}const{background:k,grid:R,data:V}=await Im(t.id);s.value.drawBackground(k),s.value.drawGrid(R),s.value.fromJSON(V),g()},_=l.shallowRef(null),T=()=>{new ResizeObserver(()=>{g()}).observe(_.value)};return l.onMounted(()=>{a(),u(),N(),T()}),(k,R)=>{const V=l.resolveComponent("el-icon"),A=l.resolveComponent("el-button"),P=l.resolveComponent("el-dropdown-item"),j=l.resolveComponent("el-dropdown-menu"),z=l.resolveComponent("el-dropdown"),Y=l.resolveComponent("el-scrollbar"),le=l.resolveComponent("el-dialog"),I=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",n3,[l.createElementVNode("div",s3,[l.createElementVNode("div",r3,[l.createVNode(z,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(P,{command:"snapLine"},{default:l.withCtx(()=>R[4]||(R[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(P,{command:"select"},{default:l.withCtx(()=>R[5]||(R[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(P,{command:"drawLine"},{default:l.withCtx(()=>R[6]||(R[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(P,{command:"adaptive"},{default:l.withCtx(()=>R[7]||(R[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(P,{command:"shortcuts"},{default:l.withCtx(()=>R[8]||(R[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(P,{command:"image"},{default:l.withCtx(()=>R[9]||(R[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(P,{command:"clear"},{default:l.withCtx(()=>R[10]||(R[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(P,{command:"export"},{default:l.withCtx(()=>R[11]||(R[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",i3,[l.createVNode(A,{size:"small",text:""},{default:l.withCtx(()=>[R[3]||(R[3]=l.createTextVNode("工具 ")),l.createVNode(V,null,{default:l.withCtx(()=>[l.createVNode(l.unref(WP))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",o3,[l.createVNode(l.unref(Bg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(A,{size:"small",icon:l.unref(Mp),onClick:C},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Bg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(A,{size:"small",icon:l.unref(nA),onClick:M},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",a3,[R[12]||(R[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",l3,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:_},null,512)]),l.createElementVNode("div",c3,[r.label?(l.openBlock(),l.createElementBlock("div",u3,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(Y,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value},null,8,["graph","payload"]))]),_:1})])]),l.createVNode(le,{modelValue:m.show,"onUpdate:modelValue":R[0]||(R[0]=B=>m.show=B),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(Vj)]),_:1},8,["modelValue"]),l.createVNode(le,{modelValue:b.show,"onUpdate:modelValue":R[1]||(R[1]=B=>b.show=B),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(t3)]),_:1},8,["modelValue"]),l.createVNode(I,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":R[2]||(R[2]=B=>E.show=B),title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",d3,[E.show?(l.openBlock(),l.createBlock(gd,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-1890cc85"]]),h3=[r0,gd],i0=(n,e)=>{h3.forEach(t=>{n.component(t.name,t)})};typeof window<"u"&&window.Vue&&i0(window.Vue);const f3={install:i0};Re.WiringDiagramEditor=r0,Re.WiringDiagramPreview=gd,Re.default=f3,Re.setBaseURL=FD,Re.setToken=UD,Object.defineProperties(Re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
738
+ `;var p3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class di extends be{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(e={}){super(),this.name="stencil",Fr(this.name,f3),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},di.defaultOptions),e),this.init()}init(){this.dnd=new _s(this.options),this.onSearch=mp(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(e,t){return Array.isArray(e)?this.loadGroup(e,t):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s)}),this}unload(e,t){return Array.isArray(e)?this.loadGroup(e,t,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s,!0)}),this}toggleGroup(e){return this.isGroupCollapsed(e)?this.expandGroup(e):this.collapseGroup(e),this}collapseGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&!this.isGroupCollapsed(e)&&(this.trigger("group:collapse",{name:e}),X(t,"collapsed"))}return this}expandGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&this.isGroupCollapsed(e)&&(this.trigger("group:expand",{name:e}),De(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return Pn(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&Pn(t,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(e=>this.collapseGroup(e)),this}expandGroups(){return Object.keys(this.groups).forEach(e=>this.expandGroup(e)),this}resizeGroup(e,t){const s=this.graphs[e];return s&&s.resize(t.width,t.height),this}addGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups?this.options.groups.push(...t):this.options.groups=t,t.forEach(s=>this.initGroup(s))}removeGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!t.includes(s.name)),t.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];Ht(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),X(this.container,this.prefixClassName(Mt.base)),fe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),X(this.content,this.prefixClassName(Mt.content)),ys(this.content,this.container)}initSearch(){this.options.search&&(X(this.container,"searchable"),kt(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");X(s,this.prefixClassName(Mt.group)),fe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&X(s,"collapsable"),hn(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");X(r,this.prefixClassName(Mt.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");X(i,this.prefixClassName(Mt.groupContent));const o=e.graphOptions,a=new $(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new et,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),kt(i,a.container),kt(s,[r,i]),ys(s,this.content),this.groups[e.name]=s,this.graphs[e.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(e=>{this.initGroup(e)});else{const e=this.options.stencilGraphOptions||{},t=new $(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new et,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));kt(this.content,t.container),this.graphs[xo.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(X(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?X(this.container,"collapsed"):De(this.container,"collapsed")):De(this.container,"collapsable")}setTitle(){const e=document.createElement("div");X(e,this.prefixClassName(Mt.title)),e.innerHTML=this.options.title,ys(e,this.container)}renderSearch(){const e=document.createElement("div");X(e,this.prefixClassName(Mt.search));const t=document.createElement("input");return fe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),X(t,this.prefixClassName(Mt.searchText)),kt(e,t),e}startListening(){const e=this.prefixClassName(Mt.title),t=this.prefixClassName(Mt.searchText),s=this.prefixClassName(Mt.groupTitle);this.delegateEvents({[`click .${e}`]:"onTitleClick",[`touchstart .${e}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${t}`]:"onSearch",[`focusin .${t}`]:"onSearchFocusIn",[`focusout .${t}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(e){e.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(e){e.off("cell:mousedown",this.onDragStart,this)}loadGroup(e,t,s){const r=this.getModel(t);if(r){const c=e.map(u=>He.isNode(u)?u:He.create(u));s===!0?r.removeCells(c):r.resetCells(c)}const i=this.getGroup(t);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&ee(a,this,r,i),!o){const c=this.getGraph(t);c.fitToContent({minWidth:c.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(e){const{e:t,node:s}=e,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,t)}filter(e,t){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===xo.defaultGroupName?null:i,c=o.model.getNodes().filter(h=>{let p=!1;typeof t=="function"?p=ee(t,this,h,e,a,this):typeof t=="boolean"?p=t:p=this.isCellMatched(h,e,t,e.toLowerCase()!==e);const g=o.renderer.findViewByCell(h);return g&&hn(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,f=new et;return f.resetCells(c),d.layout&&ee(d.layout,this,f,this.getGroup(i)),this.groups[i]&&hn(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);hn(this.container,"not-found",!s)}isCellMatched(e,t,s,r){return t&&s?Object.keys(s).some(i=>{if(i==="*"||e.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(c=>{let u=e.getPropByPath(c);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(t)>=0):!1})}return!1}):!0}onSearch(e){this.filter(e.target.value,this.options.search)}onSearchFocusIn(){X(this.container,"is-focused")}onSearchFocusOut(){De(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(hn(this.container,"collapsed"),Pn(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Mt.group)}`);t&&this.toggleGroup(fe(t,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||Pn(o,"collapsed")});hn(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||xo.defaultGroupName]}getGroup(e){const t=this.options.groups;return e!=null&&t&&t.length?t.find(s=>s.name===e):null}getGroupByNode(e){const t=this.options.groups;return t?t.find(s=>{const r=this.getModel(s.name);return r?r.has(e.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(e=>{const t=this.graphs[e];this.unregisterGraphEvents(t),t.dispose()}),Object.keys(this.groups).forEach(e=>{const t=this.groups[e];Ht(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Ur(this.name)}}p3([be.dispose()],di.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(e,t){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};h3(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},_s.defaults)}(di||(di={}));var Mt;(function(n){n.base="widget-stencil",n.title=`${n.base}-title`,n.search=`${n.base}-search`,n.searchText=`${n.search}-text`,n.content=`${n.base}-content`,n.group=`${n.base}-group`,n.groupTitle=`${n.group}-title`,n.groupContent=`${n.group}-content`})(Mt||(Mt={}));var xo;(function(n){n.defaultGroupName="__default__"})(xo||(xo={})),$.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},$.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},$.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},$.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},$.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},$.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var g3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class p0 extends Te{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{Ys.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{Ys.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{Ys.downloadDataUri(Ys.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=oe.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=t.preserveDimensions;if(c){const f=typeof c=="boolean"?a:c;r.attr({width:f.width,height:f.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),t.copyStyles!==!1){const f=s.ownerDocument,h=Array.from(s.querySelectorAll("*")),p=Array.from(i.querySelectorAll("*")),g=f.styleSheets.length,m=[];for(let w=g-1;w>=0;w-=1)m[w]=f.styleSheets[w],f.styleSheets[w].disabled=!0;const y={};h.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S={};Object.keys(v).forEach(E=>{S[E]=v.getPropertyValue(E)}),y[x]=S}),g!==f.styleSheets.length&&m.forEach((w,x)=>{f.styleSheets[x]=w});for(let w=0;w<g;w+=1)f.styleSheets[w].disabled=!1;const b={};h.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S=y[x],E={};Object.keys(v).forEach(C=>{!kc(C)&&v.getPropertyValue(C)!==S[C]&&(E[C]=v.getPropertyValue(C))}),b[x]=E}),p.forEach((w,x)=>{Je(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const f=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(oe.create("style",{type:"text/css"},[f]))}const d=()=>{const f=t.beforeSerialize;if(typeof f=="function"){const p=ee(f,this.graph,i);p instanceof SVGSVGElement&&(i=p)}const h=new XMLSerializer().serializeToString(i).replace(/&nbsp;/g," ");this.notify("after:export",t),e(h)};if(t.serializeImages){const f=r.find("image").map(h=>new Promise(p=>{const g=h.attr("xlink:href")||h.attr("href");Ys.imageToDataUri(g,(m,y)=>{!m&&y&&h.attr("xlink:href",y),p()})}));Promise.all(f).then(d)}else d()}toDataURL(e,t){let s=t.viewBox||this.graph.getContentBBox();const r=ps(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const i=new F(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const d=s.width+r.left+r.right,f=s.height+r.top+r.bottom;i.scale(d/t.width,f/t.height)}s=F.create(s).moveAndExpand(i);const o=typeof t.width=="number"&&typeof t.height=="number"?{width:t.width,height:t.height}:s;let a=t.ratio?parseFloat(t.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const c={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const d=document.createElement("canvas"),f=d.getContext("2d");d.width=c.width,d.height=c.height;const h=c.width-1,p=c.height-1;f.fillStyle="rgb(1,1,1)",f.fillRect(h,p,1,1);const g=f.getImageData(h,p,1,1).data;if(g[0]!==1||g[1]!==1||g[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=c.width,d.height=c.height;const f=d.getContext("2d");f.fillStyle=t.backgroundColor||"white",f.fillRect(0,0,c.width,c.height);try{f.drawImage(u,0,0,c.width,c.height);const h=d.toDataURL(t.type,t.quality);e(h)}catch{}},this.toSVG(d=>{u.src=`data:image/svg+xml,${encodeURIComponent(d)}`},Object.assign(Object.assign({},t),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},c)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}g3([Te.dispose()],p0.prototype,"dispose",null);const m3={class:"control-box"},y3=Ut({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref("3"),s=l.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(u=>({id:u.id,attrs:u.attrs,args:{x:Number(u.args.x.replace("%","")),y:Number(u.args.y.replace("%",""))}}))))},i=()=>{const u=_u;u.attrs.text.text=`${e.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",e.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{Ki("#drawing-board",!0)},a=(u,d,f)=>{e.payload.portProp(u,"args/"+d,f+"%"),r()},c=u=>{e.payload.removePort(u),r()};return l.onMounted(()=>{r()}),(u,d)=>{const f=l.resolveComponent("el-button"),h=l.resolveComponent("el-table-column"),p=l.resolveComponent("el-slider"),g=l.resolveComponent("el-icon"),m=l.resolveComponent("el-table"),y=l.resolveComponent("el-collapse-item"),b=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",m3,[l.createVNode(b,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=w=>t.value=w),accordion:""},{default:l.withCtx(()=>[l.createVNode(y,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(f,{type:"primary",onClick:i,size:"small"},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(f,{type:"primary",onClick:o,size:"small"},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(h,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:w})=>[l.createTextVNode(l.toDisplayString(w.attrs.text.text),1)]),_:1}),l.createVNode(h,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.x,"onUpdate:modelValue":x=>w.args.x=x,min:0,max:100,step:1,onInput:x=>a(w.id,"x",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(h,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.y,"onUpdate:modelValue":x=>w.args.y=x,min:0,max:100,step:1,onInput:x=>a(w.id,"y",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(h,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(f,{type:"danger",size:"small",onClick:x=>c(w.id)},{default:l.withCtx(()=>[l.createVNode(g,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Vp))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),El=[{shape:"rect",width:60,height:5,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:0}},data:{type:"base-shape"}},{shape:"rect",width:60,height:20,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape",label:"母线"}},{shape:"circle",width:40,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape"}},{shape:"ellipse",width:60,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff"}},data:{type:"base-shape"}}],g0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},Od=Object.assign({name:"wiring-diagram-preview"},{__name:"index",props:{id:{type:String,default:""},background:{type:Object,default:()=>({})},grid:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})}},setup(n){const e=n,t=l.ref(),s=()=>{const b=document.getElementById("preview-container");t.value=new $({container:b,autoResize:!0,panning:!0,mousewheel:!0,connecting:{router:"orth",connectionPoint:{name:"anchor"},anchor:"center"},interacting:{nodeMovable:!1,magnetConnectable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1}}),t.value.on("blank:dblclick",()=>{d()})},r=async()=>{let b,w,x;if(e.id){const{background:v,grid:S,data:E}=await Hm(e.id);b=v,w=S,x=E}else b=e.background,w={},x=e.data;t.value.drawBackground(b),t.value.drawGrid(w),t.value.fromJSON(x),c()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=()=>{o.value=t.value.getCells().filter(b=>{var w,x,v;return((w=b==null?void 0:b.data)==null?void 0:w.type)==="text"||((x=b==null?void 0:b.data)==null?void 0:x.type)==="pipe"||((v=b==null?void 0:b.data)==null?void 0:v.type)==="arrow"}),o.value.forEach(b=>{var w,x;(x=(w=b==null?void 0:b.data)==null?void 0:w.fields)!=null&&x.length&&(b==null||b.data.fields.forEach(v=>{v.field&&a.value.push({id:b==null?void 0:b.id,fields:b==null?void 0:b.data.fields})}))}),console.log("所有字段",a.value),d()},u=l.ref(!0),d=async()=>{if(!a.value.length)return;if(!u.value){Ye.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),u.value=!1;let b=await sD(a.value).catch(()=>{u.value=!0});u.value=!0,b==null||b.forEach(w=>{var v,S,E;const x=t.value.getCellById(w.id);console.log("122222222",x),x.data.type==="text"&&(x.label=f(x.data.content,w.fields)),x.data.type==="pipe"&&(console.log("管道详情",x,(v=w.fields)==null?void 0:v[0].value),h(x,(S=w.fields)==null?void 0:S[0].value)),x.data.type==="arrow"&&p(x,(E=w.fields)==null?void 0:E[0].value)}),i.value=setTimeout(()=>{d()},1e4)},f=(b,w)=>{let x=0;return b.replace(Sl,()=>{const v=w.find(S=>S.index===x);return x++,v?v.value:u0})},h=(b,w)=>{if(!b.data.isCondition)return!1;for(let x=0;x<b.data.condition.length;x++)if(Number(w)>b.data.condition[x].min&&Number(w)<=b.data.condition[x].max)return b.attr("line2/style/animation",c0(b.data.condition[x].direction)),!1},p=(b,w)=>{if(console.log(b,w),!b.data.isCondition)return!1;for(let x=0;x<b.data.condition.length;x++)if(Number(w)>b.data.condition[x].min&&Number(w)<=b.data.condition[x].max)return b.attr("arrow/style/animation",b.data.condition[x].animation===nr?"flashing 2s infinite linear":""),b.attr("arrow/d",b.data.condition[x].direction===ui?Ga:Jm),b.attr("arrow/display",b.data.condition[x].display),!1},g=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},m=l.shallowRef(),y=()=>{new ResizeObserver(()=>{g()}).observe(m.value)};return l.onMounted(()=>{s(),r(),setTimeout(()=>{Ki("#preview-container",!1),g()},100),y()}),l.onUnmounted(()=>{clearInterval(i.value)}),(b,w)=>(l.openBlock(),l.createElementBlock("div",{id:"preview-container",ref_key:"previewRef",ref:m,onDblclick:g},null,544))}}),b3={class:"form-container"},w3={class:"footer"},x3=Ut({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=n,s=e,r=l.reactive({groupName:"",sort:1,isShow:1}),i=l.reactive({groupName:[{required:!0,message:"请输入分组名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}],isShow:[{required:!0,message:"请选择是否显示",trigger:"change"}]}),o=l.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?Ha("/cny/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(Ye.success("保存成功"),s("close",!0)):Ye.error((d==null?void 0:d.msg)||"保存失败")}):Ha("/cny/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(Ye.success("保存成功"),s("close",!0)):Ye.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},c=()=>{s("close",!1)};return l.onMounted(()=>{var u;(u=t.payload)!=null&&u.id&&(r.id=t.payload.id,r.groupName=t.payload.groupName,r.sort=t.payload.sort,r.isShow=t.payload.isShow)}),(u,d)=>{const f=l.resolveComponent("el-input"),h=l.resolveComponent("el-form-item"),p=l.resolveComponent("el-input-number"),g=l.resolveComponent("el-switch"),m=l.resolveComponent("el-button"),y=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",b3,[l.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(h,{label:"分组名称",prop:"groupName"},{default:l.withCtx(()=>[l.createVNode(f,{modelValue:r.groupName,"onUpdate:modelValue":d[0]||(d[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),l.createVNode(h,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:r.sort,"onUpdate:modelValue":d[1]||(d[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(h,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(g,{modelValue:r.isShow,"onUpdate:modelValue":d[2]||(d[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createElementVNode("div",w3,[l.createVNode(m,{type:"primary",onClick:a},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(m,{onClick:c},{default:l.withCtx(()=>d[4]||(d[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-a2a7ce25"]]),v3={class:"form-container"},C3={class:"footer"},S3=Ut({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=e,s=n,r=l.shallowRef(null),i=l.reactive({groupId:"",id:"",imageName:"",sort:0,isShow:1,imageUrl:""}),o={imageName:[{required:!0,message:"请输入图片名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}]},a=l.ref(""),c=f=>{if(f.raw.type.indexOf("image")===-1){Ye.error("请上传图片格式的文件");return}const h=new FormData;h.append("file",f.raw),nD("/cny/file/fileUpload",h).then(p=>{p!=null&&p.isOk?(a.value=Mn.defaults.baseURL+"/cny/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):Ye.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(f=>{if(f)Ha("/cny/custom/savePicture",i).then(h=>{h!=null&&h.isOk?(Ye.success("保存成功"),t("close",!0)):Ye.error((h==null?void 0:h.msg)||"保存失败")});else return!1})},d=()=>{t("close",!1)};return l.onMounted(()=>{var f;(f=s.payload)!=null&&f.id&&(i.id=s.payload.id,i.imageName=s.payload.imageName,i.sort=s.payload.sort,i.isShow=s.payload.isShow,i.imageUrl=s.payload.imageUrl,a.value=i.imageUrl),i.groupId=s.payload.groupId}),(f,h)=>{const p=l.resolveComponent("el-input"),g=l.resolveComponent("el-form-item"),m=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-image"),w=l.resolveComponent("el-icon"),x=l.resolveComponent("el-upload"),v=l.resolveComponent("el-button"),S=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",v3,[l.createVNode(S,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(g,{label:"图片名称",prop:"imageName"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:i.imageName,"onUpdate:modelValue":h[0]||(h[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":h[1]||(h[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":h[2]||(h[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"上传",prop:"image"},{default:l.withCtx(()=>[l.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":c,"auto-upload":!1},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(l.openBlock(),l.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:l.withCtx(()=>[l.createVNode(l.unref(xN))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",C3,[l.createVNode(v,{type:"primary",onClick:u},{default:l.withCtx(()=>h[3]||(h[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(v,{onClick:d},{default:l.withCtx(()=>h[4]||(h[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-c7d87a18"]]),E3={class:"form-container"},O3={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},M3=["src"],P3=Ut({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Xi("/cny/custom/groupList").then(h=>{e.items=h.data})},s=l.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=h=>{s.show=!0,s.title="编辑图片分组",s.payload={id:h.id,groupName:h.groupName,sort:h.sort,isShow:h.isShow}},o=h=>{Um("/cny/custom/removeGroup/"+h).then(p=>{p.code===200?(Ye.success("删除成功"),t()):Ye.error(p.msg||"删除失败")})},a=l.reactive({show:!1,title:"新增图片",payload:null}),c=h=>{a.show=!0,a.title="新增图片",a.payload={groupId:h}},u=h=>{a.show=!0,a.title="编辑图片",a.payload={id:h.id,groupId:h.groupId,imageName:h.imageName,sort:h.sort,isShow:h.isShow,imageUrl:h.imageUrl}},d=h=>{Um("/cny/custom/removePicture/"+h).then(p=>{p.code===200?(Ye.success("删除成功"),t()):Ye.error(p.msg||"删除失败")})},f=h=>{s.show=!1,a.show=!1,h&&t()};return l.onMounted(()=>{t()}),(h,p)=>{const g=l.resolveComponent("el-button"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-table"),b=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",E3,[l.createVNode(g,{type:"primary",onClick:r,size:"small"},{default:l.withCtx(()=>p[2]||(p[2]=[l.createTextVNode("新增图片分组")])),_:1}),l.createVNode(y,{data:e.items,border:"",height:"500"},{default:l.withCtx(()=>[l.createVNode(m,{type:"expand"},{default:l.withCtx(w=>[l.createElementVNode("div",O3,[l.createVNode(g,{type:"primary",size:"small",onClick:x=>c(w.row.id)},{default:l.withCtx(()=>p[3]||(p[3]=[l.createTextVNode("新增图片")])),_:2},1032,["onClick"]),l.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:l.withCtx(()=>[l.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),l.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:l.withCtx(x=>[l.createElementVNode("img",{src:l.unref(Mn).defaults.baseURL+x.row.imageUrl,alt:"",style:{width:"64px",height:"64px"}},null,8,M3)]),_:1}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(x=>[l.createTextVNode(l.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:v=>d(x.row.id)},{default:l.withCtx(()=>p[5]||(p[5]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),l.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(w=>[l.createTextVNode(l.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(g,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:l.withCtx(()=>p[6]||(p[6]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:l.withCtx(()=>p[7]||(p[7]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":p[0]||(p[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[s.show?(l.openBlock(),l.createBlock(x3,{key:0,payload:s.payload,onClose:f},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),l.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":p[1]||(p[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[a.show?(l.openBlock(),l.createBlock(S3,{key:0,payload:a.payload,onClose:f},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-a6e5644c"]]),N3={class:"page-container"},A3={class:"tool-bar"},_3={class:"action"},T3={class:"el-dropdown-link"},k3={class:"action",style:{"margin-right":"50px"}},V3={class:"board"},D3={class:"drawing-board-box"},R3={id:"controls"},L3={key:0,class:"controls-label"},I3={style:{width:"100%",height:"100%",background:"black"}},m0=Ut(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""}},emits:["getJson"],setup(n,{emit:e}){const t=n,s=l.ref(),r=l.reactive({label:"",component:l.shallowRef(null)}),i=l.ref(null),o=l.ref(null),a=()=>{const V=document.getElementById("drawing-board");s.value=new $({container:V,autoResize:!0,panning:!0,mousewheel:!0,connecting:{snap:!0,allowEdge:!0,highlight:!0,router:"orth",connectionPoint:{name:"anchor"},anchor:"center",createEdge(){return s.value.createEdge({inherit:"edge",...Qe,data:{type:l0()},zIndex:0})}}}),s.value.use(Ej()),s.value.use(Oj()),s.value.use(Mj()),s.value.use(Pj()),s.value.use(Aj()),s.value.use(_j()),s.value.bindKey(["delete","backspace"],()=>{Tj(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{kj(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{Vj(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{Dj(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Rj(s.value)});let R=null;s.value.on("edge:click",({cell:j})=>{o.value=j,r.component=f0,r.label="线段属性",i.value=Ed()}),s.value.on("edge:mouseenter",({cell:j})=>{clearTimeout(R),j.toFront(),Lj(j)}),s.value.on("edge:mouseleave",({cell:j})=>{R=setTimeout(()=>{j.toBack(),j.removeTools()},300)}),s.value.on("node:mouseenter",()=>{Ki("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Ki("#drawing-board",!1)}),s.value.use(new p0),s.value.on("blank:click",({e:j,x:N,y:M})=>{o.value=s,r.component=lD,r.label="画布属性",i.value=Ed()}),s.value.on("cell:click",({cell:j})=>{var N,M;if(o.value=j,i.value=Ed(),((N=j.data)==null?void 0:N.type)==="text"){r.component=d0,r.label="文本属性";return}if(((M=j.data)==null?void 0:M.type)==="base-shape"){r.component=d0,r.label="基础图形属性";return}if((j==null?void 0:j.shape)==="edge"){r.component=f0,r.label="连线属性";return}if((j==null?void 0:j.shape)==="image"){r.component=y3,r.label="图片属性";return}r.component=null,r.label=null})},c=l.ref(),u=()=>{c.value=new di({target:s.value,...rD,groups:[{name:"基础组件",graphPadding:30}],search(j,N){var M;return((M=j.label)==null?void 0:M.indexOf(N))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:j=>{const N=j.clone({keepId:!0});return N.label!=="文本"&&(N.label=""),N}});const V=s.value.createNode({...iD}),R=El.map(j=>(j.ports=g0,s.value.createNode(j)));c.value.load([V,...R],"基础组件"),Xi("/cny/custom/groupList").then(j=>{const N=(j==null?void 0:j.data)||[];N==null||N.forEach(M=>{c.value.addGroup({name:M==null?void 0:M.groupName,graphPadding:30});const D=M==null?void 0:M.pictureList.map(B=>{const G={shape:"image",imageUrl:Mn.defaults.baseURL+(B==null?void 0:B.imageUrl),ports:g0,width:64,height:64,label:B.imageName};return s.value.createNode(G)});c.value.load(D,M==null?void 0:M.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{c.value.container.querySelectorAll(".x6-node").forEach((N,M)=>{if(M>El.length){const D=N.querySelector("text");N.style.position="relative",D&&(D.style.display="none",D.setAttribute("x","0%"),D.setAttribute("y","40"),D.style.fontSize="12px",D.style.fill="#ffffff")}N.addEventListener("mouseenter",D=>{if(M>El.length){const B=N.querySelector("text");B&&(B.style.display="block")}}),N.addEventListener("mouseleave",D=>{if(M>El.length){const B=N.querySelector("text");B&&(B.style.display="none")}})})},200)})},d=V=>{switch(V){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),Ye.warning("关闭对齐线")):(s.value.enableSnapline(),Ye.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),Ye.warning("关闭框选")):(s.value.enableSelection(),Ye.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},f=l.ref(!1),h=l.ref(null),p=()=>{f.value=!0;const V=new Date;s.value.startBatch(V),s.value.disablePanning(),s.value.once("blank:mousedown",({e:R,x:j,y:N})=>{f.value&&(h.value=s.value.addEdge({source:{x:j,y:N},target:{x:j,y:N},...Qe,data:{type:l0(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:R,x:j,y:N})=>{f.value&&h.value.setTarget({x:j,y:N})}),s.value.on("blank:mouseup",({e:R,x:j,y:N})=>{f.value=!1,s.value.enablePanning(),s.value.stopBatch(V)})},g=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=l.reactive({show:!1}),y=()=>{m.show=!0},b=l.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(Gm),s.value.drawGrid(Wm),Ye.success("清空成功")},v=()=>{const V=W().format("YYYYMMDDHHmmss");s.value.exportPNG(V,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},S=e,E=l.reactive({show:!1,background:null,grid:null,data:null}),C=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},P=()=>{S("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},A=async()=>{if(!t.id){s.value.drawBackground(Gm),s.value.drawGrid(Wm),s.value.fromJSON({cells:[]});return}const{background:V,grid:R,data:j}=await Hm(t.id);s.value.drawBackground(V),s.value.drawGrid(R),s.value.fromJSON(j),g()},T=l.shallowRef(null),k=()=>{new ResizeObserver(()=>{g()}).observe(T.value)};return l.onMounted(()=>{a(),u(),A(),k()}),(V,R)=>{const j=l.resolveComponent("el-icon"),N=l.resolveComponent("el-button"),M=l.resolveComponent("el-dropdown-item"),D=l.resolveComponent("el-dropdown-menu"),B=l.resolveComponent("el-dropdown"),G=l.resolveComponent("el-scrollbar"),se=l.resolveComponent("el-dialog"),I=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",N3,[l.createElementVNode("div",A3,[l.createElementVNode("div",_3,[l.createVNode(B,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(D,null,{default:l.withCtx(()=>[l.createVNode(M,{command:"snapLine"},{default:l.withCtx(()=>R[4]||(R[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(M,{command:"select"},{default:l.withCtx(()=>R[5]||(R[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(M,{command:"drawLine"},{default:l.withCtx(()=>R[6]||(R[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(M,{command:"adaptive"},{default:l.withCtx(()=>R[7]||(R[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(M,{command:"shortcuts"},{default:l.withCtx(()=>R[8]||(R[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(M,{command:"image"},{default:l.withCtx(()=>R[9]||(R[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(M,{command:"clear"},{default:l.withCtx(()=>R[10]||(R[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(M,{command:"export"},{default:l.withCtx(()=>R[11]||(R[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",T3,[l.createVNode(N,{size:"small",text:""},{default:l.withCtx(()=>[R[3]||(R[3]=l.createTextVNode("工具 ")),l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(l.unref(iN))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",k3,[l.createVNode(l.unref(qg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(N,{size:"small",icon:l.unref(Lp),onClick:C},null,8,["icon"])]),_:1}),l.createVNode(l.unref(qg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(N,{size:"small",icon:l.unref(pN),onClick:P},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",V3,[R[12]||(R[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",D3,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:T},null,512)]),l.createElementVNode("div",R3,[r.label?(l.openBlock(),l.createElementBlock("div",L3,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(G,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value},null,8,["graph","payload"]))]),_:1})])]),l.createVNode(se,{modelValue:m.show,"onUpdate:modelValue":R[0]||(R[0]=_=>m.show=_),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(c3)]),_:1},8,["modelValue"]),l.createVNode(se,{modelValue:b.show,"onUpdate:modelValue":R[1]||(R[1]=_=>b.show=_),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(P3)]),_:1},8,["modelValue"]),l.createVNode(I,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":R[2]||(R[2]=_=>E.show=_),title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",I3,[E.show?(l.openBlock(),l.createBlock(Od,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-50fba89c"]]),B3=[m0,Od],y0=(n,e)=>{B3.forEach(t=>{n.component(t.name,t)})};typeof window<"u"&&window.Vue&&y0(window.Vue);const j3={install:y0};Re.WiringDiagramEditor=m0,Re.WiringDiagramPreview=Od,Re.default=j3,Re.setBaseURL=eD,Re.setToken=tD,Object.defineProperties(Re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});