vue-wiring-diagram 1.1.26 → 1.1.27

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.
@@ -1,28 +1,28 @@
1
- (function(xe,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(xe=typeof globalThis<"u"?globalThis:xe||self,l(xe["vue-wiring-diagram"]={},xe.Vue))})(this,function(xe,l){"use strict";//! moment.js
1
+ (function(we,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(we=typeof globalThis<"u"?globalThis:we||self,l(we["vue-wiring-diagram"]={},we.Vue))})(this,function(we,l){"use strict";//! moment.js
2
2
  //! version : 2.30.1
3
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
4
  //! license : MIT
5
5
  //! momentjs.com
6
- var kd;function X(){return kd.apply(null,arguments)}function S0(n){kd=n}function en(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Bs(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function ve(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function kl(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;for(e in n)if(ve(n,e))return!1;return!0}function St(n){return n===void 0}function In(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function vi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Vd(n,e){var t=[],s,r=n.length;for(s=0;s<r;++s)t.push(e(n[s],s));return t}function os(n,e){for(var t in e)ve(e,t)&&(n[t]=e[t]);return ve(e,"toString")&&(n.toString=e.toString),ve(e,"valueOf")&&(n.valueOf=e.valueOf),n}function Cn(n,e,t,s){return oh(n,e,t,s,!0).utc()}function E0(){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 he(n){return n._pf==null&&(n._pf=E0()),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 Dl(n){var e=null,t=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(e=he(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 No(n){var e=Cn(NaN);return n!=null?os(he(e),n):he(e).userInvalidated=!0,e}var Dd=X.momentProperties=[],Rl=!1;function Il(n,e){var t,s,r,i=Dd.length;if(St(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),St(e._i)||(n._i=e._i),St(e._f)||(n._f=e._f),St(e._l)||(n._l=e._l),St(e._strict)||(n._strict=e._strict),St(e._tzm)||(n._tzm=e._tzm),St(e._isUTC)||(n._isUTC=e._isUTC),St(e._offset)||(n._offset=e._offset),St(e._pf)||(n._pf=he(e)),St(e._locale)||(n._locale=e._locale),i>0)for(t=0;t<i;t++)s=Dd[t],r=e[s],St(r)||(n[s]=r);return n}function Ci(n){Il(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Rl===!1&&(Rl=!0,X.updateOffset(this),Rl=!1)}function tn(n){return n instanceof Ci||n!=null&&n._isAMomentObject!=null}function Rd(n){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function jt(n,e){var t=!0;return os(function(){if(X.deprecationHandler!=null&&X.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])ve(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];s.push(r)}Rd(n+`
6
+ var kd;function J(){return kd.apply(null,arguments)}function S0(n){kd=n}function en(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Bs(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function xe(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Al(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 vt(n){return n===void 0}function In(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function vi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Vd(n,e){var t=[],s,r=n.length;for(s=0;s<r;++s)t.push(e(n[s],s));return t}function as(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 Cn(n,e,t,s){return oh(n,e,t,s,!0).utc()}function E0(){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=E0()),n._pf}var Tl;Array.prototype.some?Tl=Array.prototype.some:Tl=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 kl(n){var e=null,t=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(e=de(n),t=Tl.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 No(n){var e=Cn(NaN);return n!=null?as(de(e),n):de(e).userInvalidated=!0,e}var Dd=J.momentProperties=[],Vl=!1;function Dl(n,e){var t,s,r,i=Dd.length;if(vt(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),vt(e._i)||(n._i=e._i),vt(e._f)||(n._f=e._f),vt(e._l)||(n._l=e._l),vt(e._strict)||(n._strict=e._strict),vt(e._tzm)||(n._tzm=e._tzm),vt(e._isUTC)||(n._isUTC=e._isUTC),vt(e._offset)||(n._offset=e._offset),vt(e._pf)||(n._pf=de(e)),vt(e._locale)||(n._locale=e._locale),i>0)for(t=0;t<i;t++)s=Dd[t],r=e[s],vt(r)||(n[s]=r);return n}function Ci(n){Dl(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Vl===!1&&(Vl=!0,J.updateOffset(this),Vl=!1)}function tn(n){return n instanceof Ci||n!=null&&n._isAMomentObject!=null}function Rd(n){J.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function Bt(n,e){var t=!0;return as(function(){if(J.deprecationHandler!=null&&J.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)}Rd(n+`
8
8
  Arguments: `+Array.prototype.slice.call(s).join("")+`
9
- `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var Id={};function Ld(n,e){X.deprecationHandler!=null&&X.deprecationHandler(n,e),Id[n]||(Rd(e),Id[n]=!0)}X.suppressDeprecationWarnings=!1,X.deprecationHandler=null;function Sn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function O0(n){var e,t;for(t in n)ve(n,t)&&(e=n[t],Sn(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 Ll(n,e){var t=os({},n),s;for(s in e)ve(e,s)&&(Bs(n[s])&&Bs(e[s])?(t[s]={},os(t[s],n[s]),os(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in n)ve(n,s)&&!ve(e,s)&&Bs(n[s])&&(t[s]=os({},t[s]));return t}function Bl(n){n!=null&&this.set(n)}var jl;Object.keys?jl=Object.keys:jl=function(n){var e,t=[];for(e in n)ve(n,e)&&t.push(e);return t};var M0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function N0(n,e,t){var s=this._calendar[n]||this._calendar.sameElse;return Sn(s)?s.call(e,t):s}function En(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 $l=/(\[[^\[]*\])|(\\)?([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,Po=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,zl={},pr={};function ae(n,e,t,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(pr[n]=r),e&&(pr[e[0]]=function(){return En(r.apply(this,arguments),e[1],e[2])}),t&&(pr[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 _0(n){var e=n.match($l),t,s;for(t=0,s=e.length;t<s;t++)pr[e[t]]?e[t]=pr[e[t]]:e[t]=P0(e[t]);return function(r){var i="",o;for(o=0;o<s;o++)i+=Sn(e[o])?e[o].call(r,n):e[o];return i}}function _o(n,e){return n.isValid()?(e=Bd(e,n.localeData()),zl[e]=zl[e]||_0(e),zl[e](n)):n.localeData().invalidDate()}function Bd(n,e){var t=5;function s(r){return e.longDateFormat(r)||r}for(Po.lastIndex=0;t>=0&&Po.test(n);)n=n.replace(Po,s),Po.lastIndex=0,t-=1;return n}var A0={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 T0(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match($l).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var k0="Invalid date";function V0(){return this._invalidDate}var D0="%d",R0=/\d{1,2}/;function I0(n){return this._ordinal.replace("%d",n)}var L0={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 B0(n,e,t,s){var r=this._relativeTime[t];return Sn(r)?r(n,e,t,s):r.replace(/%d/i,n)}function j0(n,e){var t=this._relativeTime[n>0?"future":"past"];return Sn(t)?t(e):t.replace(/%s/i,e)}var jd={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 $t(n){return typeof n=="string"?jd[n]||jd[n.toLowerCase()]:void 0}function Fl(n){var e={},t,s;for(s in n)ve(n,s)&&(t=$t(s),t&&(e[t]=n[s]));return e}var $0={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 z0(n){var e=[],t;for(t in n)ve(n,t)&&e.push({unit:t,priority:$0[t]});return e.sort(function(s,r){return s.priority-r.priority}),e}var $d=/\d/,kt=/\d\d/,zd=/\d{3}/,Ul=/\d{4}/,Ao=/[+-]?\d{6}/,_e=/\d\d?/,Fd=/\d\d\d\d?/,Ud=/\d\d\d\d\d\d?/,To=/\d{1,3}/,Hl=/\d{1,4}/,ko=/[+-]?\d{1,6}/,gr=/\d+/,Vo=/[+-]?\d+/,F0=/Z|[+-]\d\d:?\d\d/gi,Do=/Z|[+-]\d\d(?::?\d\d)?/gi,U0=/[+-]?\d+(\.\d{1,3})?/,Si=/[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,mr=/^[1-9]\d?/,Gl=/^([1-9]\d|\d)/,Ro;Ro={};function te(n,e,t){Ro[n]=Sn(e)?e:function(s,r){return s&&t?t:e}}function H0(n,e){return ve(Ro,n)?Ro[n](e._strict,e._locale):new RegExp(G0(n))}function G0(n){return Ln(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,r,i){return t||s||r||i}))}function Ln(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function zt(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=zt(e)),t}var Wl={};function Me(n,e){var t,s=e,r;for(typeof n=="string"&&(n=[n]),In(e)&&(s=function(i,o){o[e]=me(i)}),r=n.length,t=0;t<r;t++)Wl[n[t]]=s}function Ei(n,e){Me(n,function(t,s,r,i){r._w=r._w||{},e(t,r._w,r,i)})}function W0(n,e,t){e!=null&&ve(Wl,n)&&Wl[n](e,t._a,t,n)}function Io(n){return n%4===0&&n%100!==0||n%400===0}var ft=0,Bn=1,On=2,et=3,nn=4,jn=5,js=6,Y0=7,q0=8;ae("Y",0,0,function(){var n=this.year();return n<=9999?En(n,4):"+"+n}),ae(0,["YY",2],0,function(){return this.year()%100}),ae(0,["YYYY",4],0,"year"),ae(0,["YYYYY",5],0,"year"),ae(0,["YYYYYY",6,!0],0,"year"),te("Y",Vo),te("YY",_e,kt),te("YYYY",Hl,Ul),te("YYYYY",ko,Ao),te("YYYYYY",ko,Ao),Me(["YYYYY","YYYYYY"],ft),Me("YYYY",function(n,e){e[ft]=n.length===2?X.parseTwoDigitYear(n):me(n)}),Me("YY",function(n,e){e[ft]=X.parseTwoDigitYear(n)}),Me("Y",function(n,e){e[ft]=parseInt(n,10)});function Oi(n){return Io(n)?366:365}X.parseTwoDigitYear=function(n){return me(n)+(me(n)>68?1900:2e3)};var Hd=yr("FullYear",!0);function X0(){return Io(this.year())}function yr(n,e){return function(t){return t!=null?(Gd(this,n,t),X.updateOffset(this,e),this):Mi(this,n)}}function Mi(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 Gd(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&&!Io(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function J0(n){return n=$t(n),Sn(this[n])?this[n]():this}function K0(n,e){if(typeof n=="object"){n=Fl(n);var t=z0(n),s,r=t.length;for(s=0;s<r;s++)this[t[s].unit](n[t[s].unit])}else if(n=$t(n),Sn(this[n]))return this[n](e);return this}function Z0(n,e){return(n%e+e)%e}var Ue;Array.prototype.indexOf?Ue=Array.prototype.indexOf:Ue=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function Yl(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=Z0(e,12);return n+=(e-t)/12,t===1?Io(n)?29:28:31-t%7%2}ae("M",["MM",2],"Mo",function(){return this.month()+1}),ae("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),ae("MMMM",0,0,function(n){return this.localeData().months(this,n)}),te("M",_e,mr),te("MM",_e,kt),te("MMM",function(n,e){return e.monthsShortRegex(n)}),te("MMMM",function(n,e){return e.monthsRegex(n)}),Me(["M","MM"],function(n,e){e[Bn]=me(n)-1}),Me(["MMM","MMMM"],function(n,e,t,s){var r=t._locale.monthsParse(n,s,t._strict);r!=null?e[Bn]=r:he(t).invalidMonth=n});var Q0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Wd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ew=Si,tw=Si;function nw(n,e){return n?en(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Yd).test(e)?"format":"standalone"][n.month()]:en(this._months)?this._months:this._months.standalone}function sw(n,e){return n?en(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Yd.test(e)?"format":"standalone"][n.month()]:en(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function rw(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=Cn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return t?e==="MMM"?(r=Ue.call(this._shortMonthsParse,o),r!==-1?r:null):(r=Ue.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=Ue.call(this._shortMonthsParse,o),r!==-1?r:(r=Ue.call(this._longMonthsParse,o),r!==-1?r:null)):(r=Ue.call(this._longMonthsParse,o),r!==-1?r:(r=Ue.call(this._shortMonthsParse,o),r!==-1?r:null))}function iw(n,e,t){var s,r,i;if(this._monthsParseExact)return rw.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=Cn([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 qd(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),!In(e))return n}var t=e,s=n.date();return s=s<29?s:Math.min(s,Yl(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,s):n._d.setMonth(t,s),n}function Xd(n){return n!=null?(qd(this,n),X.updateOffset(this,!0),this):Mi(this,"Month")}function ow(){return Yl(this.year(),this.month())}function aw(n){return this._monthsParseExact?(ve(this,"_monthsRegex")||Jd.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(ve(this,"_monthsShortRegex")||(this._monthsShortRegex=ew),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function lw(n){return this._monthsParseExact?(ve(this,"_monthsRegex")||Jd.call(this),n?this._monthsStrictRegex:this._monthsRegex):(ve(this,"_monthsRegex")||(this._monthsRegex=tw),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Jd(){function n(c,u){return u.length-c.length}var e=[],t=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=Cn([2e3,r]),o=Ln(this.monthsShort(i,"")),a=Ln(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 cw(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 Ni(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 Lo(n,e,t){var s=7+e-t,r=(7+Ni(n,0,s).getUTCDay()-e)%7;return-r+s-1}function Kd(n,e,t,s,r){var i=(7+t-s)%7,o=Lo(n,s,r),a=1+7*(e-1)+i+o,c,u;return a<=0?(c=n-1,u=Oi(c)+a):a>Oi(n)?(c=n+1,u=a-Oi(n)):(c=n,u=a),{year:c,dayOfYear:u}}function Pi(n,e,t){var s=Lo(n.year(),e,t),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+$n(o,e,t)):r>$n(n.year(),e,t)?(i=r-$n(n.year(),e,t),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function $n(n,e,t){var s=Lo(n,e,t),r=Lo(n+1,e,t);return(Oi(n)-s+r)/7}ae("w",["ww",2],"wo","week"),ae("W",["WW",2],"Wo","isoWeek"),te("w",_e,mr),te("ww",_e,kt),te("W",_e,mr),te("WW",_e,kt),Ei(["w","ww","W","WW"],function(n,e,t,s){e[s.substr(0,1)]=me(n)});function uw(n){return Pi(n,this._week.dow,this._week.doy).week}var dw={dow:0,doy:6};function hw(){return this._week.dow}function fw(){return this._week.doy}function pw(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function gw(n){var e=Pi(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}ae("d",0,"do","day"),ae("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),ae("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),ae("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),ae("e",0,0,"weekday"),ae("E",0,0,"isoWeekday"),te("d",_e),te("e",_e),te("E",_e),te("dd",function(n,e){return e.weekdaysMinRegex(n)}),te("ddd",function(n,e){return e.weekdaysShortRegex(n)}),te("dddd",function(n,e){return e.weekdaysRegex(n)}),Ei(["dd","ddd","dddd"],function(n,e,t,s){var r=t._locale.weekdaysParse(n,s,t._strict);r!=null?e.d=r:he(t).invalidWeekday=n}),Ei(["d","e","E"],function(n,e,t,s){e[s]=me(n)});function mw(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function yw(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function ql(n,e){return n.slice(e,7).concat(n.slice(0,e))}var bw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ww="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xw=Si,vw=Si,Cw=Si;function Sw(n,e){var t=en(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?ql(t,this._week.dow):n?t[n.day()]:t}function Ew(n){return n===!0?ql(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function Ow(n){return n===!0?ql(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function Mw(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=Cn([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=Ue.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=Ue.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=Ue.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=Ue.call(this._weekdaysParse,o),r!==-1||(r=Ue.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=Ue.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=Ue.call(this._shortWeekdaysParse,o),r!==-1||(r=Ue.call(this._weekdaysParse,o),r!==-1)?r:(r=Ue.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=Ue.call(this._minWeekdaysParse,o),r!==-1||(r=Ue.call(this._weekdaysParse,o),r!==-1)?r:(r=Ue.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function Nw(n,e,t){var s,r,i;if(this._weekdaysParseExact)return Mw.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=Cn([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=Mi(this,"Day");return n!=null?(n=mw(n,this.localeData()),this.add(n-e,"d")):e}function _w(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 Aw(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=yw(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Tw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Xl.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(ve(this,"_weekdaysRegex")||(this._weekdaysRegex=xw),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function kw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Xl.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ve(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=vw),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Vw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Xl.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ve(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Cw),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xl(){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=Cn([2e3,1]).day(i),a=Ln(this.weekdaysMin(o,"")),c=Ln(this.weekdaysShort(o,"")),u=Ln(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 Jl(){return this.hours()%12||12}function Dw(){return this.hours()||24}ae("H",["HH",2],0,"hour"),ae("h",["hh",2],0,Jl),ae("k",["kk",2],0,Dw),ae("hmm",0,0,function(){return""+Jl.apply(this)+En(this.minutes(),2)}),ae("hmmss",0,0,function(){return""+Jl.apply(this)+En(this.minutes(),2)+En(this.seconds(),2)}),ae("Hmm",0,0,function(){return""+this.hours()+En(this.minutes(),2)}),ae("Hmmss",0,0,function(){return""+this.hours()+En(this.minutes(),2)+En(this.seconds(),2)});function Qd(n,e){ae(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Qd("a",!0),Qd("A",!1);function eh(n,e){return e._meridiemParse}te("a",eh),te("A",eh),te("H",_e,Gl),te("h",_e,mr),te("k",_e,mr),te("HH",_e,kt),te("hh",_e,kt),te("kk",_e,kt),te("hmm",Fd),te("hmmss",Ud),te("Hmm",Fd),te("Hmmss",Ud),Me(["H","HH"],et),Me(["k","kk"],function(n,e,t){var s=me(n);e[et]=s===24?0:s}),Me(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n}),Me(["h","hh"],function(n,e,t){e[et]=me(n),he(t).bigHour=!0}),Me("hmm",function(n,e,t){var s=n.length-2;e[et]=me(n.substr(0,s)),e[nn]=me(n.substr(s)),he(t).bigHour=!0}),Me("hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[et]=me(n.substr(0,s)),e[nn]=me(n.substr(s,2)),e[jn]=me(n.substr(r)),he(t).bigHour=!0}),Me("Hmm",function(n,e,t){var s=n.length-2;e[et]=me(n.substr(0,s)),e[nn]=me(n.substr(s))}),Me("Hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[et]=me(n.substr(0,s)),e[nn]=me(n.substr(s,2)),e[jn]=me(n.substr(r))});function Rw(n){return(n+"").toLowerCase().charAt(0)==="p"}var Iw=/[ap]\.?m?\.?/i,Lw=yr("Hours",!0);function Bw(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var th={calendar:M0,longDateFormat:A0,invalidDate:k0,ordinal:D0,dayOfMonthOrdinalParse:R0,relativeTime:L0,months:Q0,monthsShort:Wd,week:dw,weekdays:bw,weekdaysMin:ww,weekdaysShort:Zd,meridiemParse:Iw},Ie={},_i={},Ai;function jw(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 nh(n){return n&&n.toLowerCase().replace("_","-")}function $w(n){for(var e=0,t,s,r,i;e<n.length;){for(i=nh(n[e]).split("-"),t=i.length,s=nh(n[e+1]),s=s?s.split("-"):null;t>0;){if(r=Bo(i.slice(0,t).join("-")),r)return r;if(s&&s.length>=t&&jw(i,s)>=t-1)break;t--}e++}return Ai}function zw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function Bo(n){var e=null,t;if(Ie[n]===void 0&&typeof module<"u"&&module&&module.exports&&zw(n))try{e=Ai._abbr,t=require,t("./locale/"+n),as(e)}catch{Ie[n]=null}return Ie[n]}function as(n,e){var t;return n&&(St(e)?t=zn(n):t=Kl(n,e),t?Ai=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Ai._abbr}function Kl(n,e){if(e!==null){var t,s=th;if(e.abbr=n,Ie[n]!=null)Ld("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=Ie[n]._config;else if(e.parentLocale!=null)if(Ie[e.parentLocale]!=null)s=Ie[e.parentLocale]._config;else if(t=Bo(e.parentLocale),t!=null)s=t._config;else return _i[e.parentLocale]||(_i[e.parentLocale]=[]),_i[e.parentLocale].push({name:n,config:e}),null;return Ie[n]=new Bl(Ll(s,e)),_i[n]&&_i[n].forEach(function(r){Kl(r.name,r.config)}),as(n),Ie[n]}else return delete Ie[n],null}function Fw(n,e){if(e!=null){var t,s,r=th;Ie[n]!=null&&Ie[n].parentLocale!=null?Ie[n].set(Ll(Ie[n]._config,e)):(s=Bo(n),s!=null&&(r=s._config),e=Ll(r,e),s==null&&(e.abbr=n),t=new Bl(e),t.parentLocale=Ie[n],Ie[n]=t),as(n)}else Ie[n]!=null&&(Ie[n].parentLocale!=null?(Ie[n]=Ie[n].parentLocale,n===as()&&as(n)):Ie[n]!=null&&delete Ie[n]);return Ie[n]}function zn(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Ai;if(!en(n)){if(e=Bo(n),e)return e;n=[n]}return $w(n)}function Uw(){return jl(Ie)}function Zl(n){var e,t=n._a;return t&&he(n).overflow===-2&&(e=t[Bn]<0||t[Bn]>11?Bn:t[On]<1||t[On]>Yl(t[ft],t[Bn])?On:t[et]<0||t[et]>24||t[et]===24&&(t[nn]!==0||t[jn]!==0||t[js]!==0)?et:t[nn]<0||t[nn]>59?nn:t[jn]<0||t[jn]>59?jn:t[js]<0||t[js]>999?js:-1,he(n)._overflowDayOfYear&&(e<ft||e>On)&&(e=On),he(n)._overflowWeeks&&e===-1&&(e=Y0),he(n)._overflowWeekday&&e===-1&&(e=q0),he(n).overflow=e),n}var Hw=/^\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)?)?$/,Gw=/^\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)?)?$/,Ww=/Z|[+-]\d\d(?::?\d\d)?/,jo=[["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]],Ql=[["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/]],Yw=/^\/?Date\((-?\d+)/i,qw=/^(?:(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}))$/,Xw={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 sh(n){var e,t,s=n._i,r=Hw.exec(s)||Gw.exec(s),i,o,a,c,u=jo.length,d=Ql.length;if(r){for(he(n).iso=!0,e=0,t=u;e<t;e++)if(jo[e][1].exec(r[1])){o=jo[e][0],i=jo[e][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(e=0,t=d;e<t;e++)if(Ql[e][1].exec(r[3])){a=(r[2]||" ")+Ql[e][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(Ww.exec(r[4]))c="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(c||""),tc(n)}else n._isValid=!1}function Jw(n,e,t,s,r,i){var o=[Kw(n),Wd.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Kw(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Zw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Qw(n,e,t){if(n){var s=Zd.indexOf(n),r=new Date(e[0],e[1],e[2]).getDay();if(s!==r)return he(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function ex(n,e,t){if(n)return Xw[n];if(e)return 0;var s=parseInt(t,10),r=s%100,i=(s-r)/100;return i*60+r}function rh(n){var e=qw.exec(Zw(n._i)),t;if(e){if(t=Jw(e[4],e[3],e[2],e[5],e[6],e[7]),!Qw(e[1],t,n))return;n._a=t,n._tzm=ex(e[8],e[9],e[10]),n._d=Ni.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),he(n).rfc2822=!0}else n._isValid=!1}function tx(n){var e=Yw.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(sh(n),n._isValid===!1)delete n._isValid;else return;if(rh(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:X.createFromInputFallback(n)}X.createFromInputFallback=jt("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 br(n,e,t){return n??e??t}function nx(n){var e=new Date(X.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ec(n){var e,t,s=[],r,i,o;if(!n._d){for(r=nx(n),n._w&&n._a[On]==null&&n._a[Bn]==null&&sx(n),n._dayOfYear!=null&&(o=br(n._a[ft],r[ft]),(n._dayOfYear>Oi(o)||n._dayOfYear===0)&&(he(n)._overflowDayOfYear=!0),t=Ni(o,0,n._dayOfYear),n._a[Bn]=t.getUTCMonth(),n._a[On]=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[et]===24&&n._a[nn]===0&&n._a[jn]===0&&n._a[js]===0&&(n._nextDay=!0,n._a[et]=0),n._d=(n._useUTC?Ni:cw).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[et]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(he(n).weekdayMismatch=!0)}}function sx(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=br(e.GG,n._a[ft],Pi(Ae(),1,4).year),s=br(e.W,1),r=br(e.E,1),(r<1||r>7)&&(c=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=Pi(Ae(),i,o),t=br(e.gg,n._a[ft],u.year),s=br(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>$n(t,i,o)?he(n)._overflowWeeks=!0:c!=null?he(n)._overflowWeekday=!0:(a=Kd(t,s,r,i,o),n._a[ft]=a.year,n._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){},X.RFC_2822=function(){};function tc(n){if(n._f===X.ISO_8601){sh(n);return}if(n._f===X.RFC_2822){rh(n);return}n._a=[],he(n).empty=!0;var e=""+n._i,t,s,r,i,o,a=e.length,c=0,u,d;for(r=Bd(n._f,n._locale).match($l)||[],d=r.length,t=0;t<d;t++)i=r[t],s=(e.match(H0(i,n))||[])[0],s&&(o=e.substr(0,e.indexOf(s)),o.length>0&&he(n).unusedInput.push(o),e=e.slice(e.indexOf(s)+s.length),c+=s.length),pr[i]?(s?he(n).empty=!1:he(n).unusedTokens.push(i),W0(i,s,n)):n._strict&&!s&&he(n).unusedTokens.push(i);he(n).charsLeftOver=a-c,e.length>0&&he(n).unusedInput.push(e),n._a[et]<=12&&he(n).bigHour===!0&&n._a[et]>0&&(he(n).bigHour=void 0),he(n).parsedDateParts=n._a.slice(0),he(n).meridiem=n._meridiem,n._a[et]=rx(n._locale,n._a[et],n._meridiem),u=he(n).era,u!==null&&(n._a[ft]=n._locale.erasConvertYear(u,n._a[ft])),ec(n),Zl(n)}function rx(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 ix(n){var e,t,s,r,i,o,a=!1,c=n._f.length;if(c===0){he(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<c;r++)i=0,o=!1,e=Il({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[r],tc(e),Dl(e)&&(o=!0),i+=he(e).charsLeftOver,i+=he(e).unusedTokens.length*10,he(e).score=i,a?i<s&&(s=i,t=e):(s==null||i<s||o)&&(s=i,t=e,o&&(a=!0));os(n,t||e)}function ox(n){if(!n._d){var e=Fl(n._i),t=e.day===void 0?e.date:e.day;n._a=Vd([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),ec(n)}}function ax(n){var e=new Ci(Zl(ih(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ih(n){var e=n._i,t=n._f;return n._locale=n._locale||zn(n._l),e===null||t===void 0&&e===""?No({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),tn(e)?new Ci(Zl(e)):(vi(e)?n._d=e:en(t)?ix(n):t?tc(n):lx(n),Dl(n)||(n._d=null),n))}function lx(n){var e=n._i;St(e)?n._d=new Date(X.now()):vi(e)?n._d=new Date(e.valueOf()):typeof e=="string"?tx(n):en(e)?(n._a=Vd(e.slice(0),function(t){return parseInt(t,10)}),ec(n)):Bs(e)?ox(n):In(e)?n._d=new Date(e):X.createFromInputFallback(n)}function oh(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),(Bs(n)&&kl(n)||en(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,ax(i)}function Ae(n,e,t,s){return oh(n,e,t,s,!1)}var cx=jt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Ae.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:No()}),ux=jt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Ae.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:No()});function ah(n,e){var t,s;if(e.length===1&&en(e[0])&&(e=e[0]),!e.length)return Ae();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][n](t))&&(t=e[s]);return t}function dx(){var n=[].slice.call(arguments,0);return ah("isBefore",n)}function hx(){var n=[].slice.call(arguments,0);return ah("isAfter",n)}var fx=function(){return Date.now?Date.now():+new Date},Ti=["year","quarter","month","week","day","hour","minute","second","millisecond"];function px(n){var e,t=!1,s,r=Ti.length;for(e in n)if(ve(n,e)&&!(Ue.call(Ti,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(s=0;s<r;++s)if(n[Ti[s]]){if(t)return!1;parseFloat(n[Ti[s]])!==me(n[Ti[s]])&&(t=!0)}return!0}function gx(){return this._isValid}function mx(){return sn(NaN)}function $o(n){var e=Fl(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=px(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=zn(),this._bubble()}function zo(n){return n instanceof $o}function nc(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function yx(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 lh(n,e){ae(n,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+En(~~(t/60),2)+e+En(~~t%60,2)})}lh("Z",":"),lh("ZZ",""),te("Z",Do),te("ZZ",Do),Me(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=sc(Do,n)});var bx=/([\+\-]|\d\d)/gi;function sc(n,e){var t=(e||"").match(n),s,r,i;return t===null?null:(s=t[t.length-1]||[],r=(s+"").match(bx)||["-",0,0],i=+(r[1]*60)+me(r[2]),i===0?0:r[0]==="+"?i:-i)}function rc(n,e){var t,s;return e._isUTC?(t=e.clone(),s=(tn(n)||vi(n)?n.valueOf():Ae(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),X.updateOffset(t,!1),t):Ae(n).local()}function ic(n){return-Math.round(n._d.getTimezoneOffset())}X.updateOffset=function(){};function wx(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=sc(Do,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(r=ic(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!e||this._changeInProgress?hh(this,sn(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:ic(this)}function xx(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function vx(n){return this.utcOffset(0,n)}function Cx(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(ic(this),"m")),this}function Sx(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=sc(F0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Ex(n){return this.isValid()?(n=n?Ae(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function Ox(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Mx(){if(!St(this._isDSTShifted))return this._isDSTShifted;var n={},e;return Il(n,this),n=ih(n),n._a?(e=n._isUTC?Cn(n._a):Ae(n._a),this._isDSTShifted=this.isValid()&&yx(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Nx(){return this.isValid()?!this._isUTC:!1}function Px(){return this.isValid()?this._isUTC:!1}function ch(){return this.isValid()?this._isUTC&&this._offset===0:!1}var _x=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ax=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function sn(n,e){var t=n,s=null,r,i,o;return zo(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:In(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(s=_x.exec(n))?(r=s[1]==="-"?-1:1,t={y:0,d:me(s[On])*r,h:me(s[et])*r,m:me(s[nn])*r,s:me(s[jn])*r,ms:me(nc(s[js]*1e3))*r}):(s=Ax.exec(n))?(r=s[1]==="-"?-1:1,t={y:$s(s[2],r),M:$s(s[3],r),w:$s(s[4],r),d:$s(s[5],r),h:$s(s[6],r),m:$s(s[7],r),s:$s(s[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(o=Tx(Ae(t.from),Ae(t.to)),t={},t.ms=o.milliseconds,t.M=o.months),i=new $o(t),zo(n)&&ve(n,"_locale")&&(i._locale=n._locale),zo(n)&&ve(n,"_isValid")&&(i._isValid=n._isValid),i}sn.fn=$o.prototype,sn.invalid=mx;function $s(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function uh(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 Tx(n,e){var t;return n.isValid()&&e.isValid()?(e=rc(e,n),n.isBefore(e)?t=uh(n,e):(t=uh(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function dh(n,e){return function(t,s){var r,i;return s!==null&&!isNaN(+s)&&(Ld(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=sn(t,s),hh(this,r,n),this}}function hh(n,e,t,s){var r=e._milliseconds,i=nc(e._days),o=nc(e._months);n.isValid()&&(s=s??!0,o&&qd(n,Mi(n,"Month")+o*t),i&&Gd(n,"Date",Mi(n,"Date")+i*t),r&&n._d.setTime(n._d.valueOf()+r*t),s&&X.updateOffset(n,i||o))}var kx=dh(1,"add"),Vx=dh(-1,"subtract");function fh(n){return typeof n=="string"||n instanceof String}function Dx(n){return tn(n)||vi(n)||fh(n)||In(n)||Ix(n)||Rx(n)||n===null||n===void 0}function Rx(n){var e=Bs(n)&&!kl(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||ve(n,i);return e&&t}function Ix(n){var e=en(n),t=!1;return e&&(t=n.filter(function(s){return!In(s)&&fh(n)}).length===0),e&&t}function Lx(n){var e=Bs(n)&&!kl(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||ve(n,i);return e&&t}function Bx(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 jx(n,e){arguments.length===1&&(arguments[0]?Dx(arguments[0])?(n=arguments[0],e=void 0):Lx(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||Ae(),s=rc(t,this).startOf("day"),r=X.calendarFormat(this,s)||"sameElse",i=e&&(Sn(e[r])?e[r].call(this,t):e[r]);return this.format(i||this.localeData().calendar(r,this,Ae(t)))}function $x(){return new Ci(this)}function zx(n,e){var t=tn(n)?n:Ae(n);return this.isValid()&&t.isValid()?(e=$t(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function Fx(n,e){var t=tn(n)?n:Ae(n);return this.isValid()&&t.isValid()?(e=$t(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function Ux(n,e,t,s){var r=tn(n)?n:Ae(n),i=tn(e)?e:Ae(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 Hx(n,e){var t=tn(n)?n:Ae(n),s;return this.isValid()&&t.isValid()?(e=$t(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 Gx(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function Wx(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function Yx(n,e,t){var s,r,i;if(!this.isValid())return NaN;if(s=rc(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,e=$t(e),e){case"year":i=Fo(this,s)/12;break;case"month":i=Fo(this,s);break;case"quarter":i=Fo(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:zt(i)}function Fo(n,e){if(n.date()<e.date())return-Fo(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}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function qx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Xx(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?_o(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Sn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",_o(t,"Z")):_o(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jx(){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 Kx(n){n||(n=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=_o(this,n);return this.localeData().postformat(e)}function Zx(n,e){return this.isValid()&&(tn(n)&&n.isValid()||Ae(n).isValid())?sn({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qx(n){return this.from(Ae(),n)}function e1(n,e){return this.isValid()&&(tn(n)&&n.isValid()||Ae(n).isValid())?sn({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function t1(n){return this.to(Ae(),n)}function ph(n){var e;return n===void 0?this._locale._abbr:(e=zn(n),e!=null&&(this._locale=e),this)}var gh=jt("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 mh(){return this._locale}var Uo=1e3,wr=60*Uo,Ho=60*wr,yh=(365*400+97)*24*Ho;function xr(n,e){return(n%e+e)%e}function bh(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-yh:new Date(n,e,t).valueOf()}function wh(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-yh:Date.UTC(n,e,t)}function n1(n){var e,t;if(n=$t(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wh:bh,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-=xr(e+(this._isUTC?0:this.utcOffset()*wr),Ho);break;case"minute":e=this._d.valueOf(),e-=xr(e,wr);break;case"second":e=this._d.valueOf(),e-=xr(e,Uo);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function s1(n){var e,t;if(n=$t(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wh:bh,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+=Ho-xr(e+(this._isUTC?0:this.utcOffset()*wr),Ho)-1;break;case"minute":e=this._d.valueOf(),e+=wr-xr(e,wr)-1;break;case"second":e=this._d.valueOf(),e+=Uo-xr(e,Uo)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function r1(){return this._d.valueOf()-(this._offset||0)*6e4}function i1(){return Math.floor(this.valueOf()/1e3)}function o1(){return new Date(this.valueOf())}function a1(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function l1(){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 c1(){return this.isValid()?this.toISOString():null}function u1(){return Dl(this)}function d1(){return os({},he(this))}function h1(){return he(this).overflow}function f1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ae("N",0,0,"eraAbbr"),ae("NN",0,0,"eraAbbr"),ae("NNN",0,0,"eraAbbr"),ae("NNNN",0,0,"eraName"),ae("NNNNN",0,0,"eraNarrow"),ae("y",["y",1],"yo","eraYear"),ae("y",["yy",2],0,"eraYear"),ae("y",["yyy",3],0,"eraYear"),ae("y",["yyyy",4],0,"eraYear"),te("N",oc),te("NN",oc),te("NNN",oc),te("NNNN",E1),te("NNNNN",O1),Me(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,s){var r=t._locale.erasParse(n,s,t._strict);r?he(t).era=r:he(t).invalidEra=n}),te("y",gr),te("yy",gr),te("yyy",gr),te("yyyy",gr),te("yo",M1),Me(["y","yy","yyy","yyyy"],ft),Me(["yo"],function(n,e,t,s){var r;t._locale._eraYearOrdinalRegex&&(r=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[ft]=t._locale.eraYearOrdinalParse(n,r):e[ft]=parseInt(n,10)});function p1(n,e){var t,s,r,i=this._eras||zn("en")._eras;for(t=0,s=i.length;t<s;++t){switch(typeof i[t].since){case"string":r=X(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=X(i[t].until).startOf("day").valueOf(),i[t].until=r.valueOf();break}}return i}function g1(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 m1(n,e){var t=n.since<=n.until?1:-1;return e===void 0?X(n.since).year():X(n.since).year()+(e-n.offset)*t}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].name;return""}function b1(){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 w1(){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 x1(){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()-X(r[n].since).year())*t+r[n].offset;return this.year()}function v1(n){return ve(this,"_erasNameRegex")||ac.call(this),n?this._erasNameRegex:this._erasRegex}function C1(n){return ve(this,"_erasAbbrRegex")||ac.call(this),n?this._erasAbbrRegex:this._erasRegex}function S1(n){return ve(this,"_erasNarrowRegex")||ac.call(this),n?this._erasNarrowRegex:this._erasRegex}function oc(n,e){return e.erasAbbrRegex(n)}function E1(n,e){return e.erasNameRegex(n)}function O1(n,e){return e.erasNarrowRegex(n)}function M1(n,e){return e._eraYearOrdinalRegex||gr}function ac(){var n=[],e=[],t=[],s=[],r,i,o,a,c,u=this.eras();for(r=0,i=u.length;r<i;++r)o=Ln(u[r].name),a=Ln(u[r].abbr),c=Ln(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")}ae(0,["gg",2],0,function(){return this.weekYear()%100}),ae(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Go(n,e){ae(0,[n,n.length],0,e)}Go("gggg","weekYear"),Go("ggggg","weekYear"),Go("GGGG","isoWeekYear"),Go("GGGGG","isoWeekYear"),te("G",Vo),te("g",Vo),te("GG",_e,kt),te("gg",_e,kt),te("GGGG",Hl,Ul),te("gggg",Hl,Ul),te("GGGGG",ko,Ao),te("ggggg",ko,Ao),Ei(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,s){e[s.substr(0,2)]=me(n)}),Ei(["gg","GG"],function(n,e,t,s){e[s]=X.parseTwoDigitYear(n)});function N1(n){return xh.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function P1(n){return xh.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function _1(){return $n(this.year(),1,4)}function A1(){return $n(this.isoWeekYear(),1,4)}function T1(){var n=this.localeData()._week;return $n(this.year(),n.dow,n.doy)}function k1(){var n=this.localeData()._week;return $n(this.weekYear(),n.dow,n.doy)}function xh(n,e,t,s,r){var i;return n==null?Pi(this,s,r).year:(i=$n(n,s,r),e>i&&(e=i),V1.call(this,n,e,t,s,r))}function V1(n,e,t,s,r){var i=Kd(n,e,t,s,r),o=Ni(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}ae("Q",0,"Qo","quarter"),te("Q",$d),Me("Q",function(n,e){e[Bn]=(me(n)-1)*3});function D1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}ae("D",["DD",2],"Do","date"),te("D",_e,mr),te("DD",_e,kt),te("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Me(["D","DD"],On),Me("Do",function(n,e){e[On]=me(n.match(_e)[0])});var vh=yr("Date",!0);ae("DDD",["DDDD",3],"DDDo","dayOfYear"),te("DDD",To),te("DDDD",zd),Me(["DDD","DDDD"],function(n,e,t){t._dayOfYear=me(n)});function R1(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}ae("m",["mm",2],0,"minute"),te("m",_e,Gl),te("mm",_e,kt),Me(["m","mm"],nn);var I1=yr("Minutes",!1);ae("s",["ss",2],0,"second"),te("s",_e,Gl),te("ss",_e,kt),Me(["s","ss"],jn);var L1=yr("Seconds",!1);ae("S",0,0,function(){return~~(this.millisecond()/100)}),ae(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ae(0,["SSS",3],0,"millisecond"),ae(0,["SSSS",4],0,function(){return this.millisecond()*10}),ae(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ae(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ae(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ae(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ae(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),te("S",To,$d),te("SS",To,kt),te("SSS",To,zd);var ls,Ch;for(ls="SSSS";ls.length<=9;ls+="S")te(ls,gr);function B1(n,e){e[js]=me(("0."+n)*1e3)}for(ls="S";ls.length<=9;ls+="S")Me(ls,B1);Ch=yr("Milliseconds",!1),ae("z",0,0,"zoneAbbr"),ae("zz",0,0,"zoneName");function j1(){return this._isUTC?"UTC":""}function $1(){return this._isUTC?"Coordinated Universal Time":""}var H=Ci.prototype;H.add=kx,H.calendar=jx,H.clone=$x,H.diff=Yx,H.endOf=s1,H.format=Kx,H.from=Zx,H.fromNow=Qx,H.to=e1,H.toNow=t1,H.get=J0,H.invalidAt=h1,H.isAfter=zx,H.isBefore=Fx,H.isBetween=Ux,H.isSame=Hx,H.isSameOrAfter=Gx,H.isSameOrBefore=Wx,H.isValid=u1,H.lang=gh,H.locale=ph,H.localeData=mh,H.max=ux,H.min=cx,H.parsingFlags=d1,H.set=K0,H.startOf=n1,H.subtract=Vx,H.toArray=a1,H.toObject=l1,H.toDate=o1,H.toISOString=Xx,H.inspect=Jx,typeof Symbol<"u"&&Symbol.for!=null&&(H[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),H.toJSON=c1,H.toString=qx,H.unix=i1,H.valueOf=r1,H.creationData=f1,H.eraName=y1,H.eraNarrow=b1,H.eraAbbr=w1,H.eraYear=x1,H.year=Hd,H.isLeapYear=X0,H.weekYear=N1,H.isoWeekYear=P1,H.quarter=H.quarters=D1,H.month=Xd,H.daysInMonth=ow,H.week=H.weeks=pw,H.isoWeek=H.isoWeeks=gw,H.weeksInYear=T1,H.weeksInWeekYear=k1,H.isoWeeksInYear=_1,H.isoWeeksInISOWeekYear=A1,H.date=vh,H.day=H.days=Pw,H.weekday=_w,H.isoWeekday=Aw,H.dayOfYear=R1,H.hour=H.hours=Lw,H.minute=H.minutes=I1,H.second=H.seconds=L1,H.millisecond=H.milliseconds=Ch,H.utcOffset=wx,H.utc=vx,H.local=Cx,H.parseZone=Sx,H.hasAlignedHourOffset=Ex,H.isDST=Ox,H.isLocal=Nx,H.isUtcOffset=Px,H.isUtc=ch,H.isUTC=ch,H.zoneAbbr=j1,H.zoneName=$1,H.dates=jt("dates accessor is deprecated. Use date instead.",vh),H.months=jt("months accessor is deprecated. Use month instead",Xd),H.years=jt("years accessor is deprecated. Use year instead",Hd),H.zone=jt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",xx),H.isDSTShifted=jt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Mx);function z1(n){return Ae(n*1e3)}function F1(){return Ae.apply(null,arguments).parseZone()}function Sh(n){return n}var Ce=Bl.prototype;Ce.calendar=N0,Ce.longDateFormat=T0,Ce.invalidDate=V0,Ce.ordinal=I0,Ce.preparse=Sh,Ce.postformat=Sh,Ce.relativeTime=B0,Ce.pastFuture=j0,Ce.set=O0,Ce.eras=p1,Ce.erasParse=g1,Ce.erasConvertYear=m1,Ce.erasAbbrRegex=C1,Ce.erasNameRegex=v1,Ce.erasNarrowRegex=S1,Ce.months=nw,Ce.monthsShort=sw,Ce.monthsParse=iw,Ce.monthsRegex=lw,Ce.monthsShortRegex=aw,Ce.week=uw,Ce.firstDayOfYear=fw,Ce.firstDayOfWeek=hw,Ce.weekdays=Sw,Ce.weekdaysMin=Ow,Ce.weekdaysShort=Ew,Ce.weekdaysParse=Nw,Ce.weekdaysRegex=Tw,Ce.weekdaysShortRegex=kw,Ce.weekdaysMinRegex=Vw,Ce.isPM=Rw,Ce.meridiem=Bw;function Wo(n,e,t,s){var r=zn(),i=Cn().set(s,e);return r[t](i,n)}function Eh(n,e,t){if(In(n)&&(e=n,n=void 0),n=n||"",e!=null)return Wo(n,e,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Wo(n,s,t,"month");return r}function lc(n,e,t,s){typeof n=="boolean"?(In(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,In(e)&&(t=e,e=void 0),e=e||"");var r=zn(),i=n?r._week.dow:0,o,a=[];if(t!=null)return Wo(e,(t+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Wo(e,(o+i)%7,s,"day");return a}function U1(n,e){return Eh(n,e,"months")}function H1(n,e){return Eh(n,e,"monthsShort")}function G1(n,e,t){return lc(n,e,t,"weekdays")}function W1(n,e,t){return lc(n,e,t,"weekdaysShort")}function Y1(n,e,t){return lc(n,e,t,"weekdaysMin")}as("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}}),X.lang=jt("moment.lang is deprecated. Use moment.locale instead.",as),X.langData=jt("moment.langData is deprecated. Use moment.localeData instead.",zn);var Fn=Math.abs;function q1(){var n=this._data;return this._milliseconds=Fn(this._milliseconds),this._days=Fn(this._days),this._months=Fn(this._months),n.milliseconds=Fn(n.milliseconds),n.seconds=Fn(n.seconds),n.minutes=Fn(n.minutes),n.hours=Fn(n.hours),n.months=Fn(n.months),n.years=Fn(n.years),this}function Oh(n,e,t,s){var r=sn(e,t);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function X1(n,e){return Oh(this,n,e,1)}function J1(n,e){return Oh(this,n,e,-1)}function Mh(n){return n<0?Math.floor(n):Math.ceil(n)}function K1(){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+=Mh(cc(t)+e)*864e5,e=0,t=0),s.milliseconds=n%1e3,r=zt(n/1e3),s.seconds=r%60,i=zt(r/60),s.minutes=i%60,o=zt(i/60),s.hours=o%24,e+=zt(o/24),c=zt(Nh(e)),t+=c,e-=Mh(cc(c)),a=zt(t/12),t%=12,s.days=e,s.months=t,s.years=a,this}function Nh(n){return n*4800/146097}function cc(n){return n*146097/4800}function Z1(n){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(n=$t(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+s/864e5,t=this._months+Nh(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(cc(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 Un(n){return function(){return this.as(n)}}var Ph=Un("ms"),Q1=Un("s"),ev=Un("m"),tv=Un("h"),nv=Un("d"),sv=Un("w"),rv=Un("M"),iv=Un("Q"),ov=Un("y"),av=Ph;function lv(){return sn(this)}function cv(n){return n=$t(n),this.isValid()?this[n+"s"]():NaN}function zs(n){return function(){return this.isValid()?this._data[n]:NaN}}var uv=zs("milliseconds"),dv=zs("seconds"),hv=zs("minutes"),fv=zs("hours"),pv=zs("days"),gv=zs("months"),mv=zs("years");function yv(){return zt(this.days()/7)}var Hn=Math.round,vr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function bv(n,e,t,s,r){return r.relativeTime(e||1,!!t,n,s)}function wv(n,e,t,s){var r=sn(n).abs(),i=Hn(r.as("s")),o=Hn(r.as("m")),a=Hn(r.as("h")),c=Hn(r.as("d")),u=Hn(r.as("M")),d=Hn(r.as("w")),h=Hn(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,bv.apply(null,f)}function xv(n){return n===void 0?Hn:typeof n=="function"?(Hn=n,!0):!1}function vv(n,e){return vr[n]===void 0?!1:e===void 0?vr[n]:(vr[n]=e,n==="s"&&(vr.ss=e-1),!0)}function Cv(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=vr,r,i;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(s=Object.assign({},vr,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),r=this.localeData(),i=wv(this,!t,s,r),t&&(i=r.pastFuture(+this,i)),r.postformat(i)}var uc=Math.abs;function Cr(n){return(n>0)-(n<0)||+n}function Yo(){if(!this.isValid())return this.localeData().invalidDate();var n=uc(this._milliseconds)/1e3,e=uc(this._days),t=uc(this._months),s,r,i,o,a=this.asSeconds(),c,u,d,h;return a?(s=zt(n/60),r=zt(s/60),n%=60,s%=60,i=zt(t/12),t%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=Cr(this._months)!==Cr(a)?"-":"",d=Cr(this._days)!==Cr(a)?"-":"",h=Cr(this._milliseconds)!==Cr(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 we=$o.prototype;we.isValid=gx,we.abs=q1,we.add=X1,we.subtract=J1,we.as=Z1,we.asMilliseconds=Ph,we.asSeconds=Q1,we.asMinutes=ev,we.asHours=tv,we.asDays=nv,we.asWeeks=sv,we.asMonths=rv,we.asQuarters=iv,we.asYears=ov,we.valueOf=av,we._bubble=K1,we.clone=lv,we.get=cv,we.milliseconds=uv,we.seconds=dv,we.minutes=hv,we.hours=fv,we.days=pv,we.weeks=yv,we.months=gv,we.years=mv,we.humanize=Cv,we.toISOString=Yo,we.toString=Yo,we.toJSON=Yo,we.locale=ph,we.localeData=mh,we.toIsoString=jt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yo),we.lang=gh,ae("X",0,0,"unix"),ae("x",0,0,"valueOf"),te("x",Vo),te("X",U0),Me("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)}),Me("x",function(n,e,t){t._d=new Date(me(n))});//! moment.js
10
- X.version="2.30.1",S0(Ae),X.fn=H,X.min=dx,X.max=hx,X.now=fx,X.utc=Cn,X.unix=z1,X.months=U1,X.isDate=vi,X.locale=as,X.invalid=No,X.duration=sn,X.isMoment=tn,X.weekdays=G1,X.parseZone=F1,X.localeData=zn,X.isDuration=zo,X.monthsShort=H1,X.weekdaysMin=Y1,X.defineLocale=Kl,X.updateLocale=Fw,X.locales=Uw,X.weekdaysShort=W1,X.normalizeUnits=$t,X.relativeTimeRounding=xv,X.relativeTimeThreshold=vv,X.calendarFormat=Bx,X.prototype=H,X.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 Sv='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Ev=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,_h=n=>Array.from(n.querySelectorAll(Sv)).filter(e=>Ov(e)&&Ev(e)),Ov=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}},Gn=(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 Ah;const qe=typeof window<"u",Mv=n=>typeof n=="string",Th=()=>{},Nv=qe&&((Ah=window==null?void 0:window.navigator)==null?void 0:Ah.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function dc(n){return typeof n=="function"?n():l.unref(n)}function Pv(n){return n}function qo(n){return l.getCurrentScope()?(l.onScopeDispose(n),!0):!1}function _v(n,e=!0){l.getCurrentInstance()?l.onMounted(n):e?n():l.nextTick(n)}function Av(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)},dc(e))}return s&&(r.value=!0,qe&&c()),qo(a),{isPending:l.readonly(r),start:c,stop:a}}function cs(n){var e;const t=dc(n);return(e=t==null?void 0:t.$el)!=null?e:t}const hc=qe?window:void 0;function Wn(...n){let e,t,s,r;if(Mv(n[0])||Array.isArray(n[0])?([t,s,r]=n,e=hc):[e,t,s,r]=n,!e)return Th;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(()=>[cs(e),dc(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 qo(u),u}let kh=!1;function Tv(n,e,t={}){const{window:s=hc,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return;Nv&&!kh&&(kh=!0,Array.from(s.document.body.children).forEach(f=>f.addEventListener("click",Th)));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=cs(p);return g&&(f.target===g||f.composedPath().includes(g))}}),d=[Wn(s,"click",f=>{const p=cs(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}),Wn(s,"pointerdown",f=>{const p=cs(n);p&&(a=!f.composedPath().includes(p)&&!c(f))},{passive:!0}),o&&Wn(s,"blur",f=>{var p;const g=cs(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 kv(n,e=!1){const t=l.ref(),s=()=>t.value=!!n();return s(),_v(s,e),t}const Vh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dh="__vueuse_ssr_handlers__";Vh[Dh]=Vh[Dh]||{};var Rh=Object.getOwnPropertySymbols,Vv=Object.prototype.hasOwnProperty,Dv=Object.prototype.propertyIsEnumerable,Rv=(n,e)=>{var t={};for(var s in n)Vv.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&Rh)for(var s of Rh(n))e.indexOf(s)<0&&Dv.call(n,s)&&(t[s]=n[s]);return t};function Ih(n,e,t={}){const s=t,{window:r=hc}=s,i=Rv(s,["window"]);let o;const a=kv(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},u=l.watch(()=>cs(n),h=>{c(),a.value&&r&&h&&(o=new ResizeObserver(e),o.observe(h,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return qo(d),{isSupported:a,stop:d}}var Lh;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(Lh||(Lh={}));var Iv=Object.defineProperty,Bh=Object.getOwnPropertySymbols,Lv=Object.prototype.hasOwnProperty,Bv=Object.prototype.propertyIsEnumerable,jh=(n,e,t)=>e in n?Iv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jv=(n,e)=>{for(var t in e||(e={}))Lv.call(e,t)&&jh(n,t,e[t]);if(Bh)for(var t of Bh(e))Bv.call(e,t)&&jh(n,t,e[t]);return n};jv({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 $v=()=>qe&&/firefox/i.test(window.navigator.userAgent);/**
9
+ `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var Id={};function Ld(n,e){J.deprecationHandler!=null&&J.deprecationHandler(n,e),Id[n]||(Rd(e),Id[n]=!0)}J.suppressDeprecationWarnings=!1,J.deprecationHandler=null;function Sn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function O0(n){var e,t;for(t in n)xe(n,t)&&(e=n[t],Sn(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 Rl(n,e){var t=as({},n),s;for(s in e)xe(e,s)&&(Bs(n[s])&&Bs(e[s])?(t[s]={},as(t[s],n[s]),as(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in n)xe(n,s)&&!xe(e,s)&&Bs(n[s])&&(t[s]=as({},t[s]));return t}function Il(n){n!=null&&this.set(n)}var Ll;Object.keys?Ll=Object.keys:Ll=function(n){var e,t=[];for(e in n)xe(n,e)&&t.push(e);return t};var M0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function N0(n,e,t){var s=this._calendar[n]||this._calendar.sameElse;return Sn(s)?s.call(e,t):s}function En(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 Bl=/(\[[^\[]*\])|(\\)?([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,Po=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,jl={},pr={};function oe(n,e,t,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(pr[n]=r),e&&(pr[e[0]]=function(){return En(r.apply(this,arguments),e[1],e[2])}),t&&(pr[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 _0(n){var e=n.match(Bl),t,s;for(t=0,s=e.length;t<s;t++)pr[e[t]]?e[t]=pr[e[t]]:e[t]=P0(e[t]);return function(r){var i="",o;for(o=0;o<s;o++)i+=Sn(e[o])?e[o].call(r,n):e[o];return i}}function _o(n,e){return n.isValid()?(e=Bd(e,n.localeData()),jl[e]=jl[e]||_0(e),jl[e](n)):n.localeData().invalidDate()}function Bd(n,e){var t=5;function s(r){return e.longDateFormat(r)||r}for(Po.lastIndex=0;t>=0&&Po.test(n);)n=n.replace(Po,s),Po.lastIndex=0,t-=1;return n}var A0={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 T0(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(Bl).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var k0="Invalid date";function V0(){return this._invalidDate}var D0="%d",R0=/\d{1,2}/;function I0(n){return this._ordinal.replace("%d",n)}var L0={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 B0(n,e,t,s){var r=this._relativeTime[t];return Sn(r)?r(n,e,t,s):r.replace(/%d/i,n)}function j0(n,e){var t=this._relativeTime[n>0?"future":"past"];return Sn(t)?t(e):t.replace(/%s/i,e)}var jd={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 jt(n){return typeof n=="string"?jd[n]||jd[n.toLowerCase()]:void 0}function $l(n){var e={},t,s;for(s in n)xe(n,s)&&(t=jt(s),t&&(e[t]=n[s]));return e}var $0={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 z0(n){var e=[],t;for(t in n)xe(n,t)&&e.push({unit:t,priority:$0[t]});return e.sort(function(s,r){return s.priority-r.priority}),e}var $d=/\d/,Tt=/\d\d/,zd=/\d{3}/,zl=/\d{4}/,Ao=/[+-]?\d{6}/,Pe=/\d\d?/,Fd=/\d\d\d\d?/,Ud=/\d\d\d\d\d\d?/,To=/\d{1,3}/,Fl=/\d{1,4}/,ko=/[+-]?\d{1,6}/,gr=/\d+/,Vo=/[+-]?\d+/,F0=/Z|[+-]\d\d:?\d\d/gi,Do=/Z|[+-]\d\d(?::?\d\d)?/gi,U0=/[+-]?\d+(\.\d{1,3})?/,Si=/[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,mr=/^[1-9]\d?/,Ul=/^([1-9]\d|\d)/,Ro;Ro={};function ee(n,e,t){Ro[n]=Sn(e)?e:function(s,r){return s&&t?t:e}}function H0(n,e){return xe(Ro,n)?Ro[n](e._strict,e._locale):new RegExp(G0(n))}function G0(n){return Ln(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,r,i){return t||s||r||i}))}function Ln(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $t(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=$t(e)),t}var Hl={};function Oe(n,e){var t,s=e,r;for(typeof n=="string"&&(n=[n]),In(e)&&(s=function(i,o){o[e]=ge(i)}),r=n.length,t=0;t<r;t++)Hl[n[t]]=s}function Ei(n,e){Oe(n,function(t,s,r,i){r._w=r._w||{},e(t,r._w,r,i)})}function W0(n,e,t){e!=null&&xe(Hl,n)&&Hl[n](e,t._a,t,n)}function Io(n){return n%4===0&&n%100!==0||n%400===0}var ht=0,Bn=1,On=2,Qe=3,nn=4,jn=5,js=6,Y0=7,q0=8;oe("Y",0,0,function(){var n=this.year();return n<=9999?En(n,4):"+"+n}),oe(0,["YY",2],0,function(){return this.year()%100}),oe(0,["YYYY",4],0,"year"),oe(0,["YYYYY",5],0,"year"),oe(0,["YYYYYY",6,!0],0,"year"),ee("Y",Vo),ee("YY",Pe,Tt),ee("YYYY",Fl,zl),ee("YYYYY",ko,Ao),ee("YYYYYY",ko,Ao),Oe(["YYYYY","YYYYYY"],ht),Oe("YYYY",function(n,e){e[ht]=n.length===2?J.parseTwoDigitYear(n):ge(n)}),Oe("YY",function(n,e){e[ht]=J.parseTwoDigitYear(n)}),Oe("Y",function(n,e){e[ht]=parseInt(n,10)});function Oi(n){return Io(n)?366:365}J.parseTwoDigitYear=function(n){return ge(n)+(ge(n)>68?1900:2e3)};var Hd=yr("FullYear",!0);function X0(){return Io(this.year())}function yr(n,e){return function(t){return t!=null?(Gd(this,n,t),J.updateOffset(this,e),this):Mi(this,n)}}function Mi(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 Gd(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&&!Io(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function J0(n){return n=jt(n),Sn(this[n])?this[n]():this}function K0(n,e){if(typeof n=="object"){n=$l(n);var t=z0(n),s,r=t.length;for(s=0;s<r;s++)this[t[s].unit](n[t[s].unit])}else if(n=jt(n),Sn(this[n]))return this[n](e);return this}function Z0(n,e){return(n%e+e)%e}var ze;Array.prototype.indexOf?ze=Array.prototype.indexOf:ze=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function Gl(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=Z0(e,12);return n+=(e-t)/12,t===1?Io(n)?29:28:31-t%7%2}oe("M",["MM",2],"Mo",function(){return this.month()+1}),oe("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),oe("MMMM",0,0,function(n){return this.localeData().months(this,n)}),ee("M",Pe,mr),ee("MM",Pe,Tt),ee("MMM",function(n,e){return e.monthsShortRegex(n)}),ee("MMMM",function(n,e){return e.monthsRegex(n)}),Oe(["M","MM"],function(n,e){e[Bn]=ge(n)-1}),Oe(["MMM","MMMM"],function(n,e,t,s){var r=t._locale.monthsParse(n,s,t._strict);r!=null?e[Bn]=r:de(t).invalidMonth=n});var Q0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Wd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ew=Si,tw=Si;function nw(n,e){return n?en(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Yd).test(e)?"format":"standalone"][n.month()]:en(this._months)?this._months:this._months.standalone}function sw(n,e){return n?en(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Yd.test(e)?"format":"standalone"][n.month()]:en(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function rw(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=Cn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return t?e==="MMM"?(r=ze.call(this._shortMonthsParse,o),r!==-1?r:null):(r=ze.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=ze.call(this._shortMonthsParse,o),r!==-1?r:(r=ze.call(this._longMonthsParse,o),r!==-1?r:null)):(r=ze.call(this._longMonthsParse,o),r!==-1?r:(r=ze.call(this._shortMonthsParse,o),r!==-1?r:null))}function iw(n,e,t){var s,r,i;if(this._monthsParseExact)return rw.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=Cn([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 qd(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),!In(e))return n}var t=e,s=n.date();return s=s<29?s:Math.min(s,Gl(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,s):n._d.setMonth(t,s),n}function Xd(n){return n!=null?(qd(this,n),J.updateOffset(this,!0),this):Mi(this,"Month")}function ow(){return Gl(this.year(),this.month())}function aw(n){return this._monthsParseExact?(xe(this,"_monthsRegex")||Jd.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(xe(this,"_monthsShortRegex")||(this._monthsShortRegex=ew),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function lw(n){return this._monthsParseExact?(xe(this,"_monthsRegex")||Jd.call(this),n?this._monthsStrictRegex:this._monthsRegex):(xe(this,"_monthsRegex")||(this._monthsRegex=tw),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Jd(){function n(c,u){return u.length-c.length}var e=[],t=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=Cn([2e3,r]),o=Ln(this.monthsShort(i,"")),a=Ln(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 cw(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 Ni(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 Lo(n,e,t){var s=7+e-t,r=(7+Ni(n,0,s).getUTCDay()-e)%7;return-r+s-1}function Kd(n,e,t,s,r){var i=(7+t-s)%7,o=Lo(n,s,r),a=1+7*(e-1)+i+o,c,u;return a<=0?(c=n-1,u=Oi(c)+a):a>Oi(n)?(c=n+1,u=a-Oi(n)):(c=n,u=a),{year:c,dayOfYear:u}}function Pi(n,e,t){var s=Lo(n.year(),e,t),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+$n(o,e,t)):r>$n(n.year(),e,t)?(i=r-$n(n.year(),e,t),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function $n(n,e,t){var s=Lo(n,e,t),r=Lo(n+1,e,t);return(Oi(n)-s+r)/7}oe("w",["ww",2],"wo","week"),oe("W",["WW",2],"Wo","isoWeek"),ee("w",Pe,mr),ee("ww",Pe,Tt),ee("W",Pe,mr),ee("WW",Pe,Tt),Ei(["w","ww","W","WW"],function(n,e,t,s){e[s.substr(0,1)]=ge(n)});function uw(n){return Pi(n,this._week.dow,this._week.doy).week}var dw={dow:0,doy:6};function hw(){return this._week.dow}function fw(){return this._week.doy}function pw(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function gw(n){var e=Pi(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}oe("d",0,"do","day"),oe("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),oe("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),oe("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),oe("e",0,0,"weekday"),oe("E",0,0,"isoWeekday"),ee("d",Pe),ee("e",Pe),ee("E",Pe),ee("dd",function(n,e){return e.weekdaysMinRegex(n)}),ee("ddd",function(n,e){return e.weekdaysShortRegex(n)}),ee("dddd",function(n,e){return e.weekdaysRegex(n)}),Ei(["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}),Ei(["d","e","E"],function(n,e,t,s){e[s]=ge(n)});function mw(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function yw(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Wl(n,e){return n.slice(e,7).concat(n.slice(0,e))}var bw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ww="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xw=Si,vw=Si,Cw=Si;function Sw(n,e){var t=en(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?Wl(t,this._week.dow):n?t[n.day()]:t}function Ew(n){return n===!0?Wl(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function Ow(n){return n===!0?Wl(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function Mw(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=Cn([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=ze.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=ze.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=ze.call(this._weekdaysParse,o),r!==-1||(r=ze.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=ze.call(this._shortWeekdaysParse,o),r!==-1||(r=ze.call(this._weekdaysParse,o),r!==-1)?r:(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=ze.call(this._minWeekdaysParse,o),r!==-1||(r=ze.call(this._weekdaysParse,o),r!==-1)?r:(r=ze.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function Nw(n,e,t){var s,r,i;if(this._weekdaysParseExact)return Mw.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=Cn([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=Mi(this,"Day");return n!=null?(n=mw(n,this.localeData()),this.add(n-e,"d")):e}function _w(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 Aw(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=yw(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Tw(n){return this._weekdaysParseExact?(xe(this,"_weekdaysRegex")||Yl.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(xe(this,"_weekdaysRegex")||(this._weekdaysRegex=xw),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function kw(n){return this._weekdaysParseExact?(xe(this,"_weekdaysRegex")||Yl.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(xe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=vw),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Vw(n){return this._weekdaysParseExact?(xe(this,"_weekdaysRegex")||Yl.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(xe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Cw),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yl(){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=Cn([2e3,1]).day(i),a=Ln(this.weekdaysMin(o,"")),c=Ln(this.weekdaysShort(o,"")),u=Ln(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 ql(){return this.hours()%12||12}function Dw(){return this.hours()||24}oe("H",["HH",2],0,"hour"),oe("h",["hh",2],0,ql),oe("k",["kk",2],0,Dw),oe("hmm",0,0,function(){return""+ql.apply(this)+En(this.minutes(),2)}),oe("hmmss",0,0,function(){return""+ql.apply(this)+En(this.minutes(),2)+En(this.seconds(),2)}),oe("Hmm",0,0,function(){return""+this.hours()+En(this.minutes(),2)}),oe("Hmmss",0,0,function(){return""+this.hours()+En(this.minutes(),2)+En(this.seconds(),2)});function Qd(n,e){oe(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Qd("a",!0),Qd("A",!1);function eh(n,e){return e._meridiemParse}ee("a",eh),ee("A",eh),ee("H",Pe,Ul),ee("h",Pe,mr),ee("k",Pe,mr),ee("HH",Pe,Tt),ee("hh",Pe,Tt),ee("kk",Pe,Tt),ee("hmm",Fd),ee("hmmss",Ud),ee("Hmm",Fd),ee("Hmmss",Ud),Oe(["H","HH"],Qe),Oe(["k","kk"],function(n,e,t){var s=ge(n);e[Qe]=s===24?0:s}),Oe(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n}),Oe(["h","hh"],function(n,e,t){e[Qe]=ge(n),de(t).bigHour=!0}),Oe("hmm",function(n,e,t){var s=n.length-2;e[Qe]=ge(n.substr(0,s)),e[nn]=ge(n.substr(s)),de(t).bigHour=!0}),Oe("hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Qe]=ge(n.substr(0,s)),e[nn]=ge(n.substr(s,2)),e[jn]=ge(n.substr(r)),de(t).bigHour=!0}),Oe("Hmm",function(n,e,t){var s=n.length-2;e[Qe]=ge(n.substr(0,s)),e[nn]=ge(n.substr(s))}),Oe("Hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Qe]=ge(n.substr(0,s)),e[nn]=ge(n.substr(s,2)),e[jn]=ge(n.substr(r))});function Rw(n){return(n+"").toLowerCase().charAt(0)==="p"}var Iw=/[ap]\.?m?\.?/i,Lw=yr("Hours",!0);function Bw(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var th={calendar:M0,longDateFormat:A0,invalidDate:k0,ordinal:D0,dayOfMonthOrdinalParse:R0,relativeTime:L0,months:Q0,monthsShort:Wd,week:dw,weekdays:bw,weekdaysMin:ww,weekdaysShort:Zd,meridiemParse:Iw},Re={},_i={},Ai;function jw(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 nh(n){return n&&n.toLowerCase().replace("_","-")}function $w(n){for(var e=0,t,s,r,i;e<n.length;){for(i=nh(n[e]).split("-"),t=i.length,s=nh(n[e+1]),s=s?s.split("-"):null;t>0;){if(r=Bo(i.slice(0,t).join("-")),r)return r;if(s&&s.length>=t&&jw(i,s)>=t-1)break;t--}e++}return Ai}function zw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function Bo(n){var e=null,t;if(Re[n]===void 0&&typeof module<"u"&&module&&module.exports&&zw(n))try{e=Ai._abbr,t=require,t("./locale/"+n),ls(e)}catch{Re[n]=null}return Re[n]}function ls(n,e){var t;return n&&(vt(e)?t=zn(n):t=Xl(n,e),t?Ai=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Ai._abbr}function Xl(n,e){if(e!==null){var t,s=th;if(e.abbr=n,Re[n]!=null)Ld("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=Re[n]._config;else if(e.parentLocale!=null)if(Re[e.parentLocale]!=null)s=Re[e.parentLocale]._config;else if(t=Bo(e.parentLocale),t!=null)s=t._config;else return _i[e.parentLocale]||(_i[e.parentLocale]=[]),_i[e.parentLocale].push({name:n,config:e}),null;return Re[n]=new Il(Rl(s,e)),_i[n]&&_i[n].forEach(function(r){Xl(r.name,r.config)}),ls(n),Re[n]}else return delete Re[n],null}function Fw(n,e){if(e!=null){var t,s,r=th;Re[n]!=null&&Re[n].parentLocale!=null?Re[n].set(Rl(Re[n]._config,e)):(s=Bo(n),s!=null&&(r=s._config),e=Rl(r,e),s==null&&(e.abbr=n),t=new Il(e),t.parentLocale=Re[n],Re[n]=t),ls(n)}else Re[n]!=null&&(Re[n].parentLocale!=null?(Re[n]=Re[n].parentLocale,n===ls()&&ls(n)):Re[n]!=null&&delete Re[n]);return Re[n]}function zn(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Ai;if(!en(n)){if(e=Bo(n),e)return e;n=[n]}return $w(n)}function Uw(){return Ll(Re)}function Jl(n){var e,t=n._a;return t&&de(n).overflow===-2&&(e=t[Bn]<0||t[Bn]>11?Bn:t[On]<1||t[On]>Gl(t[ht],t[Bn])?On:t[Qe]<0||t[Qe]>24||t[Qe]===24&&(t[nn]!==0||t[jn]!==0||t[js]!==0)?Qe:t[nn]<0||t[nn]>59?nn:t[jn]<0||t[jn]>59?jn:t[js]<0||t[js]>999?js:-1,de(n)._overflowDayOfYear&&(e<ht||e>On)&&(e=On),de(n)._overflowWeeks&&e===-1&&(e=Y0),de(n)._overflowWeekday&&e===-1&&(e=q0),de(n).overflow=e),n}var Hw=/^\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)?)?$/,Gw=/^\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)?)?$/,Ww=/Z|[+-]\d\d(?::?\d\d)?/,jo=[["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]],Kl=[["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/]],Yw=/^\/?Date\((-?\d+)/i,qw=/^(?:(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}))$/,Xw={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 sh(n){var e,t,s=n._i,r=Hw.exec(s)||Gw.exec(s),i,o,a,c,u=jo.length,d=Kl.length;if(r){for(de(n).iso=!0,e=0,t=u;e<t;e++)if(jo[e][1].exec(r[1])){o=jo[e][0],i=jo[e][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(e=0,t=d;e<t;e++)if(Kl[e][1].exec(r[3])){a=(r[2]||" ")+Kl[e][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(Ww.exec(r[4]))c="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(c||""),Ql(n)}else n._isValid=!1}function Jw(n,e,t,s,r,i){var o=[Kw(n),Wd.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Kw(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Zw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Qw(n,e,t){if(n){var s=Zd.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 ex(n,e,t){if(n)return Xw[n];if(e)return 0;var s=parseInt(t,10),r=s%100,i=(s-r)/100;return i*60+r}function rh(n){var e=qw.exec(Zw(n._i)),t;if(e){if(t=Jw(e[4],e[3],e[2],e[5],e[6],e[7]),!Qw(e[1],t,n))return;n._a=t,n._tzm=ex(e[8],e[9],e[10]),n._d=Ni.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),de(n).rfc2822=!0}else n._isValid=!1}function tx(n){var e=Yw.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(sh(n),n._isValid===!1)delete n._isValid;else return;if(rh(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:J.createFromInputFallback(n)}J.createFromInputFallback=Bt("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 br(n,e,t){return n??e??t}function nx(n){var e=new Date(J.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Zl(n){var e,t,s=[],r,i,o;if(!n._d){for(r=nx(n),n._w&&n._a[On]==null&&n._a[Bn]==null&&sx(n),n._dayOfYear!=null&&(o=br(n._a[ht],r[ht]),(n._dayOfYear>Oi(o)||n._dayOfYear===0)&&(de(n)._overflowDayOfYear=!0),t=Ni(o,0,n._dayOfYear),n._a[Bn]=t.getUTCMonth(),n._a[On]=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[Qe]===24&&n._a[nn]===0&&n._a[jn]===0&&n._a[js]===0&&(n._nextDay=!0,n._a[Qe]=0),n._d=(n._useUTC?Ni:cw).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[Qe]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(de(n).weekdayMismatch=!0)}}function sx(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=br(e.GG,n._a[ht],Pi(_e(),1,4).year),s=br(e.W,1),r=br(e.E,1),(r<1||r>7)&&(c=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=Pi(_e(),i,o),t=br(e.gg,n._a[ht],u.year),s=br(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>$n(t,i,o)?de(n)._overflowWeeks=!0:c!=null?de(n)._overflowWeekday=!0:(a=Kd(t,s,r,i,o),n._a[ht]=a.year,n._dayOfYear=a.dayOfYear)}J.ISO_8601=function(){},J.RFC_2822=function(){};function Ql(n){if(n._f===J.ISO_8601){sh(n);return}if(n._f===J.RFC_2822){rh(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=Bd(n._f,n._locale).match(Bl)||[],d=r.length,t=0;t<d;t++)i=r[t],s=(e.match(H0(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),pr[i]?(s?de(n).empty=!1:de(n).unusedTokens.push(i),W0(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[Qe]<=12&&de(n).bigHour===!0&&n._a[Qe]>0&&(de(n).bigHour=void 0),de(n).parsedDateParts=n._a.slice(0),de(n).meridiem=n._meridiem,n._a[Qe]=rx(n._locale,n._a[Qe],n._meridiem),u=de(n).era,u!==null&&(n._a[ht]=n._locale.erasConvertYear(u,n._a[ht])),Zl(n),Jl(n)}function rx(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 ix(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=Dl({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[r],Ql(e),kl(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));as(n,t||e)}function ox(n){if(!n._d){var e=$l(n._i),t=e.day===void 0?e.date:e.day;n._a=Vd([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),Zl(n)}}function ax(n){var e=new Ci(Jl(ih(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ih(n){var e=n._i,t=n._f;return n._locale=n._locale||zn(n._l),e===null||t===void 0&&e===""?No({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),tn(e)?new Ci(Jl(e)):(vi(e)?n._d=e:en(t)?ix(n):t?Ql(n):lx(n),kl(n)||(n._d=null),n))}function lx(n){var e=n._i;vt(e)?n._d=new Date(J.now()):vi(e)?n._d=new Date(e.valueOf()):typeof e=="string"?tx(n):en(e)?(n._a=Vd(e.slice(0),function(t){return parseInt(t,10)}),Zl(n)):Bs(e)?ox(n):In(e)?n._d=new Date(e):J.createFromInputFallback(n)}function oh(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),(Bs(n)&&Al(n)||en(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,ax(i)}function _e(n,e,t,s){return oh(n,e,t,s,!1)}var cx=Bt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=_e.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:No()}),ux=Bt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=_e.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:No()});function ah(n,e){var t,s;if(e.length===1&&en(e[0])&&(e=e[0]),!e.length)return _e();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][n](t))&&(t=e[s]);return t}function dx(){var n=[].slice.call(arguments,0);return ah("isBefore",n)}function hx(){var n=[].slice.call(arguments,0);return ah("isAfter",n)}var fx=function(){return Date.now?Date.now():+new Date},Ti=["year","quarter","month","week","day","hour","minute","second","millisecond"];function px(n){var e,t=!1,s,r=Ti.length;for(e in n)if(xe(n,e)&&!(ze.call(Ti,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(s=0;s<r;++s)if(n[Ti[s]]){if(t)return!1;parseFloat(n[Ti[s]])!==ge(n[Ti[s]])&&(t=!0)}return!0}function gx(){return this._isValid}function mx(){return sn(NaN)}function $o(n){var e=$l(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=px(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=zn(),this._bubble()}function zo(n){return n instanceof $o}function ec(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function yx(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 lh(n,e){oe(n,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+En(~~(t/60),2)+e+En(~~t%60,2)})}lh("Z",":"),lh("ZZ",""),ee("Z",Do),ee("ZZ",Do),Oe(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=tc(Do,n)});var bx=/([\+\-]|\d\d)/gi;function tc(n,e){var t=(e||"").match(n),s,r,i;return t===null?null:(s=t[t.length-1]||[],r=(s+"").match(bx)||["-",0,0],i=+(r[1]*60)+ge(r[2]),i===0?0:r[0]==="+"?i:-i)}function nc(n,e){var t,s;return e._isUTC?(t=e.clone(),s=(tn(n)||vi(n)?n.valueOf():_e(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),J.updateOffset(t,!1),t):_e(n).local()}function sc(n){return-Math.round(n._d.getTimezoneOffset())}J.updateOffset=function(){};function wx(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=tc(Do,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(r=sc(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!e||this._changeInProgress?hh(this,sn(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,J.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:sc(this)}function xx(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function vx(n){return this.utcOffset(0,n)}function Cx(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(sc(this),"m")),this}function Sx(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=tc(F0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Ex(n){return this.isValid()?(n=n?_e(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function Ox(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Mx(){if(!vt(this._isDSTShifted))return this._isDSTShifted;var n={},e;return Dl(n,this),n=ih(n),n._a?(e=n._isUTC?Cn(n._a):_e(n._a),this._isDSTShifted=this.isValid()&&yx(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Nx(){return this.isValid()?!this._isUTC:!1}function Px(){return this.isValid()?this._isUTC:!1}function ch(){return this.isValid()?this._isUTC&&this._offset===0:!1}var _x=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ax=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function sn(n,e){var t=n,s=null,r,i,o;return zo(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:In(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(s=_x.exec(n))?(r=s[1]==="-"?-1:1,t={y:0,d:ge(s[On])*r,h:ge(s[Qe])*r,m:ge(s[nn])*r,s:ge(s[jn])*r,ms:ge(ec(s[js]*1e3))*r}):(s=Ax.exec(n))?(r=s[1]==="-"?-1:1,t={y:$s(s[2],r),M:$s(s[3],r),w:$s(s[4],r),d:$s(s[5],r),h:$s(s[6],r),m:$s(s[7],r),s:$s(s[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(o=Tx(_e(t.from),_e(t.to)),t={},t.ms=o.milliseconds,t.M=o.months),i=new $o(t),zo(n)&&xe(n,"_locale")&&(i._locale=n._locale),zo(n)&&xe(n,"_isValid")&&(i._isValid=n._isValid),i}sn.fn=$o.prototype,sn.invalid=mx;function $s(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function uh(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 Tx(n,e){var t;return n.isValid()&&e.isValid()?(e=nc(e,n),n.isBefore(e)?t=uh(n,e):(t=uh(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function dh(n,e){return function(t,s){var r,i;return s!==null&&!isNaN(+s)&&(Ld(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=sn(t,s),hh(this,r,n),this}}function hh(n,e,t,s){var r=e._milliseconds,i=ec(e._days),o=ec(e._months);n.isValid()&&(s=s??!0,o&&qd(n,Mi(n,"Month")+o*t),i&&Gd(n,"Date",Mi(n,"Date")+i*t),r&&n._d.setTime(n._d.valueOf()+r*t),s&&J.updateOffset(n,i||o))}var kx=dh(1,"add"),Vx=dh(-1,"subtract");function fh(n){return typeof n=="string"||n instanceof String}function Dx(n){return tn(n)||vi(n)||fh(n)||In(n)||Ix(n)||Rx(n)||n===null||n===void 0}function Rx(n){var e=Bs(n)&&!Al(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 Ix(n){var e=en(n),t=!1;return e&&(t=n.filter(function(s){return!In(s)&&fh(n)}).length===0),e&&t}function Lx(n){var e=Bs(n)&&!Al(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 Bx(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 jx(n,e){arguments.length===1&&(arguments[0]?Dx(arguments[0])?(n=arguments[0],e=void 0):Lx(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||_e(),s=nc(t,this).startOf("day"),r=J.calendarFormat(this,s)||"sameElse",i=e&&(Sn(e[r])?e[r].call(this,t):e[r]);return this.format(i||this.localeData().calendar(r,this,_e(t)))}function $x(){return new Ci(this)}function zx(n,e){var t=tn(n)?n:_e(n);return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function Fx(n,e){var t=tn(n)?n:_e(n);return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function Ux(n,e,t,s){var r=tn(n)?n:_e(n),i=tn(e)?e:_e(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 Hx(n,e){var t=tn(n)?n:_e(n),s;return this.isValid()&&t.isValid()?(e=jt(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 Gx(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function Wx(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function Yx(n,e,t){var s,r,i;if(!this.isValid())return NaN;if(s=nc(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,e=jt(e),e){case"year":i=Fo(this,s)/12;break;case"month":i=Fo(this,s);break;case"quarter":i=Fo(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:$t(i)}function Fo(n,e){if(n.date()<e.date())return-Fo(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}J.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",J.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function qx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Xx(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?_o(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Sn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",_o(t,"Z")):_o(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jx(){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 Kx(n){n||(n=this.isUtc()?J.defaultFormatUtc:J.defaultFormat);var e=_o(this,n);return this.localeData().postformat(e)}function Zx(n,e){return this.isValid()&&(tn(n)&&n.isValid()||_e(n).isValid())?sn({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qx(n){return this.from(_e(),n)}function e1(n,e){return this.isValid()&&(tn(n)&&n.isValid()||_e(n).isValid())?sn({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function t1(n){return this.to(_e(),n)}function ph(n){var e;return n===void 0?this._locale._abbr:(e=zn(n),e!=null&&(this._locale=e),this)}var gh=Bt("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 mh(){return this._locale}var Uo=1e3,wr=60*Uo,Ho=60*wr,yh=(365*400+97)*24*Ho;function xr(n,e){return(n%e+e)%e}function bh(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-yh:new Date(n,e,t).valueOf()}function wh(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-yh:Date.UTC(n,e,t)}function n1(n){var e,t;if(n=jt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wh:bh,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-=xr(e+(this._isUTC?0:this.utcOffset()*wr),Ho);break;case"minute":e=this._d.valueOf(),e-=xr(e,wr);break;case"second":e=this._d.valueOf(),e-=xr(e,Uo);break}return this._d.setTime(e),J.updateOffset(this,!0),this}function s1(n){var e,t;if(n=jt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wh:bh,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+=Ho-xr(e+(this._isUTC?0:this.utcOffset()*wr),Ho)-1;break;case"minute":e=this._d.valueOf(),e+=wr-xr(e,wr)-1;break;case"second":e=this._d.valueOf(),e+=Uo-xr(e,Uo)-1;break}return this._d.setTime(e),J.updateOffset(this,!0),this}function r1(){return this._d.valueOf()-(this._offset||0)*6e4}function i1(){return Math.floor(this.valueOf()/1e3)}function o1(){return new Date(this.valueOf())}function a1(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function l1(){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 c1(){return this.isValid()?this.toISOString():null}function u1(){return kl(this)}function d1(){return as({},de(this))}function h1(){return de(this).overflow}function f1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}oe("N",0,0,"eraAbbr"),oe("NN",0,0,"eraAbbr"),oe("NNN",0,0,"eraAbbr"),oe("NNNN",0,0,"eraName"),oe("NNNNN",0,0,"eraNarrow"),oe("y",["y",1],"yo","eraYear"),oe("y",["yy",2],0,"eraYear"),oe("y",["yyy",3],0,"eraYear"),oe("y",["yyyy",4],0,"eraYear"),ee("N",rc),ee("NN",rc),ee("NNN",rc),ee("NNNN",E1),ee("NNNNN",O1),Oe(["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}),ee("y",gr),ee("yy",gr),ee("yyy",gr),ee("yyyy",gr),ee("yo",M1),Oe(["y","yy","yyy","yyyy"],ht),Oe(["yo"],function(n,e,t,s){var r;t._locale._eraYearOrdinalRegex&&(r=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[ht]=t._locale.eraYearOrdinalParse(n,r):e[ht]=parseInt(n,10)});function p1(n,e){var t,s,r,i=this._eras||zn("en")._eras;for(t=0,s=i.length;t<s;++t){switch(typeof i[t].since){case"string":r=J(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=J(i[t].until).startOf("day").valueOf(),i[t].until=r.valueOf();break}}return i}function g1(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 m1(n,e){var t=n.since<=n.until?1:-1;return e===void 0?J(n.since).year():J(n.since).year()+(e-n.offset)*t}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].name;return""}function b1(){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 w1(){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 x1(){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()-J(r[n].since).year())*t+r[n].offset;return this.year()}function v1(n){return xe(this,"_erasNameRegex")||ic.call(this),n?this._erasNameRegex:this._erasRegex}function C1(n){return xe(this,"_erasAbbrRegex")||ic.call(this),n?this._erasAbbrRegex:this._erasRegex}function S1(n){return xe(this,"_erasNarrowRegex")||ic.call(this),n?this._erasNarrowRegex:this._erasRegex}function rc(n,e){return e.erasAbbrRegex(n)}function E1(n,e){return e.erasNameRegex(n)}function O1(n,e){return e.erasNarrowRegex(n)}function M1(n,e){return e._eraYearOrdinalRegex||gr}function ic(){var n=[],e=[],t=[],s=[],r,i,o,a,c,u=this.eras();for(r=0,i=u.length;r<i;++r)o=Ln(u[r].name),a=Ln(u[r].abbr),c=Ln(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")}oe(0,["gg",2],0,function(){return this.weekYear()%100}),oe(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Go(n,e){oe(0,[n,n.length],0,e)}Go("gggg","weekYear"),Go("ggggg","weekYear"),Go("GGGG","isoWeekYear"),Go("GGGGG","isoWeekYear"),ee("G",Vo),ee("g",Vo),ee("GG",Pe,Tt),ee("gg",Pe,Tt),ee("GGGG",Fl,zl),ee("gggg",Fl,zl),ee("GGGGG",ko,Ao),ee("ggggg",ko,Ao),Ei(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,s){e[s.substr(0,2)]=ge(n)}),Ei(["gg","GG"],function(n,e,t,s){e[s]=J.parseTwoDigitYear(n)});function N1(n){return xh.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function P1(n){return xh.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function _1(){return $n(this.year(),1,4)}function A1(){return $n(this.isoWeekYear(),1,4)}function T1(){var n=this.localeData()._week;return $n(this.year(),n.dow,n.doy)}function k1(){var n=this.localeData()._week;return $n(this.weekYear(),n.dow,n.doy)}function xh(n,e,t,s,r){var i;return n==null?Pi(this,s,r).year:(i=$n(n,s,r),e>i&&(e=i),V1.call(this,n,e,t,s,r))}function V1(n,e,t,s,r){var i=Kd(n,e,t,s,r),o=Ni(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}oe("Q",0,"Qo","quarter"),ee("Q",$d),Oe("Q",function(n,e){e[Bn]=(ge(n)-1)*3});function D1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}oe("D",["DD",2],"Do","date"),ee("D",Pe,mr),ee("DD",Pe,Tt),ee("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Oe(["D","DD"],On),Oe("Do",function(n,e){e[On]=ge(n.match(Pe)[0])});var vh=yr("Date",!0);oe("DDD",["DDDD",3],"DDDo","dayOfYear"),ee("DDD",To),ee("DDDD",zd),Oe(["DDD","DDDD"],function(n,e,t){t._dayOfYear=ge(n)});function R1(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}oe("m",["mm",2],0,"minute"),ee("m",Pe,Ul),ee("mm",Pe,Tt),Oe(["m","mm"],nn);var I1=yr("Minutes",!1);oe("s",["ss",2],0,"second"),ee("s",Pe,Ul),ee("ss",Pe,Tt),Oe(["s","ss"],jn);var L1=yr("Seconds",!1);oe("S",0,0,function(){return~~(this.millisecond()/100)}),oe(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),oe(0,["SSS",3],0,"millisecond"),oe(0,["SSSS",4],0,function(){return this.millisecond()*10}),oe(0,["SSSSS",5],0,function(){return this.millisecond()*100}),oe(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),oe(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),oe(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),oe(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ee("S",To,$d),ee("SS",To,Tt),ee("SSS",To,zd);var cs,Ch;for(cs="SSSS";cs.length<=9;cs+="S")ee(cs,gr);function B1(n,e){e[js]=ge(("0."+n)*1e3)}for(cs="S";cs.length<=9;cs+="S")Oe(cs,B1);Ch=yr("Milliseconds",!1),oe("z",0,0,"zoneAbbr"),oe("zz",0,0,"zoneName");function j1(){return this._isUTC?"UTC":""}function $1(){return this._isUTC?"Coordinated Universal Time":""}var G=Ci.prototype;G.add=kx,G.calendar=jx,G.clone=$x,G.diff=Yx,G.endOf=s1,G.format=Kx,G.from=Zx,G.fromNow=Qx,G.to=e1,G.toNow=t1,G.get=J0,G.invalidAt=h1,G.isAfter=zx,G.isBefore=Fx,G.isBetween=Ux,G.isSame=Hx,G.isSameOrAfter=Gx,G.isSameOrBefore=Wx,G.isValid=u1,G.lang=gh,G.locale=ph,G.localeData=mh,G.max=ux,G.min=cx,G.parsingFlags=d1,G.set=K0,G.startOf=n1,G.subtract=Vx,G.toArray=a1,G.toObject=l1,G.toDate=o1,G.toISOString=Xx,G.inspect=Jx,typeof Symbol<"u"&&Symbol.for!=null&&(G[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),G.toJSON=c1,G.toString=qx,G.unix=i1,G.valueOf=r1,G.creationData=f1,G.eraName=y1,G.eraNarrow=b1,G.eraAbbr=w1,G.eraYear=x1,G.year=Hd,G.isLeapYear=X0,G.weekYear=N1,G.isoWeekYear=P1,G.quarter=G.quarters=D1,G.month=Xd,G.daysInMonth=ow,G.week=G.weeks=pw,G.isoWeek=G.isoWeeks=gw,G.weeksInYear=T1,G.weeksInWeekYear=k1,G.isoWeeksInYear=_1,G.isoWeeksInISOWeekYear=A1,G.date=vh,G.day=G.days=Pw,G.weekday=_w,G.isoWeekday=Aw,G.dayOfYear=R1,G.hour=G.hours=Lw,G.minute=G.minutes=I1,G.second=G.seconds=L1,G.millisecond=G.milliseconds=Ch,G.utcOffset=wx,G.utc=vx,G.local=Cx,G.parseZone=Sx,G.hasAlignedHourOffset=Ex,G.isDST=Ox,G.isLocal=Nx,G.isUtcOffset=Px,G.isUtc=ch,G.isUTC=ch,G.zoneAbbr=j1,G.zoneName=$1,G.dates=Bt("dates accessor is deprecated. Use date instead.",vh),G.months=Bt("months accessor is deprecated. Use month instead",Xd),G.years=Bt("years accessor is deprecated. Use year instead",Hd),G.zone=Bt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",xx),G.isDSTShifted=Bt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Mx);function z1(n){return _e(n*1e3)}function F1(){return _e.apply(null,arguments).parseZone()}function Sh(n){return n}var ve=Il.prototype;ve.calendar=N0,ve.longDateFormat=T0,ve.invalidDate=V0,ve.ordinal=I0,ve.preparse=Sh,ve.postformat=Sh,ve.relativeTime=B0,ve.pastFuture=j0,ve.set=O0,ve.eras=p1,ve.erasParse=g1,ve.erasConvertYear=m1,ve.erasAbbrRegex=C1,ve.erasNameRegex=v1,ve.erasNarrowRegex=S1,ve.months=nw,ve.monthsShort=sw,ve.monthsParse=iw,ve.monthsRegex=lw,ve.monthsShortRegex=aw,ve.week=uw,ve.firstDayOfYear=fw,ve.firstDayOfWeek=hw,ve.weekdays=Sw,ve.weekdaysMin=Ow,ve.weekdaysShort=Ew,ve.weekdaysParse=Nw,ve.weekdaysRegex=Tw,ve.weekdaysShortRegex=kw,ve.weekdaysMinRegex=Vw,ve.isPM=Rw,ve.meridiem=Bw;function Wo(n,e,t,s){var r=zn(),i=Cn().set(s,e);return r[t](i,n)}function Eh(n,e,t){if(In(n)&&(e=n,n=void 0),n=n||"",e!=null)return Wo(n,e,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Wo(n,s,t,"month");return r}function oc(n,e,t,s){typeof n=="boolean"?(In(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,In(e)&&(t=e,e=void 0),e=e||"");var r=zn(),i=n?r._week.dow:0,o,a=[];if(t!=null)return Wo(e,(t+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Wo(e,(o+i)%7,s,"day");return a}function U1(n,e){return Eh(n,e,"months")}function H1(n,e){return Eh(n,e,"monthsShort")}function G1(n,e,t){return oc(n,e,t,"weekdays")}function W1(n,e,t){return oc(n,e,t,"weekdaysShort")}function Y1(n,e,t){return oc(n,e,t,"weekdaysMin")}ls("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}}),J.lang=Bt("moment.lang is deprecated. Use moment.locale instead.",ls),J.langData=Bt("moment.langData is deprecated. Use moment.localeData instead.",zn);var Fn=Math.abs;function q1(){var n=this._data;return this._milliseconds=Fn(this._milliseconds),this._days=Fn(this._days),this._months=Fn(this._months),n.milliseconds=Fn(n.milliseconds),n.seconds=Fn(n.seconds),n.minutes=Fn(n.minutes),n.hours=Fn(n.hours),n.months=Fn(n.months),n.years=Fn(n.years),this}function Oh(n,e,t,s){var r=sn(e,t);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function X1(n,e){return Oh(this,n,e,1)}function J1(n,e){return Oh(this,n,e,-1)}function Mh(n){return n<0?Math.floor(n):Math.ceil(n)}function K1(){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+=Mh(ac(t)+e)*864e5,e=0,t=0),s.milliseconds=n%1e3,r=$t(n/1e3),s.seconds=r%60,i=$t(r/60),s.minutes=i%60,o=$t(i/60),s.hours=o%24,e+=$t(o/24),c=$t(Nh(e)),t+=c,e-=Mh(ac(c)),a=$t(t/12),t%=12,s.days=e,s.months=t,s.years=a,this}function Nh(n){return n*4800/146097}function ac(n){return n*146097/4800}function Z1(n){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(n=jt(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+s/864e5,t=this._months+Nh(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(ac(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 Un(n){return function(){return this.as(n)}}var Ph=Un("ms"),Q1=Un("s"),ev=Un("m"),tv=Un("h"),nv=Un("d"),sv=Un("w"),rv=Un("M"),iv=Un("Q"),ov=Un("y"),av=Ph;function lv(){return sn(this)}function cv(n){return n=jt(n),this.isValid()?this[n+"s"]():NaN}function zs(n){return function(){return this.isValid()?this._data[n]:NaN}}var uv=zs("milliseconds"),dv=zs("seconds"),hv=zs("minutes"),fv=zs("hours"),pv=zs("days"),gv=zs("months"),mv=zs("years");function yv(){return $t(this.days()/7)}var Hn=Math.round,vr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function bv(n,e,t,s,r){return r.relativeTime(e||1,!!t,n,s)}function wv(n,e,t,s){var r=sn(n).abs(),i=Hn(r.as("s")),o=Hn(r.as("m")),a=Hn(r.as("h")),c=Hn(r.as("d")),u=Hn(r.as("M")),d=Hn(r.as("w")),h=Hn(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,bv.apply(null,f)}function xv(n){return n===void 0?Hn:typeof n=="function"?(Hn=n,!0):!1}function vv(n,e){return vr[n]===void 0?!1:e===void 0?vr[n]:(vr[n]=e,n==="s"&&(vr.ss=e-1),!0)}function Cv(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=vr,r,i;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(s=Object.assign({},vr,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),r=this.localeData(),i=wv(this,!t,s,r),t&&(i=r.pastFuture(+this,i)),r.postformat(i)}var lc=Math.abs;function Cr(n){return(n>0)-(n<0)||+n}function Yo(){if(!this.isValid())return this.localeData().invalidDate();var n=lc(this._milliseconds)/1e3,e=lc(this._days),t=lc(this._months),s,r,i,o,a=this.asSeconds(),c,u,d,h;return a?(s=$t(n/60),r=$t(s/60),n%=60,s%=60,i=$t(t/12),t%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=Cr(this._months)!==Cr(a)?"-":"",d=Cr(this._days)!==Cr(a)?"-":"",h=Cr(this._milliseconds)!==Cr(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=$o.prototype;be.isValid=gx,be.abs=q1,be.add=X1,be.subtract=J1,be.as=Z1,be.asMilliseconds=Ph,be.asSeconds=Q1,be.asMinutes=ev,be.asHours=tv,be.asDays=nv,be.asWeeks=sv,be.asMonths=rv,be.asQuarters=iv,be.asYears=ov,be.valueOf=av,be._bubble=K1,be.clone=lv,be.get=cv,be.milliseconds=uv,be.seconds=dv,be.minutes=hv,be.hours=fv,be.days=pv,be.weeks=yv,be.months=gv,be.years=mv,be.humanize=Cv,be.toISOString=Yo,be.toString=Yo,be.toJSON=Yo,be.locale=ph,be.localeData=mh,be.toIsoString=Bt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yo),be.lang=gh,oe("X",0,0,"unix"),oe("x",0,0,"valueOf"),ee("x",Vo),ee("X",U0),Oe("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)}),Oe("x",function(n,e,t){t._d=new Date(ge(n))});//! moment.js
10
+ J.version="2.30.1",S0(_e),J.fn=G,J.min=dx,J.max=hx,J.now=fx,J.utc=Cn,J.unix=z1,J.months=U1,J.isDate=vi,J.locale=ls,J.invalid=No,J.duration=sn,J.isMoment=tn,J.weekdays=G1,J.parseZone=F1,J.localeData=zn,J.isDuration=zo,J.monthsShort=H1,J.weekdaysMin=Y1,J.defineLocale=Xl,J.updateLocale=Fw,J.locales=Uw,J.weekdaysShort=W1,J.normalizeUnits=jt,J.relativeTimeRounding=xv,J.relativeTimeThreshold=vv,J.calendarFormat=Bx,J.prototype=G,J.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 Sv='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Ev=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,_h=n=>Array.from(n.querySelectorAll(Sv)).filter(e=>Ov(e)&&Ev(e)),Ov=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}},Gn=(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 Ah;const Ye=typeof window<"u",Mv=n=>typeof n=="string",Th=()=>{},Nv=Ye&&((Ah=window==null?void 0:window.navigator)==null?void 0:Ah.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function cc(n){return typeof n=="function"?n():l.unref(n)}function Pv(n){return n}function qo(n){return l.getCurrentScope()?(l.onScopeDispose(n),!0):!1}function _v(n,e=!0){l.getCurrentInstance()?l.onMounted(n):e?n():l.nextTick(n)}function Av(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)},cc(e))}return s&&(r.value=!0,Ye&&c()),qo(a),{isPending:l.readonly(r),start:c,stop:a}}function us(n){var e;const t=cc(n);return(e=t==null?void 0:t.$el)!=null?e:t}const uc=Ye?window:void 0;function Wn(...n){let e,t,s,r;if(Mv(n[0])||Array.isArray(n[0])?([t,s,r]=n,e=uc):[e,t,s,r]=n,!e)return Th;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(()=>[us(e),cc(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 qo(u),u}let kh=!1;function Tv(n,e,t={}){const{window:s=uc,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return;Nv&&!kh&&(kh=!0,Array.from(s.document.body.children).forEach(f=>f.addEventListener("click",Th)));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=us(p);return g&&(f.target===g||f.composedPath().includes(g))}}),d=[Wn(s,"click",f=>{const p=us(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}),Wn(s,"pointerdown",f=>{const p=us(n);p&&(a=!f.composedPath().includes(p)&&!c(f))},{passive:!0}),o&&Wn(s,"blur",f=>{var p;const g=us(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 kv(n,e=!1){const t=l.ref(),s=()=>t.value=!!n();return s(),_v(s,e),t}const Vh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dh="__vueuse_ssr_handlers__";Vh[Dh]=Vh[Dh]||{};var Rh=Object.getOwnPropertySymbols,Vv=Object.prototype.hasOwnProperty,Dv=Object.prototype.propertyIsEnumerable,Rv=(n,e)=>{var t={};for(var s in n)Vv.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&Rh)for(var s of Rh(n))e.indexOf(s)<0&&Dv.call(n,s)&&(t[s]=n[s]);return t};function Ih(n,e,t={}){const s=t,{window:r=uc}=s,i=Rv(s,["window"]);let o;const a=kv(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},u=l.watch(()=>us(n),h=>{c(),a.value&&r&&h&&(o=new ResizeObserver(e),o.observe(h,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return qo(d),{isSupported:a,stop:d}}var Lh;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(Lh||(Lh={}));var Iv=Object.defineProperty,Bh=Object.getOwnPropertySymbols,Lv=Object.prototype.hasOwnProperty,Bv=Object.prototype.propertyIsEnumerable,jh=(n,e,t)=>e in n?Iv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jv=(n,e)=>{for(var t in e||(e={}))Lv.call(e,t)&&jh(n,t,e[t]);if(Bh)for(var t of Bh(e))Bv.call(e,t)&&jh(n,t,e[t]);return n};jv({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 $v=()=>Ye&&/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 us=()=>{},zv=Object.prototype.hasOwnProperty,Xo=(n,e)=>zv.call(n,e),Fv=Array.isArray,Ft=n=>typeof n=="function",rn=n=>typeof n=="string",Sr=n=>n!==null&&typeof n=="object",Uv=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hv=/-(\w)/g,Gv=Uv(n=>n.replace(Hv,(e,t)=>t?t.toUpperCase():""));var $h=typeof global=="object"&&global&&global.Object===Object&&global,Wv=typeof self=="object"&&self&&self.Object===Object&&self,on=$h||Wv||Function("return this")(),Ut=on.Symbol,zh=Object.prototype,Yv=zh.hasOwnProperty,qv=zh.toString,ki=Ut?Ut.toStringTag:void 0;function Xv(n){var e=Yv.call(n,ki),t=n[ki];try{n[ki]=void 0;var s=!0}catch{}var r=qv.call(n);return s&&(e?n[ki]=t:delete n[ki]),r}var Jv=Object.prototype,Kv=Jv.toString;function Zv(n){return Kv.call(n)}var Qv="[object Null]",eC="[object Undefined]",Fh=Ut?Ut.toStringTag:void 0;function ds(n){return n==null?n===void 0?eC:Qv:Fh&&Fh in Object(n)?Xv(n):Zv(n)}function an(n){return n!=null&&typeof n=="object"}var tC="[object Symbol]";function Mn(n){return typeof n=="symbol"||an(n)&&ds(n)==tC}function Jo(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 pt=Array.isArray,nC=1/0,Uh=Ut?Ut.prototype:void 0,Hh=Uh?Uh.toString:void 0;function Gh(n){if(typeof n=="string")return n;if(pt(n))return Jo(n,Gh)+"";if(Mn(n))return Hh?Hh.call(n):"";var e=n+"";return e=="0"&&1/n==-nC?"-0":e}var sC=/\s/;function rC(n){for(var e=n.length;e--&&sC.test(n.charAt(e)););return e}var iC=/^\s+/;function oC(n){return n&&n.slice(0,rC(n)+1).replace(iC,"")}function $e(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Wh=NaN,aC=/^[-+]0x[0-9a-f]+$/i,lC=/^0b[01]+$/i,cC=/^0o[0-7]+$/i,uC=parseInt;function Vi(n){if(typeof n=="number")return n;if(Mn(n))return Wh;if($e(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=$e(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=oC(n);var t=lC.test(n);return t||cC.test(n)?uC(n.slice(2),t?2:8):aC.test(n)?Wh:+n}function Er(n){return n}var dC="[object AsyncFunction]",hC="[object Function]",fC="[object GeneratorFunction]",pC="[object Proxy]";function fc(n){if(!$e(n))return!1;var e=ds(n);return e==hC||e==fC||e==dC||e==pC}var pc=on["__core-js_shared__"],Yh=function(){var n=/[^.]+$/.exec(pc&&pc.keys&&pc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function gC(n){return!!Yh&&Yh in n}var mC=Function.prototype,yC=mC.toString;function Fs(n){if(n!=null){try{return yC.call(n)}catch{}try{return n+""}catch{}}return""}var bC=/[\\^$.*+?()[\]{}|]/g,wC=/^\[object .+?Constructor\]$/,xC=Function.prototype,vC=Object.prototype,CC=xC.toString,SC=vC.hasOwnProperty,EC=RegExp("^"+CC.call(SC).replace(bC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OC(n){if(!$e(n)||gC(n))return!1;var e=fc(n)?EC:wC;return e.test(Fs(n))}function MC(n,e){return n==null?void 0:n[e]}function Us(n,e){var t=MC(n,e);return OC(t)?t:void 0}var gc=Us(on,"WeakMap"),qh=Object.create,NC=function(){function n(){}return function(e){if(!$e(e))return{};if(qh)return qh(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Xh(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 Jh(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var _C=800,AC=16,TC=Date.now;function kC(n){var e=0,t=0;return function(){var s=TC(),r=AC-(s-t);if(t=s,r>0){if(++e>=_C)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function VC(n){return function(){return n}}var Ko=function(){try{var n=Us(Object,"defineProperty");return n({},"",{}),n}catch{}}(),DC=Ko?function(n,e){return Ko(n,"toString",{configurable:!0,enumerable:!1,value:VC(e),writable:!0})}:Er,Kh=kC(DC);function RC(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}function IC(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 LC(n){return n!==n}function BC(n,e,t){for(var s=t-1,r=n.length;++s<r;)if(n[s]===e)return s;return-1}function jC(n,e,t){return e===e?BC(n,e,t):IC(n,LC,t)}function Zh(n,e){var t=n==null?0:n.length;return!!t&&jC(n,e,0)>-1}var $C=9007199254740991,zC=/^(?:0|[1-9]\d*)$/;function Zo(n,e){var t=typeof n;return e=e??$C,!!e&&(t=="number"||t!="symbol"&&zC.test(n))&&n>-1&&n%1==0&&n<e}function Qo(n,e,t){e=="__proto__"&&Ko?Ko(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Or(n,e){return n===e||n!==n&&e!==e}var FC=Object.prototype,UC=FC.hasOwnProperty;function mc(n,e,t){var s=n[e];(!(UC.call(n,e)&&Or(s,t))||t===void 0&&!(e in n))&&Qo(n,e,t)}function Di(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?Qo(t,a,c):mc(t,a,c)}return t}var Qh=Math.max;function ef(n,e,t){return e=Qh(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Qh(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),Xh(n,this,a)}}function Mr(n,e){return Kh(ef(n,e,Er),n+"")}var HC=9007199254740991;function yc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=HC}function Hs(n){return n!=null&&yc(n.length)&&!fc(n)}function ea(n,e,t){if(!$e(t))return!1;var s=typeof e;return(s=="number"?Hs(t)&&Zo(e,t.length):s=="string"&&e in t)?Or(t[e],n):!1}function tf(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&&ea(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 GC=Object.prototype;function ta(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||GC;return n===t}function WC(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var YC="[object Arguments]";function nf(n){return an(n)&&ds(n)==YC}var sf=Object.prototype,qC=sf.hasOwnProperty,XC=sf.propertyIsEnumerable,Nr=nf(function(){return arguments}())?nf:function(n){return an(n)&&qC.call(n,"callee")&&!XC.call(n,"callee")};function JC(){return!1}var rf=typeof xe=="object"&&xe&&!xe.nodeType&&xe,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,KC=of&&of.exports===rf,af=KC?on.Buffer:void 0,ZC=af?af.isBuffer:void 0,Pr=ZC||JC,QC="[object Arguments]",eS="[object Array]",tS="[object Boolean]",nS="[object Date]",sS="[object Error]",rS="[object Function]",iS="[object Map]",oS="[object Number]",aS="[object Object]",lS="[object RegExp]",cS="[object Set]",uS="[object String]",dS="[object WeakMap]",hS="[object ArrayBuffer]",fS="[object DataView]",pS="[object Float32Array]",gS="[object Float64Array]",mS="[object Int8Array]",yS="[object Int16Array]",bS="[object Int32Array]",wS="[object Uint8Array]",xS="[object Uint8ClampedArray]",vS="[object Uint16Array]",CS="[object Uint32Array]",Te={};Te[pS]=Te[gS]=Te[mS]=Te[yS]=Te[bS]=Te[wS]=Te[xS]=Te[vS]=Te[CS]=!0,Te[QC]=Te[eS]=Te[hS]=Te[tS]=Te[fS]=Te[nS]=Te[sS]=Te[rS]=Te[iS]=Te[oS]=Te[aS]=Te[lS]=Te[cS]=Te[uS]=Te[dS]=!1;function SS(n){return an(n)&&yc(n.length)&&!!Te[ds(n)]}function na(n){return function(e){return n(e)}}var lf=typeof xe=="object"&&xe&&!xe.nodeType&&xe,Ri=lf&&typeof module=="object"&&module&&!module.nodeType&&module,ES=Ri&&Ri.exports===lf,bc=ES&&$h.process,_r=function(){try{var n=Ri&&Ri.require&&Ri.require("util").types;return n||bc&&bc.binding&&bc.binding("util")}catch{}}(),cf=_r&&_r.isTypedArray,sa=cf?na(cf):SS,OS=Object.prototype,MS=OS.hasOwnProperty;function uf(n,e){var t=pt(n),s=!t&&Nr(n),r=!t&&!s&&Pr(n),i=!t&&!s&&!r&&sa(n),o=t||s||r||i,a=o?WC(n.length,String):[],c=a.length;for(var u in n)(e||MS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Zo(u,c)))&&a.push(u);return a}function df(n,e){return function(t){return n(e(t))}}var NS=df(Object.keys,Object),PS=Object.prototype,_S=PS.hasOwnProperty;function hf(n){if(!ta(n))return NS(n);var e=[];for(var t in Object(n))_S.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ii(n){return Hs(n)?uf(n):hf(n)}function AS(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var TS=Object.prototype,kS=TS.hasOwnProperty;function VS(n){if(!$e(n))return AS(n);var e=ta(n),t=[];for(var s in n)s=="constructor"&&(e||!kS.call(n,s))||t.push(s);return t}function Ar(n){return Hs(n)?uf(n,!0):VS(n)}var DS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RS=/^\w*$/;function wc(n,e){if(pt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||Mn(n)?!0:RS.test(n)||!DS.test(n)||e!=null&&n in Object(e)}var Li=Us(Object,"create");function IS(){this.__data__=Li?Li(null):{},this.size=0}function LS(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var BS="__lodash_hash_undefined__",jS=Object.prototype,$S=jS.hasOwnProperty;function zS(n){var e=this.__data__;if(Li){var t=e[n];return t===BS?void 0:t}return $S.call(e,n)?e[n]:void 0}var FS=Object.prototype,US=FS.hasOwnProperty;function HS(n){var e=this.__data__;return Li?e[n]!==void 0:US.call(e,n)}var GS="__lodash_hash_undefined__";function WS(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Li&&e===void 0?GS:e,this}function Gs(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])}}Gs.prototype.clear=IS,Gs.prototype.delete=LS,Gs.prototype.get=zS,Gs.prototype.has=HS,Gs.prototype.set=WS;function YS(){this.__data__=[],this.size=0}function ra(n,e){for(var t=n.length;t--;)if(Or(n[t][0],e))return t;return-1}var qS=Array.prototype,XS=qS.splice;function JS(n){var e=this.__data__,t=ra(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():XS.call(e,t,1),--this.size,!0}function KS(n){var e=this.__data__,t=ra(e,n);return t<0?void 0:e[t][1]}function ZS(n){return ra(this.__data__,n)>-1}function QS(n,e){var t=this.__data__,s=ra(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Yn(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])}}Yn.prototype.clear=YS,Yn.prototype.delete=JS,Yn.prototype.get=KS,Yn.prototype.has=ZS,Yn.prototype.set=QS;var Bi=Us(on,"Map");function eE(){this.size=0,this.__data__={hash:new Gs,map:new(Bi||Yn),string:new Gs}}function tE(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ia(n,e){var t=n.__data__;return tE(e)?t[typeof e=="string"?"string":"hash"]:t.map}function nE(n){var e=ia(this,n).delete(n);return this.size-=e?1:0,e}function sE(n){return ia(this,n).get(n)}function rE(n){return ia(this,n).has(n)}function iE(n,e){var t=ia(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function qn(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])}}qn.prototype.clear=eE,qn.prototype.delete=nE,qn.prototype.get=sE,qn.prototype.has=rE,qn.prototype.set=iE;var oE="Expected a function";function xc(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(oE);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(xc.Cache||qn),t}xc.Cache=qn;var aE=500;function lE(n){var e=xc(n,function(s){return t.size===aE&&t.clear(),s}),t=e.cache;return e}var cE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uE=/\\(\\)?/g,dE=lE(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(cE,function(t,s,r,i){e.push(r?i.replace(uE,"$1"):s||t)}),e});function ji(n){return n==null?"":Gh(n)}function oa(n,e){return pt(n)?n:wc(n,e)?[n]:dE(ji(n))}var hE=1/0;function $i(n){if(typeof n=="string"||Mn(n))return n;var e=n+"";return e=="0"&&1/n==-hE?"-0":e}function aa(n,e){e=oa(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 ff(n,e,t){var s=n==null?void 0:aa(n,e);return s===void 0?t:s}function vc(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var pf=Ut?Ut.isConcatSpreadable:void 0;function fE(n){return pt(n)||Nr(n)||!!(pf&&n&&n[pf])}function la(n,e,t,s,r){var i=-1,o=n.length;for(t||(t=fE),r||(r=[]);++i<o;){var a=n[i];t(a)?vc(r,a):s||(r[r.length]=a)}return r}function pE(n){var e=n==null?0:n.length;return e?la(n):[]}function gE(n){return Kh(ef(n,void 0,pE),n+"")}var Cc=df(Object.getPrototypeOf,Object),mE="[object Object]",yE=Function.prototype,bE=Object.prototype,gf=yE.toString,wE=bE.hasOwnProperty,xE=gf.call(Object);function Nn(n){if(!an(n)||ds(n)!=mE)return!1;var e=Cc(n);if(e===null)return!0;var t=wE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&gf.call(t)==xE}function vE(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 CE(n,e,t){var s=n.length;return t=t===void 0?s:t,!e&&t>=s?n:vE(n,e,t)}var SE="\\ud800-\\udfff",EE="\\u0300-\\u036f",OE="\\ufe20-\\ufe2f",ME="\\u20d0-\\u20ff",NE=EE+OE+ME,PE="\\ufe0e\\ufe0f",_E="\\u200d",AE=RegExp("["+_E+SE+NE+PE+"]");function mf(n){return AE.test(n)}function TE(n){return n.split("")}var yf="\\ud800-\\udfff",kE="\\u0300-\\u036f",VE="\\ufe20-\\ufe2f",DE="\\u20d0-\\u20ff",RE=kE+VE+DE,IE="\\ufe0e\\ufe0f",LE="["+yf+"]",Sc="["+RE+"]",Ec="\\ud83c[\\udffb-\\udfff]",BE="(?:"+Sc+"|"+Ec+")",bf="[^"+yf+"]",wf="(?:\\ud83c[\\udde6-\\uddff]){2}",xf="[\\ud800-\\udbff][\\udc00-\\udfff]",jE="\\u200d",vf=BE+"?",Cf="["+IE+"]?",$E="(?:"+jE+"(?:"+[bf,wf,xf].join("|")+")"+Cf+vf+")*",zE=Cf+vf+$E,FE="(?:"+[bf+Sc+"?",Sc,wf,xf,LE].join("|")+")",UE=RegExp(Ec+"(?="+Ec+")|"+FE+zE,"g");function HE(n){return n.match(UE)||[]}function GE(n){return mf(n)?HE(n):TE(n)}function Sf(n){return function(e){e=ji(e);var t=mf(e)?GE(e):void 0,s=t?t[0]:e.charAt(0),r=t?CE(t,1).join(""):e.slice(1);return s[n]()+r}}var ca=Sf("toUpperCase");function WE(n){return ca(ji(n).toLowerCase())}function YE(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 qE(n){return function(e){return n==null?void 0:n[e]}}var XE={À:"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"},JE=qE(XE),KE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ZE="\\u0300-\\u036f",QE="\\ufe20-\\ufe2f",eO="\\u20d0-\\u20ff",tO=ZE+QE+eO,nO="["+tO+"]",sO=RegExp(nO,"g");function rO(n){return n=ji(n),n&&n.replace(KE,JE).replace(sO,"")}var iO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function oO(n){return n.match(iO)||[]}var aO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lO(n){return aO.test(n)}var Ef="\\ud800-\\udfff",cO="\\u0300-\\u036f",uO="\\ufe20-\\ufe2f",dO="\\u20d0-\\u20ff",hO=cO+uO+dO,Of="\\u2700-\\u27bf",Mf="a-z\\xdf-\\xf6\\xf8-\\xff",fO="\\xac\\xb1\\xd7\\xf7",pO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gO="\\u2000-\\u206f",mO=" \\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",Nf="A-Z\\xc0-\\xd6\\xd8-\\xde",yO="\\ufe0e\\ufe0f",Pf=fO+pO+gO+mO,_f="['’]",Af="["+Pf+"]",bO="["+hO+"]",Tf="\\d+",wO="["+Of+"]",kf="["+Mf+"]",Vf="[^"+Ef+Pf+Tf+Of+Mf+Nf+"]",xO="\\ud83c[\\udffb-\\udfff]",vO="(?:"+bO+"|"+xO+")",CO="[^"+Ef+"]",Df="(?:\\ud83c[\\udde6-\\uddff]){2}",Rf="[\\ud800-\\udbff][\\udc00-\\udfff]",Tr="["+Nf+"]",SO="\\u200d",If="(?:"+kf+"|"+Vf+")",EO="(?:"+Tr+"|"+Vf+")",Lf="(?:"+_f+"(?:d|ll|m|re|s|t|ve))?",Bf="(?:"+_f+"(?:D|LL|M|RE|S|T|VE))?",jf=vO+"?",$f="["+yO+"]?",OO="(?:"+SO+"(?:"+[CO,Df,Rf].join("|")+")"+$f+jf+")*",MO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",NO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",PO=$f+jf+OO,_O="(?:"+[wO,Df,Rf].join("|")+")"+PO,AO=RegExp([Tr+"?"+kf+"+"+Lf+"(?="+[Af,Tr,"$"].join("|")+")",EO+"+"+Bf+"(?="+[Af,Tr+If,"$"].join("|")+")",Tr+"?"+If+"+"+Lf,Tr+"+"+Bf,NO,MO,Tf,_O].join("|"),"g");function TO(n){return n.match(AO)||[]}function kO(n,e,t){return n=ji(n),e=e,e===void 0?lO(n)?TO(n):oO(n):n.match(e)||[]}var VO="['’]",DO=RegExp(VO,"g");function zf(n){return function(e){return YE(kO(rO(e).replace(DO,"")),n,"")}}var ua=zf(function(n,e,t){return e=e.toLowerCase(),n+(t?WE(e):e)});function RO(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function Et(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Vi(t),t=t===t?t:0),e!==void 0&&(e=Vi(e),e=e===e?e:0),RO(Vi(n),e,t)}function IO(){this.__data__=new Yn,this.size=0}function LO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function BO(n){return this.__data__.get(n)}function jO(n){return this.__data__.has(n)}var $O=200;function zO(n,e){var t=this.__data__;if(t instanceof Yn){var s=t.__data__;if(!Bi||s.length<$O-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new qn(s)}return t.set(n,e),this.size=t.size,this}function ln(n){var e=this.__data__=new Yn(n);this.size=e.size}ln.prototype.clear=IO,ln.prototype.delete=LO,ln.prototype.get=BO,ln.prototype.has=jO,ln.prototype.set=zO;function FO(n,e){return n&&Di(e,Ii(e),n)}function UO(n,e){return n&&Di(e,Ar(e),n)}var Ff=typeof xe=="object"&&xe&&!xe.nodeType&&xe,Uf=Ff&&typeof module=="object"&&module&&!module.nodeType&&module,HO=Uf&&Uf.exports===Ff,Hf=HO?on.Buffer:void 0,Gf=Hf?Hf.allocUnsafe:void 0;function Wf(n,e){if(e)return n.slice();var t=n.length,s=Gf?Gf(t):new n.constructor(t);return n.copy(s),s}function GO(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 Yf(){return[]}var WO=Object.prototype,YO=WO.propertyIsEnumerable,qf=Object.getOwnPropertySymbols,Oc=qf?function(n){return n==null?[]:(n=Object(n),GO(qf(n),function(e){return YO.call(n,e)}))}:Yf;function qO(n,e){return Di(n,Oc(n),e)}var XO=Object.getOwnPropertySymbols,Xf=XO?function(n){for(var e=[];n;)vc(e,Oc(n)),n=Cc(n);return e}:Yf;function JO(n,e){return Di(n,Xf(n),e)}function Jf(n,e,t){var s=e(n);return pt(n)?s:vc(s,t(n))}function Mc(n){return Jf(n,Ii,Oc)}function KO(n){return Jf(n,Ar,Xf)}var Nc=Us(on,"DataView"),Pc=Us(on,"Promise"),kr=Us(on,"Set"),Kf="[object Map]",ZO="[object Object]",Zf="[object Promise]",Qf="[object Set]",ep="[object WeakMap]",tp="[object DataView]",QO=Fs(Nc),e2=Fs(Bi),t2=Fs(Pc),n2=Fs(kr),s2=Fs(gc),Ht=ds;(Nc&&Ht(new Nc(new ArrayBuffer(1)))!=tp||Bi&&Ht(new Bi)!=Kf||Pc&&Ht(Pc.resolve())!=Zf||kr&&Ht(new kr)!=Qf||gc&&Ht(new gc)!=ep)&&(Ht=function(n){var e=ds(n),t=e==ZO?n.constructor:void 0,s=t?Fs(t):"";if(s)switch(s){case QO:return tp;case e2:return Kf;case t2:return Zf;case n2:return Qf;case s2:return ep}return e});var r2=Object.prototype,i2=r2.hasOwnProperty;function o2(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&i2.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var da=on.Uint8Array;function _c(n){var e=new n.constructor(n.byteLength);return new da(e).set(new da(n)),e}function a2(n,e){var t=e?_c(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var l2=/\w*$/;function c2(n){var e=new n.constructor(n.source,l2.exec(n));return e.lastIndex=n.lastIndex,e}var np=Ut?Ut.prototype:void 0,sp=np?np.valueOf:void 0;function u2(n){return sp?Object(sp.call(n)):{}}function rp(n,e){var t=e?_c(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var d2="[object Boolean]",h2="[object Date]",f2="[object Map]",p2="[object Number]",g2="[object RegExp]",m2="[object Set]",y2="[object String]",b2="[object Symbol]",w2="[object ArrayBuffer]",x2="[object DataView]",v2="[object Float32Array]",C2="[object Float64Array]",S2="[object Int8Array]",E2="[object Int16Array]",O2="[object Int32Array]",M2="[object Uint8Array]",N2="[object Uint8ClampedArray]",P2="[object Uint16Array]",_2="[object Uint32Array]";function A2(n,e,t){var s=n.constructor;switch(e){case w2:return _c(n);case d2:case h2:return new s(+n);case x2:return a2(n,t);case v2:case C2:case S2:case E2:case O2:case M2:case N2:case P2:case _2:return rp(n,t);case f2:return new s;case p2:case y2:return new s(n);case g2:return c2(n);case m2:return new s;case b2:return u2(n)}}function ip(n){return typeof n.constructor=="function"&&!ta(n)?NC(Cc(n)):{}}var T2="[object Map]";function k2(n){return an(n)&&Ht(n)==T2}var op=_r&&_r.isMap,V2=op?na(op):k2,D2="[object Set]";function R2(n){return an(n)&&Ht(n)==D2}var ap=_r&&_r.isSet,I2=ap?na(ap):R2,L2=1,B2=2,j2=4,lp="[object Arguments]",$2="[object Array]",z2="[object Boolean]",F2="[object Date]",U2="[object Error]",cp="[object Function]",H2="[object GeneratorFunction]",G2="[object Map]",W2="[object Number]",up="[object Object]",Y2="[object RegExp]",q2="[object Set]",X2="[object String]",J2="[object Symbol]",K2="[object WeakMap]",Z2="[object ArrayBuffer]",Q2="[object DataView]",eM="[object Float32Array]",tM="[object Float64Array]",nM="[object Int8Array]",sM="[object Int16Array]",rM="[object Int32Array]",iM="[object Uint8Array]",oM="[object Uint8ClampedArray]",aM="[object Uint16Array]",lM="[object Uint32Array]",Pe={};Pe[lp]=Pe[$2]=Pe[Z2]=Pe[Q2]=Pe[z2]=Pe[F2]=Pe[eM]=Pe[tM]=Pe[nM]=Pe[sM]=Pe[rM]=Pe[G2]=Pe[W2]=Pe[up]=Pe[Y2]=Pe[q2]=Pe[X2]=Pe[J2]=Pe[iM]=Pe[oM]=Pe[aM]=Pe[lM]=!0,Pe[U2]=Pe[cp]=Pe[K2]=!1;function zi(n,e,t,s,r,i){var o,a=e&L2,c=e&B2,u=e&j2;if(o!==void 0)return o;if(!$e(n))return n;var d=pt(n);if(d){if(o=o2(n),!a)return Jh(n,o)}else{var h=Ht(n),f=h==cp||h==H2;if(Pr(n))return Wf(n,a);if(h==up||h==lp||f&&!r){if(o=c||f?{}:ip(n),!a)return c?JO(n,UO(o,n)):qO(n,FO(o,n))}else{if(!Pe[h])return r?n:{};o=A2(n,h,a)}}i||(i=new ln);var p=i.get(n);if(p)return p;i.set(n,o),I2(n)?n.forEach(function(y){o.add(zi(y,e,t,y,n,i))}):V2(n)&&n.forEach(function(y,b){o.set(b,zi(y,e,t,b,n,i))});var g=u?c?KO:Mc:c?Ar:Ii,m=d?void 0:g(n);return RC(m||n,function(y,b){m&&(b=y,y=n[b]),mc(o,b,zi(y,e,t,b,n,i))}),o}var cM=4;function Ac(n){return zi(n,cM)}var uM=1,dM=4;function ke(n){return zi(n,uM|dM)}var hM="__lodash_hash_undefined__";function fM(n){return this.__data__.set(n,hM),this}function pM(n){return this.__data__.has(n)}function Vr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new qn;++e<t;)this.add(n[e])}Vr.prototype.add=Vr.prototype.push=fM,Vr.prototype.has=pM;function gM(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 Tc(n,e){return n.has(e)}var mM=1,yM=2;function dp(n,e,t,s,r,i){var o=t&mM,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&yM?new Vr: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(!gM(e,function(b,w){if(!Tc(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 bM(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function kc(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var wM=1,xM=2,vM="[object Boolean]",CM="[object Date]",SM="[object Error]",EM="[object Map]",OM="[object Number]",MM="[object RegExp]",NM="[object Set]",PM="[object String]",_M="[object Symbol]",AM="[object ArrayBuffer]",TM="[object DataView]",hp=Ut?Ut.prototype:void 0,Vc=hp?hp.valueOf:void 0;function kM(n,e,t,s,r,i,o){switch(t){case TM:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case AM:return!(n.byteLength!=e.byteLength||!i(new da(n),new da(e)));case vM:case CM:case OM:return Or(+n,+e);case SM:return n.name==e.name&&n.message==e.message;case MM:case PM:return n==e+"";case EM:var a=bM;case NM:var c=s&wM;if(a||(a=kc),n.size!=e.size&&!c)return!1;var u=o.get(n);if(u)return u==e;s|=xM,o.set(n,e);var d=dp(a(n),a(e),s,r,i,o);return o.delete(n),d;case _M:if(Vc)return Vc.call(n)==Vc.call(e)}return!1}var VM=1,DM=Object.prototype,RM=DM.hasOwnProperty;function IM(n,e,t,s,r,i){var o=t&VM,a=Mc(n),c=a.length,u=Mc(e),d=u.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var f=a[h];if(!(o?f in e:RM.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 C=n.constructor,E=e.constructor;C!=E&&"constructor"in n&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof E=="function"&&E instanceof E)&&(m=!1)}return i.delete(n),i.delete(e),m}var LM=1,fp="[object Arguments]",pp="[object Array]",ha="[object Object]",BM=Object.prototype,gp=BM.hasOwnProperty;function jM(n,e,t,s,r,i){var o=pt(n),a=pt(e),c=o?pp:Ht(n),u=a?pp:Ht(e);c=c==fp?ha:c,u=u==fp?ha:u;var d=c==ha,h=u==ha,f=c==u;if(f&&Pr(n)){if(!Pr(e))return!1;o=!0,d=!1}if(f&&!d)return i||(i=new ln),o||sa(n)?dp(n,e,t,s,r,i):kM(n,e,c,t,s,r,i);if(!(t&LM)){var p=d&&gp.call(n,"__wrapped__"),g=h&&gp.call(e,"__wrapped__");if(p||g){var m=p?n.value():n,y=g?e.value():e;return i||(i=new ln),r(m,y,t,s,i)}}return f?(i||(i=new ln),IM(n,e,t,s,r,i)):!1}function fa(n,e,t,s,r){return n===e?!0:n==null||e==null||!an(n)&&!an(e)?n!==n&&e!==e:jM(n,e,t,s,fa,r)}var $M=1,zM=2;function FM(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 ln,h;if(!(h===void 0?fa(u,c,$M|zM,s,d):h))return!1}}return!0}function mp(n){return n===n&&!$e(n)}function UM(n){for(var e=Ii(n),t=e.length;t--;){var s=e[t],r=n[s];e[t]=[s,r,mp(r)]}return e}function yp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function HM(n){var e=UM(n);return e.length==1&&e[0][2]?yp(e[0][0],e[0][1]):function(t){return t===n||FM(t,n,e)}}function GM(n,e){return n!=null&&e in Object(n)}function bp(n,e,t){e=oa(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&&yc(r)&&Zo(o,r)&&(pt(n)||Nr(n)))}function wp(n,e){return n!=null&&bp(n,e,GM)}var WM=1,YM=2;function qM(n,e){return wc(n)&&mp(e)?yp($i(n),e):function(t){var s=ff(t,n);return s===void 0&&s===e?wp(t,n):fa(e,s,WM|YM)}}function XM(n){return function(e){return e==null?void 0:e[n]}}function JM(n){return function(e){return aa(e,n)}}function KM(n){return wc(n)?XM($i(n)):JM(n)}function Dc(n){return typeof n=="function"?n:n==null?Er:typeof n=="object"?pt(n)?qM(n[0],n[1]):HM(n):KM(n)}function ZM(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 QM(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 xp=QM();function eN(n,e){return n&&xp(n,e,Ii)}function tN(n,e){return function(t,s){if(t==null)return t;if(!Hs(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 vp=tN(eN);function nN(n,e,t,s){return vp(n,function(r,i,o){e(s,r,t(r),o)}),s}function sN(n,e){return function(t,s){var r=pt(t)?ZM:nN,i=e?e():{};return r(t,n,Dc(s),i)}}var Rc=function(){return on.Date.now()},rN="Expected a function",iN=Math.max,oN=Math.min;function Cp(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(rN);e=Vi(e)||0,$e(t)&&(d=!!t.leading,h="maxWait"in t,i=h?iN(Vi(t.maxWait)||0,e):i,f="trailing"in t?!!t.trailing:f);function p(v){var S=s,O=r;return s=r=void 0,u=v,o=n.apply(O,S),o}function g(v){return u=v,a=setTimeout(b,e),d?p(v):o}function m(v){var S=v-c,O=v-u,_=e-S;return h?oN(_,i-O):_}function y(v){var S=v-c,O=v-u;return c===void 0||S>=e||S<0||h&&O>=i}function b(){var v=Rc();if(y(v))return w(v);a=setTimeout(b,m(v))}function w(v){return a=void 0,f&&s?p(v):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=c=r=a=void 0}function C(){return a===void 0?o:w(Rc())}function E(){var v=Rc(),S=y(v);if(s=arguments,r=this,c=v,S){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 E.cancel=x,E.flush=C,E}var Sp=Object.prototype,aN=Sp.hasOwnProperty,lN=Mr(function(n,e){n=Object(n);var t=-1,s=e.length,r=s>2?e[2]:void 0;for(r&&ea(e[0],e[1],r)&&(s=1);++t<s;)for(var i=e[t],o=Ar(i),a=-1,c=o.length;++a<c;){var u=o[a],d=n[u];(d===void 0||Or(d,Sp[u])&&!aN.call(n,u))&&(n[u]=i[u])}return n});function Ic(n,e,t){(t!==void 0&&!Or(n[e],t)||t===void 0&&!(e in n))&&Qo(n,e,t)}function pa(n){return an(n)&&Hs(n)}function Lc(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function cN(n){return Di(n,Ar(n))}function uN(n,e,t,s,r,i,o){var a=Lc(n,t),c=Lc(e,t),u=o.get(c);if(u){Ic(n,t,u);return}var d=i?i(a,c,t+"",n,e,o):void 0,h=d===void 0;if(h){var f=pt(c),p=!f&&Pr(c),g=!f&&!p&&sa(c);d=c,f||p||g?pt(a)?d=a:pa(a)?d=Jh(a):p?(h=!1,d=Wf(c,!0)):g?(h=!1,d=rp(c,!0)):d=[]:Nn(c)||Nr(c)?(d=a,Nr(a)?d=cN(a):(!$e(a)||fc(a))&&(d=ip(c))):h=!1}h&&(o.set(c,d),r(d,c,s,i,o),o.delete(c)),Ic(n,t,d)}function ga(n,e,t,s,r){n!==e&&xp(e,function(i,o){if(r||(r=new ln),$e(i))uN(n,e,o,t,ga,s,r);else{var a=s?s(Lc(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),Ic(n,o,a)}},Ar)}function Ep(n,e,t,s,r,i){return $e(n)&&$e(e)&&(i.set(e,n),ga(n,e,void 0,Ep,i),i.delete(e)),n}var dN=tf(function(n,e,t,s){ga(n,e,t,s)}),Op=Mr(function(n){return n.push(void 0,Ep),Xh(dN,void 0,n)}),hN=200;function fN(n,e,t,s){var r=-1,i=Zh,o=!0,a=n.length,c=[],u=e.length;if(!a)return c;e.length>=hN&&(i=Tc,o=!1,e=new Vr(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 pN=Mr(function(n,e){return pa(n)?fN(n,la(e,1,pa,!0)):[]});function gN(n,e){var t=-1,s=Hs(n)?Array(n.length):[];return vp(n,function(r,i,o){s[++t]=e(r,i,o)}),s}function ma(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 mN=Object.prototype,yN=mN.hasOwnProperty,Mp=sN(function(n,e,t){yN.call(n,t)?n[t].push(e):Qo(n,t,[e])});function bN(n,e){return n>e}var wN=Object.prototype,xN=wN.hasOwnProperty;function vN(n,e){return n!=null&&xN.call(n,e)}function ya(n,e){return n!=null&&bp(n,e,vN)}var CN="[object Map]",SN="[object Set]",EN=Object.prototype,ON=EN.hasOwnProperty;function Np(n){if(n==null)return!0;if(Hs(n)&&(pt(n)||typeof n=="string"||typeof n.splice=="function"||Pr(n)||sa(n)||Nr(n)))return!n.length;var e=Ht(n);if(e==CN||e==SN)return!n.size;if(ta(n))return!hf(n).length;for(var t in n)if(ON.call(n,t))return!1;return!0}function Pn(n,e){return fa(n,e)}var MN="[object Number]";function Bc(n){return typeof n=="number"||an(n)&&ds(n)==MN}function ba(n){return n==null}function NN(n){return n===void 0}var PN=Sf("toLowerCase");function _N(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&&!Mn(o):t(o,a)))var a=o,c=i}return c}function AN(n){return n&&n.length?_N(n,Er,bN):void 0}var Xe=tf(function(n,e,t){ga(n,e,t)});function TN(n,e,t,s){if(!$e(n))return n;e=oa(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=$e(d)?d:Zo(e[r+1])?[]:{})}mc(a,c,u),a=a[c]}return n}function kN(n,e,t){for(var s=-1,r=e.length,i={};++s<r;){var o=e[s],a=aa(n,o);t(a,o)&&TN(i,oa(o,n),a)}return i}function VN(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function DN(n,e){if(n!==e){var t=n!==void 0,s=n===null,r=n===n,i=Mn(n),o=e!==void 0,a=e===null,c=e===e,u=Mn(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 RN(n,e,t){for(var s=-1,r=n.criteria,i=e.criteria,o=r.length,a=t.length;++s<o;){var c=DN(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 IN(n,e,t){e.length?e=Jo(e,function(i){return pt(i)?function(o){return aa(o,i.length===1?i[0]:i)}:i}):e=[Er];var s=-1;e=Jo(e,na(Dc));var r=gN(n,function(i,o,a){var c=Jo(e,function(u){return u(i)});return{criteria:c,index:++s,value:i}});return VN(r,function(i,o){return RN(i,o,t)})}function LN(n,e){return kN(n,e,function(t,s){return wp(n,s)})}var jc=gE(function(n,e){return n==null?{}:LN(n,e)}),$c=Mr(function(n,e){if(n==null)return[];var t=e.length;return t>1&&ea(n,e[0],e[1])?e=[]:t>2&&ea(e[0],e[1],e[2])&&(e=[e[0]]),IN(n,la(e),[])}),BN=4294967295,jN=BN-1,$N=Math.floor,zN=Math.min;function Pp(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=Mn(e),u=e===void 0;r<i;){var d=$N((r+i)/2),h=t(n[d]),f=h!==void 0,p=h===null,g=h===h,m=Mn(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 zN(i,jN)}var FN=4294967295,UN=FN>>>1;function HN(n,e,t){var s=0,r=n==null?s:n.length;if(typeof e=="number"&&e===e&&r<=UN){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!Mn(o)&&o<e?s=i+1:r=i}return r}return Pp(n,e,Er)}function GN(n,e){return HN(n,e)}function WN(n,e,t){return Pp(n,e,Dc(t))}var YN=zf(function(n,e,t){return n+(t?" ":"")+ca(e)}),qN="Expected a function";function XN(n,e,t){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(qN);return $e(t)&&(s="leading"in t?!!t.leading:s,r="trailing"in t?!!t.trailing:r),Cp(n,e,{leading:s,maxWait:e,trailing:r})}var JN=1/0,KN=kr&&1/kc(new kr([,-0]))[1]==JN?function(n){return new kr(n)}:PC,ZN=200;function _p(n,e,t){var s=-1,r=Zh,i=n.length,o=!0,a=[],c=a;if(i>=ZN){var u=KN(n);if(u)return kc(u);o=!1,r=Tc,c=new Vr}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 Ap=Mr(function(n){return _p(la(n,1,pa,!0))});function Tp(n){return n&&n.length?_p(n):[]}const kp=n=>n===void 0,wa=n=>typeof n=="boolean",Gt=n=>typeof n=="number",Xn=n=>typeof Element>"u"?!1:n instanceof Element,QN=n=>rn(n)?!Number.isNaN(Number(n)):!1,Vp=n=>Object.keys(n);class Dp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function eP(n,e){throw new Dp(`[${n}] ${e}`)}function Vt(n,e){if(process.env.NODE_ENV!=="production"){const t=rn(n)?new Dp(`[${n}] ${e}`):n;console.warn(t)}}const tP="utils/dom/style",Rp=(n="")=>n.split(" ").filter(e=>!!e.trim()),Ip=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},nP=(n,e)=>{!n||!e.trim()||n.classList.add(...Rp(e))},sP=(n,e)=>{!n||!e.trim()||n.classList.remove(...Rp(e))},rP=(n,e)=>{var t;if(!qe||!n||!e)return"";let s=Gv(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 Fi(n,e="px"){if(!n)return"";if(Gt(n)||QN(n))return`${n}${e}`;if(rn(n))return n;Vt(tP,"binding value must be a string or number")}let xa;const iP=n=>{var e;if(!qe)return 0;if(xa!==void 0)return xa;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),xa=s-i,xa};/*! Element Plus Icons Vue v2.3.1 */var oP=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"})]))}}),aP=oP,lP=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"})]))}}),Lp=lP,cP=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"})]))}}),Bp=cP,uP=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"})]))}}),dP=uP,hP=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"})]))}}),fP=hP,pP=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"})]))}}),jp=pP,gP=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"})]))}}),va=gP,mP=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"})]))}}),$p=mP,yP=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"})]))}}),bP=yP,wP=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"})]))}}),zp=wP;const Fp="__epPropKey",fe=n=>n,xP=n=>Sr(n)&&!!n[Fp],Ca=(n,e)=>{if(!Sr(n)||xP(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),Xo(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,[Fp]:!0};return Xo(n,"default")&&(c.default=r),c},tt=n=>ma(Object.entries(n).map(([e,t])=>[e,Ca(t,e)])),Ui=fe([String,Object,Function]),Up={Close:dP,SuccessFilled:$p,InfoFilled:jp,WarningFilled:zp,CircleCloseFilled:Lp},Sa={success:$p,warning:zp,error:Lp,info:jp},vP={validating:va,success:aP,error:Bp},Ws=(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},CP=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),SP=n=>(n.install=us,n),Dr={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"},zc="update:modelValue",Hp=["","default","small","large"],EP=n=>["",...Hp].includes(n);var Ea=(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))(Ea||{});const OP=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),Gp=n=>n,MP=["class","style"],NP=/^on[A-Z]/,PP=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,s=l.computed(()=>((t==null?void 0:t.value)||[]).concat(MP)),r=l.getCurrentInstance();return r?l.computed(()=>{var i;return ma(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(e&&NP.test(o))))}):(Vt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},_P=({from:n,replacement:e,scope:t,version:s,ref:r,type:i="API"},o)=>{l.watch(()=>l.unref(o),a=>{a&&Vt(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 ds=()=>{},zv=Object.prototype.hasOwnProperty,Xo=(n,e)=>zv.call(n,e),Fv=Array.isArray,zt=n=>typeof n=="function",rn=n=>typeof n=="string",Sr=n=>n!==null&&typeof n=="object",Uv=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hv=/-(\w)/g,Gv=Uv(n=>n.replace(Hv,(e,t)=>t?t.toUpperCase():""));var $h=typeof global=="object"&&global&&global.Object===Object&&global,Wv=typeof self=="object"&&self&&self.Object===Object&&self,on=$h||Wv||Function("return this")(),Ft=on.Symbol,zh=Object.prototype,Yv=zh.hasOwnProperty,qv=zh.toString,ki=Ft?Ft.toStringTag:void 0;function Xv(n){var e=Yv.call(n,ki),t=n[ki];try{n[ki]=void 0;var s=!0}catch{}var r=qv.call(n);return s&&(e?n[ki]=t:delete n[ki]),r}var Jv=Object.prototype,Kv=Jv.toString;function Zv(n){return Kv.call(n)}var Qv="[object Null]",eC="[object Undefined]",Fh=Ft?Ft.toStringTag:void 0;function hs(n){return n==null?n===void 0?eC:Qv:Fh&&Fh in Object(n)?Xv(n):Zv(n)}function an(n){return n!=null&&typeof n=="object"}var tC="[object Symbol]";function Mn(n){return typeof n=="symbol"||an(n)&&hs(n)==tC}function Jo(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 ft=Array.isArray,nC=1/0,Uh=Ft?Ft.prototype:void 0,Hh=Uh?Uh.toString:void 0;function Gh(n){if(typeof n=="string")return n;if(ft(n))return Jo(n,Gh)+"";if(Mn(n))return Hh?Hh.call(n):"";var e=n+"";return e=="0"&&1/n==-nC?"-0":e}var sC=/\s/;function rC(n){for(var e=n.length;e--&&sC.test(n.charAt(e)););return e}var iC=/^\s+/;function oC(n){return n&&n.slice(0,rC(n)+1).replace(iC,"")}function Be(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Wh=NaN,aC=/^[-+]0x[0-9a-f]+$/i,lC=/^0b[01]+$/i,cC=/^0o[0-7]+$/i,uC=parseInt;function Vi(n){if(typeof n=="number")return n;if(Mn(n))return Wh;if(Be(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Be(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=oC(n);var t=lC.test(n);return t||cC.test(n)?uC(n.slice(2),t?2:8):aC.test(n)?Wh:+n}function Er(n){return n}var dC="[object AsyncFunction]",hC="[object Function]",fC="[object GeneratorFunction]",pC="[object Proxy]";function dc(n){if(!Be(n))return!1;var e=hs(n);return e==hC||e==fC||e==dC||e==pC}var hc=on["__core-js_shared__"],Yh=function(){var n=/[^.]+$/.exec(hc&&hc.keys&&hc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function gC(n){return!!Yh&&Yh in n}var mC=Function.prototype,yC=mC.toString;function Fs(n){if(n!=null){try{return yC.call(n)}catch{}try{return n+""}catch{}}return""}var bC=/[\\^$.*+?()[\]{}|]/g,wC=/^\[object .+?Constructor\]$/,xC=Function.prototype,vC=Object.prototype,CC=xC.toString,SC=vC.hasOwnProperty,EC=RegExp("^"+CC.call(SC).replace(bC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OC(n){if(!Be(n)||gC(n))return!1;var e=dc(n)?EC:wC;return e.test(Fs(n))}function MC(n,e){return n==null?void 0:n[e]}function Us(n,e){var t=MC(n,e);return OC(t)?t:void 0}var fc=Us(on,"WeakMap"),qh=Object.create,NC=function(){function n(){}return function(e){if(!Be(e))return{};if(qh)return qh(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Xh(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 Jh(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var _C=800,AC=16,TC=Date.now;function kC(n){var e=0,t=0;return function(){var s=TC(),r=AC-(s-t);if(t=s,r>0){if(++e>=_C)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function VC(n){return function(){return n}}var Ko=function(){try{var n=Us(Object,"defineProperty");return n({},"",{}),n}catch{}}(),DC=Ko?function(n,e){return Ko(n,"toString",{configurable:!0,enumerable:!1,value:VC(e),writable:!0})}:Er,Kh=kC(DC);function RC(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}function IC(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 LC(n){return n!==n}function BC(n,e,t){for(var s=t-1,r=n.length;++s<r;)if(n[s]===e)return s;return-1}function jC(n,e,t){return e===e?BC(n,e,t):IC(n,LC,t)}function Zh(n,e){var t=n==null?0:n.length;return!!t&&jC(n,e,0)>-1}var $C=9007199254740991,zC=/^(?:0|[1-9]\d*)$/;function Zo(n,e){var t=typeof n;return e=e??$C,!!e&&(t=="number"||t!="symbol"&&zC.test(n))&&n>-1&&n%1==0&&n<e}function Qo(n,e,t){e=="__proto__"&&Ko?Ko(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Or(n,e){return n===e||n!==n&&e!==e}var FC=Object.prototype,UC=FC.hasOwnProperty;function pc(n,e,t){var s=n[e];(!(UC.call(n,e)&&Or(s,t))||t===void 0&&!(e in n))&&Qo(n,e,t)}function Di(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?Qo(t,a,c):pc(t,a,c)}return t}var Qh=Math.max;function ef(n,e,t){return e=Qh(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Qh(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),Xh(n,this,a)}}function Mr(n,e){return Kh(ef(n,e,Er),n+"")}var HC=9007199254740991;function gc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=HC}function Hs(n){return n!=null&&gc(n.length)&&!dc(n)}function ea(n,e,t){if(!Be(t))return!1;var s=typeof e;return(s=="number"?Hs(t)&&Zo(e,t.length):s=="string"&&e in t)?Or(t[e],n):!1}function tf(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&&ea(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 GC=Object.prototype;function ta(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||GC;return n===t}function WC(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var YC="[object Arguments]";function nf(n){return an(n)&&hs(n)==YC}var sf=Object.prototype,qC=sf.hasOwnProperty,XC=sf.propertyIsEnumerable,Nr=nf(function(){return arguments}())?nf:function(n){return an(n)&&qC.call(n,"callee")&&!XC.call(n,"callee")};function JC(){return!1}var rf=typeof we=="object"&&we&&!we.nodeType&&we,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,KC=of&&of.exports===rf,af=KC?on.Buffer:void 0,ZC=af?af.isBuffer:void 0,Pr=ZC||JC,QC="[object Arguments]",eS="[object Array]",tS="[object Boolean]",nS="[object Date]",sS="[object Error]",rS="[object Function]",iS="[object Map]",oS="[object Number]",aS="[object Object]",lS="[object RegExp]",cS="[object Set]",uS="[object String]",dS="[object WeakMap]",hS="[object ArrayBuffer]",fS="[object DataView]",pS="[object Float32Array]",gS="[object Float64Array]",mS="[object Int8Array]",yS="[object Int16Array]",bS="[object Int32Array]",wS="[object Uint8Array]",xS="[object Uint8ClampedArray]",vS="[object Uint16Array]",CS="[object Uint32Array]",Ae={};Ae[pS]=Ae[gS]=Ae[mS]=Ae[yS]=Ae[bS]=Ae[wS]=Ae[xS]=Ae[vS]=Ae[CS]=!0,Ae[QC]=Ae[eS]=Ae[hS]=Ae[tS]=Ae[fS]=Ae[nS]=Ae[sS]=Ae[rS]=Ae[iS]=Ae[oS]=Ae[aS]=Ae[lS]=Ae[cS]=Ae[uS]=Ae[dS]=!1;function SS(n){return an(n)&&gc(n.length)&&!!Ae[hs(n)]}function na(n){return function(e){return n(e)}}var lf=typeof we=="object"&&we&&!we.nodeType&&we,Ri=lf&&typeof module=="object"&&module&&!module.nodeType&&module,ES=Ri&&Ri.exports===lf,mc=ES&&$h.process,_r=function(){try{var n=Ri&&Ri.require&&Ri.require("util").types;return n||mc&&mc.binding&&mc.binding("util")}catch{}}(),cf=_r&&_r.isTypedArray,sa=cf?na(cf):SS,OS=Object.prototype,MS=OS.hasOwnProperty;function uf(n,e){var t=ft(n),s=!t&&Nr(n),r=!t&&!s&&Pr(n),i=!t&&!s&&!r&&sa(n),o=t||s||r||i,a=o?WC(n.length,String):[],c=a.length;for(var u in n)(e||MS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Zo(u,c)))&&a.push(u);return a}function df(n,e){return function(t){return n(e(t))}}var NS=df(Object.keys,Object),PS=Object.prototype,_S=PS.hasOwnProperty;function hf(n){if(!ta(n))return NS(n);var e=[];for(var t in Object(n))_S.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ii(n){return Hs(n)?uf(n):hf(n)}function AS(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var TS=Object.prototype,kS=TS.hasOwnProperty;function VS(n){if(!Be(n))return AS(n);var e=ta(n),t=[];for(var s in n)s=="constructor"&&(e||!kS.call(n,s))||t.push(s);return t}function Ar(n){return Hs(n)?uf(n,!0):VS(n)}var DS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RS=/^\w*$/;function yc(n,e){if(ft(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||Mn(n)?!0:RS.test(n)||!DS.test(n)||e!=null&&n in Object(e)}var Li=Us(Object,"create");function IS(){this.__data__=Li?Li(null):{},this.size=0}function LS(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var BS="__lodash_hash_undefined__",jS=Object.prototype,$S=jS.hasOwnProperty;function zS(n){var e=this.__data__;if(Li){var t=e[n];return t===BS?void 0:t}return $S.call(e,n)?e[n]:void 0}var FS=Object.prototype,US=FS.hasOwnProperty;function HS(n){var e=this.__data__;return Li?e[n]!==void 0:US.call(e,n)}var GS="__lodash_hash_undefined__";function WS(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Li&&e===void 0?GS:e,this}function Gs(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])}}Gs.prototype.clear=IS,Gs.prototype.delete=LS,Gs.prototype.get=zS,Gs.prototype.has=HS,Gs.prototype.set=WS;function YS(){this.__data__=[],this.size=0}function ra(n,e){for(var t=n.length;t--;)if(Or(n[t][0],e))return t;return-1}var qS=Array.prototype,XS=qS.splice;function JS(n){var e=this.__data__,t=ra(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():XS.call(e,t,1),--this.size,!0}function KS(n){var e=this.__data__,t=ra(e,n);return t<0?void 0:e[t][1]}function ZS(n){return ra(this.__data__,n)>-1}function QS(n,e){var t=this.__data__,s=ra(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Yn(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])}}Yn.prototype.clear=YS,Yn.prototype.delete=JS,Yn.prototype.get=KS,Yn.prototype.has=ZS,Yn.prototype.set=QS;var Bi=Us(on,"Map");function eE(){this.size=0,this.__data__={hash:new Gs,map:new(Bi||Yn),string:new Gs}}function tE(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ia(n,e){var t=n.__data__;return tE(e)?t[typeof e=="string"?"string":"hash"]:t.map}function nE(n){var e=ia(this,n).delete(n);return this.size-=e?1:0,e}function sE(n){return ia(this,n).get(n)}function rE(n){return ia(this,n).has(n)}function iE(n,e){var t=ia(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function qn(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])}}qn.prototype.clear=eE,qn.prototype.delete=nE,qn.prototype.get=sE,qn.prototype.has=rE,qn.prototype.set=iE;var oE="Expected a function";function bc(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(oE);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(bc.Cache||qn),t}bc.Cache=qn;var aE=500;function lE(n){var e=bc(n,function(s){return t.size===aE&&t.clear(),s}),t=e.cache;return e}var cE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uE=/\\(\\)?/g,dE=lE(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(cE,function(t,s,r,i){e.push(r?i.replace(uE,"$1"):s||t)}),e});function ji(n){return n==null?"":Gh(n)}function oa(n,e){return ft(n)?n:yc(n,e)?[n]:dE(ji(n))}var hE=1/0;function $i(n){if(typeof n=="string"||Mn(n))return n;var e=n+"";return e=="0"&&1/n==-hE?"-0":e}function aa(n,e){e=oa(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 ff(n,e,t){var s=n==null?void 0:aa(n,e);return s===void 0?t:s}function wc(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var pf=Ft?Ft.isConcatSpreadable:void 0;function fE(n){return ft(n)||Nr(n)||!!(pf&&n&&n[pf])}function la(n,e,t,s,r){var i=-1,o=n.length;for(t||(t=fE),r||(r=[]);++i<o;){var a=n[i];t(a)?wc(r,a):s||(r[r.length]=a)}return r}function pE(n){var e=n==null?0:n.length;return e?la(n):[]}function gE(n){return Kh(ef(n,void 0,pE),n+"")}var xc=df(Object.getPrototypeOf,Object),mE="[object Object]",yE=Function.prototype,bE=Object.prototype,gf=yE.toString,wE=bE.hasOwnProperty,xE=gf.call(Object);function Nn(n){if(!an(n)||hs(n)!=mE)return!1;var e=xc(n);if(e===null)return!0;var t=wE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&gf.call(t)==xE}function vE(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 CE(n,e,t){var s=n.length;return t=t===void 0?s:t,!e&&t>=s?n:vE(n,e,t)}var SE="\\ud800-\\udfff",EE="\\u0300-\\u036f",OE="\\ufe20-\\ufe2f",ME="\\u20d0-\\u20ff",NE=EE+OE+ME,PE="\\ufe0e\\ufe0f",_E="\\u200d",AE=RegExp("["+_E+SE+NE+PE+"]");function mf(n){return AE.test(n)}function TE(n){return n.split("")}var yf="\\ud800-\\udfff",kE="\\u0300-\\u036f",VE="\\ufe20-\\ufe2f",DE="\\u20d0-\\u20ff",RE=kE+VE+DE,IE="\\ufe0e\\ufe0f",LE="["+yf+"]",vc="["+RE+"]",Cc="\\ud83c[\\udffb-\\udfff]",BE="(?:"+vc+"|"+Cc+")",bf="[^"+yf+"]",wf="(?:\\ud83c[\\udde6-\\uddff]){2}",xf="[\\ud800-\\udbff][\\udc00-\\udfff]",jE="\\u200d",vf=BE+"?",Cf="["+IE+"]?",$E="(?:"+jE+"(?:"+[bf,wf,xf].join("|")+")"+Cf+vf+")*",zE=Cf+vf+$E,FE="(?:"+[bf+vc+"?",vc,wf,xf,LE].join("|")+")",UE=RegExp(Cc+"(?="+Cc+")|"+FE+zE,"g");function HE(n){return n.match(UE)||[]}function GE(n){return mf(n)?HE(n):TE(n)}function Sf(n){return function(e){e=ji(e);var t=mf(e)?GE(e):void 0,s=t?t[0]:e.charAt(0),r=t?CE(t,1).join(""):e.slice(1);return s[n]()+r}}var ca=Sf("toUpperCase");function WE(n){return ca(ji(n).toLowerCase())}function YE(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 qE(n){return function(e){return n==null?void 0:n[e]}}var XE={À:"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"},JE=qE(XE),KE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ZE="\\u0300-\\u036f",QE="\\ufe20-\\ufe2f",eO="\\u20d0-\\u20ff",tO=ZE+QE+eO,nO="["+tO+"]",sO=RegExp(nO,"g");function rO(n){return n=ji(n),n&&n.replace(KE,JE).replace(sO,"")}var iO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function oO(n){return n.match(iO)||[]}var aO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lO(n){return aO.test(n)}var Ef="\\ud800-\\udfff",cO="\\u0300-\\u036f",uO="\\ufe20-\\ufe2f",dO="\\u20d0-\\u20ff",hO=cO+uO+dO,Of="\\u2700-\\u27bf",Mf="a-z\\xdf-\\xf6\\xf8-\\xff",fO="\\xac\\xb1\\xd7\\xf7",pO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gO="\\u2000-\\u206f",mO=" \\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",Nf="A-Z\\xc0-\\xd6\\xd8-\\xde",yO="\\ufe0e\\ufe0f",Pf=fO+pO+gO+mO,_f="['’]",Af="["+Pf+"]",bO="["+hO+"]",Tf="\\d+",wO="["+Of+"]",kf="["+Mf+"]",Vf="[^"+Ef+Pf+Tf+Of+Mf+Nf+"]",xO="\\ud83c[\\udffb-\\udfff]",vO="(?:"+bO+"|"+xO+")",CO="[^"+Ef+"]",Df="(?:\\ud83c[\\udde6-\\uddff]){2}",Rf="[\\ud800-\\udbff][\\udc00-\\udfff]",Tr="["+Nf+"]",SO="\\u200d",If="(?:"+kf+"|"+Vf+")",EO="(?:"+Tr+"|"+Vf+")",Lf="(?:"+_f+"(?:d|ll|m|re|s|t|ve))?",Bf="(?:"+_f+"(?:D|LL|M|RE|S|T|VE))?",jf=vO+"?",$f="["+yO+"]?",OO="(?:"+SO+"(?:"+[CO,Df,Rf].join("|")+")"+$f+jf+")*",MO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",NO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",PO=$f+jf+OO,_O="(?:"+[wO,Df,Rf].join("|")+")"+PO,AO=RegExp([Tr+"?"+kf+"+"+Lf+"(?="+[Af,Tr,"$"].join("|")+")",EO+"+"+Bf+"(?="+[Af,Tr+If,"$"].join("|")+")",Tr+"?"+If+"+"+Lf,Tr+"+"+Bf,NO,MO,Tf,_O].join("|"),"g");function TO(n){return n.match(AO)||[]}function kO(n,e,t){return n=ji(n),e=e,e===void 0?lO(n)?TO(n):oO(n):n.match(e)||[]}var VO="['’]",DO=RegExp(VO,"g");function zf(n){return function(e){return YE(kO(rO(e).replace(DO,"")),n,"")}}var ua=zf(function(n,e,t){return e=e.toLowerCase(),n+(t?WE(e):e)});function RO(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function Ct(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Vi(t),t=t===t?t:0),e!==void 0&&(e=Vi(e),e=e===e?e:0),RO(Vi(n),e,t)}function IO(){this.__data__=new Yn,this.size=0}function LO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function BO(n){return this.__data__.get(n)}function jO(n){return this.__data__.has(n)}var $O=200;function zO(n,e){var t=this.__data__;if(t instanceof Yn){var s=t.__data__;if(!Bi||s.length<$O-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new qn(s)}return t.set(n,e),this.size=t.size,this}function ln(n){var e=this.__data__=new Yn(n);this.size=e.size}ln.prototype.clear=IO,ln.prototype.delete=LO,ln.prototype.get=BO,ln.prototype.has=jO,ln.prototype.set=zO;function FO(n,e){return n&&Di(e,Ii(e),n)}function UO(n,e){return n&&Di(e,Ar(e),n)}var Ff=typeof we=="object"&&we&&!we.nodeType&&we,Uf=Ff&&typeof module=="object"&&module&&!module.nodeType&&module,HO=Uf&&Uf.exports===Ff,Hf=HO?on.Buffer:void 0,Gf=Hf?Hf.allocUnsafe:void 0;function Wf(n,e){if(e)return n.slice();var t=n.length,s=Gf?Gf(t):new n.constructor(t);return n.copy(s),s}function GO(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 Yf(){return[]}var WO=Object.prototype,YO=WO.propertyIsEnumerable,qf=Object.getOwnPropertySymbols,Sc=qf?function(n){return n==null?[]:(n=Object(n),GO(qf(n),function(e){return YO.call(n,e)}))}:Yf;function qO(n,e){return Di(n,Sc(n),e)}var XO=Object.getOwnPropertySymbols,Xf=XO?function(n){for(var e=[];n;)wc(e,Sc(n)),n=xc(n);return e}:Yf;function JO(n,e){return Di(n,Xf(n),e)}function Jf(n,e,t){var s=e(n);return ft(n)?s:wc(s,t(n))}function Ec(n){return Jf(n,Ii,Sc)}function KO(n){return Jf(n,Ar,Xf)}var Oc=Us(on,"DataView"),Mc=Us(on,"Promise"),kr=Us(on,"Set"),Kf="[object Map]",ZO="[object Object]",Zf="[object Promise]",Qf="[object Set]",ep="[object WeakMap]",tp="[object DataView]",QO=Fs(Oc),e2=Fs(Bi),t2=Fs(Mc),n2=Fs(kr),s2=Fs(fc),Ut=hs;(Oc&&Ut(new Oc(new ArrayBuffer(1)))!=tp||Bi&&Ut(new Bi)!=Kf||Mc&&Ut(Mc.resolve())!=Zf||kr&&Ut(new kr)!=Qf||fc&&Ut(new fc)!=ep)&&(Ut=function(n){var e=hs(n),t=e==ZO?n.constructor:void 0,s=t?Fs(t):"";if(s)switch(s){case QO:return tp;case e2:return Kf;case t2:return Zf;case n2:return Qf;case s2:return ep}return e});var r2=Object.prototype,i2=r2.hasOwnProperty;function o2(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&i2.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var da=on.Uint8Array;function Nc(n){var e=new n.constructor(n.byteLength);return new da(e).set(new da(n)),e}function a2(n,e){var t=e?Nc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var l2=/\w*$/;function c2(n){var e=new n.constructor(n.source,l2.exec(n));return e.lastIndex=n.lastIndex,e}var np=Ft?Ft.prototype:void 0,sp=np?np.valueOf:void 0;function u2(n){return sp?Object(sp.call(n)):{}}function rp(n,e){var t=e?Nc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var d2="[object Boolean]",h2="[object Date]",f2="[object Map]",p2="[object Number]",g2="[object RegExp]",m2="[object Set]",y2="[object String]",b2="[object Symbol]",w2="[object ArrayBuffer]",x2="[object DataView]",v2="[object Float32Array]",C2="[object Float64Array]",S2="[object Int8Array]",E2="[object Int16Array]",O2="[object Int32Array]",M2="[object Uint8Array]",N2="[object Uint8ClampedArray]",P2="[object Uint16Array]",_2="[object Uint32Array]";function A2(n,e,t){var s=n.constructor;switch(e){case w2:return Nc(n);case d2:case h2:return new s(+n);case x2:return a2(n,t);case v2:case C2:case S2:case E2:case O2:case M2:case N2:case P2:case _2:return rp(n,t);case f2:return new s;case p2:case y2:return new s(n);case g2:return c2(n);case m2:return new s;case b2:return u2(n)}}function ip(n){return typeof n.constructor=="function"&&!ta(n)?NC(xc(n)):{}}var T2="[object Map]";function k2(n){return an(n)&&Ut(n)==T2}var op=_r&&_r.isMap,V2=op?na(op):k2,D2="[object Set]";function R2(n){return an(n)&&Ut(n)==D2}var ap=_r&&_r.isSet,I2=ap?na(ap):R2,L2=1,B2=2,j2=4,lp="[object Arguments]",$2="[object Array]",z2="[object Boolean]",F2="[object Date]",U2="[object Error]",cp="[object Function]",H2="[object GeneratorFunction]",G2="[object Map]",W2="[object Number]",up="[object Object]",Y2="[object RegExp]",q2="[object Set]",X2="[object String]",J2="[object Symbol]",K2="[object WeakMap]",Z2="[object ArrayBuffer]",Q2="[object DataView]",eM="[object Float32Array]",tM="[object Float64Array]",nM="[object Int8Array]",sM="[object Int16Array]",rM="[object Int32Array]",iM="[object Uint8Array]",oM="[object Uint8ClampedArray]",aM="[object Uint16Array]",lM="[object Uint32Array]",Ne={};Ne[lp]=Ne[$2]=Ne[Z2]=Ne[Q2]=Ne[z2]=Ne[F2]=Ne[eM]=Ne[tM]=Ne[nM]=Ne[sM]=Ne[rM]=Ne[G2]=Ne[W2]=Ne[up]=Ne[Y2]=Ne[q2]=Ne[X2]=Ne[J2]=Ne[iM]=Ne[oM]=Ne[aM]=Ne[lM]=!0,Ne[U2]=Ne[cp]=Ne[K2]=!1;function zi(n,e,t,s,r,i){var o,a=e&L2,c=e&B2,u=e&j2;if(o!==void 0)return o;if(!Be(n))return n;var d=ft(n);if(d){if(o=o2(n),!a)return Jh(n,o)}else{var h=Ut(n),f=h==cp||h==H2;if(Pr(n))return Wf(n,a);if(h==up||h==lp||f&&!r){if(o=c||f?{}:ip(n),!a)return c?JO(n,UO(o,n)):qO(n,FO(o,n))}else{if(!Ne[h])return r?n:{};o=A2(n,h,a)}}i||(i=new ln);var p=i.get(n);if(p)return p;i.set(n,o),I2(n)?n.forEach(function(y){o.add(zi(y,e,t,y,n,i))}):V2(n)&&n.forEach(function(y,b){o.set(b,zi(y,e,t,b,n,i))});var g=u?c?KO:Ec:c?Ar:Ii,m=d?void 0:g(n);return RC(m||n,function(y,b){m&&(b=y,y=n[b]),pc(o,b,zi(y,e,t,b,n,i))}),o}var cM=4;function Pc(n){return zi(n,cM)}var uM=1,dM=4;function Te(n){return zi(n,uM|dM)}var hM="__lodash_hash_undefined__";function fM(n){return this.__data__.set(n,hM),this}function pM(n){return this.__data__.has(n)}function Vr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new qn;++e<t;)this.add(n[e])}Vr.prototype.add=Vr.prototype.push=fM,Vr.prototype.has=pM;function gM(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 _c(n,e){return n.has(e)}var mM=1,yM=2;function dp(n,e,t,s,r,i){var o=t&mM,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&yM?new Vr: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(!gM(e,function(b,w){if(!_c(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 bM(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function Ac(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var wM=1,xM=2,vM="[object Boolean]",CM="[object Date]",SM="[object Error]",EM="[object Map]",OM="[object Number]",MM="[object RegExp]",NM="[object Set]",PM="[object String]",_M="[object Symbol]",AM="[object ArrayBuffer]",TM="[object DataView]",hp=Ft?Ft.prototype:void 0,Tc=hp?hp.valueOf:void 0;function kM(n,e,t,s,r,i,o){switch(t){case TM:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case AM:return!(n.byteLength!=e.byteLength||!i(new da(n),new da(e)));case vM:case CM:case OM:return Or(+n,+e);case SM:return n.name==e.name&&n.message==e.message;case MM:case PM:return n==e+"";case EM:var a=bM;case NM:var c=s&wM;if(a||(a=Ac),n.size!=e.size&&!c)return!1;var u=o.get(n);if(u)return u==e;s|=xM,o.set(n,e);var d=dp(a(n),a(e),s,r,i,o);return o.delete(n),d;case _M:if(Tc)return Tc.call(n)==Tc.call(e)}return!1}var VM=1,DM=Object.prototype,RM=DM.hasOwnProperty;function IM(n,e,t,s,r,i){var o=t&VM,a=Ec(n),c=a.length,u=Ec(e),d=u.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var f=a[h];if(!(o?f in e:RM.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 C=n.constructor,E=e.constructor;C!=E&&"constructor"in n&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof E=="function"&&E instanceof E)&&(m=!1)}return i.delete(n),i.delete(e),m}var LM=1,fp="[object Arguments]",pp="[object Array]",ha="[object Object]",BM=Object.prototype,gp=BM.hasOwnProperty;function jM(n,e,t,s,r,i){var o=ft(n),a=ft(e),c=o?pp:Ut(n),u=a?pp:Ut(e);c=c==fp?ha:c,u=u==fp?ha:u;var d=c==ha,h=u==ha,f=c==u;if(f&&Pr(n)){if(!Pr(e))return!1;o=!0,d=!1}if(f&&!d)return i||(i=new ln),o||sa(n)?dp(n,e,t,s,r,i):kM(n,e,c,t,s,r,i);if(!(t&LM)){var p=d&&gp.call(n,"__wrapped__"),g=h&&gp.call(e,"__wrapped__");if(p||g){var m=p?n.value():n,y=g?e.value():e;return i||(i=new ln),r(m,y,t,s,i)}}return f?(i||(i=new ln),IM(n,e,t,s,r,i)):!1}function fa(n,e,t,s,r){return n===e?!0:n==null||e==null||!an(n)&&!an(e)?n!==n&&e!==e:jM(n,e,t,s,fa,r)}var $M=1,zM=2;function FM(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 ln,h;if(!(h===void 0?fa(u,c,$M|zM,s,d):h))return!1}}return!0}function mp(n){return n===n&&!Be(n)}function UM(n){for(var e=Ii(n),t=e.length;t--;){var s=e[t],r=n[s];e[t]=[s,r,mp(r)]}return e}function yp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function HM(n){var e=UM(n);return e.length==1&&e[0][2]?yp(e[0][0],e[0][1]):function(t){return t===n||FM(t,n,e)}}function GM(n,e){return n!=null&&e in Object(n)}function bp(n,e,t){e=oa(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&&gc(r)&&Zo(o,r)&&(ft(n)||Nr(n)))}function wp(n,e){return n!=null&&bp(n,e,GM)}var WM=1,YM=2;function qM(n,e){return yc(n)&&mp(e)?yp($i(n),e):function(t){var s=ff(t,n);return s===void 0&&s===e?wp(t,n):fa(e,s,WM|YM)}}function XM(n){return function(e){return e==null?void 0:e[n]}}function JM(n){return function(e){return aa(e,n)}}function KM(n){return yc(n)?XM($i(n)):JM(n)}function kc(n){return typeof n=="function"?n:n==null?Er:typeof n=="object"?ft(n)?qM(n[0],n[1]):HM(n):KM(n)}function ZM(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 QM(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 xp=QM();function eN(n,e){return n&&xp(n,e,Ii)}function tN(n,e){return function(t,s){if(t==null)return t;if(!Hs(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 vp=tN(eN);function nN(n,e,t,s){return vp(n,function(r,i,o){e(s,r,t(r),o)}),s}function sN(n,e){return function(t,s){var r=ft(t)?ZM:nN,i=e?e():{};return r(t,n,kc(s),i)}}var Vc=function(){return on.Date.now()},rN="Expected a function",iN=Math.max,oN=Math.min;function Cp(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(rN);e=Vi(e)||0,Be(t)&&(d=!!t.leading,h="maxWait"in t,i=h?iN(Vi(t.maxWait)||0,e):i,f="trailing"in t?!!t.trailing:f);function p(v){var S=s,O=r;return s=r=void 0,u=v,o=n.apply(O,S),o}function g(v){return u=v,a=setTimeout(b,e),d?p(v):o}function m(v){var S=v-c,O=v-u,_=e-S;return h?oN(_,i-O):_}function y(v){var S=v-c,O=v-u;return c===void 0||S>=e||S<0||h&&O>=i}function b(){var v=Vc();if(y(v))return w(v);a=setTimeout(b,m(v))}function w(v){return a=void 0,f&&s?p(v):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=c=r=a=void 0}function C(){return a===void 0?o:w(Vc())}function E(){var v=Vc(),S=y(v);if(s=arguments,r=this,c=v,S){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 E.cancel=x,E.flush=C,E}var Sp=Object.prototype,aN=Sp.hasOwnProperty,lN=Mr(function(n,e){n=Object(n);var t=-1,s=e.length,r=s>2?e[2]:void 0;for(r&&ea(e[0],e[1],r)&&(s=1);++t<s;)for(var i=e[t],o=Ar(i),a=-1,c=o.length;++a<c;){var u=o[a],d=n[u];(d===void 0||Or(d,Sp[u])&&!aN.call(n,u))&&(n[u]=i[u])}return n});function Dc(n,e,t){(t!==void 0&&!Or(n[e],t)||t===void 0&&!(e in n))&&Qo(n,e,t)}function pa(n){return an(n)&&Hs(n)}function Rc(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function cN(n){return Di(n,Ar(n))}function uN(n,e,t,s,r,i,o){var a=Rc(n,t),c=Rc(e,t),u=o.get(c);if(u){Dc(n,t,u);return}var d=i?i(a,c,t+"",n,e,o):void 0,h=d===void 0;if(h){var f=ft(c),p=!f&&Pr(c),g=!f&&!p&&sa(c);d=c,f||p||g?ft(a)?d=a:pa(a)?d=Jh(a):p?(h=!1,d=Wf(c,!0)):g?(h=!1,d=rp(c,!0)):d=[]:Nn(c)||Nr(c)?(d=a,Nr(a)?d=cN(a):(!Be(a)||dc(a))&&(d=ip(c))):h=!1}h&&(o.set(c,d),r(d,c,s,i,o),o.delete(c)),Dc(n,t,d)}function ga(n,e,t,s,r){n!==e&&xp(e,function(i,o){if(r||(r=new ln),Be(i))uN(n,e,o,t,ga,s,r);else{var a=s?s(Rc(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),Dc(n,o,a)}},Ar)}function Ep(n,e,t,s,r,i){return Be(n)&&Be(e)&&(i.set(e,n),ga(n,e,void 0,Ep,i),i.delete(e)),n}var dN=tf(function(n,e,t,s){ga(n,e,t,s)}),Op=Mr(function(n){return n.push(void 0,Ep),Xh(dN,void 0,n)}),hN=200;function fN(n,e,t,s){var r=-1,i=Zh,o=!0,a=n.length,c=[],u=e.length;if(!a)return c;e.length>=hN&&(i=_c,o=!1,e=new Vr(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 pN=Mr(function(n,e){return pa(n)?fN(n,la(e,1,pa,!0)):[]});function gN(n,e){var t=-1,s=Hs(n)?Array(n.length):[];return vp(n,function(r,i,o){s[++t]=e(r,i,o)}),s}function ma(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 mN=Object.prototype,yN=mN.hasOwnProperty,Mp=sN(function(n,e,t){yN.call(n,t)?n[t].push(e):Qo(n,t,[e])});function bN(n,e){return n>e}var wN=Object.prototype,xN=wN.hasOwnProperty;function vN(n,e){return n!=null&&xN.call(n,e)}function ya(n,e){return n!=null&&bp(n,e,vN)}var CN="[object Map]",SN="[object Set]",EN=Object.prototype,ON=EN.hasOwnProperty;function Np(n){if(n==null)return!0;if(Hs(n)&&(ft(n)||typeof n=="string"||typeof n.splice=="function"||Pr(n)||sa(n)||Nr(n)))return!n.length;var e=Ut(n);if(e==CN||e==SN)return!n.size;if(ta(n))return!hf(n).length;for(var t in n)if(ON.call(n,t))return!1;return!0}function Pn(n,e){return fa(n,e)}var MN="[object Number]";function Ic(n){return typeof n=="number"||an(n)&&hs(n)==MN}function ba(n){return n==null}function NN(n){return n===void 0}var PN=Sf("toLowerCase");function _N(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&&!Mn(o):t(o,a)))var a=o,c=i}return c}function AN(n){return n&&n.length?_N(n,Er,bN):void 0}var qe=tf(function(n,e,t){ga(n,e,t)});function TN(n,e,t,s){if(!Be(n))return n;e=oa(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=Be(d)?d:Zo(e[r+1])?[]:{})}pc(a,c,u),a=a[c]}return n}function kN(n,e,t){for(var s=-1,r=e.length,i={};++s<r;){var o=e[s],a=aa(n,o);t(a,o)&&TN(i,oa(o,n),a)}return i}function VN(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function DN(n,e){if(n!==e){var t=n!==void 0,s=n===null,r=n===n,i=Mn(n),o=e!==void 0,a=e===null,c=e===e,u=Mn(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 RN(n,e,t){for(var s=-1,r=n.criteria,i=e.criteria,o=r.length,a=t.length;++s<o;){var c=DN(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 IN(n,e,t){e.length?e=Jo(e,function(i){return ft(i)?function(o){return aa(o,i.length===1?i[0]:i)}:i}):e=[Er];var s=-1;e=Jo(e,na(kc));var r=gN(n,function(i,o,a){var c=Jo(e,function(u){return u(i)});return{criteria:c,index:++s,value:i}});return VN(r,function(i,o){return RN(i,o,t)})}function LN(n,e){return kN(n,e,function(t,s){return wp(n,s)})}var Lc=gE(function(n,e){return n==null?{}:LN(n,e)}),Bc=Mr(function(n,e){if(n==null)return[];var t=e.length;return t>1&&ea(n,e[0],e[1])?e=[]:t>2&&ea(e[0],e[1],e[2])&&(e=[e[0]]),IN(n,la(e),[])}),BN=4294967295,jN=BN-1,$N=Math.floor,zN=Math.min;function Pp(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=Mn(e),u=e===void 0;r<i;){var d=$N((r+i)/2),h=t(n[d]),f=h!==void 0,p=h===null,g=h===h,m=Mn(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 zN(i,jN)}var FN=4294967295,UN=FN>>>1;function HN(n,e,t){var s=0,r=n==null?s:n.length;if(typeof e=="number"&&e===e&&r<=UN){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!Mn(o)&&o<e?s=i+1:r=i}return r}return Pp(n,e,Er)}function GN(n,e){return HN(n,e)}function WN(n,e,t){return Pp(n,e,kc(t))}var YN=zf(function(n,e,t){return n+(t?" ":"")+ca(e)}),qN="Expected a function";function XN(n,e,t){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(qN);return Be(t)&&(s="leading"in t?!!t.leading:s,r="trailing"in t?!!t.trailing:r),Cp(n,e,{leading:s,maxWait:e,trailing:r})}var JN=1/0,KN=kr&&1/Ac(new kr([,-0]))[1]==JN?function(n){return new kr(n)}:PC,ZN=200;function _p(n,e,t){var s=-1,r=Zh,i=n.length,o=!0,a=[],c=a;if(i>=ZN){var u=KN(n);if(u)return Ac(u);o=!1,r=_c,c=new Vr}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 Ap=Mr(function(n){return _p(la(n,1,pa,!0))});function Tp(n){return n&&n.length?_p(n):[]}const kp=n=>n===void 0,wa=n=>typeof n=="boolean",Ht=n=>typeof n=="number",Xn=n=>typeof Element>"u"?!1:n instanceof Element,QN=n=>rn(n)?!Number.isNaN(Number(n)):!1,Vp=n=>Object.keys(n);class Dp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function eP(n,e){throw new Dp(`[${n}] ${e}`)}function kt(n,e){if(process.env.NODE_ENV!=="production"){const t=rn(n)?new Dp(`[${n}] ${e}`):n;console.warn(t)}}const tP="utils/dom/style",Rp=(n="")=>n.split(" ").filter(e=>!!e.trim()),Ip=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},nP=(n,e)=>{!n||!e.trim()||n.classList.add(...Rp(e))},sP=(n,e)=>{!n||!e.trim()||n.classList.remove(...Rp(e))},rP=(n,e)=>{var t;if(!Ye||!n||!e)return"";let s=Gv(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 Fi(n,e="px"){if(!n)return"";if(Ht(n)||QN(n))return`${n}${e}`;if(rn(n))return n;kt(tP,"binding value must be a string or number")}let xa;const iP=n=>{var e;if(!Ye)return 0;if(xa!==void 0)return xa;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),xa=s-i,xa};/*! Element Plus Icons Vue v2.3.1 */var oP=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"})]))}}),aP=oP,lP=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"})]))}}),Lp=lP,cP=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"})]))}}),Bp=cP,uP=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"})]))}}),dP=uP,hP=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"})]))}}),fP=hP,pP=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"})]))}}),jp=pP,gP=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"})]))}}),va=gP,mP=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"})]))}}),$p=mP,yP=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"})]))}}),bP=yP,wP=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"})]))}}),zp=wP;const Fp="__epPropKey",he=n=>n,xP=n=>Sr(n)&&!!n[Fp],Ca=(n,e)=>{if(!Sr(n)||xP(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),Xo(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,[Fp]:!0};return Xo(n,"default")&&(c.default=r),c},et=n=>ma(Object.entries(n).map(([e,t])=>[e,Ca(t,e)])),Ui=he([String,Object,Function]),Up={Close:dP,SuccessFilled:$p,InfoFilled:jp,WarningFilled:zp,CircleCloseFilled:Lp},Sa={success:$p,warning:zp,error:Lp,info:jp},vP={validating:va,success:aP,error:Bp},Ws=(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},CP=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),SP=n=>(n.install=ds,n),Dr={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"},jc="update:modelValue",Hp=["","default","small","large"],EP=n=>["",...Hp].includes(n);var Ea=(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))(Ea||{});const OP=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),Gp=n=>n,MP=["class","style"],NP=/^on[A-Z]/,PP=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,s=l.computed(()=>((t==null?void 0:t.value)||[]).concat(MP)),r=l.getCurrentInstance();return r?l.computed(()=>{var i;return ma(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(e&&NP.test(o))))}):(kt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},_P=({from:n,replacement:e,scope:t,version:s,ref:r,type:i="API"},o)=>{l.watch(()=>l.unref(o),a=>{a&&kt(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})},AP=(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,C=document.documentElement.clientHeight,E=-m+f,v=-y+p,S=x-m-b+f,O=C-y-w+p,_=A=>{let V=f+A.clientX-d,L=p+A.clientY-h;s!=null&&s.value||(V=Math.min(Math.max(V,E),S),L=Math.min(Math.max(L,v),O)),r={offsetX:V,offsetY:L},n.value&&(n.value.style.transform=`translate(${Fi(V)}, ${Fi(L)})`)},T=()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",_),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 TP={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 kP=n=>(e,t)=>VP(e,t,l.unref(n)),VP=(n,e,t)=>ff(t,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=e==null?void 0:e[r])!=null?i:`{${r}}`}`}),DP=n=>{const e=l.computed(()=>l.unref(n).name),t=l.isRef(n)?n:l.ref(n);return{lang:e,locale:t,t:kP(n)}},Wp=Symbol("localeContextKey"),RP=n=>{const e=n||l.inject(Wp,l.ref());return DP(l.computed(()=>e.value||TP))},Oa="el",IP="is-",Ys=(n,e,t,s,r)=>{let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Yp=Symbol("namespaceContextKey"),Fc=n=>{const e=n||(l.getCurrentInstance()?l.inject(Yp,l.ref(Oa)):l.ref(Oa));return l.computed(()=>l.unref(e)||Oa)},wt=(n,e)=>{const t=Fc(e);return{namespace:t,b:(m="")=>Ys(t.value,n,m,"",""),e:m=>m?Ys(t.value,n,"",m,""):"",m:m=>m?Ys(t.value,n,"","",m):"",be:(m,y)=>m&&y?Ys(t.value,n,m,y,""):"",em:(m,y)=>m&&y?Ys(t.value,n,"",m,y):"",bm:(m,y)=>m&&y?Ys(t.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?Ys(t.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${IP}${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}`}},LP=(n,e={})=>{l.isRef(n)||eP("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||wt("popup"),s=l.computed(()=>t.bm("parent","hidden"));if(!qe||Ip(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(sP(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=!Ip(document.body,s.value),i&&(o=document.body.style.width),r=iP(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=rP(document.body,"overflowY");r>0&&(u||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),nP(document.body,s.value)}),l.onScopeDispose(()=>a())},BP=Ca({type:fe(Boolean),default:null}),jP=Ca({type:fe(Function)}),$P=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,s=[e],r={[n]:BP,[t]:jP};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(()=>Ft(g[t])),y=l.computed(()=>g[n]===null),b=S=>{o.value!==!0&&(o.value=!0,a&&(a.value=S),Ft(d)&&d(S))},w=S=>{o.value!==!1&&(o.value=!1,a&&(a.value=S),Ft(h)&&h(S))},x=S=>{if(g.disabled===!0||Ft(u)&&!u())return;const O=m.value&&qe;O&&p(e,!0),(y.value||!O)&&b(S)},C=S=>{if(g.disabled===!0||!qe)return;const O=m.value&&qe;O&&p(e,!1),(y.value||!O)&&w(S)},E=S=>{wa(S)&&(g.disabled&&S?m.value&&p(e,!1):o.value!==S&&(S?b():w()))},v=()=>{o.value?C():x()};return l.watch(()=>g[n],E),c&&f.appContext.config.globalProperties.$route!==void 0&&l.watch(()=>({...f.proxy.$route}),()=>{c.value&&o.value&&C()}),l.onMounted(()=>{E(g[n])}),{hide:C,show:x,toggle:v,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},qp=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 Ot="top",Wt="bottom",Yt="right",Mt="left",Ma="auto",Hi=[Ot,Wt,Yt,Mt],Rr="start",Gi="end",zP="clippingParents",Xp="viewport",Wi="popper",FP="reference",Jp=Hi.reduce(function(n,e){return n.concat([e+"-"+Rr,e+"-"+Gi])},[]),Uc=[].concat(Hi,[Ma]).reduce(function(n,e){return n.concat([e,e+"-"+Rr,e+"-"+Gi])},[]),UP="beforeRead",HP="read",GP="afterRead",WP="beforeMain",YP="main",qP="afterMain",XP="beforeWrite",JP="write",KP="afterWrite",Hc=[UP,HP,GP,WP,YP,qP,XP,JP,KP];function _n(n){return n?(n.nodeName||"").toLowerCase():null}function Dt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function qs(n){var e=Dt(n).Element;return n instanceof e||n instanceof Element}function Rt(n){var e=Dt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Gc(n){if(typeof ShadowRoot>"u")return!1;var e=Dt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function ZP(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];!Rt(i)||!_n(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 QP(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},{});!Rt(r)||!_n(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const e_={name:"applyStyles",enabled:!0,phase:"write",fn:ZP,effect:QP,requires:["computeStyles"]};function cn(n){return n.split("-")[0]}var Xs=Math.max,Na=Math.min,Ir=Math.round;function Wc(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Kp(){return!/^((?!chrome|android).)*safari/i.test(Wc())}function Lr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),r=1,i=1;e&&Rt(n)&&(r=n.offsetWidth>0&&Ir(s.width)/n.offsetWidth||1,i=n.offsetHeight>0&&Ir(s.height)/n.offsetHeight||1);var o=qs(n)?Dt(n):window,a=o.visualViewport,c=!Kp()&&t,u=(s.left+(c&&a?a.offsetLeft:0))/r,d=(s.top+(c&&a?a.offsetTop:0))/i,h=s.width/r,f=s.height/i;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function Yc(n){var e=Lr(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 Zp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Gc(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function un(n){return Dt(n).getComputedStyle(n)}function t_(n){return["table","td","th"].indexOf(_n(n))>=0}function hs(n){return((qs(n)?n.ownerDocument:n.document)||window.document).documentElement}function Pa(n){return _n(n)==="html"?n:n.assignedSlot||n.parentNode||(Gc(n)?n.host:null)||hs(n)}function Qp(n){return!Rt(n)||un(n).position==="fixed"?null:n.offsetParent}function n_(n){var e=/firefox/i.test(Wc()),t=/Trident/i.test(Wc());if(t&&Rt(n)){var s=un(n);if(s.position==="fixed")return null}var r=Pa(n);for(Gc(r)&&(r=r.host);Rt(r)&&["html","body"].indexOf(_n(r))<0;){var i=un(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 Yi(n){for(var e=Dt(n),t=Qp(n);t&&t_(t)&&un(t).position==="static";)t=Qp(t);return t&&(_n(t)==="html"||_n(t)==="body"&&un(t).position==="static")?e:t||n_(n)||e}function qc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function qi(n,e,t){return Xs(n,Na(e,t))}function s_(n,e,t){var s=qi(n,e,t);return s>t?t:s}function eg(){return{top:0,right:0,bottom:0,left:0}}function tg(n){return Object.assign({},eg(),n)}function ng(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var r_=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tg(typeof e!="number"?e:ng(e,Hi))};function i_(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=qc(a),u=[Mt,Yt].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!o)){var h=r_(r.padding,t),f=Yc(i),p=c==="y"?Ot:Mt,g=c==="y"?Wt:Yt,m=t.rects.reference[d]+t.rects.reference[c]-o[c]-t.rects.popper[d],y=o[c]-t.rects.reference[c],b=Yi(i),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,C=h[p],E=w-f[d]-h[g],v=w/2-f[d]/2+x,S=qi(C,v,E),O=c;t.modifiersData[s]=(e={},e[O]=S,e.centerOffset=S-v,e)}}function o_(n){var e=n.state,t=n.options,s=t.element,r=s===void 0?"[data-popper-arrow]":s;if(r!=null&&!(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r))){if(process.env.NODE_ENV!=="production"&&(Rt(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!Zp(e.elements.popper,r)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}e.elements.arrow=r}}const a_={name:"arrow",enabled:!0,phase:"main",fn:i_,effect:o_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Br(n){return n.split("-")[1]}var l_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function c_(n,e){var t=n.x,s=n.y,r=e.devicePixelRatio||1;return{x:Ir(t*r)/r||0,y:Ir(s*r)/r||0}}function sg(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=Mt,C=Ot,E=window;if(u){var v=Yi(t),S="clientHeight",O="clientWidth";if(v===Dt(t)&&(v=hs(t),un(v).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),v=v,r===Ot||(r===Mt||r===Yt)&&i===Gi){C=Wt;var _=h&&v===E&&E.visualViewport?E.visualViewport.height:v[S];m-=_-s.height,m*=c?1:-1}if(r===Mt||(r===Ot||r===Wt)&&i===Gi){x=Yt;var T=h&&v===E&&E.visualViewport?E.visualViewport.width:v[O];p-=T-s.width,p*=c?1:-1}}var A=Object.assign({position:a},u&&l_),V=d===!0?c_({x:p,y:m},Dt(t)):{x:p,y:m};if(p=V.x,m=V.y,c){var L;return Object.assign({},A,(L={},L[C]=w?"0":"",L[x]=b?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",L))}return Object.assign({},A,(e={},e[C]=w?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function u_(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;if(process.env.NODE_ENV!=="production"){var u=un(e.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some(function(h){return u.indexOf(h)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
16
+ `)},{immediate:!0})},AP=(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,C=document.documentElement.clientHeight,E=-m+f,v=-y+p,S=x-m-b+f,O=C-y-w+p,_=A=>{let D=f+A.clientX-d,L=p+A.clientY-h;s!=null&&s.value||(D=Math.min(Math.max(D,E),S),L=Math.min(Math.max(L,v),O)),r={offsetX:D,offsetY:L},n.value&&(n.value.style.transform=`translate(${Fi(D)}, ${Fi(L)})`)},T=()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",_),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 TP={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 kP=n=>(e,t)=>VP(e,t,l.unref(n)),VP=(n,e,t)=>ff(t,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=e==null?void 0:e[r])!=null?i:`{${r}}`}`}),DP=n=>{const e=l.computed(()=>l.unref(n).name),t=l.isRef(n)?n:l.ref(n);return{lang:e,locale:t,t:kP(n)}},Wp=Symbol("localeContextKey"),RP=n=>{const e=n||l.inject(Wp,l.ref());return DP(l.computed(()=>e.value||TP))},Oa="el",IP="is-",Ys=(n,e,t,s,r)=>{let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Yp=Symbol("namespaceContextKey"),$c=n=>{const e=n||(l.getCurrentInstance()?l.inject(Yp,l.ref(Oa)):l.ref(Oa));return l.computed(()=>l.unref(e)||Oa)},yt=(n,e)=>{const t=$c(e);return{namespace:t,b:(m="")=>Ys(t.value,n,m,"",""),e:m=>m?Ys(t.value,n,"",m,""):"",m:m=>m?Ys(t.value,n,"","",m):"",be:(m,y)=>m&&y?Ys(t.value,n,m,y,""):"",em:(m,y)=>m&&y?Ys(t.value,n,"",m,y):"",bm:(m,y)=>m&&y?Ys(t.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?Ys(t.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${IP}${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}`}},LP=(n,e={})=>{l.isRef(n)||eP("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||yt("popup"),s=l.computed(()=>t.bm("parent","hidden"));if(!Ye||Ip(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(sP(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=!Ip(document.body,s.value),i&&(o=document.body.style.width),r=iP(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=rP(document.body,"overflowY");r>0&&(u||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),nP(document.body,s.value)}),l.onScopeDispose(()=>a())},BP=Ca({type:he(Boolean),default:null}),jP=Ca({type:he(Function)}),$P=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,s=[e],r={[n]:BP,[t]:jP};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(()=>zt(g[t])),y=l.computed(()=>g[n]===null),b=S=>{o.value!==!0&&(o.value=!0,a&&(a.value=S),zt(d)&&d(S))},w=S=>{o.value!==!1&&(o.value=!1,a&&(a.value=S),zt(h)&&h(S))},x=S=>{if(g.disabled===!0||zt(u)&&!u())return;const O=m.value&&Ye;O&&p(e,!0),(y.value||!O)&&b(S)},C=S=>{if(g.disabled===!0||!Ye)return;const O=m.value&&Ye;O&&p(e,!1),(y.value||!O)&&w(S)},E=S=>{wa(S)&&(g.disabled&&S?m.value&&p(e,!1):o.value!==S&&(S?b():w()))},v=()=>{o.value?C():x()};return l.watch(()=>g[n],E),c&&f.appContext.config.globalProperties.$route!==void 0&&l.watch(()=>({...f.proxy.$route}),()=>{c.value&&o.value&&C()}),l.onMounted(()=>{E(g[n])}),{hide:C,show:x,toggle:v,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},qp=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 St="top",Gt="bottom",Wt="right",Et="left",Ma="auto",Hi=[St,Gt,Wt,Et],Rr="start",Gi="end",zP="clippingParents",Xp="viewport",Wi="popper",FP="reference",Jp=Hi.reduce(function(n,e){return n.concat([e+"-"+Rr,e+"-"+Gi])},[]),zc=[].concat(Hi,[Ma]).reduce(function(n,e){return n.concat([e,e+"-"+Rr,e+"-"+Gi])},[]),UP="beforeRead",HP="read",GP="afterRead",WP="beforeMain",YP="main",qP="afterMain",XP="beforeWrite",JP="write",KP="afterWrite",Fc=[UP,HP,GP,WP,YP,qP,XP,JP,KP];function _n(n){return n?(n.nodeName||"").toLowerCase():null}function Vt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function qs(n){var e=Vt(n).Element;return n instanceof e||n instanceof Element}function Dt(n){var e=Vt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Uc(n){if(typeof ShadowRoot>"u")return!1;var e=Vt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function ZP(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];!Dt(i)||!_n(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 QP(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},{});!Dt(r)||!_n(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const e_={name:"applyStyles",enabled:!0,phase:"write",fn:ZP,effect:QP,requires:["computeStyles"]};function cn(n){return n.split("-")[0]}var Xs=Math.max,Na=Math.min,Ir=Math.round;function Hc(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Kp(){return!/^((?!chrome|android).)*safari/i.test(Hc())}function Lr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),r=1,i=1;e&&Dt(n)&&(r=n.offsetWidth>0&&Ir(s.width)/n.offsetWidth||1,i=n.offsetHeight>0&&Ir(s.height)/n.offsetHeight||1);var o=qs(n)?Vt(n):window,a=o.visualViewport,c=!Kp()&&t,u=(s.left+(c&&a?a.offsetLeft:0))/r,d=(s.top+(c&&a?a.offsetTop:0))/i,h=s.width/r,f=s.height/i;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function Gc(n){var e=Lr(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 Zp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Uc(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function un(n){return Vt(n).getComputedStyle(n)}function t_(n){return["table","td","th"].indexOf(_n(n))>=0}function fs(n){return((qs(n)?n.ownerDocument:n.document)||window.document).documentElement}function Pa(n){return _n(n)==="html"?n:n.assignedSlot||n.parentNode||(Uc(n)?n.host:null)||fs(n)}function Qp(n){return!Dt(n)||un(n).position==="fixed"?null:n.offsetParent}function n_(n){var e=/firefox/i.test(Hc()),t=/Trident/i.test(Hc());if(t&&Dt(n)){var s=un(n);if(s.position==="fixed")return null}var r=Pa(n);for(Uc(r)&&(r=r.host);Dt(r)&&["html","body"].indexOf(_n(r))<0;){var i=un(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 Yi(n){for(var e=Vt(n),t=Qp(n);t&&t_(t)&&un(t).position==="static";)t=Qp(t);return t&&(_n(t)==="html"||_n(t)==="body"&&un(t).position==="static")?e:t||n_(n)||e}function Wc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function qi(n,e,t){return Xs(n,Na(e,t))}function s_(n,e,t){var s=qi(n,e,t);return s>t?t:s}function eg(){return{top:0,right:0,bottom:0,left:0}}function tg(n){return Object.assign({},eg(),n)}function ng(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var r_=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tg(typeof e!="number"?e:ng(e,Hi))};function i_(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=Wc(a),u=[Et,Wt].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!o)){var h=r_(r.padding,t),f=Gc(i),p=c==="y"?St:Et,g=c==="y"?Gt:Wt,m=t.rects.reference[d]+t.rects.reference[c]-o[c]-t.rects.popper[d],y=o[c]-t.rects.reference[c],b=Yi(i),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,C=h[p],E=w-f[d]-h[g],v=w/2-f[d]/2+x,S=qi(C,v,E),O=c;t.modifiersData[s]=(e={},e[O]=S,e.centerOffset=S-v,e)}}function o_(n){var e=n.state,t=n.options,s=t.element,r=s===void 0?"[data-popper-arrow]":s;if(r!=null&&!(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r))){if(process.env.NODE_ENV!=="production"&&(Dt(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!Zp(e.elements.popper,r)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}e.elements.arrow=r}}const a_={name:"arrow",enabled:!0,phase:"main",fn:i_,effect:o_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Br(n){return n.split("-")[1]}var l_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function c_(n,e){var t=n.x,s=n.y,r=e.devicePixelRatio||1;return{x:Ir(t*r)/r||0,y:Ir(s*r)/r||0}}function sg(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=Et,C=St,E=window;if(u){var v=Yi(t),S="clientHeight",O="clientWidth";if(v===Vt(t)&&(v=fs(t),un(v).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),v=v,r===St||(r===Et||r===Wt)&&i===Gi){C=Gt;var _=h&&v===E&&E.visualViewport?E.visualViewport.height:v[S];m-=_-s.height,m*=c?1:-1}if(r===Et||(r===St||r===Gt)&&i===Gi){x=Wt;var T=h&&v===E&&E.visualViewport?E.visualViewport.width:v[O];p-=T-s.width,p*=c?1:-1}}var A=Object.assign({position:a},u&&l_),D=d===!0?c_({x:p,y:m},Vt(t)):{x:p,y:m};if(p=D.x,m=D.y,c){var L;return Object.assign({},A,(L={},L[C]=w?"0":"",L[x]=b?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",L))}return Object.assign({},A,(e={},e[C]=w?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function u_(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;if(process.env.NODE_ENV!=="production"){var u=un(e.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some(function(h){return u.indexOf(h)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
17
17
 
18
18
  `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
19
19
 
20
- `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:cn(e.placement),variation:Br(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,sg(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,sg(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const d_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:u_,data:{}};var _a={passive:!0};function h_(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=Dt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",t.update,_a)}),a&&c.addEventListener("resize",t.update,_a),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",t.update,_a)}),a&&c.removeEventListener("resize",t.update,_a)}}const f_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:h_,data:{}};var p_={left:"right",right:"left",bottom:"top",top:"bottom"};function Aa(n){return n.replace(/left|right|bottom|top/g,function(e){return p_[e]})}var g_={start:"end",end:"start"};function rg(n){return n.replace(/start|end/g,function(e){return g_[e]})}function Xc(n){var e=Dt(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function Jc(n){return Lr(hs(n)).left+Xc(n).scrollLeft}function m_(n,e){var t=Dt(n),s=hs(n),r=t.visualViewport,i=s.clientWidth,o=s.clientHeight,a=0,c=0;if(r){i=r.width,o=r.height;var u=Kp();(u||!u&&e==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:o,x:a+Jc(n),y:c}}function y_(n){var e,t=hs(n),s=Xc(n),r=(e=n.ownerDocument)==null?void 0:e.body,i=Xs(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Xs(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Jc(n),c=-s.scrollTop;return un(r||t).direction==="rtl"&&(a+=Xs(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function Kc(n){var e=un(n),t=e.overflow,s=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+s)}function ig(n){return["html","body","#document"].indexOf(_n(n))>=0?n.ownerDocument.body:Rt(n)&&Kc(n)?n:ig(Pa(n))}function Xi(n,e){var t;e===void 0&&(e=[]);var s=ig(n),r=s===((t=n.ownerDocument)==null?void 0:t.body),i=Dt(s),o=r?[i].concat(i.visualViewport||[],Kc(s)?s:[]):s,a=e.concat(o);return r?a:a.concat(Xi(Pa(o)))}function Zc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function b_(n,e){var t=Lr(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function og(n,e,t){return e===Xp?Zc(m_(n,t)):qs(e)?b_(e,t):Zc(y_(hs(n)))}function w_(n){var e=Xi(Pa(n)),t=["absolute","fixed"].indexOf(un(n).position)>=0,s=t&&Rt(n)?Yi(n):n;return qs(s)?e.filter(function(r){return qs(r)&&Zp(r,s)&&_n(r)!=="body"}):[]}function x_(n,e,t,s){var r=e==="clippingParents"?w_(n):[].concat(e),i=[].concat(r,[t]),o=i[0],a=i.reduce(function(c,u){var d=og(n,u,s);return c.top=Xs(d.top,c.top),c.right=Na(d.right,c.right),c.bottom=Na(d.bottom,c.bottom),c.left=Xs(d.left,c.left),c},og(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ag(n){var e=n.reference,t=n.element,s=n.placement,r=s?cn(s):null,i=s?Br(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(r){case Ot:c={x:o,y:e.y-t.height};break;case Wt:c={x:o,y:e.y+e.height};break;case Yt:c={x:e.x+e.width,y:a};break;case Mt:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=r?qc(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Rr:c[u]=c[u]-(e[d]/2-t[d]/2);break;case Gi:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function Ji(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=s===void 0?n.placement:s,i=t.strategy,o=i===void 0?n.strategy:i,a=t.boundary,c=a===void 0?zP:a,u=t.rootBoundary,d=u===void 0?Xp:u,h=t.elementContext,f=h===void 0?Wi:h,p=t.altBoundary,g=p===void 0?!1:p,m=t.padding,y=m===void 0?0:m,b=tg(typeof y!="number"?y:ng(y,Hi)),w=f===Wi?FP:Wi,x=n.rects.popper,C=n.elements[g?w:f],E=x_(qs(C)?C:C.contextElement||hs(n.elements.popper),c,d,o),v=Lr(n.elements.reference),S=ag({reference:v,element:x,strategy:"absolute",placement:r}),O=Zc(Object.assign({},x,S)),_=f===Wi?O:v,T={top:E.top-_.top+b.top,bottom:_.bottom-E.bottom+b.bottom,left:E.left-_.left+b.left,right:_.right-E.right+b.right},A=n.modifiersData.offset;if(f===Wi&&A){var V=A[r];Object.keys(T).forEach(function(L){var B=[Yt,Wt].indexOf(L)>=0?1:-1,P=[Ot,Wt].indexOf(L)>=0?"y":"x";T[L]+=V[P]*B})}return T}function v_(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?Uc:c,d=Br(s),h=d?a?Jp:Jp.filter(function(g){return Br(g)===d}):Hi,f=h.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=h,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=f.reduce(function(g,m){return g[m]=Ji(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 C_(n){if(cn(n)===Ma)return[];var e=Aa(n);return[rg(n),e,rg(e)]}function S_(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?[Aa(y)]:C_(y)),C=[y].concat(x).reduce(function(ne,Q){return ne.concat(cn(Q)===Ma?v_(e,{placement:Q,boundary:d,rootBoundary:h,padding:u,flipVariations:g,allowedAutoPlacements:m}):Q)},[]),E=e.rects.reference,v=e.rects.popper,S=new Map,O=!0,_=C[0],T=0;T<C.length;T++){var A=C[T],V=cn(A),L=Br(A)===Rr,B=[Ot,Wt].indexOf(V)>=0,P=B?"width":"height",M=Ji(e,{placement:A,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),k=B?L?Yt:Mt:L?Wt:Ot;E[P]>v[P]&&(k=Aa(k));var j=Aa(k),W=[];if(i&&W.push(M[V]<=0),a&&W.push(M[k]<=0,M[j]<=0),W.every(function(ne){return ne})){_=A,O=!1;break}S.set(A,W)}if(O)for(var Z=g?3:1,$=function(Q){var F=C.find(function(R){var re=S.get(R);if(re)return re.slice(0,Q).every(function(q){return q})});if(F)return _=F,"break"},D=Z;D>0;D--){var U=$(D);if(U==="break")break}e.placement!==_&&(e.modifiersData[s]._skip=!0,e.placement=_,e.reset=!0)}}const E_={name:"flip",enabled:!0,phase:"main",fn:S_,requiresIfExists:["offset"],data:{_skip:!1}};function lg(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 cg(n){return[Ot,Yt,Wt,Mt].some(function(e){return n[e]>=0})}function O_(n){var e=n.state,t=n.name,s=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=Ji(e,{elementContext:"reference"}),a=Ji(e,{altBoundary:!0}),c=lg(o,s),u=lg(a,r,i),d=cg(c),h=cg(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})}const M_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:O_};function N_(n,e,t){var s=cn(n),r=[Mt,Ot].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,[Mt,Yt].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function P_(n){var e=n.state,t=n.options,s=n.name,r=t.offset,i=r===void 0?[0,0]:r,o=Uc.reduce(function(d,h){return d[h]=N_(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}const __={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:P_};function A_(n){var e=n.state,t=n.name;e.modifiersData[t]=ag({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const T_={name:"popperOffsets",enabled:!0,phase:"read",fn:A_,data:{}};function k_(n){return n==="x"?"y":"x"}function V_(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=Ji(e,{boundary:c,rootBoundary:u,padding:h,altBoundary:d}),b=cn(e.placement),w=Br(e.placement),x=!w,C=qc(b),E=k_(C),v=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,_=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,T=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),A=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,V={x:0,y:0};if(v){if(i){var L,B=C==="y"?Ot:Mt,P=C==="y"?Wt:Yt,M=C==="y"?"height":"width",k=v[C],j=k+y[B],W=k-y[P],Z=p?-O[M]/2:0,$=w===Rr?S[M]:O[M],D=w===Rr?-O[M]:-S[M],U=e.elements.arrow,ne=p&&U?Yc(U):{width:0,height:0},Q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eg(),F=Q[B],R=Q[P],re=qi(0,S[M],ne[M]),q=x?S[M]/2-Z-re-F-T.mainAxis:$-re-F-T.mainAxis,J=x?-S[M]/2+Z+re+R+T.mainAxis:D+re+R+T.mainAxis,Ee=e.elements.arrow&&Yi(e.elements.arrow),je=Ee?C==="y"?Ee.clientTop||0:Ee.clientLeft||0:0,bt=(L=A==null?void 0:A[C])!=null?L:0,ee=k+q-bt-je,Re=k+J-bt,rs=qi(p?Na(j,ee):j,k,p?Xs(W,Re):W);v[C]=rs,V[C]=rs-k}if(a){var vt,vn=C==="x"?Ot:Mt,hr=C==="x"?Wt:Yt,Qt=v[E],Ls=E==="y"?"height":"width",fr=Qt+y[vn],ce=Qt-y[hr],Ct=[Ot,Mt].indexOf(b)!==-1,Y=(vt=A==null?void 0:A[E])!=null?vt:0,Ne=Ct?fr:Qt-S[Ls]-O[Ls]-Y+T.altAxis,is=Ct?Qt+S[Ls]+O[Ls]-Y-T.altAxis:ce,Mo=p&&Ct?s_(Ne,Qt,is):qi(p?Ne:fr,Qt,p?is:ce);v[E]=Mo,V[E]=Mo-Qt}e.modifiersData[s]=V}}const D_={name:"preventOverflow",enabled:!0,phase:"main",fn:V_,requiresIfExists:["offset"]};function R_(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function I_(n){return n===Dt(n)||!Rt(n)?Xc(n):R_(n)}function L_(n){var e=n.getBoundingClientRect(),t=Ir(e.width)/n.offsetWidth||1,s=Ir(e.height)/n.offsetHeight||1;return t!==1||s!==1}function B_(n,e,t){t===void 0&&(t=!1);var s=Rt(e),r=Rt(e)&&L_(e),i=hs(e),o=Lr(n,r,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((_n(e)!=="body"||Kc(i))&&(a=I_(e)),Rt(e)?(c=Lr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Jc(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function j_(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 $_(n){var e=j_(n);return Hc.reduce(function(t,s){return t.concat(e.filter(function(r){return r.phase===s}))},[])}function z_(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function fs(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return[].concat(t).reduce(function(r,i){return r.replace(/%s/,i)},n)}var Js='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',F_='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',ug=["name","enabled","phase","fn","effect","requires","options"];function U_(n){n.forEach(function(e){[].concat(Object.keys(e),ug).filter(function(t,s,r){return r.indexOf(t)===s}).forEach(function(t){switch(t){case"name":typeof e.name!="string"&&console.error(fs(Js,String(e.name),'"name"','"string"','"'+String(e.name)+'"'));break;case"enabled":typeof e.enabled!="boolean"&&console.error(fs(Js,e.name,'"enabled"','"boolean"','"'+String(e.enabled)+'"'));break;case"phase":Hc.indexOf(e.phase)<0&&console.error(fs(Js,e.name,'"phase"',"either "+Hc.join(", "),'"'+String(e.phase)+'"'));break;case"fn":typeof e.fn!="function"&&console.error(fs(Js,e.name,'"fn"','"function"','"'+String(e.fn)+'"'));break;case"effect":e.effect!=null&&typeof e.effect!="function"&&console.error(fs(Js,e.name,'"effect"','"function"','"'+String(e.fn)+'"'));break;case"requires":e.requires!=null&&!Array.isArray(e.requires)&&console.error(fs(Js,e.name,'"requires"','"array"','"'+String(e.requires)+'"'));break;case"requiresIfExists":Array.isArray(e.requiresIfExists)||console.error(fs(Js,e.name,'"requiresIfExists"','"array"','"'+String(e.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+e.name+'" modifier, valid properties are '+ug.map(function(s){return'"'+s+'"'}).join(", ")+'; but "'+t+'" was provided.')}e.requires&&e.requires.forEach(function(s){n.find(function(r){return r.name===s})==null&&console.error(fs(F_,String(e.name),s,s))})})})}function H_(n,e){var t=new Set;return n.filter(function(s){var r=e(s);if(!t.has(r))return t.add(r),!0})}function G_(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 dg="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",W_="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",hg={placement:"bottom",modifiers:[],strategy:"absolute"};function fg(){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 Y_(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,r=e.defaultOptions,i=r===void 0?hg:r;return function(a,c,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},hg,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},h=[],f=!1,p={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;m(),d.options=Object.assign({},i,d.options,w),d.scrollParents={reference:qs(a)?Xi(a):a.contextElement?Xi(a.contextElement):[],popper:Xi(c)};var x=$_(G_([].concat(s,d.options.modifiers)));if(d.orderedModifiers=x.filter(function(A){return A.enabled}),process.env.NODE_ENV!=="production"){var C=H_([].concat(x,d.options.modifiers),function(A){var V=A.name;return V});if(U_(C),cn(d.options.placement)===Ma){var E=d.orderedModifiers.find(function(A){var V=A.name;return V==="flip"});E||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var v=un(c),S=v.marginTop,O=v.marginRight,_=v.marginBottom,T=v.marginLeft;[S,O,_,T].some(function(A){return parseFloat(A)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return g(),p.update()},forceUpdate:function(){if(!f){var b=d.elements,w=b.reference,x=b.popper;if(!fg(w,x)){process.env.NODE_ENV!=="production"&&console.error(dg);return}d.rects={reference:B_(w,Yi(x),d.options.strategy==="fixed"),popper:Yc(x)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(A){return d.modifiersData[A.name]=Object.assign({},A.data)});for(var C=0,E=0;E<d.orderedModifiers.length;E++){if(process.env.NODE_ENV!=="production"&&(C+=1,C>100)){console.error(W_);break}if(d.reset===!0){d.reset=!1,E=-1;continue}var v=d.orderedModifiers[E],S=v.fn,O=v.options,_=O===void 0?{}:O,T=v.name;typeof S=="function"&&(d=S({state:d,options:_,name:T,instance:p})||d)}}},update:z_(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){m(),f=!0}};if(!fg(a,c))return process.env.NODE_ENV!=="production"&&console.error(dg),p;p.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){d.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,x=w===void 0?{}:w,C=y.effect;if(typeof C=="function"){var E=C({state:d,name:b,instance:p,options:x}),v=function(){};h.push(E||v)}})}function m(){h.forEach(function(y){return y()}),h=[]}return p}}var q_=[f_,T_,d_,e_,__,E_,D_,a_,M_],X_=Y_({defaultModifiers:q_});const J_=(n,e,t={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=K_(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=X_(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 K_(n){const e=Object.keys(n.elements),t=ma(e.map(r=>[r,n.styles[r]||{}])),s=ma(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:s}}const pg=n=>{if(!n)return{onClick:us,onMousedown:us,onMouseup:us};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 gg(){let n;const e=(s,r)=>{t(),n=window.setTimeout(s,r)},t=()=>window.clearTimeout(n);return qo(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Qc={prefix:Math.floor(Math.random()*1e4),current:0},Z_=Symbol("elIdInjection"),mg=()=>l.getCurrentInstance()?l.inject(Z_,Qc):Qc,Ta=n=>{const e=mg();!qe&&e===Qc&&Vt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
20
+ `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:cn(e.placement),variation:Br(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,sg(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,sg(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const d_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:u_,data:{}};var _a={passive:!0};function h_(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=Vt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",t.update,_a)}),a&&c.addEventListener("resize",t.update,_a),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",t.update,_a)}),a&&c.removeEventListener("resize",t.update,_a)}}const f_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:h_,data:{}};var p_={left:"right",right:"left",bottom:"top",top:"bottom"};function Aa(n){return n.replace(/left|right|bottom|top/g,function(e){return p_[e]})}var g_={start:"end",end:"start"};function rg(n){return n.replace(/start|end/g,function(e){return g_[e]})}function Yc(n){var e=Vt(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function qc(n){return Lr(fs(n)).left+Yc(n).scrollLeft}function m_(n,e){var t=Vt(n),s=fs(n),r=t.visualViewport,i=s.clientWidth,o=s.clientHeight,a=0,c=0;if(r){i=r.width,o=r.height;var u=Kp();(u||!u&&e==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:o,x:a+qc(n),y:c}}function y_(n){var e,t=fs(n),s=Yc(n),r=(e=n.ownerDocument)==null?void 0:e.body,i=Xs(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Xs(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+qc(n),c=-s.scrollTop;return un(r||t).direction==="rtl"&&(a+=Xs(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function Xc(n){var e=un(n),t=e.overflow,s=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+s)}function ig(n){return["html","body","#document"].indexOf(_n(n))>=0?n.ownerDocument.body:Dt(n)&&Xc(n)?n:ig(Pa(n))}function Xi(n,e){var t;e===void 0&&(e=[]);var s=ig(n),r=s===((t=n.ownerDocument)==null?void 0:t.body),i=Vt(s),o=r?[i].concat(i.visualViewport||[],Xc(s)?s:[]):s,a=e.concat(o);return r?a:a.concat(Xi(Pa(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 b_(n,e){var t=Lr(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function og(n,e,t){return e===Xp?Jc(m_(n,t)):qs(e)?b_(e,t):Jc(y_(fs(n)))}function w_(n){var e=Xi(Pa(n)),t=["absolute","fixed"].indexOf(un(n).position)>=0,s=t&&Dt(n)?Yi(n):n;return qs(s)?e.filter(function(r){return qs(r)&&Zp(r,s)&&_n(r)!=="body"}):[]}function x_(n,e,t,s){var r=e==="clippingParents"?w_(n):[].concat(e),i=[].concat(r,[t]),o=i[0],a=i.reduce(function(c,u){var d=og(n,u,s);return c.top=Xs(d.top,c.top),c.right=Na(d.right,c.right),c.bottom=Na(d.bottom,c.bottom),c.left=Xs(d.left,c.left),c},og(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ag(n){var e=n.reference,t=n.element,s=n.placement,r=s?cn(s):null,i=s?Br(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(r){case St:c={x:o,y:e.y-t.height};break;case Gt:c={x:o,y:e.y+e.height};break;case Wt:c={x:e.x+e.width,y:a};break;case Et:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=r?Wc(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Rr:c[u]=c[u]-(e[d]/2-t[d]/2);break;case Gi:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function Ji(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=s===void 0?n.placement:s,i=t.strategy,o=i===void 0?n.strategy:i,a=t.boundary,c=a===void 0?zP:a,u=t.rootBoundary,d=u===void 0?Xp:u,h=t.elementContext,f=h===void 0?Wi:h,p=t.altBoundary,g=p===void 0?!1:p,m=t.padding,y=m===void 0?0:m,b=tg(typeof y!="number"?y:ng(y,Hi)),w=f===Wi?FP:Wi,x=n.rects.popper,C=n.elements[g?w:f],E=x_(qs(C)?C:C.contextElement||fs(n.elements.popper),c,d,o),v=Lr(n.elements.reference),S=ag({reference:v,element:x,strategy:"absolute",placement:r}),O=Jc(Object.assign({},x,S)),_=f===Wi?O:v,T={top:E.top-_.top+b.top,bottom:_.bottom-E.bottom+b.bottom,left:E.left-_.left+b.left,right:_.right-E.right+b.right},A=n.modifiersData.offset;if(f===Wi&&A){var D=A[r];Object.keys(T).forEach(function(L){var j=[Wt,Gt].indexOf(L)>=0?1:-1,P=[St,Gt].indexOf(L)>=0?"y":"x";T[L]+=D[P]*j})}return T}function v_(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?zc:c,d=Br(s),h=d?a?Jp:Jp.filter(function(g){return Br(g)===d}):Hi,f=h.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=h,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=f.reduce(function(g,m){return g[m]=Ji(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 C_(n){if(cn(n)===Ma)return[];var e=Aa(n);return[rg(n),e,rg(e)]}function S_(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?[Aa(y)]:C_(y)),C=[y].concat(x).reduce(function(Q,se){return Q.concat(cn(se)===Ma?v_(e,{placement:se,boundary:d,rootBoundary:h,padding:u,flipVariations:g,allowedAutoPlacements:m}):se)},[]),E=e.rects.reference,v=e.rects.popper,S=new Map,O=!0,_=C[0],T=0;T<C.length;T++){var A=C[T],D=cn(A),L=Br(A)===Rr,j=[St,Gt].indexOf(D)>=0,P=j?"width":"height",M=Ji(e,{placement:A,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),k=j?L?Wt:Et:L?Gt:St;E[P]>v[P]&&(k=Aa(k));var $=Aa(k),V=[];if(i&&V.push(M[D]<=0),a&&V.push(M[k]<=0,M[$]<=0),V.every(function(Q){return Q})){_=A,O=!1;break}S.set(A,V)}if(O)for(var U=g?3:1,F=function(se){var H=C.find(function(I){var re=S.get(I);if(re)return re.slice(0,se).every(function(B){return B})});if(H)return _=H,"break"},q=U;q>0;q--){var X=F(q);if(X==="break")break}e.placement!==_&&(e.modifiersData[s]._skip=!0,e.placement=_,e.reset=!0)}}const E_={name:"flip",enabled:!0,phase:"main",fn:S_,requiresIfExists:["offset"],data:{_skip:!1}};function lg(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 cg(n){return[St,Wt,Gt,Et].some(function(e){return n[e]>=0})}function O_(n){var e=n.state,t=n.name,s=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=Ji(e,{elementContext:"reference"}),a=Ji(e,{altBoundary:!0}),c=lg(o,s),u=lg(a,r,i),d=cg(c),h=cg(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})}const M_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:O_};function N_(n,e,t){var s=cn(n),r=[Et,St].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,[Et,Wt].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function P_(n){var e=n.state,t=n.options,s=n.name,r=t.offset,i=r===void 0?[0,0]:r,o=zc.reduce(function(d,h){return d[h]=N_(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}const __={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:P_};function A_(n){var e=n.state,t=n.name;e.modifiersData[t]=ag({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const T_={name:"popperOffsets",enabled:!0,phase:"read",fn:A_,data:{}};function k_(n){return n==="x"?"y":"x"}function V_(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=Ji(e,{boundary:c,rootBoundary:u,padding:h,altBoundary:d}),b=cn(e.placement),w=Br(e.placement),x=!w,C=Wc(b),E=k_(C),v=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,_=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,T=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),A=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(v){if(i){var L,j=C==="y"?St:Et,P=C==="y"?Gt:Wt,M=C==="y"?"height":"width",k=v[C],$=k+y[j],V=k-y[P],U=p?-O[M]/2:0,F=w===Rr?S[M]:O[M],q=w===Rr?-O[M]:-S[M],X=e.elements.arrow,Q=p&&X?Gc(X):{width:0,height:0},se=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eg(),H=se[j],I=se[P],re=qi(0,S[M],Q[M]),B=x?S[M]/2-U-re-H-T.mainAxis:F-re-H-T.mainAxis,Z=x?-S[M]/2+U+re+I+T.mainAxis:q+re+I+T.mainAxis,Se=e.elements.arrow&&Yi(e.elements.arrow),We=Se?C==="y"?Se.clientTop||0:Se.clientLeft||0:0,At=(L=A==null?void 0:A[C])!=null?L:0,Zt=k+B-At-We,De=k+Z-At,is=qi(p?Na($,Zt):$,k,p?Xs(V,De):V);v[C]=is,D[C]=is-k}if(a){var wt,vn=C==="x"?St:Et,hr=C==="x"?Gt:Wt,Qt=v[E],Ls=E==="y"?"height":"width",fr=Qt+y[vn],le=Qt-y[hr],xt=[St,Et].indexOf(b)!==-1,Y=(wt=A==null?void 0:A[E])!=null?wt:0,Me=xt?fr:Qt-S[Ls]-O[Ls]-Y+T.altAxis,os=xt?Qt+S[Ls]+O[Ls]-Y-T.altAxis:le,Mo=p&&xt?s_(Me,Qt,os):qi(p?Me:fr,Qt,p?os:le);v[E]=Mo,D[E]=Mo-Qt}e.modifiersData[s]=D}}const D_={name:"preventOverflow",enabled:!0,phase:"main",fn:V_,requiresIfExists:["offset"]};function R_(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function I_(n){return n===Vt(n)||!Dt(n)?Yc(n):R_(n)}function L_(n){var e=n.getBoundingClientRect(),t=Ir(e.width)/n.offsetWidth||1,s=Ir(e.height)/n.offsetHeight||1;return t!==1||s!==1}function B_(n,e,t){t===void 0&&(t=!1);var s=Dt(e),r=Dt(e)&&L_(e),i=fs(e),o=Lr(n,r,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((_n(e)!=="body"||Xc(i))&&(a=I_(e)),Dt(e)?(c=Lr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=qc(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function j_(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 $_(n){var e=j_(n);return Fc.reduce(function(t,s){return t.concat(e.filter(function(r){return r.phase===s}))},[])}function z_(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function ps(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return[].concat(t).reduce(function(r,i){return r.replace(/%s/,i)},n)}var Js='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',F_='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',ug=["name","enabled","phase","fn","effect","requires","options"];function U_(n){n.forEach(function(e){[].concat(Object.keys(e),ug).filter(function(t,s,r){return r.indexOf(t)===s}).forEach(function(t){switch(t){case"name":typeof e.name!="string"&&console.error(ps(Js,String(e.name),'"name"','"string"','"'+String(e.name)+'"'));break;case"enabled":typeof e.enabled!="boolean"&&console.error(ps(Js,e.name,'"enabled"','"boolean"','"'+String(e.enabled)+'"'));break;case"phase":Fc.indexOf(e.phase)<0&&console.error(ps(Js,e.name,'"phase"',"either "+Fc.join(", "),'"'+String(e.phase)+'"'));break;case"fn":typeof e.fn!="function"&&console.error(ps(Js,e.name,'"fn"','"function"','"'+String(e.fn)+'"'));break;case"effect":e.effect!=null&&typeof e.effect!="function"&&console.error(ps(Js,e.name,'"effect"','"function"','"'+String(e.fn)+'"'));break;case"requires":e.requires!=null&&!Array.isArray(e.requires)&&console.error(ps(Js,e.name,'"requires"','"array"','"'+String(e.requires)+'"'));break;case"requiresIfExists":Array.isArray(e.requiresIfExists)||console.error(ps(Js,e.name,'"requiresIfExists"','"array"','"'+String(e.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+e.name+'" modifier, valid properties are '+ug.map(function(s){return'"'+s+'"'}).join(", ")+'; but "'+t+'" was provided.')}e.requires&&e.requires.forEach(function(s){n.find(function(r){return r.name===s})==null&&console.error(ps(F_,String(e.name),s,s))})})})}function H_(n,e){var t=new Set;return n.filter(function(s){var r=e(s);if(!t.has(r))return t.add(r),!0})}function G_(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 dg="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",W_="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",hg={placement:"bottom",modifiers:[],strategy:"absolute"};function fg(){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 Y_(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,r=e.defaultOptions,i=r===void 0?hg:r;return function(a,c,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},hg,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},h=[],f=!1,p={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;m(),d.options=Object.assign({},i,d.options,w),d.scrollParents={reference:qs(a)?Xi(a):a.contextElement?Xi(a.contextElement):[],popper:Xi(c)};var x=$_(G_([].concat(s,d.options.modifiers)));if(d.orderedModifiers=x.filter(function(A){return A.enabled}),process.env.NODE_ENV!=="production"){var C=H_([].concat(x,d.options.modifiers),function(A){var D=A.name;return D});if(U_(C),cn(d.options.placement)===Ma){var E=d.orderedModifiers.find(function(A){var D=A.name;return D==="flip"});E||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var v=un(c),S=v.marginTop,O=v.marginRight,_=v.marginBottom,T=v.marginLeft;[S,O,_,T].some(function(A){return parseFloat(A)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return g(),p.update()},forceUpdate:function(){if(!f){var b=d.elements,w=b.reference,x=b.popper;if(!fg(w,x)){process.env.NODE_ENV!=="production"&&console.error(dg);return}d.rects={reference:B_(w,Yi(x),d.options.strategy==="fixed"),popper:Gc(x)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(A){return d.modifiersData[A.name]=Object.assign({},A.data)});for(var C=0,E=0;E<d.orderedModifiers.length;E++){if(process.env.NODE_ENV!=="production"&&(C+=1,C>100)){console.error(W_);break}if(d.reset===!0){d.reset=!1,E=-1;continue}var v=d.orderedModifiers[E],S=v.fn,O=v.options,_=O===void 0?{}:O,T=v.name;typeof S=="function"&&(d=S({state:d,options:_,name:T,instance:p})||d)}}},update:z_(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){m(),f=!0}};if(!fg(a,c))return process.env.NODE_ENV!=="production"&&console.error(dg),p;p.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){d.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,x=w===void 0?{}:w,C=y.effect;if(typeof C=="function"){var E=C({state:d,name:b,instance:p,options:x}),v=function(){};h.push(E||v)}})}function m(){h.forEach(function(y){return y()}),h=[]}return p}}var q_=[f_,T_,d_,e_,__,E_,D_,a_,M_],X_=Y_({defaultModifiers:q_});const J_=(n,e,t={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=K_(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=X_(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 K_(n){const e=Object.keys(n.elements),t=ma(e.map(r=>[r,n.styles[r]||{}])),s=ma(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:s}}const pg=n=>{if(!n)return{onClick:ds,onMousedown:ds,onMouseup:ds};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 gg(){let n;const e=(s,r)=>{t(),n=window.setTimeout(s,r)},t=()=>window.clearTimeout(n);return qo(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Kc={prefix:Math.floor(Math.random()*1e4),current:0},Z_=Symbol("elIdInjection"),mg=()=>l.getCurrentInstance()?l.inject(Z_,Kc):Kc,Ta=n=>{const e=mg();!Ye&&e===Kc&&kt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
21
21
  usage: app.provide(ID_INJECTION_KEY, {
22
22
  prefix: number,
23
23
  current: number,
24
- })`);const t=Fc();return l.computed(()=>l.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let jr=[];const yg=n=>{const e=n;e.key===Dr.esc&&jr.forEach(t=>t(e))},Q_=n=>{l.onMounted(()=>{jr.length===0&&document.addEventListener("keydown",yg),qe&&jr.push(n)}),l.onBeforeUnmount(()=>{jr=jr.filter(e=>e!==n),jr.length===0&&qe&&document.removeEventListener("keydown",yg)})},bg=()=>{const n=Fc(),e=mg(),t=l.computed(()=>`${n.value}-popper-container-${e.prefix}`),s=l.computed(()=>`#${t.value}`);return{id:t,selector:s}},eA=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},tA=()=>{const{id:n,selector:e}=bg();return l.onBeforeMount(()=>{qe&&(process.env.NODE_ENV==="test"||!document.body.querySelector(e.value))&&eA(n.value)}),{id:n,selector:e}},nA=tt({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),sA=({showAfter:n,hideAfter:e,autoClose:t,open:s,close:r})=>{const{registerTimeout:i}=gg(),{registerTimeout:o,cancelTimeout:a}=gg();return{onOpen:d=>{i(()=>{s(d);const h=l.unref(t);Gt(h)&&h>0&&o(()=>{r(d)},h)},l.unref(n))},onClose:d=>{a(),i(()=>{r(d)},l.unref(e))}}},wg=Symbol("elForwardRef"),rA=n=>{const e=t=>{n.value=t};l.provide(wg,{setForwardRef:e})},iA=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),xg={current:0},vg=l.ref(0),Cg=2e3,Sg=Symbol("elZIndexContextKey"),Eg=Symbol("zIndexContextKey"),Og=n=>{const e=l.getCurrentInstance()?l.inject(Sg,xg):xg,t=n||(l.getCurrentInstance()?l.inject(Eg,void 0):void 0),s=l.computed(()=>{const o=l.unref(t);return Gt(o)?o:Cg}),r=l.computed(()=>s.value+vg.value),i=()=>(e.current++,vg.value=e.current,r.value);return!qe&&!l.inject(Sg)&&Vt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
25
- usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function oA(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 eu=Ca({type:String,values:Hp,required:!1}),Mg=Symbol("size"),aA=()=>{const n=l.inject(Mg,{});return l.computed(()=>l.unref(n.size)||"")};function lA(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=>{Ft(e)&&e(f)||c.value||(c.value=!0,o("focus",f),t==null||t())},d=f=>{var p;Ft(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")}),Wn(a,"focus",u,!0),Wn(a,"blur",d,!0),Wn(a,"click",h,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const f=Xn(n.value)?n.value:document.querySelector("input,textarea");f&&(Wn(f,"focus",u,!0),Wn(f,"blur",d,!0))}),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}function cA({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=!OP(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 uA=Symbol("emptyValuesContextKey"),dA=tt({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>Ft(n)?!n():!n}}),hA=tt({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),tu=n=>jc(hA,n),Ng=Symbol(),ka=l.ref();function nu(n,e=void 0){const t=l.getCurrentInstance()?l.inject(Ng,ka):ka;return n?l.computed(()=>{var s,r;return(r=(s=t.value)==null?void 0:s[n])!=null?r:e}):t}function Pg(n,e){const t=nu(),s=wt(n,l.computed(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||Oa})),r=RP(l.computed(()=>{var a;return(a=t.value)==null?void 0:a.locale})),i=Og(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 _g(l.computed(()=>l.unref(t)||{})),{ns:s,locale:r,zIndex:i,size:o}}const _g=(n,e,t=!1)=>{var s;const r=!!l.getCurrentInstance(),i=r?nu():void 0,o=(s=void 0)!=null?s:r?l.provide:void 0;if(!o){Vt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=l.computed(()=>{const c=l.unref(n);return i!=null&&i.value?fA(i.value,c):c});return o(Ng,a),o(Wp,l.computed(()=>a.value.locale)),o(Yp,l.computed(()=>a.value.namespace)),o(Eg,l.computed(()=>a.value.zIndex)),o(Mg,{size:l.computed(()=>a.value.size||"")}),o(uA,l.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!ka.value)&&(ka.value=a.value),a},fA=(n,e)=>{const t=[...new Set([...Vp(n),...Vp(e)])],s={};for(const r of t)s[r]=e[r]!==void 0?e[r]:n[r];return s},pA=tt({a11y:{type:Boolean,default:!0},locale:{type:fe(Object)},size:eu,button:{type:fe(Object)},experimentalFeatures:{type:fe(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:fe(Object)},zIndex:Number,namespace:{type:String,default:"el"},...dA}),dn={};l.defineComponent({name:"ElConfigProvider",props:pA,setup(n,{slots:e}){l.watch(()=>n.message,s=>{Object.assign(dn,s??{})},{immediate:!0,deep:!0});const t=_g(n);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var gt=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};const gA=tt({size:{type:fe([Number,String])},color:{type:String}}),mA=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),yA=l.defineComponent({...mA,props:gA,setup(n){const e=n,t=wt("icon"),s=l.computed(()=>{const{size:r,color:i}=e;return!r&&!i?{}:{fontSize:kp(r)?void 0:Fi(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 bA=gt(yA,[["__file","icon.vue"]]);const An=Ws(bA),su=Symbol("formContextKey"),Va=Symbol("formItemContextKey"),Ag=(n,e={})=>{const t=l.ref(void 0),s=e.prop?t:qp("size"),r=e.global?t:aA(),i=e.form?{size:void 0}:l.inject(su,void 0),o=e.formItem?{size:void 0}:l.inject(Va,void 0);return l.computed(()=>s.value||l.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},ru=n=>{const e=qp("disabled"),t=l.inject(su,void 0);return l.computed(()=>e.value||l.unref(n)||(t==null?void 0:t.disabled)||!1)},Tg=()=>{const n=l.inject(su,void 0),e=l.inject(Va,void 0);return{form:n,formItem:e}},wA=(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:Ta().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 hn;const xA=`
24
+ })`);const t=$c();return l.computed(()=>l.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let jr=[];const yg=n=>{const e=n;e.key===Dr.esc&&jr.forEach(t=>t(e))},Q_=n=>{l.onMounted(()=>{jr.length===0&&document.addEventListener("keydown",yg),Ye&&jr.push(n)}),l.onBeforeUnmount(()=>{jr=jr.filter(e=>e!==n),jr.length===0&&Ye&&document.removeEventListener("keydown",yg)})},bg=()=>{const n=$c(),e=mg(),t=l.computed(()=>`${n.value}-popper-container-${e.prefix}`),s=l.computed(()=>`#${t.value}`);return{id:t,selector:s}},eA=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},tA=()=>{const{id:n,selector:e}=bg();return l.onBeforeMount(()=>{Ye&&(process.env.NODE_ENV==="test"||!document.body.querySelector(e.value))&&eA(n.value)}),{id:n,selector:e}},nA=et({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),sA=({showAfter:n,hideAfter:e,autoClose:t,open:s,close:r})=>{const{registerTimeout:i}=gg(),{registerTimeout:o,cancelTimeout:a}=gg();return{onOpen:d=>{i(()=>{s(d);const h=l.unref(t);Ht(h)&&h>0&&o(()=>{r(d)},h)},l.unref(n))},onClose:d=>{a(),i(()=>{r(d)},l.unref(e))}}},wg=Symbol("elForwardRef"),rA=n=>{const e=t=>{n.value=t};l.provide(wg,{setForwardRef:e})},iA=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),xg={current:0},vg=l.ref(0),Cg=2e3,Sg=Symbol("elZIndexContextKey"),Eg=Symbol("zIndexContextKey"),Og=n=>{const e=l.getCurrentInstance()?l.inject(Sg,xg):xg,t=n||(l.getCurrentInstance()?l.inject(Eg,void 0):void 0),s=l.computed(()=>{const o=l.unref(t);return Ht(o)?o:Cg}),r=l.computed(()=>s.value+vg.value),i=()=>(e.current++,vg.value=e.current,r.value);return!Ye&&!l.inject(Sg)&&kt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
25
+ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function oA(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 Zc=Ca({type:String,values:Hp,required:!1}),Mg=Symbol("size"),aA=()=>{const n=l.inject(Mg,{});return l.computed(()=>l.unref(n.size)||"")};function lA(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=>{zt(e)&&e(f)||c.value||(c.value=!0,o("focus",f),t==null||t())},d=f=>{var p;zt(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")}),Wn(a,"focus",u,!0),Wn(a,"blur",d,!0),Wn(a,"click",h,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const f=Xn(n.value)?n.value:document.querySelector("input,textarea");f&&(Wn(f,"focus",u,!0),Wn(f,"blur",d,!0))}),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}function cA({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=!OP(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 uA=Symbol("emptyValuesContextKey"),dA=et({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>zt(n)?!n():!n}}),hA=et({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Qc=n=>Lc(hA,n),Ng=Symbol(),ka=l.ref();function eu(n,e=void 0){const t=l.getCurrentInstance()?l.inject(Ng,ka):ka;return n?l.computed(()=>{var s,r;return(r=(s=t.value)==null?void 0:s[n])!=null?r:e}):t}function Pg(n,e){const t=eu(),s=yt(n,l.computed(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||Oa})),r=RP(l.computed(()=>{var a;return(a=t.value)==null?void 0:a.locale})),i=Og(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 _g(l.computed(()=>l.unref(t)||{})),{ns:s,locale:r,zIndex:i,size:o}}const _g=(n,e,t=!1)=>{var s;const r=!!l.getCurrentInstance(),i=r?eu():void 0,o=(s=void 0)!=null?s:r?l.provide:void 0;if(!o){kt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=l.computed(()=>{const c=l.unref(n);return i!=null&&i.value?fA(i.value,c):c});return o(Ng,a),o(Wp,l.computed(()=>a.value.locale)),o(Yp,l.computed(()=>a.value.namespace)),o(Eg,l.computed(()=>a.value.zIndex)),o(Mg,{size:l.computed(()=>a.value.size||"")}),o(uA,l.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!ka.value)&&(ka.value=a.value),a},fA=(n,e)=>{const t=[...new Set([...Vp(n),...Vp(e)])],s={};for(const r of t)s[r]=e[r]!==void 0?e[r]:n[r];return s},pA=et({a11y:{type:Boolean,default:!0},locale:{type:he(Object)},size:Zc,button:{type:he(Object)},experimentalFeatures:{type:he(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:he(Object)},zIndex:Number,namespace:{type:String,default:"el"},...dA}),dn={};l.defineComponent({name:"ElConfigProvider",props:pA,setup(n,{slots:e}){l.watch(()=>n.message,s=>{Object.assign(dn,s??{})},{immediate:!0,deep:!0});const t=_g(n);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var pt=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};const gA=et({size:{type:he([Number,String])},color:{type:String}}),mA=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),yA=l.defineComponent({...mA,props:gA,setup(n){const e=n,t=yt("icon"),s=l.computed(()=>{const{size:r,color:i}=e;return!r&&!i?{}:{fontSize:kp(r)?void 0:Fi(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 bA=pt(yA,[["__file","icon.vue"]]);const An=Ws(bA),tu=Symbol("formContextKey"),Va=Symbol("formItemContextKey"),Ag=(n,e={})=>{const t=l.ref(void 0),s=e.prop?t:qp("size"),r=e.global?t:aA(),i=e.form?{size:void 0}:l.inject(tu,void 0),o=e.formItem?{size:void 0}:l.inject(Va,void 0);return l.computed(()=>s.value||l.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},nu=n=>{const e=qp("disabled"),t=l.inject(tu,void 0);return l.computed(()=>e.value||l.unref(n)||(t==null?void 0:t.disabled)||!1)},Tg=()=>{const n=l.inject(tu,void 0),e=l.inject(Va,void 0);return{form:n,formItem:e}},wA=(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:Ta().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 hn;const xA=`
26
26
  height:0 !important;
27
27
  visibility:hidden !important;
28
28
  ${$v()?"":"overflow:hidden !important;"}
@@ -30,15 +30,15 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
30
30
  z-index:-1000 !important;
31
31
  top:0 !important;
32
32
  right:0 !important;
33
- `,vA=["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 CA(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:vA.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:t}}function kg(n,e=1,t){var s;hn||(hn=document.createElement("textarea"),document.body.appendChild(hn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=CA(n);hn.setAttribute("style",`${a};${xA}`),hn.value=n.value||n.placeholder||"";let c=hn.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-r),hn.value="";const d=hn.scrollHeight-r;if(Gt(e)){let h=d*e;o==="border-box"&&(h=h+r+i),c=Math.max(h,c),u.minHeight=`${h}px`}if(Gt(t)){let h=d*t;o==="border-box"&&(h=h+r+i),c=Math.min(h,c)}return u.height=`${c}px`,(s=hn.parentNode)==null||s.removeChild(hn),hn=void 0,u}const SA=tt({id:{type:String,default:void 0},size:eu,disabled:Boolean,modelValue:{type:fe([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:fe([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:Ui},prefixIcon:{type:Ui},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:fe([Object,Array,String]),default:()=>Gp({})},autofocus:Boolean,rows:{type:Number,default:2},...tu(["ariaLabel"])}),EA={[zc]:n=>rn(n),input:n=>rn(n),change:n=>rn(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},OA=l.defineComponent({name:"ElInput",inheritAttrs:!1}),MA=l.defineComponent({...OA,props:SA,emits:EA,setup(n,{expose:e,emit:t}){const s=n,r=l.useAttrs(),i=l.useSlots(),o=l.computed(()=>{const Y={};return s.containerRole==="combobox"&&(Y["aria-haspopup"]=r["aria-haspopup"],Y["aria-owns"]=r["aria-owns"],Y["aria-expanded"]=r["aria-expanded"]),Y}),a=l.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(p.value),m.is("disabled",g.value),m.is("exceed",U.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")]:W.value&&Z.value,[m.b("hidden")]:s.type==="hidden"},r.class]),c=l.computed(()=>[m.e("wrapper"),m.is("focus",_.value)]),u=PP({excludeKeys:l.computed(()=>Object.keys(o.value))}),{form:d,formItem:h}=Tg(),{inputId:f}=wA(s,{formItemContext:h}),p=Ag(),g=ru(),m=wt("input"),y=wt("textarea"),b=l.shallowRef(),w=l.shallowRef(),x=l.ref(!1),C=l.ref(!1),E=l.ref(),v=l.shallowRef(s.inputStyle),S=l.computed(()=>b.value||w.value),{wrapperRef:O,isFocused:_,handleFocus:T,handleBlur:A}=lA(S,{beforeFocus(){return g.value},afterBlur(){var Y;s.validateEvent&&((Y=h==null?void 0:h.validate)==null||Y.call(h,"blur").catch(Ne=>Vt(Ne)))}}),V=l.computed(()=>{var Y;return(Y=d==null?void 0:d.statusIcon)!=null?Y:!1}),L=l.computed(()=>(h==null?void 0:h.validateState)||""),B=l.computed(()=>L.value&&vP[L.value]),P=l.computed(()=>C.value?bP:fP),M=l.computed(()=>[r.style]),k=l.computed(()=>[s.inputStyle,v.value,{resize:s.resize}]),j=l.computed(()=>ba(s.modelValue)?"":String(s.modelValue)),W=l.computed(()=>s.clearable&&!g.value&&!s.readonly&&!!j.value&&(_.value||x.value)),Z=l.computed(()=>s.showPassword&&!g.value&&!!j.value&&(!!j.value||_.value)),$=l.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!g.value&&!s.readonly&&!s.showPassword),D=l.computed(()=>j.value.length),U=l.computed(()=>!!$.value&&D.value>Number(s.maxlength)),ne=l.computed(()=>!!i.suffix||!!s.suffixIcon||W.value||s.showPassword||$.value||!!L.value&&V.value),[Q,F]=oA(b);Ih(w,Y=>{if(q(),!$.value||s.resize!=="both")return;const Ne=Y[0],{width:is}=Ne.contentRect;E.value={right:`calc(100% - ${is+15+6}px)`}});const R=()=>{const{type:Y,autosize:Ne}=s;if(!(!qe||Y!=="textarea"||!w.value))if(Ne){const is=Sr(Ne)?Ne.minRows:void 0,Mo=Sr(Ne)?Ne.maxRows:void 0,x0=kg(w.value,is,Mo);v.value={overflowY:"hidden",...x0},l.nextTick(()=>{w.value.offsetHeight,v.value=x0})}else v.value={minHeight:kg(w.value).minHeight}},q=(Y=>{let Ne=!1;return()=>{var is;if(Ne||!s.autosize)return;((is=w.value)==null?void 0:is.offsetParent)===null||(Y(),Ne=!0)}})(R),J=()=>{const Y=S.value,Ne=s.formatter?s.formatter(j.value):j.value;!Y||Y.value===Ne||(Y.value=Ne)},Ee=async Y=>{Q();let{value:Ne}=Y.target;if(s.formatter&&(Ne=s.parser?s.parser(Ne):Ne),!bt.value){if(Ne===j.value){J();return}t(zc,Ne),t("input",Ne),await l.nextTick(),J(),F()}},je=Y=>{t("change",Y.target.value)},{isComposing:bt,handleCompositionStart:ee,handleCompositionUpdate:Re,handleCompositionEnd:rs}=cA({emit:t,afterComposition:Ee}),vt=()=>{C.value=!C.value,vn()},vn=async()=>{var Y;await l.nextTick(),(Y=S.value)==null||Y.focus()},hr=()=>{var Y;return(Y=S.value)==null?void 0:Y.blur()},Qt=Y=>{x.value=!1,t("mouseleave",Y)},Ls=Y=>{x.value=!0,t("mouseenter",Y)},fr=Y=>{t("keydown",Y)},ce=()=>{var Y;(Y=S.value)==null||Y.select()},Ct=()=>{t(zc,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>s.modelValue,()=>{var Y;l.nextTick(()=>R()),s.validateEvent&&((Y=h==null?void 0:h.validate)==null||Y.call(h,"change").catch(Ne=>Vt(Ne)))}),l.watch(j,()=>J()),l.watch(()=>s.type,async()=>{await l.nextTick(),J(),R()}),l.onMounted(()=>{!s.formatter&&s.parser&&Vt("ElInput","If you set the parser, you also need to set the formatter."),J(),l.nextTick(R)}),e({input:b,textarea:w,ref:S,textareaStyle:k,autosize:l.toRef(s,"autosize"),isComposing:bt,focus:vn,blur:hr,select:ce,clear:Ct,resizeTextarea:R}),(Y,Ne)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(o),{class:[l.unref(a),{[l.unref(m).bm("group","append")]:Y.$slots.append,[l.unref(m).bm("group","prepend")]:Y.$slots.prepend}],style:l.unref(M),role:Y.containerRole,onMouseenter:Ls,onMouseleave:Qt}),[l.createCommentVNode(" input "),Y.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),Y.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(m).be("group","prepend"))},[l.renderSlot(Y.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:O,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),Y.$slots.prefix||Y.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(Y.$slots,"prefix"),Y.prefixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(Y.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:Y.minlength,maxlength:Y.maxlength,type:Y.showPassword?C.value?"text":"password":Y.type,disabled:l.unref(g),readonly:Y.readonly,autocomplete:Y.autocomplete,tabindex:Y.tabindex,"aria-label":Y.ariaLabel,placeholder:Y.placeholder,style:Y.inputStyle,form:Y.form,autofocus:Y.autofocus,onCompositionstart:l.unref(ee),onCompositionupdate:l.unref(Re),onCompositionend:l.unref(rs),onInput:Ee,onChange:je,onKeydown:fr}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(ne)?(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(W)||!l.unref(Z)||!l.unref($)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(Y.$slots,"suffix"),Y.suffixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(Y.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(W)?(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("clear")]),onMousedown:l.withModifiers(l.unref(us),["prevent"]),onClick:Ct},{default:l.withCtx(()=>[l.createVNode(l.unref(Bp))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(Z)?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("password")]),onClick:vt},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(P))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref($)?(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(D))+" / "+l.toDisplayString(Y.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(L)&&l.unref(B)&&l.unref(V)?(l.openBlock(),l.createBlock(l.unref(An),{key:4,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("validateIcon"),l.unref(m).is("loading",l.unref(L)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(B))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),Y.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(m).be("group","append"))},[l.renderSlot(Y.$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(_))]},l.unref(u),{minlength:Y.minlength,maxlength:Y.maxlength,tabindex:Y.tabindex,disabled:l.unref(g),readonly:Y.readonly,autocomplete:Y.autocomplete,style:l.unref(k),"aria-label":Y.ariaLabel,placeholder:Y.placeholder,form:Y.form,autofocus:Y.autofocus,rows:Y.rows,onCompositionstart:l.unref(ee),onCompositionupdate:l.unref(Re),onCompositionend:l.unref(rs),onInput:Ee,onFocus:l.unref(T),onBlur:l.unref(A),onChange:je,onKeydown:fr}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),l.unref($)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(E.value),class:l.normalizeClass(l.unref(m).e("count"))},l.toDisplayString(l.unref(D))+" / "+l.toDisplayString(Y.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var NA=gt(MA,[["__file","input.vue"]]);const PA=Ws(NA),iu=Symbol("popper"),Vg=Symbol("popperContent"),Dg=tt({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),_A=l.defineComponent({name:"ElPopper",inheritAttrs:!1}),AA=l.defineComponent({..._A,props:Dg,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(iu,c),(u,d)=>l.renderSlot(u.$slots,"default")}});var TA=gt(AA,[["__file","popper.vue"]]);const Rg=tt({arrowOffset:{type:Number,default:5}}),kA=l.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),VA=l.defineComponent({...kA,props:Rg,setup(n,{expose:e}){const t=n,s=wt("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=l.inject(Vg,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 DA=gt(VA,[["__file","arrow.vue"]]);const ou="ElOnlyChild",RA=l.defineComponent({name:ou,setup(n,{slots:e,attrs:t}){var s;const r=l.inject(wg),i=iA((s=r==null?void 0:r.setForwardRef)!=null?s:us);return()=>{var o;const a=(o=e.default)==null?void 0:o.call(e,t);if(!a)return null;if(a.length>1)return Vt(ou,"requires exact only one valid child."),null;const c=Ig(a);return c?l.withDirectives(l.cloneVNode(c,t),[[i]]):(Vt(ou,"no valid child node found"),null)}}});function Ig(n){if(!n)return null;const e=n;for(const t of e){if(Sr(t))switch(t.type){case l.Comment:continue;case l.Text:case"svg":return Lg(t);case l.Fragment:return Ig(t.children);default:return t}return Lg(t)}return null}function Lg(n){const e=wt("only-child");return l.createVNode("span",{class:e.e("content")},[n])}const Bg=tt({virtualRef:{type:fe(Object)},virtualTriggering:Boolean,onMouseenter:{type:fe(Function)},onMouseleave:{type:fe(Function)},onClick:{type:fe(Function)},onKeydown:{type:fe(Function)},onFocus:{type:fe(Function)},onBlur:{type:fe(Function)},onContextmenu:{type:fe(Function)},id:String,open:Boolean}),IA=l.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),LA=l.defineComponent({...IA,props:Bg,setup(n,{expose:e}){const t=n,{role:s,triggerRef:r}=l.inject(iu,void 0);rA(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=cs(h))},{immediate:!0}),l.watch(r,(h,f)=>{u==null||u(),u=void 0,Xn(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)=>{ba(p[m])?h.removeAttribute(g):h.setAttribute(g,p[m])})},{immediate:!0})),Xn(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&&Xn(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(RA),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 BA=gt(LA,[["__file","trigger.vue"]]);const au="focus-trap.focus-after-trapped",lu="focus-trap.focus-after-released",jA="focus-trap.focusout-prevented",jg={cancelable:!0,bubbles:!1},$A={cancelable:!0,bubbles:!1},$g="focusAfterTrapped",zg="focusAfterReleased",zA=Symbol("elFocusTrap"),cu=l.ref(),Da=l.ref(0),uu=l.ref(0);let Ra=0;const Fg=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},Ug=(n,e)=>{for(const t of n)if(!FA(t,e))return t},FA=(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},UA=n=>{const e=Fg(n),t=Ug(e,n),s=Ug(e.reverse(),n);return[t,s]},HA=n=>n instanceof HTMLInputElement&&"select"in n,ps=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),uu.value=window.performance.now(),n!==t&&HA(n)&&e&&n.select()}};function Hg(n,e){const t=[...n],s=n.indexOf(e);return s!==-1&&t.splice(s,1),t}const GA=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=Hg(n,s),n.unshift(s)},remove:s=>{var r,i;n=Hg(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},WA=(n,e=!1)=>{const t=document.activeElement;for(const s of n)if(ps(s,e),document.activeElement!==t)return},Gg=GA(),YA=()=>Da.value>uu.value,Ia=()=>{cu.value="pointer",Da.value=window.performance.now()},Wg=()=>{cu.value="keyboard",Da.value=window.performance.now()},qA=()=>(l.onMounted(()=>{Ra===0&&(document.addEventListener("mousedown",Ia),document.addEventListener("touchstart",Ia),document.addEventListener("keydown",Wg)),Ra++}),l.onBeforeUnmount(()=>{Ra--,Ra<=0&&(document.removeEventListener("mousedown",Ia),document.removeEventListener("touchstart",Ia),document.removeEventListener("keydown",Wg))}),{focusReason:cu,lastUserFocusTimestamp:Da,lastAutomatedFocusTimestamp:uu}),La=n=>new CustomEvent(jA,{...$A,detail:n}),XA=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[$g,zg,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=l.ref();let s,r;const{focusReason:i}=qA();Q_(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:C}=g,{loop:E}=n,v=m===Dr.tab&&!y&&!b&&!w,S=document.activeElement;if(v&&S){const O=x,[_,T]=UA(O);if(_&&T){if(!C&&S===T){const V=La({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),E&&ps(_,!0))}else if(C&&[_,O].includes(S)){const V=La({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),E&&ps(T,!0))}}else if(S===O){const V=La({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||g.preventDefault()}}};l.provide(zA,{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($g,g)},u=g=>e(zg,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:ps(r,!0))},h=g=>{const m=l.unref(t);if(!(o.paused||!m))if(n.trapped){const y=g.relatedTarget;!ba(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=La({focusReason:i.value});e("focusout-prevented",b),b.defaultPrevented||ps(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){Gg.push(o);const m=g.contains(document.activeElement)?s:document.activeElement;if(s=m,!g.contains(m)){const b=new Event(au,jg);g.addEventListener(au,c),g.dispatchEvent(b),b.defaultPrevented||l.nextTick(()=>{let w=n.focusStartEl;rn(w)||(ps(w),document.activeElement!==w&&(w="first")),w==="first"&&WA(Fg(g),!0),(document.activeElement===m||w==="container")&&ps(g)})}}}function p(){const g=l.unref(t);if(g){g.removeEventListener(au,c);const m=new CustomEvent(lu,{...jg,detail:{focusReason:i.value}});g.addEventListener(lu,u),g.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!YA()||g.contains(document.activeElement))&&ps(s??document.body),g.removeEventListener(lu,u),Gg.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 JA(n,e,t,s,r,i){return l.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Yg=gt(XA,[["render",JA],["__file","focus-trap.vue"]]);const KA=["fixed","absolute"],ZA=tt({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:fe(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Uc,default:"bottom"},popperOptions:{type:fe(Object),default:()=>({})},strategy:{type:String,values:KA,default:"absolute"}}),qg=tt({...ZA,id:String,style:{type:fe([String,Array,Object])},className:{type:fe([String,Array,Object])},effect:{type:fe(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:fe([String,Array,Object])},popperStyle:{type:fe([String,Array,Object])},referenceEl:{type:fe(Object)},triggerTargetEl:{type:fe(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...tu(["ariaLabel"])}),QA={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},eT=(n,e=[])=>{const{placement:t,strategy:s,popperOptions:r}=n,i={placement:t,strategy:s,...r,modifiers:[...nT(n),...e]};return sT(i,r==null?void 0:r.modifiers),i},tT=n=>{if(qe)return cs(n)};function nT(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 sT(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const rT=0,iT=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:s,role:r}=l.inject(iu,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:rT;return{name:"arrow",enabled:!NN(w),options:{element:w,padding:x}}}),u=l.computed(()=>({onFirstUpdate:()=>{g()},...eT(n,[l.unref(c),l.unref(a)])})),d=l.computed(()=>tT(n.referenceEl)||l.unref(s)),{attributes:h,state:f,styles:p,update:g,forceUpdate:m,instanceRef:y}=J_(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}},oT=(n,{attributes:e,styles:t,role:s})=>{const{nextZIndex:r}=Og(),i=wt("popper"),o=l.computed(()=>l.unref(e).popper),a=l.ref(Gt(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=Gt(n.zIndex)?n.zIndex:r()}}},aT=(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")}}},lT=l.defineComponent({name:"ElPopperContent"}),cT=l.defineComponent({...lT,props:qg,emits:QA,setup(n,{expose:e,emit:t}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=aT(s,t),{attributes:h,arrowRef:f,contentRef:p,styles:g,instanceRef:m,role:y,update:b}=iT(s),{ariaModal:w,arrowStyle:x,contentAttrs:C,contentClass:E,contentStyle:v,updateZIndex:S}=oT(s,{styles:g,attributes:h,role:y}),O=l.inject(Va,void 0),_=l.ref();l.provide(Vg,{arrowStyle:x,arrowRef:f,arrowOffset:_}),O&&l.provide(Va,{...O,addInputId:us,removeInputId:us});let T;const A=(L=!0)=>{b(),L&&S()},V=()=>{A(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return l.onMounted(()=>{l.watch(()=>s.triggerTargetEl,(L,B)=>{T==null||T(),T=void 0;const P=l.unref(L||p.value),M=l.unref(B||p.value);Xn(P)&&(T=l.watch([y,()=>s.ariaLabel,w,()=>s.id],k=>{["role","aria-label","aria-modal","id"].forEach((j,W)=>{ba(k[W])?P.removeAttribute(j):P.setAttribute(j,k[W])})},{immediate:!0})),M!==P&&Xn(M)&&["role","aria-label","aria-modal","id"].forEach(k=>{M.removeAttribute(k)})},{immediate:!0}),l.watch(()=>s.visible,V,{immediate:!0})}),l.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:p,popperInstanceRef:m,updatePopper:A,contentStyle:v}),(L,B)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({ref_key:"contentRef",ref:p},l.unref(C),{style:l.unref(v),class:l.unref(E),tabindex:"-1",onMouseenter:P=>L.$emit("mouseenter",P),onMouseleave:P=>L.$emit("mouseleave",P)}),[l.createVNode(l.unref(Yg),{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(L.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var uT=gt(cT,[["__file","content.vue"]]);const dT=Ws(TA),du=Symbol("elTooltip"),Xg=tt({...nA,...qg,appendTo:{type:fe([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:fe(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...tu(["ariaLabel"])}),Jg=tt({...Bg,disabled:Boolean,trigger:{type:fe([String,Array]),default:"hover"},triggerKeys:{type:fe(Array),default:()=>[Dr.enter,Dr.space]}}),{useModelToggleProps:hT,useModelToggleEmits:fT,useModelToggle:pT}=$P("visible"),gT=tt({...Dg,...hT,...Xg,...Jg,...Rg,showArrow:{type:Boolean,default:!0}}),mT=[...fT,"before-show","before-hide","show","hide","open","close"],yT=(n,e)=>Fv(n)?n.includes(e):n===e,$r=(n,e,t)=>s=>{yT(l.unref(n),e)&&t(s)},bT=l.defineComponent({name:"ElTooltipTrigger"}),wT=l.defineComponent({...bT,props:Jg,setup(n,{expose:e}){const t=n,s=wt("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:c,onToggle:u}=l.inject(du,void 0),d=l.ref(null),h=()=>{if(l.unref(r)||t.disabled)return!0},f=l.toRef(t,"trigger"),p=Gn(h,$r(f,"hover",a)),g=Gn(h,$r(f,"hover",c)),m=Gn(h,$r(f,"click",C=>{C.button===0&&u(C)})),y=Gn(h,$r(f,"focus",a)),b=Gn(h,$r(f,"focus",c)),w=Gn(h,$r(f,"contextmenu",C=>{C.preventDefault(),u(C)})),x=Gn(h,C=>{const{code:E}=C;t.triggerKeys.includes(E)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,E)=>(l.openBlock(),l.createBlock(l.unref(BA),{id:l.unref(i),"virtual-ref":C.virtualRef,open:l.unref(o),"virtual-triggering":C.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(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var xT=gt(wT,[["__file","trigger.vue"]]);const vT=tt({to:{type:fe([String,Object]),required:!0},disabled:Boolean});var CT=gt(l.defineComponent({__name:"teleport",props:vT,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 ST=Ws(CT),ET=l.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),OT=l.defineComponent({...ET,props:Xg,setup(n,{expose:e}){const t=n,{selector:s}=bg(),r=wt("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(du,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)),C=l.computed(()=>t.disabled?!1:l.unref(u)),E=l.computed(()=>t.appendTo||s.value),v=l.computed(()=>{var M;return(M=t.style)!=null?M:{}}),S=l.ref(!0),O=()=>{g(),S.value=!0},_=()=>{if(l.unref(a))return!0},T=Gn(_,()=>{t.enterable&&l.unref(d)==="hover"&&f()}),A=Gn(_,()=>{l.unref(d)==="hover"&&h()}),V=()=>{var M,k;(k=(M=i.value)==null?void 0:M.updatePopper)==null||k.call(M),m==null||m()},L=()=>{y==null||y()},B=()=>{p(),o=Tv(l.computed(()=>{var M;return(M=i.value)==null?void 0:M.popperContentRef}),()=>{if(l.unref(a))return;l.unref(d)!=="hover"&&h()})},P=()=>{t.virtualTriggering||h()};return l.watch(()=>l.unref(u),M=>{M?S.value=!1:o==null||o()},{flush:"post"}),l.watch(()=>t.content,()=>{var M,k;(k=(M=i.value)==null?void 0:M.updatePopper)==null||k.call(M)}),e({contentRef:i}),(M,k)=>(l.openBlock(),l.createBlock(l.unref(ST),{disabled:!M.teleported,to:l.unref(E)},{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(b),onAfterLeave:O,onBeforeEnter:V,onAfterEnter:B,onBeforeLeave:L},{default:l.withCtx(()=>[l.unref(x)?l.withDirectives((l.openBlock(),l.createBlock(l.unref(uT),l.mergeProps({key:0,id:l.unref(c),ref_key:"contentRef",ref:i},M.$attrs,{"aria-label":M.ariaLabel,"aria-hidden":S.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(v)],"reference-el":M.referenceEl,"trigger-target-el":M.triggerTargetEl,visible:l.unref(C),"z-index":M.zIndex,onMouseenter:l.unref(T),onMouseleave:l.unref(A),onBlur:P,onClose:l.unref(h)}),{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(C)]]):l.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var MT=gt(OT,[["__file","content.vue"]]);const NT=l.defineComponent({name:"ElTooltip"}),PT=l.defineComponent({...NT,props:gT,emits:mT,setup(n,{expose:e,emit:t}){const s=n;tA();const r=Ta(),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}=pT({indicator:c,toggleReason:u}),{onOpen:p,onClose:g}=sA({showAfter:l.toRef(s,"showAfter"),hideAfter:l.toRef(s,"hideAfter"),autoClose:l.toRef(s,"autoClose"),open:d,close:h}),m=l.computed(()=>wa(s.visible)&&!f.value);l.provide(du,{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 C=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,E=(b==null?void 0:b.relatedTarget)||document.activeElement;return C&&C.contains(E)};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(dT),{ref_key:"popperRef",ref:i,role:b.role},{default:l.withCtx(()=>[l.createVNode(xT,{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(MT,{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(DA),{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 _T=gt(PT,[["__file","tooltip.vue"]]);const Kg=Ws(_T),AT=tt({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:fe([String,Object,Array])},offset:{type:fe(Array),default:[0,0]},badgeClass:{type:String}}),TT=l.defineComponent({name:"ElBadge"}),kT=l.defineComponent({...TT,props:AT,setup(n,{expose:e}){const t=n,s=wt("badge"),r=l.computed(()=>t.isDot?"":Gt(t.value)&&Gt(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:Fi(-((a=(o=t.offset)==null?void 0:o[0])!=null?a:0)),marginTop:Fi((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 VT=gt(kT,[["__file","badge.vue"]]);const DT=Ws(VT),Zg=Symbol("buttonGroupContextKey"),RT=(n,e)=>{_P({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(Zg,void 0),s=nu("button"),{form:r}=Tg(),i=Ag(l.computed(()=>t==null?void 0:t.size)),o=ru(),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)}}},hu=tt({size:eu,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ui},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ui,default:()=>va},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:fe([String,Object]),default:"button"}}),IT={click:n=>n instanceof MouseEvent};function ut(n,e){LT(n)&&(n="100%");var t=BT(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 Ba(n){return Math.min(1,Math.max(0,n))}function LT(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function BT(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Qg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function ja(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Ks(n){return n.length===1?"0"+n:String(n)}function jT(n,e,t){return{r:ut(n,255)*255,g:ut(e,255)*255,b:ut(t,255)*255}}function em(n,e,t){n=ut(n,255),e=ut(e,255),t=ut(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 fu(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 $T(n,e,t){var s,r,i;if(n=ut(n,360),e=ut(e,100),t=ut(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=fu(a,o,n+1/3),r=fu(a,o,n),i=fu(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function tm(n,e,t){n=ut(n,255),e=ut(e,255),t=ut(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 zT(n,e,t){n=ut(n,360)*6,e=ut(e,100),t=ut(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 nm(n,e,t,s){var r=[Ks(Math.round(n).toString(16)),Ks(Math.round(e).toString(16)),Ks(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 FT(n,e,t,s,r){var i=[Ks(Math.round(n).toString(16)),Ks(Math.round(e).toString(16)),Ks(Math.round(t).toString(16)),Ks(UT(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 UT(n){return Math.round(parseFloat(n)*255).toString(16)}function sm(n){return It(n)/255}function It(n){return parseInt(n,16)}function HT(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var pu={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 GT(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=qT(n)),typeof n=="object"&&(Jn(n.r)&&Jn(n.g)&&Jn(n.b)?(e=jT(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Jn(n.h)&&Jn(n.s)&&Jn(n.v)?(s=ja(n.s),r=ja(n.v),e=zT(n.h,s,r),o=!0,a="hsv"):Jn(n.h)&&Jn(n.s)&&Jn(n.l)&&(s=ja(n.s),i=ja(n.l),e=$T(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Qg(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 WT="[-\\+]?\\d+%?",YT="[-\\+]?\\d*\\.\\d+%?",gs="(?:".concat(YT,")|(?:").concat(WT,")"),gu="[\\s|\\(]+(".concat(gs,")[,|\\s]+(").concat(gs,")[,|\\s]+(").concat(gs,")\\s*\\)?"),mu="[\\s|\\(]+(".concat(gs,")[,|\\s]+(").concat(gs,")[,|\\s]+(").concat(gs,")[,|\\s]+(").concat(gs,")\\s*\\)?"),fn={CSS_UNIT:new RegExp(gs),rgb:new RegExp("rgb"+gu),rgba:new RegExp("rgba"+mu),hsl:new RegExp("hsl"+gu),hsla:new RegExp("hsla"+mu),hsv:new RegExp("hsv"+gu),hsva:new RegExp("hsva"+mu),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 qT(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(pu[n])n=pu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=fn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=fn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=fn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=fn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=fn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=fn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=fn.hex8.exec(n),t?{r:It(t[1]),g:It(t[2]),b:It(t[3]),a:sm(t[4]),format:e?"name":"hex8"}:(t=fn.hex6.exec(n),t?{r:It(t[1]),g:It(t[2]),b:It(t[3]),format:e?"name":"hex"}:(t=fn.hex4.exec(n),t?{r:It(t[1]+t[1]),g:It(t[2]+t[2]),b:It(t[3]+t[3]),a:sm(t[4]+t[4]),format:e?"name":"hex8"}:(t=fn.hex3.exec(n),t?{r:It(t[1]+t[1]),g:It(t[2]+t[2]),b:It(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Jn(n){return!!fn.CSS_UNIT.exec(String(n))}var XT=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=HT(e)),this.originalInput=e;var r=GT(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=Qg(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=tm(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=tm(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=em(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=em(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),nm(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),FT(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(ut(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(ut(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="#"+nm(this.r,this.g,this.b,!1),t=0,s=Object.entries(pu);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=Ba(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=Ba(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=Ba(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=Ba(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 ms(n,e=20){return n.mix("#141414",e).toString()}function JT(n){const e=ru(),t=wt("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 XT(r),a=n.dark?o.tint(20).toString():ms(o,20);if(n.plain)s=t.cssVarBlock({"bg-color":n.dark?ms(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ms(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?ms(o,90):o.tint(90).toString(),s[t.cssVarBlockName("disabled-text-color")]=n.dark?ms(o,50):o.tint(50).toString(),s[t.cssVarBlockName("disabled-border-color")]=n.dark?ms(o,80):o.tint(80).toString());else{const c=n.dark?ms(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?ms(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 KT=l.defineComponent({name:"ElButton"}),ZT=l.defineComponent({...KT,props:hu,emits:IT,setup(n,{expose:e,emit:t}){const s=n,r=JT(s),i=wt("button"),{_ref:o,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:h,handleClick:f}=RT(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(An),{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(An),{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 QT=gt(ZT,[["__file","button.vue"]]);const ek={size:hu.size,type:hu.type},tk=l.defineComponent({name:"ElButtonGroup"}),nk=l.defineComponent({...tk,props:ek,setup(n){const e=n;l.provide(Zg,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=wt("button");return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(s.$slots,"default")],2))}});var rm=gt(nk,[["__file","button-group.vue"]]);const sk=Ws(QT,{ButtonGroup:rm});SP(rm);function rk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const yu="_trap-focus-children",Zs=[],im=n=>{var e;if(Zs.length===0)return;const t=Zs[Zs.length-1][yu];if(t.length>0&&n.code===Dr.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())}}},ik={beforeMount(n){n[yu]=_h(n),Zs.push(n),Zs.length<=1&&document.addEventListener("keydown",im)},updated(n){l.nextTick(()=>{n[yu]=_h(n)})},unmounted(){Zs.shift(),Zs.length===0&&document.removeEventListener("keydown",im)}},ok=tt({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:fe([String,Array,Object])},zIndex:{type:fe([String,Number])}}),ak={click:n=>n instanceof MouseEvent},lk="overlay";var ck=l.defineComponent({name:"ElOverlay",props:ok,emits:ak,setup(n,{slots:e,emit:t}){const s=wt(lk),r=c=>{t("click",c)},{onClick:i,onMousedown:o,onMouseup:a}=pg(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")],Ea.STYLE|Ea.CLASS|Ea.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 uk=ck,om=["success","info","warning","error"],mt=Gp({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:qe?document.body:void 0}),dk=tt({customClass:{type:String,default:mt.customClass},center:{type:Boolean,default:mt.center},dangerouslyUseHTMLString:{type:Boolean,default:mt.dangerouslyUseHTMLString},duration:{type:Number,default:mt.duration},icon:{type:Ui,default:mt.icon},id:{type:String,default:mt.id},message:{type:fe([String,Object,Function]),default:mt.message},onClose:{type:fe(Function),default:mt.onClose},showClose:{type:Boolean,default:mt.showClose},type:{type:String,values:om,default:mt.type},plain:{type:Boolean,default:mt.plain},offset:{type:Number,default:mt.offset},zIndex:{type:Number,default:mt.zIndex},grouping:{type:Boolean,default:mt.grouping},repeatNum:{type:Number,default:mt.repeatNum}}),hk={destroy:()=>!0},pn=l.shallowReactive([]),fk=n=>{const e=pn.findIndex(r=>r.id===n),t=pn[e];let s;return e>0&&(s=pn[e-1]),{current:t,prev:s}},pk=n=>{const{prev:e}=fk(n);return e?e.vm.exposed.bottom.value:0},gk=(n,e)=>pn.findIndex(s=>s.id===n)>0?16:e,mk=l.defineComponent({name:"ElMessage"}),yk=l.defineComponent({...mk,props:dk,emits:hk,setup(n,{expose:e}){const t=n,{Close:s}=Up,{ns:r,zIndex:i}=Pg("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 S=t.type;return{[r.bm("icon",S)]:S&&Sa[S]}}),g=l.computed(()=>t.icon||Sa[t.type]||""),m=l.computed(()=>pk(t.id)),y=l.computed(()=>gk(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}=Av(()=>{E()},t.duration))}function C(){h==null||h()}function E(){u.value=!1}function v({code:S}){S===Dr.esc&&E()}return l.onMounted(()=>{x(),a(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{C(),x()}),Wn(document,"keydown",v),Ih(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:b,close:E}),(S,O)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:S.onClose,onAfterLeave:_=>S.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:S.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(S.type)]:S.type},l.unref(r).is("center",S.center),l.unref(r).is("closable",S.showClose),l.unref(r).is("plain",S.plain),S.customClass]),style:l.normalizeStyle(l.unref(w)),role:"alert",onMouseenter:C,onMouseleave:x},[S.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(DT),{key:0,value:S.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(An),{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(S.$slots,"default",{},()=>[S.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:S.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(S.message),3))]),S.showClose?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(E,["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 bk=gt(yk,[["__file","message.vue"]]);let wk=1;const am=n=>{const e=!n||rn(n)||l.isVNode(n)||Ft(n)?{message:n}:n,t={...mt,...e};if(!t.appendTo)t.appendTo=document.body;else if(rn(t.appendTo)){let s=document.querySelector(t.appendTo);Xn(s)||(Vt("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),t.appendTo=s}return wa(dn.grouping)&&!t.grouping&&(t.grouping=dn.grouping),Gt(dn.duration)&&t.duration===3e3&&(t.duration=dn.duration),Gt(dn.offset)&&t.offset===16&&(t.offset=dn.offset),wa(dn.showClose)&&!t.showClose&&(t.showClose=dn.showClose),t},xk=n=>{const e=pn.indexOf(n);if(e===-1)return;pn.splice(e,1);const{handler:t}=n;t.close()},vk=({appendTo:n,...e},t)=>{const s=`message_${wk++}`,r=e.onClose,i=document.createElement("div"),o={...e,id:s,onClose:()=>{r==null||r(),xk(d)},onDestroy:()=>{l.render(null,i)}},a=l.createVNode(bk,o,Ft(o.message)||l.isVNode(o.message)?{default:Ft(o.message)?o.message:()=>o.message}:null);a.appContext=t||zr._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},zr=(n={},e)=>{if(!qe)return{close:()=>{}};const t=am(n);if(t.grouping&&pn.length){const r=pn.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(Gt(dn.max)&&pn.length>=dn.max)return{close:()=>{}};const s=vk(t,e);return pn.push(s),s.handler};om.forEach(n=>{zr[n]=(e={},t)=>{const s=am(e);return zr({...s,type:n},t)}});function Ck(n){for(const e of pn)(!n||n===e.props.type)&&e.handler.close()}zr.closeAll=Ck,zr._context=null;const Je=CP(zr,"$message"),Sk=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:ik},components:{ElButton:sk,ElFocusTrap:Yg,ElInput:PA,ElOverlay:uk,ElIcon:An,...Up},inheritAttrs:!1,props:{buttonSize:{type:String,validator:EP},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}=Pg("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(va),cancelButtonLoadingIcon:l.markRaw(va),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=l.computed(()=>{const M=u.type;return{[r.bm("icon",M)]:M&&Sa[M]}}),h=Ta(),f=Ta(),p=l.computed(()=>u.icon||Sa[u.type]||""),g=l.computed(()=>!!u.message),m=l.ref(),y=l.ref(),b=l.ref(),w=l.ref(),x=l.ref(),C=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 k,j;M&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(j=(k=x.value)==null?void 0:k.$el)!=null?j:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(M?l.nextTick().then(()=>{var W;w.value&&w.value.$el&&(u.autofocus?b.value=(W=L())!=null?W:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const E=l.computed(()=>n.draggable),v=l.computed(()=>n.overflow);AP(m,y,E,v),l.onMounted(async()=>{await l.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",S)}),l.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const O=()=>{n.closeOnClickModal&&A(u.distinguishCancelAndClose?"close":"cancel")},_=pg(O),T=M=>{if(u.inputType!=="textarea")return M.preventDefault(),A("confirm")},A=M=>{var k;n.boxType==="prompt"&&M==="confirm"&&!V()||(u.action=M,u.beforeClose?(k=u.beforeClose)==null||k.call(u,M,u,S):S())},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 k=u.inputValidator;if(typeof k=="function"){const j=k(u.inputValue);if(j===!1)return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;if(typeof j=="string")return u.editorErrorMessage=j,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},L=()=>{const M=w.value.$refs;return M.input||M.textarea},B=()=>{A("close")},P=()=>{n.closeOnPressEscape&&B()};return n.lockScroll&&LP(c),{...l.toRefs(u),ns:r,overlayEvent:_,visible:c,hasMessage:g,typeClass:d,contentId:h,inputId:f,btnSize:i,iconComponent:p,confirmButtonClasses:C,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:S,handleClose:B,onCloseRequested:P,handleWrapperClick:O,handleInputEnter:T,handleAction:A,t:o}}});function Ek(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 Ok=gt(Sk,[["render",Ek],["__file","index.vue"]]);const Ki=new Map,Mk=n=>{let e=document.body;return n.appendTo&&(rn(n.appendTo)&&(e=document.querySelector(n.appendTo)),Xn(n.appendTo)&&(e=n.appendTo),Xn(e)||(Vt("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},Nk=(n,e,t=null)=>{const s=l.createVNode(Ok,n,Ft(n.message)||l.isVNode(n.message)?{default:Ft(n.message)?n.message:()=>n.message}:null);return s.appContext=t,l.render(s,e),Mk(n).appendChild(e.firstElementChild),s.component},Pk=()=>document.createElement("div"),_k=(n,e)=>{const t=Pk();n.onVanish=()=>{l.render(null,t),Ki.delete(r)},n.onAction=i=>{const o=Ki.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=Nk(n,t,e),r=s.proxy;for(const i in n)Xo(n,i)&&!Xo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function Fr(n,e=null){if(!qe)return Promise.reject();let t;return rn(n)||l.isVNode(n)?n={message:n}:t=n.callback,new Promise((s,r)=>{const i=_k(n,e??Fr._context);Ki.set(i,{options:n,callback:t,resolve:s,reject:r})})}const Ak=["alert","confirm","prompt"],Tk={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Ak.forEach(n=>{Fr[n]=kk(n)});function kk(n){return(e,t,s,r)=>{let i="";return Sr(t)?(s=t,i=""):kp(t)?i="":i=t,Fr(Object.assign({title:i,message:e,type:"",...Tk[n]},s,{boxType:n}),r)}}Fr.close=()=>{Ki.forEach((n,e)=>{e.doClose()}),Ki.clear()},Fr._context=null;const ys=Fr;ys.install=n=>{ys._context=n._context,n.config.globalProperties.$msgbox=ys,n.config.globalProperties.$messageBox=ys,n.config.globalProperties.$alert=ys.alert,n.config.globalProperties.$confirm=ys.confirm,n.config.globalProperties.$prompt=ys.prompt};const Vk=ys;function lm(n,e){return function(){return n.apply(e,arguments)}}const{toString:Dk}=Object.prototype,{getPrototypeOf:bu}=Object,$a=(n=>e=>{const t=Dk.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),gn=n=>(n=n.toLowerCase(),e=>$a(e)===n),za=n=>e=>typeof e===n,{isArray:Ur}=Array,Zi=za("undefined");function Rk(n){return n!==null&&!Zi(n)&&n.constructor!==null&&!Zi(n.constructor)&&Lt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const cm=gn("ArrayBuffer");function Ik(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&cm(n.buffer),e}const Lk=za("string"),Lt=za("function"),um=za("number"),Fa=n=>n!==null&&typeof n=="object",Bk=n=>n===!0||n===!1,Ua=n=>{if($a(n)!=="object")return!1;const e=bu(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},jk=gn("Date"),$k=gn("File"),zk=gn("Blob"),Fk=gn("FileList"),Uk=n=>Fa(n)&&Lt(n.pipe),Hk=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Lt(n.append)&&((e=$a(n))==="formdata"||e==="object"&&Lt(n.toString)&&n.toString()==="[object FormData]"))},Gk=gn("URLSearchParams"),[Wk,Yk,qk,Xk]=["ReadableStream","Request","Response","Headers"].map(gn),Jk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qi(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),Ur(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 dm(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 Qs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hm=n=>!Zi(n)&&n!==Qs;function wu(){const{caseless:n}=hm(this)&&this||{},e={},t=(s,r)=>{const i=n&&dm(e,r)||r;Ua(e[i])&&Ua(s)?e[i]=wu(e[i],s):Ua(s)?e[i]=wu({},s):Ur(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Qi(arguments[s],t);return e}const Kk=(n,e,t,{allOwnKeys:s}={})=>(Qi(e,(r,i)=>{t&&Lt(r)?n[i]=lm(r,t):n[i]=r},{allOwnKeys:s}),n),Zk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Qk=(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)},eV=(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&&bu(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},tV=(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},nV=n=>{if(!n)return null;if(Ur(n))return n;let e=n.length;if(!um(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},sV=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&bu(Uint8Array)),rV=(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])}},iV=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},oV=gn("HTMLFormElement"),aV=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),fm=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),lV=gn("RegExp"),pm=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};Qi(t,(r,i)=>{let o;(o=e(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},cV=n=>{pm(n,(e,t)=>{if(Lt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(Lt(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+"'")})}})},uV=(n,e)=>{const t={},s=r=>{r.forEach(i=>{t[i]=!0})};return Ur(n)?s(n):s(String(n).split(e)),t},dV=()=>{},hV=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,xu="abcdefghijklmnopqrstuvwxyz",gm="0123456789",mm={DIGIT:gm,ALPHA:xu,ALPHA_DIGIT:xu+xu.toUpperCase()+gm},fV=(n=16,e=mm.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;n--;)t+=e[Math.random()*s|0];return t};function pV(n){return!!(n&&Lt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const gV=n=>{const e=new Array(10),t=(s,r)=>{if(Fa(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=Ur(s)?[]:{};return Qi(s,(o,a)=>{const c=t(o,r+1);!Zi(c)&&(i[a]=c)}),e[r]=void 0,i}}return s};return t(n,0)},mV=gn("AsyncFunction"),yV=n=>n&&(Fa(n)||Lt(n))&&Lt(n.then)&&Lt(n.catch),ym=((n,e)=>n?setImmediate:e?((t,s)=>(Qs.addEventListener("message",({source:r,data:i})=>{r===Qs&&i===t&&s.length&&s.shift()()},!1),r=>{s.push(r),Qs.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Lt(Qs.postMessage)),bV=typeof queueMicrotask<"u"?queueMicrotask.bind(Qs):typeof process<"u"&&process.nextTick||ym,I={isArray:Ur,isArrayBuffer:cm,isBuffer:Rk,isFormData:Hk,isArrayBufferView:Ik,isString:Lk,isNumber:um,isBoolean:Bk,isObject:Fa,isPlainObject:Ua,isReadableStream:Wk,isRequest:Yk,isResponse:qk,isHeaders:Xk,isUndefined:Zi,isDate:jk,isFile:$k,isBlob:zk,isRegExp:lV,isFunction:Lt,isStream:Uk,isURLSearchParams:Gk,isTypedArray:sV,isFileList:Fk,forEach:Qi,merge:wu,extend:Kk,trim:Jk,stripBOM:Zk,inherits:Qk,toFlatObject:eV,kindOf:$a,kindOfTest:gn,endsWith:tV,toArray:nV,forEachEntry:rV,matchAll:iV,isHTMLForm:oV,hasOwnProperty:fm,hasOwnProp:fm,reduceDescriptors:pm,freezeMethods:cV,toObjectSet:uV,toCamelCase:aV,noop:dV,toFiniteNumber:hV,findKey:dm,global:Qs,isContextDefined:hm,ALPHABET:mm,generateString:fV,isSpecCompliantForm:pV,toJSONObject:gV,isAsyncFn:mV,isThenable:yV,setImmediate:ym,asap:bV};function de(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)}I.inherits(de,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:I.toJSONObject(this.config),code:this.code,status:this.status}}});const bm=de.prototype,wm={};["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=>{wm[n]={value:n}}),Object.defineProperties(de,wm),Object.defineProperty(bm,"isAxiosError",{value:!0}),de.from=(n,e,t,s,r,i)=>{const o=Object.create(bm);return I.toFlatObject(n,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),de.call(o,n.message,e,t,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const wV=null;function vu(n){return I.isPlainObject(n)||I.isArray(n)}function xm(n){return I.endsWith(n,"[]")?n.slice(0,-2):n}function vm(n,e,t){return n?n.concat(e).map(function(r,i){return r=xm(r),!t&&i?"["+r+"]":r}).join(t?".":""):e}function xV(n){return I.isArray(n)&&!n.some(vu)}const vV=I.toFlatObject(I,{},null,function(e){return/^is[A-Z]/.test(e)});function Ha(n,e,t){if(!I.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=I.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!I.isUndefined(y[m])});const s=t.metaTokens,r=t.visitor||d,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(e);if(!I.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(I.isDate(g))return g.toISOString();if(!c&&I.isBlob(g))throw new de("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(g)||I.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(I.endsWith(m,"{}"))m=s?m:m.slice(0,-2),g=JSON.stringify(g);else if(I.isArray(g)&&xV(g)||(I.isFileList(g)||I.endsWith(m,"[]"))&&(b=I.toArray(g)))return m=xm(m),b.forEach(function(x,C){!(I.isUndefined(x)||x===null)&&e.append(o===!0?vm([m],C,i):o===null?m:m+"[]",u(x))}),!1}return vu(g)?!0:(e.append(vm(y,m,i),u(g)),!1)}const h=[],f=Object.assign(vV,{defaultVisitor:d,convertValue:u,isVisitable:vu});function p(g,m){if(!I.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(g),I.forEach(g,function(b,w){(!(I.isUndefined(b)||b===null)&&r.call(e,b,I.isString(w)?w.trim():w,m,f))===!0&&p(b,m?m.concat(w):[w])}),h.pop()}}if(!I.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 Cu(n,e){this._pairs=[],n&&Ha(n,this,e)}const Sm=Cu.prototype;Sm.append=function(e,t){this._pairs.push([e,t])},Sm.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 CV(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Em(n,e,t){if(!e)return n;const s=t&&t.encode||CV,r=t&&t.serialize;let i;if(r?i=r(e,t):i=I.isURLSearchParams(e)?e.toString():new Cu(e,t).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Om{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){I.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Mm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},SV={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Cu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Su=typeof window<"u"&&typeof document<"u",Eu=typeof navigator=="object"&&navigator||void 0,EV=Su&&(!Eu||["ReactNative","NativeScript","NS"].indexOf(Eu.product)<0),OV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MV=Su&&window.location.href||"http://localhost",Nt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Su,hasStandardBrowserEnv:EV,hasStandardBrowserWebWorkerEnv:OV,navigator:Eu,origin:MV},Symbol.toStringTag,{value:"Module"})),...SV};function NV(n,e){return Ha(n,new Nt.classes.URLSearchParams,Object.assign({visitor:function(t,s,r,i){return Nt.isNode&&I.isBuffer(t)?(this.append(s,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function PV(n){return I.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function _V(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 Nm(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&&I.isArray(r)?r.length:o,c?(I.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!I.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],i)&&I.isArray(r[o])&&(r[o]=_V(r[o])),!a)}if(I.isFormData(n)&&I.isFunction(n.entries)){const t={};return I.forEachEntry(n,(s,r)=>{e(PV(s),r,t,0)}),t}return null}function AV(n,e,t){if(I.isString(n))try{return(e||JSON.parse)(n),I.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const eo={transitional:Mm,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,i=I.isObject(e);if(i&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return r?JSON.stringify(Nm(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e)||I.isReadableStream(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.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 NV(e,this.formSerializer).toString();if((a=I.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ha(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),AV(e)):e}],transformResponse:[function(e){const t=this.transitional||eo.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(I.isResponse(e)||I.isReadableStream(e))return e;if(e&&I.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"?de.from(a,de.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:Nt.classes.FormData,Blob:Nt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],n=>{eo.headers[n]={}});const TV=I.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"]),kV=n=>{const e={};let t,s,r;return n&&n.split(`
34
- `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&TV[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Pm=Symbol("internals");function to(n){return n&&String(n).trim().toLowerCase()}function Ga(n){return n===!1||n==null?n:I.isArray(n)?n.map(Ga):String(n)}function VV(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 DV=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Ou(n,e,t,s,r){if(I.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!I.isString(e)){if(I.isString(s))return e.indexOf(s)!==-1;if(I.isRegExp(s))return s.test(e)}}function RV(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function IV(n,e){const t=I.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 Pt{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function i(a,c,u){const d=to(c);if(!d)throw new Error("header name must be a non-empty string");const h=I.findKey(r,d);(!h||r[h]===void 0||u===!0||u===void 0&&r[h]!==!1)&&(r[h||c]=Ga(a))}const o=(a,c)=>I.forEach(a,(u,d)=>i(u,d,c));if(I.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(I.isString(e)&&(e=e.trim())&&!DV(e))o(kV(e),t);else if(I.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=to(e),e){const s=I.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return VV(r);if(I.isFunction(t))return t.call(this,r,s);if(I.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=to(e),e){const s=I.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||Ou(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function i(o){if(o=to(o),o){const a=I.findKey(s,o);a&&(!t||Ou(s,s[a],a,t))&&(delete s[a],r=!0)}}return I.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||Ou(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,s={};return I.forEach(this,(r,i)=>{const o=I.findKey(s,i);if(o){t[o]=Ga(r),delete t[i];return}const a=e?RV(i):String(i).trim();a!==i&&delete t[i],t[a]=Ga(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return I.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&I.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(`
35
- `)}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[Pm]=this[Pm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=to(o);s[a]||(IV(r,o),s[a]=!0)}return I.isArray(e)?e.forEach(i):i(e),this}}Pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(Pt.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}}),I.freezeMethods(Pt);function Mu(n,e){const t=this||eo,s=e||t,r=Pt.from(s.headers);let i=s.data;return I.forEach(n,function(a){i=a.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function _m(n){return!!(n&&n.__CANCEL__)}function Hr(n,e,t){de.call(this,n??"canceled",de.ERR_CANCELED,e,t),this.name="CanceledError"}I.inherits(Hr,de,{__CANCEL__:!0});function Am(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new de("Request failed with status code "+t.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function LV(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function BV(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 jV(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 Wa=(n,e,t=3)=>{let s=0;const r=BV(50,250);return jV(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)},Tm=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},km=n=>(...e)=>I.asap(()=>n(...e)),$V=Nt.hasStandardBrowserEnv?function(){const e=Nt.navigator&&/(msie|trident)/i.test(Nt.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=I.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),zV=Nt.hasStandardBrowserEnv?{write(n,e,t,s,r,i){const o=[n+"="+encodeURIComponent(e)];I.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),I.isString(s)&&o.push("path="+s),I.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 FV(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function UV(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Vm(n,e){return n&&!FV(e)?UV(n,e):e}const Dm=n=>n instanceof Pt?{...n}:n;function er(n,e){e=e||{};const t={};function s(u,d,h){return I.isPlainObject(u)&&I.isPlainObject(d)?I.merge.call({caseless:h},u,d):I.isPlainObject(d)?I.merge({},d):I.isArray(d)?d.slice():d}function r(u,d,h){if(I.isUndefined(d)){if(!I.isUndefined(u))return s(void 0,u,h)}else return s(u,d,h)}function i(u,d){if(!I.isUndefined(d))return s(void 0,d)}function o(u,d){if(I.isUndefined(d)){if(!I.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(Dm(u),Dm(d),!0)};return I.forEach(Object.keys(Object.assign({},n,e)),function(d){const h=c[d]||r,f=h(n[d],e[d],d);I.isUndefined(f)&&h!==a||(t[d]=f)}),t}const Rm=n=>{const e=er({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Pt.from(o),e.url=Em(Vm(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(I.isFormData(t)){if(Nt.hasStandardBrowserEnv||Nt.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(Nt.hasStandardBrowserEnv&&(s&&I.isFunction(s)&&(s=s(e)),s||s!==!1&&$V(e.url))){const u=r&&i&&zV.read(i);u&&o.set(r,u)}return e},HV=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,s){const r=Rm(n);let i=r.data;const o=Pt.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=Pt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};Am(function(S){t(S),m()},function(S){s(S),m()},E),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 de("Request aborted",de.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new de("Network Error",de.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let C=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const E=r.transitional||Mm;r.timeoutErrorMessage&&(C=r.timeoutErrorMessage),s(new de(C,E.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&I.forEach(o.toJSON(),function(C,E){y.setRequestHeader(E,C)}),I.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([f,g]=Wa(u,!0),y.addEventListener("progress",f)),c&&y.upload&&([h,p]=Wa(c),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new Hr(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=LV(r.url);if(w&&Nt.protocols.indexOf(w)===-1){s(new de("Unsupported protocol "+w+":",de.ERR_BAD_REQUEST,n));return}y.send(i||null)})},GV=(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 de?d:new Hr(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new de(`timeout ${e} of ms exceeded`,de.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=()=>I.asap(a),c}},WV=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},YV=async function*(n,e){for await(const t of qV(n))yield*WV(t,e)},qV=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()}},Im=(n,e,t,s)=>{const r=YV(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})},Ya=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Lm=Ya&&typeof ReadableStream=="function",XV=Ya&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Bm=(n,...e)=>{try{return!!n(...e)}catch{return!1}},JV=Lm&&Bm(()=>{let n=!1;const e=new Request(Nt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),jm=64*1024,Nu=Lm&&Bm(()=>I.isReadableStream(new Response("").body)),qa={stream:Nu&&(n=>n.body)};Ya&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!qa[e]&&(qa[e]=I.isFunction(n[e])?t=>t[e]():(t,s)=>{throw new de(`Response type '${e}' is not supported`,de.ERR_NOT_SUPPORT,s)})})})(new Response);const KV=async n=>{if(n==null)return 0;if(I.isBlob(n))return n.size;if(I.isSpecCompliantForm(n))return(await new Request(Nt.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(I.isArrayBufferView(n)||I.isArrayBuffer(n))return n.byteLength;if(I.isURLSearchParams(n)&&(n=n+""),I.isString(n))return(await XV(n)).byteLength},ZV=async(n,e)=>{const t=I.toFiniteNumber(n.getContentLength());return t??KV(e)},Pu={http:wV,xhr:HV,fetch:Ya&&(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}=Rm(n);u=u?(u+"").toLowerCase():"text";let p=GV([r,i&&i.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&JV&&t!=="get"&&t!=="head"&&(y=await ZV(d,s))!==0){let E=new Request(e,{method:"POST",body:s,duplex:"half"}),v;if(I.isFormData(s)&&(v=E.headers.get("content-type"))&&d.setContentType(v),E.body){const[S,O]=Tm(y,Wa(km(c)));s=Im(E.body,jm,S,O)}}I.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=Nu&&(u==="stream"||u==="response");if(Nu&&(a||x&&m)){const E={};["status","statusText","headers"].forEach(_=>{E[_]=w[_]});const v=I.toFiniteNumber(w.headers.get("content-length")),[S,O]=a&&Tm(v,Wa(km(a),!0))||[];w=new Response(Im(w.body,jm,S,()=>{O&&O(),m&&m()}),E)}u=u||"text";let C=await qa[I.findKey(qa,u)||"text"](w,n);return!x&&m&&m(),await new Promise((E,v)=>{Am(E,v,{data:C,headers:Pt.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 de("Network Error",de.ERR_NETWORK,n,g),{cause:b.cause||b}):de.from(b,b&&b.code,n,g)}})};I.forEach(Pu,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const $m=n=>`- ${n}`,QV=n=>I.isFunction(n)||n===null||n===!1,zm={getAdapter:n=>{n=I.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,!QV(t)&&(s=Pu[(o=String(t)).toLowerCase()],s===void 0))throw new de(`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 :
33
+ `,vA=["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 CA(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:vA.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:t}}function kg(n,e=1,t){var s;hn||(hn=document.createElement("textarea"),document.body.appendChild(hn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=CA(n);hn.setAttribute("style",`${a};${xA}`),hn.value=n.value||n.placeholder||"";let c=hn.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-r),hn.value="";const d=hn.scrollHeight-r;if(Ht(e)){let h=d*e;o==="border-box"&&(h=h+r+i),c=Math.max(h,c),u.minHeight=`${h}px`}if(Ht(t)){let h=d*t;o==="border-box"&&(h=h+r+i),c=Math.min(h,c)}return u.height=`${c}px`,(s=hn.parentNode)==null||s.removeChild(hn),hn=void 0,u}const SA=et({id:{type:String,default:void 0},size:Zc,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:Ui},prefixIcon:{type:Ui},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:he([Object,Array,String]),default:()=>Gp({})},autofocus:Boolean,rows:{type:Number,default:2},...Qc(["ariaLabel"])}),EA={[jc]:n=>rn(n),input:n=>rn(n),change:n=>rn(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},OA=l.defineComponent({name:"ElInput",inheritAttrs:!1}),MA=l.defineComponent({...OA,props:SA,emits:EA,setup(n,{expose:e,emit:t}){const s=n,r=l.useAttrs(),i=l.useSlots(),o=l.computed(()=>{const Y={};return s.containerRole==="combobox"&&(Y["aria-haspopup"]=r["aria-haspopup"],Y["aria-owns"]=r["aria-owns"],Y["aria-expanded"]=r["aria-expanded"]),Y}),a=l.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(p.value),m.is("disabled",g.value),m.is("exceed",X.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")]:V.value&&U.value,[m.b("hidden")]:s.type==="hidden"},r.class]),c=l.computed(()=>[m.e("wrapper"),m.is("focus",_.value)]),u=PP({excludeKeys:l.computed(()=>Object.keys(o.value))}),{form:d,formItem:h}=Tg(),{inputId:f}=wA(s,{formItemContext:h}),p=Ag(),g=nu(),m=yt("input"),y=yt("textarea"),b=l.shallowRef(),w=l.shallowRef(),x=l.ref(!1),C=l.ref(!1),E=l.ref(),v=l.shallowRef(s.inputStyle),S=l.computed(()=>b.value||w.value),{wrapperRef:O,isFocused:_,handleFocus:T,handleBlur:A}=lA(S,{beforeFocus(){return g.value},afterBlur(){var Y;s.validateEvent&&((Y=h==null?void 0:h.validate)==null||Y.call(h,"blur").catch(Me=>kt(Me)))}}),D=l.computed(()=>{var Y;return(Y=d==null?void 0:d.statusIcon)!=null?Y:!1}),L=l.computed(()=>(h==null?void 0:h.validateState)||""),j=l.computed(()=>L.value&&vP[L.value]),P=l.computed(()=>C.value?bP:fP),M=l.computed(()=>[r.style]),k=l.computed(()=>[s.inputStyle,v.value,{resize:s.resize}]),$=l.computed(()=>ba(s.modelValue)?"":String(s.modelValue)),V=l.computed(()=>s.clearable&&!g.value&&!s.readonly&&!!$.value&&(_.value||x.value)),U=l.computed(()=>s.showPassword&&!g.value&&!!$.value&&(!!$.value||_.value)),F=l.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!g.value&&!s.readonly&&!s.showPassword),q=l.computed(()=>$.value.length),X=l.computed(()=>!!F.value&&q.value>Number(s.maxlength)),Q=l.computed(()=>!!i.suffix||!!s.suffixIcon||V.value||s.showPassword||F.value||!!L.value&&D.value),[se,H]=oA(b);Ih(w,Y=>{if(B(),!F.value||s.resize!=="both")return;const Me=Y[0],{width:os}=Me.contentRect;E.value={right:`calc(100% - ${os+15+6}px)`}});const I=()=>{const{type:Y,autosize:Me}=s;if(!(!Ye||Y!=="textarea"||!w.value))if(Me){const os=Sr(Me)?Me.minRows:void 0,Mo=Sr(Me)?Me.maxRows:void 0,x0=kg(w.value,os,Mo);v.value={overflowY:"hidden",...x0},l.nextTick(()=>{w.value.offsetHeight,v.value=x0})}else v.value={minHeight:kg(w.value).minHeight}},B=(Y=>{let Me=!1;return()=>{var os;if(Me||!s.autosize)return;((os=w.value)==null?void 0:os.offsetParent)===null||(Y(),Me=!0)}})(I),Z=()=>{const Y=S.value,Me=s.formatter?s.formatter($.value):$.value;!Y||Y.value===Me||(Y.value=Me)},Se=async Y=>{se();let{value:Me}=Y.target;if(s.formatter&&(Me=s.parser?s.parser(Me):Me),!At.value){if(Me===$.value){Z();return}t(jc,Me),t("input",Me),await l.nextTick(),Z(),H()}},We=Y=>{t("change",Y.target.value)},{isComposing:At,handleCompositionStart:Zt,handleCompositionUpdate:De,handleCompositionEnd:is}=cA({emit:t,afterComposition:Se}),wt=()=>{C.value=!C.value,vn()},vn=async()=>{var Y;await l.nextTick(),(Y=S.value)==null||Y.focus()},hr=()=>{var Y;return(Y=S.value)==null?void 0:Y.blur()},Qt=Y=>{x.value=!1,t("mouseleave",Y)},Ls=Y=>{x.value=!0,t("mouseenter",Y)},fr=Y=>{t("keydown",Y)},le=()=>{var Y;(Y=S.value)==null||Y.select()},xt=()=>{t(jc,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>s.modelValue,()=>{var Y;l.nextTick(()=>I()),s.validateEvent&&((Y=h==null?void 0:h.validate)==null||Y.call(h,"change").catch(Me=>kt(Me)))}),l.watch($,()=>Z()),l.watch(()=>s.type,async()=>{await l.nextTick(),Z(),I()}),l.onMounted(()=>{!s.formatter&&s.parser&&kt("ElInput","If you set the parser, you also need to set the formatter."),Z(),l.nextTick(I)}),e({input:b,textarea:w,ref:S,textareaStyle:k,autosize:l.toRef(s,"autosize"),isComposing:At,focus:vn,blur:hr,select:le,clear:xt,resizeTextarea:I}),(Y,Me)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(o),{class:[l.unref(a),{[l.unref(m).bm("group","append")]:Y.$slots.append,[l.unref(m).bm("group","prepend")]:Y.$slots.prepend}],style:l.unref(M),role:Y.containerRole,onMouseenter:Ls,onMouseleave:Qt}),[l.createCommentVNode(" input "),Y.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),Y.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(m).be("group","prepend"))},[l.renderSlot(Y.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:O,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),Y.$slots.prefix||Y.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(Y.$slots,"prefix"),Y.prefixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(Y.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:Y.minlength,maxlength:Y.maxlength,type:Y.showPassword?C.value?"text":"password":Y.type,disabled:l.unref(g),readonly:Y.readonly,autocomplete:Y.autocomplete,tabindex:Y.tabindex,"aria-label":Y.ariaLabel,placeholder:Y.placeholder,style:Y.inputStyle,form:Y.form,autofocus:Y.autofocus,onCompositionstart:l.unref(Zt),onCompositionupdate:l.unref(De),onCompositionend:l.unref(is),onInput:Se,onChange:We,onKeydown:fr}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(Q)?(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(V)||!l.unref(U)||!l.unref(F)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(Y.$slots,"suffix"),Y.suffixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(Y.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(V)?(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("clear")]),onMousedown:l.withModifiers(l.unref(ds),["prevent"]),onClick:xt},{default:l.withCtx(()=>[l.createVNode(l.unref(Bp))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(U)?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("password")]),onClick:wt},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(P))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(F)?(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(q))+" / "+l.toDisplayString(Y.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(L)&&l.unref(j)&&l.unref(D)?(l.openBlock(),l.createBlock(l.unref(An),{key:4,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("validateIcon"),l.unref(m).is("loading",l.unref(L)==="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 "),Y.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(m).be("group","append"))},[l.renderSlot(Y.$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(_))]},l.unref(u),{minlength:Y.minlength,maxlength:Y.maxlength,tabindex:Y.tabindex,disabled:l.unref(g),readonly:Y.readonly,autocomplete:Y.autocomplete,style:l.unref(k),"aria-label":Y.ariaLabel,placeholder:Y.placeholder,form:Y.form,autofocus:Y.autofocus,rows:Y.rows,onCompositionstart:l.unref(Zt),onCompositionupdate:l.unref(De),onCompositionend:l.unref(is),onInput:Se,onFocus:l.unref(T),onBlur:l.unref(A),onChange:We,onKeydown:fr}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),l.unref(F)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(E.value),class:l.normalizeClass(l.unref(m).e("count"))},l.toDisplayString(l.unref(q))+" / "+l.toDisplayString(Y.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var NA=pt(MA,[["__file","input.vue"]]);const PA=Ws(NA),su=Symbol("popper"),Vg=Symbol("popperContent"),Dg=et({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),_A=l.defineComponent({name:"ElPopper",inheritAttrs:!1}),AA=l.defineComponent({..._A,props:Dg,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(su,c),(u,d)=>l.renderSlot(u.$slots,"default")}});var TA=pt(AA,[["__file","popper.vue"]]);const Rg=et({arrowOffset:{type:Number,default:5}}),kA=l.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),VA=l.defineComponent({...kA,props:Rg,setup(n,{expose:e}){const t=n,s=yt("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=l.inject(Vg,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 DA=pt(VA,[["__file","arrow.vue"]]);const ru="ElOnlyChild",RA=l.defineComponent({name:ru,setup(n,{slots:e,attrs:t}){var s;const r=l.inject(wg),i=iA((s=r==null?void 0:r.setForwardRef)!=null?s:ds);return()=>{var o;const a=(o=e.default)==null?void 0:o.call(e,t);if(!a)return null;if(a.length>1)return kt(ru,"requires exact only one valid child."),null;const c=Ig(a);return c?l.withDirectives(l.cloneVNode(c,t),[[i]]):(kt(ru,"no valid child node found"),null)}}});function Ig(n){if(!n)return null;const e=n;for(const t of e){if(Sr(t))switch(t.type){case l.Comment:continue;case l.Text:case"svg":return Lg(t);case l.Fragment:return Ig(t.children);default:return t}return Lg(t)}return null}function Lg(n){const e=yt("only-child");return l.createVNode("span",{class:e.e("content")},[n])}const Bg=et({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}),IA=l.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),LA=l.defineComponent({...IA,props:Bg,setup(n,{expose:e}){const t=n,{role:s,triggerRef:r}=l.inject(su,void 0);rA(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=us(h))},{immediate:!0}),l.watch(r,(h,f)=>{u==null||u(),u=void 0,Xn(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)=>{ba(p[m])?h.removeAttribute(g):h.setAttribute(g,p[m])})},{immediate:!0})),Xn(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&&Xn(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(RA),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 BA=pt(LA,[["__file","trigger.vue"]]);const iu="focus-trap.focus-after-trapped",ou="focus-trap.focus-after-released",jA="focus-trap.focusout-prevented",jg={cancelable:!0,bubbles:!1},$A={cancelable:!0,bubbles:!1},$g="focusAfterTrapped",zg="focusAfterReleased",zA=Symbol("elFocusTrap"),au=l.ref(),Da=l.ref(0),lu=l.ref(0);let Ra=0;const Fg=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},Ug=(n,e)=>{for(const t of n)if(!FA(t,e))return t},FA=(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},UA=n=>{const e=Fg(n),t=Ug(e,n),s=Ug(e.reverse(),n);return[t,s]},HA=n=>n instanceof HTMLInputElement&&"select"in n,gs=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),lu.value=window.performance.now(),n!==t&&HA(n)&&e&&n.select()}};function Hg(n,e){const t=[...n],s=n.indexOf(e);return s!==-1&&t.splice(s,1),t}const GA=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=Hg(n,s),n.unshift(s)},remove:s=>{var r,i;n=Hg(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},WA=(n,e=!1)=>{const t=document.activeElement;for(const s of n)if(gs(s,e),document.activeElement!==t)return},Gg=GA(),YA=()=>Da.value>lu.value,Ia=()=>{au.value="pointer",Da.value=window.performance.now()},Wg=()=>{au.value="keyboard",Da.value=window.performance.now()},qA=()=>(l.onMounted(()=>{Ra===0&&(document.addEventListener("mousedown",Ia),document.addEventListener("touchstart",Ia),document.addEventListener("keydown",Wg)),Ra++}),l.onBeforeUnmount(()=>{Ra--,Ra<=0&&(document.removeEventListener("mousedown",Ia),document.removeEventListener("touchstart",Ia),document.removeEventListener("keydown",Wg))}),{focusReason:au,lastUserFocusTimestamp:Da,lastAutomatedFocusTimestamp:lu}),La=n=>new CustomEvent(jA,{...$A,detail:n}),XA=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[$g,zg,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=l.ref();let s,r;const{focusReason:i}=qA();Q_(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:C}=g,{loop:E}=n,v=m===Dr.tab&&!y&&!b&&!w,S=document.activeElement;if(v&&S){const O=x,[_,T]=UA(O);if(_&&T){if(!C&&S===T){const D=La({focusReason:i.value});e("focusout-prevented",D),D.defaultPrevented||(g.preventDefault(),E&&gs(_,!0))}else if(C&&[_,O].includes(S)){const D=La({focusReason:i.value});e("focusout-prevented",D),D.defaultPrevented||(g.preventDefault(),E&&gs(T,!0))}}else if(S===O){const D=La({focusReason:i.value});e("focusout-prevented",D),D.defaultPrevented||g.preventDefault()}}};l.provide(zA,{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($g,g)},u=g=>e(zg,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:gs(r,!0))},h=g=>{const m=l.unref(t);if(!(o.paused||!m))if(n.trapped){const y=g.relatedTarget;!ba(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=La({focusReason:i.value});e("focusout-prevented",b),b.defaultPrevented||gs(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){Gg.push(o);const m=g.contains(document.activeElement)?s:document.activeElement;if(s=m,!g.contains(m)){const b=new Event(iu,jg);g.addEventListener(iu,c),g.dispatchEvent(b),b.defaultPrevented||l.nextTick(()=>{let w=n.focusStartEl;rn(w)||(gs(w),document.activeElement!==w&&(w="first")),w==="first"&&WA(Fg(g),!0),(document.activeElement===m||w==="container")&&gs(g)})}}}function p(){const g=l.unref(t);if(g){g.removeEventListener(iu,c);const m=new CustomEvent(ou,{...jg,detail:{focusReason:i.value}});g.addEventListener(ou,u),g.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!YA()||g.contains(document.activeElement))&&gs(s??document.body),g.removeEventListener(ou,u),Gg.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 JA(n,e,t,s,r,i){return l.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Yg=pt(XA,[["render",JA],["__file","focus-trap.vue"]]);const KA=["fixed","absolute"],ZA=et({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:zc,default:"bottom"},popperOptions:{type:he(Object),default:()=>({})},strategy:{type:String,values:KA,default:"absolute"}}),qg=et({...ZA,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,...Qc(["ariaLabel"])}),QA={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},eT=(n,e=[])=>{const{placement:t,strategy:s,popperOptions:r}=n,i={placement:t,strategy:s,...r,modifiers:[...nT(n),...e]};return sT(i,r==null?void 0:r.modifiers),i},tT=n=>{if(Ye)return us(n)};function nT(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 sT(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const rT=0,iT=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:s,role:r}=l.inject(su,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:rT;return{name:"arrow",enabled:!NN(w),options:{element:w,padding:x}}}),u=l.computed(()=>({onFirstUpdate:()=>{g()},...eT(n,[l.unref(c),l.unref(a)])})),d=l.computed(()=>tT(n.referenceEl)||l.unref(s)),{attributes:h,state:f,styles:p,update:g,forceUpdate:m,instanceRef:y}=J_(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}},oT=(n,{attributes:e,styles:t,role:s})=>{const{nextZIndex:r}=Og(),i=yt("popper"),o=l.computed(()=>l.unref(e).popper),a=l.ref(Ht(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=Ht(n.zIndex)?n.zIndex:r()}}},aT=(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")}}},lT=l.defineComponent({name:"ElPopperContent"}),cT=l.defineComponent({...lT,props:qg,emits:QA,setup(n,{expose:e,emit:t}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=aT(s,t),{attributes:h,arrowRef:f,contentRef:p,styles:g,instanceRef:m,role:y,update:b}=iT(s),{ariaModal:w,arrowStyle:x,contentAttrs:C,contentClass:E,contentStyle:v,updateZIndex:S}=oT(s,{styles:g,attributes:h,role:y}),O=l.inject(Va,void 0),_=l.ref();l.provide(Vg,{arrowStyle:x,arrowRef:f,arrowOffset:_}),O&&l.provide(Va,{...O,addInputId:ds,removeInputId:ds});let T;const A=(L=!0)=>{b(),L&&S()},D=()=>{A(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return l.onMounted(()=>{l.watch(()=>s.triggerTargetEl,(L,j)=>{T==null||T(),T=void 0;const P=l.unref(L||p.value),M=l.unref(j||p.value);Xn(P)&&(T=l.watch([y,()=>s.ariaLabel,w,()=>s.id],k=>{["role","aria-label","aria-modal","id"].forEach(($,V)=>{ba(k[V])?P.removeAttribute($):P.setAttribute($,k[V])})},{immediate:!0})),M!==P&&Xn(M)&&["role","aria-label","aria-modal","id"].forEach(k=>{M.removeAttribute(k)})},{immediate:!0}),l.watch(()=>s.visible,D,{immediate:!0})}),l.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:p,popperInstanceRef:m,updatePopper:A,contentStyle:v}),(L,j)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({ref_key:"contentRef",ref:p},l.unref(C),{style:l.unref(v),class:l.unref(E),tabindex:"-1",onMouseenter:P=>L.$emit("mouseenter",P),onMouseleave:P=>L.$emit("mouseleave",P)}),[l.createVNode(l.unref(Yg),{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(L.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var uT=pt(cT,[["__file","content.vue"]]);const dT=Ws(TA),cu=Symbol("elTooltip"),Xg=et({...nA,...qg,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,...Qc(["ariaLabel"])}),Jg=et({...Bg,disabled:Boolean,trigger:{type:he([String,Array]),default:"hover"},triggerKeys:{type:he(Array),default:()=>[Dr.enter,Dr.space]}}),{useModelToggleProps:hT,useModelToggleEmits:fT,useModelToggle:pT}=$P("visible"),gT=et({...Dg,...hT,...Xg,...Jg,...Rg,showArrow:{type:Boolean,default:!0}}),mT=[...fT,"before-show","before-hide","show","hide","open","close"],yT=(n,e)=>Fv(n)?n.includes(e):n===e,$r=(n,e,t)=>s=>{yT(l.unref(n),e)&&t(s)},bT=l.defineComponent({name:"ElTooltipTrigger"}),wT=l.defineComponent({...bT,props:Jg,setup(n,{expose:e}){const t=n,s=yt("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:c,onToggle:u}=l.inject(cu,void 0),d=l.ref(null),h=()=>{if(l.unref(r)||t.disabled)return!0},f=l.toRef(t,"trigger"),p=Gn(h,$r(f,"hover",a)),g=Gn(h,$r(f,"hover",c)),m=Gn(h,$r(f,"click",C=>{C.button===0&&u(C)})),y=Gn(h,$r(f,"focus",a)),b=Gn(h,$r(f,"focus",c)),w=Gn(h,$r(f,"contextmenu",C=>{C.preventDefault(),u(C)})),x=Gn(h,C=>{const{code:E}=C;t.triggerKeys.includes(E)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,E)=>(l.openBlock(),l.createBlock(l.unref(BA),{id:l.unref(i),"virtual-ref":C.virtualRef,open:l.unref(o),"virtual-triggering":C.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(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var xT=pt(wT,[["__file","trigger.vue"]]);const vT=et({to:{type:he([String,Object]),required:!0},disabled:Boolean});var CT=pt(l.defineComponent({__name:"teleport",props:vT,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 ST=Ws(CT),ET=l.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),OT=l.defineComponent({...ET,props:Xg,setup(n,{expose:e}){const t=n,{selector:s}=bg(),r=yt("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(cu,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)),C=l.computed(()=>t.disabled?!1:l.unref(u)),E=l.computed(()=>t.appendTo||s.value),v=l.computed(()=>{var M;return(M=t.style)!=null?M:{}}),S=l.ref(!0),O=()=>{g(),S.value=!0},_=()=>{if(l.unref(a))return!0},T=Gn(_,()=>{t.enterable&&l.unref(d)==="hover"&&f()}),A=Gn(_,()=>{l.unref(d)==="hover"&&h()}),D=()=>{var M,k;(k=(M=i.value)==null?void 0:M.updatePopper)==null||k.call(M),m==null||m()},L=()=>{y==null||y()},j=()=>{p(),o=Tv(l.computed(()=>{var M;return(M=i.value)==null?void 0:M.popperContentRef}),()=>{if(l.unref(a))return;l.unref(d)!=="hover"&&h()})},P=()=>{t.virtualTriggering||h()};return l.watch(()=>l.unref(u),M=>{M?S.value=!1:o==null||o()},{flush:"post"}),l.watch(()=>t.content,()=>{var M,k;(k=(M=i.value)==null?void 0:M.updatePopper)==null||k.call(M)}),e({contentRef:i}),(M,k)=>(l.openBlock(),l.createBlock(l.unref(ST),{disabled:!M.teleported,to:l.unref(E)},{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(b),onAfterLeave:O,onBeforeEnter:D,onAfterEnter:j,onBeforeLeave:L},{default:l.withCtx(()=>[l.unref(x)?l.withDirectives((l.openBlock(),l.createBlock(l.unref(uT),l.mergeProps({key:0,id:l.unref(c),ref_key:"contentRef",ref:i},M.$attrs,{"aria-label":M.ariaLabel,"aria-hidden":S.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(v)],"reference-el":M.referenceEl,"trigger-target-el":M.triggerTargetEl,visible:l.unref(C),"z-index":M.zIndex,onMouseenter:l.unref(T),onMouseleave:l.unref(A),onBlur:P,onClose:l.unref(h)}),{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(C)]]):l.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var MT=pt(OT,[["__file","content.vue"]]);const NT=l.defineComponent({name:"ElTooltip"}),PT=l.defineComponent({...NT,props:gT,emits:mT,setup(n,{expose:e,emit:t}){const s=n;tA();const r=Ta(),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}=pT({indicator:c,toggleReason:u}),{onOpen:p,onClose:g}=sA({showAfter:l.toRef(s,"showAfter"),hideAfter:l.toRef(s,"hideAfter"),autoClose:l.toRef(s,"autoClose"),open:d,close:h}),m=l.computed(()=>wa(s.visible)&&!f.value);l.provide(cu,{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 C=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,E=(b==null?void 0:b.relatedTarget)||document.activeElement;return C&&C.contains(E)};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(dT),{ref_key:"popperRef",ref:i,role:b.role},{default:l.withCtx(()=>[l.createVNode(xT,{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(MT,{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(DA),{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 _T=pt(PT,[["__file","tooltip.vue"]]);const Kg=Ws(_T),AT=et({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}}),TT=l.defineComponent({name:"ElBadge"}),kT=l.defineComponent({...TT,props:AT,setup(n,{expose:e}){const t=n,s=yt("badge"),r=l.computed(()=>t.isDot?"":Ht(t.value)&&Ht(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:Fi(-((a=(o=t.offset)==null?void 0:o[0])!=null?a:0)),marginTop:Fi((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 VT=pt(kT,[["__file","badge.vue"]]);const DT=Ws(VT),Zg=Symbol("buttonGroupContextKey"),RT=(n,e)=>{_P({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(Zg,void 0),s=eu("button"),{form:r}=Tg(),i=Ag(l.computed(()=>t==null?void 0:t.size)),o=nu(),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)}}},uu=et({size:Zc,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ui},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ui,default:()=>va},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"}}),IT={click:n=>n instanceof MouseEvent};function ct(n,e){LT(n)&&(n="100%");var t=BT(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 Ba(n){return Math.min(1,Math.max(0,n))}function LT(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function BT(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Qg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function ja(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Ks(n){return n.length===1?"0"+n:String(n)}function jT(n,e,t){return{r:ct(n,255)*255,g:ct(e,255)*255,b:ct(t,255)*255}}function em(n,e,t){n=ct(n,255),e=ct(e,255),t=ct(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 du(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 $T(n,e,t){var s,r,i;if(n=ct(n,360),e=ct(e,100),t=ct(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=du(a,o,n+1/3),r=du(a,o,n),i=du(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function tm(n,e,t){n=ct(n,255),e=ct(e,255),t=ct(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 zT(n,e,t){n=ct(n,360)*6,e=ct(e,100),t=ct(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 nm(n,e,t,s){var r=[Ks(Math.round(n).toString(16)),Ks(Math.round(e).toString(16)),Ks(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 FT(n,e,t,s,r){var i=[Ks(Math.round(n).toString(16)),Ks(Math.round(e).toString(16)),Ks(Math.round(t).toString(16)),Ks(UT(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 UT(n){return Math.round(parseFloat(n)*255).toString(16)}function sm(n){return Rt(n)/255}function Rt(n){return parseInt(n,16)}function HT(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var hu={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 GT(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=qT(n)),typeof n=="object"&&(Jn(n.r)&&Jn(n.g)&&Jn(n.b)?(e=jT(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Jn(n.h)&&Jn(n.s)&&Jn(n.v)?(s=ja(n.s),r=ja(n.v),e=zT(n.h,s,r),o=!0,a="hsv"):Jn(n.h)&&Jn(n.s)&&Jn(n.l)&&(s=ja(n.s),i=ja(n.l),e=$T(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Qg(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 WT="[-\\+]?\\d+%?",YT="[-\\+]?\\d*\\.\\d+%?",ms="(?:".concat(YT,")|(?:").concat(WT,")"),fu="[\\s|\\(]+(".concat(ms,")[,|\\s]+(").concat(ms,")[,|\\s]+(").concat(ms,")\\s*\\)?"),pu="[\\s|\\(]+(".concat(ms,")[,|\\s]+(").concat(ms,")[,|\\s]+(").concat(ms,")[,|\\s]+(").concat(ms,")\\s*\\)?"),fn={CSS_UNIT:new RegExp(ms),rgb:new RegExp("rgb"+fu),rgba:new RegExp("rgba"+pu),hsl:new RegExp("hsl"+fu),hsla:new RegExp("hsla"+pu),hsv:new RegExp("hsv"+fu),hsva:new RegExp("hsva"+pu),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 qT(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(hu[n])n=hu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=fn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=fn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=fn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=fn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=fn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=fn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=fn.hex8.exec(n),t?{r:Rt(t[1]),g:Rt(t[2]),b:Rt(t[3]),a:sm(t[4]),format:e?"name":"hex8"}:(t=fn.hex6.exec(n),t?{r:Rt(t[1]),g:Rt(t[2]),b:Rt(t[3]),format:e?"name":"hex"}:(t=fn.hex4.exec(n),t?{r:Rt(t[1]+t[1]),g:Rt(t[2]+t[2]),b:Rt(t[3]+t[3]),a:sm(t[4]+t[4]),format:e?"name":"hex8"}:(t=fn.hex3.exec(n),t?{r:Rt(t[1]+t[1]),g:Rt(t[2]+t[2]),b:Rt(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Jn(n){return!!fn.CSS_UNIT.exec(String(n))}var XT=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=HT(e)),this.originalInput=e;var r=GT(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=Qg(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=tm(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=tm(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=em(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=em(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),nm(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),FT(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(ct(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(ct(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="#"+nm(this.r,this.g,this.b,!1),t=0,s=Object.entries(hu);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=Ba(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=Ba(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=Ba(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=Ba(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 ys(n,e=20){return n.mix("#141414",e).toString()}function JT(n){const e=nu(),t=yt("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 XT(r),a=n.dark?o.tint(20).toString():ys(o,20);if(n.plain)s=t.cssVarBlock({"bg-color":n.dark?ys(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ys(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?ys(o,90):o.tint(90).toString(),s[t.cssVarBlockName("disabled-text-color")]=n.dark?ys(o,50):o.tint(50).toString(),s[t.cssVarBlockName("disabled-border-color")]=n.dark?ys(o,80):o.tint(80).toString());else{const c=n.dark?ys(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?ys(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 KT=l.defineComponent({name:"ElButton"}),ZT=l.defineComponent({...KT,props:uu,emits:IT,setup(n,{expose:e,emit:t}){const s=n,r=JT(s),i=yt("button"),{_ref:o,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:h,handleClick:f}=RT(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(An),{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(An),{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 QT=pt(ZT,[["__file","button.vue"]]);const ek={size:uu.size,type:uu.type},tk=l.defineComponent({name:"ElButtonGroup"}),nk=l.defineComponent({...tk,props:ek,setup(n){const e=n;l.provide(Zg,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=yt("button");return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(s.$slots,"default")],2))}});var rm=pt(nk,[["__file","button-group.vue"]]);const sk=Ws(QT,{ButtonGroup:rm});SP(rm);function rk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const gu="_trap-focus-children",Zs=[],im=n=>{var e;if(Zs.length===0)return;const t=Zs[Zs.length-1][gu];if(t.length>0&&n.code===Dr.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())}}},ik={beforeMount(n){n[gu]=_h(n),Zs.push(n),Zs.length<=1&&document.addEventListener("keydown",im)},updated(n){l.nextTick(()=>{n[gu]=_h(n)})},unmounted(){Zs.shift(),Zs.length===0&&document.removeEventListener("keydown",im)}},ok=et({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:he([String,Array,Object])},zIndex:{type:he([String,Number])}}),ak={click:n=>n instanceof MouseEvent},lk="overlay";var ck=l.defineComponent({name:"ElOverlay",props:ok,emits:ak,setup(n,{slots:e,emit:t}){const s=yt(lk),r=c=>{t("click",c)},{onClick:i,onMousedown:o,onMouseup:a}=pg(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")],Ea.STYLE|Ea.CLASS|Ea.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 uk=ck,om=["success","info","warning","error"],gt=Gp({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:Ye?document.body:void 0}),dk=et({customClass:{type:String,default:gt.customClass},center:{type:Boolean,default:gt.center},dangerouslyUseHTMLString:{type:Boolean,default:gt.dangerouslyUseHTMLString},duration:{type:Number,default:gt.duration},icon:{type:Ui,default:gt.icon},id:{type:String,default:gt.id},message:{type:he([String,Object,Function]),default:gt.message},onClose:{type:he(Function),default:gt.onClose},showClose:{type:Boolean,default:gt.showClose},type:{type:String,values:om,default:gt.type},plain:{type:Boolean,default:gt.plain},offset:{type:Number,default:gt.offset},zIndex:{type:Number,default:gt.zIndex},grouping:{type:Boolean,default:gt.grouping},repeatNum:{type:Number,default:gt.repeatNum}}),hk={destroy:()=>!0},pn=l.shallowReactive([]),fk=n=>{const e=pn.findIndex(r=>r.id===n),t=pn[e];let s;return e>0&&(s=pn[e-1]),{current:t,prev:s}},pk=n=>{const{prev:e}=fk(n);return e?e.vm.exposed.bottom.value:0},gk=(n,e)=>pn.findIndex(s=>s.id===n)>0?16:e,mk=l.defineComponent({name:"ElMessage"}),yk=l.defineComponent({...mk,props:dk,emits:hk,setup(n,{expose:e}){const t=n,{Close:s}=Up,{ns:r,zIndex:i}=Pg("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 S=t.type;return{[r.bm("icon",S)]:S&&Sa[S]}}),g=l.computed(()=>t.icon||Sa[t.type]||""),m=l.computed(()=>pk(t.id)),y=l.computed(()=>gk(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}=Av(()=>{E()},t.duration))}function C(){h==null||h()}function E(){u.value=!1}function v({code:S}){S===Dr.esc&&E()}return l.onMounted(()=>{x(),a(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{C(),x()}),Wn(document,"keydown",v),Ih(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:b,close:E}),(S,O)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:S.onClose,onAfterLeave:_=>S.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:S.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(S.type)]:S.type},l.unref(r).is("center",S.center),l.unref(r).is("closable",S.showClose),l.unref(r).is("plain",S.plain),S.customClass]),style:l.normalizeStyle(l.unref(w)),role:"alert",onMouseenter:C,onMouseleave:x},[S.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(DT),{key:0,value:S.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(An),{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(S.$slots,"default",{},()=>[S.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:S.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(S.message),3))]),S.showClose?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(E,["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 bk=pt(yk,[["__file","message.vue"]]);let wk=1;const am=n=>{const e=!n||rn(n)||l.isVNode(n)||zt(n)?{message:n}:n,t={...gt,...e};if(!t.appendTo)t.appendTo=document.body;else if(rn(t.appendTo)){let s=document.querySelector(t.appendTo);Xn(s)||(kt("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),t.appendTo=s}return wa(dn.grouping)&&!t.grouping&&(t.grouping=dn.grouping),Ht(dn.duration)&&t.duration===3e3&&(t.duration=dn.duration),Ht(dn.offset)&&t.offset===16&&(t.offset=dn.offset),wa(dn.showClose)&&!t.showClose&&(t.showClose=dn.showClose),t},xk=n=>{const e=pn.indexOf(n);if(e===-1)return;pn.splice(e,1);const{handler:t}=n;t.close()},vk=({appendTo:n,...e},t)=>{const s=`message_${wk++}`,r=e.onClose,i=document.createElement("div"),o={...e,id:s,onClose:()=>{r==null||r(),xk(d)},onDestroy:()=>{l.render(null,i)}},a=l.createVNode(bk,o,zt(o.message)||l.isVNode(o.message)?{default:zt(o.message)?o.message:()=>o.message}:null);a.appContext=t||zr._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},zr=(n={},e)=>{if(!Ye)return{close:()=>{}};const t=am(n);if(t.grouping&&pn.length){const r=pn.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(Ht(dn.max)&&pn.length>=dn.max)return{close:()=>{}};const s=vk(t,e);return pn.push(s),s.handler};om.forEach(n=>{zr[n]=(e={},t)=>{const s=am(e);return zr({...s,type:n},t)}});function Ck(n){for(const e of pn)(!n||n===e.props.type)&&e.handler.close()}zr.closeAll=Ck,zr._context=null;const Xe=CP(zr,"$message"),Sk=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:ik},components:{ElButton:sk,ElFocusTrap:Yg,ElInput:PA,ElOverlay:uk,ElIcon:An,...Up},inheritAttrs:!1,props:{buttonSize:{type:String,validator:EP},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}=Pg("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(va),cancelButtonLoadingIcon:l.markRaw(va),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=l.computed(()=>{const M=u.type;return{[r.bm("icon",M)]:M&&Sa[M]}}),h=Ta(),f=Ta(),p=l.computed(()=>u.icon||Sa[u.type]||""),g=l.computed(()=>!!u.message),m=l.ref(),y=l.ref(),b=l.ref(),w=l.ref(),x=l.ref(),C=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async M=>{await l.nextTick(),n.boxType==="prompt"&&M!==null&&D()},{immediate:!0}),l.watch(()=>c.value,M=>{var k,$;M&&(n.boxType!=="prompt"&&(u.autofocus?b.value=($=(k=x.value)==null?void 0:k.$el)!=null?$:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(M?l.nextTick().then(()=>{var V;w.value&&w.value.$el&&(u.autofocus?b.value=(V=L())!=null?V:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const E=l.computed(()=>n.draggable),v=l.computed(()=>n.overflow);AP(m,y,E,v),l.onMounted(async()=>{await l.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",S)}),l.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const O=()=>{n.closeOnClickModal&&A(u.distinguishCancelAndClose?"close":"cancel")},_=pg(O),T=M=>{if(u.inputType!=="textarea")return M.preventDefault(),A("confirm")},A=M=>{var k;n.boxType==="prompt"&&M==="confirm"&&!D()||(u.action=M,u.beforeClose?(k=u.beforeClose)==null||k.call(u,M,u,S):S())},D=()=>{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 k=u.inputValidator;if(typeof k=="function"){const $=k(u.inputValue);if($===!1)return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;if(typeof $=="string")return u.editorErrorMessage=$,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},L=()=>{const M=w.value.$refs;return M.input||M.textarea},j=()=>{A("close")},P=()=>{n.closeOnPressEscape&&j()};return n.lockScroll&&LP(c),{...l.toRefs(u),ns:r,overlayEvent:_,visible:c,hasMessage:g,typeClass:d,contentId:h,inputId:f,btnSize:i,iconComponent:p,confirmButtonClasses:C,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:S,handleClose:j,onCloseRequested:P,handleWrapperClick:O,handleInputEnter:T,handleAction:A,t:o}}});function Ek(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 Ok=pt(Sk,[["render",Ek],["__file","index.vue"]]);const Ki=new Map,Mk=n=>{let e=document.body;return n.appendTo&&(rn(n.appendTo)&&(e=document.querySelector(n.appendTo)),Xn(n.appendTo)&&(e=n.appendTo),Xn(e)||(kt("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},Nk=(n,e,t=null)=>{const s=l.createVNode(Ok,n,zt(n.message)||l.isVNode(n.message)?{default:zt(n.message)?n.message:()=>n.message}:null);return s.appContext=t,l.render(s,e),Mk(n).appendChild(e.firstElementChild),s.component},Pk=()=>document.createElement("div"),_k=(n,e)=>{const t=Pk();n.onVanish=()=>{l.render(null,t),Ki.delete(r)},n.onAction=i=>{const o=Ki.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=Nk(n,t,e),r=s.proxy;for(const i in n)Xo(n,i)&&!Xo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function Fr(n,e=null){if(!Ye)return Promise.reject();let t;return rn(n)||l.isVNode(n)?n={message:n}:t=n.callback,new Promise((s,r)=>{const i=_k(n,e??Fr._context);Ki.set(i,{options:n,callback:t,resolve:s,reject:r})})}const Ak=["alert","confirm","prompt"],Tk={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Ak.forEach(n=>{Fr[n]=kk(n)});function kk(n){return(e,t,s,r)=>{let i="";return Sr(t)?(s=t,i=""):kp(t)?i="":i=t,Fr(Object.assign({title:i,message:e,type:"",...Tk[n]},s,{boxType:n}),r)}}Fr.close=()=>{Ki.forEach((n,e)=>{e.doClose()}),Ki.clear()},Fr._context=null;const bs=Fr;bs.install=n=>{bs._context=n._context,n.config.globalProperties.$msgbox=bs,n.config.globalProperties.$messageBox=bs,n.config.globalProperties.$alert=bs.alert,n.config.globalProperties.$confirm=bs.confirm,n.config.globalProperties.$prompt=bs.prompt};const Vk=bs;function lm(n,e){return function(){return n.apply(e,arguments)}}const{toString:Dk}=Object.prototype,{getPrototypeOf:mu}=Object,$a=(n=>e=>{const t=Dk.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),gn=n=>(n=n.toLowerCase(),e=>$a(e)===n),za=n=>e=>typeof e===n,{isArray:Ur}=Array,Zi=za("undefined");function Rk(n){return n!==null&&!Zi(n)&&n.constructor!==null&&!Zi(n.constructor)&&It(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const cm=gn("ArrayBuffer");function Ik(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&cm(n.buffer),e}const Lk=za("string"),It=za("function"),um=za("number"),Fa=n=>n!==null&&typeof n=="object",Bk=n=>n===!0||n===!1,Ua=n=>{if($a(n)!=="object")return!1;const e=mu(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},jk=gn("Date"),$k=gn("File"),zk=gn("Blob"),Fk=gn("FileList"),Uk=n=>Fa(n)&&It(n.pipe),Hk=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||It(n.append)&&((e=$a(n))==="formdata"||e==="object"&&It(n.toString)&&n.toString()==="[object FormData]"))},Gk=gn("URLSearchParams"),[Wk,Yk,qk,Xk]=["ReadableStream","Request","Response","Headers"].map(gn),Jk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qi(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),Ur(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 dm(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 Qs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hm=n=>!Zi(n)&&n!==Qs;function yu(){const{caseless:n}=hm(this)&&this||{},e={},t=(s,r)=>{const i=n&&dm(e,r)||r;Ua(e[i])&&Ua(s)?e[i]=yu(e[i],s):Ua(s)?e[i]=yu({},s):Ur(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Qi(arguments[s],t);return e}const Kk=(n,e,t,{allOwnKeys:s}={})=>(Qi(e,(r,i)=>{t&&It(r)?n[i]=lm(r,t):n[i]=r},{allOwnKeys:s}),n),Zk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Qk=(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)},eV=(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&&mu(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},tV=(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},nV=n=>{if(!n)return null;if(Ur(n))return n;let e=n.length;if(!um(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},sV=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&mu(Uint8Array)),rV=(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])}},iV=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},oV=gn("HTMLFormElement"),aV=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),fm=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),lV=gn("RegExp"),pm=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};Qi(t,(r,i)=>{let o;(o=e(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},cV=n=>{pm(n,(e,t)=>{if(It(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(It(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+"'")})}})},uV=(n,e)=>{const t={},s=r=>{r.forEach(i=>{t[i]=!0})};return Ur(n)?s(n):s(String(n).split(e)),t},dV=()=>{},hV=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,bu="abcdefghijklmnopqrstuvwxyz",gm="0123456789",mm={DIGIT:gm,ALPHA:bu,ALPHA_DIGIT:bu+bu.toUpperCase()+gm},fV=(n=16,e=mm.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;n--;)t+=e[Math.random()*s|0];return t};function pV(n){return!!(n&&It(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const gV=n=>{const e=new Array(10),t=(s,r)=>{if(Fa(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=Ur(s)?[]:{};return Qi(s,(o,a)=>{const c=t(o,r+1);!Zi(c)&&(i[a]=c)}),e[r]=void 0,i}}return s};return t(n,0)},mV=gn("AsyncFunction"),yV=n=>n&&(Fa(n)||It(n))&&It(n.then)&&It(n.catch),ym=((n,e)=>n?setImmediate:e?((t,s)=>(Qs.addEventListener("message",({source:r,data:i})=>{r===Qs&&i===t&&s.length&&s.shift()()},!1),r=>{s.push(r),Qs.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",It(Qs.postMessage)),bV=typeof queueMicrotask<"u"?queueMicrotask.bind(Qs):typeof process<"u"&&process.nextTick||ym,R={isArray:Ur,isArrayBuffer:cm,isBuffer:Rk,isFormData:Hk,isArrayBufferView:Ik,isString:Lk,isNumber:um,isBoolean:Bk,isObject:Fa,isPlainObject:Ua,isReadableStream:Wk,isRequest:Yk,isResponse:qk,isHeaders:Xk,isUndefined:Zi,isDate:jk,isFile:$k,isBlob:zk,isRegExp:lV,isFunction:It,isStream:Uk,isURLSearchParams:Gk,isTypedArray:sV,isFileList:Fk,forEach:Qi,merge:yu,extend:Kk,trim:Jk,stripBOM:Zk,inherits:Qk,toFlatObject:eV,kindOf:$a,kindOfTest:gn,endsWith:tV,toArray:nV,forEachEntry:rV,matchAll:iV,isHTMLForm:oV,hasOwnProperty:fm,hasOwnProp:fm,reduceDescriptors:pm,freezeMethods:cV,toObjectSet:uV,toCamelCase:aV,noop:dV,toFiniteNumber:hV,findKey:dm,global:Qs,isContextDefined:hm,ALPHABET:mm,generateString:fV,isSpecCompliantForm:pV,toJSONObject:gV,isAsyncFn:mV,isThenable:yV,setImmediate:ym,asap:bV};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)}R.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:R.toJSONObject(this.config),code:this.code,status:this.status}}});const bm=ue.prototype,wm={};["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=>{wm[n]={value:n}}),Object.defineProperties(ue,wm),Object.defineProperty(bm,"isAxiosError",{value:!0}),ue.from=(n,e,t,s,r,i)=>{const o=Object.create(bm);return R.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 wV=null;function wu(n){return R.isPlainObject(n)||R.isArray(n)}function xm(n){return R.endsWith(n,"[]")?n.slice(0,-2):n}function vm(n,e,t){return n?n.concat(e).map(function(r,i){return r=xm(r),!t&&i?"["+r+"]":r}).join(t?".":""):e}function xV(n){return R.isArray(n)&&!n.some(wu)}const vV=R.toFlatObject(R,{},null,function(e){return/^is[A-Z]/.test(e)});function Ha(n,e,t){if(!R.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=R.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!R.isUndefined(y[m])});const s=t.metaTokens,r=t.visitor||d,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(e);if(!R.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(R.isDate(g))return g.toISOString();if(!c&&R.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(g)||R.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(R.endsWith(m,"{}"))m=s?m:m.slice(0,-2),g=JSON.stringify(g);else if(R.isArray(g)&&xV(g)||(R.isFileList(g)||R.endsWith(m,"[]"))&&(b=R.toArray(g)))return m=xm(m),b.forEach(function(x,C){!(R.isUndefined(x)||x===null)&&e.append(o===!0?vm([m],C,i):o===null?m:m+"[]",u(x))}),!1}return wu(g)?!0:(e.append(vm(y,m,i),u(g)),!1)}const h=[],f=Object.assign(vV,{defaultVisitor:d,convertValue:u,isVisitable:wu});function p(g,m){if(!R.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(g),R.forEach(g,function(b,w){(!(R.isUndefined(b)||b===null)&&r.call(e,b,R.isString(w)?w.trim():w,m,f))===!0&&p(b,m?m.concat(w):[w])}),h.pop()}}if(!R.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 xu(n,e){this._pairs=[],n&&Ha(n,this,e)}const Sm=xu.prototype;Sm.append=function(e,t){this._pairs.push([e,t])},Sm.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 CV(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Em(n,e,t){if(!e)return n;const s=t&&t.encode||CV,r=t&&t.serialize;let i;if(r?i=r(e,t):i=R.isURLSearchParams(e)?e.toString():new xu(e,t).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Om{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){R.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Mm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},SV={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:xu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},vu=typeof window<"u"&&typeof document<"u",Cu=typeof navigator=="object"&&navigator||void 0,EV=vu&&(!Cu||["ReactNative","NativeScript","NS"].indexOf(Cu.product)<0),OV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MV=vu&&window.location.href||"http://localhost",Ot={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vu,hasStandardBrowserEnv:EV,hasStandardBrowserWebWorkerEnv:OV,navigator:Cu,origin:MV},Symbol.toStringTag,{value:"Module"})),...SV};function NV(n,e){return Ha(n,new Ot.classes.URLSearchParams,Object.assign({visitor:function(t,s,r,i){return Ot.isNode&&R.isBuffer(t)?(this.append(s,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function PV(n){return R.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function _V(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 Nm(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&&R.isArray(r)?r.length:o,c?(R.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!R.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],i)&&R.isArray(r[o])&&(r[o]=_V(r[o])),!a)}if(R.isFormData(n)&&R.isFunction(n.entries)){const t={};return R.forEachEntry(n,(s,r)=>{e(PV(s),r,t,0)}),t}return null}function AV(n,e,t){if(R.isString(n))try{return(e||JSON.parse)(n),R.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const eo={transitional:Mm,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return r?JSON.stringify(Nm(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e)||R.isReadableStream(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.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 NV(e,this.formSerializer).toString();if((a=R.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ha(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),AV(e)):e}],transformResponse:[function(e){const t=this.transitional||eo.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(R.isResponse(e)||R.isReadableStream(e))return e;if(e&&R.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:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],n=>{eo.headers[n]={}});const TV=R.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"]),kV=n=>{const e={};let t,s,r;return n&&n.split(`
34
+ `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&TV[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Pm=Symbol("internals");function to(n){return n&&String(n).trim().toLowerCase()}function Ga(n){return n===!1||n==null?n:R.isArray(n)?n.map(Ga):String(n)}function VV(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 DV=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Su(n,e,t,s,r){if(R.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!R.isString(e)){if(R.isString(s))return e.indexOf(s)!==-1;if(R.isRegExp(s))return s.test(e)}}function RV(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function IV(n,e){const t=R.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 Mt{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function i(a,c,u){const d=to(c);if(!d)throw new Error("header name must be a non-empty string");const h=R.findKey(r,d);(!h||r[h]===void 0||u===!0||u===void 0&&r[h]!==!1)&&(r[h||c]=Ga(a))}const o=(a,c)=>R.forEach(a,(u,d)=>i(u,d,c));if(R.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(R.isString(e)&&(e=e.trim())&&!DV(e))o(kV(e),t);else if(R.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=to(e),e){const s=R.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return VV(r);if(R.isFunction(t))return t.call(this,r,s);if(R.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=to(e),e){const s=R.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||Su(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function i(o){if(o=to(o),o){const a=R.findKey(s,o);a&&(!t||Su(s,s[a],a,t))&&(delete s[a],r=!0)}}return R.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||Su(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,s={};return R.forEach(this,(r,i)=>{const o=R.findKey(s,i);if(o){t[o]=Ga(r),delete t[i];return}const a=e?RV(i):String(i).trim();a!==i&&delete t[i],t[a]=Ga(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return R.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&R.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(`
35
+ `)}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[Pm]=this[Pm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=to(o);s[a]||(IV(r,o),s[a]=!0)}return R.isArray(e)?e.forEach(i):i(e),this}}Mt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(Mt.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}}),R.freezeMethods(Mt);function Eu(n,e){const t=this||eo,s=e||t,r=Mt.from(s.headers);let i=s.data;return R.forEach(n,function(a){i=a.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function _m(n){return!!(n&&n.__CANCEL__)}function Hr(n,e,t){ue.call(this,n??"canceled",ue.ERR_CANCELED,e,t),this.name="CanceledError"}R.inherits(Hr,ue,{__CANCEL__:!0});function Am(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 LV(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function BV(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 jV(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 Wa=(n,e,t=3)=>{let s=0;const r=BV(50,250);return jV(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)},Tm=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},km=n=>(...e)=>R.asap(()=>n(...e)),$V=Ot.hasStandardBrowserEnv?function(){const e=Ot.navigator&&/(msie|trident)/i.test(Ot.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=R.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),zV=Ot.hasStandardBrowserEnv?{write(n,e,t,s,r,i){const o=[n+"="+encodeURIComponent(e)];R.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),R.isString(s)&&o.push("path="+s),R.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 FV(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function UV(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Vm(n,e){return n&&!FV(e)?UV(n,e):e}const Dm=n=>n instanceof Mt?{...n}:n;function er(n,e){e=e||{};const t={};function s(u,d,h){return R.isPlainObject(u)&&R.isPlainObject(d)?R.merge.call({caseless:h},u,d):R.isPlainObject(d)?R.merge({},d):R.isArray(d)?d.slice():d}function r(u,d,h){if(R.isUndefined(d)){if(!R.isUndefined(u))return s(void 0,u,h)}else return s(u,d,h)}function i(u,d){if(!R.isUndefined(d))return s(void 0,d)}function o(u,d){if(R.isUndefined(d)){if(!R.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(Dm(u),Dm(d),!0)};return R.forEach(Object.keys(Object.assign({},n,e)),function(d){const h=c[d]||r,f=h(n[d],e[d],d);R.isUndefined(f)&&h!==a||(t[d]=f)}),t}const Rm=n=>{const e=er({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Mt.from(o),e.url=Em(Vm(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(R.isFormData(t)){if(Ot.hasStandardBrowserEnv||Ot.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(Ot.hasStandardBrowserEnv&&(s&&R.isFunction(s)&&(s=s(e)),s||s!==!1&&$V(e.url))){const u=r&&i&&zV.read(i);u&&o.set(r,u)}return e},HV=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,s){const r=Rm(n);let i=r.data;const o=Mt.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=Mt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};Am(function(S){t(S),m()},function(S){s(S),m()},E),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 C=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const E=r.transitional||Mm;r.timeoutErrorMessage&&(C=r.timeoutErrorMessage),s(new ue(C,E.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&R.forEach(o.toJSON(),function(C,E){y.setRequestHeader(E,C)}),R.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([f,g]=Wa(u,!0),y.addEventListener("progress",f)),c&&y.upload&&([h,p]=Wa(c),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new Hr(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=LV(r.url);if(w&&Ot.protocols.indexOf(w)===-1){s(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,n));return}y.send(i||null)})},GV=(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 Hr(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=()=>R.asap(a),c}},WV=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},YV=async function*(n,e){for await(const t of qV(n))yield*WV(t,e)},qV=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()}},Im=(n,e,t,s)=>{const r=YV(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})},Ya=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Lm=Ya&&typeof ReadableStream=="function",XV=Ya&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Bm=(n,...e)=>{try{return!!n(...e)}catch{return!1}},JV=Lm&&Bm(()=>{let n=!1;const e=new Request(Ot.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),jm=64*1024,Ou=Lm&&Bm(()=>R.isReadableStream(new Response("").body)),qa={stream:Ou&&(n=>n.body)};Ya&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!qa[e]&&(qa[e]=R.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 KV=async n=>{if(n==null)return 0;if(R.isBlob(n))return n.size;if(R.isSpecCompliantForm(n))return(await new Request(Ot.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(R.isArrayBufferView(n)||R.isArrayBuffer(n))return n.byteLength;if(R.isURLSearchParams(n)&&(n=n+""),R.isString(n))return(await XV(n)).byteLength},ZV=async(n,e)=>{const t=R.toFiniteNumber(n.getContentLength());return t??KV(e)},Mu={http:wV,xhr:HV,fetch:Ya&&(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}=Rm(n);u=u?(u+"").toLowerCase():"text";let p=GV([r,i&&i.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&JV&&t!=="get"&&t!=="head"&&(y=await ZV(d,s))!==0){let E=new Request(e,{method:"POST",body:s,duplex:"half"}),v;if(R.isFormData(s)&&(v=E.headers.get("content-type"))&&d.setContentType(v),E.body){const[S,O]=Tm(y,Wa(km(c)));s=Im(E.body,jm,S,O)}}R.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=Ou&&(u==="stream"||u==="response");if(Ou&&(a||x&&m)){const E={};["status","statusText","headers"].forEach(_=>{E[_]=w[_]});const v=R.toFiniteNumber(w.headers.get("content-length")),[S,O]=a&&Tm(v,Wa(km(a),!0))||[];w=new Response(Im(w.body,jm,S,()=>{O&&O(),m&&m()}),E)}u=u||"text";let C=await qa[R.findKey(qa,u)||"text"](w,n);return!x&&m&&m(),await new Promise((E,v)=>{Am(E,v,{data:C,headers:Mt.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)}})};R.forEach(Mu,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const $m=n=>`- ${n}`,QV=n=>R.isFunction(n)||n===null||n===!1,zm={getAdapter:n=>{n=R.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,!QV(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 :
36
36
  `+i.map($m).join(`
37
- `):" "+$m(i[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:Pu};function _u(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Hr(null,n)}function Fm(n){return _u(n),n.headers=Pt.from(n.headers),n.data=Mu.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),zm.getAdapter(n.adapter||eo.adapter)(n).then(function(s){return _u(n),s.data=Mu.call(n,n.transformResponse,s),s.headers=Pt.from(s.headers),s},function(s){return _m(s)||(_u(n),s&&s.response&&(s.response.data=Mu.call(n,n.transformResponse,s.response),s.response.headers=Pt.from(s.response.headers))),Promise.reject(s)})}const Um="1.7.7",Au={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Au[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const Hm={};Au.transitional=function(e,t,s){function r(i,o){return"[Axios v"+Um+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new de(r(o," has been removed"+(t?" in "+t:"")),de.ERR_DEPRECATED);return t&&!Hm[o]&&(Hm[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 eD(n,e,t){if(typeof n!="object")throw new de("options must be an object",de.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 de("option "+i+" must be "+c,de.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new de("Unknown option "+i,de.ERR_BAD_OPTION)}}const Tu={assertOptions:eD,validators:Au},bs=Tu.validators;class tr{constructor(e){this.defaults=e,this.interceptors={request:new Om,response:new Om}}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+=`
38
- `+i):s.stack=i}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=er(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:i}=t;s!==void 0&&Tu.assertOptions(s,{silentJSONParsing:bs.transitional(bs.boolean),forcedJSONParsing:bs.transitional(bs.boolean),clarifyTimeoutError:bs.transitional(bs.boolean)},!1),r!=null&&(I.isFunction(r)?t.paramsSerializer={serialize:r}:Tu.assertOptions(r,{encode:bs.function,serialize:bs.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&I.merge(i.common,i[t.method]);i&&I.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=Pt.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=[Fm.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=Fm.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=er(this.defaults,e);const t=Vm(e.baseURL,e.url);return Em(t,e.params,e.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(e){tr.prototype[e]=function(t,s){return this.request(er(s||{},{method:e,url:t,data:(s||{}).data}))}}),I.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,a){return this.request(er(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}tr.prototype[e]=t(),tr.prototype[e+"Form"]=t(!0)});class ku{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 Hr(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 ku(function(r){e=r}),cancel:e}}}function tD(n){return function(t){return n.apply(null,t)}}function nD(n){return I.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 Gm(n){const e=new tr(n),t=lm(tr.prototype.request,e);return I.extend(t,tr.prototype,e,{allOwnKeys:!0}),I.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Gm(er(n,r))},t}const Ke=Gm(eo);Ke.Axios=tr,Ke.CanceledError=Hr,Ke.CancelToken=ku,Ke.isCancel=_m,Ke.VERSION=Um,Ke.toFormData=Ha,Ke.AxiosError=de,Ke.Cancel=Ke.CanceledError,Ke.all=function(e){return Promise.all(e)},Ke.spread=tD,Ke.isAxiosError=nD,Ke.mergeConfig=er,Ke.AxiosHeaders=Pt,Ke.formToJSON=n=>Nm(I.isHTMLForm(n)?new FormData(n):n),Ke.getAdapter=zm.getAdapter,Ke.HttpStatusCode=Vu,Ke.default=Ke;const Kn=Ke.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),sD=n=>{Kn.defaults.baseURL=n},rD=n=>{Kn.interceptors.request.use(e=>{if(n)return e.headers.token=n,e},e=>Promise.reject(e))};Kn.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 ws=(n,e={})=>Kn.get(n,{params:e}),Xa=(n,e={})=>Kn.post(n,e),Wm=(n,e={})=>Kn.delete(n,{params:e}),iD=(n,e={})=>Kn.post(n,e,{headers:{"Content-Type":"multipart/form-data"}}),Gr=(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"},Ja=n=>ws("/custom/deviceList",{itemIds:n}).then(e=>{if(e!=null&&e.isOk)return e.data}),Ka=n=>ws("/custom/monitorInfo",{deviceCode:n,fieldType:1}).then(e=>{if(e!=null&&e.isOk)return e.data}),Ym=n=>ws("/template/selectOne",{id:n}).then(e=>{if(e!=null&&e.isOk){const t=JSON.parse(e.data.remark);return t===null?null:{background:t.background,grid:t.grid,data:t.data}}else Je.error((e==null?void 0:e.msg)||"获取失败")}),oD=n=>Xa("/custom/arrRealData2",n).then(e=>{if(e!=null&&e.isOk)return e.data;Je.error((e==null?void 0:e.msg)||"获取失败")}),Za={color:"#000000"},Qa={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},aD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},Du={position:"absolute",args:{x:0,y:0},attrs:{text:{fill:"#5174ff",fontSize:8},circle:{magnet:!0,stroke:"#5174ff",r:4}},label:{position:"top"}},lD={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:Du}}}},el={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}}}},tl="M 0 -6 8 0 0 6 z",Xm="M 0 -6 -8 0 0 6 z",Jm={attrs:{wrap:{strokeWidth:10},arrow:{d:tl,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"}]},nt={markup:el.markup,attrs:el.attrs},_t=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},cD={class:"control"},uD={class:"row-column"},dD=_t({__name:"index",props:{payload:Object},setup(n){var f,p,g,m,y,b,w,x,C,E,v,S,O,_,T,A,V,L,B,P,M;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(((C=(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:C.color)||null),o=l.ref(((O=(S=(v=(E=e.payload.value.options)==null?void 0:E.grid)==null?void 0:v.args)==null?void 0:S[0])==null?void 0:O.thickness)||1),a=l.ref(((V=(A=(T=(_=e.payload.value.options)==null?void 0:_.grid)==null?void 0:T.args)==null?void 0:A[1])==null?void 0:V.color)||null),c=l.ref(((M=(P=(B=(L=e.payload.value.options)==null?void 0:L.grid)==null?void 0:B.args)==null?void 0:P[1])==null?void 0:M.thickness)||1),u=l.ref("1"),d=k=>{e.payload.value.drawBackground({color:k})},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(k,j)=>{const W=l.resolveComponent("el-col"),Z=l.resolveComponent("el-color-picker"),$=l.resolveComponent("el-row"),D=l.resolveComponent("el-switch"),U=l.resolveComponent("el-input-number"),ne=l.resolveComponent("el-collapse-item"),Q=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",cD,[l.createVNode(Q,{modelValue:u.value,"onUpdate:modelValue":j[7]||(j[7]=F=>u.value=F),accordion:""},{default:l.withCtx(()=>[l.createVNode(ne,{title:"基础属性",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",uD,[l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[8]||(j[8]=[l.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:t.value,"onUpdate:modelValue":j[0]||(j[0]=F=>t.value=F),size:"small","show-alpha":"",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[9]||(j[9]=[l.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:s.value,"onUpdate:modelValue":j[1]||(j[1]=F=>s.value=F),"active-value":!0,"inactive-value":!1,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[10]||(j[10]=[l.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:r.value,"onUpdate:modelValue":j[2]||(j[2]=F=>r.value=F),min:1,max:20,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[11]||(j[11]=[l.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:i.value,"onUpdate:modelValue":j[3]||(j[3]=F=>i.value=F),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[12]||(j[12]=[l.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:a.value,"onUpdate:modelValue":j[4]||(j[4]=F=>a.value=F),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[13]||(j[13]=[l.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:o.value,"onUpdate:modelValue":j[5]||(j[5]=F=>o.value=F),min:.5,max:10,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode($,{gutter:20},{default:l.withCtx(()=>[l.createVNode(W,{span:12},{default:l.withCtx(()=>j[14]||(j[14]=[l.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),l.createVNode(W,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:c.value,"onUpdate:modelValue":j[6]||(j[6]=F=>c.value=F),min:.5,max:10,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]);/*! Element Plus Icons Vue v2.3.1 */var hD=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"})]))}}),fD=hD,pD=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"})]))}}),Km=pD,gD=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"})]))}}),mD=gD,yD=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"})]))}}),bD=yD,wD=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"})]))}}),xD=wD;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 xt{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})(xt||(xt={}));class Zm{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})(Zm||(Zm={}));function Qm(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 ie(n,e,...t){return Qm(n,e,t)}function vD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Ru(n){return n!=null&&(n instanceof Promise||vD(n))}function Iu(...n){const e=[];if(n.forEach(s=>{Array.isArray(s)?e.push(...s):e.push(s)}),e.some(s=>Ru(s))){const s=e.map(r=>Ru(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 CD(...n){const e=Iu(n);return typeof e=="boolean"?Promise.resolve(e):e}function Lu(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=Qm(r,i,o);t.push(a)}return Iu(t)}class SD{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),Lu([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=Lu([...i],t))}const r=this.listeners["*"];return r!=null?Iu([s,Lu([...r],[e,...t])]):s}emit(e,...t){return this.trigger(e,...t)}}function ED(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(t.prototype,s))})})}const OD=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 MD(n,e){OD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}class ND{}const PD=/^\s*class\s+/.test(`${ND}`)||/^\s*class\s*\{/.test(`${class{}}`);function Bu(n,e){let t;return PD?t=class extends e{}:(t=function(){return e.apply(this,arguments)},MD(t,e)),Object.defineProperty(t,"name",{value:n}),t}function ey(n){return n==="__proto__"}function ju(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 Wr(n,e,t,s="/"){const r=Array.isArray(e)?e:e.split(s),i=r.pop();if(i&&!ey(i)){let o=n;r.forEach(a=>{ey(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=t}return n}function ty(n,e,t="/"){const s=Array.isArray(e)?e.slice():e.split(t),r=s.pop();if(r)if(s.length>0){const i=ju(n,s);i&&delete i[r]}else delete n[r];return n}var _D=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 Ve extends SD{dispose(){this.off()}}_D([xt.dispose()],Ve.prototype,"dispose",null),function(n){n.dispose=xt.dispose}(Ve||(Ve={})),ED(Ve,xt);const ny=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},sy=ny(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),$u=ny(n=>YN(ua(n)).replace(/ /g,""));function zu(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 nl(){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 AD(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=TD(a,d,r-1);if(h===void 0)continue;h<3?(o=!0,i=c):(r=h,i=c)}}return i}function TD(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 Zn(n){return typeof n=="string"&&n.slice(-1)==="%"}function mn(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Zn(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 xs(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 Fu=!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,yy=!1,by=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Fu=n.indexOf("Macintosh")>=0,ry=!!n.match(/(iPad|iPhone|iPod)/g),iy=n.indexOf("Windows")>=0,oy=n.indexOf("MSIE")>=0,ay=!!n.match(/Trident\/7\./),ly=!!n.match(/Edge\//),cy=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,dy=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,hy=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,fy=n.indexOf("Firefox/")>=0,py=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(by=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(uy=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,my=window.PointerEvent!=null&&!Fu),typeof document=="object"){gy="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){yy=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var vs;(function(n){n.IS_MAC=Fu,n.IS_IOS=ry,n.IS_WINDOWS=iy,n.IS_IE=oy,n.IS_IE11=ay,n.IS_EDGE=ly,n.IS_NETSCAPE=cy,n.IS_CHROME_APP=uy,n.IS_CHROME=dy,n.IS_OPERA=hy,n.IS_FIREFOX=fy,n.IS_SAFARI=py,n.SUPPORT_TOUCH=gy,n.SUPPORT_POINTER=my,n.SUPPORT_PASSIVE=yy,n.NO_FOREIGNOBJECT=by,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(vs||(vs={})),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}(vs||(vs={}));const Uu=/[\t\r\n\f]/g,Hu=/\S+/g,Yr=n=>` ${n} `;function qr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function Tn(n,e){if(n==null||e==null)return!1;const t=Yr(qr(n)),s=Yr(e);return n.nodeType===1?t.replace(Uu," ").includes(s):!1}function se(n,e){if(!(n==null||e==null)){if(typeof e=="function")return se(n,e(qr(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(Hu)||[],s=Yr(qr(n)).replace(Uu," ");let r=t.reduce((i,o)=>i.indexOf(Yr(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function Le(n,e){if(n!=null){if(typeof e=="function")return Le(n,e(qr(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(Hu)||[],s=Yr(qr(n)).replace(Uu," ");let r=t.reduce((i,o)=>{const a=Yr(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=e?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function yn(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?se(n,e):Le(n,e);return}if(typeof e=="function")return yn(n,e(qr(n),t),t);typeof e=="string"&&(e.match(Hu)||[]).forEach(r=>{Tn(n,r)?Le(n,r):se(n,r)})}}let wy=0;function kD(){return wy+=1,`v${wy}`}function Gu(n){return(n.id==null||n.id==="")&&(n.id=kD()),n.id}function Cs(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const ot={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"},xy="1.1";function vy(n,e=document){return e.createElement(n)}function Wu(n,e=ot.xhtml,t=document){return t.createElementNS(e,n)}function bn(n,e=document){return Wu(n,ot.svg,e)}function sl(n){if(n){const t=`<svg xmlns="${ot.svg}" xmlns:xlink="${ot.xlink}" version="${xy}">${n}</svg>`,{documentElement:s}=VD(t,{async:!1});return s}const e=document.createElementNS(ot.svg,"svg");return e.setAttributeNS(ot.xmlns,"xmlns:xlink",ot.xlink),e.setAttribute("version",xy),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 DD(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Yu(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function RD(n,e){return n.querySelectorAll(e)}function ID(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(Tn(r,e))return r;r=r.parentNode}return null}function qu(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function qt(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function no(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Bt(n,e){(Array.isArray(e)?e:[e]).forEach(s=>{s!=null&&n.appendChild(s)})}function Sy(n,e){const t=n.firstChild;return t?Xu(t,e):Bt(n,e)}function Xu(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&t.insertBefore(r,n)})}function Ss(n,e){e!=null&&e.appendChild(n)}function Ey(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function LD(n,e){const t=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!e||Tn(s,e))&&t.push(s);return t}const Oy=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function BD(n,e){return n.getAttribute(e)}function Ju(n,e){const t=Ny(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Ku(n,e,t){if(t==null)return Ju(n,e);const s=Ny(e);s.ns&&typeof t=="string"?n.setAttributeNS(s.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function My(n,e){Object.keys(e).forEach(t=>{Ku(n,t,e[t])})}function pe(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"?My(n,e):Ku(n,e,t)}function Ny(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:ot[e[0]],local:e[1]}}return{ns:null,local:n}}function so(n){const e={};return Object.keys(n).forEach(t=>{const s=Oy.includes(t)?t:sy(t);e[s]=n[t]}),e}function rl(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 Zu(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=rl(e[t])):r?(i=rl(n[t]),o=e[t]):(i=rl(n[t]),o=rl(e[t])),n[t]=Zu(i,o)}else n[t]=e[t]}),n}function jD(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=Zu(Zu({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(d)))}a=i[u-1],a?$e(o)&&$e(a)?(c=c,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?c.t+=o.t:(r.push(c),c=o)):$e(o)||$e(a)?(c=c,r.push(c),c=o):c=(c||"")+o:c=o}return c!=null&&r.push(c),r}function $D(n){return n.replace(/ /g," ")}var nr;(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 C=u.match(x);return C&&C[2]?a(C[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})(nr||(nr={}));let sr;const zD={px(n){return n},mm(n){return sr*n},cm(n){return sr*n*10},in(n){return sr*n*25.4},pt(n){return sr*(25.4*n/72)},pc(n){return sr*(25.4*n/6)}};var Py;(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){sr==null&&(sr=e("1","1","mm").width);const i=r?zD[r]:null;return i?i(s):s}n.toPx=t})(Py||(Py={}));const FD=/-(.)/g;function UD(n){return n.replace(FD,(e,t)=>t.toUpperCase())}const Qu={},_y=["webkit","ms","moz","o"],Ay=typeof document<"u"?document.createElement("div").style:{};function HD(n){for(let e=0;e<_y.length;e+=1){const t=_y[e]+n;if(t in Ay)return t}return null}function GD(n){const e=UD(n);if(Qu[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Qu[e]=e in Ay?e:HD(t)}return Qu[e]}function Ty(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 WD={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 YD(n){return/^--/.test(n)}function qD(n,e,t){const s=window.getComputedStyle(n,null);return t?s.getPropertyValue(e)||void 0:s[e]||n.style[e]}function XD(n,e){return!WD[n]&&typeof e=="number"?`${e}px`:e}function Ze(n,e,t){if(typeof e=="string"){const s=YD(e);if(s||(e=GD(e)),t===void 0)return qD(n,e,s);s||(t=XD(e,t));const r=n.style;s?r.setProperty(e,t):r[e]=t;return}for(const s in e)Ze(n,s,e[s])}const il=new WeakMap;function ky(n,e){const t=ua(e),s=il.get(n);if(s)return s[t]}function JD(n,e,t){const s=ua(e),r=il.get(n);r?r[s]=t:il.set(n,{[s]:t})}function rr(n,e,t){if(!e){const s={};return Object.keys(il).forEach(r=>{s[r]=ky(n,r)}),s}if(typeof e=="string"){if(t===void 0)return ky(n,e);JD(n,e,t);return}for(const s in e)rr(n,s,e[s])}class le{get[Symbol.toStringTag](){return le.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(le.isVector(e))r=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")r=sl();else if(e[0]==="<"){const i=sl(e);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(ot.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),s&&this.append(s)}transform(e,t){return e==null?Jr(this.node):(Jr(this.node,e,t),this)}translate(e,t=0,s={}){return e==null?zy(this.node):(zy(this.node,e,t,s),this)}rotate(e,t,s,r={}){return e==null?nd(this.node):(nd(this.node,e,t,s,r),this)}scale(e,t){return e==null?sd(this.node):(sd(this.node,e,t),this)}getTransformToElement(e){const t=le.toNode(e);return ao(this.node,t)}removeAttribute(e){return Ju(this.node,e),this}getAttribute(e){return BD(this.node,e)}setAttribute(e,t){return Ku(this.node,e,t),this}setAttributes(e){return My(this.node,e),this}attr(e,t){return e==null?pe(this.node):typeof e=="string"&&t===void 0?pe(this.node,e):(typeof e=="object"?pe(this.node,e):pe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:le.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?le.create(t):le.create("defs").appendTo(e)}text(e,t={}){return Dy(this.node,e,t),this}tagName(){return DD(this.node)}clone(){return le.create(this.node.cloneNode(!0))}remove(){return qt(this.node),this}empty(){return no(this.node),this}append(e){return Bt(this.node,le.toNodes(e)),this}appendTo(e){return Ss(this.node,le.isVector(e)?e.node:e),this}prepend(e){return Sy(this.node,le.toNodes(e)),this}before(e){return Xu(this.node,le.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(le.toNode(e),this.node),le.create(e)}first(){return this.node.firstChild?le.create(this.node.firstChild):null}last(){return this.node.lastChild?le.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?le.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(le.toNode(e))}find(e){const t=[],s=RD(this.node,e);if(s)for(let r=0,i=s.length;r<i;r+=1)t.push(le.create(s[r]));return t}findOne(e){const t=ID(this.node,e);return t?le.create(t):null}findParentByClass(e,t){const s=Cy(this.node,e,t);return s?le.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 qu(this.node,le.isVector(e)?e.node:e)}wrap(e){const t=le.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=le.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=le.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(le.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 Yu(this.node)}hasClass(e){return Tn(this.node,e)}addClass(e){return se(this.node,e),this}removeClass(e){return Le(this.node,e),this}toggleClass(e,t){return yn(this.node,e,t),this}toLocalPoint(e,t){return mR(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?eR(this.node,e):[]}toPath(){return le.create(aR(this.node))}toPathData(){return jy(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=sl(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})(le||(le={}));function KD(n,e){const t=le.create(e),s=le.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=le.create("path").attr("d",r).appendTo(t.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function ZD(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=le.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 Vy=/em$/;function ol(n,e){const t=parseFloat(n);return Vy.test(n)?t*e:t}function QD(n,e,t,s){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let i=e[0];const o=ol(i.maxFontSize,t)||t;let a=0;const c=ol(s,t);for(let h=1;h<r;h+=1){i=e[h];const f=ol(i.lineHeight,t)||c;a+=f}const u=ol(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 Dy(n,e,t={}){e=$D(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 _=g[0];_&&_.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&no(n),pe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const m=pe(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&pe(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=KD(r,n)):b=document.createDocumentFragment();let w,x=0,C;const E=e.split(`
39
- `),v=[],S=E.length-1;for(let _=0;_<=S;_+=1){w=f;let T="v-line";const A=bn("tspan");let V,L=E[_];if(L)if(u){const B=jD(L,u,{offset:-x,includeAnnotationIndices:c});V=ZD(A,B,{eol:_!==S&&s,baseSize:y,lineHeight:h?null:f,includeAnnotationIndices:c});const P=V.lineHeight;P&&h&&_!==0&&(w=P),_===0&&(C=V.maxFontSize*.8)}else s&&_!==S&&(L+=s),A.textContent=L;else{A.textContent="-",T+=" v-empty-line";const B=A.style;B.fillOpacity=0,B.strokeOpacity=0,u&&(V={})}V&&v.push(V),_>0&&A.setAttribute("dy",w),(_>0||r)&&A.setAttribute("x",a),A.className.baseVal=T,b.appendChild(A),x+=L.length+1}if(o)if(u)w=QD(i,v,y,f);else if(i==="top")w="0.8em";else{let _;switch(S>0?(_=parseFloat(f)||1,_*=S,Vy.test(f)||(_/=y)):_=0,i){case"middle":w=`${.3-_/2}em`;break;case"bottom":w=`${-_-.3}em`;break}}else i===0?w="0em":i?w=i:(w=0,n.getAttribute("y")==null&&n.setAttribute("y",`${C||"0.8em"}`));b.firstChild.setAttribute("dy",w),n.appendChild(b)}function ro(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 Ry(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]||ro(a,s).width,u=n.slice(0,o+1),d=i[u]||ro(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 Iy(n,e,t={},s={}){const r=e.width,i=e.height,o=s.eol||`
40
- `,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=nl(),b=[];return n.split(o).map(w=>{const x=Iy(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}=ro(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=ro(g,t).width);for(let y=0;y<u;y+=1)if(p>r)if(y===u-1){const[w]=Ry(f,r-m,p,t);h.push(g?`${w}${g}`:w)}else{const[w,x]=Ry(f,r,p,t);h.push(w),f=x,p=ro(f,t).width}else{h.push(f);break}return h.join(o)}const ed=.551784;function dt(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 eR(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 tR(n){return["M",dt(n,"x1"),dt(n,"y1"),"L",dt(n,"x2"),dt(n,"y2")].join(" ")}function nR(n){const e=al(n);return e.length===0?null:`${Ly(e)} Z`}function sR(n){const e=al(n);return e.length===0?null:Ly(e)}function Ly(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function al(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=dt(n,"cx",0),t=dt(n,"cy",0),s=dt(n,"r"),r=s*ed;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 iR(n){const e=dt(n,"cx",0),t=dt(n,"cy",0),s=dt(n,"rx"),r=dt(n,"ry")||s,i=s*ed,o=r*ed;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 oR(n){return By({x:dt(n,"x",0),y:dt(n,"y",0),width:dt(n,"width",0),height:dt(n,"height",0),rx:dt(n,"rx",0),ry:dt(n,"ry",0)})}function By(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 aR(n){const e=bn("path");pe(e,pe(n));const t=jy(n);return t&&e.setAttribute("d",t),e}function jy(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return tR(n);case"polygon":return nR(n);case"polyline":return sR(n);case"ellipse":return iR(n);case"circle":return rR(n);case"rect":return oR(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const lR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,$y=/[ ,]+/,cR=/^(\w+)\((.*)\)/;function uR(n,e){const s=bn("svg").createSVGPoint();return s.x=n,s.y=e,s}function at(n){const t=bn("svg").createSVGMatrix();if(n!=null){const s=n,r=t;for(const i in s)r[i]=s[i]}return t}function io(n){const e=bn("svg");return n!=null?(n instanceof DOMMatrix||(n=at(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function oo(n){let e=at();const t=n!=null&&n.match(lR);if(!t)return e;for(let s=0,r=t.length;s<r;s+=1){const o=t[s].match(cR);if(o){let a,c,u,d,h,f=at();const p=o[2].split($y);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 Xr(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 ll(n){let e,t,s;if(n){const i=$y;if(n.trim().indexOf("matrix")>=0){const o=oo(n),a=dR(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 td(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 dR(n){const e=td(n,{x:0,y:1}),t=td(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 hR(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 fR(n){let e={x:0,y:1};n&&(e=td(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function pR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Jr(n,e,t={}){if(e==null)return oo(pe(n,"transform"));if(t.absolute){n.setAttribute("transform",Xr(e));return}const s=n.transform,r=io(e);s.baseVal.appendItem(r)}function zy(n,e,t=0,s={}){let r=pe(n,"transform");const i=ll(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 nd(n,e,t,s,r={}){let i=pe(n,"transform");const o=ll(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 sd(n,e,t){let s=pe(n,"transform");const r=ll(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 ao(n,e){if(Cs(e)&&Cs(n)){const t=e.getScreenCTM(),s=n.getScreenCTM();if(t&&s)return t.inverse().multiply(s)}return at()}function gR(n,e){let t=at();if(Cs(e)&&Cs(n)){let s=n;const r=[];for(;s&&s!==e;){const i=s.getAttribute("transform")||null,o=oo(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{t=t.multiply(i)})}return t}function mR(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=ao(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var Xt;(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})(Xt||(Xt={}));var ir;(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})(ir||(ir={}));var ue;(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})(ue||(ue={})),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}(ue||(ue={})),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}(ue||(ue={})),function(n){function e(t,s){const r=[],i=ir.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}(ue||(ue={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ue||(ue={})),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}(ue||(ue={}));class kn{constructor(e,t){this.isDefaultPrevented=ue.returnFalse,this.isPropagationStopped=ue.returnFalse,this.isImmediatePropagationStopped=ue.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=ue.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=ue.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=ue.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?ue.returnTrue:ue.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})(kn||(kn={})),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}(kn||(kn={})),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]))}(kn||(kn={})),function(n){Xt.register("load",{noBubble:!0})}(),function(n){Xt.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){Xt.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ue.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseover"),s}}),Xt.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ue.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseout"),s}})}();var yR=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},lo;(function(n){let e;function t(o,a,c,u,d){if(!ue.isValidTarget(o))return;let h;if(typeof c!="function"){const{handler:m,selector:y}=c,b=yR(c,["handler","selector"]);c=m,d=y,h=b}const f=ir.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=ue.ensureHandlerId(c);ue.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=ue.normalizeType(m);if(!y)return;let w=y,x=Xt.get(w);w=(d?x.delegateType:x.bindType)||w,x=Xt.get(w);const C=Object.assign({type:w,originType:y,data:u,selector:d,guid:g,handler:c,namespace:b.join(".")},h),E=f.events;let v=E[w];v||(v=E[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,p)===!1)&&ue.addEventListener(o,w,p)),x.add&&(ue.removeHandlerId(C.handler),x.add(o,C),ue.setHandlerId(C.handler,g)),d?(v.handlers.splice(v.delegateCount,0,C),v.delegateCount+=1):v.handlers.push(C)})}n.on=t;function s(o,a,c,u,d){const h=ir.get(o);if(!h)return;const f=h.events;f&&(ue.splitType(a).forEach(p=>{const{originType:g,namespaces:m}=ue.normalizeType(p);if(!g){Object.keys(f).forEach(E=>{s(o,E+p,c,u,!0)});return}let y=g;const b=Xt.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,C=w.handlers.length;for(let E=w.handlers.length-1;E>=0;E-=1){const v=w.handlers[E];(d||g===v.originType)&&(!c||ue.getHandlerId(c)===v.guid)&&(x==null||v.namespace&&x.test(v.namespace))&&(u==null||u===v.selector||u==="**"&&v.selector)&&(w.handlers.splice(E,1),v.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,v))}C&&w.handlers.length===0&&((!b.teardown||b.teardown(o,m,h.handler)===!1)&&ue.removeEventListener(o,y,h.handler),delete f[y])}),Object.keys(f).length===0&&ir.remove(o))}n.off=s;function r(o,a,...c){const u=kn.create(a);u.delegateTarget=o;const d=Xt.get(u.type);if(d.preDispatch&&d.preDispatch(o,u)===!1)return;const h=ue.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=Xt.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 kn?o:new kn(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=Xt.get(h);if(!u&&y.trigger&&y.trigger(p,d,a)===!1)return;let b;const w=[p];if(!u&&!y.noBubble&&!ue.isWindow(p)){b=y.delegateType||h;let C=p,E=p.parentNode;for(;E!=null;)w.push(E),C=E,E=E.parentNode;const v=p.ownerDocument||document;if(C===v){const S=C.defaultView||C.parentWindow||window;w.push(S)}}let x=p;for(let C=0,E=w.length;C<E&&!d.isPropagationStopped();C+=1){const v=w[C];x=v,d.type=C>1?b:y.bindType||h;const S=ir.get(v);S&&S.events[d.type]&&S.handler&&S.handler.call(v,...m);const O=g&&v[g]||null;O&&ue.isValidTarget(v)&&(d.result=O.call(v,...m),d.result===!1&&d.preventDefault())}if(d.type=h,!u&&!d.isDefaultPrevented()){const C=y.preventDefault;if((C==null||C(w.pop(),d,a)===!1)&&ue.isValidTarget(p)&&g&&typeof p[h]=="function"&&!ue.isWindow(p)){const E=p[g];E&&(p[g]=null),e=h,d.isPropagationStopped()&&x.addEventListener(h,ue.stopPropagationCallback),p[h](),d.isPropagationStopped()&&x.removeEventListener(h,ue.stopPropagationCallback),e=void 0,E&&(p[g]=E)}}return d.result}n.trigger=i})(lo||(lo={}));var ht;(function(n){function e(i,o,a,c,u){return co.on(i,o,a,c,u),i}n.on=e;function t(i,o,a,c,u){return co.on(i,o,a,c,u,!0),i}n.once=t;function s(i,o,a,c){return co.off(i,o,a,c),i}n.off=s;function r(i,o,a,c){return lo.trigger(o,a,i,c),i}n.trigger=r})(ht||(ht={}));var co;(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=ue.returnFalse;else if(!a)return;if(c){const u=a;a=function(d,...h){return n.off(s,d),u.call(this,d,...h)},ue.setHandlerId(a,ue.ensureHandlerId(u))}lo.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=ue.returnFalse),lo.off(s,r,o,i)}n.off=t})(co||(co={}));class Fy{constructor(e,t,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=vs.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 rd(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function bR(n){return n.getBoundingClientRect().width}function wR(n){return n.getBoundingClientRect().height}function Uy(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=Uy(()=>{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 vR(n){let e=null,t=[];const s=Uy(()=>{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 CR=typeof ResizeObserver<"u"?vR:xR;var cl;(function(n){const e=new WeakMap;function t(r){let i=e.get(r);return i||(i=CR(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)}})(cl||(cl={}));class uo{constructor(e={}){this.comparator=e.comparator||uo.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})(uo||(uo={}));var id;(function(n){function e(t,s,r=(i,o)=>1){const i={},o={},a={},c=new uo;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})(id||(id={}));class Qn{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 Qn.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=Qn.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(Et(i,0,255)),this.g=Math.round(Et(o,0,255)),this.b=Math.round(Et(a,0,255)),this.a=c==null?1:Et(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 Qn.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 Qn.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 C=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(C){const E=C[1].split(/\s*,\s*/).map(v=>parseInt(v,10));return new n(E)}return null}n.fromRGBA=s;function r(x,C,E){E<0&&++E,E>1&&--E;const v=6*E;return v<1?x+(C-x)*v:2*E<1?C:3*E<2?x+(C-x)*(2/3-E)*6:x}function i(x){const C=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(C){const E=C[2].split(/\s*,\s*/),v=(parseFloat(E[0])%360+360)%360/360,S=parseFloat(E[1])/100,O=parseFloat(E[2])/100,_=E[3]==null?1:parseInt(E[3],10);return new n(u(v,S,O,_))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return t(x);if(x.startsWith("rgb"))return s(x);const C=n.named[x];return C?t(C):i(x)}n.fromString=o;function a(x,C){return n.fromArray([x,x,x,C])}n.makeGrey=a;function c(x,C,E,v){const S=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:C,_=Array.isArray(x)?x[2]:E,T=Array.isArray(x)?x[3]:v,A=Math.max(S,O,_),V=Math.min(S,O,_),L=(A+V)/2;let B=0,P=0;if(V!==A){const M=A-V;switch(P=L>.5?M/(2-A-V):M/(A+V),A){case S:B=(O-_)/M+(O<_?6:0);break;case O:B=(_-S)/M+2;break;case _:B=(S-O)/M+4;break}B/=6}return[B,P,L,T??1]}n.rgba2hsla=c;function u(x,C,E,v){const S=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:C,_=Array.isArray(x)?x[2]:E,T=Array.isArray(x)?x[3]:v,A=_<=.5?_*(O+1):_+O-_*O,V=2*_-A;return[r(V,A,S+1/3)*256,r(V,A,S)*256,r(V,A,S-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 h(){const x="0123456789ABCDEF";let C="#";for(let E=0;E<6;E+=1)C+=x[Math.floor(Math.random()*16)];return C}n.randomHex=h;function f(x){return d(x).toString()}n.randomRGBA=f;function p(x,C){if(typeof x=="string"){const _=x[0]==="#",[T,A,V]=g(x);return C?T*.299+A*.587+V*.114>186?"#000000":"#ffffff":`${_?"#":""}${m(255-T,255-A,255-V)}`}const E=x[0],v=x[1],S=x[2],O=x[3];return C?E*.299+v*.587+S*.114>186?[0,0,0,O]:[255,255,255,O]:[255-E,255-v,255-S,O]}n.invert=p;function g(x){const C=x.indexOf("#")===0?x:`#${x}`;let E=+`0x${C.substr(1)}`;if(!(C.length===4||C.length===7)||Number.isNaN(E))throw new Error("Invalid hex color.");const v=C.length===4?4:8,S=(1<<v)-1,O=["b","g","r"].map(()=>{const _=E&S;return E>>=v,v===4?17*_:_});return[O[2],O[1],O[0]]}function m(x,C,E){const v=S=>S.length<2?`0${S}`:S;return`${v(x.toString(16))}${v(C.toString(16))}${v(E.toString(16))}`}function y(x,C){return w(x,C)}n.lighten=y;function b(x,C){return w(x,-C)}n.darken=b;function w(x,C){if(typeof x=="string"){const S=x[0]==="#",O=parseInt(S?x.substr(1):x,16),_=Et((O>>16)+C,0,255),T=Et((O>>8&255)+C,0,255),A=Et((O&255)+C,0,255);return`${S?"#":""}${(A|T<<8|_<<16).toString(16)}`}const E=m(x[0],x[1],x[2]),v=g(w(E,C));return[v[0],v[1],v[2],x[3]]}})(Qn||(Qn={})),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"}}(Qn||(Qn={}));class od{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 Es;(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})(Es||(Es={}));var or;(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}}})(or||(or={})),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)}}}(or||(or={})),function(n){function e(P){return-1*Math.cos(P*(Math.PI/2))+1}n.easeInSine=e;function t(P){return Math.sin(P*(Math.PI/2))}n.easeOutSine=t;function s(P){return-.5*(Math.cos(Math.PI*P)-1)}n.easeInOutSine=s;function r(P){return P*P}n.easeInQuad=r;function i(P){return P*(2-P)}n.easeOutQuad=i;function o(P){return P<.5?2*P*P:-1+(4-2*P)*P}n.easeInOutQuad=o;function a(P){return P*P*P}n.easeInCubic=a;function c(P){const M=P-1;return M*M*M+1}n.easeOutCubic=c;function u(P){return P<.5?4*P*P*P:(P-1)*(2*P-2)*(2*P-2)+1}n.easeInOutCubic=u;function d(P){return P*P*P*P}n.easeInQuart=d;function h(P){const M=P-1;return 1-M*M*M*M}n.easeOutQuart=h;function f(P){const M=P-1;return P<.5?8*P*P*P*P:1-8*M*M*M*M}n.easeInOutQuart=f;function p(P){return P*P*P*P*P}n.easeInQuint=p;function g(P){const M=P-1;return 1+M*M*M*M*M}n.easeOutQuint=g;function m(P){const M=P-1;return P<.5?16*P*P*P*P*P:1+16*M*M*M*M*M}n.easeInOutQuint=m;function y(P){return P===0?0:Math.pow(2,10*(P-1))}n.easeInExpo=y;function b(P){return P===1?1:-Math.pow(2,-10*P)+1}n.easeOutExpo=b;function w(P){if(P===0||P===1)return P;const M=P*2,k=M-1;return M<1?.5*Math.pow(2,10*k):.5*(-Math.pow(2,-10*k)+2)}n.easeInOutExpo=w;function x(P){const M=P/1;return-1*(Math.sqrt(1-M*P)-1)}n.easeInCirc=x;function C(P){const M=P-1;return Math.sqrt(1-M*M)}n.easeOutCirc=C;function E(P){const M=P*2,k=M-2;return M<1?-.5*(Math.sqrt(1-M*M)-1):.5*(Math.sqrt(1-k*k)+1)}n.easeInOutCirc=E;function v(P,M=1.70158){return P*P*((M+1)*P-M)}n.easeInBack=v;function S(P,M=1.70158){const k=P/1-1;return k*k*((M+1)*k+M)+1}n.easeOutBack=S;function O(P,M=1.70158){const k=P*2,j=k-2,W=M*1.525;return k<1?.5*k*k*((W+1)*k-W):.5*(j*j*((W+1)*j+W)+2)}n.easeInOutBack=O;function _(P,M=.7){if(P===0||P===1)return P;const j=P/1-1,W=1-M,Z=W/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*j)*Math.sin((j-Z)*(2*Math.PI)/W))}n.easeInElastic=_;function T(P,M=.7){const k=1-M,j=P*2;if(P===0||P===1)return P;const W=k/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*j)*Math.sin((j-W)*(2*Math.PI)/k)+1}n.easeOutElastic=T;function A(P,M=.65){const k=1-M;if(P===0||P===1)return P;const j=P*2,W=j-1,Z=k/(2*Math.PI)*Math.asin(1);return j<1?-.5*(Math.pow(2,10*W)*Math.sin((W-Z)*(2*Math.PI)/k)):Math.pow(2,-10*W)*Math.sin((W-Z)*(2*Math.PI)/k)*.5+1}n.easeInOutElastic=A;function V(P){const M=P/1;if(M<1/2.75)return 7.5625*M*M;if(M<2/2.75){const k=M-.5454545454545454;return 7.5625*k*k+.75}if(M<2.5/2.75){const k=M-.8181818181818182;return 7.5625*k*k+.9375}{const k=M-.9545454545454546;return 7.5625*k*k+.984375}}n.easeOutBounce=V;function L(P){return 1-V(1-P)}n.easeInBounce=L;function B(P){return P<.5?L(P*2)*.5:V(P*2-1)*.5+.5}n.easeInOutBounce=B}(or||(or={}));var ar;(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)}`}}})(ar||(ar={}));const ho=[];function Kr(n,e){const t=ho.find(s=>s.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!vs.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),ho.push({name:n,loadTimes:1,styleElement:s})}}function Zr(n){const e=ho.findIndex(t=>t.name===n);if(e>-1){const t=ho[e];if(t.loadTimes-=1,t.loadTimes>0)return;let s=t.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,ho.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 Se;(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})(Se||(Se={}));class Os{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class N extends Os{constructor(e,t){super(),this.x=e??0,this.y=t??0}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this}add(e,t){const s=N.create(e,t);return this.x+=s.x,this.y+=s.y,this}update(e,t){const s=N.create(e,t);return this.x=s.x,this.y=s.y,this}translate(e,t){const s=N.create(e,t);return this.x+=s.x,this.y+=s.y,this}rotate(e,t){const s=N.rotate(this,e,t);return this.x=s.x,this.y=s.y,this}scale(e,t,s=new N){const r=N.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 N.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?N.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=N.create(e),s=this.x-t.x,r=this.y-t.y;return s*s+r*r}manhattanDistance(e){const t=N.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 N){const t=N.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 N(0,0).angleBetween(this,e)}toPolar(e){return this.update(N.toPolar(this,e)),this}changeInAngle(e,t,s=new N){return this.clone().translate(-e,-t).theta(s)-this.theta(s)}adhereToRect(e){return Se.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=N.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)),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=N.create(e),r=N.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=N.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new N(this.x-e,this.y-t);const s=N.create(e);return new N(this.x-s.x,this.y-s.y)}lerp(e,t){const s=N.create(e);return new N((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=N.create(e),r=ye.toRad(s.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return N.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Se.snapToGrid(this.x,e),this.y=Se.snapToGrid(this.y,t??e),this}equals(e){const t=N.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return N.clone(this)}toJSON(){return N.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(N||(N={})),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}(N||(N={})),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=ye.normalize(ye.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),ye.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(Se.random(h,f),Se.random(p,g))}n.random=c;function u(h,f,p){const g=ye.toRad(ye.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,C=w*f+b*p;return new n(x+y.x,C+y.y)}n.rotateEx=d}(N||(N={}));class G extends Os{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 N(this.x,this.y)}get topLeft(){return new N(this.x,this.y)}get topCenter(){return new N(this.x+this.width/2,this.y)}get topRight(){return new N(this.x+this.width,this.y)}get center(){return new N(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new N(this.x,this.y+this.height)}get bottomCenter(){return new N(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new N(this.x+this.width,this.y+this.height)}get corner(){return new N(this.x+this.width,this.y+this.height)}get rightMiddle(){return new N(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new N(this.x,this.y+this.height/2)}get topLine(){return new K(this.topLeft,this.topRight)}get rightLine(){return new K(this.topRight,this.bottomRight)}get bottomLine(){return new K(this.bottomLeft,this.bottomRight)}get leftLine(){return new K(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 G(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this.width=Se.round(this.width,e),this.height=Se.round(this.height,e),this}add(e,t,s,r){const i=G.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=G.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=N.create(e,t);return this.x+=s.x,this.y+=s.y,this}scale(e,t,s=new N){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=N.rotateEx(o,r,i,t),a=N.rotateEx(a,r,i,t),c=N.rotateEx(c,r,i,t),u=N.rotateEx(u,r,i,t);const d=new G(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=G.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=G.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 Se.containsPoint(this,N.create(e,t))}containsRect(e,t,s,r){const i=G.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=N.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 K(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=G.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 G(d,h,Math.min(a.x,u.x)-d,Math.min(a.y,u.y)-h)}isIntersectWithRect(e,t,s,r){const i=G.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=G.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 G(a,c,u-a,d-c)}getNearestSideToPoint(e){const t=N.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=N.clone(e);if(this.containsPoint(t)){const s=this.getNearestSideToPoint(t);if(s==="left")return new N(this.x,t.y);if(s==="top")return new N(t.x,this.y);if(s==="right")return new N(this.x+this.width,t.y);if(s==="bottom")return new N(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 G(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})(G||(G={})),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}(G||(G={})),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}(G||(G={}));class K extends Os{get center(){return new N((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 N(e,t),this.end=new N(s,r)):(this.start=N.create(e),this.end=N.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 N(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new N(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 G(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 K(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 K(this.start,t),new K(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new K(this.start,t),new K(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 K(t,e).length()>r||new K(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 N(this.end.x-this.start.x,this.end.y-this.start.y),s=new N(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*s.y-t.y*s.x,i=new N(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 N(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=N.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=N.create(e,t);return this.closestPoint(s).squaredDistance(s)}pointDistance(e,t){const s=N.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 K(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 K(t,s);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){const s=N.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 K(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})(K||(K={}));class wn extends Os{get center(){return new N(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 G.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=N.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 N(this.x,this.y)),u=new N(a.x/(s*s),a.y/(r*r)),d=new N(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=N.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 N(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=N.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 N(p,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const s=G.fromEllipse(this);s.rotate(e,t);const r=wn.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=N.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 wn(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})(wn||(wn={})),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}(wn||(wn={}));const SR=new RegExp("^[\\s\\dLMCZz,.]*$");function ER(n){return typeof n!="string"?!1:SR.test(n)}function ad(n,e){return(n%e+e)%e}function OR(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 N(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[ad(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[ad(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[ad(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 C=f*Math.min(c,g/2)/g,E=p*Math.min(c,g/2)/g,v=h.x+C,S=h.y+E;i.push("Q",h.x,h.y,v,S),h=new N(v,S)}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 Hy(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})}),OR(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ul(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 C;if(x>1)t=Math.sqrt(x)*t,s=Math.sqrt(x)*s,C=0;else{let R=1;i===o&&(R=-1),C=R*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const E=C*t*g/s,v=-1*C*s*p/t,S=h*E-f*v+a/2,O=f*E+h*v+c/2;let _=Math.atan2((g-v)/s,(p-E)/t)-Math.atan2(0,1),T=_>=0?_:2*Math.PI+_;_=Math.atan2((-g-v)/s,(-p-E)/t)-Math.atan2((g-v)/s,(p-E)/t);let A=_>=0?_:2*Math.PI+_;o===0&&A>0?A-=2*Math.PI:o!==0&&A<0&&(A+=2*Math.PI);const V=A*2/Math.PI,L=Math.ceil(V<0?-1*V:V),B=A/L,P=8/3*Math.sin(B/4)*Math.sin(B/4)/Math.sin(B/2),M=h*t,k=h*s,j=f*t,W=f*s;let Z=Math.cos(T),$=Math.sin(T),D=-P*(M*$+W*Z),U=-P*(j*$-k*Z),ne=0,Q=0;const F=[];for(let R=0;R<L;R+=1){T+=B,Z=Math.cos(T),$=Math.sin(T),ne=M*Z-W*$+S,Q=j*Z+k*$+O;const re=-P*(M*$+W*Z),q=-P*(j*$-k*Z),J=R*6;F[J]=Number(D+n),F[J+1]=Number(U+e),F[J+2]=Number(ne-re+n),F[J+3]=Number(Q-q+e),F[J+4]=Number(ne+n),F[J+5]=Number(Q+e),D=ne+re,U=Q+q}return F.map(R=>+R.toFixed(2))}function MR(n,e,t,s,r=0,i=0,o=0,a,c){const u=[],d=ul(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 He extends Os{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 He.parse(e);this.points=e.map(t=>N.create(t))}else this.points=[]}scale(e,t,s=new N){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=N.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 G;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 G(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 K(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=N.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 K(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 N(s+p,r),m=new K(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 K(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 K(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 K(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 K(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 K(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 He;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 E=y.angleBetween(w,p);Math.abs(E-180)<1e-10||y.equals(p)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((E+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 He(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 He(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})(He||(He={})),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}(He||(He={}));class ze extends Os{constructor(e,t,s,r){super(),this.PRECISION=3,this.start=N.create(e),this.controlPoint1=N.create(t),this.controlPoint2=N.create(s),this.end=N.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,C,E,v;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*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}E=y*y-4*b*m,v=Math.sqrt(E),!(E<0)&&(x=(-y+v)/(2*m),x>0&&x<1&&p.push(x),C=(-y-v)/(2*m),C>0&&C<1&&p.push(C))}let S,O,_,T=p.length;const A=T;for(;T;)T-=1,w=p[T],_=1-w,S=_*_*_*i+3*_*_*w*a+3*_*w*w*u+w*w*w*h,g[0][T]=S,O=_*_*_*o+3*_*_*w*c+3*_*w*w*d+w*w*w*f,g[1][T]=O;p[A]=0,p[A+1]=1,g[0][A]=i,g[1][A]=o,g[0][A+1]=h,g[1][A+1]=f,p.length=A+2,g[0].length=A+2,g[1].length=A+2;const V=Math.min.apply(null,g[0]),L=Math.min.apply(null,g[1]),B=Math.max.apply(null,g[0]),P=Math.max.apply(null,g[1]);return new G(V,L,B-V,P-L)}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 E=o.divide(.5);g/=2;const v=E[0].start.distance(e),S=E[0].end.distance(e),O=v+S,_=E[1].start.distance(e),T=E[1].end.distance(e),A=_+T;O<=A?(o=E[0],c-=g,u=v,d=S):(o=E[1],a+=g,u=_,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 ze(t,t,t,t),new ze(t,s,r,i)];if(e>=1)return[new ze(t,s,r,i),new ze(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 ze(t,a,c,u),new ze(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 K(t,s).pointAt(e),a=new K(s,r).pointAt(e),c=new K(r,i).pointAt(e),u=new K(o,a).pointAt(e),d=new K(a,c).pointAt(e),h=new K(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 ze(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 K(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],C=x.endpointDistance();if(e<=f+C){a=x,c=w*g,u=(w+1)*g,d=s?e-f:C+f-e,h=s?C+f-e:e-f;break}f+=C}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 C=a.divide(.5);g/=2;const E=C[0].endpointDistance(),v=C[1].endpointDistance();d<=E?(a=C[0],u-=g,w=d,x=E-w):(a=C[1],c+=g,w=d-E,x=v-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 He(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 ze(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})(ze||(ze={})),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=>N.clone(f)),o=[],a=[],c=i.length-1;if(c===1)return o[0]=new N((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new N(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 N(d[f],h[f])),f<c-1?a.push(new N(2*i[f+1].x-d[f+1],2*i[f+1].y-h[f+1])):a.push(new N((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 N(i[0][a].x,i[0][a].y),d=new N(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,d,r[a+1]))}return o}n.throughPoints=s}(ze||(ze={}));class dl extends Os{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 yt extends dl{constructor(e,t){super(),K.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=N.create(e,t).round(2)}get type(){return"L"}get line(){return new K(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 yt(t[0]),new yt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new yt(t[0]),new yt(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 yt(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(K.isLine(r))return new n(r);if(N.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})(yt||(yt={}));class Qr extends dl{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 K(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 yt(t[0]):this.clone(),new yt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new yt(t[0]):this.clone(),new yt(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 Qr}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})(Qr||(Qr={}));class ei extends dl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,K.isLine(e)||ze.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=N.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 ei(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(K.isLine(r))return new n(r);if(ze.isCurve(r))return new n(r);if(N.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 yt(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 yt(a,c))}return i}n.create=e})(ei||(ei={}));class Jt extends dl{constructor(e,t,s,r,i,o){super(),ze.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 N(e,t).round(2),this.controlPoint2=new N(s,r).round(2),this.endPoint=new N(i,o).round(2)):(this.controlPoint1=N.create(e).round(2),this.controlPoint2=N.create(t).round(2),this.endPoint=N.create(s).round(2))}get type(){return"C"}get curve(){return new ze(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 Jt(s[0]),new Jt(s[1])]}divideAtLength(e,t={}){const s=this.curve.divideAtLength(e,t);return[new Jt(s[0]),new Jt(s[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new Jt(t[0]),new Jt(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 Jt(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(ze.isCurve(r))return new n(r);if(N.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})(Jt||(Jt={}));function hl(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function Gy(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 Wy(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=hl(n,e,-h),n=p.x,e=p.y,p=hl(a,c,-h),a=p.x,c=p.y;const B=(n-a)/2,P=(e-c)/2;let M=B*B/(t*t)+P*P/(s*s);M>1&&(M=Math.sqrt(M),t=M*t,s=M*s);const k=t*t,j=s*s,W=(i===o?-1:1)*Math.sqrt(Math.abs((k*j-k*P*P-j*B*B)/(k*P*P+j*B*B)));y=W*t*P/s+(n+a)/2,b=W*-s*B/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 B=m,P=a,M=c;m=g+d*(o&&m>g?1:-1),a=y+t*Math.cos(m),c=b+s*Math.sin(m),f=Wy(a,c,t,s,r,0,o,P,M,[m,B,y,b])}w=m-g;const x=Math.cos(g),C=Math.sin(g),E=Math.cos(m),v=Math.sin(m),S=Math.tan(w/4),O=4/3*(t*S),_=4/3*(s*S),T=[n,e],A=[n+O*C,e-_*x],V=[a+O*v,c-_*E],L=[a,c];if(A[0]=2*T[0]-A[0],A[1]=2*T[1]-A[1],u)return[A,V,L].concat(f);{f=[A,V,L].concat(f).join().split(",");const B=[],P=f.length;for(let M=0;M<P;M+=1)B[M]=M%2?hl(+f[M-1],+f[M],h).y:hl(+f[M],+f[M+1],h).x;return B}}function NR(n){if(!n)return null;const e=`
41
- \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 PR(n){const e=NR(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 _R(n){const e=PR(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(Wy.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(Gy(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(Gy(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 AR(n){return _R(n).map(e=>e.map(t=>typeof t=="string"?t:Se.round(t,2))).join(",").split(",").join(" ")}class oe extends Os{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(K.isLine(e[0])||ze.isCurve(e[0])){let t=null;e.forEach((r,i)=>{i===0&&this.appendSegment(oe.createSegment("M",r.start)),t!=null&&!t.end.equals(r.start)&&this.appendSegment(oe.createSegment("M",r.start)),K.isLine(r)?this.appendSegment(oe.createSegment("L",r.end)):ze.isCurve(r)&&this.appendSegment(oe.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),t=r})}else e.forEach(s=>{s.isSegment&&this.appendSegment(s)});else e!=null&&(K.isLine(e)?(this.appendSegment(oe.createSegment("M",e.start)),this.appendSegment(oe.createSegment("L",e.end))):ze.isCurve(e)?(this.appendSegment(oe.createSegment("M",e.start)),this.appendSegment(oe.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):He.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,s)=>{const r=s===0?oe.createSegment("M",t):oe.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(ei.create.call(null,...e))}lineTo(...e){return this.appendSegment(yt.create.call(null,...e))}curveTo(...e){return this.appendSegment(Jt.create.call(null,...e))}arcTo(e,t,s,r,i,o,a){const c=this.end||new N,u=typeof o=="number"?ul(c.x,c.y,e,t,s,r,i,o,a):ul(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 N,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=oe.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Qr.create())}drawPoints(e,t={}){const s=Hy(e,t),r=oe.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 G(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=Se.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=Se.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=Se.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=Se.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(this.segments.length===0)return null;const s=Se.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 E=0,v=this.segments.length;E<v;E+=1){const S=s?E:v-1-E,O=this.getSegment(S),_=i[S],T={precision:r,subdivisions:_},A=O.length(T);if(O.isDifferentiable()&&(u=O,d=S,e<=o+A)){c=S,a=O.divideAtLength((s?1:-1)*(e-o),T);break}o+=A}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,oe.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(f.removeSegment(y-1),y-=1);const w=y-g-1;for(let E=y,v=f.segments.length;E<v;E+=1){const S=this.getSegment(E-w),O=f.getSegment(E);if(O.type==="Z"&&!S.subpathStartSegment.end.equals(O.subpathStartSegment.end)){const _=oe.createSegment("L",S.end);f.replaceSegment(E,_)}}const x=new oe(f.segments.slice(0,m)),C=new oe(f.segments.slice(m));return[x,C]}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=Se.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=Se.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=Se.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 He(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 oe;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})(oe||(oe={})),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 ei.create.call(null,...r);if(s==="L")return yt.create.call(null,...r);if(s==="C")return Jt.create.call(null,...r);if(s==="z"||s==="Z")return Qr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=t}(oe||(oe={})),function(n){n.normalize=AR,n.isValid=ER,n.drawArc=MR,n.drawPoints=Hy,n.arcToCurves=ul}(oe||(oe={}));class Ge{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&&!vs.isApplyingHMR()&&this.onDuplicated(e);const r=this.options.process,i=r?ie(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&&ie(this.options.onConflict,this,e),new Error(`${ca(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} ${PN(this.options.type)}`:this.options.type;return`${ca(r)} with name '${e}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(e){return AD(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ge||(Ge={}));const TR=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;pe(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",pe(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,pe(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;pe(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",pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Ms{constructor(){this.patterns={},this.root=le.create(sl(),{width:"100%",height:"100%"},[bn("defs")]).node}add(e,t){const s=this.root.childNodes[0];s&&s.appendChild(t),this.patterns[e]=t,le.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=TR,n.registry=Ge.create({type:"grid"}),n.registry.register(n.presets,!0)})(Ms||(Ms={}));const Yy=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},qy=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},Xy=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},kR=Object.freeze(Object.defineProperty({__proto__:null,flipX:Yy,flipXY:Xy,flipY:qy,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 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 fo;(function(n){n.presets=Object.assign({},kR),n.presets["flip-x"]=Yy,n.presets["flip-y"]=qy,n.presets["flip-xy"]=Xy,n.registry=Ge.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(fo||(fo={}));function ld(n,e){return n??e}function lt(n,e){return n!=null&&Number.isFinite(n)?n:e}function VR(n={}){const e=ld(n.color,"blue"),t=lt(n.width,1),s=lt(n.margin,2),r=lt(n.opacity,1),i=s,o=s+t;return`
37
+ `):" "+$m(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 Nu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Hr(null,n)}function Fm(n){return Nu(n),n.headers=Mt.from(n.headers),n.data=Eu.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),zm.getAdapter(n.adapter||eo.adapter)(n).then(function(s){return Nu(n),s.data=Eu.call(n,n.transformResponse,s),s.headers=Mt.from(s.headers),s},function(s){return _m(s)||(Nu(n),s&&s.response&&(s.response.data=Eu.call(n,n.transformResponse,s.response),s.response.headers=Mt.from(s.response.headers))),Promise.reject(s)})}const Um="1.7.7",Pu={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Pu[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const Hm={};Pu.transitional=function(e,t,s){function r(i,o){return"[Axios v"+Um+"] 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&&!Hm[o]&&(Hm[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 eD(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 _u={assertOptions:eD,validators:Pu},ws=_u.validators;class tr{constructor(e){this.defaults=e,this.interceptors={request:new Om,response:new Om}}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+=`
38
+ `+i):s.stack=i}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=er(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:i}=t;s!==void 0&&_u.assertOptions(s,{silentJSONParsing:ws.transitional(ws.boolean),forcedJSONParsing:ws.transitional(ws.boolean),clarifyTimeoutError:ws.transitional(ws.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:_u.assertOptions(r,{encode:ws.function,serialize:ws.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&R.merge(i.common,i[t.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=Mt.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=[Fm.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=Fm.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=er(this.defaults,e);const t=Vm(e.baseURL,e.url);return Em(t,e.params,e.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(e){tr.prototype[e]=function(t,s){return this.request(er(s||{},{method:e,url:t,data:(s||{}).data}))}}),R.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,a){return this.request(er(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}tr.prototype[e]=t(),tr.prototype[e+"Form"]=t(!0)});class Au{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 Hr(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 Au(function(r){e=r}),cancel:e}}}function tD(n){return function(t){return n.apply(null,t)}}function nD(n){return R.isObject(n)&&n.isAxiosError===!0}const Tu={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(Tu).forEach(([n,e])=>{Tu[e]=n});function Gm(n){const e=new tr(n),t=lm(tr.prototype.request,e);return R.extend(t,tr.prototype,e,{allOwnKeys:!0}),R.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Gm(er(n,r))},t}const Je=Gm(eo);Je.Axios=tr,Je.CanceledError=Hr,Je.CancelToken=Au,Je.isCancel=_m,Je.VERSION=Um,Je.toFormData=Ha,Je.AxiosError=ue,Je.Cancel=Je.CanceledError,Je.all=function(e){return Promise.all(e)},Je.spread=tD,Je.isAxiosError=nD,Je.mergeConfig=er,Je.AxiosHeaders=Mt,Je.formToJSON=n=>Nm(R.isHTMLForm(n)?new FormData(n):n),Je.getAdapter=zm.getAdapter,Je.HttpStatusCode=Tu,Je.default=Je;const Kn=Je.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),sD=n=>{Kn.defaults.baseURL=n},rD=n=>{Kn.interceptors.request.use(e=>{if(n)return e.headers.token=n,e},e=>Promise.reject(e))};Kn.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 Zn=(n,e={})=>Kn.get(n,{params:e}),Xa=(n,e={})=>Kn.post(n,e),Wm=(n,e={})=>Kn.delete(n,{params:e}),iD=(n,e={})=>Kn.post(n,e,{headers:{"Content-Type":"multipart/form-data"}}),Gr=(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"},ku=n=>Zn("/custom/deviceList",{itemIds:n}).then(e=>{if(e!=null&&e.isOk)return e.data}),oD=n=>Zn("/template/getDiField",{itemIds:n}).then(e=>{if(e!=null&&e.isOk)return e.data.map(t=>({id:t.deviceCode+t.field,...t}))}),Vu=n=>Zn("/custom/monitorInfo",{deviceCode:n,fieldType:1}).then(e=>{if(e!=null&&e.isOk)return e.data}),Ym=n=>Zn("/template/selectOne",{id:n}).then(e=>{var t;if(e!=null&&e.isOk){const s=JSON.parse(((t=e.data)==null?void 0:t.remark)??"{}");return s===null?null:{background:s.background,grid:s.grid,data:s.data}}else Xe.error((e==null?void 0:e.msg)||"获取失败")}),aD=n=>Xa("/custom/arrRealData2",n).then(e=>{if(e!=null&&e.isOk)return e.data;Xe.error((e==null?void 0:e.msg)||"获取失败")}),Ja={color:"#000000"},Ka={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},lD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},Du={position:"absolute",args:{x:0,y:0},attrs:{text:{fill:"#5174ff",fontSize:8},circle:{magnet:!0,stroke:"#5174ff",r:4}},label:{position:"top"}},cD={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:Du}}}},Za={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}}}},Qa="M 0 -6 8 0 0 6 z",Xm="M 0 -6 -8 0 0 6 z",Jm={attrs:{wrap:{strokeWidth:10},arrow:{d:Qa,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"}]},tt={markup:Za.markup,attrs:Za.attrs},Nt=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},uD={class:"control"},dD={class:"row-column"},hD=Nt({__name:"index",props:{payload:Object},setup(n){var f,p,g,m,y,b,w,x,C,E,v,S,O,_,T,A,D,L,j,P,M;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(((C=(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:C.color)||null),o=l.ref(((O=(S=(v=(E=e.payload.value.options)==null?void 0:E.grid)==null?void 0:v.args)==null?void 0:S[0])==null?void 0:O.thickness)||1),a=l.ref(((D=(A=(T=(_=e.payload.value.options)==null?void 0:_.grid)==null?void 0:T.args)==null?void 0:A[1])==null?void 0:D.color)||null),c=l.ref(((M=(P=(j=(L=e.payload.value.options)==null?void 0:L.grid)==null?void 0:j.args)==null?void 0:P[1])==null?void 0:M.thickness)||1),u=l.ref("1"),d=k=>{e.payload.value.drawBackground({color:k})},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(k,$)=>{const V=l.resolveComponent("el-col"),U=l.resolveComponent("el-color-picker"),F=l.resolveComponent("el-row"),q=l.resolveComponent("el-switch"),X=l.resolveComponent("el-input-number"),Q=l.resolveComponent("el-collapse-item"),se=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",uD,[l.createVNode(se,{modelValue:u.value,"onUpdate:modelValue":$[7]||($[7]=H=>u.value=H),accordion:""},{default:l.withCtx(()=>[l.createVNode(Q,{title:"基础属性",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",dD,[l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[8]||($[8]=[l.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:t.value,"onUpdate:modelValue":$[0]||($[0]=H=>t.value=H),size:"small","show-alpha":"",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[9]||($[9]=[l.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:s.value,"onUpdate:modelValue":$[1]||($[1]=H=>s.value=H),"active-value":!0,"inactive-value":!1,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[10]||($[10]=[l.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:r.value,"onUpdate:modelValue":$[2]||($[2]=H=>r.value=H),min:1,max:20,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[11]||($[11]=[l.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:i.value,"onUpdate:modelValue":$[3]||($[3]=H=>i.value=H),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[12]||($[12]=[l.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:a.value,"onUpdate:modelValue":$[4]||($[4]=H=>a.value=H),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[13]||($[13]=[l.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:o.value,"onUpdate:modelValue":$[5]||($[5]=H=>o.value=H),min:.5,max:10,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(F,{gutter:20},{default:l.withCtx(()=>[l.createVNode(V,{span:12},{default:l.withCtx(()=>$[14]||($[14]=[l.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),l.createVNode(V,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:c.value,"onUpdate:modelValue":$[6]||($[6]=H=>c.value=H),min:.5,max:10,size:"small","controls-position":"right",onChange:h},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]);/*! Element Plus Icons Vue v2.3.1 */var fD=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"})]))}}),pD=fD,gD=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"})]))}}),Km=gD,mD=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"})]))}}),yD=mD,bD=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"})]))}}),wD=bD,xD=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"})]))}}),vD=xD;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 bt{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})(bt||(bt={}));class Zm{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})(Zm||(Zm={}));function Qm(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 ne(n,e,...t){return Qm(n,e,t)}function CD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Ru(n){return n!=null&&(n instanceof Promise||CD(n))}function Iu(...n){const e=[];if(n.forEach(s=>{Array.isArray(s)?e.push(...s):e.push(s)}),e.some(s=>Ru(s))){const s=e.map(r=>Ru(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 SD(...n){const e=Iu(n);return typeof e=="boolean"?Promise.resolve(e):e}function Lu(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=Qm(r,i,o);t.push(a)}return Iu(t)}class ED{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),Lu([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=Lu([...i],t))}const r=this.listeners["*"];return r!=null?Iu([s,Lu([...r],[e,...t])]):s}emit(e,...t){return this.trigger(e,...t)}}function OD(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(t.prototype,s))})})}const MD=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 ND(n,e){MD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}class PD{}const _D=/^\s*class\s+/.test(`${PD}`)||/^\s*class\s*\{/.test(`${class{}}`);function Bu(n,e){let t;return _D?t=class extends e{}:(t=function(){return e.apply(this,arguments)},ND(t,e)),Object.defineProperty(t,"name",{value:n}),t}function ey(n){return n==="__proto__"}function ju(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 Wr(n,e,t,s="/"){const r=Array.isArray(e)?e:e.split(s),i=r.pop();if(i&&!ey(i)){let o=n;r.forEach(a=>{ey(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=t}return n}function ty(n,e,t="/"){const s=Array.isArray(e)?e.slice():e.split(t),r=s.pop();if(r)if(s.length>0){const i=ju(n,s);i&&delete i[r]}else delete n[r];return n}var AD=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 ke extends ED{dispose(){this.off()}}AD([bt.dispose()],ke.prototype,"dispose",null),function(n){n.dispose=bt.dispose}(ke||(ke={})),OD(ke,bt);const ny=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},sy=ny(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),$u=ny(n=>YN(ua(n)).replace(/ /g,""));function zu(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 el(){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 TD(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=kD(a,d,r-1);if(h===void 0)continue;h<3?(o=!0,i=c):(r=h,i=c)}}return i}function kD(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 mn(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 xs(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 Fu=!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,yy=!1,by=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Fu=n.indexOf("Macintosh")>=0,ry=!!n.match(/(iPad|iPhone|iPod)/g),iy=n.indexOf("Windows")>=0,oy=n.indexOf("MSIE")>=0,ay=!!n.match(/Trident\/7\./),ly=!!n.match(/Edge\//),cy=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,dy=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,hy=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,fy=n.indexOf("Firefox/")>=0,py=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(by=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(uy=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,my=window.PointerEvent!=null&&!Fu),typeof document=="object"){gy="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){yy=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var vs;(function(n){n.IS_MAC=Fu,n.IS_IOS=ry,n.IS_WINDOWS=iy,n.IS_IE=oy,n.IS_IE11=ay,n.IS_EDGE=ly,n.IS_NETSCAPE=cy,n.IS_CHROME_APP=uy,n.IS_CHROME=dy,n.IS_OPERA=hy,n.IS_FIREFOX=fy,n.IS_SAFARI=py,n.SUPPORT_TOUCH=gy,n.SUPPORT_POINTER=my,n.SUPPORT_PASSIVE=yy,n.NO_FOREIGNOBJECT=by,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(vs||(vs={})),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}(vs||(vs={}));const Uu=/[\t\r\n\f]/g,Hu=/\S+/g,Yr=n=>` ${n} `;function qr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function Tn(n,e){if(n==null||e==null)return!1;const t=Yr(qr(n)),s=Yr(e);return n.nodeType===1?t.replace(Uu," ").includes(s):!1}function te(n,e){if(!(n==null||e==null)){if(typeof e=="function")return te(n,e(qr(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(Hu)||[],s=Yr(qr(n)).replace(Uu," ");let r=t.reduce((i,o)=>i.indexOf(Yr(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function Ie(n,e){if(n!=null){if(typeof e=="function")return Ie(n,e(qr(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(Hu)||[],s=Yr(qr(n)).replace(Uu," ");let r=t.reduce((i,o)=>{const a=Yr(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=e?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function yn(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?te(n,e):Ie(n,e);return}if(typeof e=="function")return yn(n,e(qr(n),t),t);typeof e=="string"&&(e.match(Hu)||[]).forEach(r=>{Tn(n,r)?Ie(n,r):te(n,r)})}}let wy=0;function VD(){return wy+=1,`v${wy}`}function Gu(n){return(n.id==null||n.id==="")&&(n.id=VD()),n.id}function Cs(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const it={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"},xy="1.1";function vy(n,e=document){return e.createElement(n)}function Wu(n,e=it.xhtml,t=document){return t.createElementNS(e,n)}function bn(n,e=document){return Wu(n,it.svg,e)}function tl(n){if(n){const t=`<svg xmlns="${it.svg}" xmlns:xlink="${it.xlink}" version="${xy}">${n}</svg>`,{documentElement:s}=DD(t,{async:!1});return s}const e=document.createElementNS(it.svg,"svg");return e.setAttributeNS(it.xmlns,"xmlns:xlink",it.xlink),e.setAttribute("version",xy),e}function DD(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 RD(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Yu(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function ID(n,e){return n.querySelectorAll(e)}function LD(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(Tn(r,e))return r;r=r.parentNode}return null}function qu(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Yt(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function no(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Lt(n,e){(Array.isArray(e)?e:[e]).forEach(s=>{s!=null&&n.appendChild(s)})}function Sy(n,e){const t=n.firstChild;return t?Xu(t,e):Lt(n,e)}function Xu(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&t.insertBefore(r,n)})}function Ss(n,e){e!=null&&e.appendChild(n)}function Ey(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function BD(n,e){const t=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!e||Tn(s,e))&&t.push(s);return t}const Oy=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function jD(n,e){return n.getAttribute(e)}function Ju(n,e){const t=Ny(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Ku(n,e,t){if(t==null)return Ju(n,e);const s=Ny(e);s.ns&&typeof t=="string"?n.setAttributeNS(s.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function My(n,e){Object.keys(e).forEach(t=>{Ku(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"?My(n,e):Ku(n,e,t)}function Ny(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:it[e[0]],local:e[1]}}return{ns:null,local:n}}function so(n){const e={};return Object.keys(n).forEach(t=>{const s=Oy.includes(t)?t:sy(t);e[s]=n[t]}),e}function nl(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 Zu(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=nl(e[t])):r?(i=nl(n[t]),o=e[t]):(i=nl(n[t]),o=nl(e[t])),n[t]=Zu(i,o)}else n[t]=e[t]}),n}function $D(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=Zu(Zu({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(d)))}a=i[u-1],a?Be(o)&&Be(a)?(c=c,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?c.t+=o.t:(r.push(c),c=o)):Be(o)||Be(a)?(c=c,r.push(c),c=o):c=(c||"")+o:c=o}return c!=null&&r.push(c),r}function zD(n){return n.replace(/ /g," ")}var nr;(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 C=u.match(x);return C&&C[2]?a(C[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})(nr||(nr={}));let sr;const FD={px(n){return n},mm(n){return sr*n},cm(n){return sr*n*10},in(n){return sr*n*25.4},pt(n){return sr*(25.4*n/72)},pc(n){return sr*(25.4*n/6)}};var Py;(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){sr==null&&(sr=e("1","1","mm").width);const i=r?FD[r]:null;return i?i(s):s}n.toPx=t})(Py||(Py={}));const UD=/-(.)/g;function HD(n){return n.replace(UD,(e,t)=>t.toUpperCase())}const Qu={},_y=["webkit","ms","moz","o"],Ay=typeof document<"u"?document.createElement("div").style:{};function GD(n){for(let e=0;e<_y.length;e+=1){const t=_y[e]+n;if(t in Ay)return t}return null}function WD(n){const e=HD(n);if(Qu[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Qu[e]=e in Ay?e:GD(t)}return Qu[e]}function Ty(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 YD={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 qD(n){return/^--/.test(n)}function XD(n,e,t){const s=window.getComputedStyle(n,null);return t?s.getPropertyValue(e)||void 0:s[e]||n.style[e]}function JD(n,e){return!YD[n]&&typeof e=="number"?`${e}px`:e}function Ke(n,e,t){if(typeof e=="string"){const s=qD(e);if(s||(e=WD(e)),t===void 0)return XD(n,e,s);s||(t=JD(e,t));const r=n.style;s?r.setProperty(e,t):r[e]=t;return}for(const s in e)Ke(n,s,e[s])}const sl=new WeakMap;function ky(n,e){const t=ua(e),s=sl.get(n);if(s)return s[t]}function KD(n,e,t){const s=ua(e),r=sl.get(n);r?r[s]=t:sl.set(n,{[s]:t})}function rr(n,e,t){if(!e){const s={};return Object.keys(sl).forEach(r=>{s[r]=ky(n,r)}),s}if(typeof e=="string"){if(t===void 0)return ky(n,e);KD(n,e,t);return}for(const s in e)rr(n,s,e[s])}class ae{get[Symbol.toStringTag](){return ae.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(ae.isVector(e))r=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")r=tl();else if(e[0]==="<"){const i=tl(e);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(it.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),s&&this.append(s)}transform(e,t){return e==null?Jr(this.node):(Jr(this.node,e,t),this)}translate(e,t=0,s={}){return e==null?zy(this.node):(zy(this.node,e,t,s),this)}rotate(e,t,s,r={}){return e==null?nd(this.node):(nd(this.node,e,t,s,r),this)}scale(e,t){return e==null?sd(this.node):(sd(this.node,e,t),this)}getTransformToElement(e){const t=ae.toNode(e);return ao(this.node,t)}removeAttribute(e){return Ju(this.node,e),this}getAttribute(e){return jD(this.node,e)}setAttribute(e,t){return Ku(this.node,e,t),this}setAttributes(e){return My(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:ae.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?ae.create(t):ae.create("defs").appendTo(e)}text(e,t={}){return Dy(this.node,e,t),this}tagName(){return RD(this.node)}clone(){return ae.create(this.node.cloneNode(!0))}remove(){return Yt(this.node),this}empty(){return no(this.node),this}append(e){return Lt(this.node,ae.toNodes(e)),this}appendTo(e){return Ss(this.node,ae.isVector(e)?e.node:e),this}prepend(e){return Sy(this.node,ae.toNodes(e)),this}before(e){return Xu(this.node,ae.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(ae.toNode(e),this.node),ae.create(e)}first(){return this.node.firstChild?ae.create(this.node.firstChild):null}last(){return this.node.lastChild?ae.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?ae.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(ae.toNode(e))}find(e){const t=[],s=ID(this.node,e);if(s)for(let r=0,i=s.length;r<i;r+=1)t.push(ae.create(s[r]));return t}findOne(e){const t=LD(this.node,e);return t?ae.create(t):null}findParentByClass(e,t){const s=Cy(this.node,e,t);return s?ae.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 qu(this.node,ae.isVector(e)?e.node:e)}wrap(e){const t=ae.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=ae.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=ae.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(ae.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 Yu(this.node)}hasClass(e){return Tn(this.node,e)}addClass(e){return te(this.node,e),this}removeClass(e){return Ie(this.node,e),this}toggleClass(e,t){return yn(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 ae.create(lR(this.node))}toPathData(){return jy(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=tl(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})(ae||(ae={}));function ZD(n,e){const t=ae.create(e),s=ae.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=ae.create("path").attr("d",r).appendTo(t.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function QD(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=ae.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 Vy=/em$/;function rl(n,e){const t=parseFloat(n);return Vy.test(n)?t*e:t}function eR(n,e,t,s){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let i=e[0];const o=rl(i.maxFontSize,t)||t;let a=0;const c=rl(s,t);for(let h=1;h<r;h+=1){i=e[h];const f=rl(i.lineHeight,t)||c;a+=f}const u=rl(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 Dy(n,e,t={}){e=zD(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 _=g[0];_&&_.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&no(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=ZD(r,n)):b=document.createDocumentFragment();let w,x=0,C;const E=e.split(`
39
+ `),v=[],S=E.length-1;for(let _=0;_<=S;_+=1){w=f;let T="v-line";const A=bn("tspan");let D,L=E[_];if(L)if(u){const j=$D(L,u,{offset:-x,includeAnnotationIndices:c});D=QD(A,j,{eol:_!==S&&s,baseSize:y,lineHeight:h?null:f,includeAnnotationIndices:c});const P=D.lineHeight;P&&h&&_!==0&&(w=P),_===0&&(C=D.maxFontSize*.8)}else s&&_!==S&&(L+=s),A.textContent=L;else{A.textContent="-",T+=" v-empty-line";const j=A.style;j.fillOpacity=0,j.strokeOpacity=0,u&&(D={})}D&&v.push(D),_>0&&A.setAttribute("dy",w),(_>0||r)&&A.setAttribute("x",a),A.className.baseVal=T,b.appendChild(A),x+=L.length+1}if(o)if(u)w=eR(i,v,y,f);else if(i==="top")w="0.8em";else{let _;switch(S>0?(_=parseFloat(f)||1,_*=S,Vy.test(f)||(_/=y)):_=0,i){case"middle":w=`${.3-_/2}em`;break;case"bottom":w=`${-_-.3}em`;break}}else i===0?w="0em":i?w=i:(w=0,n.getAttribute("y")==null&&n.setAttribute("y",`${C||"0.8em"}`));b.firstChild.setAttribute("dy",w),n.appendChild(b)}function ro(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 Ry(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]||ro(a,s).width,u=n.slice(0,o+1),d=i[u]||ro(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 Iy(n,e,t={},s={}){const r=e.width,i=e.height,o=s.eol||`
40
+ `,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=el(),b=[];return n.split(o).map(w=>{const x=Iy(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}=ro(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=ro(g,t).width);for(let y=0;y<u;y+=1)if(p>r)if(y===u-1){const[w]=Ry(f,r-m,p,t);h.push(g?`${w}${g}`:w)}else{const[w,x]=Ry(f,r,p,t);h.push(w),f=x,p=ro(f,t).width}else{h.push(f);break}return h.join(o)}const ed=.551784;function ut(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 nR(n){return["M",ut(n,"x1"),ut(n,"y1"),"L",ut(n,"x2"),ut(n,"y2")].join(" ")}function sR(n){const e=il(n);return e.length===0?null:`${Ly(e)} Z`}function rR(n){const e=il(n);return e.length===0?null:Ly(e)}function Ly(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function il(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 iR(n){const e=ut(n,"cx",0),t=ut(n,"cy",0),s=ut(n,"r"),r=s*ed;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 oR(n){const e=ut(n,"cx",0),t=ut(n,"cy",0),s=ut(n,"rx"),r=ut(n,"ry")||s,i=s*ed,o=r*ed;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 aR(n){return By({x:ut(n,"x",0),y:ut(n,"y",0),width:ut(n,"width",0),height:ut(n,"height",0),rx:ut(n,"rx",0),ry:ut(n,"ry",0)})}function By(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 lR(n){const e=bn("path");fe(e,fe(n));const t=jy(n);return t&&e.setAttribute("d",t),e}function jy(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return nR(n);case"polygon":return sR(n);case"polyline":return rR(n);case"ellipse":return oR(n);case"circle":return iR(n);case"rect":return aR(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const cR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,$y=/[ ,]+/,uR=/^(\w+)\((.*)\)/;function dR(n,e){const s=bn("svg").createSVGPoint();return s.x=n,s.y=e,s}function ot(n){const t=bn("svg").createSVGMatrix();if(n!=null){const s=n,r=t;for(const i in s)r[i]=s[i]}return t}function io(n){const e=bn("svg");return n!=null?(n instanceof DOMMatrix||(n=ot(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function oo(n){let e=ot();const t=n!=null&&n.match(cR);if(!t)return e;for(let s=0,r=t.length;s<r;s+=1){const o=t[s].match(uR);if(o){let a,c,u,d,h,f=ot();const p=o[2].split($y);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 Xr(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 ol(n){let e,t,s;if(n){const i=$y;if(n.trim().indexOf("matrix")>=0){const o=oo(n),a=hR(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 td(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 hR(n){const e=td(n,{x:0,y:1}),t=td(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 pR(n){let e={x:0,y:1};n&&(e=td(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function gR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Jr(n,e,t={}){if(e==null)return oo(fe(n,"transform"));if(t.absolute){n.setAttribute("transform",Xr(e));return}const s=n.transform,r=io(e);s.baseVal.appendItem(r)}function zy(n,e,t=0,s={}){let r=fe(n,"transform");const i=ol(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 nd(n,e,t,s,r={}){let i=fe(n,"transform");const o=ol(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 sd(n,e,t){let s=fe(n,"transform");const r=ol(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 ao(n,e){if(Cs(e)&&Cs(n)){const t=e.getScreenCTM(),s=n.getScreenCTM();if(t&&s)return t.inverse().multiply(s)}return ot()}function mR(n,e){let t=ot();if(Cs(e)&&Cs(n)){let s=n;const r=[];for(;s&&s!==e;){const i=s.getAttribute("transform")||null,o=oo(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=ao(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var qt;(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})(qt||(qt={}));var ir;(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})(ir||(ir={}));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=ir.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 kn{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})(kn||(kn={})),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}(kn||(kn={})),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]))}(kn||(kn={})),function(n){qt.register("load",{noBubble:!0})}(),function(n){qt.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){qt.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}}),qt.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 bR=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},lo;(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=bR(c,["handler","selector"]);c=m,d=y,h=b}const f=ir.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=qt.get(w);w=(d?x.delegateType:x.bindType)||w,x=qt.get(w);const C=Object.assign({type:w,originType:y,data:u,selector:d,guid:g,handler:c,namespace:b.join(".")},h),E=f.events;let v=E[w];v||(v=E[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,p)===!1)&&ce.addEventListener(o,w,p)),x.add&&(ce.removeHandlerId(C.handler),x.add(o,C),ce.setHandlerId(C.handler,g)),d?(v.handlers.splice(v.delegateCount,0,C),v.delegateCount+=1):v.handlers.push(C)})}n.on=t;function s(o,a,c,u,d){const h=ir.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(E=>{s(o,E+p,c,u,!0)});return}let y=g;const b=qt.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,C=w.handlers.length;for(let E=w.handlers.length-1;E>=0;E-=1){const v=w.handlers[E];(d||g===v.originType)&&(!c||ce.getHandlerId(c)===v.guid)&&(x==null||v.namespace&&x.test(v.namespace))&&(u==null||u===v.selector||u==="**"&&v.selector)&&(w.handlers.splice(E,1),v.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,v))}C&&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&&ir.remove(o))}n.off=s;function r(o,a,...c){const u=kn.create(a);u.delegateTarget=o;const d=qt.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=qt.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 kn?o:new kn(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=qt.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 C=p,E=p.parentNode;for(;E!=null;)w.push(E),C=E,E=E.parentNode;const v=p.ownerDocument||document;if(C===v){const S=C.defaultView||C.parentWindow||window;w.push(S)}}let x=p;for(let C=0,E=w.length;C<E&&!d.isPropagationStopped();C+=1){const v=w[C];x=v,d.type=C>1?b:y.bindType||h;const S=ir.get(v);S&&S.events[d.type]&&S.handler&&S.handler.call(v,...m);const O=g&&v[g]||null;O&&ce.isValidTarget(v)&&(d.result=O.call(v,...m),d.result===!1&&d.preventDefault())}if(d.type=h,!u&&!d.isDefaultPrevented()){const C=y.preventDefault;if((C==null||C(w.pop(),d,a)===!1)&&ce.isValidTarget(p)&&g&&typeof p[h]=="function"&&!ce.isWindow(p)){const E=p[g];E&&(p[g]=null),e=h,d.isPropagationStopped()&&x.addEventListener(h,ce.stopPropagationCallback),p[h](),d.isPropagationStopped()&&x.removeEventListener(h,ce.stopPropagationCallback),e=void 0,E&&(p[g]=E)}}return d.result}n.trigger=i})(lo||(lo={}));var dt;(function(n){function e(i,o,a,c,u){return co.on(i,o,a,c,u),i}n.on=e;function t(i,o,a,c,u){return co.on(i,o,a,c,u,!0),i}n.once=t;function s(i,o,a,c){return co.off(i,o,a,c),i}n.off=s;function r(i,o,a,c){return lo.trigger(o,a,i,c),i}n.trigger=r})(dt||(dt={}));var co;(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))}lo.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),lo.off(s,r,o,i)}n.off=t})(co||(co={}));class Fy{constructor(e,t,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=vs.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 rd(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function wR(n){return n.getBoundingClientRect().width}function xR(n){return n.getBoundingClientRect().height}function Uy(n,e=60){let t=null;return(...s)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,s)},e)}}function vR(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=Uy(()=>{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=Uy(()=>{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 SR=typeof ResizeObserver<"u"?CR:vR;var al;(function(n){const e=new WeakMap;function t(r){let i=e.get(r);return i||(i=SR(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)}})(al||(al={}));class uo{constructor(e={}){this.comparator=e.comparator||uo.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})(uo||(uo={}));var id;(function(n){function e(t,s,r=(i,o)=>1){const i={},o={},a={},c=new uo;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})(id||(id={}));class es{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 es.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=es.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(Ct(i,0,255)),this.g=Math.round(Ct(o,0,255)),this.b=Math.round(Ct(a,0,255)),this.a=c==null?1:Ct(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 es.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 es.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 C=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(C){const E=C[1].split(/\s*,\s*/).map(v=>parseInt(v,10));return new n(E)}return null}n.fromRGBA=s;function r(x,C,E){E<0&&++E,E>1&&--E;const v=6*E;return v<1?x+(C-x)*v:2*E<1?C:3*E<2?x+(C-x)*(2/3-E)*6:x}function i(x){const C=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(C){const E=C[2].split(/\s*,\s*/),v=(parseFloat(E[0])%360+360)%360/360,S=parseFloat(E[1])/100,O=parseFloat(E[2])/100,_=E[3]==null?1:parseInt(E[3],10);return new n(u(v,S,O,_))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return t(x);if(x.startsWith("rgb"))return s(x);const C=n.named[x];return C?t(C):i(x)}n.fromString=o;function a(x,C){return n.fromArray([x,x,x,C])}n.makeGrey=a;function c(x,C,E,v){const S=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:C,_=Array.isArray(x)?x[2]:E,T=Array.isArray(x)?x[3]:v,A=Math.max(S,O,_),D=Math.min(S,O,_),L=(A+D)/2;let j=0,P=0;if(D!==A){const M=A-D;switch(P=L>.5?M/(2-A-D):M/(A+D),A){case S:j=(O-_)/M+(O<_?6:0);break;case O:j=(_-S)/M+2;break;case _:j=(S-O)/M+4;break}j/=6}return[j,P,L,T??1]}n.rgba2hsla=c;function u(x,C,E,v){const S=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:C,_=Array.isArray(x)?x[2]:E,T=Array.isArray(x)?x[3]:v,A=_<=.5?_*(O+1):_+O-_*O,D=2*_-A;return[r(D,A,S+1/3)*256,r(D,A,S)*256,r(D,A,S-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 h(){const x="0123456789ABCDEF";let C="#";for(let E=0;E<6;E+=1)C+=x[Math.floor(Math.random()*16)];return C}n.randomHex=h;function f(x){return d(x).toString()}n.randomRGBA=f;function p(x,C){if(typeof x=="string"){const _=x[0]==="#",[T,A,D]=g(x);return C?T*.299+A*.587+D*.114>186?"#000000":"#ffffff":`${_?"#":""}${m(255-T,255-A,255-D)}`}const E=x[0],v=x[1],S=x[2],O=x[3];return C?E*.299+v*.587+S*.114>186?[0,0,0,O]:[255,255,255,O]:[255-E,255-v,255-S,O]}n.invert=p;function g(x){const C=x.indexOf("#")===0?x:`#${x}`;let E=+`0x${C.substr(1)}`;if(!(C.length===4||C.length===7)||Number.isNaN(E))throw new Error("Invalid hex color.");const v=C.length===4?4:8,S=(1<<v)-1,O=["b","g","r"].map(()=>{const _=E&S;return E>>=v,v===4?17*_:_});return[O[2],O[1],O[0]]}function m(x,C,E){const v=S=>S.length<2?`0${S}`:S;return`${v(x.toString(16))}${v(C.toString(16))}${v(E.toString(16))}`}function y(x,C){return w(x,C)}n.lighten=y;function b(x,C){return w(x,-C)}n.darken=b;function w(x,C){if(typeof x=="string"){const S=x[0]==="#",O=parseInt(S?x.substr(1):x,16),_=Ct((O>>16)+C,0,255),T=Ct((O>>8&255)+C,0,255),A=Ct((O&255)+C,0,255);return`${S?"#":""}${(A|T<<8|_<<16).toString(16)}`}const E=m(x[0],x[1],x[2]),v=g(w(E,C));return[v[0],v[1],v[2],x[3]]}})(es||(es={})),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"}}(es||(es={}));class od{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 Es;(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})(Es||(Es={}));var or;(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}}})(or||(or={})),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)}}}(or||(or={})),function(n){function e(P){return-1*Math.cos(P*(Math.PI/2))+1}n.easeInSine=e;function t(P){return Math.sin(P*(Math.PI/2))}n.easeOutSine=t;function s(P){return-.5*(Math.cos(Math.PI*P)-1)}n.easeInOutSine=s;function r(P){return P*P}n.easeInQuad=r;function i(P){return P*(2-P)}n.easeOutQuad=i;function o(P){return P<.5?2*P*P:-1+(4-2*P)*P}n.easeInOutQuad=o;function a(P){return P*P*P}n.easeInCubic=a;function c(P){const M=P-1;return M*M*M+1}n.easeOutCubic=c;function u(P){return P<.5?4*P*P*P:(P-1)*(2*P-2)*(2*P-2)+1}n.easeInOutCubic=u;function d(P){return P*P*P*P}n.easeInQuart=d;function h(P){const M=P-1;return 1-M*M*M*M}n.easeOutQuart=h;function f(P){const M=P-1;return P<.5?8*P*P*P*P:1-8*M*M*M*M}n.easeInOutQuart=f;function p(P){return P*P*P*P*P}n.easeInQuint=p;function g(P){const M=P-1;return 1+M*M*M*M*M}n.easeOutQuint=g;function m(P){const M=P-1;return P<.5?16*P*P*P*P*P:1+16*M*M*M*M*M}n.easeInOutQuint=m;function y(P){return P===0?0:Math.pow(2,10*(P-1))}n.easeInExpo=y;function b(P){return P===1?1:-Math.pow(2,-10*P)+1}n.easeOutExpo=b;function w(P){if(P===0||P===1)return P;const M=P*2,k=M-1;return M<1?.5*Math.pow(2,10*k):.5*(-Math.pow(2,-10*k)+2)}n.easeInOutExpo=w;function x(P){const M=P/1;return-1*(Math.sqrt(1-M*P)-1)}n.easeInCirc=x;function C(P){const M=P-1;return Math.sqrt(1-M*M)}n.easeOutCirc=C;function E(P){const M=P*2,k=M-2;return M<1?-.5*(Math.sqrt(1-M*M)-1):.5*(Math.sqrt(1-k*k)+1)}n.easeInOutCirc=E;function v(P,M=1.70158){return P*P*((M+1)*P-M)}n.easeInBack=v;function S(P,M=1.70158){const k=P/1-1;return k*k*((M+1)*k+M)+1}n.easeOutBack=S;function O(P,M=1.70158){const k=P*2,$=k-2,V=M*1.525;return k<1?.5*k*k*((V+1)*k-V):.5*($*$*((V+1)*$+V)+2)}n.easeInOutBack=O;function _(P,M=.7){if(P===0||P===1)return P;const $=P/1-1,V=1-M,U=V/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*$)*Math.sin(($-U)*(2*Math.PI)/V))}n.easeInElastic=_;function T(P,M=.7){const k=1-M,$=P*2;if(P===0||P===1)return P;const V=k/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*$)*Math.sin(($-V)*(2*Math.PI)/k)+1}n.easeOutElastic=T;function A(P,M=.65){const k=1-M;if(P===0||P===1)return P;const $=P*2,V=$-1,U=k/(2*Math.PI)*Math.asin(1);return $<1?-.5*(Math.pow(2,10*V)*Math.sin((V-U)*(2*Math.PI)/k)):Math.pow(2,-10*V)*Math.sin((V-U)*(2*Math.PI)/k)*.5+1}n.easeInOutElastic=A;function D(P){const M=P/1;if(M<1/2.75)return 7.5625*M*M;if(M<2/2.75){const k=M-.5454545454545454;return 7.5625*k*k+.75}if(M<2.5/2.75){const k=M-.8181818181818182;return 7.5625*k*k+.9375}{const k=M-.9545454545454546;return 7.5625*k*k+.984375}}n.easeOutBounce=D;function L(P){return 1-D(1-P)}n.easeInBounce=L;function j(P){return P<.5?L(P*2)*.5:D(P*2-1)*.5+.5}n.easeInOutBounce=j}(or||(or={}));var ar;(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)}`}}})(ar||(ar={}));const ho=[];function Kr(n,e){const t=ho.find(s=>s.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!vs.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),ho.push({name:n,loadTimes:1,styleElement:s})}}function Zr(n){const e=ho.findIndex(t=>t.name===n);if(e>-1){const t=ho[e];if(t.loadTimes-=1,t.loadTimes>0)return;let s=t.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,ho.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 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 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})(Ce||(Ce={}));class Os{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class N extends Os{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=N.create(e,t);return this.x+=s.x,this.y+=s.y,this}update(e,t){const s=N.create(e,t);return this.x=s.x,this.y=s.y,this}translate(e,t){const s=N.create(e,t);return this.x+=s.x,this.y+=s.y,this}rotate(e,t){const s=N.rotate(this,e,t);return this.x=s.x,this.y=s.y,this}scale(e,t,s=new N){const r=N.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 N.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?N.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=N.create(e),s=this.x-t.x,r=this.y-t.y;return s*s+r*r}manhattanDistance(e){const t=N.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 N){const t=N.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 N(0,0).angleBetween(this,e)}toPolar(e){return this.update(N.toPolar(this,e)),this}changeInAngle(e,t,s=new N){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=N.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=N.create(e),r=N.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=N.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new N(this.x-e,this.y-t);const s=N.create(e);return new N(this.x-s.x,this.y-s.y)}lerp(e,t){const s=N.create(e);return new N((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=N.create(e),r=me.toRad(s.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return N.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=N.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return N.clone(this)}toJSON(){return N.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(N||(N={})),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}(N||(N={})),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(Ce.random(h,f),Ce.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,C=w*f+b*p;return new n(x+y.x,C+y.y)}n.rotateEx=d}(N||(N={}));class W extends Os{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 N(this.x,this.y)}get topLeft(){return new N(this.x,this.y)}get topCenter(){return new N(this.x+this.width/2,this.y)}get topRight(){return new N(this.x+this.width,this.y)}get center(){return new N(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new N(this.x,this.y+this.height)}get bottomCenter(){return new N(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new N(this.x+this.width,this.y+this.height)}get corner(){return new N(this.x+this.width,this.y+this.height)}get rightMiddle(){return new N(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new N(this.x,this.y+this.height/2)}get topLine(){return new K(this.topLeft,this.topRight)}get rightLine(){return new K(this.topRight,this.bottomRight)}get bottomLine(){return new K(this.bottomLeft,this.bottomRight)}get leftLine(){return new K(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 W(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=W.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=W.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=N.create(e,t);return this.x+=s.x,this.y+=s.y,this}scale(e,t,s=new N){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=N.rotateEx(o,r,i,t),a=N.rotateEx(a,r,i,t),c=N.rotateEx(c,r,i,t),u=N.rotateEx(u,r,i,t);const d=new W(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=W.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=W.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 Ce.containsPoint(this,N.create(e,t))}containsRect(e,t,s,r){const i=W.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=N.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 K(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=W.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 W(d,h,Math.min(a.x,u.x)-d,Math.min(a.y,u.y)-h)}isIntersectWithRect(e,t,s,r){const i=W.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=W.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 W(a,c,u-a,d-c)}getNearestSideToPoint(e){const t=N.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=N.clone(e);if(this.containsPoint(t)){const s=this.getNearestSideToPoint(t);if(s==="left")return new N(this.x,t.y);if(s==="top")return new N(t.x,this.y);if(s==="right")return new N(this.x+this.width,t.y);if(s==="bottom")return new N(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 W(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})(W||(W={})),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}(W||(W={})),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}(W||(W={}));class K extends Os{get center(){return new N((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 N(e,t),this.end=new N(s,r)):(this.start=N.create(e),this.end=N.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 N(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new N(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 W(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 K(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 K(this.start,t),new K(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new K(this.start,t),new K(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 K(t,e).length()>r||new K(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 N(this.end.x-this.start.x,this.end.y-this.start.y),s=new N(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*s.y-t.y*s.x,i=new N(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 N(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=N.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=N.create(e,t);return this.closestPoint(s).squaredDistance(s)}pointDistance(e,t){const s=N.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 K(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 K(t,s);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){const s=N.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 K(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})(K||(K={}));class wn extends Os{get center(){return new N(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 W.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=N.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 N(this.x,this.y)),u=new N(a.x/(s*s),a.y/(r*r)),d=new N(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=N.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 N(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=N.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 N(p,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const s=W.fromEllipse(this);s.rotate(e,t);const r=wn.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=N.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 wn(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})(wn||(wn={})),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}(wn||(wn={}));const ER=new RegExp("^[\\s\\dLMCZz,.]*$");function OR(n){return typeof n!="string"?!1:ER.test(n)}function ad(n,e){return(n%e+e)%e}function MR(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 N(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[ad(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[ad(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[ad(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 C=f*Math.min(c,g/2)/g,E=p*Math.min(c,g/2)/g,v=h.x+C,S=h.y+E;i.push("Q",h.x,h.y,v,S),h=new N(v,S)}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 Hy(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})}),MR(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ll(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 C;if(x>1)t=Math.sqrt(x)*t,s=Math.sqrt(x)*s,C=0;else{let I=1;i===o&&(I=-1),C=I*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const E=C*t*g/s,v=-1*C*s*p/t,S=h*E-f*v+a/2,O=f*E+h*v+c/2;let _=Math.atan2((g-v)/s,(p-E)/t)-Math.atan2(0,1),T=_>=0?_:2*Math.PI+_;_=Math.atan2((-g-v)/s,(-p-E)/t)-Math.atan2((g-v)/s,(p-E)/t);let A=_>=0?_:2*Math.PI+_;o===0&&A>0?A-=2*Math.PI:o!==0&&A<0&&(A+=2*Math.PI);const D=A*2/Math.PI,L=Math.ceil(D<0?-1*D:D),j=A/L,P=8/3*Math.sin(j/4)*Math.sin(j/4)/Math.sin(j/2),M=h*t,k=h*s,$=f*t,V=f*s;let U=Math.cos(T),F=Math.sin(T),q=-P*(M*F+V*U),X=-P*($*F-k*U),Q=0,se=0;const H=[];for(let I=0;I<L;I+=1){T+=j,U=Math.cos(T),F=Math.sin(T),Q=M*U-V*F+S,se=$*U+k*F+O;const re=-P*(M*F+V*U),B=-P*($*F-k*U),Z=I*6;H[Z]=Number(q+n),H[Z+1]=Number(X+e),H[Z+2]=Number(Q-re+n),H[Z+3]=Number(se-B+e),H[Z+4]=Number(Q+n),H[Z+5]=Number(se+e),q=Q+re,X=se+B}return H.map(I=>+I.toFixed(2))}function NR(n,e,t,s,r=0,i=0,o=0,a,c){const u=[],d=ll(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 Fe extends Os{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 Fe.parse(e);this.points=e.map(t=>N.create(t))}else this.points=[]}scale(e,t,s=new N){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=N.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 W;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 W(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 K(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=N.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 K(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 N(s+p,r),m=new K(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 K(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 K(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 K(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 K(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 K(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 Fe;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 E=y.angleBetween(w,p);Math.abs(E-180)<1e-10||y.equals(p)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((E+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 Fe(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 Fe(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})(Fe||(Fe={})),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}(Fe||(Fe={}));class je extends Os{constructor(e,t,s,r){super(),this.PRECISION=3,this.start=N.create(e),this.controlPoint1=N.create(t),this.controlPoint2=N.create(s),this.end=N.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,C,E,v;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*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}E=y*y-4*b*m,v=Math.sqrt(E),!(E<0)&&(x=(-y+v)/(2*m),x>0&&x<1&&p.push(x),C=(-y-v)/(2*m),C>0&&C<1&&p.push(C))}let S,O,_,T=p.length;const A=T;for(;T;)T-=1,w=p[T],_=1-w,S=_*_*_*i+3*_*_*w*a+3*_*w*w*u+w*w*w*h,g[0][T]=S,O=_*_*_*o+3*_*_*w*c+3*_*w*w*d+w*w*w*f,g[1][T]=O;p[A]=0,p[A+1]=1,g[0][A]=i,g[1][A]=o,g[0][A+1]=h,g[1][A+1]=f,p.length=A+2,g[0].length=A+2,g[1].length=A+2;const D=Math.min.apply(null,g[0]),L=Math.min.apply(null,g[1]),j=Math.max.apply(null,g[0]),P=Math.max.apply(null,g[1]);return new W(D,L,j-D,P-L)}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 E=o.divide(.5);g/=2;const v=E[0].start.distance(e),S=E[0].end.distance(e),O=v+S,_=E[1].start.distance(e),T=E[1].end.distance(e),A=_+T;O<=A?(o=E[0],c-=g,u=v,d=S):(o=E[1],a+=g,u=_,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 je(t,t,t,t),new je(t,s,r,i)];if(e>=1)return[new je(t,s,r,i),new je(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 je(t,a,c,u),new je(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 K(t,s).pointAt(e),a=new K(s,r).pointAt(e),c=new K(r,i).pointAt(e),u=new K(o,a).pointAt(e),d=new K(a,c).pointAt(e),h=new K(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 je(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 K(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],C=x.endpointDistance();if(e<=f+C){a=x,c=w*g,u=(w+1)*g,d=s?e-f:C+f-e,h=s?C+f-e:e-f;break}f+=C}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 C=a.divide(.5);g/=2;const E=C[0].endpointDistance(),v=C[1].endpointDistance();d<=E?(a=C[0],u-=g,w=d,x=E-w):(a=C[1],c+=g,w=d-E,x=v-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 Fe(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 je(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})(je||(je={})),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=>N.clone(f)),o=[],a=[],c=i.length-1;if(c===1)return o[0]=new N((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new N(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 N(d[f],h[f])),f<c-1?a.push(new N(2*i[f+1].x-d[f+1],2*i[f+1].y-h[f+1])):a.push(new N((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 N(i[0][a].x,i[0][a].y),d=new N(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,d,r[a+1]))}return o}n.throughPoints=s}(je||(je={}));class cl extends Os{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 mt extends cl{constructor(e,t){super(),K.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=N.create(e,t).round(2)}get type(){return"L"}get line(){return new K(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 mt(t[0]),new mt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new mt(t[0]),new mt(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 mt(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(K.isLine(r))return new n(r);if(N.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})(mt||(mt={}));class Qr extends cl{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 K(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 mt(t[0]):this.clone(),new mt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new mt(t[0]):this.clone(),new mt(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 Qr}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})(Qr||(Qr={}));class ei extends cl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,K.isLine(e)||je.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=N.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 ei(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(K.isLine(r))return new n(r);if(je.isCurve(r))return new n(r);if(N.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 mt(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 mt(a,c))}return i}n.create=e})(ei||(ei={}));class Xt extends cl{constructor(e,t,s,r,i,o){super(),je.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 N(e,t).round(2),this.controlPoint2=new N(s,r).round(2),this.endPoint=new N(i,o).round(2)):(this.controlPoint1=N.create(e).round(2),this.controlPoint2=N.create(t).round(2),this.endPoint=N.create(s).round(2))}get type(){return"C"}get curve(){return new je(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 Xt(s[0]),new Xt(s[1])]}divideAtLength(e,t={}){const s=this.curve.divideAtLength(e,t);return[new Xt(s[0]),new Xt(s[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new Xt(t[0]),new Xt(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 Xt(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(je.isCurve(r))return new n(r);if(N.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})(Xt||(Xt={}));function ul(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function Gy(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 Wy(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=ul(n,e,-h),n=p.x,e=p.y,p=ul(a,c,-h),a=p.x,c=p.y;const j=(n-a)/2,P=(e-c)/2;let M=j*j/(t*t)+P*P/(s*s);M>1&&(M=Math.sqrt(M),t=M*t,s=M*s);const k=t*t,$=s*s,V=(i===o?-1:1)*Math.sqrt(Math.abs((k*$-k*P*P-$*j*j)/(k*P*P+$*j*j)));y=V*t*P/s+(n+a)/2,b=V*-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,P=a,M=c;m=g+d*(o&&m>g?1:-1),a=y+t*Math.cos(m),c=b+s*Math.sin(m),f=Wy(a,c,t,s,r,0,o,P,M,[m,j,y,b])}w=m-g;const x=Math.cos(g),C=Math.sin(g),E=Math.cos(m),v=Math.sin(m),S=Math.tan(w/4),O=4/3*(t*S),_=4/3*(s*S),T=[n,e],A=[n+O*C,e-_*x],D=[a+O*v,c-_*E],L=[a,c];if(A[0]=2*T[0]-A[0],A[1]=2*T[1]-A[1],u)return[A,D,L].concat(f);{f=[A,D,L].concat(f).join().split(",");const j=[],P=f.length;for(let M=0;M<P;M+=1)j[M]=M%2?ul(+f[M-1],+f[M],h).y:ul(+f[M],+f[M+1],h).x;return j}}function PR(n){if(!n)return null;const e=`
41
+ \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 _R(n){const e=PR(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 AR(n){const e=_R(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(Wy.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(Gy(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(Gy(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 TR(n){return AR(n).map(e=>e.map(t=>typeof t=="string"?t:Ce.round(t,2))).join(",").split(",").join(" ")}class ie extends Os{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(K.isLine(e[0])||je.isCurve(e[0])){let t=null;e.forEach((r,i)=>{i===0&&this.appendSegment(ie.createSegment("M",r.start)),t!=null&&!t.end.equals(r.start)&&this.appendSegment(ie.createSegment("M",r.start)),K.isLine(r)?this.appendSegment(ie.createSegment("L",r.end)):je.isCurve(r)&&this.appendSegment(ie.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),t=r})}else e.forEach(s=>{s.isSegment&&this.appendSegment(s)});else e!=null&&(K.isLine(e)?(this.appendSegment(ie.createSegment("M",e.start)),this.appendSegment(ie.createSegment("L",e.end))):je.isCurve(e)?(this.appendSegment(ie.createSegment("M",e.start)),this.appendSegment(ie.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):Fe.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,s)=>{const r=s===0?ie.createSegment("M",t):ie.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(ei.create.call(null,...e))}lineTo(...e){return this.appendSegment(mt.create.call(null,...e))}curveTo(...e){return this.appendSegment(Xt.create.call(null,...e))}arcTo(e,t,s,r,i,o,a){const c=this.end||new N,u=typeof o=="number"?ll(c.x,c.y,e,t,s,r,i,o,a):ll(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 N,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=ie.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Qr.create())}drawPoints(e,t={}){const s=Hy(e,t),r=ie.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 W(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=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,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=Ce.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=Ce.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=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,h;for(let E=0,v=this.segments.length;E<v;E+=1){const S=s?E:v-1-E,O=this.getSegment(S),_=i[S],T={precision:r,subdivisions:_},A=O.length(T);if(O.isDifferentiable()&&(u=O,d=S,e<=o+A)){c=S,a=O.divideAtLength((s?1:-1)*(e-o),T);break}o+=A}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,ie.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(f.removeSegment(y-1),y-=1);const w=y-g-1;for(let E=y,v=f.segments.length;E<v;E+=1){const S=this.getSegment(E-w),O=f.getSegment(E);if(O.type==="Z"&&!S.subpathStartSegment.end.equals(O.subpathStartSegment.end)){const _=ie.createSegment("L",S.end);f.replaceSegment(E,_)}}const x=new ie(f.segments.slice(0,m)),C=new ie(f.segments.slice(m));return[x,C]}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 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=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,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=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 Fe(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 ie;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})(ie||(ie={})),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 ei.create.call(null,...r);if(s==="L")return mt.create.call(null,...r);if(s==="C")return Xt.create.call(null,...r);if(s==="z"||s==="Z")return Qr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=t}(ie||(ie={})),function(n){n.normalize=TR,n.isValid=OR,n.drawArc=NR,n.drawPoints=Hy,n.arcToCurves=ll}(ie||(ie={}));class Ue{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&&!vs.isApplyingHMR()&&this.onDuplicated(e);const r=this.options.process,i=r?ne(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&&ne(this.options.onConflict,this,e),new Error(`${ca(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} ${PN(this.options.type)}`:this.options.type;return`${ca(r)} with name '${e}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(e){return TD(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ue||(Ue={}));const kR=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 Ms{constructor(){this.patterns={},this.root=ae.create(tl(),{width:"100%",height:"100%"},[bn("defs")]).node}add(e,t){const s=this.root.childNodes[0];s&&s.appendChild(t),this.patterns[e]=t,ae.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=kR,n.registry=Ue.create({type:"grid"}),n.registry.register(n.presets,!0)})(Ms||(Ms={}));const Yy=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},qy=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},Xy=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},VR=Object.freeze(Object.defineProperty({__proto__:null,flipX:Yy,flipXY:Xy,flipY:qy,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 fo;(function(n){n.presets=Object.assign({},VR),n.presets["flip-x"]=Yy,n.presets["flip-y"]=qy,n.presets["flip-xy"]=Xy,n.registry=Ue.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(fo||(fo={}));function ld(n,e){return n??e}function at(n,e){return n!=null&&Number.isFinite(n)?n:e}function DR(n={}){const e=ld(n.color,"blue"),t=at(n.width,1),s=at(n.margin,2),r=at(n.opacity,1),i=s,o=s+t;return`
42
42
  <filter>
43
43
  <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>
44
44
  <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
@@ -50,7 +50,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
50
50
  <feMergeNode in="SourceGraphic"/>
51
51
  </feMerge>
52
52
  </filter>
53
- `.trim()}function DR(n={}){const e=ld(n.color,"red"),t=lt(n.blur,0),s=lt(n.width,1),r=lt(n.opacity,1);return`
53
+ `.trim()}function RR(n={}){const e=ld(n.color,"red"),t=at(n.blur,0),s=at(n.width,1),r=at(n.opacity,1);return`
54
54
  <filter>
55
55
  <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>
56
56
  <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${s}"/>
@@ -58,11 +58,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
58
58
  <feGaussianBlur result="blured" in="composed" stdDeviation="${t}"/>
59
59
  <feBlend in="SourceGraphic" in2="blured" mode="normal"/>
60
60
  </filter>
61
- `.trim()}function RR(n={}){const e=lt(n.x,2);return`
61
+ `.trim()}function IR(n={}){const e=at(n.x,2);return`
62
62
  <filter>
63
63
  <feGaussianBlur stdDeviation="${n.y!=null&&Number.isFinite(n.y)?[e,n.y]:e}"/>
64
64
  </filter>
65
- `.trim()}function IR(n={}){const e=lt(n.dx,0),t=lt(n.dy,0),s=ld(n.color,"black"),r=lt(n.blur,4),i=lt(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
65
+ `.trim()}function LR(n={}){const e=at(n.dx,0),t=at(n.dy,0),s=ld(n.color,"black"),r=at(n.blur,4),i=at(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
66
66
  <feDropShadow stdDeviation="${r}" dx="${e}" dy="${t}" flood-color="${s}" flood-opacity="${i}" />
67
67
  </filter>`.trim():`<filter>
68
68
  <feGaussianBlur in="SourceAlpha" stdDeviation="${r}" />
@@ -76,23 +76,23 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
76
76
  <feMergeNode/>
77
77
  <feMergeNode in="SourceGraphic"/>
78
78
  </feMerge>
79
- </filter>`.trim()}function LR(n={}){const e=lt(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`
79
+ </filter>`.trim()}function BR(n={}){const e=at(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`
80
80
  <filter>
81
81
  <feColorMatrix type="matrix" values="${t} ${s} ${r} 0 0 ${i} ${o} ${a} 0 0 ${c} ${s} ${u} 0 0 0 0 0 1 0"/>
82
82
  </filter>
83
- `.trim()}function BR(n={}){const e=lt(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`
83
+ `.trim()}function jR(n={}){const e=at(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`
84
84
  <filter>
85
85
  <feColorMatrix type="matrix" values="${t} ${s} ${r} 0 0 ${i} ${o} ${a} 0 0 ${c} ${u} ${d} 0 0 0 0 0 1 0"/>
86
86
  </filter>
87
- `.trim()}function jR(n={}){return`
87
+ `.trim()}function $R(n={}){return`
88
88
  <filter>
89
- <feColorMatrix type="saturate" values="${1-lt(n.amount,1)}"/>
89
+ <feColorMatrix type="saturate" values="${1-at(n.amount,1)}"/>
90
90
  </filter>
91
- `.trim()}function $R(n={}){return`
91
+ `.trim()}function zR(n={}){return`
92
92
  <filter>
93
- <feColorMatrix type="hueRotate" values="${lt(n.angle,0)}"/>
93
+ <feColorMatrix type="hueRotate" values="${at(n.angle,0)}"/>
94
94
  </filter>
95
- `.trim()}function zR(n={}){const e=lt(n.amount,1),t=1-e;return`
95
+ `.trim()}function FR(n={}){const e=at(n.amount,1),t=1-e;return`
96
96
  <filter>
97
97
  <feComponentTransfer>
98
98
  <feFuncR type="table" tableValues="${e} ${t}"/>
@@ -100,7 +100,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
100
100
  <feFuncB type="table" tableValues="${e} ${t}"/>
101
101
  </feComponentTransfer>
102
102
  </filter>
103
- `.trim()}function FR(n={}){const e=lt(n.amount,1);return`
103
+ `.trim()}function UR(n={}){const e=at(n.amount,1);return`
104
104
  <filter>
105
105
  <feComponentTransfer>
106
106
  <feFuncR type="linear" slope="${e}"/>
@@ -108,7 +108,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
108
108
  <feFuncB type="linear" slope="${e}"/>
109
109
  </feComponentTransfer>
110
110
  </filter>
111
- `.trim()}function UR(n={}){const e=lt(n.amount,1),t=.5-e/2;return`
111
+ `.trim()}function HR(n={}){const e=at(n.amount,1),t=.5-e/2;return`
112
112
  <filter>
113
113
  <feComponentTransfer>
114
114
  <feFuncR type="linear" slope="${e}" intercept="${t}"/>
@@ -116,11 +116,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
116
116
  <feFuncB type="linear" slope="${e}" intercept="${t}"/>
117
117
  </feComponentTransfer>
118
118
  </filter>
119
- `.trim()}const HR=Object.freeze(Object.defineProperty({__proto__:null,blur:RR,brightness:FR,contrast:UR,dropShadow:IR,grayScale:LR,highlight:DR,hueRotate:$R,invert:zR,outline:VR,saturate:jR,sepia:BR},Symbol.toStringTag,{value:"Module"}));var ti;(function(n){n.presets=HR,n.registry=Ge.create({type:"filter"}),n.registry.register(n.presets,!0)})(ti||(ti={}));const GR={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"},WR={},Jy={position:fl("x","width","origin")},Ky={position:fl("y","height","origin")},YR={position:fl("x","width","corner")},qR={position:fl("y","height","corner")},Zy={set:Ns("width","width")},Qy={set:Ns("height","height")},XR={set:Ns("rx","width")},JR={set:Ns("ry","height")},eb={set:(n=>{const e=Ns(n,"width"),t=Ns(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?e:t;return ie(o,this,s,r)}})("r")},KR={set(n,{refBBox:e}){let t=parseFloat(n);const s=Zn(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}}},ZR={set:Ns("cx","width")},QR={set:Ns("cy","height")},tb={set:rb({resetOffset:!0})},eI={set:rb({resetOffset:!1})},nb={set:ib({resetOffset:!0})},tI={set:ib({resetOffset:!1})},nI=eb,sI=tb,rI=nb,iI=Jy,oI=Ky,aI=Zy,lI=Qy;function fl(n,e,t){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=Zn(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 N;return c[n]=a||0,c}}function Ns(n,e){return function(t,{refBBox:s}){let r=parseFloat(t);const i=Zn(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 sb(n,e){const t="x6-shape",s=e&&e.resetOffset;return function(r,{elem:i,refBBox:o}){let a=rr(i,t);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},rr(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 rb(n){function e(s){return oe.parse(s)}const t=sb(e,n);return(s,r)=>({d:t(s,r).serialize()})}function ib(n){const e=sb(t=>new He(t),n);return(t,s)=>({points:e(t,s).serialize()})}const cI={qualify:Nn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},uI={qualify:Nn,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)})`}},ob={qualify(n,{attrs:e}){return e.textWrap==null||!Nn(e.textWrap)},set(n,{view:e,elem:t,attrs:s}){const r="x6-text",i=rr(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&&(Gu(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},d))}}Dy(t,`${n}`,a),rr(t,r,u)}}},dI={qualify:Nn,set(n,{view:e,elem:t,attrs:s,refBBox:r}){const i=n,o=i.width||0;Zn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;Zn(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=Iy(`${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="",ie(ob.set,this,c,{view:e,elem:t,attrs:s,refBBox:r,cell:e.cell})}},ni=(n,{attrs:e})=>e.text!==void 0,hI={qualify:ni},fI={qualify:ni},pI={qualify:ni},gI={qualify:ni},mI={qualify:ni},yI={qualify:ni},bI={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",s=`${n}`,r=rr(e,t);if(r==null||r!==s){rr(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)}}}},wI={offset:ab("x","width","right")},xI={offset:ab("y","height","bottom")},vI={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ab(n,e,t){return(s,{refBBox:r})=>{const i=new N;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:Zn(s)?o=r[e]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const CI={qualify:Nn,set(n,{elem:e}){Ze(e,n)}},SI={set(n,{elem:e}){e.innerHTML=`${n}`}},EI={qualify:Nn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},OI={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Ps(n,e,t){let s,r;typeof e=="object"?(s=e.x,r=e.y):(s=e,r=t);const i=oe.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 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 MI=n=>{var{size:e,width:t,height:s,offset:r,open:i}=n,o=lb(n,["size","width","height","offset","open"]);return cb({size:e,width:t,height:s,offset:r},i===!0,!0,void 0,o)},NI=n=>{var{size:e,width:t,height:s,offset:r,factor:i}=n,o=lb(n,["size","width","height","offset","factor"]);return cb({size:e,width:t,height:s,offset:r},!1,!1,i,o)};function cb(n,e,t,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,c=new oe,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=Et(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:Ps(c.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var PI=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 _I=n=>{var{size:e,width:t,height:s,offset:r}=n,i=PI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new oe;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:Ps(u.serialize(),r??-a/2)})};var AI=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 TI=n=>{var{d:e,offsetX:t,offsetY:s}=n,r=AI(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Ps(e,t,s)})};var kI=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 VI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=kI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new oe;return u.moveTo(0,0).lineTo(a,c).moveTo(0,c).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:Ps(u.serialize(),r||-a/2)})};var DI=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 RI=n=>{var{width:e,height:t,offset:s,open:r,flip:i}=n,o=DI(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 oe;return f.moveTo(0,a).lineTo(c,0),u?h.fill="none":(f.lineTo(c,a),f.close()),h.d=Ps(f.serialize(),{x:s||-c/2,y:a/2}),h};var ub=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 db=n=>{var{r:e}=n,t=ub(n,["r"]);const s=e||5;return Object.assign(Object.assign({cx:s},t),{tagName:"circle",r:s})},II=n=>{var{r:e}=n,t=ub(n,["r"]);const s=e||5,r=new oe;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},db({r:s})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Ps(r.serialize(),-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 BI=Object.freeze(Object.defineProperty({__proto__:null,async:RI,block:MI,circle:db,circlePlus:II,classic:NI,cross:VI,diamond:_I,ellipse:n=>{var{rx:e,ry:t}=n,s=LI(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:TI},Symbol.toStringTag,{value:"Module"}));var _s;(function(n){n.presets=BI,n.registry=Ge.create({type:"marker"}),n.registry.register(n.presets,!0)})(_s||(_s={})),function(n){n.normalize=Ps}(_s||(_s={}));var jI=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 cd(n){return typeof n=="string"||Nn(n)}const $I={qualify:cd,set(n,{view:e,attrs:t}){return ud("marker-start",n,e,t)}},zI={qualify:cd,set(n,{view:e,attrs:t}){return ud("marker-end",n,e,t,{transform:"rotate(180)"})}},FI={qualify:cd,set(n,{view:e,attrs:t}){return ud("marker-mid",n,e,t)}};function ud(n,e,t,s,r={}){const i=typeof e=="string"?{name:e}:e,{name:o,args:a}=i,c=jI(i,["name","args"]);let u=c;if(o&&typeof o=="string"){const h=_s.registry.get(o);if(h)u=h(Object.assign(Object.assign({},c),a));else return _s.registry.onNotFound(o)}const d=Object.assign(Object.assign(Object.assign({},UI(s,n)),r),u);return{[n]:`url(#${t.graph.defineMarker(d)})`}}function UI(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 po=(n,{view:e})=>e.cell.isEdge(),HI={qualify:po,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()}}},hb={qualify:po,set:pl("getTangentAtLength",{rotate:!0})},GI={qualify:po,set:pl("getTangentAtLength",{rotate:!1})},fb={qualify:po,set:pl("getTangentAtRatio",{rotate:!0})},WI={qualify:po,set:pl("getTangentAtRatio",{rotate:!1})},YI=hb,qI=fb;function pl(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 XI=Object.freeze(Object.defineProperty({__proto__:null,annotations:gI,atConnectionLength:YI,atConnectionLengthIgnoreGradient:GI,atConnectionLengthKeepGradient:hb,atConnectionRatio:qI,atConnectionRatioIgnoreGradient:WI,atConnectionRatioKeepGradient:fb,connection:HI,displayEmpty:yI,eol:mI,fill:cI,filter:EI,html:SI,lineHeight:hI,port:OI,ref:WR,refCx:ZR,refCy:QR,refD:sI,refDKeepOffset:eI,refDResetOffset:tb,refDx:YR,refDy:qR,refHeight:Qy,refHeight2:lI,refPoints:rI,refPointsKeepOffset:tI,refPointsResetOffset:nb,refR:nI,refRCircumscribed:KR,refRInscribed:eb,refRx:XR,refRy:JR,refWidth:Zy,refWidth2:aI,refX:Jy,refX2:iI,refY:Ky,refY2:oI,resetOffset:vI,sourceMarker:$I,stroke:uI,style:CI,targetMarker:zI,text:ob,textPath:pI,textVerticalAnchor:fI,textWrap:dI,title:bI,vertexMarker:FI,xAlign:wI,yAlign:xI},Symbol.toStringTag,{value:"Module"}));var Vn;(function(n){function e(t,s,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||ie(t.qualify,this,s,r)))}n.isValidDefinition=e})(Vn||(Vn={})),function(n){n.presets=Object.assign(Object.assign({},GR),XI),n.registry=Ge.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Vn||(Vn={}));const Kt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Kt.prefixCls}-${n}`}},pb=Kt.prefix("highlighted"),JI={highlight(n,e,t){const s=t&&t.className||pb;se(e,s)},unhighlight(n,e,t){const s=t&&t.className||pb;Le(e,s)}},gb=Kt.prefix("highlight-opacity"),KI={highlight(n,e){se(e,gb)},unhighlight(n,e){Le(e,gb)}};var Oe;(function(n){n.normalizeMarker=Ps;function e(f,p){const g=uR(f.x,f.y).matrixTransform(p);return new N(g.x,g.y)}n.transformPoint=e;function t(f,p){return new K(e(f.start,p),e(f.end,p))}n.transformLine=t;function s(f,p){let g=f instanceof He?f.points:f;return Array.isArray(g)||(g=[]),new He(g.map(m=>e(m,p)))}n.transformPolyline=s;function r(f,p){const m=bn("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),C=Math.min(y.x,b.x,w.x,x.x),E=Math.max(y.x,b.x,w.x,x.x),v=Math.min(y.y,b.y,w.y,x.y),S=Math.max(y.y,b.y,w.y,x.y);return new G(C,v,E-C,S-v)}n.transformRectangle=r;function i(f,p,g){let m;const y=f.ownerSVGElement;if(!y)return new G(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 G.create(m);const b=ao(f,g||y);return r(m,b)}n.bbox=i;function o(f,p={}){let g;if(!f.ownerSVGElement||!Cs(f)){if(Ey(f)){const{left:w,top:x,width:C,height:E}=a(f);return new G(w,x,C,E)}return new G(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 G.create(g);const w=ao(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 C=0;C<x;C+=1){const E=w[C];let v;E.childNodes.length===0?v=o(E,{target:y}):v=o(E,{target:y,recursive:!0}),g?g=g.union(v):g=v}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(Ty(b,"borderLeft"),10),g+=parseInt(Ty(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 G(p("x"),p("y"),p("width"),p("height"));case"circle":return new wn(p("cx"),p("cy"),p("r"),p("r"));case"ellipse":return new wn(p("cx"),p("cy"),p("rx"),p("ry"));case"polyline":{const g=al(f);return new He(g)}case"polygon":{const g=al(f);return g.length>1&&g.push(g[0]),new He(g)}case"path":{let g=f.getAttribute("d");return oe.isValid(g)||(g=oe.normalize(g)),oe.parse(g)}case"line":return new K(p("x1"),p("y1"),p("x2"),p("y2"))}return o(f)}n.toGeometryShape=c;function u(f,p,g,m){const y=N.create(p),b=N.create(g);m||(m=f instanceof SVGSVGElement?f:f.ownerSVGElement);const w=sd(f);f.setAttribute("transform","");const x=o(f,{target:m}).scale(w.sx,w.sy),C=io();C.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const E=io(),v=y.angleBetween(b,y.clone().translate(1,0));v&&E.setRotate(v,0,0);const S=io(),O=y.clone().move(b,x.width/2);S.setTranslate(2*y.x-O.x,2*y.y-O.y);const _=ao(f,m),T=io();T.setMatrix(S.matrix.multiply(E.matrix.multiply(C.matrix.multiply(_.scale(w.sx,w.sy))))),f.setAttribute("transform",Xr(T.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(),Tn(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(!Cs(p)){if(Ey(f)){const{left:y,top:b,width:w,height:x}=a(f);return new G(y,b,w,x)}return new G(0,0,0,0)}return c(p).bbox()||G.create()}n.getBBoxV2=h})(Oe||(Oe={}));const ZI={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},QI={highlight(n,e,t){const s=As.getHighlighterId(e,t);if(As.hasCache(s))return;t=Op({},t,ZI);const r=le.create(e);let i,o;try{i=r.toPathData()}catch{o=Oe.bbox(r.node,!0),i=By(Object.assign(Object.assign({},t),o))}const a=bn("path");if(pe(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?so(t.attrs):null)),n.isEdgeElement(e))pe(a,"d",n.getConnectionPathData());else{let d=r.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=Oe.bbox(r.node,!0));const f=o.x+o.width/2,p=o.y+o.height/2;o=Oe.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=at({a:y,b:0,c:0,d:b,e:f-y*f,f:p-b*p});d=d.multiply(w)}Jr(a,d)}se(a,Kt.prefix("highlight-stroke"));const c=n.cell,u=()=>As.removeHighlighter(s);c.on("removed",u),c.model&&c.model.on("reseted",u),n.container.appendChild(a),As.setCache(s,a)},unhighlight(n,e,t){As.removeHighlighter(As.getHighlighterId(e,t))}};var As;(function(n){function e(o,a){return Gu(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&&(qt(a),delete t[o])}n.removeHighlighter=i})(As||(As={}));const eL=Object.freeze(Object.defineProperty({__proto__:null,className:JI,opacity:KI,stroke:QI},Symbol.toStringTag,{value:"Module"}));var es;(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})(es||(es={})),function(n){n.presets=eL,n.registry=Ge.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(es||(es={}));function dd(n,e={}){return new N(mn(e.x,n.width),mn(e.y,n.height))}function hd(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const tL=(n,e)=>n.map(({x:t,y:s,angle:r})=>hd(dd(e,{x:t,y:s}),r||0)),nL=(n,e,t)=>{const s=t.start||0,r=t.step||20;return mb(n,e,s,(i,o)=>(i+.5-o/2)*r)},sL=(n,e,t)=>{const s=t.start||0,r=t.step||360/n.length;return mb(n,e,s,i=>i*r)};function mb(n,e,t,s){const r=e.getCenter(),i=e.getTopCenter(),o=e.width/e.height,a=wn.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),hd(f.round(),p,u)})}var rL=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 iL=(n,e,t)=>{const s=dd(e,t.start||e.getOrigin()),r=dd(e,t.end||e.getCorner());return go(n,s,r,t)},oL=(n,e,t)=>go(n,e.getTopLeft(),e.getBottomLeft(),t),aL=(n,e,t)=>go(n,e.getTopRight(),e.getBottomRight(),t),lL=(n,e,t)=>go(n,e.getTopLeft(),e.getTopRight(),t),cL=(n,e,t)=>go(n,e.getBottomLeft(),e.getBottomRight(),t);function go(n,e,t,s){const r=new K(e,t),i=n.length;return n.map((o,a)=>{var{strict:c}=o,u=rL(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),hd(h.round(),0,u)})}const uL=Object.freeze(Object.defineProperty({__proto__:null,absolute:tL,bottom:cL,ellipse:nL,ellipseSpread:sL,left:oL,line:iL,right:aL,top:lL},Symbol.toStringTag,{value:"Module"}));var lr;(function(n){n.presets=uL,n.registry=Ge.create({type:"port layout"}),n.registry.register(n.presets,!0)})(lr||(lr={}));const dL={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ts(n,e){const{x:t,y:s,angle:r,attrs:i}=e||{};return Op({},{angle:r,attrs:i,position:{x:t,y:s}},n,dL)}const hL=(n,e,t)=>Ts({position:e.getTopLeft()},t),fL=(n,e,t)=>Ts({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),pL=(n,e,t)=>Ts({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),gL=(n,e,t)=>Ts({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),mL=(n,e,t)=>Ts({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),yL=(n,e,t)=>yb(n,e,!1,t),bL=(n,e,t)=>yb(n,e,!0,t),wL=(n,e,t)=>bb(n,e,!1,t),xL=(n,e,t)=>bb(n,e,!0,t);function yb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=wb(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"),Ts({position:{x:Math.round(c),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":d}}},s)}function bb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=wb(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"),Ts({position:{x:Math.round(c),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":d}}},s)}function wb(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 vL=(n,e,t)=>xb(n.diff(e.getCenter()),!1,t),CL=(n,e,t)=>xb(n.diff(e.getCenter()),!0,t);function xb(n,e,t){const s=t.offset!=null?t.offset:20,r=new N(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",Ts({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":c}}},t)}const SL=Object.freeze(Object.defineProperty({__proto__:null,bottom:mL,inside:wL,insideOriented:xL,left:fL,manual:hL,outside:yL,outsideOriented:bL,radial:vL,radialOriented:CL,right:pL,top:gL},Symbol.toStringTag,{value:"Module"}));var si;(function(n){n.presets=SL,n.registry=Ge.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(si||(si={}));var EL=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 Ve{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=fd.uniqueId(),be.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return no(e),this}unmount(e=this.container){return qt(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 se(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return Le(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Ze(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&pe(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=Yu(e)+1;s=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(s+=` > ${t}`),s=this.getSelector(e.parentNode,s)}return s}prefixClassName(e){return Kt.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 ht.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 ht.on(this.container,e+this.getEventNamespace(),t,s),this}undelegateEvent(e,t,s){const r=e+this.getEventNamespace();return t==null?ht.off(this.container,r):typeof t=="string"?ht.off(this.container,r,t,s):ht.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"&&ht.on(e,i+r,s,o)}),this}removeEventListeners(e){return e!=null&&ht.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Kt.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()}}EL([be.dispose()],be.prototype,"dispose",null),function(n){function e(r,i){return i?bn(r||"g"):Wu(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 fd;(function(n){let e=0;function t(){const s=`v${e}`;return e+=1,s}n.uniqueId=t})(fd||(fd={}));class OL{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new od,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 at(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Oe.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Oe.getBBoxV2(e)),t.boundingRect.clone()}}var De;(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:ke(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:ot.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||ot.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const C=x.tagName;if(!C)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const E=y?Wu(C,y):vy(C),v=x.attrs;v&&pe(E,so(v));const S=x.style;S&&Ze(E,S);const O=x.className;O!=null&&E.setAttribute("class",Array.isArray(O)?O.join(" "):O),x.textContent&&(E.textContent=x.textContent);const _=x.selector;if(_!=null){if(p[_])throw new TypeError("Selector must be unique");p[_]=E}if(x.groupSelector){let A=x.groupSelector;Array.isArray(A)||(A=[A]),A.forEach(V=>{f[V]||(f[V]=[]),f[V].push(E)})}w.appendChild(E);const T=x.children;Array.isArray(T)&&g.push({ns:y,markup:T,parent:E})})}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?bn("g"):vy("div")}function a(u){if(t(u)){const p=le.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=le.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})(De||(De={})),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=Yu(t)+1;i=`${o}:nth-child(${c})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,s,i)}return r}n.getSelector=e}(De||(De={})),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}(De||(De={})),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}(De||(De={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:ot.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:ot.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(De||(De={}));class vb{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=ie(Vn.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=Oy.includes(c)?c:sy(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 od;return Object.keys(e).forEach(a=>{const c=e[a];if(!Nn(c))return;const{isCSSSelector:u,elems:d}=be.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=GN(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)=>Xe(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=ie(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=oo(h),p=new N(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=ie(w.position,this.view,b,u());x!=null&&(g=!0,p.translate(N.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=Oe.transformRectangle(y,f);Object.keys(c).forEach(w=>{const x=c[w],C=this.getDefinition(w);if(C!=null){const E=ie(C.offset,this.view,x,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:b});E!=null&&(m=!0,p.translate(N.create(E)))}})}}(d!=null||g||m)&&(p.round(1),f.e=p.x,f.f=p.y,e.setAttribute("transform",Xr(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(C=>C.refNode===h);x>-1?a.splice(x,0,w):a.push(w)}});const c=new od;let u;a.forEach(d=>{const h=d.node,f=d.refNode;let p;const g=f!=null&&s.rotatableNode!=null&&qu(s.rotatableNode,f);if(f&&(p=c.get(f)),!p){const b=g?s.rotatableNode:e;p=f?Oe.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=oo(pe(s.rotatableNode,"transform"))),y=Oe.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 ML=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},NL=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 We extends be{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,d)=>d!=null?Tp([...Array.isArray(u)?u:[u],...Array.isArray(d)?d:[d]]):Array.isArray(u)?[...u]:[u],s=ke(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=e,c=NL(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)),Xe(s,c)}get[Symbol.toStringTag](){return We.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new vb(this),this.flag=new Cb(this,this.options.actions,this.options.bootstrap),this.cache=new OL(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=De.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=ie(t,this.graph,this)),typeof t=="object"){let s=t[e];return typeof s=="function"&&(s=ie(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 Oe.transformRectangle(t,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return Oe.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 at().translate(t.x,t.y)}getRootRotatedMatrix(){let e=at();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 G),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=Qe.isToolsView(e)?e:new Qe(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)}}We.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},ML([We.dispose()],We.prototype,"dispose",null),function(n){n.Flag=Cb,n.Attr=vb}(We||(We={})),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}(We||(We={})),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}(We||(We={})),function(n){n.registry=Ge.create({type:"view"})}(We||(We={}));class Qe extends be{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Qe.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 se(s,this.prefixClassName("cell-tools")),t.className&&se(s,t.className),s}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!We.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(se(this.svgContainer,this.prefixClassName("edge-tools")),se(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(se(this.svgContainer,this.prefixClassName("node-tools")),se(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=>{Qe.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(Qe.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=ii.registry.get(a);if(u)o=new u(c);else return ii.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=oi.registry.get(a);if(u)o=new u(c);else return oi.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),qt(this.svgContainer),qt(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})(Qe||(Qe={})),function(n){class e extends be{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return Xe(ke(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),se(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&se(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()?se(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&se(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=De.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?$u(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Bu(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={}))}(Qe||(Qe={}));const PL=n=>n;function Sb(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Eb(n){return(t,s,r,i)=>s.isEdgeElement(r)?AL(n,t,s,r,i):_L(n,t,s,r,i)}function _L(n,e,t,s,r){const i=t.cell,o=i.getAngle(),a=t.getUnrotatedBBoxOfElement(s),c=i.getBBox().getCenter(),u=N.create(r).rotate(o,c);let d=u.x-a.x,h=u.y-a.y;return n&&(d=Sb(d,a.width),h=Sb(h,a.height)),e.anchor={name:"topLeft",args:{dx:d,dy:h,rotate:!0}},e}function AL(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 TL=Eb(!0),kL=Eb(!1),VL=Object.freeze(Object.defineProperty({__proto__:null,noop:PL,pinAbsolute:kL,pinRelative:TL},Symbol.toStringTag,{value:"Module"}));var pd;(function(n){n.presets=VL,n.registry=Ge.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(pd||(pd={}));function Ob(n,e,t,s){return ie(pd.presets.pinRelative,this.graph,{},e,t,n,this.cell,s,{}).anchor}function Mb(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class ks extends Qe.ToolItem{onRender(){se(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();Jr(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=Mb(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=mn(s,c.width),r=mn(r,c.height);let f=at().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=mn(r,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,c=o.vector().vectorAngle(new N(1,0))||0):(a=e.getConnection().start,c=0);let d=at().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"&&ie(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"}})})(ks||(ks={})),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})}})}(ks||(ks={}));var DL=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 gl extends Qe.ToolItem{onRender(){if(se(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,s=DL(e,["class"]);pe(this.container,so(s)),t&&se(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:s,rotate:r}=t,i=xs(t.padding);let o=Mb(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();nd(this.container,c,u.x,u.y,{absolute:!0})}else o=o.bbox(c)}return pe(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"}})})(gl||(gl={}));class mo extends Qe.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:N.create(r),next:N.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?Es.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})(mo||(mo={})),function(n){const e=Kt.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"}})}(mo||(mo={}));class yo extends Qe.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){se(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=ke(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 O=u.sourceAnchor.clone();O[a]=f[a];const _=ie(o,i,O,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",_)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const C=i.targetView,E=i.targetBBox;let v=!1,S=!1;if(m?c===p.length-2?E.containsPoint(m)?(p.pop(),v=!0):(m[a]=f[a],S=!0):m[a]=f[a]:(m=i.targetAnchor.toJSON(),m[a]=f[a],E.containsPoint(m)?v=!0:(p.push(m),S=!0)),typeof o=="function"&&C){if(v){const O=u.targetAnchor.clone();O[a]=f[a];const _=ie(o,i,O,C,i.targetMagnet||C.container,"target",i,this);this.resetAnchor("target",_)}S&&this.resetAnchor("target",u.targetAnchorDef)}N.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:ke(this.cell.prop(["source","anchor"])),targetAnchorDef:ke(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 K(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 N(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 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 N(s,r))||new N(s,r);let c=at().translate(a.x,a.y);if(a.equals({x:s,y:r}))c=c.rotate(i);else{let d=new K(s,r,a.x,a.y).vector().vectorAngle(new N(1,0));d!==0&&(d+=90),c=c.rotate(d)}this.setAttrs({transform:Xr(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})(yo||(yo={})),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:Ob})}(yo||(yo={}));class ml extends Qe.ToolItem{get type(){return this.options.type}onRender(){se(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),pe(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=ie(u,s,c,r,a,t,s,this);c=N.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=ie(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:Ob,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}})})(ml||(ml={}));const RL=ml.define({name:"source-anchor",type:"source"}),IL=ml.define({name:"target-anchor",type:"target"});var LL=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 yl extends Qe.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=LL(e,["class"]);this.setAttrs(s,this.container),t&&se(this.container,t)}}onRender(){se(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 N(1,0))||0;if(!r)return this;const o=at().translate(r.x,r.y).rotate(i);return Jr(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"}})})(yl||(yl={}));const BL=yl.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"}}),jL=yl.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 ri extends Qe.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=Qe.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=N.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=mn(a,p.width),c=mn(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=N.create(),r=20;const{style:i}=t,o=this.event.target,a=o.parentElement;if(a&&Tn(a,this.prefixClassName("edge-label"))){const d=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(d,10);const h=a.getAttribute("transform"),{translation:f}=ll(h);s=new N(f.tx,f.ty),r=Oe.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=e.clientToLocal(N.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 ie(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"){ie(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:{}};Wr(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"}})})(ri||(ri={})),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"})}(ri||(ri={}));var Nb=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},ii;(function(n){n.presets={boundary:gl,button:ks,"button-remove":ks.Remove,"node-editor":ri.NodeEditor},n.registry=Ge.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let s=Qe.ToolItem;const{inherit:r}=t,i=Nb(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)})(ii||(ii={}));var oi;(function(n){n.presets={boundary:gl,vertices:mo,segments:yo,button:ks,"button-remove":ks.Remove,"source-anchor":RL,"target-anchor":IL,"source-arrowhead":BL,"target-arrowhead":jL,"edge-editor":ri.EdgeEditor},n.registry=Ge.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let s=Qe.ToolItem;const{inherit:r}=t,i=Nb(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)})(oi||(oi={}));const $L=ts("center"),zL=ts("topCenter"),FL=ts("bottomCenter"),UL=ts("leftMiddle"),HL=ts("rightMiddle"),GL=ts("topLeft"),WL=ts("topRight"),YL=ts("bottomLeft"),qL=ts("bottomRight");function ts(n){return function(e,t,s,r={}){const i=r.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=i[n];o.x+=mn(r.dx,i.width),o.y+=mn(r.dy,i.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function bl(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=Pb(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new N;return n.call(this,e,t,o,r)}return n.apply(this,arguments)}}function Pb(n,e){const t=Zn(e),s=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const XL=bl(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}),JL=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},KL=bl(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}),ZL=Object.freeze(Object.defineProperty({__proto__:null,bottom:FL,bottomLeft:YL,bottomRight:qL,center:$L,left:UL,midSide:KL,nodeCenter:JL,orth:XL,right:HL,top:zL,topLeft:GL,topRight:WL},Symbol.toStringTag,{value:"Module"}));var ai;(function(n){n.presets=ZL,n.registry=Ge.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(ai||(ai={}));const QL=function(n,e,t,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},eB=function(n,e,t,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},_b=function(n,e,t,s){const r=n.getClosestPoint(t);return r??new N},tB=bl(_b),nB=bl(function(n,e,t,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new K(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),c=new K(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?Pb(n,s.fallbackAt):ie(_b,this,n,e,t,s)}),sB=Object.freeze(Object.defineProperty({__proto__:null,closest:tB,length:eB,orth:nB,ratio:QL},Symbol.toStringTag,{value:"Module"}));var li;(function(n){n.presets=sB,n.registry=Ge.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(li||(li={}));function wl(n,e,t){let s;if(typeof t=="object"){if(Number.isFinite(t.y)){const i=new K(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 xl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function rB(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 Ab=function(n,e,t,s){const r=e.getBBoxOfElement(t);s.stroked&&r.inflate(xl(t)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return wl(o,n.start,s.offset)},iB=function(n,e,t,s,r){const i=e.cell,o=i.isNode()?i.getAngle():0;if(o===0)return ie(Ab,this,n,e,t,s,r);const a=e.getUnrotatedBBoxOfElement(t);s.stroked&&a.inflate(xl(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 wl(h,n.start,s.offset)},oB=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=ju(t,a):r=rB(t),!Cs(r)){if(r===t||!Cs(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=Oe.transformLine(n,p),m=g.start.clone(),y=e.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=c.bbox());const C=y.shapeBBox;if(C!=null&&C.containsPoint(m))return o}s.extrapolate===!0&&g.setLength(1e6);let b;if(oe.isPath(c)){const C=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:C})),b={precision:C,segmentSubdivisions:y.segmentSubdivisions},i=g.intersect(c,b)}else i=g.intersect(c);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(G.isRectangle(c)?i=c.getNearestPointToPoint(m):wn.isEllipse(c)?i=c.intersectsWithLineFromCenterToPoint(m):i=c.closestPoint(m,b));const w=i?Oe.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+=xl(r)/2):x+=xl(r)/2),wl(w,n.start,x)};function aB(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 lB=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,s){const{alignOffset:r,align:i}=s;return i&&aB(n,i,r),wl(n.end,n.start,s.offset)},bbox:Ab,boundary:oB,rect:iB},Symbol.toStringTag,{value:"Module"}));var ci;(function(n){n.presets=lB,n.registry=Ge.create({type:"connection point"}),n.registry.register(n.presets,!0)})(ci||(ci={}));const cB=function(n){return[...n]},uB=function(n,e,t){const s=e.side||"bottom",r=xs(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 vl(n){return new G(n.x,n.y,0,0)}function Cl(n={}){const e=xs(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Tb(n,e={}){return n.sourceBBox.clone().moveAndExpand(Cl(e))}function kb(n,e={}){return n.targetBBox.clone().moveAndExpand(Cl(e))}function dB(n,e={}){return n.sourceAnchor?n.sourceAnchor:Tb(n,e).getCenter()}function hB(n,e={}){return n.targetAnchor?n.targetAnchor:kb(n,e).getCenter()}const Vb=function(n,e,t){let s=Tb(t,e),r=kb(t,e);const i=dB(t,e),o=hB(t,e);s=s.union(vl(i)),r=r.union(vl(o));const a=n.map(d=>N.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=Zt.getBearing(p,g)!=null;if(d===0)d+1===h?s.intersectsWithRect(r.clone().inflate(1))?f=Zt.insideNode(p,g,s,r):m||(f=Zt.nodeToNode(p,g,s,r)):s.containsPoint(g)?f=Zt.insideNode(p,g,s,vl(g).moveAndExpand(Cl(e))):m||(f=Zt.nodeToVertex(p,g,s));else if(d+1===h){const y=m&&Zt.getBearing(g,p)===c;r.containsPoint(p)||y?f=Zt.insideNode(p,g,vl(p).moveAndExpand(Cl(e)),r,c):m||(f=Zt.vertexToNode(p,g,r,c))}else m||(f=Zt.vertexToVertex(p,g,c));f?(u.push(...f.points),c=f.direction):c=Zt.getBearing(p,g),d+1<h&&u.push(g)}return u};var Zt;(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 N(h.x,f.y);return p.containsPoint(g)&&(g=new N(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 N(h.x,f.y),m=new N(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 N(h.x,f.y),new N(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=pN(m,y)[0];const x=N.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=N.create(h).move(b,-r(p,i(h,b))/2),x=N.create(f).move(y,-r(g,i(f,y))/2),C=new K(w,x).getCenter(),E=a(h,C,p),v=o(C,f,E.direction);m.points=[E.points[0],v.points[0]],m.direction=v.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,C=w?h:f;let E,v,S;m?(E=N.fromPolar(y.width+y.height,t[m],x),E=y.getNearestPointToPoint(E).move(E,-1)):E=y.getNearestPointToPoint(x).move(x,1),v=s(E,C,y);let O;E.round().equals(v.round())?(v=N.fromPolar(y.width+y.height,ye.toRad(E.theta(x))+Math.PI/2,C),v=y.getNearestPointToPoint(v).move(C,1).round(),S=s(E,v,y),O=w?[v,S,E]:[E,S,v]):O=w?[v,E]:[E,v];const _=i(w?E:v,f);return{points:O,direction:_}}n.insideNode=d})(Zt||(Zt={}));const fB={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 Vs(this.step,this)},directions(){const n=Vs(this.step,this),e=Vs(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=Vs(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Vs(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Vb,draggingRouter:null,snapToGrid:!0};function Vs(n,e){return typeof n=="function"?n.call(e):n}function pB(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]=Vs(n[s],n),t},{});if(e.padding){const t=xs(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 N(0,0),r=new N(t.offsetX,t.offsetY);t.angle=ye.normalize(s.theta(r))}),e}const Db=1,Rb=2;class gB{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Db,this.values[e]=t;const s=WN(this.items,e,r=>this.values[r]);this.items.splice(s,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Rb),e}isOpen(e){return this.hash[e]===Db}isClose(e){return this.hash[e]===Rb}isEmpty(){return this.items.length===0}}class mB{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=Ap(i,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(i=Ap(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 C=b.y;C<=w.y;C+=c){const E=new N(x,C).toString();u[E]==null&&(u[E]=[]),u[E].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 Ib(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Lb(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Bb(n,e){return n.sourceAnchor?n.sourceAnchor:Ib(n,e).getCenter()}function yB(n,e){return n.targetAnchor?n.targetAnchor:Lb(n,e).getCenter()}function gd(n,e,t,s,r){const i=360/t,o=n.theta(bB(n,e,s,r)),a=ye.normalize(o+i/2);return i*Math.floor(a/i)}function bB(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 N(n.x+u,n.y+d)}function jb(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function wB(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 xB(n,e,t){return{source:e.clone(),x:$b(t.x-e.x,n),y:$b(t.y-e.y,n)}}function $b(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 vB(n,e){const t=e.source,s=Se.snapToGrid(n.x-t.x,e.x)+t.x,r=Se.snapToGrid(n.y-t.y,e.y)+t.y;return new N(s,r)}function bo(n,e){return n.round(e)}function Sl(n,e,t){return bo(vB(n.clone(),e),t)}function wo(n){return n.toString()}function md(n){return new N(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function zb(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 Fb(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 N(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new K(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=Sl(y,s,i);e.containsPoint(b)&&(b=Sl(b.translate(h.x*s.x,h.y*s.y),s,i)),u.push(b)}}return u},[]);return e.containsPoint(n)||c.push(Sl(n,s,i)),c}function CB(n,e,t,s,r){const i=[];let o=md(r.diff(t)),a=wo(t),c=n[a],u;for(;c;){u=e[a];const f=md(u.diff(c));f.equals(o)||(i.unshift(u),o=f),a=wo(c),c=n[a]}const d=e[a];return md(d.diff(s)).equals(o)||i.unshift(d),i}function SB(n,e,t,s,r){const i=r.precision;let o,a;G.isRectangle(e)?o=bo(Bb(n,r).clone(),i):o=bo(e.clone(),i),G.isRectangle(t)?a=bo(yB(n,r).clone(),i):a=bo(t.clone(),i);const c=xB(r.step,o,a),u=o,d=a;let h,f;if(G.isRectangle(e)?h=Fb(u,e,r.startDirections,c,r):h=[u],G.isRectangle(t)?f=Fb(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 gB,g={},m={},y={};for(let T=0,A=h.length;T<A;T+=1){const V=h[T],L=wo(V);p.add(L,zb(V,f)),g[L]=V,y[L]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,C;const E=wB(c,r),v=E.length,S=f.reduce((T,A)=>{const V=wo(A);return T.push(V),T},[]),O=N.equalPoints(h,f);let _=r.maxLoopCount;for(;!p.isEmpty()&&_>0;){const T=p.pop(),A=g[T],V=m[T],L=y[T],B=A.equals(u),P=V==null;let M;if(P?w?B?M=null:M=gd(u,A,v,c,r):M=b:M=gd(V,A,v,c,r),!(P&&O)&&S.indexOf(T)>=0)return r.previousDirectionAngle=M,CB(m,g,A,u,d);for(let j=0;j<v;j+=1){x=E[j];const W=x.angle;if(C=jb(M,W),!(w&&B)&&C>r.maxDirectionChange)continue;const Z=Sl(A.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),c,i),$=wo(Z);if(p.isClose($)||!s.isAccessible(Z))continue;if(S.indexOf($)>=0&&!Z.equals(d)){const F=gd(Z,d,v,c,r);if(jb(W,F)>r.maxDirectionChange)continue}const D=x.cost,U=B?0:r.penalties[C],ne=L+D+U;(!p.isOpen($)||ne<y[$])&&(g[$]=Z,m[$]=A,y[$]=ne,p.add($,ne+zb(Z,f)))}_-=1}}return r.fallbackRoute?ie(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 OB=function(n,e,t){const s=pB(e),r=Ib(t,s),i=Lb(t,s),o=Bb(t,s),a=new mB(s).build(t.graph.model,t.cell),c=n.map(p=>N.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,C=f.getOrigin();m=ie(s.draggingRouter,t,x,C,s)}}if(m==null&&(m=SB(t,h,f,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),ie(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},Ub=function(n,e,t){return ie(OB,this,n,Object.assign(Object.assign({},fB),e),t)},MB={maxDirectionChange:45,directions(){const n=Vs(this.step,this),e=Vs(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 K(n,a),u=90*Math.ceil(s/90),d=N.fromPolar(c.squaredLength(),ye.toRad(u+135),a),h=new K(e,d),f=c.intersectsWithLine(h),p=f||e,g=f?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}},NB=function(n,e,t){return ie(Ub,this,n,Object.assign(Object.assign({},MB),e),t)},PB=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,C=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-C)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,d.x+C))}else{const b=m.y,w=y.y,x=a.height/2+r,C=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-C)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,d.y+C))}return[m.toJSON(),...n,y.toJSON()]};function ui(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const s=N.create(n[1]).move(n[2],t),r=N.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 _B=Object.freeze(Object.defineProperty({__proto__:null,er:PB,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=ye.toRad(b),x=Math.sin(w),C=Math.cos(w),E=new N(a.x+C*s,a.y+x*s),v=new N(E.x-C*i,E.y-x*i),S=v.clone().rotate(-90,E),O=v.clone().rotate(90,E);return[S.toJSON(),E.toJSON(),O.toJSON()]},f=b=>{const w=a.clone().move(b,-1),x=new K(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},p=[0,90,180,270,45,135,225,315];if(typeof o=="number")return ui(h(o),e.merge);const g=u.getCenter();if(g.equals(a))return ui(h(0),e.merge);const m=g.angleBetween(a,g.clone().translate(1,0));let y=h(m);if(f(y[1]))return ui(y,e.merge);for(let b=1,w=p.length;b<w;b+=1)if(y=h(m+p[b]),f(y[1]))return ui(y,e.merge);return ui(y,e.merge)}{const h=new K(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 K(y.start,p),w=new K(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 K(a,c),C=new K(p,x.center).setLength(Number.MAX_SAFE_INTEGER),E=u.intersectsWithLine(C),v=d.intersectsWithLine(C),S=E?Array.isArray(E)?E:[E]:[];v&&(Array.isArray(v)?S.push(...v):S.push(v));const O=x.center.closest(S);O?(t.sourceAnchor=O.clone(),t.targetAnchor=O.clone()):(t.sourceAnchor=x.center.clone(),t.targetAnchor=x.center.clone())}return ui([g.toJSON(),p.toJSON(),m.toJSON()],e.merge)}},manhattan:Ub,metro:NB,normal:cB,oneSide:uB,orth:Vb},Symbol.toStringTag,{value:"Module"}));var Ds;(function(n){n.presets=_B,n.registry=Ge.create({type:"router"}),n.registry.register(n.presets,!0)})(Ds||(Ds={}));const AB=function(n,e,t,s={}){const r=[n,...t,e],i=new He(r),o=new oe(i);return s.raw?o:o.serialize()},TB=function(n,e,t,s={}){const r=t.length===3?0:1,i=N.create(t[0+r]),o=N.create(t[2+r]),a=N.create(t[1+r]);if(!N.equals(n,e)){const u=new N((n.x+e.x)/2,(n.y+e.y)/2),d=u.angleBetween(N.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=`
119
+ `.trim()}const GR=Object.freeze(Object.defineProperty({__proto__:null,blur:IR,brightness:UR,contrast:HR,dropShadow:LR,grayScale:BR,highlight:RR,hueRotate:zR,invert:FR,outline:DR,saturate:$R,sepia:jR},Symbol.toStringTag,{value:"Module"}));var ti;(function(n){n.presets=GR,n.registry=Ue.create({type:"filter"}),n.registry.register(n.presets,!0)})(ti||(ti={}));const WR={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"},YR={},Jy={position:dl("x","width","origin")},Ky={position:dl("y","height","origin")},qR={position:dl("x","width","corner")},XR={position:dl("y","height","corner")},Zy={set:Ns("width","width")},Qy={set:Ns("height","height")},JR={set:Ns("rx","width")},KR={set:Ns("ry","height")},eb={set:(n=>{const e=Ns(n,"width"),t=Ns(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?e:t;return ne(o,this,s,r)}})("r")},ZR={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}}},QR={set:Ns("cx","width")},eI={set:Ns("cy","height")},tb={set:rb({resetOffset:!0})},tI={set:rb({resetOffset:!1})},nb={set:ib({resetOffset:!0})},nI={set:ib({resetOffset:!1})},sI=eb,rI=tb,iI=nb,oI=Jy,aI=Ky,lI=Zy,cI=Qy;function dl(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 N;return c[n]=a||0,c}}function Ns(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 sb(n,e){const t="x6-shape",s=e&&e.resetOffset;return function(r,{elem:i,refBBox:o}){let a=rr(i,t);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},rr(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 rb(n){function e(s){return ie.parse(s)}const t=sb(e,n);return(s,r)=>({d:t(s,r).serialize()})}function ib(n){const e=sb(t=>new Fe(t),n);return(t,s)=>({points:e(t,s).serialize()})}const uI={qualify:Nn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},dI={qualify:Nn,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)})`}},ob={qualify(n,{attrs:e}){return e.textWrap==null||!Nn(e.textWrap)},set(n,{view:e,elem:t,attrs:s}){const r="x6-text",i=rr(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&&(Gu(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},d))}}Dy(t,`${n}`,a),rr(t,r,u)}}},hI={qualify:Nn,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=Iy(`${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="",ne(ob.set,this,c,{view:e,elem:t,attrs:s,refBBox:r,cell:e.cell})}},ni=(n,{attrs:e})=>e.text!==void 0,fI={qualify:ni},pI={qualify:ni},gI={qualify:ni},mI={qualify:ni},yI={qualify:ni},bI={qualify:ni},wI={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",s=`${n}`,r=rr(e,t);if(r==null||r!==s){rr(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)}}}},xI={offset:ab("x","width","right")},vI={offset:ab("y","height","bottom")},CI={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ab(n,e,t){return(s,{refBBox:r})=>{const i=new N;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 SI={qualify:Nn,set(n,{elem:e}){Ke(e,n)}},EI={set(n,{elem:e}){e.innerHTML=`${n}`}},OI={qualify:Nn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},MI={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Ps(n,e,t){let s,r;typeof e=="object"?(s=e.x,r=e.y):(s=e,r=t);const i=ie.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 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 NI=n=>{var{size:e,width:t,height:s,offset:r,open:i}=n,o=lb(n,["size","width","height","offset","open"]);return cb({size:e,width:t,height:s,offset:r},i===!0,!0,void 0,o)},PI=n=>{var{size:e,width:t,height:s,offset:r,factor:i}=n,o=lb(n,["size","width","height","offset","factor"]);return cb({size:e,width:t,height:s,offset:r},!1,!1,i,o)};function cb(n,e,t,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,c=new ie,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=Ct(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:Ps(c.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var _I=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{size:e,width:t,height:s,offset:r}=n,i=_I(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new ie;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:Ps(u.serialize(),r??-a/2)})};var TI=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 kI=n=>{var{d:e,offsetX:t,offsetY:s}=n,r=TI(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Ps(e,t,s)})};var VI=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{size:e,width:t,height:s,offset:r}=n,i=VI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new ie;return u.moveTo(0,0).lineTo(a,c).moveTo(0,c).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:Ps(u.serialize(),r||-a/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{width:e,height:t,offset:s,open:r,flip:i}=n,o=RI(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 ie;return f.moveTo(0,a).lineTo(c,0),u?h.fill="none":(f.lineTo(c,a),f.close()),h.d=Ps(f.serialize(),{x:s||-c/2,y:a/2}),h};var ub=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 db=n=>{var{r:e}=n,t=ub(n,["r"]);const s=e||5;return Object.assign(Object.assign({cx:s},t),{tagName:"circle",r:s})},LI=n=>{var{r:e}=n,t=ub(n,["r"]);const s=e||5,r=new ie;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},db({r:s})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Ps(r.serialize(),-s)})]}};var BI=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 jI=Object.freeze(Object.defineProperty({__proto__:null,async:II,block:NI,circle:db,circlePlus:LI,classic:PI,cross:DI,diamond:AI,ellipse:n=>{var{rx:e,ry:t}=n,s=BI(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:kI},Symbol.toStringTag,{value:"Module"}));var _s;(function(n){n.presets=jI,n.registry=Ue.create({type:"marker"}),n.registry.register(n.presets,!0)})(_s||(_s={})),function(n){n.normalize=Ps}(_s||(_s={}));var $I=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 cd(n){return typeof n=="string"||Nn(n)}const zI={qualify:cd,set(n,{view:e,attrs:t}){return ud("marker-start",n,e,t)}},FI={qualify:cd,set(n,{view:e,attrs:t}){return ud("marker-end",n,e,t,{transform:"rotate(180)"})}},UI={qualify:cd,set(n,{view:e,attrs:t}){return ud("marker-mid",n,e,t)}};function ud(n,e,t,s,r={}){const i=typeof e=="string"?{name:e}:e,{name:o,args:a}=i,c=$I(i,["name","args"]);let u=c;if(o&&typeof o=="string"){const h=_s.registry.get(o);if(h)u=h(Object.assign(Object.assign({},c),a));else return _s.registry.onNotFound(o)}const d=Object.assign(Object.assign(Object.assign({},HI(s,n)),r),u);return{[n]:`url(#${t.graph.defineMarker(d)})`}}function HI(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 po=(n,{view:e})=>e.cell.isEdge(),GI={qualify:po,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()}}},hb={qualify:po,set:hl("getTangentAtLength",{rotate:!0})},WI={qualify:po,set:hl("getTangentAtLength",{rotate:!1})},fb={qualify:po,set:hl("getTangentAtRatio",{rotate:!0})},YI={qualify:po,set:hl("getTangentAtRatio",{rotate:!1})},qI=hb,XI=fb;function hl(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 JI=Object.freeze(Object.defineProperty({__proto__:null,annotations:mI,atConnectionLength:qI,atConnectionLengthIgnoreGradient:WI,atConnectionLengthKeepGradient:hb,atConnectionRatio:XI,atConnectionRatioIgnoreGradient:YI,atConnectionRatioKeepGradient:fb,connection:GI,displayEmpty:bI,eol:yI,fill:uI,filter:OI,html:EI,lineHeight:fI,port:MI,ref:YR,refCx:QR,refCy:eI,refD:rI,refDKeepOffset:tI,refDResetOffset:tb,refDx:qR,refDy:XR,refHeight:Qy,refHeight2:cI,refPoints:iI,refPointsKeepOffset:nI,refPointsResetOffset:nb,refR:sI,refRCircumscribed:ZR,refRInscribed:eb,refRx:JR,refRy:KR,refWidth:Zy,refWidth2:lI,refX:Jy,refX2:oI,refY:Ky,refY2:aI,resetOffset:CI,sourceMarker:zI,stroke:dI,style:SI,targetMarker:FI,text:ob,textPath:gI,textVerticalAnchor:pI,textWrap:hI,title:wI,vertexMarker:UI,xAlign:xI,yAlign:vI},Symbol.toStringTag,{value:"Module"}));var Vn;(function(n){function e(t,s,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||ne(t.qualify,this,s,r)))}n.isValidDefinition=e})(Vn||(Vn={})),function(n){n.presets=Object.assign(Object.assign({},WR),JI),n.registry=Ue.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Vn||(Vn={}));const Jt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Jt.prefixCls}-${n}`}},pb=Jt.prefix("highlighted"),KI={highlight(n,e,t){const s=t&&t.className||pb;te(e,s)},unhighlight(n,e,t){const s=t&&t.className||pb;Ie(e,s)}},gb=Jt.prefix("highlight-opacity"),ZI={highlight(n,e){te(e,gb)},unhighlight(n,e){Ie(e,gb)}};var Ee;(function(n){n.normalizeMarker=Ps;function e(f,p){const g=dR(f.x,f.y).matrixTransform(p);return new N(g.x,g.y)}n.transformPoint=e;function t(f,p){return new K(e(f.start,p),e(f.end,p))}n.transformLine=t;function s(f,p){let g=f instanceof Fe?f.points:f;return Array.isArray(g)||(g=[]),new Fe(g.map(m=>e(m,p)))}n.transformPolyline=s;function r(f,p){const m=bn("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),C=Math.min(y.x,b.x,w.x,x.x),E=Math.max(y.x,b.x,w.x,x.x),v=Math.min(y.y,b.y,w.y,x.y),S=Math.max(y.y,b.y,w.y,x.y);return new W(C,v,E-C,S-v)}n.transformRectangle=r;function i(f,p,g){let m;const y=f.ownerSVGElement;if(!y)return new W(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 W.create(m);const b=ao(f,g||y);return r(m,b)}n.bbox=i;function o(f,p={}){let g;if(!f.ownerSVGElement||!Cs(f)){if(Ey(f)){const{left:w,top:x,width:C,height:E}=a(f);return new W(w,x,C,E)}return new W(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 W.create(g);const w=ao(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 C=0;C<x;C+=1){const E=w[C];let v;E.childNodes.length===0?v=o(E,{target:y}):v=o(E,{target:y,recursive:!0}),g?g=g.union(v):g=v}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(Ty(b,"borderLeft"),10),g+=parseInt(Ty(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 W(p("x"),p("y"),p("width"),p("height"));case"circle":return new wn(p("cx"),p("cy"),p("r"),p("r"));case"ellipse":return new wn(p("cx"),p("cy"),p("rx"),p("ry"));case"polyline":{const g=il(f);return new Fe(g)}case"polygon":{const g=il(f);return g.length>1&&g.push(g[0]),new Fe(g)}case"path":{let g=f.getAttribute("d");return ie.isValid(g)||(g=ie.normalize(g)),ie.parse(g)}case"line":return new K(p("x1"),p("y1"),p("x2"),p("y2"))}return o(f)}n.toGeometryShape=c;function u(f,p,g,m){const y=N.create(p),b=N.create(g);m||(m=f instanceof SVGSVGElement?f:f.ownerSVGElement);const w=sd(f);f.setAttribute("transform","");const x=o(f,{target:m}).scale(w.sx,w.sy),C=io();C.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const E=io(),v=y.angleBetween(b,y.clone().translate(1,0));v&&E.setRotate(v,0,0);const S=io(),O=y.clone().move(b,x.width/2);S.setTranslate(2*y.x-O.x,2*y.y-O.y);const _=ao(f,m),T=io();T.setMatrix(S.matrix.multiply(E.matrix.multiply(C.matrix.multiply(_.scale(w.sx,w.sy))))),f.setAttribute("transform",Xr(T.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(),Tn(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(!Cs(p)){if(Ey(f)){const{left:y,top:b,width:w,height:x}=a(f);return new W(y,b,w,x)}return new W(0,0,0,0)}return c(p).bbox()||W.create()}n.getBBoxV2=h})(Ee||(Ee={}));const QI={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},eL={highlight(n,e,t){const s=As.getHighlighterId(e,t);if(As.hasCache(s))return;t=Op({},t,QI);const r=ae.create(e);let i,o;try{i=r.toPathData()}catch{o=Ee.bbox(r.node,!0),i=By(Object.assign(Object.assign({},t),o))}const a=bn("path");if(fe(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?so(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=Ee.bbox(r.node,!0));const f=o.x+o.width/2,p=o.y+o.height/2;o=Ee.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=ot({a:y,b:0,c:0,d:b,e:f-y*f,f:p-b*p});d=d.multiply(w)}Jr(a,d)}te(a,Jt.prefix("highlight-stroke"));const c=n.cell,u=()=>As.removeHighlighter(s);c.on("removed",u),c.model&&c.model.on("reseted",u),n.container.appendChild(a),As.setCache(s,a)},unhighlight(n,e,t){As.removeHighlighter(As.getHighlighterId(e,t))}};var As;(function(n){function e(o,a){return Gu(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&&(Yt(a),delete t[o])}n.removeHighlighter=i})(As||(As={}));const tL=Object.freeze(Object.defineProperty({__proto__:null,className:KI,opacity:ZI,stroke:eL},Symbol.toStringTag,{value:"Module"}));var ts;(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})(ts||(ts={})),function(n){n.presets=tL,n.registry=Ue.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(ts||(ts={}));function dd(n,e={}){return new N(mn(e.x,n.width),mn(e.y,n.height))}function hd(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const nL=(n,e)=>n.map(({x:t,y:s,angle:r})=>hd(dd(e,{x:t,y:s}),r||0)),sL=(n,e,t)=>{const s=t.start||0,r=t.step||20;return mb(n,e,s,(i,o)=>(i+.5-o/2)*r)},rL=(n,e,t)=>{const s=t.start||0,r=t.step||360/n.length;return mb(n,e,s,i=>i*r)};function mb(n,e,t,s){const r=e.getCenter(),i=e.getTopCenter(),o=e.width/e.height,a=wn.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),hd(f.round(),p,u)})}var iL=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 oL=(n,e,t)=>{const s=dd(e,t.start||e.getOrigin()),r=dd(e,t.end||e.getCorner());return go(n,s,r,t)},aL=(n,e,t)=>go(n,e.getTopLeft(),e.getBottomLeft(),t),lL=(n,e,t)=>go(n,e.getTopRight(),e.getBottomRight(),t),cL=(n,e,t)=>go(n,e.getTopLeft(),e.getTopRight(),t),uL=(n,e,t)=>go(n,e.getBottomLeft(),e.getBottomRight(),t);function go(n,e,t,s){const r=new K(e,t),i=n.length;return n.map((o,a)=>{var{strict:c}=o,u=iL(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),hd(h.round(),0,u)})}const dL=Object.freeze(Object.defineProperty({__proto__:null,absolute:nL,bottom:uL,ellipse:sL,ellipseSpread:rL,left:aL,line:oL,right:lL,top:cL},Symbol.toStringTag,{value:"Module"}));var lr;(function(n){n.presets=dL,n.registry=Ue.create({type:"port layout"}),n.registry.register(n.presets,!0)})(lr||(lr={}));const hL={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ts(n,e){const{x:t,y:s,angle:r,attrs:i}=e||{};return Op({},{angle:r,attrs:i,position:{x:t,y:s}},n,hL)}const fL=(n,e,t)=>Ts({position:e.getTopLeft()},t),pL=(n,e,t)=>Ts({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),gL=(n,e,t)=>Ts({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),mL=(n,e,t)=>Ts({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),yL=(n,e,t)=>Ts({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),bL=(n,e,t)=>yb(n,e,!1,t),wL=(n,e,t)=>yb(n,e,!0,t),xL=(n,e,t)=>bb(n,e,!1,t),vL=(n,e,t)=>bb(n,e,!0,t);function yb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=wb(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"),Ts({position:{x:Math.round(c),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":d}}},s)}function bb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=wb(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"),Ts({position:{x:Math.round(c),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":d}}},s)}function wb(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 CL=(n,e,t)=>xb(n.diff(e.getCenter()),!1,t),SL=(n,e,t)=>xb(n.diff(e.getCenter()),!0,t);function xb(n,e,t){const s=t.offset!=null?t.offset:20,r=new N(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",Ts({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":c}}},t)}const EL=Object.freeze(Object.defineProperty({__proto__:null,bottom:yL,inside:xL,insideOriented:vL,left:pL,manual:fL,outside:bL,outsideOriented:wL,radial:CL,radialOriented:SL,right:gL,top:mL},Symbol.toStringTag,{value:"Module"}));var si;(function(n){n.presets=EL,n.registry=Ue.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(si||(si={}));var OL=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 ke{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=fd.uniqueId(),ye.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return no(e),this}unmount(e=this.container){return Yt(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 te(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return Ie(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Ke(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=Yu(e)+1;s=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(s+=` > ${t}`),s=this.getSelector(e.parentNode,s)}return s}prefixClassName(e){return Jt.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 dt.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 dt.on(this.container,e+this.getEventNamespace(),t,s),this}undelegateEvent(e,t,s){const r=e+this.getEventNamespace();return t==null?dt.off(this.container,r):typeof t=="string"?dt.off(this.container,r,t,s):dt.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"&&dt.on(e,i+r,s,o)}),this}removeEventListeners(e){return e!=null&&dt.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Jt.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()}}OL([ye.dispose()],ye.prototype,"dispose",null),function(n){function e(r,i){return i?bn(r||"g"):Wu(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 fd;(function(n){let e=0;function t(){const s=`v${e}`;return e+=1,s}n.uniqueId=t})(fd||(fd={}));class ML{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new od,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=mR(e,s)}return ot(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Ee.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Ee.getBBoxV2(e)),t.boundingRect.clone()}}var Ve;(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:Te(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:it.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||it.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const C=x.tagName;if(!C)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const E=y?Wu(C,y):vy(C),v=x.attrs;v&&fe(E,so(v));const S=x.style;S&&Ke(E,S);const O=x.className;O!=null&&E.setAttribute("class",Array.isArray(O)?O.join(" "):O),x.textContent&&(E.textContent=x.textContent);const _=x.selector;if(_!=null){if(p[_])throw new TypeError("Selector must be unique");p[_]=E}if(x.groupSelector){let A=x.groupSelector;Array.isArray(A)||(A=[A]),A.forEach(D=>{f[D]||(f[D]=[]),f[D].push(E)})}w.appendChild(E);const T=x.children;Array.isArray(T)&&g.push({ns:y,markup:T,parent:E})})}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?bn("g"):vy("div")}function a(u){if(t(u)){const p=ae.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=ae.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})(Ve||(Ve={})),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=Yu(t)+1;i=`${o}:nth-child(${c})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,s,i)}return r}n.getSelector=e}(Ve||(Ve={})),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}(Ve||(Ve={})),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}(Ve||(Ve={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:it.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:it.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(Ve||(Ve={}));class vb{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=ne(Vn.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=Oy.includes(c)?c:sy(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 od;return Object.keys(e).forEach(a=>{const c=e[a];if(!Nn(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=GN(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)=>qe(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=ne(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=oo(h),p=new N(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=ne(w.position,this.view,b,u());x!=null&&(g=!0,p.translate(N.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=Ee.transformRectangle(y,f);Object.keys(c).forEach(w=>{const x=c[w],C=this.getDefinition(w);if(C!=null){const E=ne(C.offset,this.view,x,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:b});E!=null&&(m=!0,p.translate(N.create(E)))}})}}(d!=null||g||m)&&(p.round(1),f.e=p.x,f.f=p.y,e.setAttribute("transform",Xr(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(C=>C.refNode===h);x>-1?a.splice(x,0,w):a.push(w)}});const c=new od;let u;a.forEach(d=>{const h=d.node,f=d.refNode;let p;const g=f!=null&&s.rotatableNode!=null&&qu(s.rotatableNode,f);if(f&&(p=c.get(f)),!p){const b=g?s.rotatableNode:e;p=f?Ee.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=oo(fe(s.rotatableNode,"transform"))),y=Ee.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 NL=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},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};class He extends ye{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,d)=>d!=null?Tp([...Array.isArray(u)?u:[u],...Array.isArray(d)?d:[d]]):Array.isArray(u)?[...u]:[u],s=Te(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=e,c=PL(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)),qe(s,c)}get[Symbol.toStringTag](){return He.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new vb(this),this.flag=new Cb(this,this.options.actions,this.options.bootstrap),this.cache=new ML(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=Ve.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=ne(t,this.graph,this)),typeof t=="object"){let s=t[e];return typeof s=="function"&&(s=ne(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 Ee.transformRectangle(t,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return Ee.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 ot().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ot();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 W),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=Ze.isToolsView(e)?e:new Ze(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)}}He.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},NL([He.dispose()],He.prototype,"dispose",null),function(n){n.Flag=Cb,n.Attr=vb}(He||(He={})),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}(He||(He={})),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}(He||(He={})),function(n){n.registry=Ue.create({type:"view"})}(He||(He={}));class Ze extends ye{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Ze.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 te(s,this.prefixClassName("cell-tools")),t.className&&te(s,t.className),s}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!He.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(te(this.svgContainer,this.prefixClassName("edge-tools")),te(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(te(this.svgContainer,this.prefixClassName("node-tools")),te(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=>{Ze.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(Ze.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=ii.registry.get(a);if(u)o=new u(c);else return ii.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=oi.registry.get(a);if(u)o=new u(c);else return oi.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),Yt(this.svgContainer),Yt(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})(Ze||(Ze={})),function(n){class e extends ye{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return qe(Te(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),te(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&te(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()?te(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&te(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=Ve.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?$u(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Bu(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={}))}(Ze||(Ze={}));const _L=n=>n;function Sb(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Eb(n){return(t,s,r,i)=>s.isEdgeElement(r)?TL(n,t,s,r,i):AL(n,t,s,r,i)}function AL(n,e,t,s,r){const i=t.cell,o=i.getAngle(),a=t.getUnrotatedBBoxOfElement(s),c=i.getBBox().getCenter(),u=N.create(r).rotate(o,c);let d=u.x-a.x,h=u.y-a.y;return n&&(d=Sb(d,a.width),h=Sb(h,a.height)),e.anchor={name:"topLeft",args:{dx:d,dy:h,rotate:!0}},e}function TL(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 kL=Eb(!0),VL=Eb(!1),DL=Object.freeze(Object.defineProperty({__proto__:null,noop:_L,pinAbsolute:VL,pinRelative:kL},Symbol.toStringTag,{value:"Module"}));var pd;(function(n){n.presets=DL,n.registry=Ue.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(pd||(pd={}));function Ob(n,e,t,s){return ne(pd.presets.pinRelative,this.graph,{},e,t,n,this.cell,s,{}).anchor}function Mb(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class ks extends Ze.ToolItem{onRender(){te(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();Jr(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=Mb(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=mn(s,c.width),r=mn(r,c.height);let f=ot().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=mn(r,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,c=o.vector().vectorAngle(new N(1,0))||0):(a=e.getConnection().start,c=0);let d=ot().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"&&ne(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"}})})(ks||(ks={})),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})}})}(ks||(ks={}));var RL=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 fl extends Ze.ToolItem{onRender(){if(te(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,s=RL(e,["class"]);fe(this.container,so(s)),t&&te(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:s,rotate:r}=t,i=xs(t.padding);let o=Mb(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();nd(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"}})})(fl||(fl={}));class mo extends Ze.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:N.create(r),next:N.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?Es.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})(mo||(mo={})),function(n){const e=Jt.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"}})}(mo||(mo={}));class yo extends Ze.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){te(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=Te(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 O=u.sourceAnchor.clone();O[a]=f[a];const _=ne(o,i,O,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",_)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const C=i.targetView,E=i.targetBBox;let v=!1,S=!1;if(m?c===p.length-2?E.containsPoint(m)?(p.pop(),v=!0):(m[a]=f[a],S=!0):m[a]=f[a]:(m=i.targetAnchor.toJSON(),m[a]=f[a],E.containsPoint(m)?v=!0:(p.push(m),S=!0)),typeof o=="function"&&C){if(v){const O=u.targetAnchor.clone();O[a]=f[a];const _=ne(o,i,O,C,i.targetMagnet||C.container,"target",i,this);this.resetAnchor("target",_)}S&&this.resetAnchor("target",u.targetAnchorDef)}N.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:Te(this.cell.prop(["source","anchor"])),targetAnchorDef:Te(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 K(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 N(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 N(s,r))||new N(s,r);let c=ot().translate(a.x,a.y);if(a.equals({x:s,y:r}))c=c.rotate(i);else{let d=new K(s,r,a.x,a.y).vector().vectorAngle(new N(1,0));d!==0&&(d+=90),c=c.rotate(d)}this.setAttrs({transform:Xr(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})(yo||(yo={})),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:Ob})}(yo||(yo={}));class pl extends Ze.ToolItem{get type(){return this.options.type}onRender(){te(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=ne(u,s,c,r,a,t,s,this);c=N.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=ne(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:Ob,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}})})(pl||(pl={}));const IL=pl.define({name:"source-anchor",type:"source"}),LL=pl.define({name:"target-anchor",type:"target"});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};class gl extends Ze.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=BL(e,["class"]);this.setAttrs(s,this.container),t&&te(this.container,t)}}onRender(){te(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 N(1,0))||0;if(!r)return this;const o=ot().translate(r.x,r.y).rotate(i);return Jr(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"}})})(gl||(gl={}));const jL=gl.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"}}),$L=gl.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 ri extends Ze.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=Ze.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=N.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=mn(a,p.width),c=mn(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=N.create(),r=20;const{style:i}=t,o=this.event.target,a=o.parentElement;if(a&&Tn(a,this.prefixClassName("edge-label"))){const d=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(d,10);const h=a.getAttribute("transform"),{translation:f}=ol(h);s=new N(f.tx,f.ty),r=Ee.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=e.clientToLocal(N.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 ne(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"){ne(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:{}};Wr(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"}})})(ri||(ri={})),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"})}(ri||(ri={}));var Nb=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},ii;(function(n){n.presets={boundary:fl,button:ks,"button-remove":ks.Remove,"node-editor":ri.NodeEditor},n.registry=Ue.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let s=Ze.ToolItem;const{inherit:r}=t,i=Nb(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)})(ii||(ii={}));var oi;(function(n){n.presets={boundary:fl,vertices:mo,segments:yo,button:ks,"button-remove":ks.Remove,"source-anchor":IL,"target-anchor":LL,"source-arrowhead":jL,"target-arrowhead":$L,"edge-editor":ri.EdgeEditor},n.registry=Ue.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let s=Ze.ToolItem;const{inherit:r}=t,i=Nb(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)})(oi||(oi={}));const zL=ns("center"),FL=ns("topCenter"),UL=ns("bottomCenter"),HL=ns("leftMiddle"),GL=ns("rightMiddle"),WL=ns("topLeft"),YL=ns("topRight"),qL=ns("bottomLeft"),XL=ns("bottomRight");function ns(n){return function(e,t,s,r={}){const i=r.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=i[n];o.x+=mn(r.dx,i.width),o.y+=mn(r.dy,i.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function ml(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=Pb(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new N;return n.call(this,e,t,o,r)}return n.apply(this,arguments)}}function Pb(n,e){const t=Qn(e),s=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const JL=ml(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}),KL=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},ZL=ml(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}),QL=Object.freeze(Object.defineProperty({__proto__:null,bottom:UL,bottomLeft:qL,bottomRight:XL,center:zL,left:HL,midSide:ZL,nodeCenter:KL,orth:JL,right:GL,top:FL,topLeft:WL,topRight:YL},Symbol.toStringTag,{value:"Module"}));var ai;(function(n){n.presets=QL,n.registry=Ue.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(ai||(ai={}));const eB=function(n,e,t,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},tB=function(n,e,t,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},_b=function(n,e,t,s){const r=n.getClosestPoint(t);return r??new N},nB=ml(_b),sB=ml(function(n,e,t,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new K(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),c=new K(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?Pb(n,s.fallbackAt):ne(_b,this,n,e,t,s)}),rB=Object.freeze(Object.defineProperty({__proto__:null,closest:nB,length:tB,orth:sB,ratio:eB},Symbol.toStringTag,{value:"Module"}));var li;(function(n){n.presets=rB,n.registry=Ue.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(li||(li={}));function yl(n,e,t){let s;if(typeof t=="object"){if(Number.isFinite(t.y)){const i=new K(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 bl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function iB(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 Ab=function(n,e,t,s){const r=e.getBBoxOfElement(t);s.stroked&&r.inflate(bl(t)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return yl(o,n.start,s.offset)},oB=function(n,e,t,s,r){const i=e.cell,o=i.isNode()?i.getAngle():0;if(o===0)return ne(Ab,this,n,e,t,s,r);const a=e.getUnrotatedBBoxOfElement(t);s.stroked&&a.inflate(bl(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 yl(h,n.start,s.offset)},aB=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=ju(t,a):r=iB(t),!Cs(r)){if(r===t||!Cs(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=Ee.transformLine(n,p),m=g.start.clone(),y=e.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=c.bbox());const C=y.shapeBBox;if(C!=null&&C.containsPoint(m))return o}s.extrapolate===!0&&g.setLength(1e6);let b;if(ie.isPath(c)){const C=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:C})),b={precision:C,segmentSubdivisions:y.segmentSubdivisions},i=g.intersect(c,b)}else i=g.intersect(c);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(W.isRectangle(c)?i=c.getNearestPointToPoint(m):wn.isEllipse(c)?i=c.intersectsWithLineFromCenterToPoint(m):i=c.closestPoint(m,b));const w=i?Ee.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+=bl(r)/2):x+=bl(r)/2),yl(w,n.start,x)};function lB(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 cB=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,s){const{alignOffset:r,align:i}=s;return i&&lB(n,i,r),yl(n.end,n.start,s.offset)},bbox:Ab,boundary:aB,rect:oB},Symbol.toStringTag,{value:"Module"}));var ci;(function(n){n.presets=cB,n.registry=Ue.create({type:"connection point"}),n.registry.register(n.presets,!0)})(ci||(ci={}));const uB=function(n){return[...n]},dB=function(n,e,t){const s=e.side||"bottom",r=xs(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 wl(n){return new W(n.x,n.y,0,0)}function xl(n={}){const e=xs(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Tb(n,e={}){return n.sourceBBox.clone().moveAndExpand(xl(e))}function kb(n,e={}){return n.targetBBox.clone().moveAndExpand(xl(e))}function hB(n,e={}){return n.sourceAnchor?n.sourceAnchor:Tb(n,e).getCenter()}function fB(n,e={}){return n.targetAnchor?n.targetAnchor:kb(n,e).getCenter()}const Vb=function(n,e,t){let s=Tb(t,e),r=kb(t,e);const i=hB(t,e),o=fB(t,e);s=s.union(wl(i)),r=r.union(wl(o));const a=n.map(d=>N.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=Kt.getBearing(p,g)!=null;if(d===0)d+1===h?s.intersectsWithRect(r.clone().inflate(1))?f=Kt.insideNode(p,g,s,r):m||(f=Kt.nodeToNode(p,g,s,r)):s.containsPoint(g)?f=Kt.insideNode(p,g,s,wl(g).moveAndExpand(xl(e))):m||(f=Kt.nodeToVertex(p,g,s));else if(d+1===h){const y=m&&Kt.getBearing(g,p)===c;r.containsPoint(p)||y?f=Kt.insideNode(p,g,wl(p).moveAndExpand(xl(e)),r,c):m||(f=Kt.vertexToNode(p,g,r,c))}else m||(f=Kt.vertexToVertex(p,g,c));f?(u.push(...f.points),c=f.direction):c=Kt.getBearing(p,g),d+1<h&&u.push(g)}return u};var Kt;(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 N(h.x,f.y);return p.containsPoint(g)&&(g=new N(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 N(h.x,f.y),m=new N(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 N(h.x,f.y),new N(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=pN(m,y)[0];const x=N.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=N.create(h).move(b,-r(p,i(h,b))/2),x=N.create(f).move(y,-r(g,i(f,y))/2),C=new K(w,x).getCenter(),E=a(h,C,p),v=o(C,f,E.direction);m.points=[E.points[0],v.points[0]],m.direction=v.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,C=w?h:f;let E,v,S;m?(E=N.fromPolar(y.width+y.height,t[m],x),E=y.getNearestPointToPoint(E).move(E,-1)):E=y.getNearestPointToPoint(x).move(x,1),v=s(E,C,y);let O;E.round().equals(v.round())?(v=N.fromPolar(y.width+y.height,me.toRad(E.theta(x))+Math.PI/2,C),v=y.getNearestPointToPoint(v).move(C,1).round(),S=s(E,v,y),O=w?[v,S,E]:[E,S,v]):O=w?[v,E]:[E,v];const _=i(w?E:v,f);return{points:O,direction:_}}n.insideNode=d})(Kt||(Kt={}));const pB={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 Vs(this.step,this)},directions(){const n=Vs(this.step,this),e=Vs(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=Vs(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Vs(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Vb,draggingRouter:null,snapToGrid:!0};function Vs(n,e){return typeof n=="function"?n.call(e):n}function gB(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]=Vs(n[s],n),t},{});if(e.padding){const t=xs(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 N(0,0),r=new N(t.offsetX,t.offsetY);t.angle=me.normalize(s.theta(r))}),e}const Db=1,Rb=2;class mB{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Db,this.values[e]=t;const s=WN(this.items,e,r=>this.values[r]);this.items.splice(s,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Rb),e}isOpen(e){return this.hash[e]===Db}isClose(e){return this.hash[e]===Rb}isEmpty(){return this.items.length===0}}class yB{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=Ap(i,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(i=Ap(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 C=b.y;C<=w.y;C+=c){const E=new N(x,C).toString();u[E]==null&&(u[E]=[]),u[E].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 Ib(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Lb(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Bb(n,e){return n.sourceAnchor?n.sourceAnchor:Ib(n,e).getCenter()}function bB(n,e){return n.targetAnchor?n.targetAnchor:Lb(n,e).getCenter()}function gd(n,e,t,s,r){const i=360/t,o=n.theta(wB(n,e,s,r)),a=me.normalize(o+i/2);return i*Math.floor(a/i)}function wB(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 N(n.x+u,n.y+d)}function jb(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function xB(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 vB(n,e,t){return{source:e.clone(),x:$b(t.x-e.x,n),y:$b(t.y-e.y,n)}}function $b(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 N(s,r)}function bo(n,e){return n.round(e)}function vl(n,e,t){return bo(CB(n.clone(),e),t)}function wo(n){return n.toString()}function md(n){return new N(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function zb(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 Fb(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 N(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new K(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=vl(y,s,i);e.containsPoint(b)&&(b=vl(b.translate(h.x*s.x,h.y*s.y),s,i)),u.push(b)}}return u},[]);return e.containsPoint(n)||c.push(vl(n,s,i)),c}function SB(n,e,t,s,r){const i=[];let o=md(r.diff(t)),a=wo(t),c=n[a],u;for(;c;){u=e[a];const f=md(u.diff(c));f.equals(o)||(i.unshift(u),o=f),a=wo(c),c=n[a]}const d=e[a];return md(d.diff(s)).equals(o)||i.unshift(d),i}function EB(n,e,t,s,r){const i=r.precision;let o,a;W.isRectangle(e)?o=bo(Bb(n,r).clone(),i):o=bo(e.clone(),i),W.isRectangle(t)?a=bo(bB(n,r).clone(),i):a=bo(t.clone(),i);const c=vB(r.step,o,a),u=o,d=a;let h,f;if(W.isRectangle(e)?h=Fb(u,e,r.startDirections,c,r):h=[u],W.isRectangle(t)?f=Fb(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 mB,g={},m={},y={};for(let T=0,A=h.length;T<A;T+=1){const D=h[T],L=wo(D);p.add(L,zb(D,f)),g[L]=D,y[L]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,C;const E=xB(c,r),v=E.length,S=f.reduce((T,A)=>{const D=wo(A);return T.push(D),T},[]),O=N.equalPoints(h,f);let _=r.maxLoopCount;for(;!p.isEmpty()&&_>0;){const T=p.pop(),A=g[T],D=m[T],L=y[T],j=A.equals(u),P=D==null;let M;if(P?w?j?M=null:M=gd(u,A,v,c,r):M=b:M=gd(D,A,v,c,r),!(P&&O)&&S.indexOf(T)>=0)return r.previousDirectionAngle=M,SB(m,g,A,u,d);for(let $=0;$<v;$+=1){x=E[$];const V=x.angle;if(C=jb(M,V),!(w&&j)&&C>r.maxDirectionChange)continue;const U=vl(A.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),c,i),F=wo(U);if(p.isClose(F)||!s.isAccessible(U))continue;if(S.indexOf(F)>=0&&!U.equals(d)){const H=gd(U,d,v,c,r);if(jb(V,H)>r.maxDirectionChange)continue}const q=x.cost,X=j?0:r.penalties[C],Q=L+q+X;(!p.isOpen(F)||Q<y[F])&&(g[F]=U,m[F]=A,y[F]=Q,p.add(F,Q+zb(U,f)))}_-=1}}return r.fallbackRoute?ne(r.fallbackRoute,this,u,d,r):null}function OB(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 MB=function(n,e,t){const s=gB(e),r=Ib(t,s),i=Lb(t,s),o=Bb(t,s),a=new yB(s).build(t.graph.model,t.cell),c=n.map(p=>N.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,C=f.getOrigin();m=ne(s.draggingRouter,t,x,C,s)}}if(m==null&&(m=EB(t,h,f,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),ne(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?OB(u,t.graph.grid.getGridSize()):u},Ub=function(n,e,t){return ne(MB,this,n,Object.assign(Object.assign({},pB),e),t)},NB={maxDirectionChange:45,directions(){const n=Vs(this.step,this),e=Vs(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 K(n,a),u=90*Math.ceil(s/90),d=N.fromPolar(c.squaredLength(),me.toRad(u+135),a),h=new K(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}},PB=function(n,e,t){return ne(Ub,this,n,Object.assign(Object.assign({},NB),e),t)},_B=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,C=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-C)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,d.x+C))}else{const b=m.y,w=y.y,x=a.height/2+r,C=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-C)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,d.y+C))}return[m.toJSON(),...n,y.toJSON()]};function ui(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const s=N.create(n[1]).move(n[2],t),r=N.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 AB=Object.freeze(Object.defineProperty({__proto__:null,er:_B,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),C=Math.cos(w),E=new N(a.x+C*s,a.y+x*s),v=new N(E.x-C*i,E.y-x*i),S=v.clone().rotate(-90,E),O=v.clone().rotate(90,E);return[S.toJSON(),E.toJSON(),O.toJSON()]},f=b=>{const w=a.clone().move(b,-1),x=new K(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},p=[0,90,180,270,45,135,225,315];if(typeof o=="number")return ui(h(o),e.merge);const g=u.getCenter();if(g.equals(a))return ui(h(0),e.merge);const m=g.angleBetween(a,g.clone().translate(1,0));let y=h(m);if(f(y[1]))return ui(y,e.merge);for(let b=1,w=p.length;b<w;b+=1)if(y=h(m+p[b]),f(y[1]))return ui(y,e.merge);return ui(y,e.merge)}{const h=new K(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 K(y.start,p),w=new K(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 K(a,c),C=new K(p,x.center).setLength(Number.MAX_SAFE_INTEGER),E=u.intersectsWithLine(C),v=d.intersectsWithLine(C),S=E?Array.isArray(E)?E:[E]:[];v&&(Array.isArray(v)?S.push(...v):S.push(v));const O=x.center.closest(S);O?(t.sourceAnchor=O.clone(),t.targetAnchor=O.clone()):(t.sourceAnchor=x.center.clone(),t.targetAnchor=x.center.clone())}return ui([g.toJSON(),p.toJSON(),m.toJSON()],e.merge)}},manhattan:Ub,metro:PB,normal:uB,oneSide:dB,orth:Vb},Symbol.toStringTag,{value:"Module"}));var Ds;(function(n){n.presets=AB,n.registry=Ue.create({type:"router"}),n.registry.register(n.presets,!0)})(Ds||(Ds={}));const TB=function(n,e,t,s={}){const r=[n,...t,e],i=new Fe(r),o=new ie(i);return s.raw?o:o.serialize()},kB=function(n,e,t,s={}){const r=t.length===3?0:1,i=N.create(t[0+r]),o=N.create(t[2+r]),a=N.create(t[1+r]);if(!N.equals(n,e)){const u=new N((n.x+e.x)/2,(n.y+e.y)/2),d=u.angleBetween(N.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=`
120
120
  M ${n.x} ${n.y}
121
121
  Q ${i.x} ${i.y} ${a.x} ${a.y}
122
122
  Q ${o.x} ${o.y} ${e.x} ${e.y}
123
- `;return s.raw?oe.parse(c):c},kB=function(n,e,t,s={}){const r=new oe;r.appendSegment(oe.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=N.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 N(i*b.x+o*f.x,o*f.y+i*b.y),C=new N(i*w.x+o*f.x,o*f.y+i*w.y);r.appendSegment(oe.createSegment("L",b)),r.appendSegment(oe.createSegment("C",x,C,w))}return r.appendSegment(oe.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=ze.throughPoints(o);r=new oe(a)}else if(r=new oe,r.appendSegment(oe.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(oe.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;r.appendSegment(oe.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return s.raw?r:r.serialize()},Hb=1,El=1/3,Ol=2/3;function DB(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 yd(n,e,t=[]){const s=[n,...t,e],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new K(i,a))}),r}function RB(n,e){const t=[];return e.forEach(s=>{const r=n.intersectsWithLine(s);r&&t.push(r)}),t}function Gb(n,e){return new K(n,e).squaredLength()}function IB(n,e,t){return e.reduce((s,r,i)=>{if(Ml.includes(r))return s;const o=s.pop()||n,a=N.create(r).move(o.start,-t);let c=N.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),Ml.push(u))}else if(a.distance(o.end)<t*2+Hb)return s.push(o),s;if(c.distance(o.start)<t*2+Hb)return s.push(o),s;const h=new K(a,c);return xo.push(h),s.push(new K(o.start,a),h,new K(c,o.end)),s},[])}function Wb(n,e,t,s){const r=new oe;let i;return i=oe.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(xo.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 K(p,o.end).rotate(c,p);let m;m=new K(o.start,p),d=m.pointAt(2/3).rotate(c,o.start),h=g.pointAt(1/3).rotate(-c,g.end),i=oe.createSegment("C",d,h,g.end),r.appendSegment(i),m=new K(p,o.end),d=g.pointAt(1/3).rotate(c,g.end),h=m.pointAt(1/3).rotate(-c,o.end),i=oe.createSegment("C",d,h,o.end),r.appendSegment(i)}else if(t==="gap")i=oe.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 N(o.start.x+f,o.start.y+p).rotate(c,o.start),h=new N(o.end.x-f,o.end.y+p).rotate(c,o.end),i=oe.createSegment("C",d,h,o.end),r.appendSegment(i)}}else{const c=n[a+1];s===0||!c||xo.includes(c)?(i=oe.createSegment("L",o.end),r.appendSegment(i)):LB(s,r,o.end,o.start,c.end)}}),r}function LB(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 N(El*u.x+Ol*t.x,Ol*t.y+El*u.y),f=new N(El*d.x+Ol*t.x,Ol*t.y+El*d.y);let p;p=oe.createSegment("L",u),e.appendSegment(p),p=oe.createSegment("C",h,f,d),e.appendSegment(p)}let xo,Ml;const BB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,s={}){xo=[],Ml=[],DB(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 Wb(yd(n,e,t),r,i,o);const h=this.cell,f=d.indexOf(h),p=c.options.connecting.connector||{},g=d.filter((C,E)=>{const v=C.getConnector()||p;return a.includes(v.name)?!1:E>f?v.name!=="jumpover":!0}),m=g.map(C=>c.findViewByCell(C)),y=yd(n,e,t),b=m.map(C=>C==null?[]:C===this?y:yd(C.sourcePoint,C.targetPoint,C.routePoints)),w=[];y.forEach(C=>{const E=g.reduce((v,S,O)=>{if(S!==h){const _=RB(C,b[O]);v.push(..._)}return v},[]).sort((v,S)=>Gb(C.start,v)-Gb(C.start,S));E.length>0?w.push(...IB(C,E,r)):w.push(C)});const x=Wb(w,r,i,o);return xo=[],Ml=[],s.raw?x:x.serialize()},loop:TB,normal:AB,rounded:kB,smooth:VB},Symbol.toStringTag,{value:"Module"}));var cr;(function(n){n.presets=BB,n.registry=Ge.create({type:"connector"}),n.registry.register(n.presets,!0)})(cr||(cr={}));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 Yb extends Ve{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ke(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=ke(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];Pn(a[h],f)||i.push(h),Pn(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 ju(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}Wr(u,i,t,r);const f=ke(this.data);s.rewrite&&ty(f,e,r);const p=Xe(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=ke(this.get(r));o&&ty(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()?ke(this.changed):null;const t=this.changing?this.previous:this.data,s={};let r;for(const i in e){const o=e[i];Pn(t[i],o)||(s[i]=o,r=!0)}return r?ke(s):null}toJSON(){return ke(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})}}jB([Ve.dispose()],Yb.prototype,"dispose",null);class vo{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=lN(s,vo.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=>Pn(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"?or[e]:e}getInterp(e,t,s){return e?e(t,s):typeof s=="number"?ar.number(t,s):typeof s=="string"?s[0]==="#"?ar.color(t,s):ar.unit(t,s):ar.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"}})(vo||(vo={}));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},qb=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 ge extends Ve{static config(e){const{markup:t,propHooks:s,attrHooks:r}=e,i=qb(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=Xe({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ke(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((s,r)=>r?ie(r,e,s):s,t)}get[Symbol.toStringTag](){return ge.toStringTag}constructor(e={}){super();const s=this.constructor.getDefaults(!0),r=Xe({},this.preprocess(s),this.preprocess(e));this.id=r.id||nl(),this.store=new Yb(r),this.animation=new vo(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=nl()),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(Xe({},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(Xe({},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]||Vn.registry.get(e);if(!r){const i=ua(e);r=s[i]||Vn.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(Xe({},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 ge.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 ge.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=ke(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",ge.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=ke(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 G}getConnectionPoint(e,t){return new N}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"&&!Nn(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];Pn(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(C=>{const E=w[C];if(y==null||x==null||!$e(x)||!Pn(x[C],E)){h[g]==null&&(h[g]={}),h[g][b]==null&&(h[g][b]={});const v=h[g][b];v[C]=E}}):(y==null||!Pn(x,w))&&(h[g]==null&&(h[g]={}),h[g][b]=w)})});const f=Object.assign(Object.assign({},t),{attrs:Np(h)?void 0:h});f.attrs==null&&delete f.attrs;const p=f;return p.angle===0&&delete p.angle,ke(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 ge.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()}}ge.defaults={},ge.attrHooks={},ge.propHooks=[],$B([Ve.dispose()],ge.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}(ge||(ge={})),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}(ge||(ge={})),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=Tp(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}(ge||(ge={})),function(n){n.config({propHooks(e){var{tools:t}=e,s=qb(e,["tools"]);return t&&(s.tools=n.normalizeTools(t)),s}})}(ge||(ge={}));var di;(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})(di||(di={}));class zB{constructor(e){this.ports=[],this.groups={},this.init(ke(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=lr.registry.get(o);if(h==null)return lr.registry.onNotFound(o);a=h}else a=lr.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,N.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=Xe({},s.attrs,t.attrs),t.position=this.createPosition(s,t),t.label=Xe({},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 Xe({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=si.registry.get(r)||si.presets.left;return o?o(t,s,i):null}}var Nl=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 Ye=class v0 extends ge{get[Symbol.toStringTag](){return v0.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:s,y:r,width:i,height:o}=e,a=Nl(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 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-=ye.toRad(c);const m=N.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:ar.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),ge.getCellsBBox(t)}return G.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=N.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}=ge.getCellsBBox(s);const c=xs(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")||De.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",De.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||De.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",De.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||De.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",De.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return ke(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ke(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 G(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&&!Np(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 nl()}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 zB(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})}};Ye.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}(Ye||(Ye={})),function(n){n.config({propHooks(e){var{ports:t}=e,s=Nl(e,["ports"]);return t&&(s.ports=Array.isArray(t)?{items:t}:t),s}})}(Ye||(Ye={})),function(n){n.registry=Ge.create({type:"node",process(e,t){if(di.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=Nl(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}}),di.setNodeRegistry(n.registry)}(Ye||(Ye={})),function(n){let e=0;function t(i){return i?$u(i):(e+=1,`CustomNode${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=Nl(i,["constructorName","overwrite"]),u=Bu(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}(Ye||(Ye={}));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 Fe=class C0 extends ge{get[Symbol.toStringTag](){return C0.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(ge.isCell(s))f.source={cell:s.id};else if(p(s))f.source={cell:s};else if(N.isPoint(s))f.source=s.toJSON();else if(Array.isArray(s))f.source={x:s[0],y:s[1]};else{const g=s.cell;ge.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=N.create(o).toJSON());if(a!=null)if(ge.isCell(a))f.target={cell:a.id};else if(p(a))f.target={cell:a};else if(N.isPoint(a))f.target=a.toJSON();else if(Array.isArray(a))f.target={x:a[0],y:a[1]};else{const g=a.cell;ge.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=N.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(ge.isCell(t))return this.store.set(e,Xe({},s,{cell:t.id}),r),this;const i=t;return N.isPoint(t)||i.x!=null&&i.y!=null?(this.store.set(e,Xe({},s,{x:i.x,y:i.y}),r),this):(this.store.set(e,ke(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(N.isPointLike(t))return N.create(t);const s=this.getTerminalCell(e);return s?s.getConnectionPoint(this,e):new N}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 ke(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||Pn(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>i===o||Pn(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=>N.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,N.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=>N.equals(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>N.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")||De.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=>N.create(i).scale(e,t,s).toJSON(),r)}applyToPoints(e,t={}){const s={},r=this.getSource(),i=this.getTarget();N.isPointLike(r)&&(s.source=e(r)),N.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=>N.create(t)),this.getTargetPoint()];return new He(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=ge.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))}};Fe.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}(Fe||(Fe={})),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}(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.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}(Fe||(Fe={})),function(n){n.registry=Ge.create({type:"edge",process(e,t){if(di.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}}),di.setEdgeRegistry(n.registry)}(Fe||(Fe={})),function(n){let e=0;function t(i){return i?$u(i):(e+=1,`CustomEdge${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=Pl(i,["constructorName","overwrite"]),u=Bu(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}(Fe||(Fe={})),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=>N.create(o).toJSON())),i}}),n.registry.register(e,n)}(Fe||(Fe={}));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 _l extends Ve{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=$c(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([])}}FB([_l.dispose()],_l.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 st extends Ve{get[Symbol.toStringTag](){return st.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new _l(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=ge.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=ge.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=Ye.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 Ye.create(e)}addEdge(e,t={}){const s=Fe.isEdge(e)?e:this.createEdge(e);return this.addCell(s,t),s}createEdge(e){return Fe.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))}),ge.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 ge.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 G(e,t,s,r):G.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 G(e,t,s,r):G.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 ge.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,ie(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,ie(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=id.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 st.toJSON(this.getCells(),e)}parseJSON(e){return st.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()}}UB([st.dispose()],st.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}(st||(st={})),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(Ye.registry.exist(o))return Ye.create(i);if(Fe.registry.exist(o))return Fe.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(st||(st={}));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};let Rs=class extends Ye{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=HB(e,["label"]);return t&&Wr(s,"attrs/text/text",t),s},visible:!0})})(Rs||(Rs={}));var GB=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 WB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function YB(n="xlink:href"){return t=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=t,o=GB(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 hi(n,e,t={}){const s={constructorName:n,markup:WB(n,t.selector),attrs:{[n]:Object.assign({},Rs.bodyAttr)}};return(t.parent||Rs).define(Xe(s,e,{shape:n}))}hi("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const qB=Fe.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"}}});hi("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});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};class fi extends Rs{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",fi.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(","):N.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:s}=t,r=XB(t,["points"]);if(s){const i=e(s);i&&Wr(r,"attrs/body/refPoints",i)}return r}})})(fi||(fi={})),hi("polygon",{},{parent:fi}),hi("polyline",{},{parent:fi});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};Rs.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=JB(n,["path"]);return e&&Wr(t,"attrs/body/refD",e),t}});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};Rs.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},vs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:ot.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({},Rs.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=KB(n,["text"]);return e&&Wr(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=Vn.presets.textWrap;return ie(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()}}}}),hi("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:YB()},{selector:"image"}),hi("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class xn extends We{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return xn.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")?Le(t,s):se(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 G(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=>{qt(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const s=this.cell.getParsedPorts(),r=Mp(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?Xu(s[Math.max(t,0)],r):Bt(this.container,r)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=De.renderMarkup(this.cell.getPortContainerMarkup());const s=t.elem;if(s==null)throw new Error("Invalid port container markup.");t=De.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}`),se(s,o),se(s,"x6-port"),se(r,"x6-port-body"),s.appendChild(r);let a=i,c,u;if(this.existPortLabel(e)){if(t=De.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)}se(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=G.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=G.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=G.fromSize(o.labelSize)),this.updateAttrs(c.portLabelElement,d.attrs,h)}}}applyPortTransform(e,t,s=0){const r=t.angle,i=t.position,o=at().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);Jr(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"?ie(o,r,{view:this,node:this.cell}).filter(f=>ge.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=Mp(a,"zIndex"),p=AN(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&&ie(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?ie(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=ie(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"?ie(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=N.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=Se.snapToGrid(t+c.x,o),h=Se.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})(xn||(xn={})),xn.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"]}}),xn.registry.register("node",xn,!0);var ZB=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 ns extends We{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return ns.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const s=this.cell.getSource();return new G(s.x,s.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new G(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 G(s.x,s.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new G(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=bn("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"&&ya(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=le.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=le.create("g").append(t):s=le.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=Xe({},r.attrs,u.attrs);this.updateAttrs(a,d,{selectors:c,rootBBox:u.size?G.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=ZB(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 He(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 N.create(this.sourceAnchor);case"target":return N.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return N.create(this.sourcePoint);case"target":return N.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 He(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=N.create(t):h?g=p:g=N.create(u),i=this.getAnchor(c.anchor,d,f,g,e)}else i=N.create(c);if(h){const g=N.create(r||i);o=this.getAnchor(u.anchor,h,p,g,s)}else o=N.isPointLike(u)?N.create(u):new N;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=li.registry.get(d);if(typeof h!="function")return li.registry.onNotFound(d);u=ie(h,this,t,s,r,c.args||{},i)}else{const h=ai.registry.get(d);if(typeof h!="function")return ai.registry.onNotFound(d);u=ie(h,this,t,s,r,c.args||{},i)}return u?u.round(this.POINT_ROUNDING):new N}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Ds.presets.normal,s=this.cell.getRouter()||t;let r;if(typeof s=="function")r=ie(s,this,e,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ds.registry.get(i):Ds.presets.normal;if(typeof a!="function")return Ds.registry.onNotFound(i);r=ie(a,this,e,o,this)}return r==null?e.map(i=>N.create(i)):r.map(i=>N.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 K(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 K(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=ci.registry.get(a);if(typeof u!="function")return ci.registry.onNotFound(a);const d=ie(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=cr.registry.get(i);if(typeof u!="function")return cr.registry.onNotFound(i);a=u}else a=cr.presets.normal;const c=ie(a,this,t,s,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof c=="string"?oe.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=Xe({},i,d),f=this.getLabelTransformationMatrix(h);u.setAttribute("transform",Xr(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:Xe({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return ya(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return ya(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return ya(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:(Zn(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 N(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),C=p.diff(x);w={x:C.x,y:C.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=ye.normalize((w+90)%180-90)))}else b=p.start,d&&b.translate(c);return at().translate(b.x,b.y).rotate(w)}getVertexIndex(e,t){const r=this.cell.getVertices(),i=this.getClosestPointLength(new N(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:Ac(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=C=>{const E=i==="source"?a?a.port:null:m?m.getSourcePortId():null,v=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return ie(C,this.graph,{edge:m,edgeView:o,sourceView:e,targetView:s,sourcePort:E,targetPort:v,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&&ns.isEdgeView(y)&&(w=!1):w=x(h)),w&&d!=null&&b==null&&(typeof d=="boolean"?!d&&xn.isNodeView(y)&&(w=!1):w=x(d)),w&&p!=null&&o){const C=o.cell,E=i==="source"?a:C.getSource(),v=i==="target"?a:C.getTarget(),S=a?this.graph.getCellById(a.cell):null;if(E&&v&&E.cell&&v.cell&&S)if(typeof p=="function")w=x(p);else{const O=this.graph.model.getConnectedEdges(S,{outgoing:i==="source",incoming:i==="target"});O.length&&(p==="withPort"?O.some(T=>{const A=T.getSource(),V=T.getTarget();return A&&V&&A.cell===E.cell&&V.cell===v.cell&&A.port!=null&&A.port===E.port&&V.port!=null&&V.port===v.port})&&(w=!1):p||O.some(T=>{const A=T.getSource(),V=T.getTarget();return A&&V&&A.cell===E.cell&&V.cell===v.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 ie(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?ie(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 C=r.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(E=>E!==this);u.push(...C)}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 N(e,t);u.forEach(C=>{if(C.container.getAttribute("magnet")!=="false"){if(C.isNodeView())f=c==="center"?C.cell.getBBox().getCenter().distance(g):C.cell.getBBox().getNearestPointToPoint(g).distance(g);else if(C.isEdgeView()){const E=C.getClosestPoint(g);E?f=E.distance(g):f=Number.MAX_SAFE_INTEGER}f<a&&f<p&&(h===C.container||this.validateConnection(...s.getValidateConnectionArgs(C,null),C.getEdgeTerminal(C.container,e,t,this.cell,s.terminalType)))&&(p=f,s.closestView=C,s.closestMagnet=C.container)}C.container.querySelectorAll("[magnet]").forEach(E=>{if(E.getAttribute("magnet")!=="false"){const v=C.getBBoxOfElement(E);f=g.distance(v.getCenter()),f<a&&f<p&&(h===E||this.validateConnection(...s.getValidateConnectionArgs(C,E),C.getEdgeTerminal(E,e,t,this.cell,s.terminalType)))&&(p=f,s.closestView=C,s.closestMagnet=E)}})});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&&!Fe.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:N.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:N.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=Xe({},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})(ns||(ns={})),ns.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"]}}),ns.registry.register("edge",ns,!0);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 Dn extends be{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:s}=De.parseJSONMarkup(Dn.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=Dn.snapshoot(this.container),se(this.container,this.prefixClassName("graph")),Bt(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&&ge.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=ie(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 kn(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);ie(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=()=>{}}}QB([be.dispose()],Dn.prototype,"dispose",null),function(n){const e=`${Kt.prefixCls}-graph`;n.markup=[{ns:ot.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:ot.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:ot.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":ot.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(no(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}(Dn||(Dn={})),function(n){const e=Kt.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"}}(Dn||(Dn={}));const e3=`.x6-graph {
123
+ `;return s.raw?ie.parse(c):c},VB=function(n,e,t,s={}){const r=new ie;r.appendSegment(ie.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=N.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 N(i*b.x+o*f.x,o*f.y+i*b.y),C=new N(i*w.x+o*f.x,o*f.y+i*w.y);r.appendSegment(ie.createSegment("L",b)),r.appendSegment(ie.createSegment("C",x,C,w))}return r.appendSegment(ie.createSegment("L",e)),s.raw?r:r.serialize()},DB=function(n,e,t,s={}){let r,i=s.direction;if(t&&t.length!==0){const o=[n,...t,e],a=je.throughPoints(o);r=new ie(a)}else if(r=new ie,r.appendSegment(ie.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(ie.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;r.appendSegment(ie.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return s.raw?r:r.serialize()},Hb=1,Cl=1/3,Sl=2/3;function RB(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 yd(n,e,t=[]){const s=[n,...t,e],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new K(i,a))}),r}function IB(n,e){const t=[];return e.forEach(s=>{const r=n.intersectsWithLine(s);r&&t.push(r)}),t}function Gb(n,e){return new K(n,e).squaredLength()}function LB(n,e,t){return e.reduce((s,r,i)=>{if(El.includes(r))return s;const o=s.pop()||n,a=N.create(r).move(o.start,-t);let c=N.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),El.push(u))}else if(a.distance(o.end)<t*2+Hb)return s.push(o),s;if(c.distance(o.start)<t*2+Hb)return s.push(o),s;const h=new K(a,c);return xo.push(h),s.push(new K(o.start,a),h,new K(c,o.end)),s},[])}function Wb(n,e,t,s){const r=new ie;let i;return i=ie.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(xo.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 K(p,o.end).rotate(c,p);let m;m=new K(o.start,p),d=m.pointAt(2/3).rotate(c,o.start),h=g.pointAt(1/3).rotate(-c,g.end),i=ie.createSegment("C",d,h,g.end),r.appendSegment(i),m=new K(p,o.end),d=g.pointAt(1/3).rotate(c,g.end),h=m.pointAt(1/3).rotate(-c,o.end),i=ie.createSegment("C",d,h,o.end),r.appendSegment(i)}else if(t==="gap")i=ie.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 N(o.start.x+f,o.start.y+p).rotate(c,o.start),h=new N(o.end.x-f,o.end.y+p).rotate(c,o.end),i=ie.createSegment("C",d,h,o.end),r.appendSegment(i)}}else{const c=n[a+1];s===0||!c||xo.includes(c)?(i=ie.createSegment("L",o.end),r.appendSegment(i)):BB(s,r,o.end,o.start,c.end)}}),r}function BB(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 N(Cl*u.x+Sl*t.x,Sl*t.y+Cl*u.y),f=new N(Cl*d.x+Sl*t.x,Sl*t.y+Cl*d.y);let p;p=ie.createSegment("L",u),e.appendSegment(p),p=ie.createSegment("C",h,f,d),e.appendSegment(p)}let xo,El;const jB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,s={}){xo=[],El=[],RB(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 Wb(yd(n,e,t),r,i,o);const h=this.cell,f=d.indexOf(h),p=c.options.connecting.connector||{},g=d.filter((C,E)=>{const v=C.getConnector()||p;return a.includes(v.name)?!1:E>f?v.name!=="jumpover":!0}),m=g.map(C=>c.findViewByCell(C)),y=yd(n,e,t),b=m.map(C=>C==null?[]:C===this?y:yd(C.sourcePoint,C.targetPoint,C.routePoints)),w=[];y.forEach(C=>{const E=g.reduce((v,S,O)=>{if(S!==h){const _=IB(C,b[O]);v.push(..._)}return v},[]).sort((v,S)=>Gb(C.start,v)-Gb(C.start,S));E.length>0?w.push(...LB(C,E,r)):w.push(C)});const x=Wb(w,r,i,o);return xo=[],El=[],s.raw?x:x.serialize()},loop:kB,normal:TB,rounded:VB,smooth:DB},Symbol.toStringTag,{value:"Module"}));var cr;(function(n){n.presets=jB,n.registry=Ue.create({type:"connector"}),n.registry.register(n.presets,!0)})(cr||(cr={}));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 Yb extends ke{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(Te(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=Te(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];Pn(a[h],f)||i.push(h),Pn(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 ju(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}Wr(u,i,t,r);const f=Te(this.data);s.rewrite&&ty(f,e,r);const p=qe(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=Te(this.get(r));o&&ty(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()?Te(this.changed):null;const t=this.changing?this.previous:this.data,s={};let r;for(const i in e){const o=e[i];Pn(t[i],o)||(s[i]=o,r=!0)}return r?Te(s):null}toJSON(){return Te(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})}}$B([ke.dispose()],Yb.prototype,"dispose",null);class vo{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=lN(s,vo.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=>Pn(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"?or[e]:e}getInterp(e,t,s){return e?e(t,s):typeof s=="number"?ar.number(t,s):typeof s=="string"?s[0]==="#"?ar.color(t,s):ar.unit(t,s):ar.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"}})(vo||(vo={}));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},qb=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 ke{static config(e){const{markup:t,propHooks:s,attrHooks:r}=e,i=qb(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=qe({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:Te(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((s,r)=>r?ne(r,e,s):s,t)}get[Symbol.toStringTag](){return pe.toStringTag}constructor(e={}){super();const s=this.constructor.getDefaults(!0),r=qe({},this.preprocess(s),this.preprocess(e));this.id=r.id||el(),this.store=new Yb(r),this.animation=new vo(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=el()),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(qe({},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(qe({},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]||Vn.registry.get(e);if(!r){const i=ua(e);r=s[i]||Vn.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(qe({},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=Te(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=Te(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 W}getConnectionPoint(e,t){return new N}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"&&!Nn(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];Pn(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(C=>{const E=w[C];if(y==null||x==null||!Be(x)||!Pn(x[C],E)){h[g]==null&&(h[g]={}),h[g][b]==null&&(h[g][b]={});const v=h[g][b];v[C]=E}}):(y==null||!Pn(x,w))&&(h[g]==null&&(h[g]={}),h[g][b]=w)})});const f=Object.assign(Object.assign({},t),{attrs:Np(h)?void 0:h});f.attrs==null&&delete f.attrs;const p=f;return p.angle===0&&delete p.angle,Te(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=[],zB([ke.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=Tp(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=qb(e,["tools"]);return t&&(s.tools=n.normalizeTools(t)),s}})}(pe||(pe={}));var di;(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})(di||(di={}));class FB{constructor(e){this.ports=[],this.groups={},this.init(Te(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=lr.registry.get(o);if(h==null)return lr.registry.onNotFound(o);a=h}else a=lr.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,N.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=qe({},s.attrs,t.attrs),t.position=this.createPosition(s,t),t.label=qe({},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 qe({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=si.registry.get(r)||si.presets.left;return o?o(t,s,i):null}}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};let Ge=class v0 extends pe{get[Symbol.toStringTag](){return v0.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:s,y:r,width:i,height:o}=e,a=Ol(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=N.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:ar.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 W.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=N.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=xs(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")||Ve.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",Ve.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Ve.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",Ve.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Ve.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",Ve.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return Te(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return Te(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 W(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&&!Np(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 el()}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 FB(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})}};Ge.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}(Ge||(Ge={})),function(n){n.config({propHooks(e){var{ports:t}=e,s=Ol(e,["ports"]);return t&&(s.ports=Array.isArray(t)?{items:t}:t),s}})}(Ge||(Ge={})),function(n){n.registry=Ue.create({type:"node",process(e,t){if(di.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=Ol(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}}),di.setNodeRegistry(n.registry)}(Ge||(Ge={})),function(n){let e=0;function t(i){return i?$u(i):(e+=1,`CustomNode${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=Ol(i,["constructorName","overwrite"]),u=Bu(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}(Ge||(Ge={}));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};let $e=class C0 extends pe{get[Symbol.toStringTag](){return C0.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=Ml(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(N.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=N.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(N.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=N.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,qe({},s,{cell:t.id}),r),this;const i=t;return N.isPoint(t)||i.x!=null&&i.y!=null?(this.store.set(e,qe({},s,{x:i.x,y:i.y}),r),this):(this.store.set(e,Te(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(N.isPointLike(t))return N.create(t);const s=this.getTerminalCell(e);return s?s.getConnectionPoint(this,e):new N}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 Te(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||Pn(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>i===o||Pn(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=>N.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,N.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=>N.equals(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>N.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")||Ve.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=>N.create(i).scale(e,t,s).toJSON(),r)}applyToPoints(e,t={}){const s={},r=this.getSource(),i=this.getTarget();N.isPointLike(r)&&(s.source=e(r)),N.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=>N.create(t)),this.getTargetPoint()];return new Fe(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))}};$e.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}($e||($e={})),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}($e||($e={})),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}($e||($e={})),function(n){n.registry=Ue.create({type:"edge",process(e,t){if(di.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=Ml(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}}),di.setEdgeRegistry(n.registry)}($e||($e={})),function(n){let e=0;function t(i){return i?$u(i):(e+=1,`CustomEdge${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=Ml(i,["constructorName","overwrite"]),u=Bu(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}($e||($e={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:s,vertices:r}=t,i=Ml(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=>N.create(o).toJSON())),i}}),n.registry.register(e,n)}($e||($e={}));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 Nl extends ke{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=Bc(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([])}}UB([Nl.dispose()],Nl.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 nt extends ke{get[Symbol.toStringTag](){return nt.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Nl(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=Ge.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 Ge.create(e)}addEdge(e,t={}){const s=$e.isEdge(e)?e:this.createEdge(e);return this.addCell(s,t),s}createEdge(e){return $e.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 W(e,t,s,r):W.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 W(e,t,s,r):W.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,ne(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,ne(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=id.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 nt.toJSON(this.getCells(),e)}parseJSON(e){return nt.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()}}HB([nt.dispose()],nt.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}(nt||(nt={})),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(Ge.registry.exist(o))return Ge.create(i);if($e.registry.exist(o))return $e.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(nt||(nt={}));var GB=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 Rs=class extends Ge{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=GB(e,["label"]);return t&&Wr(s,"attrs/text/text",t),s},visible:!0})})(Rs||(Rs={}));var 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};function YB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function qB(n="xlink:href"){return t=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=t,o=WB(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 hi(n,e,t={}){const s={constructorName:n,markup:YB(n,t.selector),attrs:{[n]:Object.assign({},Rs.bodyAttr)}};return(t.parent||Rs).define(qe(s,e,{shape:n}))}hi("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const XB=$e.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"}}});hi("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});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 fi extends Rs{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",fi.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(","):N.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:s}=t,r=JB(t,["points"]);if(s){const i=e(s);i&&Wr(r,"attrs/body/refPoints",i)}return r}})})(fi||(fi={})),hi("polygon",{},{parent:fi}),hi("polyline",{},{parent:fi});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};Rs.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=KB(n,["path"]);return e&&Wr(t,"attrs/body/refD",e),t}});var ZB=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};Rs.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},vs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:it.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({},Rs.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=ZB(n,["text"]);return e&&Wr(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=Vn.presets.textWrap;return ne(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()}}}}),hi("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:qB()},{selector:"image"}),hi("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class xn extends He{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return xn.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")?Ie(t,s):te(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 W(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=>{Yt(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const s=this.cell.getParsedPorts(),r=Mp(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?Xu(s[Math.max(t,0)],r):Lt(this.container,r)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=Ve.renderMarkup(this.cell.getPortContainerMarkup());const s=t.elem;if(s==null)throw new Error("Invalid port container markup.");t=Ve.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}`),te(s,o),te(s,"x6-port"),te(r,"x6-port-body"),s.appendChild(r);let a=i,c,u;if(this.existPortLabel(e)){if(t=Ve.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)}te(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=W.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=W.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=W.fromSize(o.labelSize)),this.updateAttrs(c.portLabelElement,d.attrs,h)}}}applyPortTransform(e,t,s=0){const r=t.angle,i=t.position,o=ot().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);Jr(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"?ne(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=Mp(a,"zIndex"),p=AN(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&&ne(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?ne(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=ne(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"?ne(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=N.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),h=Ce.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})(xn||(xn={})),xn.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"]}}),xn.registry.register("node",xn,!0);var QB=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 ss extends He{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return ss.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const s=this.cell.getSource();return new W(s.x,s.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new W(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 W(s.x,s.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new W(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=bn("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"&&ya(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=ae.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=ae.create("g").append(t):s=ae.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=qe({},r.attrs,u.attrs);this.updateAttrs(a,d,{selectors:c,rootBBox:u.size?W.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=QB(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 Fe(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 N.create(this.sourceAnchor);case"target":return N.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return N.create(this.sourcePoint);case"target":return N.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 Fe(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=N.create(t):h?g=p:g=N.create(u),i=this.getAnchor(c.anchor,d,f,g,e)}else i=N.create(c);if(h){const g=N.create(r||i);o=this.getAnchor(u.anchor,h,p,g,s)}else o=N.isPointLike(u)?N.create(u):new N;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=li.registry.get(d);if(typeof h!="function")return li.registry.onNotFound(d);u=ne(h,this,t,s,r,c.args||{},i)}else{const h=ai.registry.get(d);if(typeof h!="function")return ai.registry.onNotFound(d);u=ne(h,this,t,s,r,c.args||{},i)}return u?u.round(this.POINT_ROUNDING):new N}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Ds.presets.normal,s=this.cell.getRouter()||t;let r;if(typeof s=="function")r=ne(s,this,e,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ds.registry.get(i):Ds.presets.normal;if(typeof a!="function")return Ds.registry.onNotFound(i);r=ne(a,this,e,o,this)}return r==null?e.map(i=>N.create(i)):r.map(i=>N.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 K(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 K(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=ci.registry.get(a);if(typeof u!="function")return ci.registry.onNotFound(a);const d=ne(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=cr.registry.get(i);if(typeof u!="function")return cr.registry.onNotFound(i);a=u}else a=cr.presets.normal;const c=ne(a,this,t,s,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof c=="string"?ie.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=qe({},i,d),f=this.getLabelTransformationMatrix(h);u.setAttribute("transform",Xr(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:qe({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return ya(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return ya(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return ya(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 N(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),C=p.diff(x);w={x:C.x,y:C.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 ot().translate(b.x,b.y).rotate(w)}getVertexIndex(e,t){const r=this.cell.getVertices(),i=this.getClosestPointLength(new N(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:Pc(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=C=>{const E=i==="source"?a?a.port:null:m?m.getSourcePortId():null,v=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return ne(C,this.graph,{edge:m,edgeView:o,sourceView:e,targetView:s,sourcePort:E,targetPort:v,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&&ss.isEdgeView(y)&&(w=!1):w=x(h)),w&&d!=null&&b==null&&(typeof d=="boolean"?!d&&xn.isNodeView(y)&&(w=!1):w=x(d)),w&&p!=null&&o){const C=o.cell,E=i==="source"?a:C.getSource(),v=i==="target"?a:C.getTarget(),S=a?this.graph.getCellById(a.cell):null;if(E&&v&&E.cell&&v.cell&&S)if(typeof p=="function")w=x(p);else{const O=this.graph.model.getConnectedEdges(S,{outgoing:i==="source",incoming:i==="target"});O.length&&(p==="withPort"?O.some(T=>{const A=T.getSource(),D=T.getTarget();return A&&D&&A.cell===E.cell&&D.cell===v.cell&&A.port!=null&&A.port===E.port&&D.port!=null&&D.port===v.port})&&(w=!1):p||O.some(T=>{const A=T.getSource(),D=T.getTarget();return A&&D&&A.cell===E.cell&&D.cell===v.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 ne(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?ne(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 C=r.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(E=>E!==this);u.push(...C)}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 N(e,t);u.forEach(C=>{if(C.container.getAttribute("magnet")!=="false"){if(C.isNodeView())f=c==="center"?C.cell.getBBox().getCenter().distance(g):C.cell.getBBox().getNearestPointToPoint(g).distance(g);else if(C.isEdgeView()){const E=C.getClosestPoint(g);E?f=E.distance(g):f=Number.MAX_SAFE_INTEGER}f<a&&f<p&&(h===C.container||this.validateConnection(...s.getValidateConnectionArgs(C,null),C.getEdgeTerminal(C.container,e,t,this.cell,s.terminalType)))&&(p=f,s.closestView=C,s.closestMagnet=C.container)}C.container.querySelectorAll("[magnet]").forEach(E=>{if(E.getAttribute("magnet")!=="false"){const v=C.getBBoxOfElement(E);f=g.distance(v.getCenter()),f<a&&f<p&&(h===E||this.validateConnection(...s.getValidateConnectionArgs(C,E),C.getEdgeTerminal(E,e,t,this.cell,s.terminalType)))&&(p=f,s.closestView=C,s.closestMagnet=E)}})});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&&!$e.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:N.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:N.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=qe({},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})(ss||(ss={})),ss.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"]}}),ss.registry.register("edge",ss,!0);var e3=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 Dn extends ye{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:s}=Ve.parseJSONMarkup(Dn.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=Dn.snapshoot(this.container),te(this.container,this.prefixClassName("graph")),Lt(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=ne(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 kn(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);ne(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=()=>{}}}e3([ye.dispose()],Dn.prototype,"dispose",null),function(n){const e=`${Jt.prefixCls}-graph`;n.markup=[{ns:it.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:it.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:it.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":it.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(no(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}(Dn||(Dn={})),function(n){const e=Jt.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"}}(Dn||(Dn={}));const t3=`.x6-graph {
124
124
  position: relative;
125
125
  overflow: hidden;
126
126
  outline: none;
@@ -279,7 +279,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
279
279
  border: 1px solid #275fc5;
280
280
  border-radius: 2px;
281
281
  }
282
- `;class ct extends xt{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 t3=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 ct{init(){Kr("core",e3)}dispose(){Zr("core")}}t3([bd.dispose()],bd.prototype,"dispose",null);var n3=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},Co;(function(n){function e(t){const{grid:s,panning:r,mousewheel:i,embedding:o}=t,a=n3(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=Xe({},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})(Co||(Co={})),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:Kt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Kt.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 qB}},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}}(Co||(Co={}));var s3=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},r3=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 wd extends ct{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=r3(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,le.create("pattern",{id:d,patternUnits:"userSpaceOnUse"},le.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),pe(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 Ms),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Ms.presets.dot),e.args)];const s=Ms.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 Ms.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}s3([ct.dispose()],wd.prototype,"dispose",null);class Xb extends ct{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),at(this.viewportMatrix)}setMatrix(e){const t=at(e),s=Xr(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 Bc(e)||(e=this.container.clientWidth),Bc(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return hR(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 Et(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 fR(this.getMatrix())}rotate(e,t,s){if(t==null||s==null){const i=Oe.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 pR(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=xs(s),o=r.border||0,a=r.contentArea?G.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 G(-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=N.create(b)}else s=this.getContentBBox(e),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=xs(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=G.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=Et(g,c,u),m=Et(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 G:Oe.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=G.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const s=G.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=mn(t,Math.max(0,r.width)),t<0&&(t=r.width+t),s=mn(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=G.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 i3=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 xd extends ct{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=G.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=fo.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=Ac(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=Ac(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()}}i3([ct.dispose()],xd.prototype,"dispose",null);var o3=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 vd extends ct{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),ht.on(this.graph.container,"mousedown",this.onRightMouseDown),ht.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Fy(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),ht.off(this.graph.container,"mousedown",this.onRightMouseDown),ht.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&Es.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(),ht.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)}),ht.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(),ht.off(document.body,".panning"),ht.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?(se(e,t),Le(e,s)):(Le(e,t),se(e,s)):(Le(e,t),Le(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()}}o3([ct.dispose()],vd.prototype,"dispose",null);var a3=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 ct{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 Fy(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))&&Es.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&Es.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=Et(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()}}a3([xt.dispose()],Cd.prototype,"dispose",null);var l3=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 ct{init(){this.resetRenderArea=XN(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()}}l3([ct.dispose()],Jb.prototype,"dispose",null);class c3{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&ss.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 ss;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(ss||(ss={}));var u3=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 rt extends xt{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new c3,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,rt.FLAG_INSERT,t,ss.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,s={},r=ss.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=ss.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===rt.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=rt.FLAG_INSERT;else{const c=this.createCellView(s);c&&(c.graph=this.graph,o=rt.FLAG_INSERT|c.getBootstrapFlag(),a={view:c,flag:o,options:t,state:rt.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===rt.ViewState.MOUNTED?(a=this.updateView(e,t,s),o.flag=a):o.state=rt.ViewState.WAITING,a&&r.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:ss.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===rt.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(We.isCellView(e)){if(t&rt.FLAG_REMOVE)return this.removeView(e.cell),0;t&rt.FLAG_INSERT&&(this.insertView(e),t^=rt.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=rt.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&&Ze(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=ie(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=We.registry.get(r);return i?new i(e,t):We.registry.onNotFound(r)}return e.isNode()?new xn(e,t):e.isEdge()?new ns(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()?ss.RenderNode:ss.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}u3([xt.dispose()],rt.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(rt||(rt={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(rt||(rt={}));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 Sd extends ct{constructor(){super(...arguments),this.schedule=new rt(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=ge.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?Oe.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=G.create(e);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(t.nodeOnly&&!r.isNodeView())return!1;const i=Oe.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()}}d3([ct.dispose()],Sd.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};class Zb extends ct{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}-${zu(JSON.stringify(e))}`),!this.isDefined(t)){const r=ti.registry.get(s);if(r==null)return ti.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});le.create(De.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}-${zu(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);le.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=Kb(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=t;if(d||(d=`marker-${this.cid}-${zu(JSON.stringify(e))}`),!this.isDefined(d)){a!=="path"&&delete u.d;const h=le.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=Kb(f,["tagName"]);return le.create(`${p}`||"path",so(Object.assign(Object.assign({},u),g)))}):[le.create(a||"path",so(u))]);this.defs.appendChild(h.node)}return d}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Qb extends ct{getClientMatrix(){return at(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new N(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=N.create(e,t);return Oe.transformPoint(s,this.graph.matrix())}localToClientPoint(e,t){const s=N.create(e,t);return Oe.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=G.create(e,t,s,r);return Oe.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,s,r){const i=G.create(e,t,s,r);return Oe.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=N.create(e,t);return Oe.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const s=N.create(e,t);return Oe.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const s=N.create(e,t);return Oe.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const r=N.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(e,t,s,r){const i=G.create(e,t,s,r);return Oe.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,s,r){const i=G.create(e,t,s,r);return Oe.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,s,r){const i=G.create(e,t,s,r);return Oe.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var h3=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 Al extends ct{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=es.registry.get(i);return o==null?es.registry.onNotFound(i):(es.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(e,t){return Gu(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()}}h3([Al.dispose()],Al.prototype,"dispose",null);var f3=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 e0 extends ct{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&&cl.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(){cl.clear(this.graph.container)}}f3([ct.dispose()],e0.prototype,"dispose",null);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 z extends Ve{get container(){return this.options.container}get[Symbol.toStringTag](){return z.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=Co.get(e),this.css=new bd(this),this.view=new Dn(this),this.defs=new Zb(this),this.coord=new Qb(this),this.transform=new Xb(this),this.highlight=new Al(this),this.grid=new wd(this),this.background=new xd(this),this.options.model?this.model=this.options.model:(this.model=new st,this.model.graph=this),this.renderer=new Sd(this),this.panning=new vd(this),this.mousewheel=new Cd(this),this.virtualRender=new Jb(this),this.size=new e0(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=>Ye.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=>Fe.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 ge.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return G.isRectangleLike(e)?this.findViewsInArea(e):N.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 G.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 G.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 G.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 G.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 G.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 G.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 G.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()})}}p3([Ve.dispose()],z.prototype,"dispose",null),function(n){n.View=Dn,n.Renderer=Sd,n.MouseWheel=Cd,n.DefsManager=Zb,n.GridManager=wd,n.CoordManager=Qb,n.TransformManager=Xb,n.HighlightManager=Al,n.BackgroundManager=xd,n.PanningManager=vd}(z||(z={})),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}(z||(z={})),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}(z||(z={})),function(n){n.registerNode=Ye.registry.register,n.registerEdge=Fe.registry.register,n.registerView=We.registry.register,n.registerAttr=Vn.registry.register,n.registerGrid=Ms.registry.register,n.registerFilter=ti.registry.register,n.registerNodeTool=ii.registry.register,n.registerEdgeTool=oi.registry.register,n.registerBackground=fo.registry.register,n.registerHighlighter=es.registry.register,n.registerPortLayout=lr.registry.register,n.registerPortLabelLayout=si.registry.register,n.registerMarker=_s.registry.register,n.registerRouter=Ds.registry.register,n.registerConnector=cr.registry.register,n.registerAnchor=ai.registry.register,n.registerEdgeAnchor=li.registry.register,n.registerConnectionPoint=ci.registry.register}(z||(z={})),function(n){n.unregisterNode=Ye.registry.unregister,n.unregisterEdge=Fe.registry.unregister,n.unregisterView=We.registry.unregister,n.unregisterAttr=Vn.registry.unregister,n.unregisterGrid=Ms.registry.unregister,n.unregisterFilter=ti.registry.unregister,n.unregisterNodeTool=ii.registry.unregister,n.unregisterEdgeTool=oi.registry.unregister,n.unregisterBackground=fo.registry.unregister,n.unregisterHighlighter=es.registry.unregister,n.unregisterPortLayout=lr.registry.unregister,n.unregisterPortLabelLayout=si.registry.unregister,n.unregisterMarker=_s.registry.unregister,n.unregisterRouter=Ds.registry.unregister,n.unregisterConnector=cr.registry.unregister,n.unregisterAnchor=ai.registry.unregister,n.unregisterEdgeAnchor=li.registry.unregister,n.unregisterConnectionPoint=ci.registry.unregister}(z||(z={}));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},m3=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 pi extends Ye{}(function(n){class e extends xn{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){no(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:Bt(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}g3([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),xn.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(pi||(pi={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},De.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ye.registry.register("html",n,!0)}(pi||(pi={})),function(n){n.shapeMaps={};function e(t){const{shape:s,html:r,effect:i,inherit:o}=t,a=m3(t,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},z.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(pi||(pi={}));var y3=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 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({},it.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");pe(e,"draggable","false");const t=e.cloneNode(!0);se(t,this.rotateClassName);const s=it.POSITIONS.map(r=>{const i=e.cloneNode(!0);return se(i,this.resizeClassName),pe(i,"data-position",r),i});this.empty(),Bt(this.container,[...s,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(it.NODE_CLS),se(this.container,this.containerClassName),yn(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),yn(this.container,"no-resize",!this.options.resizable),yn(this.container,"no-rotate",!this.options.rotatable),this.options.className&&se(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 Ze(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(it.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=ye.normalize(this.node.getAngle()),t=Math.floor(e*(it.DIRECTIONS.length/360));if(t!==this.prevShift){const s=it.DIRECTIONS.slice(t).concat(it.DIRECTIONS.slice(0,t)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{Le(o,it.DIRECTIONS.map(c=>r(c)).join(" ")),se(o,r(s[a]))}),this.prevShift=t}}getTrueDirection(e){const t=ye.normalize(this.node.getAngle());let s=it.POSITIONS.indexOf(e);return s+=Math.floor(t*(it.POSITIONS.length/360)),s%=it.POSITIONS.length,it.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=pe(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:N.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=Et(i,m.left+g,m.right-g),o=Et(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=N.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=Se.snapToGrid(m,d),y=Se.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 C=p.width*y/p.height,E=p.height*m/p.width;m<C?y=E:m=C}const x=s.relativeDirection;if(f.allowReverse&&(b<=-m||w<=-y)){let C;x==="left"?b<=-m&&(C="right"):x==="right"?b<=-m&&(C="left"):x==="top"?w<=-y&&(C="bottom"):x==="bottom"?w<=-y&&(C="top"):x==="top-left"?b<=-m&&w<=-y?C="bottom-right":b<=-m?C="top-right":w<=-y&&(C="bottom-left"):x==="top-right"?b<=-m&&w<=-y?C="bottom-left":b<=-m?C="top-left":w<=-y&&(C="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?C="top-right":b<=-m?C="bottom-right":w<=-y&&(C="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?C="top-left":b<=-m?C="bottom-left":w<=-y&&(C="top-right"));const E=C;this.stopHandle();const v=this.container.querySelector(`.${this.resizeClassName}[data-position="${E}"]`);this.startHandle(v),this.prepareResizing(e,E),this.onMouseMove(e)}if(p.width!==m||p.height!==y){const C={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,C),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-N.create(u).theta(s.center);let m=s.angle+g;f.rotateGrid&&(m=Se.snapToGrid(m,f.rotateGrid)),m=ye.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,se(this.container,`${this.containerClassName}-active`),e){se(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const s=it.DIRECTIONS[it.POSITIONS.indexOf(t)];se(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(Le(this.container,`${this.containerClassName}-active`),this.handle){Le(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=it.DIRECTIONS[it.POSITIONS.indexOf(e)];Le(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(it.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()}}y3([be.dispose()],t0.prototype,"dispose",null);var it;(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}})(it||(it={}));const b3=`.x6-widget-transform {
282
+ `;class lt extends bt{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 n3=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 lt{init(){Kr("core",t3)}dispose(){Zr("core")}}n3([bd.dispose()],bd.prototype,"dispose",null);var s3=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},Co;(function(n){function e(t){const{grid:s,panning:r,mousewheel:i,embedding:o}=t,a=s3(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=qe({},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})(Co||(Co={})),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:Jt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Jt.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 XB}},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}}(Co||(Co={}));var r3=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},i3=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 wd extends lt{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=i3(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,ae.create("pattern",{id:d,patternUnits:"userSpaceOnUse"},ae.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 Ms),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Ms.presets.dot),e.args)];const s=Ms.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 Ms.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}r3([lt.dispose()],wd.prototype,"dispose",null);class Xb extends lt{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),ot(this.viewportMatrix)}setMatrix(e){const t=ot(e),s=Xr(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 Ic(e)||(e=this.container.clientWidth),Ic(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 Ct(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 pR(this.getMatrix())}rotate(e,t,s){if(t==null||s==null){const i=Ee.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 gR(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=xs(s),o=r.border||0,a=r.contentArea?W.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 W(-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=N.create(b)}else s=this.getContentBBox(e),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=xs(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=W.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=Ct(g,c,u),m=Ct(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 W:Ee.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=W.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const s=W.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=mn(t,Math.max(0,r.width)),t<0&&(t=r.width+t),s=mn(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=W.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 o3=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 xd extends lt{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=W.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=fo.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=Pc(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=Pc(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()}}o3([lt.dispose()],xd.prototype,"dispose",null);var a3=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 vd extends lt{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),dt.on(this.graph.container,"mousedown",this.onRightMouseDown),dt.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Fy(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),dt.off(this.graph.container,"mousedown",this.onRightMouseDown),dt.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&Es.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(),dt.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)}),dt.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(),dt.off(document.body,".panning"),dt.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?(te(e,t),Ie(e,s)):(Ie(e,t),te(e,s)):(Ie(e,t),Ie(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()}}a3([lt.dispose()],vd.prototype,"dispose",null);var l3=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 lt{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 Fy(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))&&Es.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&Es.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=Ct(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()}}l3([bt.dispose()],Cd.prototype,"dispose",null);var c3=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 lt{init(){this.resetRenderArea=XN(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()}}c3([lt.dispose()],Jb.prototype,"dispose",null);class u3{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&rs.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 rs;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(rs||(rs={}));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 st extends bt{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new u3,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,st.FLAG_INSERT,t,rs.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,s={},r=rs.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=rs.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===st.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=st.FLAG_INSERT;else{const c=this.createCellView(s);c&&(c.graph=this.graph,o=st.FLAG_INSERT|c.getBootstrapFlag(),a={view:c,flag:o,options:t,state:st.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===st.ViewState.MOUNTED?(a=this.updateView(e,t,s),o.flag=a):o.state=st.ViewState.WAITING,a&&r.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:rs.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===st.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(He.isCellView(e)){if(t&st.FLAG_REMOVE)return this.removeView(e.cell),0;t&st.FLAG_INSERT&&(this.insertView(e),t^=st.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=st.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&&Ke(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=ne(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=He.registry.get(r);return i?new i(e,t):He.registry.onNotFound(r)}return e.isNode()?new xn(e,t):e.isEdge()?new ss(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()?rs.RenderNode:rs.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}d3([bt.dispose()],st.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(st||(st={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(st||(st={}));var h3=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 Sd extends lt{constructor(){super(...arguments),this.schedule=new st(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?Ee.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=W.create(e);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(t.nodeOnly&&!r.isNodeView())return!1;const i=Ee.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()}}h3([lt.dispose()],Sd.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};class Zb extends lt{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}-${zu(JSON.stringify(e))}`),!this.isDefined(t)){const r=ti.registry.get(s);if(r==null)return ti.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});ae.create(Ve.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}-${zu(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);ae.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=Kb(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=t;if(d||(d=`marker-${this.cid}-${zu(JSON.stringify(e))}`),!this.isDefined(d)){a!=="path"&&delete u.d;const h=ae.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=Kb(f,["tagName"]);return ae.create(`${p}`||"path",so(Object.assign(Object.assign({},u),g)))}):[ae.create(a||"path",so(u))]);this.defs.appendChild(h.node)}return d}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Qb extends lt{getClientMatrix(){return ot(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new N(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=N.create(e,t);return Ee.transformPoint(s,this.graph.matrix())}localToClientPoint(e,t){const s=N.create(e,t);return Ee.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=W.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,s,r){const i=W.create(e,t,s,r);return Ee.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=N.create(e,t);return Ee.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const s=N.create(e,t);return Ee.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const s=N.create(e,t);return Ee.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const r=N.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(e,t,s,r){const i=W.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,s,r){const i=W.create(e,t,s,r);return Ee.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,s,r){const i=W.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,s,r){const i=W.create(e,t,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var f3=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 Pl extends lt{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=ts.registry.get(i);return o==null?ts.registry.onNotFound(i):(ts.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(e,t){return Gu(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()}}f3([Pl.dispose()],Pl.prototype,"dispose",null);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 e0 extends lt{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&&al.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(){al.clear(this.graph.container)}}p3([lt.dispose()],e0.prototype,"dispose",null);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 z extends ke{get container(){return this.options.container}get[Symbol.toStringTag](){return z.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=Co.get(e),this.css=new bd(this),this.view=new Dn(this),this.defs=new Zb(this),this.coord=new Qb(this),this.transform=new Xb(this),this.highlight=new Pl(this),this.grid=new wd(this),this.background=new xd(this),this.options.model?this.model=this.options.model:(this.model=new nt,this.model.graph=this),this.renderer=new Sd(this),this.panning=new vd(this),this.mousewheel=new Cd(this),this.virtualRender=new Jb(this),this.size=new e0(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=>Ge.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=>$e.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 W.isRectangleLike(e)?this.findViewsInArea(e):N.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 W.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 W.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 W.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 W.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 W.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 W.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 W.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()})}}g3([ke.dispose()],z.prototype,"dispose",null),function(n){n.View=Dn,n.Renderer=Sd,n.MouseWheel=Cd,n.DefsManager=Zb,n.GridManager=wd,n.CoordManager=Qb,n.TransformManager=Xb,n.HighlightManager=Pl,n.BackgroundManager=xd,n.PanningManager=vd}(z||(z={})),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}(z||(z={})),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}(z||(z={})),function(n){n.registerNode=Ge.registry.register,n.registerEdge=$e.registry.register,n.registerView=He.registry.register,n.registerAttr=Vn.registry.register,n.registerGrid=Ms.registry.register,n.registerFilter=ti.registry.register,n.registerNodeTool=ii.registry.register,n.registerEdgeTool=oi.registry.register,n.registerBackground=fo.registry.register,n.registerHighlighter=ts.registry.register,n.registerPortLayout=lr.registry.register,n.registerPortLabelLayout=si.registry.register,n.registerMarker=_s.registry.register,n.registerRouter=Ds.registry.register,n.registerConnector=cr.registry.register,n.registerAnchor=ai.registry.register,n.registerEdgeAnchor=li.registry.register,n.registerConnectionPoint=ci.registry.register}(z||(z={})),function(n){n.unregisterNode=Ge.registry.unregister,n.unregisterEdge=$e.registry.unregister,n.unregisterView=He.registry.unregister,n.unregisterAttr=Vn.registry.unregister,n.unregisterGrid=Ms.registry.unregister,n.unregisterFilter=ti.registry.unregister,n.unregisterNodeTool=ii.registry.unregister,n.unregisterEdgeTool=oi.registry.unregister,n.unregisterBackground=fo.registry.unregister,n.unregisterHighlighter=ts.registry.unregister,n.unregisterPortLayout=lr.registry.unregister,n.unregisterPortLabelLayout=si.registry.unregister,n.unregisterMarker=_s.registry.unregister,n.unregisterRouter=Ds.registry.unregister,n.unregisterConnector=cr.registry.unregister,n.unregisterAnchor=ai.registry.unregister,n.unregisterEdgeAnchor=li.registry.unregister,n.unregisterConnectionPoint=ci.registry.unregister}(z||(z={}));var m3=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},y3=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 pi extends Ge{}(function(n){class e extends xn{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){no(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:Lt(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}m3([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),xn.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(pi||(pi={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Ve.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ge.registry.register("html",n,!0)}(pi||(pi={})),function(n){n.shapeMaps={};function e(t){const{shape:s,html:r,effect:i,inherit:o}=t,a=y3(t,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},z.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(pi||(pi={}));var b3=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 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({},rt.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);te(t,this.rotateClassName);const s=rt.POSITIONS.map(r=>{const i=e.cloneNode(!0);return te(i,this.resizeClassName),fe(i,"data-position",r),i});this.empty(),Lt(this.container,[...s,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(rt.NODE_CLS),te(this.container,this.containerClassName),yn(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),yn(this.container,"no-resize",!this.options.resizable),yn(this.container,"no-rotate",!this.options.rotatable),this.options.className&&te(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 Ke(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(rt.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=me.normalize(this.node.getAngle()),t=Math.floor(e*(rt.DIRECTIONS.length/360));if(t!==this.prevShift){const s=rt.DIRECTIONS.slice(t).concat(rt.DIRECTIONS.slice(0,t)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{Ie(o,rt.DIRECTIONS.map(c=>r(c)).join(" ")),te(o,r(s[a]))}),this.prevShift=t}}getTrueDirection(e){const t=me.normalize(this.node.getAngle());let s=rt.POSITIONS.indexOf(e);return s+=Math.floor(t*(rt.POSITIONS.length/360)),s%=rt.POSITIONS.length,rt.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:N.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=Ct(i,m.left+g,m.right-g),o=Ct(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=N.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,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 C=p.width*y/p.height,E=p.height*m/p.width;m<C?y=E:m=C}const x=s.relativeDirection;if(f.allowReverse&&(b<=-m||w<=-y)){let C;x==="left"?b<=-m&&(C="right"):x==="right"?b<=-m&&(C="left"):x==="top"?w<=-y&&(C="bottom"):x==="bottom"?w<=-y&&(C="top"):x==="top-left"?b<=-m&&w<=-y?C="bottom-right":b<=-m?C="top-right":w<=-y&&(C="bottom-left"):x==="top-right"?b<=-m&&w<=-y?C="bottom-left":b<=-m?C="top-left":w<=-y&&(C="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?C="top-right":b<=-m?C="bottom-right":w<=-y&&(C="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?C="top-left":b<=-m?C="bottom-left":w<=-y&&(C="top-right"));const E=C;this.stopHandle();const v=this.container.querySelector(`.${this.resizeClassName}[data-position="${E}"]`);this.startHandle(v),this.prepareResizing(e,E),this.onMouseMove(e)}if(p.width!==m||p.height!==y){const C={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,C),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-N.create(u).theta(s.center);let m=s.angle+g;f.rotateGrid&&(m=Ce.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,te(this.container,`${this.containerClassName}-active`),e){te(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const s=rt.DIRECTIONS[rt.POSITIONS.indexOf(t)];te(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(Ie(this.container,`${this.containerClassName}-active`),this.handle){Ie(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=rt.DIRECTIONS[rt.POSITIONS.indexOf(e)];Ie(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(rt.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()}}b3([ye.dispose()],t0.prototype,"dispose",null);var rt;(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}})(rt||(rt={}));const w3=`.x6-widget-transform {
283
283
  position: absolute;
284
284
  box-sizing: content-box !important;
285
285
  margin: -5px 0 0 -5px;
@@ -405,7 +405,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
405
405
  display: block;
406
406
  background-color: #808080;
407
407
  }
408
- `;z.prototype.createTransformWidget=function(n){const e=this.getPlugin("transform");return e&&e.createWidget(n),this},z.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var w3=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 ur extends Ve{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,Kr(this.name,b3)}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 t0(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=ur.parseOptionGroup(this.graph,e,this.options.resizing),s=ur.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(),Zr(this.name)}}w3([Ve.dispose()],ur.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}(ur||(ur={}));var n0={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(S,O,_){if(S.addEventListener){S.addEventListener(O,_,!1);return}S.attachEvent("on"+O,_)}function h(S){if(S.type=="keypress"){var O=String.fromCharCode(S.which);return S.shiftKey||(O=O.toLowerCase()),O}return r[S.which]?r[S.which]:i[S.which]?i[S.which]:String.fromCharCode(S.which).toLowerCase()}function f(S,O){return S.sort().join(",")===O.sort().join(",")}function p(S){var O=[];return S.shiftKey&&O.push("shift"),S.altKey&&O.push("alt"),S.ctrlKey&&O.push("ctrl"),S.metaKey&&O.push("meta"),O}function g(S){if(S.preventDefault){S.preventDefault();return}S.returnValue=!1}function m(S){if(S.stopPropagation){S.stopPropagation();return}S.cancelBubble=!0}function y(S){return S=="shift"||S=="ctrl"||S=="alt"||S=="meta"}function b(){if(!c){c={};for(var S in r)S>95&&S<112||r.hasOwnProperty(S)&&(c[r[S]]=S)}return c}function w(S,O,_){return _||(_=b()[S]?"keydown":"keypress"),_=="keypress"&&O.length&&(_="keydown"),_}function x(S){return S==="+"?["+"]:(S=S.replace(/\+{2}/g,"+plus"),S.split("+"))}function C(S,O){var _,T,A,V=[];for(_=x(S),A=0;A<_.length;++A)T=_[A],a[T]&&(T=a[T]),O&&O!="keypress"&&o[T]&&(T=o[T],V.push("shift")),y(T)&&V.push(T);return O=w(T,V,O),{key:T,modifiers:V,action:O}}function E(S,O){return S===null||S===t?!1:S===O?!0:E(S.parentNode,O)}function v(S){var O=this;if(S=S||t,!(O instanceof v))return new v(S);O.target=S,O._callbacks={},O._directMap={};var _={},T,A=!1,V=!1,L=!1;function B($){$=$||{};var D=!1,U;for(U in _){if($[U]){D=!0;continue}_[U]=0}D||(L=!1)}function P($,D,U,ne,Q,F){var R,re,q=[],J=U.type;if(!O._callbacks[$])return[];for(J=="keyup"&&y($)&&(D=[$]),R=0;R<O._callbacks[$].length;++R)if(re=O._callbacks[$][R],!(!ne&&re.seq&&_[re.seq]!=re.level)&&J==re.action&&(J=="keypress"&&!U.metaKey&&!U.ctrlKey||f(D,re.modifiers))){var Ee=!ne&&re.combo==Q,je=ne&&re.seq==ne&&re.level==F;(Ee||je)&&O._callbacks[$].splice(R,1),q.push(re)}return q}function M($,D,U,ne){O.stopCallback(D,D.target||D.srcElement,U,ne)||$(D,U)===!1&&(g(D),m(D))}O._handleKey=function($,D,U){var ne=P($,D,U),Q,F={},R=0,re=!1;for(Q=0;Q<ne.length;++Q)ne[Q].seq&&(R=Math.max(R,ne[Q].level));for(Q=0;Q<ne.length;++Q){if(ne[Q].seq){if(ne[Q].level!=R)continue;re=!0,F[ne[Q].seq]=1,M(ne[Q].callback,U,ne[Q].combo,ne[Q].seq);continue}re||M(ne[Q].callback,U,ne[Q].combo)}var q=U.type=="keypress"&&V;U.type==L&&!y($)&&!q&&B(F),V=re&&U.type=="keydown"};function k($){typeof $.which!="number"&&($.which=$.keyCode);var D=h($);if(D){if($.type=="keyup"&&A===D){A=!1;return}O.handleKey(D,p($),$)}}function j(){clearTimeout(T),T=setTimeout(B,1e3)}function W($,D,U,ne){_[$]=0;function Q(J){return function(){L=J,++_[$],j()}}function F(J){M(U,J,$),ne!=="keyup"&&(A=h(J)),setTimeout(B,10)}for(var R=0;R<D.length;++R){var re=R+1===D.length,q=re?F:Q(ne||C(D[R+1]).action);Z(D[R],q,ne,$,R)}}function Z($,D,U,ne,Q){O._directMap[$+":"+U]=D,$=$.replace(/\s+/g," ");var F=$.split(" "),R;if(F.length>1){W($,F,D,U);return}R=C($,U),O._callbacks[R.key]=O._callbacks[R.key]||[],P(R.key,R.modifiers,{type:R.action},ne,$,Q),O._callbacks[R.key][ne?"unshift":"push"]({callback:D,modifiers:R.modifiers,action:R.action,seq:ne,level:Q,combo:$})}O._bindMultiple=function($,D,U){for(var ne=0;ne<$.length;++ne)Z($[ne],D,U)},d(S,"keypress",k),d(S,"keydown",k),d(S,"keyup",k)}v.prototype.bind=function(S,O,_){var T=this;return S=S instanceof Array?S:[S],T._bindMultiple.call(T,S,O,_),T},v.prototype.unbind=function(S,O){var _=this;return _.bind.call(_,S,function(){},O)},v.prototype.trigger=function(S,O){var _=this;return _._directMap[S+":"+O]&&_._directMap[S+":"+O]({},S),_},v.prototype.reset=function(){var S=this;return S._callbacks={},S._directMap={},S},v.prototype.stopCallback=function(S,O){var _=this;if((" "+O.className+" ").indexOf(" mousetrap ")>-1||E(O,_.target))return!1;if("composedPath"in S&&typeof S.composedPath=="function"){var T=S.composedPath()[0];T!==S.target&&(O=T)}return O.tagName=="INPUT"||O.tagName=="SELECT"||O.tagName=="TEXTAREA"||O.isContentEditable},v.prototype.handleKey=function(){var S=this;return S._handleKey.apply(S,arguments)},v.addKeycodes=function(S){for(var O in S)S.hasOwnProperty(O)&&(r[O]=S[O]);c=null},v.init=function(){var S=v(t);for(var O in S)O.charAt(0)!=="_"&&(v[O]=function(_){return function(){return S[_].apply(S,arguments)}}(O))},v.init(),e.Mousetrap=v,n.exports&&(n.exports=v)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(n0);var x3=n0.exports;const v3=rk(x3);var C3=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 gi extends xt{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=gi.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?ie(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:qu(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 pe(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 ie(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}C3([xt.dispose()],gi.prototype,"dispose",null),function(n){function e(t){const s=new v3(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}(gi||(gi={})),z.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},z.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},z.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},z.prototype.toggleKeyboard=function(n){const e=this.getPlugin("keyboard");return e&&e.toggleEnabled(n),this},z.prototype.bindKey=function(n,e,t){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,e,t),this},z.prototype.unbindKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.unbindKey(n,e),this},z.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},z.prototype.triggerKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.trigger(n,e),this};var S3=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 xt{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new gi(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()}}S3([xt.dispose()],s0.prototype,"dispose",null);var E3=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},O3=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 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=O3(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 le("svg"),t=this.horizontal=new le("line"),s=this.vertical=new le("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"?ie(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,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(V=>{if(this.isIgnored(e,V))return!1;const L=V.getBBox().bbox(V.getAngle()),B=L.getTopLeft(),P=L.getBottomRight(),M={vertical:[B.x,P.x],horizontal:[B.y,P.y]},k={};return Object.keys(M).forEach(j=>{const W=j,Z=M[W].map($=>({position:$,distance:Math.abs($-y[W])})).filter($=>$.distance<=u);k[W]=$c(Z,$=>$.distance)}),d==null&&k.vertical.length>0&&(d=k.vertical[0].position,h=Math.min(i.y,L.y),f=Math.max(a.y,P.y)-h),p==null&&k.horizontal.length>0&&(p=k.horizontal[0].position,g=Math.min(i.x,L.x),m=Math.max(a.x,P.x)-g),d!=null&&p!=null}),this.hide();let C=0,E=0;(p!=null||d!=null)&&(d!=null&&(C=w.indexOf("right")!==-1?d-a.x:o.x-d),p!=null&&(E=w.indexOf("bottom")!==-1?p-a.y:o.y-p));let v=0,S=0;if(c%90===0)c===90||c===270?(v=E,S=C):(v=C,S=E);else{const V=c>=0&&c<90?1:c>=90&&c<180?4:c>=180&&c<270?3:2;p!=null&&d!=null&&(C<E?(E=0,p=void 0):(C=0,d=void 0));const L=ye.toRad(c%90);C&&(v=V===3?C/Math.cos(L):C/Math.sin(L)),E&&(S=V===3?E/Math.cos(L):E/Math.sin(L));const B=V===1||V===3;switch(x){case"top":case"bottom":S=E?E/(B?Math.cos(L):Math.sin(L)):C/(B?Math.sin(L):Math.cos(L));break;case"left":case"right":v=C?C/(B?Math.cos(L):Math.sin(L)):E/(B?Math.sin(L):Math.cos(L));break}}switch(x){case"top":case"bottom":v=0;break;case"left":case"right":S=0;break}const O=this.graph.getGridSize();let _=Math.max(r.width+v,O),T=Math.max(r.height+S,O);t.minWidth&&t.minWidth>O&&(_=Math.max(_,t.minWidth)),t.minHeight&&t.minHeight>O&&(T=Math.max(T,t.minHeight)),t.maxWidth&&(_=Math.min(_,t.maxWidth)),t.maxHeight&&(T=Math.min(T,t.maxHeight)),t.preserveAspectRatio&&(S<v?T=_*(r.height/r.width):_=T*(r.width/r.height)),(_!==r.width||T!==r.height)&&(e.resize(_,T,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),f&&(f+=T-r.height),m&&(m+=_-r.width));const A=e.getBBox().bbox(c);d&&Math.abs(A.x-d)>1&&Math.abs(A.width+A.x-d)>1&&(d=void 0),p&&Math.abs(A.y-p)>1&&Math.abs(A.height+A.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 G(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,C,E,v=0,S=0;if(this.model.getNodes().some(O=>{if(this.isIgnored(o,O))return!1;const _=O.getBBox().bbox(O.getAngle()),T=_.getCenter(),A=_.getTopLeft(),V=_.getBottomRight();return y==null&&(Math.abs(T.x-h.x)<m?(y=T.x,v=.5):Math.abs(A.x-p.x)<m?(y=A.x,v=0):Math.abs(A.x-g.x)<m?(y=A.x,v=1):Math.abs(V.x-g.x)<m?(y=V.x,v=1):Math.abs(V.x-p.x)<m&&(y=V.x),y!=null&&(b=Math.min(f.y,_.y),w=Math.max(g.y,V.y)-b)),x==null&&(Math.abs(T.y-h.y)<m?(x=T.y,S=.5):Math.abs(A.y-p.y)<m?x=A.y:Math.abs(A.y-g.y)<m?(x=A.y,S=1):Math.abs(V.y-g.y)<m?(x=V.y,S=1):Math.abs(V.y-p.y)<m&&(x=V.y),x!=null&&(C=Math.min(f.x,_.x),E=Math.max(g.x,V.x)-C)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(f.y=x-S*f.height),y!=null&&(f.x=y-v*f.width);const O=f.getCenter(),_=O.x-u.width/2,T=O.y-u.height/2,A=_-c.x,V=T-c.y;(A!==0||V!==0)&&(o.translate(A,V,{snapped:!0,restrict:this.getRestrictArea(i)}),E&&(E+=A),w&&(w+=V)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:C,horizontalWidth:E})}}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"?ie(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new N(e.horizontalLeft,e.horizontalTop)),s=this.graph.localToGraph(new N(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 N(e.verticalLeft,e.verticalTop)),s=this.graph.localToGraph(new N(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()}}E3([be.dispose()],r0.prototype,"dispose",null);const M3=`.x6-widget-snapline {
408
+ `;z.prototype.createTransformWidget=function(n){const e=this.getPlugin("transform");return e&&e.createWidget(n),this},z.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var x3=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 ur extends ke{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,Kr(this.name,w3)}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 t0(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=ur.parseOptionGroup(this.graph,e,this.options.resizing),s=ur.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(),Zr(this.name)}}x3([ke.dispose()],ur.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}(ur||(ur={}));var n0={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(S,O,_){if(S.addEventListener){S.addEventListener(O,_,!1);return}S.attachEvent("on"+O,_)}function h(S){if(S.type=="keypress"){var O=String.fromCharCode(S.which);return S.shiftKey||(O=O.toLowerCase()),O}return r[S.which]?r[S.which]:i[S.which]?i[S.which]:String.fromCharCode(S.which).toLowerCase()}function f(S,O){return S.sort().join(",")===O.sort().join(",")}function p(S){var O=[];return S.shiftKey&&O.push("shift"),S.altKey&&O.push("alt"),S.ctrlKey&&O.push("ctrl"),S.metaKey&&O.push("meta"),O}function g(S){if(S.preventDefault){S.preventDefault();return}S.returnValue=!1}function m(S){if(S.stopPropagation){S.stopPropagation();return}S.cancelBubble=!0}function y(S){return S=="shift"||S=="ctrl"||S=="alt"||S=="meta"}function b(){if(!c){c={};for(var S in r)S>95&&S<112||r.hasOwnProperty(S)&&(c[r[S]]=S)}return c}function w(S,O,_){return _||(_=b()[S]?"keydown":"keypress"),_=="keypress"&&O.length&&(_="keydown"),_}function x(S){return S==="+"?["+"]:(S=S.replace(/\+{2}/g,"+plus"),S.split("+"))}function C(S,O){var _,T,A,D=[];for(_=x(S),A=0;A<_.length;++A)T=_[A],a[T]&&(T=a[T]),O&&O!="keypress"&&o[T]&&(T=o[T],D.push("shift")),y(T)&&D.push(T);return O=w(T,D,O),{key:T,modifiers:D,action:O}}function E(S,O){return S===null||S===t?!1:S===O?!0:E(S.parentNode,O)}function v(S){var O=this;if(S=S||t,!(O instanceof v))return new v(S);O.target=S,O._callbacks={},O._directMap={};var _={},T,A=!1,D=!1,L=!1;function j(F){F=F||{};var q=!1,X;for(X in _){if(F[X]){q=!0;continue}_[X]=0}q||(L=!1)}function P(F,q,X,Q,se,H){var I,re,B=[],Z=X.type;if(!O._callbacks[F])return[];for(Z=="keyup"&&y(F)&&(q=[F]),I=0;I<O._callbacks[F].length;++I)if(re=O._callbacks[F][I],!(!Q&&re.seq&&_[re.seq]!=re.level)&&Z==re.action&&(Z=="keypress"&&!X.metaKey&&!X.ctrlKey||f(q,re.modifiers))){var Se=!Q&&re.combo==se,We=Q&&re.seq==Q&&re.level==H;(Se||We)&&O._callbacks[F].splice(I,1),B.push(re)}return B}function M(F,q,X,Q){O.stopCallback(q,q.target||q.srcElement,X,Q)||F(q,X)===!1&&(g(q),m(q))}O._handleKey=function(F,q,X){var Q=P(F,q,X),se,H={},I=0,re=!1;for(se=0;se<Q.length;++se)Q[se].seq&&(I=Math.max(I,Q[se].level));for(se=0;se<Q.length;++se){if(Q[se].seq){if(Q[se].level!=I)continue;re=!0,H[Q[se].seq]=1,M(Q[se].callback,X,Q[se].combo,Q[se].seq);continue}re||M(Q[se].callback,X,Q[se].combo)}var B=X.type=="keypress"&&D;X.type==L&&!y(F)&&!B&&j(H),D=re&&X.type=="keydown"};function k(F){typeof F.which!="number"&&(F.which=F.keyCode);var q=h(F);if(q){if(F.type=="keyup"&&A===q){A=!1;return}O.handleKey(q,p(F),F)}}function $(){clearTimeout(T),T=setTimeout(j,1e3)}function V(F,q,X,Q){_[F]=0;function se(Z){return function(){L=Z,++_[F],$()}}function H(Z){M(X,Z,F),Q!=="keyup"&&(A=h(Z)),setTimeout(j,10)}for(var I=0;I<q.length;++I){var re=I+1===q.length,B=re?H:se(Q||C(q[I+1]).action);U(q[I],B,Q,F,I)}}function U(F,q,X,Q,se){O._directMap[F+":"+X]=q,F=F.replace(/\s+/g," ");var H=F.split(" "),I;if(H.length>1){V(F,H,q,X);return}I=C(F,X),O._callbacks[I.key]=O._callbacks[I.key]||[],P(I.key,I.modifiers,{type:I.action},Q,F,se),O._callbacks[I.key][Q?"unshift":"push"]({callback:q,modifiers:I.modifiers,action:I.action,seq:Q,level:se,combo:F})}O._bindMultiple=function(F,q,X){for(var Q=0;Q<F.length;++Q)U(F[Q],q,X)},d(S,"keypress",k),d(S,"keydown",k),d(S,"keyup",k)}v.prototype.bind=function(S,O,_){var T=this;return S=S instanceof Array?S:[S],T._bindMultiple.call(T,S,O,_),T},v.prototype.unbind=function(S,O){var _=this;return _.bind.call(_,S,function(){},O)},v.prototype.trigger=function(S,O){var _=this;return _._directMap[S+":"+O]&&_._directMap[S+":"+O]({},S),_},v.prototype.reset=function(){var S=this;return S._callbacks={},S._directMap={},S},v.prototype.stopCallback=function(S,O){var _=this;if((" "+O.className+" ").indexOf(" mousetrap ")>-1||E(O,_.target))return!1;if("composedPath"in S&&typeof S.composedPath=="function"){var T=S.composedPath()[0];T!==S.target&&(O=T)}return O.tagName=="INPUT"||O.tagName=="SELECT"||O.tagName=="TEXTAREA"||O.isContentEditable},v.prototype.handleKey=function(){var S=this;return S._handleKey.apply(S,arguments)},v.addKeycodes=function(S){for(var O in S)S.hasOwnProperty(O)&&(r[O]=S[O]);c=null},v.init=function(){var S=v(t);for(var O in S)O.charAt(0)!=="_"&&(v[O]=function(_){return function(){return S[_].apply(S,arguments)}}(O))},v.init(),e.Mousetrap=v,n.exports&&(n.exports=v)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(n0);var v3=n0.exports;const C3=rk(v3);var S3=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 gi extends bt{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=gi.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?ne(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:qu(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 ne(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}S3([bt.dispose()],gi.prototype,"dispose",null),function(n){function e(t){const s=new C3(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}(gi||(gi={})),z.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},z.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},z.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},z.prototype.toggleKeyboard=function(n){const e=this.getPlugin("keyboard");return e&&e.toggleEnabled(n),this},z.prototype.bindKey=function(n,e,t){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,e,t),this},z.prototype.unbindKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.unbindKey(n,e),this},z.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},z.prototype.triggerKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.trigger(n,e),this};var E3=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 bt{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new gi(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()}}E3([bt.dispose()],s0.prototype,"dispose",null);var O3=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},M3=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 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=M3(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 ae("svg"),t=this.horizontal=new ae("line"),s=this.vertical=new ae("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"?ne(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(D=>{if(this.isIgnored(e,D))return!1;const L=D.getBBox().bbox(D.getAngle()),j=L.getTopLeft(),P=L.getBottomRight(),M={vertical:[j.x,P.x],horizontal:[j.y,P.y]},k={};return Object.keys(M).forEach($=>{const V=$,U=M[V].map(F=>({position:F,distance:Math.abs(F-y[V])})).filter(F=>F.distance<=u);k[V]=Bc(U,F=>F.distance)}),d==null&&k.vertical.length>0&&(d=k.vertical[0].position,h=Math.min(i.y,L.y),f=Math.max(a.y,P.y)-h),p==null&&k.horizontal.length>0&&(p=k.horizontal[0].position,g=Math.min(i.x,L.x),m=Math.max(a.x,P.x)-g),d!=null&&p!=null}),this.hide();let C=0,E=0;(p!=null||d!=null)&&(d!=null&&(C=w.indexOf("right")!==-1?d-a.x:o.x-d),p!=null&&(E=w.indexOf("bottom")!==-1?p-a.y:o.y-p));let v=0,S=0;if(c%90===0)c===90||c===270?(v=E,S=C):(v=C,S=E);else{const D=c>=0&&c<90?1:c>=90&&c<180?4:c>=180&&c<270?3:2;p!=null&&d!=null&&(C<E?(E=0,p=void 0):(C=0,d=void 0));const L=me.toRad(c%90);C&&(v=D===3?C/Math.cos(L):C/Math.sin(L)),E&&(S=D===3?E/Math.cos(L):E/Math.sin(L));const j=D===1||D===3;switch(x){case"top":case"bottom":S=E?E/(j?Math.cos(L):Math.sin(L)):C/(j?Math.sin(L):Math.cos(L));break;case"left":case"right":v=C?C/(j?Math.cos(L):Math.sin(L)):E/(j?Math.sin(L):Math.cos(L));break}}switch(x){case"top":case"bottom":v=0;break;case"left":case"right":S=0;break}const O=this.graph.getGridSize();let _=Math.max(r.width+v,O),T=Math.max(r.height+S,O);t.minWidth&&t.minWidth>O&&(_=Math.max(_,t.minWidth)),t.minHeight&&t.minHeight>O&&(T=Math.max(T,t.minHeight)),t.maxWidth&&(_=Math.min(_,t.maxWidth)),t.maxHeight&&(T=Math.min(T,t.maxHeight)),t.preserveAspectRatio&&(S<v?T=_*(r.height/r.width):_=T*(r.width/r.height)),(_!==r.width||T!==r.height)&&(e.resize(_,T,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),f&&(f+=T-r.height),m&&(m+=_-r.width));const A=e.getBBox().bbox(c);d&&Math.abs(A.x-d)>1&&Math.abs(A.width+A.x-d)>1&&(d=void 0),p&&Math.abs(A.y-p)>1&&Math.abs(A.height+A.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 W(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,C,E,v=0,S=0;if(this.model.getNodes().some(O=>{if(this.isIgnored(o,O))return!1;const _=O.getBBox().bbox(O.getAngle()),T=_.getCenter(),A=_.getTopLeft(),D=_.getBottomRight();return y==null&&(Math.abs(T.x-h.x)<m?(y=T.x,v=.5):Math.abs(A.x-p.x)<m?(y=A.x,v=0):Math.abs(A.x-g.x)<m?(y=A.x,v=1):Math.abs(D.x-g.x)<m?(y=D.x,v=1):Math.abs(D.x-p.x)<m&&(y=D.x),y!=null&&(b=Math.min(f.y,_.y),w=Math.max(g.y,D.y)-b)),x==null&&(Math.abs(T.y-h.y)<m?(x=T.y,S=.5):Math.abs(A.y-p.y)<m?x=A.y:Math.abs(A.y-g.y)<m?(x=A.y,S=1):Math.abs(D.y-g.y)<m?(x=D.y,S=1):Math.abs(D.y-p.y)<m&&(x=D.y),x!=null&&(C=Math.min(f.x,_.x),E=Math.max(g.x,D.x)-C)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(f.y=x-S*f.height),y!=null&&(f.x=y-v*f.width);const O=f.getCenter(),_=O.x-u.width/2,T=O.y-u.height/2,A=_-c.x,D=T-c.y;(A!==0||D!==0)&&(o.translate(A,D,{snapped:!0,restrict:this.getRestrictArea(i)}),E&&(E+=A),w&&(w+=D)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:C,horizontalWidth:E})}}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"?ne(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new N(e.horizontalLeft,e.horizontalTop)),s=this.graph.localToGraph(new N(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 N(e.verticalLeft,e.verticalTop)),s=this.graph.localToGraph(new N(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()}}O3([ye.dispose()],r0.prototype,"dispose",null);const N3=`.x6-widget-snapline {
409
409
  position: absolute;
410
410
  top: 0;
411
411
  right: 0;
@@ -418,7 +418,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
418
418
  stroke: #2ecc71;
419
419
  stroke-width: 1px;
420
420
  }
421
- `;z.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},z.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},z.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},z.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},z.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},z.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},z.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},z.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},z.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},z.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},z.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},z.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},z.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},z.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},z.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},z.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var N3=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 i0 extends xt{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Kr(this.name,M3)}init(e){this.snaplineImpl=new r0(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(),Zr(this.name)}}N3([xt.dispose()],i0.prototype,"dispose",null);class P3{constructor(){this.cells=[]}copy(e,t,s={}){this.options=Object.assign({},s);const i=(st.isModel(t)?t:t.model).cloneSubGraph(e,s);this.cells=$c(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(e,t,s={}){this.copy(e,t,s),(z.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=z.isGraph(e)?e.model:e;return d.batchUpdate("paste",()=>{d.addCells(this.cells)}),this.copy(u,e,t),u}serialize(e){e.useLocalStorage!==!1&&So.save(this.cells)}deserialize(e){if(e.useLocalStorage){const t=So.fetch();t&&(this.cells=t)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],So.clean()}}var So;(function(n){const e=`${Kt.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 st.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(e)}n.clean=r})(So||(So={})),z.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},z.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},z.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},z.prototype.toggleClipboard=function(n){const e=this.getPlugin("clipboard");return e&&e.toggleEnabled(n),this},z.prototype.isClipboardEmpty=function(n){const e=this.getPlugin("clipboard");return e?e.isEmpty(n):!0},z.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},z.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},z.prototype.copy=function(n,e){const t=this.getPlugin("clipboard");return t&&t.copy(n,e),this},z.prototype.cut=function(n,e){const t=this.getPlugin("clipboard");return t&&t.cut(n,e),this},z.prototype.paste=function(n,e){const t=this.getPlugin("clipboard");return t?t.paste(n,e):[]};var _3=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},A3=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 o0 extends Ve{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 P3,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 A3(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}_3([Ve.dispose()],o0.prototype,"dispose",null),z.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},z.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},z.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},z.prototype.toggleHistory=function(n){const e=this.getPlugin("history");return e&&e.toggleEnabled(n),this},z.prototype.undo=function(n){const e=this.getPlugin("history");return e&&e.undo(n),this},z.prototype.redo=function(n){const e=this.getPlugin("history");return e&&e.redo(n),this},z.prototype.undoAndCancel=function(n){const e=this.getPlugin("history");return e&&e.cancel(n),this},z.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},z.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},z.prototype.cleanHistory=function(n){const e=this.getPlugin("history");return e&&e.clean(n),this},z.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},z.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},z.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},z.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var a0=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 mi extends Ve{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=Be.getOptions(e),this.validator=new mi.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)?Be.sortBatchCommands(e):[e];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},t),jc(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Be.sortBatchCommands(e):[e];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},t),jc(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(Be.isAddEvent(o)&&t||Be.isRemoveEvent(o)&&!t)i&&i.remove(s);else if(Be.isAddEvent(o)&&!t||Be.isRemoveEvent(o)&&t){const a=e.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(Be.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&&ie(a,this,e,t,s)}}addCommand(e,t){if(this.freezed||this.disabled)return;const s=t,r=s.options||{};if(r.dryrun||Be.isAddEvent(e)&&this.options.ignoreAdd||Be.isRemoveEvent(e)&&this.options.ignoreRemove||Be.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&ie(i,this,e,t)===!1)return;e==="cell:change:*"&&(e=`cell:change:${s.key}`);const o=s.cell,a=st.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||Be.isAddEvent(e)||Be.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(Be.isAddEvent(e)||Be.isRemoveEvent(e)){const d=c.data;return c.event=e,c.options=r,d.id=o.id,d.props=ke(o.toJSON()),o.isEdge()?d.edge=!0:o.isNode()&&(d.node=!0),this.push(c,r)}if(Be.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]=ke(o.previous(d)),a?c.modelChange=!0:h.id=o.id),h.next==null&&(h.next={}),h.next[d]=ke(o.prop(d)),this.push(c,r)}const u=this.options.afterAddCommand;u&&ie(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(Be.isAddEvent(i)){const a=t.findIndex(c=>Be.isRemoveEvent(c.event)&&c.data.id===o);if(a>=0){t=t.filter((c,u)=>a<u||c.data.id!==o);continue}}else if(Be.isRemoveEvent(i)){const a=t.findIndex(c=>Be.isAddEvent(c.event)&&c.data.id===o);if(a>=0){t.splice(a,1);continue}}else if(Be.isChangeEvent(i)){const a=r.data;if(Pn(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()}}a0([Ve.dispose()],mi.prototype,"dispose",null),function(n){class e extends Ve{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)}}a0([Ve.dispose()],e.prototype,"dispose",null),n.Validator=e}(mi||(mi={}));var Be;(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})(Be||(Be={}));var T3=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 l0 extends be{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(At.classNames.box)}get $boxes(){return LD(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 _l([],{comparator:At.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=rd(r),o=r.scrollLeft,a=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,s=e.clientY-i.top+window.pageYOffset+a}Ze(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(At.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"?ie(t,this.graph,s):!0)}stopSelecting(e){const t=this.graph,s=this.getEventData(e);switch(s.action){case"selecting":{let i=bR(this.container),o=wR(this.container);const a=rd(this.container),c=t.pageToLocal(a.left,a.top),u=t.transform.getScale();i/=u.sx,o/=u.sy;const d=new G(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(At.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"?ie(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=ge.getCellsBBox(o,{deep:!0})||G.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=Ze(e,"left"),i=Ze(e,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;Ze(e,"left",o+t),Ze(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&&(Ss(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(Ze(this.container,"left")||"0",10),h=parseInt(Ze(this.container,"top")||"0",10);Ze(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)&&(qt(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(),qt(this.$boxes),this.boxCount=0}hide(){Le(this.container,this.prefixClassName(At.classNames.rubberband)),Le(this.container,this.prefixClassName(At.classNames.selected))}showRubberband(){se(this.container,this.prefixClassName(At.classNames.rubberband))}hideRubberband(){Le(this.container,this.prefixClassName(At.classNames.rubberband))}showSelected(){Ju(this.container,"style"),se(this.container,this.prefixClassName(At.classNames.selected))}createContainer(){this.container=document.createElement("div"),se(this.container,this.prefixClassName(At.classNames.root)),this.options.className&&se(this.container,this.options.className),this.selectionContainer=document.createElement("div"),se(this.selectionContainer,this.prefixClassName(At.classNames.inner)),this.selectionContent=document.createElement("div"),se(this.selectionContent,this.prefixClassName(At.classNames.content)),Bt(this.selectionContainer,this.selectionContent),pe(this.selectionContainer,"data-selection-length",this.collection.length),Sy(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)}}),Ze(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),pe(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=ie(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?Ss(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;se(i,r),se(i,`${r}-${e.isNode()?"node":"edge"}`),pe(i,"data-cell-id",e.id),Ze(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),Ss(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=pe(r,"data-cell-id");qt(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()}}T3([be.dispose()],l0.prototype,"dispose",null);var At;(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})(At||(At={}));const k3=`.x6-widget-selection {
421
+ `;z.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},z.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},z.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},z.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},z.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},z.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},z.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},z.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},z.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},z.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},z.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},z.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},z.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},z.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},z.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},z.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};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 i0 extends bt{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Kr(this.name,N3)}init(e){this.snaplineImpl=new r0(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(),Zr(this.name)}}P3([bt.dispose()],i0.prototype,"dispose",null);class _3{constructor(){this.cells=[]}copy(e,t,s={}){this.options=Object.assign({},s);const i=(nt.isModel(t)?t:t.model).cloneSubGraph(e,s);this.cells=Bc(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(e,t,s={}){this.copy(e,t,s),(z.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=z.isGraph(e)?e.model:e;return d.batchUpdate("paste",()=>{d.addCells(this.cells)}),this.copy(u,e,t),u}serialize(e){e.useLocalStorage!==!1&&So.save(this.cells)}deserialize(e){if(e.useLocalStorage){const t=So.fetch();t&&(this.cells=t)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],So.clean()}}var So;(function(n){const e=`${Jt.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 nt.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(e)}n.clean=r})(So||(So={})),z.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},z.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},z.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},z.prototype.toggleClipboard=function(n){const e=this.getPlugin("clipboard");return e&&e.toggleEnabled(n),this},z.prototype.isClipboardEmpty=function(n){const e=this.getPlugin("clipboard");return e?e.isEmpty(n):!0},z.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},z.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},z.prototype.copy=function(n,e){const t=this.getPlugin("clipboard");return t&&t.copy(n,e),this},z.prototype.cut=function(n,e){const t=this.getPlugin("clipboard");return t&&t.cut(n,e),this},z.prototype.paste=function(n,e){const t=this.getPlugin("clipboard");return t?t.paste(n,e):[]};var A3=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},T3=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 o0 extends ke{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 _3,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 T3(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}A3([ke.dispose()],o0.prototype,"dispose",null),z.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},z.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},z.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},z.prototype.toggleHistory=function(n){const e=this.getPlugin("history");return e&&e.toggleEnabled(n),this},z.prototype.undo=function(n){const e=this.getPlugin("history");return e&&e.undo(n),this},z.prototype.redo=function(n){const e=this.getPlugin("history");return e&&e.redo(n),this},z.prototype.undoAndCancel=function(n){const e=this.getPlugin("history");return e&&e.cancel(n),this},z.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},z.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},z.prototype.cleanHistory=function(n){const e=this.getPlugin("history");return e&&e.clean(n),this},z.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},z.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},z.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},z.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var a0=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 mi extends ke{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 mi.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),Lc(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),Lc(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&&ne(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&&ne(i,this,e,t)===!1)return;e==="cell:change:*"&&(e=`cell:change:${s.key}`);const o=s.cell,a=nt.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=Te(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]=Te(o.previous(d)),a?c.modelChange=!0:h.id=o.id),h.next==null&&(h.next={}),h.next[d]=Te(o.prop(d)),this.push(c,r)}const u=this.options.afterAddCommand;u&&ne(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(Pn(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()}}a0([ke.dispose()],mi.prototype,"dispose",null),function(n){class e extends ke{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)}}a0([ke.dispose()],e.prototype,"dispose",null),n.Validator=e}(mi||(mi={}));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 k3=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 l0 extends ye{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Pt.classNames.box)}get $boxes(){return BD(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 Nl([],{comparator:Pt.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=rd(r),o=r.scrollLeft,a=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,s=e.clientY-i.top+window.pageYOffset+a}Ke(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(Pt.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"?ne(t,this.graph,s):!0)}stopSelecting(e){const t=this.graph,s=this.getEventData(e);switch(s.action){case"selecting":{let i=wR(this.container),o=xR(this.container);const a=rd(this.container),c=t.pageToLocal(a.left,a.top),u=t.transform.getScale();i/=u.sx,o/=u.sy;const d=new W(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(Pt.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"?ne(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})||W.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=Ke(e,"left"),i=Ke(e,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;Ke(e,"left",o+t),Ke(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&&(Ss(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(Ke(this.container,"left")||"0",10),h=parseInt(Ke(this.container,"top")||"0",10);Ke(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)&&(Yt(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(),Yt(this.$boxes),this.boxCount=0}hide(){Ie(this.container,this.prefixClassName(Pt.classNames.rubberband)),Ie(this.container,this.prefixClassName(Pt.classNames.selected))}showRubberband(){te(this.container,this.prefixClassName(Pt.classNames.rubberband))}hideRubberband(){Ie(this.container,this.prefixClassName(Pt.classNames.rubberband))}showSelected(){Ju(this.container,"style"),te(this.container,this.prefixClassName(Pt.classNames.selected))}createContainer(){this.container=document.createElement("div"),te(this.container,this.prefixClassName(Pt.classNames.root)),this.options.className&&te(this.container,this.options.className),this.selectionContainer=document.createElement("div"),te(this.selectionContainer,this.prefixClassName(Pt.classNames.inner)),this.selectionContent=document.createElement("div"),te(this.selectionContent,this.prefixClassName(Pt.classNames.content)),Lt(this.selectionContainer,this.selectionContent),fe(this.selectionContainer,"data-selection-length",this.collection.length),Sy(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)}}),Ke(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=ne(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?Ss(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;te(i,r),te(i,`${r}-${e.isNode()?"node":"edge"}`),fe(i,"data-cell-id",e.id),Ke(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),Ss(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");Yt(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()}}k3([ye.dispose()],l0.prototype,"dispose",null);var Pt;(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})(Pt||(Pt={}));const V3=`.x6-widget-selection {
422
422
  position: absolute;
423
423
  top: 0;
424
424
  left: 0;
@@ -483,8 +483,8 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
483
483
  font-size: 10px;
484
484
  background-color: #6a6b8a;
485
485
  }
486
- `;z.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},z.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},z.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},z.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},z.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},z.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},z.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},z.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},z.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},z.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},z.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},z.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},z.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},z.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},z.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},z.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},z.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},z.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},z.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},z.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},z.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},z.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},z.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},z.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},z.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},z.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},z.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},z.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},z.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},z.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},z.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t&&t.unselect(n,e),this};var V3=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 yi extends Ve{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},yi.defaultOptions),e),Kr(this.name,k3)}init(e){this.graph=e,this.selectionImpl=new l0(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&&Es.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&Es.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(),Zr(this.name)}}V3([Ve.dispose()],yi.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"]}}(yi||(yi={}));const Ed="line",Od="pipe",Md="arrow",D3=[{label:"直线",value:Ed},{label:"管道",value:Od},{label:"箭头",value:Md}],Tl=[{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"}],bi="stop",c0=[{label:"停止",value:bi},{label:"正向",value:"forward-pipe"},{label:"反向",value:"reverse-pipe"}],dr="flashing",wi="arrowForward",Nd="arrowBackward",R3=[{label:"正向",value:wi},{label:"反向",value:Nd}],I3=()=>new ur({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),L3=()=>new s0,B3=()=>new i0,j3=()=>new o0({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),$3=["tools","ports"],z3=()=>new mi({beforeAddCommand:(n,e)=>{if($3.includes(e.key))return!1}}),F3=()=>new yi({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),U3=n=>{const e=n.getSelectedCells();e.length&&n.removeCells(e)},H3=n=>{const e=n.getSelectedCells();e.length&&n.copy(e)},G3=n=>{if(!n.isClipboardEmpty()){const e=n.paste({offset:32});n.cleanSelection(),n.select(e)}},W3=n=>{n.canUndo()&&n.undo()},Y3=n=>{n.canRedo()&&n.redo()},q3=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"}}}])},u0=()=>{var n,e;return(n=nt.attrs)!=null&&n.pipe?"pipe":(e=nt.attrs)!=null&&e.arrow?"arrow":"line"},Pd=n=>n!=="none"?n+" 30s infinite linear":"",_d=()=>Math.random(),d0="--",Ad=/\$\{([^}]+)\}/g,X3={min:0,max:0,direction:bi},Eo=n=>Kn.defaults.baseURL+n.replace("/cny",""),J3={min:0,max:0,animation:dr,direction:wi,display:"block"},K3={class:"control"},Z3={class:"row-column"},Q3={class:"row-column"},h0=_t(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var D,U,ne,Q;const e=n,t=l.ref((D=e.payload.attrs.label)!=null&&D.textAnchor?"0":"1"),s=l.ref([]),r=l.ref([]),i=l.ref([]),o=async()=>{s.value=await Ja(e.itemId)},a=l.ref(),c=l.ref();l.watch(()=>c.value,F=>{F?i.value=r.value.filter(R=>R.name.includes(F)):i.value=r.value});let u=l.reactive({});const d=()=>{u=s.value.find(F=>F.deviceCode===a.value),u&&h()},h=async()=>{i.value=r.value=await Ka(u.deviceCode)},f=F=>F.replace(Ad,d0),p=F=>{Vk.confirm(`是否确定要添加${u.deviceName}-${F.name}?
487
- 添加后为:--${F.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const R=F.unit??"",re=e.payload.data.content;console.log(B.value),B.value?e.payload.data.content=g.value=re.slice(0,B.value)+"${"+u.deviceName+"."+F.name+"}"+R+re.slice(B.value):e.payload.data.content=g.value=re+"${"+u.deviceName+"."+F.name+"}"+R;const q=re.match(Ad),J=(q==null?void 0:q.length)||0;e.payload.data.fields.push({index:J,deviceName:u.deviceName,deviceCode:u.deviceCode,field:F.dataField,fieldName:F.name}),e.payload.label=f(e.payload.data.content),console.log(e.payload.data.content,e.payload.data.fields)})},g=l.ref(e.payload.data.content||null),m=l.ref(e.payload.attrs.body.fill||null),y=l.ref(e.payload.attrs.body.stroke||null),b=l.ref(e.payload.attrs.body.strokeWidth||null),w=l.ref(e.payload.attrs.body.rx||null),x=l.ref(e.payload.attrs.body.ry||null),C=l.ref(e.payload.attrs.text.fill||null),E=l.ref(e.payload.attrs.text.fontSize||null),v=l.ref(((U=e.payload.attrs.label)==null?void 0:U.textAnchor)||null),S=l.ref(((ne=e.payload.attrs.label)==null?void 0:ne.x)||null),O=l.ref(((Q=e.payload.attrs.label)==null?void 0:Q.y)||null),_=()=>{e.payload.attr("body/fill",m.value),e.payload.attr("body/stroke",y.value),e.payload.attr("body/strokeWidth",b.value),e.payload.attr("body/rx",w.value),e.payload.attr("body/ry",x.value),e.payload.attr("text/fill",C.value),e.payload.attr("text/fontSize",E.value),e.payload.attr("label/textAnchor",v.value),e.payload.attr("label/x",S.value),e.payload.attr("label/y",O.value)},T=l.ref(null),A=/[\$\{|\}]/g,V=F=>{A.test(F)&&(g.value=g.value.slice(0,-1));const R=e.payload.data.content;if(F.length<R.length){const{deleted:re,start:q,end:J}=L(R,F);if(re==="}"){const Ee=R.lastIndexOf("${",q),je=R.substring(Ee,q)+"}";g.value=R.replace(je,"");const bt=je.replace(/[${}]/g,"");e.payload.data.fields=e.payload.data.fields.filter(ee=>ee.deviceName+"."+ee.fieldName!==bt)}}e.payload.data.content=g.value,e.payload.label=f(g.value),console.log(e.payload.data.content,e.payload.data.fields)},L=(F,R)=>{let re=0,q=0;for(;re<F.length&&q<R.length&&F[re]===R[q];)re++,q++;if(q===R.length&&re<F.length)return{deleted:F.slice(re),start:re,end:F.length};let J=F.length-1,Ee=R.length-1;for(;J>re&&Ee>q&&F[J]===R[Ee];)J--,Ee--;return{deleted:F.slice(re,J),start:re,end:J}},B=l.ref(null),P=()=>{var R;const F=(R=T.value)==null?void 0:R.$refs.textarea;B.value=F.selectionStart},M=l.ref([]),k=()=>{M.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(F=>({id:F.id,attrs:F.attrs,args:{x:Number(F.args.x.replace("%","")),y:Number(F.args.y.replace("%",""))}}))))},j=()=>{const F=Du;F.attrs.text.text=`${e.payload.getPorts().length+1}`,F.args.x="50%",F.args.y="50%",e.payload.addPorts([{group:"ports",...F}]),k()},W=()=>{Gr("#drawing-board",!0)},Z=(F,R,re)=>{e.payload.portProp(F,"args/"+R,re+"%"),k()},$=F=>{e.payload.removePort(F),k()};return l.onMounted(()=>{k(),o(),l.nextTick(()=>{document.addEventListener("selectionchange",()=>{var Ee;if(!T.value)return!1;const F=(Ee=T.value)==null?void 0:Ee.$refs.textarea,R=F.selectionStart,re=g.value,q=/\$\{.*?\}/g;let J;for(;(J=q.exec(re))!==null;){const je=J.index,bt=q.lastIndex;if(R>je&&R<bt)return console.log("光标位于字段:",J[0]),F.setSelectionRange(bt,bt),!0}return console.log("光标不在任何字段内"),!1})})}),(F,R)=>{const re=l.resolveComponent("el-input"),q=l.resolveComponent("el-alert"),J=l.resolveComponent("el-option"),Ee=l.resolveComponent("el-select"),je=l.resolveComponent("el-table-column"),bt=l.resolveComponent("el-table"),ee=l.resolveComponent("el-collapse-item"),Re=l.resolveComponent("el-col"),rs=l.resolveComponent("el-color-picker"),vt=l.resolveComponent("el-row"),vn=l.resolveComponent("el-input-number"),hr=l.resolveComponent("el-button"),Qt=l.resolveComponent("el-slider"),Ls=l.resolveComponent("el-icon"),fr=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",K3,[l.createVNode(fr,{modelValue:t.value,"onUpdate:modelValue":R[13]||(R[13]=ce=>t.value=ce),accordion:""},{default:l.withCtx(()=>[n.payload.data.type==="text"?(l.openBlock(),l.createBlock(ee,{key:0,title:"文本内容",name:"0"},{default:l.withCtx(()=>[l.createVNode(re,{ref_key:"inputRef",ref:T,type:"textarea",modelValue:g.value,"onUpdate:modelValue":R[0]||(R[0]=ce=>g.value=ce),onInput:V,onBlur:P,rows:10},null,8,["modelValue"]),l.createVNode(q,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),l.createVNode(Ee,{modelValue:a.value,"onUpdate:modelValue":R[1]||(R[1]=ce=>a.value=ce),placeholder:"请选择设备",onChange:d,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,ce=>(l.openBlock(),l.createBlock(J,{key:ce.deviceCode,label:ce.deviceName,value:ce.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(re,{modelValue:c.value,"onUpdate:modelValue":R[2]||(R[2]=ce=>c.value=ce),placeholder:"请输入设备名称",clearable:"",style:{"margin-top":"5px"}},null,8,["modelValue"]),l.createVNode(bt,{data:i.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:p},{default:l.withCtx(()=>[l.createVNode(je,{type:"index",label:"序号",width:"50",align:"center"}),l.createVNode(je,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),l.createVNode(je,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),l.createVNode(je,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(ee,{title:"图形设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Z3,[l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[14]||(R[14]=[l.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(rs,{modelValue:m.value,"onUpdate:modelValue":R[3]||(R[3]=ce=>m.value=ce),"show-alpha":!0,size:"small",onChange:_},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[15]||(R[15]=[l.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(rs,{modelValue:y.value,"onUpdate:modelValue":R[4]||(R[4]=ce=>y.value=ce),"show-alpha":!0,size:"small",onChange:_},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[16]||(R[16]=[l.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:b.value,"onUpdate:modelValue":R[5]||(R[5]=ce=>b.value=ce),size:"small","controls-position":"right",onChange:_,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[17]||(R[17]=[l.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:w.value,"onUpdate:modelValue":R[6]||(R[6]=ce=>w.value=ce),size:"small","controls-position":"right",onChange:_,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[18]||(R[18]=[l.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:x.value,"onUpdate:modelValue":R[7]||(R[7]=ce=>x.value=ce),size:"small","controls-position":"right",onChange:_,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(l.openBlock(),l.createBlock(ee,{key:1,title:"文字设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Q3,[l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[19]||(R[19]=[l.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(rs,{modelValue:C.value,"onUpdate:modelValue":R[8]||(R[8]=ce=>C.value=ce),"show-alpha":!0,size:"small",onChange:_},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[20]||(R[20]=[l.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:E.value,"onUpdate:modelValue":R[9]||(R[9]=ce=>E.value=ce),size:"small","controls-position":"right",onChange:_,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[21]||(R[21]=[l.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(Ee,{modelValue:v.value,"onUpdate:modelValue":R[10]||(R[10]=ce=>v.value=ce),size:"small",onChange:_},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(["start","middle","end"],ce=>l.createVNode(J,{key:ce,label:ce,value:ce},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[22]||(R[22]=[l.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:S.value,"onUpdate:modelValue":R[11]||(R[11]=ce=>S.value=ce),size:"small","controls-position":"right",onChange:_,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(vt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Re,{span:12},{default:l.withCtx(()=>R[23]||(R[23]=[l.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),l.createVNode(Re,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:O.value,"onUpdate:modelValue":R[12]||(R[12]=ce=>O.value=ce),size:"small","controls-position":"right",onChange:_,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(ee,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(hr,{type:"primary",onClick:j,size:"small"},{default:l.withCtx(()=>R[24]||(R[24]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(hr,{type:"primary",onClick:W,size:"small"},{default:l.withCtx(()=>R[25]||(R[25]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(bt,{data:M.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(je,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:ce})=>[l.createTextVNode(l.toDisplayString(ce.attrs.text.text),1)]),_:1}),l.createVNode(je,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:ce})=>[l.createVNode(Qt,{modelValue:ce.args.x,"onUpdate:modelValue":Ct=>ce.args.x=Ct,min:0,max:100,step:1,onInput:Ct=>Z(ce.id,"x",Ct)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(je,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:ce})=>[l.createVNode(Qt,{modelValue:ce.args.y,"onUpdate:modelValue":Ct=>ce.args.y=Ct,min:0,max:100,step:1,onInput:Ct=>Z(ce.id,"y",Ct)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(je,{label:"操作",align:"center"},{default:l.withCtx(({row:ce})=>[l.createVNode(hr,{type:"danger",size:"small",onClick:Ct=>$(ce.id)},{default:l.withCtx(()=>[l.createVNode(Ls,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Km))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-4dff50a5"]]),ej={class:"container"},tj={class:"row-column"},nj={class:"row-column"},sj={class:"row-column"},rj=_t({__name:"default-line",props:{payload:Object},setup(n){var c,u,d,h;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:((h=e.payload.attrs.line.targetMarker)==null?void 0:h.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),nt.markup=e.payload.markup,nt.attrs=e.payload.attrs};return(f,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"),C=l.resolveComponent("el-select"),E=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",ej,[l.createVNode(E,{modelValue:t.value,"onUpdate:modelValue":p[10]||(p[10]=v=>t.value=v),accordion:""},{default:l.withCtx(()=>[l.createVNode(w,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",tj,[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]=v=>s.value=v),"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]=v=>r.value=v),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",nj,[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(C,{modelValue:i.name,"onUpdate:modelValue":p[2]||(p[2]=v=>i.name=v),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Tl),v=>(l.openBlock(),l.createBlock(x,{key:v.value,label:v.label,value:v.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]=v=>i.args.width=v),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]=v=>i.args.height=v),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]=v=>i.args.offset=v),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",sj,[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(C,{modelValue:o.name,"onUpdate:modelValue":p[6]||(p[6]=v=>o.name=v),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Tl),v=>(l.openBlock(),l.createBlock(x,{key:v.value,label:v.label,value:v.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]=v=>o.args.width=v),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]=v=>o.args.height=v),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]=v=>o.args.offset=v),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"]]),ij={class:"form-container"},oj={class:"footer",style:{"margin-top":"10px"}},f0=_t({__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"?X3:J3)))},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-switch"),b=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",ij,[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(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(f,{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(f,{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(c0),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(wi),"active-text":"正向","inactive-value":l.unref(Nd),"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(dr),"active-text":"闪烁","inactive-value":l.unref(bi),"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(h,{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",oj,[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-93fe286b"]]),aj={class:"container"},lj={class:"row-column"},cj={class:"row-column"},uj={class:"row-column"},dj={class:"row-column"},hj=_t({__name:"pipe-line",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var _,T,A,V,L,B,P,M,k,j,W,Z;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=(_=e.payload.attrs.pipe)==null?void 0:_.style)==null?void 0:T.animation.split(" ")[0])??bi),c=l.reactive({name:((A=e.payload.attrs.pipe.sourceMarker)==null?void 0:A.name)??null,args:((V=e.payload.attrs.pipe.sourceMarker)==null?void 0:V.args)??{}}),u=l.reactive({name:((L=e.payload.attrs.pipe.targetMarker)==null?void 0:L.name)??null,args:((B=e.payload.attrs.pipe.targetMarker)==null?void 0:B.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",Pd(a.value)),nt.markup=e.payload.markup,nt.attrs=e.payload.attrs,console.log("线-基础配置",nt),console.log("线-当前配置",e.payload)},h=l.ref(e.payload.data.isCondition??!1),f=()=>{e.payload.data.isCondition=h.value},p=l.reactive({show:!1,payload:null}),g=()=>{p.show=!0,p.payload=e.payload.data.condition??[]},m=$=>{p.show=!1,p.payload=null,$&&(e.payload.data.condition=$),console.log("条件线",e.payload.data)},y=l.ref([]),b=l.ref(((k=(M=(P=e.payload.data)==null?void 0:P.fields)==null?void 0:M[0])==null?void 0:k.deviceCode)??""),w=l.ref(((Z=(W=(j=e.payload.data)==null?void 0:j.fields)==null?void 0:W[0])==null?void 0:Z.field)??""),x=async()=>{y.value=await Ja(e.itemId),b.value&&E()};let C=l.reactive({});const E=()=>{C=y.value.find($=>$.deviceCode===b.value),C?(S(),e.payload.data.fields=[{index:0,deviceName:C.deviceName,deviceCode:C.deviceCode,field:w.value??""}],w.value=e.payload.data.fields[0].field):(w.value="",e.payload.data.fields=[]),console.log("管道配置",e.payload)},v=l.ref([]),S=async()=>{v.value=await Ka(C.deviceCode)},O=()=>{e.payload.data.fields=[{index:0,deviceName:C.deviceName,deviceCode:C.deviceCode,field:w.value??""}],console.log("管道配置",e.payload)};return l.onMounted(()=>{x()}),($,D)=>{const U=l.resolveComponent("el-col"),ne=l.resolveComponent("el-color-picker"),Q=l.resolveComponent("el-row"),F=l.resolveComponent("el-input-number"),R=l.resolveComponent("el-collapse-item"),re=l.resolveComponent("el-option"),q=l.resolveComponent("el-select"),J=l.resolveComponent("el-switch"),Ee=l.resolveComponent("el-button"),je=l.resolveComponent("el-collapse"),bt=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",aj,[l.createVNode(je,{modelValue:t.value,"onUpdate:modelValue":D[16]||(D[16]=ee=>t.value=ee),accordion:""},{default:l.withCtx(()=>[l.createVNode(R,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",lj,[l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[18]||(D[18]=[l.createElementVNode("div",{class:"row-label"},"颜色1",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:s.value,"onUpdate:modelValue":D[0]||(D[0]=ee=>s.value=ee),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[19]||(D[19]=[l.createElementVNode("div",{class:"row-label"},"颜色2",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:r.value,"onUpdate:modelValue":D[1]||(D[1]=ee=>r.value=ee),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[20]||(D[20]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:i.value,"onUpdate:modelValue":D[2]||(D[2]=ee=>i.value=ee),size:"small","controls-position":"right",onChange:d,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(R,{title:"管道设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",cj,[l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[21]||(D[21]=[l.createElementVNode("div",{class:"row-label"},"管道间隔",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:o.value,"onUpdate:modelValue":D[3]||(D[3]=ee=>o.value=ee),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(U,{span:12},{default:l.withCtx(()=>D[22]||(D[22]=[l.createElementVNode("div",{class:"row-label"},"默认流动方向",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:a.value,"onUpdate:modelValue":D[4]||(D[4]=ee=>a.value=ee),placeholder:"请选择管道方向",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(c0),ee=>(l.openBlock(),l.createBlock(re,{key:ee.value,label:ee.label,value:ee.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[23]||(D[23]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:b.value,"onUpdate:modelValue":D[5]||(D[5]=ee=>b.value=ee),placeholder:"请选择设备",onChange:E,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value,ee=>(l.openBlock(),l.createBlock(re,{key:ee.deviceCode,label:ee.deviceName,value:ee.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(q,{modelValue:w.value,"onUpdate:modelValue":D[6]||(D[6]=ee=>w.value=ee),placeholder:"请选择字段",onChange:O,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(v.value,ee=>(l.openBlock(),l.createBlock(re,{key:ee.dataField,label:ee.name,value:ee.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[24]||(D[24]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(J,{modelValue:h.value,"onUpdate:modelValue":D[7]||(D[7]=ee=>h.value=ee),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"]),l.createVNode(Ee,{type:"primary",size:"small",onClick:g,style:{"margin-left":"10px"}},{default:l.withCtx(()=>D[25]||(D[25]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1}),l.createVNode(R,{title:"箭头1设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",uj,[l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[26]||(D[26]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.name,"onUpdate:modelValue":D[8]||(D[8]=ee=>c.name=ee),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Tl),ee=>(l.openBlock(),l.createBlock(re,{key:ee.value,label:ee.label,value:ee.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[27]||(D[27]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:c.args.width,"onUpdate:modelValue":D[9]||(D[9]=ee=>c.args.width=ee),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(U,{span:12},{default:l.withCtx(()=>D[28]||(D[28]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:c.args.height,"onUpdate:modelValue":D[10]||(D[10]=ee=>c.args.height=ee),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(U,{span:12},{default:l.withCtx(()=>D[29]||(D[29]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:c.args.offset,"onUpdate:modelValue":D[11]||(D[11]=ee=>c.args.offset=ee),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(R,{title:"箭头2设置",name:"3"},{default:l.withCtx(()=>[l.createElementVNode("div",dj,[l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[30]||(D[30]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.name,"onUpdate:modelValue":D[12]||(D[12]=ee=>u.name=ee),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Tl),ee=>(l.openBlock(),l.createBlock(re,{key:ee.value,label:ee.label,value:ee.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>D[31]||(D[31]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:u.args.width,"onUpdate:modelValue":D[13]||(D[13]=ee=>u.args.width=ee),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(U,{span:12},{default:l.withCtx(()=>D[32]||(D[32]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:u.args.height,"onUpdate:modelValue":D[14]||(D[14]=ee=>u.args.height=ee),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(U,{span:12},{default:l.withCtx(()=>D[33]||(D[33]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:u.args.offset,"onUpdate:modelValue":D[15]||(D[15]=ee=>u.args.offset=ee),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(bt,{modelValue:p.show,"onUpdate:modelValue":D[17]||(D[17]=ee=>p.show=ee),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(f0,{key:0,payload:p.payload,type:"pipe",onClose:m},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-c0d777a1"]]),fj={class:"container"},pj={class:"row-column"},gj={class:"row-column"},mj={class:"row-column"},yj=_t({__name:"arrow-line",props:{payload:{type:Object,itemId:{type:String,default:""}}},setup(n){var T,A,V,L,B,P;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===tl?wi:Nd),u=l.ref(e.payload.attrs.arrow.style.animation.split(" ")[0]===dr?dr:bi),d=l.ref(e.payload.attrs.arrow.display),h=()=>{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===wi?tl:Xm),e.payload.attr("arrow/style/animation",u.value===dr?"flashing 2s infinite linear":""),e.payload.attr("arrow/display",d.value),console.log(e.payload.markup),nt.markup=e.payload.markup,nt.attrs=e.payload.attrs},f=l.ref([]),p=l.ref(((V=(A=(T=e.payload.data)==null?void 0:T.fields)==null?void 0:A[0])==null?void 0:V.deviceCode)??""),g=l.ref(((P=(B=(L=e.payload.data)==null?void 0:L.fields)==null?void 0:B[0])==null?void 0:P.field)??""),m=async()=>{f.value=await Ja(e.itemId),p.value&&b()};let y=l.reactive({});const b=()=>{y=f.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 Ka(y.deviceCode)},C=()=>{e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],console.log("箭头线-配置",e.payload)},E=l.ref(e.payload.data.isCondition??!1),v=()=>{e.payload.data.isCondition=E.value},S=l.reactive({show:!1,payload:null}),O=()=>{S.show=!0,S.payload=e.payload.data.condition??[]},_=M=>{S.show=!1,S.payload=null,M&&(e.payload.data.condition=M),console.log("条件线",e.payload.data)};return l.onMounted(()=>{m()}),(M,k)=>{const j=l.resolveComponent("el-col"),W=l.resolveComponent("el-color-picker"),Z=l.resolveComponent("el-row"),$=l.resolveComponent("el-input-number"),D=l.resolveComponent("el-collapse-item"),U=l.resolveComponent("el-option"),ne=l.resolveComponent("el-select"),Q=l.resolveComponent("el-switch"),F=l.resolveComponent("el-button"),R=l.resolveComponent("el-collapse"),re=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",fj,[l.createVNode(R,{modelValue:t.value,"onUpdate:modelValue":k[10]||(k[10]=q=>t.value=q),accordion:""},{default:l.withCtx(()=>[l.createVNode(D,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",pj,[l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[12]||(k[12]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(W,{modelValue:s.value,"onUpdate:modelValue":k[0]||(k[0]=q=>s.value=q),"show-alpha":!0,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[13]||(k[13]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode($,{modelValue:r.value,"onUpdate:modelValue":k[1]||(k[1]=q=>r.value=q),size:"small","controls-position":"right",onChange:h,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(D,{title:"箭头设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",gj,[l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[14]||(k[14]=[l.createElementVNode("div",{class:"row-label"},"箭头数量",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode($,{modelValue:o.value,"onUpdate:modelValue":k[2]||(k[2]=q=>o.value=q),size:"small","controls-position":"right",onChange:h,min:1,max:20,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[15]||(k[15]=[l.createElementVNode("div",{class:"row-label"},"箭头颜色",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(W,{modelValue:a.value,"onUpdate:modelValue":k[3]||(k[3]=q=>a.value=q),"show-alpha":!0,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[16]||(k[16]=[l.createElementVNode("div",{class:"row-label"},"默认箭头方向",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:c.value,"onUpdate:modelValue":k[4]||(k[4]=q=>c.value=q),size:"small",onChange:h},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(R3),q=>(l.openBlock(),l.createBlock(U,{key:q.value,label:q.label,value:q.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[17]||(k[17]=[l.createElementVNode("div",{class:"row-label"},"默认箭头动作",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Q,{modelValue:u.value,"onUpdate:modelValue":k[5]||(k[5]=q=>u.value=q),"active-value":l.unref(dr),"active-text":"闪烁","inactive-value":l.unref(bi),"inactive-text":"静止",size:"small",onChange:h},null,8,["modelValue","active-value","inactive-value"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[18]||(k[18]=[l.createElementVNode("div",{class:"row-label"},"默认箭头显示",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Q,{modelValue:d.value,"onUpdate:modelValue":k[6]||(k[6]=q=>d.value=q),"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(D,{title:"动态设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",mj,[l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[19]||(k[19]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:p.value,"onUpdate:modelValue":k[7]||(k[7]=q=>p.value=q),placeholder:"请选择设备",onChange:b,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,q=>(l.openBlock(),l.createBlock(U,{key:q.deviceCode,label:q.deviceName,value:q.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(ne,{modelValue:g.value,"onUpdate:modelValue":k[8]||(k[8]=q=>g.value=q),placeholder:"请选择字段",onChange:C,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,q=>(l.openBlock(),l.createBlock(U,{key:q.dataField,label:q.name,value:q.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>k[20]||(k[20]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Q,{modelValue:E.value,"onUpdate:modelValue":k[9]||(k[9]=q=>E.value=q),"active-value":!0,"inactive-value":!1,size:"small",onChange:v},null,8,["modelValue"]),l.createVNode(F,{type:"primary",size:"small",onClick:O,style:{"margin-left":"10px"}},{default:l.withCtx(()=>k[21]||(k[21]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(re,{modelValue:S.show,"onUpdate:modelValue":k[11]||(k[11]=q=>S.show=q),width:"900px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[S.show?(l.openBlock(),l.createBlock(f0,{key:0,payload:S.payload,type:"arrow",onClose:_},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-f33df45a"]]),bj={class:"container"},wj={class:"row-column",style:{padding:"5px 1px 10px"}},p0=_t({__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){const e=n,t=l.ref(e.payload.data.type),s=()=>{e.payload.data.type=t.value,t.value===Ed&&(nt.attrs=el.attrs,nt.markup=el.markup),t.value===Od&&(nt.attrs=qm.attrs,nt.markup=qm.markup),t.value===Md&&(nt.attrs=Jm.attrs,nt.markup=Jm.markup),e.payload.attrs=null,e.payload.attr(nt.attrs),e.payload.markup=nt.markup,i()},r=l.shallowRef(null),i=()=>{r.value=null,t.value===Ed&&(r.value=rj),t.value===Od&&(r.value=hj),t.value===Md&&(r.value=yj)};return l.onMounted(()=>{i()}),(o,a)=>{const c=l.resolveComponent("el-col"),u=l.resolveComponent("el-option"),d=l.resolveComponent("el-select"),h=l.resolveComponent("el-row");return l.openBlock(),l.createElementBlock("div",bj,[l.createElementVNode("div",wj,[l.createVNode(h,{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]=f=>t.value=f),placeholder:"请选择线段类型",clearable:"",size:"small",onChange:s},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(D3),f=>(l.openBlock(),l.createBlock(u,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.value),{payload:n.payload,itemId:n.itemId},null,8,["payload","itemId"]))])}}},[["__scopeId","data-v-b641f8fe"]]),xj={class:"form-container"},vj=_t({__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",xj,[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"]]),Cj=`.x6-widget-dnd {
486
+ `;z.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},z.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},z.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},z.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},z.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},z.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},z.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},z.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},z.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},z.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},z.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},z.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},z.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},z.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},z.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},z.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},z.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},z.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},z.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},z.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},z.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},z.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},z.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},z.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},z.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},z.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},z.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},z.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},z.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},z.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},z.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t&&t.unselect(n,e),this};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 yi extends ke{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},yi.defaultOptions),e),Kr(this.name,V3)}init(e){this.graph=e,this.selectionImpl=new l0(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&&Es.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&Es.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(),Zr(this.name)}}D3([ke.dispose()],yi.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"]}}(yi||(yi={}));const Ed="line",Od="pipe",Md="arrow",R3=[{label:"直线",value:Ed},{label:"管道",value:Od},{label:"箭头",value:Md}],_l=[{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"}],bi="stop",c0="forward-pipe",Nd=[{label:"停止",value:bi},{label:"正向",value:c0},{label:"反向",value:"reverse-pipe"}],dr="flashing",wi="arrowForward",Pd="arrowBackward",I3=[{label:"正向",value:wi},{label:"反向",value:Pd}],L3=()=>new ur({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),B3=()=>new s0,j3=()=>new i0,$3=()=>new o0({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),z3=["tools","ports"],F3=()=>new mi({beforeAddCommand:(n,e)=>{if(z3.includes(e.key))return!1}}),U3=()=>new yi({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),H3=n=>{const e=n.getSelectedCells();e.length&&n.removeCells(e)},G3=n=>{const e=n.getSelectedCells();e.length&&n.copy(e)},W3=n=>{if(!n.isClipboardEmpty()){const e=n.paste({offset:32});n.cleanSelection(),n.select(e)}},Y3=n=>{n.canUndo()&&n.undo()},q3=n=>{n.canRedo()&&n.redo()},X3=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"}}}])},u0=()=>{var n,e;return(n=tt.attrs)!=null&&n.pipe?"pipe":(e=tt.attrs)!=null&&e.arrow?"arrow":"line"},d0=n=>n!=="none"?n+" 30s infinite linear":"",_d=()=>Math.random(),h0="--",Ad=/\$\{([^}]+)\}/g,J3={min:0,max:0,direction:bi},Eo=n=>Kn.defaults.baseURL+n.replace("/cny",""),K3={min:0,max:0,animation:dr,direction:wi,display:"block"},Z3={class:"control"},Q3={class:"row-column"},ej={class:"row-column"},f0=Nt(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var q,X,Q,se;const e=n,t=l.ref((q=e.payload.attrs.label)!=null&&q.textAnchor?"0":"1"),s=l.ref([]),r=l.ref([]),i=l.ref([]),o=async()=>{s.value=await ku(e.itemId)},a=l.ref(),c=l.ref();l.watch(()=>c.value,H=>{H?i.value=r.value.filter(I=>I.name.includes(H)):i.value=r.value});let u=l.reactive({});const d=()=>{u=s.value.find(H=>H.deviceCode===a.value),u&&h()},h=async()=>{i.value=r.value=await Vu(u.deviceCode)},f=H=>H.replace(Ad,h0),p=H=>{Vk.confirm(`是否确定要添加${u.deviceName}-${H.name}?
487
+ 添加后为:--${H.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const I=H.unit??"",re=e.payload.data.content;console.log(j.value),j.value?e.payload.data.content=g.value=re.slice(0,j.value)+"${"+u.deviceName+"."+H.name+"}"+I+re.slice(j.value):e.payload.data.content=g.value=re+"${"+u.deviceName+"."+H.name+"}"+I;const B=re.match(Ad),Z=(B==null?void 0:B.length)||0;e.payload.data.fields.push({index:Z,deviceName:u.deviceName,deviceCode:u.deviceCode,field:H.dataField,fieldName:H.name}),e.payload.label=f(e.payload.data.content),console.log(e.payload.data.content,e.payload.data.fields)})},g=l.ref(e.payload.data.content||null),m=l.ref(e.payload.attrs.body.fill||null),y=l.ref(e.payload.attrs.body.stroke||null),b=l.ref(e.payload.attrs.body.strokeWidth||null),w=l.ref(e.payload.attrs.body.rx||null),x=l.ref(e.payload.attrs.body.ry||null),C=l.ref(e.payload.attrs.text.fill||null),E=l.ref(e.payload.attrs.text.fontSize||null),v=l.ref(((X=e.payload.attrs.label)==null?void 0:X.textAnchor)||null),S=l.ref(((Q=e.payload.attrs.label)==null?void 0:Q.x)||null),O=l.ref(((se=e.payload.attrs.label)==null?void 0:se.y)||null),_=()=>{e.payload.attr("body/fill",m.value),e.payload.attr("body/stroke",y.value),e.payload.attr("body/strokeWidth",b.value),e.payload.attr("body/rx",w.value),e.payload.attr("body/ry",x.value),e.payload.attr("text/fill",C.value),e.payload.attr("text/fontSize",E.value),e.payload.attr("label/textAnchor",v.value),e.payload.attr("label/x",S.value),e.payload.attr("label/y",O.value)},T=l.ref(null),A=/[\$\{|\}]/g,D=H=>{A.test(H)&&(g.value=g.value.slice(0,-1));const I=e.payload.data.content;if(H.length<I.length){const{deleted:re,start:B,end:Z}=L(I,H);if(re==="}"){const Se=I.lastIndexOf("${",B),We=I.substring(Se,B)+"}";g.value=I.replace(We,"");const At=We.replace(/[${}]/g,"");e.payload.data.fields=e.payload.data.fields.filter(Zt=>Zt.deviceName+"."+Zt.fieldName!==At)}}e.payload.data.content=g.value,e.payload.label=f(g.value),console.log(e.payload.data.content,e.payload.data.fields)},L=(H,I)=>{let re=0,B=0;for(;re<H.length&&B<I.length&&H[re]===I[B];)re++,B++;if(B===I.length&&re<H.length)return{deleted:H.slice(re),start:re,end:H.length};let Z=H.length-1,Se=I.length-1;for(;Z>re&&Se>B&&H[Z]===I[Se];)Z--,Se--;return{deleted:H.slice(re,Z),start:re,end:Z}},j=l.ref(null),P=()=>{var I;const H=(I=T.value)==null?void 0:I.$refs.textarea;j.value=H.selectionStart},M=l.ref([]),k=()=>{M.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(H=>({id:H.id,attrs:H.attrs,args:{x:Number(H.args.x.replace("%","")),y:Number(H.args.y.replace("%",""))}}))))},$=()=>{const H=Du;H.attrs.text.text=`${e.payload.getPorts().length+1}`,H.args.x="50%",H.args.y="50%",e.payload.addPorts([{group:"ports",...H}]),k()},V=()=>{Gr("#drawing-board",!0)},U=(H,I,re)=>{e.payload.portProp(H,"args/"+I,re+"%"),k()},F=H=>{e.payload.removePort(H),k()};return l.onMounted(()=>{k(),o(),l.nextTick(()=>{document.addEventListener("selectionchange",()=>{var Se;if(!T.value)return!1;const H=(Se=T.value)==null?void 0:Se.$refs.textarea,I=H.selectionStart,re=g.value,B=/\$\{.*?\}/g;let Z;for(;(Z=B.exec(re))!==null;){const We=Z.index,At=B.lastIndex;if(I>We&&I<At)return console.log("光标位于字段:",Z[0]),H.setSelectionRange(At,At),!0}return console.log("光标不在任何字段内"),!1})})}),(H,I)=>{const re=l.resolveComponent("el-input"),B=l.resolveComponent("el-alert"),Z=l.resolveComponent("el-option"),Se=l.resolveComponent("el-select"),We=l.resolveComponent("el-table-column"),At=l.resolveComponent("el-table"),Zt=l.resolveComponent("el-collapse-item"),De=l.resolveComponent("el-col"),is=l.resolveComponent("el-color-picker"),wt=l.resolveComponent("el-row"),vn=l.resolveComponent("el-input-number"),hr=l.resolveComponent("el-button"),Qt=l.resolveComponent("el-slider"),Ls=l.resolveComponent("el-icon"),fr=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Z3,[l.createVNode(fr,{modelValue:t.value,"onUpdate:modelValue":I[13]||(I[13]=le=>t.value=le),accordion:""},{default:l.withCtx(()=>[n.payload.data.type==="text"?(l.openBlock(),l.createBlock(Zt,{key:0,title:"文本内容",name:"0"},{default:l.withCtx(()=>[l.createVNode(re,{ref_key:"inputRef",ref:T,type:"textarea",modelValue:g.value,"onUpdate:modelValue":I[0]||(I[0]=le=>g.value=le),onInput:D,onBlur:P,rows:10},null,8,["modelValue"]),l.createVNode(B,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),l.createVNode(Se,{modelValue:a.value,"onUpdate:modelValue":I[1]||(I[1]=le=>a.value=le),placeholder:"请选择设备",onChange:d,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,le=>(l.openBlock(),l.createBlock(Z,{key:le.deviceCode,label:le.deviceName,value:le.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(re,{modelValue:c.value,"onUpdate:modelValue":I[2]||(I[2]=le=>c.value=le),placeholder:"请输入字段名称",clearable:"",style:{"margin-top":"5px"}},null,8,["modelValue"]),l.createVNode(At,{data:i.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:p},{default:l.withCtx(()=>[l.createVNode(We,{type:"index",label:"序号",width:"50",align:"center"}),l.createVNode(We,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),l.createVNode(We,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),l.createVNode(We,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(Zt,{title:"图形设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Q3,[l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[14]||(I[14]=[l.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(is,{modelValue:m.value,"onUpdate:modelValue":I[3]||(I[3]=le=>m.value=le),"show-alpha":!0,size:"small",onChange:_},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[15]||(I[15]=[l.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(is,{modelValue:y.value,"onUpdate:modelValue":I[4]||(I[4]=le=>y.value=le),"show-alpha":!0,size:"small",onChange:_},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[16]||(I[16]=[l.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:b.value,"onUpdate:modelValue":I[5]||(I[5]=le=>b.value=le),size:"small","controls-position":"right",onChange:_,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[17]||(I[17]=[l.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:w.value,"onUpdate:modelValue":I[6]||(I[6]=le=>w.value=le),size:"small","controls-position":"right",onChange:_,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[18]||(I[18]=[l.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:x.value,"onUpdate:modelValue":I[7]||(I[7]=le=>x.value=le),size:"small","controls-position":"right",onChange:_,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(l.openBlock(),l.createBlock(Zt,{key:1,title:"文字设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",ej,[l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[19]||(I[19]=[l.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(is,{modelValue:C.value,"onUpdate:modelValue":I[8]||(I[8]=le=>C.value=le),"show-alpha":!0,size:"small",onChange:_},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[20]||(I[20]=[l.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:E.value,"onUpdate:modelValue":I[9]||(I[9]=le=>E.value=le),size:"small","controls-position":"right",onChange:_,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[21]||(I[21]=[l.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(Se,{modelValue:v.value,"onUpdate:modelValue":I[10]||(I[10]=le=>v.value=le),size:"small",onChange:_},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(["start","middle","end"],le=>l.createVNode(Z,{key:le,label:le,value:le},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[22]||(I[22]=[l.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:S.value,"onUpdate:modelValue":I[11]||(I[11]=le=>S.value=le),size:"small","controls-position":"right",onChange:_,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(wt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(De,{span:12},{default:l.withCtx(()=>I[23]||(I[23]=[l.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),l.createVNode(De,{span:12},{default:l.withCtx(()=>[l.createVNode(vn,{modelValue:O.value,"onUpdate:modelValue":I[12]||(I[12]=le=>O.value=le),size:"small","controls-position":"right",onChange:_,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(Zt,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(hr,{type:"primary",onClick:$,size:"small"},{default:l.withCtx(()=>I[24]||(I[24]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(hr,{type:"primary",onClick:V,size:"small"},{default:l.withCtx(()=>I[25]||(I[25]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(At,{data:M.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(We,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:le})=>[l.createTextVNode(l.toDisplayString(le.attrs.text.text),1)]),_:1}),l.createVNode(We,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(Qt,{modelValue:le.args.x,"onUpdate:modelValue":xt=>le.args.x=xt,min:0,max:100,step:1,onInput:xt=>U(le.id,"x",xt)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(We,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(Qt,{modelValue:le.args.y,"onUpdate:modelValue":xt=>le.args.y=xt,min:0,max:100,step:1,onInput:xt=>U(le.id,"y",xt)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(We,{label:"操作",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(hr,{type:"danger",size:"small",onClick:xt=>F(le.id)},{default:l.withCtx(()=>[l.createVNode(Ls,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Km))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-945c7419"]]),tj={class:"container"},nj={class:"row-column"},sj={class:"row-column"},rj={class:"row-column"},ij=Nt({__name:"default-line",props:{payload:Object},setup(n){var c,u,d,h;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:((h=e.payload.attrs.line.targetMarker)==null?void 0:h.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),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs};return(f,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"),C=l.resolveComponent("el-select"),E=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",tj,[l.createVNode(E,{modelValue:t.value,"onUpdate:modelValue":p[10]||(p[10]=v=>t.value=v),accordion:""},{default:l.withCtx(()=>[l.createVNode(w,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",nj,[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]=v=>s.value=v),"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]=v=>r.value=v),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",sj,[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(C,{modelValue:i.name,"onUpdate:modelValue":p[2]||(p[2]=v=>i.name=v),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(_l),v=>(l.openBlock(),l.createBlock(x,{key:v.value,label:v.label,value:v.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]=v=>i.args.width=v),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]=v=>i.args.height=v),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]=v=>i.args.offset=v),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",rj,[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(C,{modelValue:o.name,"onUpdate:modelValue":p[6]||(p[6]=v=>o.name=v),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(_l),v=>(l.openBlock(),l.createBlock(x,{key:v.value,label:v.label,value:v.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]=v=>o.args.width=v),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]=v=>o.args.height=v),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]=v=>o.args.offset=v),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"]]),oj={class:"form-container"},aj={class:"footer",style:{"margin-top":"10px"}},lj=Nt({__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"?J3:K3)))},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-switch"),b=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",oj,[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(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(f,{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(f,{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(Nd),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(wi),"active-text":"正向","inactive-value":l.unref(Pd),"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(dr),"active-text":"闪烁","inactive-value":l.unref(bi),"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(h,{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",aj,[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-93fe286b"]]),cj={class:"container"},uj={class:"row-column"},dj={class:"row-column"},hj={class:"row-column"},fj={class:"row-column"},pj=Nt({__name:"pipe-line",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var C,E,v,S,O,_,T,A,D,L,j,P,M,k;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(((E=(C=e.payload.attrs.pipe)==null?void 0:C.style)==null?void 0:E.animation.split(" ")[0])??bi),c=l.reactive({name:((v=e.payload.attrs.pipe.sourceMarker)==null?void 0:v.name)??null,args:((S=e.payload.attrs.pipe.sourceMarker)==null?void 0:S.args)??{}}),u=l.reactive({name:((O=e.payload.attrs.pipe.targetMarker)==null?void 0:O.name)??null,args:((_=e.payload.attrs.pipe.targetMarker)==null?void 0:_.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",d0(a.value)),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs,console.log("线-基础配置",tt),console.log("线-当前配置",e.payload)},h=l.ref(e.payload.data.isCondition??!1),f=()=>{e.payload.data.isCondition=h.value,e.payload.data.direction=y.value},p=l.ref([]),g=l.ref(((D=(A=(T=e.payload.data)==null?void 0:T.fields)==null?void 0:A[0])==null?void 0:D.deviceCode)??""),m=l.ref(((j=(L=e.payload.data)==null?void 0:L.fields)==null?void 0:j.map($=>$.deviceCode))??[]),y=l.ref(e.payload.data.direction??c0);l.ref(((k=(M=(P=e.payload.data)==null?void 0:P.fields)==null?void 0:M[0])==null?void 0:k.field)??"");const b=async()=>{p.value=await oD(e.itemId),g.value&&x()},w=$=>{y.value=$,e.payload.data.direction=$};l.reactive({});const x=()=>{e.payload.data.fields=m.value.map($=>{const V=p.value.find(U=>U.deviceCode+U.field===$);return{deviceName:V.deviceName,deviceCode:V.deviceCode,field:V.field,id:V.id}}),console.log("管道配置",e.payload)};return l.ref([]),l.onMounted(()=>{b()}),($,V)=>{const U=l.resolveComponent("el-col"),F=l.resolveComponent("el-color-picker"),q=l.resolveComponent("el-row"),X=l.resolveComponent("el-input-number"),Q=l.resolveComponent("el-collapse-item"),se=l.resolveComponent("el-option"),H=l.resolveComponent("el-select"),I=l.resolveComponent("el-switch"),re=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",cj,[l.createVNode(re,{modelValue:t.value,"onUpdate:modelValue":V[16]||(V[16]=B=>t.value=B),accordion:""},{default:l.withCtx(()=>[l.createVNode(Q,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",uj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[17]||(V[17]=[l.createElementVNode("div",{class:"row-label"},"颜色1",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":V[0]||(V[0]=B=>s.value=B),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[18]||(V[18]=[l.createElementVNode("div",{class:"row-label"},"颜色2",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":V[1]||(V[1]=B=>r.value=B),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[19]||(V[19]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:i.value,"onUpdate:modelValue":V[2]||(V[2]=B=>i.value=B),size:"small","controls-position":"right",onChange:d,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(Q,{title:"管道设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",dj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[20]||(V[20]=[l.createElementVNode("div",{class:"row-label"},"管道间隔",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:o.value,"onUpdate:modelValue":V[3]||(V[3]=B=>o.value=B),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(U,{span:12},{default:l.withCtx(()=>V[21]||(V[21]=[l.createElementVNode("div",{class:"row-label"},"默认流动方向",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:a.value,"onUpdate:modelValue":V[4]||(V[4]=B=>a.value=B),placeholder:"请选择管道方向",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Nd),B=>(l.openBlock(),l.createBlock(se,{key:B.value,label:B.label,value:B.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[22]||(V[22]=[l.createElementVNode("div",{class:"row-label"},"是否开启动态流向配置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(I,{modelValue:h.value,"onUpdate:modelValue":V[5]||(V[5]=B=>h.value=B),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(l.Transition,{name:"el-zoom-in-top",mode:"out-in"},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[23]||(V[23]=[l.createElementVNode("div",{class:"row-label"},"关联设备状态",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:m.value,"onUpdate:modelValue":V[6]||(V[6]=B=>m.value=B),placeholder:"请选择设备",multiple:"",onChange:x,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,B=>(l.openBlock(),l.createBlock(se,{key:B.id,label:B.deviceName,value:B.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},512),[[l.vShow,h.value]])]),_:1}),l.createVNode(l.Transition,{name:"el-zoom-in-top"},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[24]||(V[24]=[l.createElementVNode("div",{class:"row-label"},"流向设置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:y.value,"onUpdate:modelValue":V[7]||(V[7]=B=>y.value=B),onChange:w,size:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Nd),B=>(l.openBlock(),l.createBlock(se,{key:B.value,label:B.label,value:B.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},512),[[l.vShow,h.value]])]),_:1})])]),_:1}),l.createVNode(Q,{title:"箭头1设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",hj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[25]||(V[25]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:c.name,"onUpdate:modelValue":V[8]||(V[8]=B=>c.name=B),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(_l),B=>(l.openBlock(),l.createBlock(se,{key:B.value,label:B.label,value:B.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[26]||(V[26]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:c.args.width,"onUpdate:modelValue":V[9]||(V[9]=B=>c.args.width=B),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(U,{span:12},{default:l.withCtx(()=>V[27]||(V[27]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:c.args.height,"onUpdate:modelValue":V[10]||(V[10]=B=>c.args.height=B),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(U,{span:12},{default:l.withCtx(()=>V[28]||(V[28]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:c.args.offset,"onUpdate:modelValue":V[11]||(V[11]=B=>c.args.offset=B),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(Q,{title:"箭头2设置",name:"3"},{default:l.withCtx(()=>[l.createElementVNode("div",fj,[l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[29]||(V[29]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(H,{modelValue:u.name,"onUpdate:modelValue":V[12]||(V[12]=B=>u.name=B),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(_l),B=>(l.openBlock(),l.createBlock(se,{key:B.value,label:B.label,value:B.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(q,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>V[30]||(V[30]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:u.args.width,"onUpdate:modelValue":V[13]||(V[13]=B=>u.args.width=B),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(U,{span:12},{default:l.withCtx(()=>V[31]||(V[31]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:u.args.height,"onUpdate:modelValue":V[14]||(V[14]=B=>u.args.height=B),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(U,{span:12},{default:l.withCtx(()=>V[32]||(V[32]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(X,{modelValue:u.args.offset,"onUpdate:modelValue":V[15]||(V[15]=B=>u.args.offset=B),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-6edc5c24"]]),gj={class:"container"},mj={class:"row-column"},yj={class:"row-column"},bj={class:"row-column"},wj=Nt({__name:"arrow-line",props:{payload:{type:Object,itemId:{type:String,default:""}}},setup(n){var T,A,D,L,j,P;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===Qa?wi:Pd),u=l.ref(e.payload.attrs.arrow.style.animation.split(" ")[0]===dr?dr:bi),d=l.ref(e.payload.attrs.arrow.display),h=()=>{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===wi?Qa:Xm),e.payload.attr("arrow/style/animation",u.value===dr?"flashing 2s infinite linear":""),e.payload.attr("arrow/display",d.value),console.log(e.payload.markup),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs},f=l.ref([]),p=l.ref(((D=(A=(T=e.payload.data)==null?void 0:T.fields)==null?void 0:A[0])==null?void 0:D.deviceCode)??""),g=l.ref(((P=(j=(L=e.payload.data)==null?void 0:L.fields)==null?void 0:j[0])==null?void 0:P.field)??""),m=async()=>{f.value=await ku(e.itemId),p.value&&b()};let y=l.reactive({});const b=()=>{y=f.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 Vu(y.deviceCode)},C=()=>{e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],console.log("箭头线-配置",e.payload)},E=l.ref(e.payload.data.isCondition??!1),v=()=>{e.payload.data.isCondition=E.value},S=l.reactive({show:!1,payload:null}),O=()=>{S.show=!0,S.payload=e.payload.data.condition??[]},_=M=>{S.show=!1,S.payload=null,M&&(e.payload.data.condition=M),console.log("条件线",e.payload.data)};return l.onMounted(()=>{m()}),(M,k)=>{const $=l.resolveComponent("el-col"),V=l.resolveComponent("el-color-picker"),U=l.resolveComponent("el-row"),F=l.resolveComponent("el-input-number"),q=l.resolveComponent("el-collapse-item"),X=l.resolveComponent("el-option"),Q=l.resolveComponent("el-select"),se=l.resolveComponent("el-switch"),H=l.resolveComponent("el-button"),I=l.resolveComponent("el-collapse"),re=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",gj,[l.createVNode(I,{modelValue:t.value,"onUpdate:modelValue":k[10]||(k[10]=B=>t.value=B),accordion:""},{default:l.withCtx(()=>[l.createVNode(q,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",mj,[l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[12]||(k[12]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(V,{modelValue:s.value,"onUpdate:modelValue":k[0]||(k[0]=B=>s.value=B),"show-alpha":!0,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[13]||(k[13]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":k[1]||(k[1]=B=>r.value=B),size:"small","controls-position":"right",onChange:h,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(q,{title:"箭头设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",yj,[l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[14]||(k[14]=[l.createElementVNode("div",{class:"row-label"},"箭头数量",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:o.value,"onUpdate:modelValue":k[2]||(k[2]=B=>o.value=B),size:"small","controls-position":"right",onChange:h,min:1,max:20,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[15]||(k[15]=[l.createElementVNode("div",{class:"row-label"},"箭头颜色",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(V,{modelValue:a.value,"onUpdate:modelValue":k[3]||(k[3]=B=>a.value=B),"show-alpha":!0,size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[16]||(k[16]=[l.createElementVNode("div",{class:"row-label"},"默认箭头方向",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(Q,{modelValue:c.value,"onUpdate:modelValue":k[4]||(k[4]=B=>c.value=B),size:"small",onChange:h},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(I3),B=>(l.openBlock(),l.createBlock(X,{key:B.value,label:B.label,value:B.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[17]||(k[17]=[l.createElementVNode("div",{class:"row-label"},"默认箭头动作",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(se,{modelValue:u.value,"onUpdate:modelValue":k[5]||(k[5]=B=>u.value=B),"active-value":l.unref(dr),"active-text":"闪烁","inactive-value":l.unref(bi),"inactive-text":"静止",size:"small",onChange:h},null,8,["modelValue","active-value","inactive-value"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[18]||(k[18]=[l.createElementVNode("div",{class:"row-label"},"默认箭头显示",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(se,{modelValue:d.value,"onUpdate:modelValue":k[6]||(k[6]=B=>d.value=B),"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small",onChange:h},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(q,{title:"动态设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",bj,[l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[19]||(k[19]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(Q,{modelValue:p.value,"onUpdate:modelValue":k[7]||(k[7]=B=>p.value=B),placeholder:"请选择设备",onChange:b,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,B=>(l.openBlock(),l.createBlock(X,{key:B.deviceCode,label:B.deviceName,value:B.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(Q,{modelValue:g.value,"onUpdate:modelValue":k[8]||(k[8]=B=>g.value=B),placeholder:"请选择字段",onChange:C,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,B=>(l.openBlock(),l.createBlock(X,{key:B.dataField,label:B.name,value:B.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode($,{span:12},{default:l.withCtx(()=>k[20]||(k[20]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode($,{span:12},{default:l.withCtx(()=>[l.createVNode(se,{modelValue:E.value,"onUpdate:modelValue":k[9]||(k[9]=B=>E.value=B),"active-value":!0,"inactive-value":!1,size:"small",onChange:v},null,8,["modelValue"]),l.createVNode(H,{type:"primary",size:"small",onClick:O,style:{"margin-left":"10px"}},{default:l.withCtx(()=>k[21]||(k[21]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(re,{modelValue:S.show,"onUpdate:modelValue":k[11]||(k[11]=B=>S.show=B),width:"900px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[S.show?(l.openBlock(),l.createBlock(lj,{key:0,payload:S.payload,type:"arrow",onClose:_},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-f33df45a"]]),xj={class:"container"},vj={class:"row-column",style:{padding:"5px 1px 10px"}},p0=Nt({__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){const e=n,t=l.ref(e.payload.data.type),s=()=>{e.payload.data.type=t.value,t.value===Ed&&(tt.attrs=Za.attrs,tt.markup=Za.markup),t.value===Od&&(tt.attrs=qm.attrs,tt.markup=qm.markup),t.value===Md&&(tt.attrs=Jm.attrs,tt.markup=Jm.markup),e.payload.attrs=null,e.payload.attr(tt.attrs),e.payload.markup=tt.markup,i()},r=l.shallowRef(null),i=()=>{r.value=null,t.value===Ed&&(r.value=ij),t.value===Od&&(r.value=pj),t.value===Md&&(r.value=wj)};return l.onMounted(()=>{i()}),(o,a)=>{const c=l.resolveComponent("el-col"),u=l.resolveComponent("el-option"),d=l.resolveComponent("el-select"),h=l.resolveComponent("el-row");return l.openBlock(),l.createElementBlock("div",xj,[l.createElementVNode("div",vj,[l.createVNode(h,{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]=f=>t.value=f),placeholder:"请选择线段类型",clearable:"",size:"small",onChange:s},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(R3),f=>(l.openBlock(),l.createBlock(u,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.value),{payload:n.payload,itemId:n.itemId},null,8,["payload","itemId"]))])}}},[["__scopeId","data-v-b641f8fe"]]),Cj={class:"form-container"},Sj=Nt({__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",Cj,[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"]]),Ej=`.x6-widget-dnd {
488
488
  position: absolute;
489
489
  top: -10000px;
490
490
  left: -10000px;
@@ -504,7 +504,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
504
504
  background: transparent;
505
505
  box-shadow: none;
506
506
  }
507
- `;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 Is 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({},Is.defaults),e),this.init()}init(){Kr(this.name,Cj),this.container=document.createElement("div"),se(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new z(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Bt(this.container,this.draggingGraph.container)}start(e,t){const s=t;s.preventDefault(),this.targetModel.startBatch("dnd"),se(this.container,"dragging"),Ss(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(Is.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&&Ze(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")};Ru(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(),Le(this.container,"dragging"),qt(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=rd(e),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return G.create({x:t.left+parseInt(Ze(e,"border-left-width"),10)-r,y:t.top+parseInt(Ze(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(Se.snapToGrid(i.x,u),Se.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:CD(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(),Zr(this.name)}}Sj([be.dispose()],Is.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"}}(Is||(Is={}));function Ej(n,e={}){const t=st.isModel(n)?n:new st().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=Rn.getNodesInColumn(s,w,r);f.push(Rn.getMaxDim(x,"width")+o)}else{(p==null||p==="auto")&&(p=Rn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)f.push(p)}const g=Rn.accumulate(f,d),m=[];let y=e.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Rn.getNodesInRow(s,w,r);m.push(Rn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Rn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Rn.accumulate(m,h);t.startBatch("layout"),s.forEach((w,x)=>{const C=x%r,E=Math.floor(x/r),v=f[C],S=m[E];let O=0,_=0,T=w.getSize();if(u){let A=v-2*o,V=S-2*a;const L=T.height*(T.width?A/T.width:1),B=T.width*(T.height?V/T.height:1);S<L?A=B:V=L,T={width:A,height:V},w.setSize(T,e)}c&&(O=(v-T.width)/2,_=(S-T.height)/2),w.position(g[C]+o+O,b[E]+a+_,e)}),t.stopBatch("layout")}var Rn;(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})(Rn||(Rn={}));const Oj=`.x6-widget-dnd {
507
+ `;var Oj=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 Is 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({},Is.defaults),e),this.init()}init(){Kr(this.name,Ej),this.container=document.createElement("div"),te(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new z(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Lt(this.container,this.draggingGraph.container)}start(e,t){const s=t;s.preventDefault(),this.targetModel.startBatch("dnd"),te(this.container,"dragging"),Ss(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(Is.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&&Ke(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")};Ru(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(),Ie(this.container,"dragging"),Yt(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=rd(e),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return W.create({x:t.left+parseInt(Ke(e,"border-left-width"),10)-r,y:t.top+parseInt(Ke(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,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:SD(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(),Zr(this.name)}}Oj([ye.dispose()],Is.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"}}(Is||(Is={}));function Mj(n,e={}){const t=nt.isModel(n)?n:new nt().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=Rn.getNodesInColumn(s,w,r);f.push(Rn.getMaxDim(x,"width")+o)}else{(p==null||p==="auto")&&(p=Rn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)f.push(p)}const g=Rn.accumulate(f,d),m=[];let y=e.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Rn.getNodesInRow(s,w,r);m.push(Rn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Rn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Rn.accumulate(m,h);t.startBatch("layout"),s.forEach((w,x)=>{const C=x%r,E=Math.floor(x/r),v=f[C],S=m[E];let O=0,_=0,T=w.getSize();if(u){let A=v-2*o,D=S-2*a;const L=T.height*(T.width?A/T.width:1),j=T.width*(T.height?D/T.height:1);S<L?A=j:D=L,T={width:A,height:D},w.setSize(T,e)}c&&(O=(v-T.width)/2,_=(S-T.height)/2),w.position(g[C]+o+O,b[E]+a+_,e)}),t.stopBatch("layout")}var Rn;(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})(Rn||(Rn={}));const Nj=`.x6-widget-dnd {
508
508
  position: absolute;
509
509
  top: -10000px;
510
510
  left: -10000px;
@@ -739,4 +739,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
739
739
  font-size: 12px;
740
740
  background: 0 0;
741
741
  }
742
- `;var Mj=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 xi 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",Kr(this.name,Oj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},xi.defaultOptions),e),this.init()}init(){this.dnd=new Is(this.options),this.onSearch=Cp(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}),se(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}),Le(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return Tn(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&Tn(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];qt(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),se(this.container,this.prefixClassName(Tt.base)),pe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),se(this.content,this.prefixClassName(Tt.content)),Ss(this.content,this.container)}initSearch(){this.options.search&&(se(this.container,"searchable"),Bt(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");se(s,this.prefixClassName(Tt.group)),pe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&se(s,"collapsable"),yn(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");se(r,this.prefixClassName(Tt.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");se(i,this.prefixClassName(Tt.groupContent));const o=e.graphOptions,a=new z(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new st,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),Bt(i,a.container),Bt(s,[r,i]),Ss(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 z(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new st,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));Bt(this.content,t.container),this.graphs[Oo.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(se(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?se(this.container,"collapsed"):Le(this.container,"collapsed")):Le(this.container,"collapsable")}setTitle(){const e=document.createElement("div");se(e,this.prefixClassName(Tt.title)),e.innerHTML=this.options.title,Ss(e,this.container)}renderSearch(){const e=document.createElement("div");se(e,this.prefixClassName(Tt.search));const t=document.createElement("input");return pe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),se(t,this.prefixClassName(Tt.searchText)),Bt(e,t),e}startListening(){const e=this.prefixClassName(Tt.title),t=this.prefixClassName(Tt.searchText),s=this.prefixClassName(Tt.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=>Ye.isNode(u)?u:Ye.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&&ie(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===Oo.defaultGroupName?null:i,c=o.model.getNodes().filter(f=>{let p=!1;typeof t=="function"?p=ie(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&&yn(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,h=new st;return h.resetCells(c),d.layout&&ie(d.layout,this,h,this.getGroup(i)),this.groups[i]&&yn(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);yn(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(){se(this.container,"is-focused")}onSearchFocusOut(){Le(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(yn(this.container,"collapsed"),Tn(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Tt.group)}`);t&&this.toggleGroup(pe(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||Tn(o,"collapsed")});yn(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||Oo.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];qt(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Zr(this.name)}}Mj([be.dispose()],xi.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};Ej(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},Is.defaults)}(xi||(xi={}));var Tt;(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`})(Tt||(Tt={}));var Oo;(function(n){n.defaultGroupName="__default__"})(Oo||(Oo={})),z.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},z.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},z.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},z.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},z.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},z.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};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 g0 extends Ve{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{nr.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{nr.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{nr.downloadDataUri(nr.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=le.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 C=window.getComputedStyle(w,null),E={};Object.keys(C).forEach(v=>{E[v]=C.getPropertyValue(v)}),y[x]=E}),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 C=window.getComputedStyle(w,null),E=y[x],v={};Object.keys(C).forEach(S=>{!Bc(S)&&C.getPropertyValue(S)!==E[S]&&(v[S]=C.getPropertyValue(S))}),b[x]=v}),p.forEach((w,x)=>{Ze(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const h=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(le.create("style",{type:"text/css"},[h]))}const d=()=>{const h=t.beforeSerialize;if(typeof h=="function"){const p=ie(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");nr.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=xs(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 G(-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=G.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()}}Nj([Ve.dispose()],g0.prototype,"dispose",null);const Pj={class:"form-container"},_j={class:"footer",style:{"margin-top":"10px"}},Aj=_t({__name:"image-condition",props:{payload:{type:Array},type:{type:String}},emits:["close"],setup(n,{emit:e}){const t=n,s=l.ref(t.payload),r=l.ref([]),i=async()=>{try{const h=await ws("/custom/groupList"),f=(h==null?void 0:h.data)||[],p=[];f.forEach(g=>{g!=null&&g.pictureList&&p.push(...g.pictureList)}),r.value=p}catch(h){console.error("获取图片列表失败:",h)}},o=()=>{s.value.push({min:0,max:100,imageUrl:""})},a=h=>{s.value.splice(h,1)},c=e,u=()=>{c("close",s.value)},d=()=>{c("close",!1)};return l.onMounted(()=>{i()}),(h,f)=>{const p=l.resolveComponent("el-button"),g=l.resolveComponent("el-input-number"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-option"),b=l.resolveComponent("el-select"),w=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",Pj,[l.createVNode(p,{type:"primary",size:"small",onClick:o,style:{"margin-bottom":"10px"}},{default:l.withCtx(()=>f[0]||(f[0]=[l.createTextVNode("添加条件")])),_:1}),l.createVNode(w,{data:s.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(m,{prop:"min",label:"最小值",width:"150",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{modelValue:x.row.min,"onUpdate:modelValue":C=>x.row.min=C,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(m,{prop:"max",label:"最大值",width:"150",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{modelValue:x.row.max,"onUpdate:modelValue":C=>x.row.max=C,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(m,{prop:"imageUrl",label:"更换元件",width:"120",align:"center"},{default:l.withCtx(x=>[l.createVNode(b,{modelValue:x.row.imageUrl,"onUpdate:modelValue":C=>x.row.imageUrl=C,placeholder:"请选择元件",size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,C=>(l.openBlock(),l.createBlock(y,{key:C.imageUrl,label:C.imageName,value:C.imageUrl},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(p,{type:"danger",size:"small",onClick:C=>a(x.$index)},{default:l.withCtx(()=>f[1]||(f[1]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createElementVNode("div",_j,[l.createVNode(p,{type:"primary",onClick:u},{default:l.withCtx(()=>f[2]||(f[2]=[l.createTextVNode("保存")])),_:1}),l.createVNode(p,{onClick:d},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("取消")])),_:1})])])}}},[["__scopeId","data-v-5aeee792"]]),Tj={class:"control-box"},kj={class:"row-column"},Vj=_t({__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var O,_,T,A,V,L,B;const e=n,t=()=>{e.payload.data?(typeof e.payload.data.type>"u"&&(e.payload.data.type="image"),typeof e.payload.data.isCondition>"u"&&(e.payload.data.isCondition=!1),Array.isArray(e.payload.data.fields)||(e.payload.data.fields=[]),Array.isArray(e.payload.data.condition)||(e.payload.data.condition=[])):e.payload.data={type:"image",isCondition:!1,fields:[],condition:[]}};t();const s=l.ref("1"),r=l.ref([]),i=l.ref([]),o=l.ref(((T=(_=(O=e.payload.data)==null?void 0:O.fields)==null?void 0:_[0])==null?void 0:T.deviceCode)??""),a=l.ref(((L=(V=(A=e.payload.data)==null?void 0:A.fields)==null?void 0:V[0])==null?void 0:L.field)??""),c=l.ref([]);let u=l.reactive({});const d=l.ref(((B=e.payload.data)==null?void 0:B.isCondition)??!1),h=l.reactive({show:!1,payload:null}),f=async()=>{i.value=await Ja(e.itemId),o.value&&p()},p=()=>{t(),u=i.value.find(P=>P.deviceCode===o.value),u?(g(),e.payload.data.fields=[{index:0,deviceName:u.deviceName,deviceCode:u.deviceCode,field:a.value??""}],a.value=e.payload.data.fields[0].field):(a.value="",e.payload.data.fields=[]),console.log("图片配置",e.payload)},g=async()=>{u!=null&&u.deviceCode&&(c.value=await Ka(u.deviceCode))},m=()=>{t(),e.payload.data.fields=[{index:0,deviceName:(u==null?void 0:u.deviceName)??"",deviceCode:(u==null?void 0:u.deviceCode)??"",field:a.value??""}],console.log("图片配置",e.payload)},y=()=>{t(),e.payload.data.isCondition=d.value},b=()=>{t(),h.show=!0,h.payload=e.payload.data.condition??[]},w=P=>{h.show=!1,h.payload=null,P&&(t(),e.payload.data.condition=P),console.log("图片条件配置",e.payload.data)},x=()=>{r.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(P=>({id:P.id,attrs:P.attrs,args:{x:Number(P.args.x.replace("%","")),y:Number(P.args.y.replace("%",""))}}))))},C=()=>{const P=Du;P.attrs.text.text=`${e.payload.getPorts().length+1}`,P.args.x="50%",P.args.y="50%",e.payload.addPorts([{group:"ports",...P}]),x()},E=()=>{Gr("#drawing-board",!0)},v=(P,M,k)=>{e.payload.portProp(P,"args/"+M,k+"%"),x()},S=P=>{e.payload.removePort(P),x()};return l.onMounted(()=>{t(),x(),f()}),(P,M)=>{const k=l.resolveComponent("el-col"),j=l.resolveComponent("el-option"),W=l.resolveComponent("el-select"),Z=l.resolveComponent("el-row"),$=l.resolveComponent("el-switch"),D=l.resolveComponent("el-button"),U=l.resolveComponent("el-collapse-item"),ne=l.resolveComponent("el-table-column"),Q=l.resolveComponent("el-slider"),F=l.resolveComponent("el-icon"),R=l.resolveComponent("el-table"),re=l.resolveComponent("el-collapse"),q=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Tj,[l.createVNode(re,{modelValue:s.value,"onUpdate:modelValue":M[3]||(M[3]=J=>s.value=J),accordion:""},{default:l.withCtx(()=>[l.createVNode(U,{title:"图片设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",kj,[l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(k,{span:12},{default:l.withCtx(()=>M[5]||(M[5]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(k,{span:12},{default:l.withCtx(()=>[l.createVNode(W,{modelValue:o.value,"onUpdate:modelValue":M[0]||(M[0]=J=>o.value=J),placeholder:"请选择设备",onChange:p,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,J=>(l.openBlock(),l.createBlock(j,{key:J.deviceCode,label:J.deviceName,value:J.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(W,{modelValue:a.value,"onUpdate:modelValue":M[1]||(M[1]=J=>a.value=J),placeholder:"请选择字段",onChange:m,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,J=>(l.openBlock(),l.createBlock(j,{key:J.dataField,label:J.name,value:J.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(k,{span:12},{default:l.withCtx(()=>M[6]||(M[6]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(k,{span:12},{default:l.withCtx(()=>[l.createVNode($,{modelValue:d.value,"onUpdate:modelValue":M[2]||(M[2]=J=>d.value=J),"active-value":!0,"inactive-value":!1,size:"small",onChange:y},null,8,["modelValue"]),l.createVNode(D,{type:"primary",size:"small",onClick:b,style:{"margin-left":"10px"}},{default:l.withCtx(()=>M[7]||(M[7]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1}),l.createVNode(U,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(D,{type:"primary",onClick:C,size:"small"},{default:l.withCtx(()=>M[8]||(M[8]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(D,{type:"primary",onClick:E,size:"small"},{default:l.withCtx(()=>M[9]||(M[9]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(R,{data:r.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(ne,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:J})=>[l.createTextVNode(l.toDisplayString(J.attrs.text.text),1)]),_:1}),l.createVNode(ne,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:J})=>[l.createVNode(Q,{modelValue:J.args.x,"onUpdate:modelValue":Ee=>J.args.x=Ee,min:0,max:100,step:1,onInput:Ee=>v(J.id,"x",Ee)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(ne,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:J})=>[l.createVNode(Q,{modelValue:J.args.y,"onUpdate:modelValue":Ee=>J.args.y=Ee,min:0,max:100,step:1,onInput:Ee=>v(J.id,"y",Ee)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(ne,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:J})=>[l.createVNode(D,{type:"danger",size:"small",onClick:Ee=>S(J.id)},{default:l.withCtx(()=>[l.createVNode(F,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Km))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(q,{modelValue:h.show,"onUpdate:modelValue":M[4]||(M[4]=J=>h.show=J),width:"550px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[h.show?(l.openBlock(),l.createBlock(Aj,{key:0,payload:h.payload,type:"image",onClose:w},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-71c9aed4"]]),m0=[{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"}}],y0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},Dj={style:{width:"100%",height:"100%",position:"relative"}},Rj={key:0,class:"spinner"},Td=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=()=>{window.__x6_instances__=[];const v=document.getElementById("preview-container");t.value=new z({container:v,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}}),window.__x6_instances__.push(v),t.value.on("blank:dblclick",()=>{f()}),t.value.on("render:done",()=>{Gr("#preview-container",!1),x()})},r=async()=>{let v,S,O;if(e.id){const _=await Ym(e.id);v=(_==null?void 0:_.background)||Za,S=(_==null?void 0:_.grid)||Qa,O=(_==null?void 0:_.data)||{cells:[]}}else v=e.background,S={},O=e.data;t.value.drawBackground(v),t.value.drawGrid(S),t.value.fromJSON(O),d()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=l.ref(!1),u=l.ref(!1),d=()=>{o.value=t.value.getCells().filter(v=>{var S,O,_,T;return((S=v==null?void 0:v.data)==null?void 0:S.type)==="text"||((O=v==null?void 0:v.data)==null?void 0:O.type)==="pipe"||((_=v==null?void 0:v.data)==null?void 0:_.type)==="arrow"||((T=v==null?void 0:v.data)==null?void 0:T.type)=="image"}),o.value.forEach(v=>{var S,O;(O=(S=v==null?void 0:v.data)==null?void 0:S.fields)!=null&&O.length&&a.value.push({id:v==null?void 0:v.id,fields:v==null?void 0:v.data.fields})}),f()},h=l.ref(!0),f=async()=>{if(u.value=!0,!a.value.length){u.value=!1;return}if(!h.value){Je.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),h.value=!1,console.log("字段数据",a.value),await p(a.value),!c.value&&(i.value=setTimeout(()=>{f()},1e4))},p=async(v,S=0)=>{let O=5;if(!c.value)if(v.length>S*O){const _=v.slice(S*O,S*O+O);console.log("批次:",S,"数据:",_),S++,g(await oD(_)),await p(v,S)}else u.value=!1,h.value=!0},g=v=>{v==null||v.forEach(S=>{var _,T,A;const O=t.value.getCellById(S.id);O.data.type==="text"&&(O.label=m(O.data.content,S.fields)),O.data.type==="pipe"&&(console.log("管道详情",O,(_=S.fields)==null?void 0:_[0].value),y(O,(T=S.fields)==null?void 0:T[0].value)),O.data.type==="arrow"&&b(O,(A=S.fields)==null?void 0:A[0].value),O.shape==="image"&&(console.log("图片详情",O,S.fields),w(O,S.fields))})},m=(v,S)=>{let O=0;return v.replace(Ad,()=>{const _=S.find(T=>T.index===O);return O++,_?_.value:d0})},y=(v,S)=>{if(!v.data.isCondition)return!1;console.log("进入设置管道阶段start:",v),console.log("管道条件判断设置:",v.data.condition);for(let O=0;O<v.data.condition.length;O++){if(console.log("┌──────单个设置管道阶段start:───────┐"),console.log("条件:",v.data.condition[O]),console.log("判断条件是否通过:",Number(S)>v.data.condition[O].min&&Number(S)<v.data.condition[O].max),Number(S)>v.data.condition[O].min&&Number(S)<v.data.condition[O].max)return console.log("管道条件判断设置的动画:",Pd(v.data.condition[O].direction)),v.attr("pipe/style/animation",Pd(v.data.condition[O].direction)),console.log("设置过后的属性:",v),console.log("└────────单个条件结束判断────────┘"),!1;console.log("└─────────单个条件结束判断───────┘")}},b=(v,S)=>{if(console.log(v,S),!v.data.isCondition)return!1;for(let O=0;O<v.data.condition.length;O++)if(Number(S)>v.data.condition[O].min&&Number(S)<v.data.condition[O].max)return v.attr("arrow/style/animation",v.data.condition[O].animation===dr?"flashing 2s infinite linear":""),v.attr("arrow/d",v.data.condition[O].direction===wi?tl:Xm),v.attr("arrow/display",v.data.condition[O].display),!1},w=(v,S)=>{if(!v.data.isCondition||(console.log("进入设置图片阶段:",v),console.log("图片条件判断设置:",v.data.condition),console.log("设备字段数据:",S),!S||S.length===0))return!1;const O=S[0],_=Number(O.value);for(let T=0;T<v.data.condition.length;T++){const A=v.data.condition[T];if(console.log(v.data,"cell.data55555555"),_>A.min&&_<A.max)return A.imageUrl&&(console.log("更换图片为:",Eo(A==null?void 0:A.imageUrl)),v.attr("image/xlink:href",xe.isSunOs?A==null?void 0:A.imageUrl:Eo(A==null?void 0:A.imageUrl))),!1}console.log("未匹配到条件,保持原图片")},x=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},C=l.shallowRef(),E=()=>{new ResizeObserver(()=>{x()}).observe(C.value)};return l.onMounted(()=>{c.value=!1,s(),r(),E()}),l.onUnmounted(()=>{c.value=!0,clearInterval(i.value)}),(v,S)=>(l.openBlock(),l.createElementBlock("div",Dj,[l.createElementVNode("div",{id:"preview-container",ref_key:"previewRef",ref:C,onDblclick:x},null,544),u.value?(l.openBlock(),l.createElementBlock("div",Rj,S[0]||(S[0]=[l.createElementVNode("div",{class:"spinner1"},null,-1)]))):l.createCommentVNode("",!0)]))}}),Ij={class:"form-container"},Lj={class:"footer"},Bj=_t({__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?Xa("/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(Je.success("保存成功"),s("close",!0)):Je.error((d==null?void 0:d.msg)||"保存失败")}):Xa("/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(Je.success("保存成功"),s("close",!0)):Je.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",Ij,[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",Lj,[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-807a2ed3"]]),jj={class:"form-container"},$j={class:"footer"},zj=_t({__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){Je.error("请上传图片格式的文件");return}const f=new FormData;f.append("file",h.raw),iD("/file/fileUpload",f).then(p=>{p!=null&&p.isOk?xe.isSunOs?(a.value=p==null?void 0:p.data,i.imageUrl=p==null?void 0:p.data):(a.value=Kn.defaults.baseURL+"/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):Je.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(h=>{if(h)Xa("/custom/savePicture",i).then(f=>{f!=null&&f.isOk?(Je.success("保存成功"),t("close",!0)):Je.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=xe.isSunOs?s.payload.imageUrl:Eo(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"),C=l.resolveComponent("el-button"),E=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",jj,[l.createVNode(E,{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]=v=>i.imageName=v),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]=v=>i.sort=v),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]=v=>i.isShow=v),"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(bD))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",$j,[l.createVNode(C,{type:"primary",onClick:u},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(C,{onClick:d},{default:l.withCtx(()=>f[4]||(f[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-8f1bae4f"]]),Fj={class:"form-container"},Uj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},Hj=["src"],Gj=_t({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{ws("/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=>{(xe.isSunOs?ws:Wm)("/custom/removeGroup/"+f).then(g=>{g.code===200?(Je.success("删除成功"),t()):Je.error(g.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=>{(xe.isSunOs?ws:Wm)("/custom/removePicture/"+f).then(g=>{g.code===200?(Je.success("删除成功"),t()):Je.error(g.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",Fj,[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",Uj,[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(xe.isSunOs)?x.row.imageUrl:l.unref(Eo)(x.row.imageUrl),alt:"",style:{width:"64px",height:"64px"}},null,8,Hj)]),_: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:C=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑 ")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:C=>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(Bj,{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(zj,{key:0,payload:a.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-721437e3"]]),Wj={class:"page-container"},Yj={class:"tool-bar"},qj={class:"action"},Xj={class:"el-dropdown-link"},Jj={class:"action",style:{"margin-right":"50px"}},Kj={class:"board"},Zj={class:"drawing-board-box"},Qj={id:"controls"},e$={key:0,class:"controls-label"},t$={style:{width:"100%",height:"100%",background:"black"}},b0=_t(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""},itemId:{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=()=>{window.__x6_instances__=[];const L=document.getElementById("drawing-board");s.value=new z({container:L,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",...nt,data:{type:u0()},zIndex:0})}}}),window.__x6_instances__.push(s.value),s.value.use(I3()),s.value.use(L3()),s.value.use(B3()),s.value.use(j3()),s.value.use(z3()),s.value.use(F3()),s.value.bindKey(["delete","backspace"],()=>{U3(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{H3(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{G3(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{W3(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Y3(s.value)});let B=null;s.value.on("edge:click",({cell:P})=>{o.value=P,r.component=p0,r.label="线段属性",i.value=_d()}),s.value.on("edge:mouseenter",({cell:P})=>{clearTimeout(B),P.toFront(),q3(P)}),s.value.on("edge:mouseleave",({cell:P})=>{B=setTimeout(()=>{P.toBack(),P.removeTools()},300)}),s.value.on("node:mouseenter",()=>{Gr("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Gr("#drawing-board",!1)}),s.value.use(new g0),s.value.on("blank:click",({e:P,x:M,y:k})=>{o.value=s,r.component=dD,r.label="画布属性",i.value=_d()}),s.value.on("cell:click",({cell:P})=>{var M,k;if(o.value=P,i.value=_d(),((M=P.data)==null?void 0:M.type)==="text"){r.component=h0,r.label="文本属性";return}if(((k=P.data)==null?void 0:k.type)==="base-shape"){r.component=h0,r.label="基础图形属性";return}if((P==null?void 0:P.shape)==="edge"){r.component=p0,r.label="连线属性";return}if((P==null?void 0:P.shape)==="image"){r.component=Vj,r.label="图片属性";return}r.component=null,r.label=null}),s.value.on("render:done",()=>{Gr("#drawing-board",!1),g()})},c=l.ref(),u=()=>{c.value=new xi({target:s.value,...aD,groups:[{name:"基础组件",graphPadding:30}],search(P,M){var k;return((k=P.label)==null?void 0:k.indexOf(M))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:P=>{const M=P.clone({keepId:!0});return M.label!=="文本"&&(M.label=""),M}});const L=s.value.createNode({...lD}),B=m0.map(P=>(P.ports=y0,s.value.createNode(P)));c.value.load([L,...B],"基础组件"),ws("/custom/groupList").then(P=>{const M=(P==null?void 0:P.data)||[];M==null||M.forEach(k=>{c.value.addGroup({name:k==null?void 0:k.groupName,graphPadding:30});const j=k==null?void 0:k.pictureList.map(W=>{const Z={shape:"image",imageUrl:xe.isSunOs?W==null?void 0:W.imageUrl:Eo(W==null?void 0:W.imageUrl),ports:y0,width:64,height:64,label:W.imageName};return s.value.createNode(Z)});c.value.load(j,k==null?void 0:k.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{const P=c.value.container,M=P.querySelectorAll(".x6-node"),k=m0.length;P.addEventListener("mouseenter",j,!0),P.addEventListener("mouseleave",W,!0),M.forEach((Z,$)=>{const D=$>k,U=Z.querySelector("text");D&&U&&(Object.assign(U.style,{display:"none",fontSize:"12px",fill:"#ffffff"}),U.setAttribute("x","0%"),U.setAttribute("y","40"),Z.style.position="relative",Z.style.cursor="pointer")});function j(Z){const $=Z.target.closest(".x6-node");if($){const D=Array.from(M).indexOf($),U=$.querySelector("text");D>k&&U&&(U.style.display="block")}}function W(Z){const $=Z.target.closest(".x6-node");if($){const D=Array.from(M).indexOf($),U=$.querySelector("text");D>k&&U&&(U.style.display="none")}}return()=>{P.removeEventListener("mouseenter",j,!0),P.removeEventListener("mouseleave",W,!0)}},200)})},d=L=>{switch(L){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),Je.warning("关闭对齐线")):(s.value.enableSnapline(),Je.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),Je.warning("关闭框选")):(s.value.enableSelection(),Je.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":C();break}},h=l.ref(!1),f=l.ref(null),p=()=>{h.value=!0;const L=new Date;s.value.startBatch(L),s.value.disablePanning(),s.value.once("blank:mousedown",({e:B,x:P,y:M})=>{h.value&&(f.value=s.value.addEdge({source:{x:P,y:M},target:{x:P,y:M},...nt,data:{type:u0(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:B,x:P,y:M})=>{h.value&&f.value.setTarget({x:P,y:M})}),s.value.on("blank:mouseup",({e:B,x:P,y:M})=>{h.value=!1,s.value.enablePanning(),s.value.stopBatch(L)})},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(Za),s.value.drawGrid(Qa),Je.success("清空成功")},C=()=>{const L=X().format("YYYYMMDDHHmmss");s.value.exportPNG(L,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},E=e,v=l.reactive({show:!1,background:null,grid:null,data:null}),S=()=>{v.background=s.value.options.background,v.grid=s.value.options.grid,v.data=s.value.toJSON(),v.show=!0},O=()=>{v.show=!1},_=()=>{E("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},T=async()=>{if(!t.id){s.value.drawBackground(Za),s.value.drawGrid(Qa),s.value.fromJSON({cells:[]});return}const L=await Ym(t.id);s.value.drawBackground((L==null?void 0:L.background)||Za),s.value.drawGrid((L==null?void 0:L.grid)||Qa),s.value.fromJSON((L==null?void 0:L.data)||{cells:[]})},A=l.shallowRef(null),V=()=>{new ResizeObserver(()=>{g()}).observe(A.value)};return l.onMounted(()=>{a(),u(),T(),V()}),(L,B)=>{const P=l.resolveComponent("el-icon"),M=l.resolveComponent("el-button"),k=l.resolveComponent("el-dropdown-item"),j=l.resolveComponent("el-dropdown-menu"),W=l.resolveComponent("el-dropdown"),Z=l.resolveComponent("el-scrollbar"),$=l.resolveComponent("el-dialog"),D=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",Wj,[l.createElementVNode("div",Yj,[l.createElementVNode("div",qj,[l.createVNode(W,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(k,{command:"snapLine"},{default:l.withCtx(()=>B[4]||(B[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(k,{command:"select"},{default:l.withCtx(()=>B[5]||(B[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(k,{command:"drawLine"},{default:l.withCtx(()=>B[6]||(B[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(k,{command:"adaptive"},{default:l.withCtx(()=>B[7]||(B[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(k,{command:"shortcuts"},{default:l.withCtx(()=>B[8]||(B[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(k,{command:"image"},{default:l.withCtx(()=>B[9]||(B[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(k,{command:"clear"},{default:l.withCtx(()=>B[10]||(B[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(k,{command:"export"},{default:l.withCtx(()=>B[11]||(B[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",Xj,[l.createVNode(M,{size:"small",text:""},{default:l.withCtx(()=>[B[3]||(B[3]=l.createTextVNode("工具 ")),l.createVNode(P,null,{default:l.withCtx(()=>[l.createVNode(l.unref(fD))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",Jj,[l.createVNode(l.unref(Kg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(M,{size:"small",icon:l.unref(xD),onClick:S},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Kg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(M,{size:"small",icon:l.unref(mD),onClick:_},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",Kj,[B[12]||(B[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",Zj,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:A},null,512)]),l.createElementVNode("div",Qj,[r.label?(l.openBlock(),l.createElementBlock("div",e$,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(Z,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value,itemId:t.itemId},null,8,["graph","payload","itemId"]))]),_:1})])]),l.createVNode($,{modelValue:m.show,"onUpdate:modelValue":B[0]||(B[0]=U=>m.show=U),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(vj)]),_:1},8,["modelValue"]),l.createVNode($,{modelValue:b.show,"onUpdate:modelValue":B[1]||(B[1]=U=>b.show=U),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[b.show?(l.openBlock(),l.createBlock(Gj,{key:0})):l.createCommentVNode("",!0)]),_:1},8,["modelValue"]),l.createVNode(D,{class:"no-border-drawer",modelValue:v.show,"onUpdate:modelValue":B[2]||(B[2]=U=>v.show=U),onClose:O,title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",t$,[v.show?(l.openBlock(),l.createBlock(Td,{key:0,background:v.background,grid:v.grid,data:v.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-5dc3c2c6"]]),n$=[b0,Td],w0=n=>{n$.forEach(e=>{n.component(e.name,e)})};typeof window<"u"&&window.Vue&&w0(window.Vue),xe.isSunOs=!1;const s$=n=>{xe.isSunOs=n},r$={install:w0};xe.WiringDiagramEditor=b0,xe.WiringDiagramPreview=Td,xe.default=r$,xe.setBaseURL=sD,xe.setIsSunOs=s$,xe.setToken=rD,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
742
+ `;var Pj=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 xi 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",Kr(this.name,Nj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},xi.defaultOptions),e),this.init()}init(){this.dnd=new Is(this.options),this.onSearch=Cp(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}),te(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}),Ie(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return Tn(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&Tn(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];Yt(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),te(this.container,this.prefixClassName(_t.base)),fe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),te(this.content,this.prefixClassName(_t.content)),Ss(this.content,this.container)}initSearch(){this.options.search&&(te(this.container,"searchable"),Lt(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");te(s,this.prefixClassName(_t.group)),fe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&te(s,"collapsable"),yn(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");te(r,this.prefixClassName(_t.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");te(i,this.prefixClassName(_t.groupContent));const o=e.graphOptions,a=new z(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new nt,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),Lt(i,a.container),Lt(s,[r,i]),Ss(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 z(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new nt,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));Lt(this.content,t.container),this.graphs[Oo.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(te(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?te(this.container,"collapsed"):Ie(this.container,"collapsed")):Ie(this.container,"collapsable")}setTitle(){const e=document.createElement("div");te(e,this.prefixClassName(_t.title)),e.innerHTML=this.options.title,Ss(e,this.container)}renderSearch(){const e=document.createElement("div");te(e,this.prefixClassName(_t.search));const t=document.createElement("input");return fe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),te(t,this.prefixClassName(_t.searchText)),Lt(e,t),e}startListening(){const e=this.prefixClassName(_t.title),t=this.prefixClassName(_t.searchText),s=this.prefixClassName(_t.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=>Ge.isNode(u)?u:Ge.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&&ne(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===Oo.defaultGroupName?null:i,c=o.model.getNodes().filter(f=>{let p=!1;typeof t=="function"?p=ne(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&&yn(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,h=new nt;return h.resetCells(c),d.layout&&ne(d.layout,this,h,this.getGroup(i)),this.groups[i]&&yn(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);yn(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(){te(this.container,"is-focused")}onSearchFocusOut(){Ie(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(yn(this.container,"collapsed"),Tn(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(_t.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||Tn(o,"collapsed")});yn(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||Oo.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];Yt(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Zr(this.name)}}Pj([ye.dispose()],xi.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};Mj(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},Is.defaults)}(xi||(xi={}));var _t;(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`})(_t||(_t={}));var Oo;(function(n){n.defaultGroupName="__default__"})(Oo||(Oo={})),z.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},z.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},z.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},z.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},z.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},z.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var _j=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 g0 extends ke{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{nr.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{nr.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{nr.downloadDataUri(nr.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=ae.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 C=window.getComputedStyle(w,null),E={};Object.keys(C).forEach(v=>{E[v]=C.getPropertyValue(v)}),y[x]=E}),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 C=window.getComputedStyle(w,null),E=y[x],v={};Object.keys(C).forEach(S=>{!Ic(S)&&C.getPropertyValue(S)!==E[S]&&(v[S]=C.getPropertyValue(S))}),b[x]=v}),p.forEach((w,x)=>{Ke(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const h=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(ae.create("style",{type:"text/css"},[h]))}const d=()=>{const h=t.beforeSerialize;if(typeof h=="function"){const p=ne(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");nr.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=xs(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 W(-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=W.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()}}_j([ke.dispose()],g0.prototype,"dispose",null);const Aj={class:"form-container"},Tj={class:"footer",style:{"margin-top":"10px"}},kj=Nt({__name:"image-condition",props:{payload:{type:Array},type:{type:String}},emits:["close"],setup(n,{emit:e}){const t=n,s=l.ref(t.payload),r=l.ref([]),i=async()=>{try{const h=await Zn("/custom/groupList"),f=(h==null?void 0:h.data)||[],p=[];f.forEach(g=>{g!=null&&g.pictureList&&p.push(...g.pictureList)}),r.value=p}catch(h){console.error("获取图片列表失败:",h)}},o=()=>{s.value.push({min:0,max:100,imageUrl:""})},a=h=>{s.value.splice(h,1)},c=e,u=()=>{c("close",s.value)},d=()=>{c("close",!1)};return l.onMounted(()=>{i()}),(h,f)=>{const p=l.resolveComponent("el-button"),g=l.resolveComponent("el-input-number"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-option"),b=l.resolveComponent("el-select"),w=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",Aj,[l.createVNode(p,{type:"primary",size:"small",onClick:o,style:{"margin-bottom":"10px"}},{default:l.withCtx(()=>f[0]||(f[0]=[l.createTextVNode("添加条件")])),_:1}),l.createVNode(w,{data:s.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(m,{prop:"min",label:"最小值",width:"150",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{modelValue:x.row.min,"onUpdate:modelValue":C=>x.row.min=C,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(m,{prop:"max",label:"最大值",width:"150",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{modelValue:x.row.max,"onUpdate:modelValue":C=>x.row.max=C,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(m,{prop:"imageUrl",label:"更换元件",width:"120",align:"center"},{default:l.withCtx(x=>[l.createVNode(b,{modelValue:x.row.imageUrl,"onUpdate:modelValue":C=>x.row.imageUrl=C,placeholder:"请选择元件",size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,C=>(l.openBlock(),l.createBlock(y,{key:C.imageUrl,label:C.imageName,value:C.imageUrl},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(p,{type:"danger",size:"small",onClick:C=>a(x.$index)},{default:l.withCtx(()=>f[1]||(f[1]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createElementVNode("div",Tj,[l.createVNode(p,{type:"primary",onClick:u},{default:l.withCtx(()=>f[2]||(f[2]=[l.createTextVNode("保存")])),_:1}),l.createVNode(p,{onClick:d},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("取消")])),_:1})])])}}},[["__scopeId","data-v-5aeee792"]]),Vj={class:"control-box"},Dj={class:"row-column"},Rj=Nt({__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var O,_,T,A,D,L,j;const e=n,t=()=>{e.payload.data?(typeof e.payload.data.type>"u"&&(e.payload.data.type="image"),typeof e.payload.data.isCondition>"u"&&(e.payload.data.isCondition=!1),Array.isArray(e.payload.data.fields)||(e.payload.data.fields=[]),Array.isArray(e.payload.data.condition)||(e.payload.data.condition=[])):e.payload.data={type:"image",isCondition:!1,fields:[],condition:[]}};t();const s=l.ref("1"),r=l.ref([]),i=l.ref([]),o=l.ref(((T=(_=(O=e.payload.data)==null?void 0:O.fields)==null?void 0:_[0])==null?void 0:T.deviceCode)??""),a=l.ref(((L=(D=(A=e.payload.data)==null?void 0:A.fields)==null?void 0:D[0])==null?void 0:L.field)??""),c=l.ref([]);let u=l.reactive({});const d=l.ref(((j=e.payload.data)==null?void 0:j.isCondition)??!1),h=l.reactive({show:!1,payload:null}),f=async()=>{i.value=await ku(e.itemId),o.value&&p()},p=()=>{t(),u=i.value.find(P=>P.deviceCode===o.value),u?(g(),e.payload.data.fields=[{index:0,deviceName:u.deviceName,deviceCode:u.deviceCode,field:a.value??""}],a.value=e.payload.data.fields[0].field):(a.value="",e.payload.data.fields=[]),console.log("图片配置",e.payload)},g=async()=>{u!=null&&u.deviceCode&&(c.value=await Vu(u.deviceCode))},m=()=>{t(),e.payload.data.fields=[{index:0,deviceName:(u==null?void 0:u.deviceName)??"",deviceCode:(u==null?void 0:u.deviceCode)??"",field:a.value??""}],console.log("图片配置",e.payload)},y=()=>{t(),e.payload.data.isCondition=d.value},b=()=>{t(),h.show=!0,h.payload=e.payload.data.condition??[]},w=P=>{h.show=!1,h.payload=null,P&&(t(),e.payload.data.condition=P),console.log("图片条件配置",e.payload.data)},x=()=>{r.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(P=>({id:P.id,attrs:P.attrs,args:{x:Number(P.args.x.replace("%","")),y:Number(P.args.y.replace("%",""))}}))))},C=()=>{const P=Du;P.attrs.text.text=`${e.payload.getPorts().length+1}`,P.args.x="50%",P.args.y="50%",e.payload.addPorts([{group:"ports",...P}]),x()},E=()=>{Gr("#drawing-board",!0)},v=(P,M,k)=>{e.payload.portProp(P,"args/"+M,k+"%"),x()},S=P=>{e.payload.removePort(P),x()};return l.onMounted(()=>{t(),x(),f()}),(P,M)=>{const k=l.resolveComponent("el-col"),$=l.resolveComponent("el-option"),V=l.resolveComponent("el-select"),U=l.resolveComponent("el-row"),F=l.resolveComponent("el-switch"),q=l.resolveComponent("el-button"),X=l.resolveComponent("el-collapse-item"),Q=l.resolveComponent("el-table-column"),se=l.resolveComponent("el-slider"),H=l.resolveComponent("el-icon"),I=l.resolveComponent("el-table"),re=l.resolveComponent("el-collapse"),B=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Vj,[l.createVNode(re,{modelValue:s.value,"onUpdate:modelValue":M[3]||(M[3]=Z=>s.value=Z),accordion:""},{default:l.withCtx(()=>[l.createVNode(X,{title:"图片设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Dj,[l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode(k,{span:12},{default:l.withCtx(()=>M[5]||(M[5]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(k,{span:12},{default:l.withCtx(()=>[l.createVNode(V,{modelValue:o.value,"onUpdate:modelValue":M[0]||(M[0]=Z=>o.value=Z),placeholder:"请选择设备",onChange:p,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,Z=>(l.openBlock(),l.createBlock($,{key:Z.deviceCode,label:Z.deviceName,value:Z.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(V,{modelValue:a.value,"onUpdate:modelValue":M[1]||(M[1]=Z=>a.value=Z),placeholder:"请选择字段",onChange:m,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,Z=>(l.openBlock(),l.createBlock($,{key:Z.dataField,label:Z.name,value:Z.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(U,{gutter:20},{default:l.withCtx(()=>[l.createVNode(k,{span:12},{default:l.withCtx(()=>M[6]||(M[6]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(k,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:d.value,"onUpdate:modelValue":M[2]||(M[2]=Z=>d.value=Z),"active-value":!0,"inactive-value":!1,size:"small",onChange:y},null,8,["modelValue"]),l.createVNode(q,{type:"primary",size:"small",onClick:b,style:{"margin-left":"10px"}},{default:l.withCtx(()=>M[7]||(M[7]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1}),l.createVNode(X,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(q,{type:"primary",onClick:C,size:"small"},{default:l.withCtx(()=>M[8]||(M[8]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(q,{type:"primary",onClick:E,size:"small"},{default:l.withCtx(()=>M[9]||(M[9]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(I,{data:r.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(Q,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:Z})=>[l.createTextVNode(l.toDisplayString(Z.attrs.text.text),1)]),_:1}),l.createVNode(Q,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:Z})=>[l.createVNode(se,{modelValue:Z.args.x,"onUpdate:modelValue":Se=>Z.args.x=Se,min:0,max:100,step:1,onInput:Se=>v(Z.id,"x",Se)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(Q,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:Z})=>[l.createVNode(se,{modelValue:Z.args.y,"onUpdate:modelValue":Se=>Z.args.y=Se,min:0,max:100,step:1,onInput:Se=>v(Z.id,"y",Se)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(Q,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:Z})=>[l.createVNode(q,{type:"danger",size:"small",onClick:Se=>S(Z.id)},{default:l.withCtx(()=>[l.createVNode(H,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Km))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(B,{modelValue:h.show,"onUpdate:modelValue":M[4]||(M[4]=Z=>h.show=Z),width:"550px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[h.show?(l.openBlock(),l.createBlock(kj,{key:0,payload:h.payload,type:"image",onClose:w},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-71c9aed4"]]),m0=[{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"}}],y0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},Ij={style:{width:"100%",height:"100%",position:"relative"}},Lj={key:0,class:"spinner"},Td=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=()=>{window.__x6_instances__=[];const v=document.getElementById("preview-container");t.value=new z({container:v,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}}),window.__x6_instances__.push(v),t.value.on("blank:dblclick",()=>{f()}),t.value.on("render:done",()=>{Gr("#preview-container",!1),x()})},r=async()=>{let v,S,O;if(e.id){const _=await Ym(e.id);v=(_==null?void 0:_.background)||Ja,S=(_==null?void 0:_.grid)||Ka,O=(_==null?void 0:_.data)||{cells:[]}}else v=e.background,S={},O=e.data;t.value.drawBackground(v),t.value.drawGrid(S),t.value.fromJSON(O),d()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=l.ref(!1),u=l.ref(!1),d=()=>{o.value=t.value.getCells().filter(v=>{var S,O,_,T;return((S=v==null?void 0:v.data)==null?void 0:S.type)==="text"||((O=v==null?void 0:v.data)==null?void 0:O.type)==="pipe"||((_=v==null?void 0:v.data)==null?void 0:_.type)==="arrow"||((T=v==null?void 0:v.data)==null?void 0:T.type)==="image"}),o.value.forEach(v=>{var S,O;(O=(S=v==null?void 0:v.data)==null?void 0:S.fields)!=null&&O.length&&a.value.push({id:v==null?void 0:v.id,fields:v==null?void 0:v.data.fields})}),f()},h=l.ref(!0),f=async()=>{if(u.value=!0,!a.value.length){u.value=!1;return}if(!h.value){Xe.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),h.value=!1,console.log("字段数据",a.value),await p(a.value),!c.value&&(i.value=setTimeout(()=>{f()},1e4))},p=async(v,S=0)=>{let O=5;if(!c.value)if(v.length>S*O){const _=v.slice(S*O,S*O+O);console.log("批次:",S,"数据:",_),S++,g(await aD(_)),await p(v,S)}else u.value=!1,h.value=!0},g=v=>{v==null||v.forEach(S=>{var _;const O=t.value.getCellById(S.id);O.data.type==="text"&&(O.label=m(O.data.content,S.fields)),O.data.type==="pipe"&&(console.log("管道详情",O,S.fields),y(O,S.fields)),O.data.type==="arrow"&&b(O,(_=S.fields)==null?void 0:_[0].value),O.shape==="image"&&(console.log("图片详情",O,S.fields),w(O,S.fields))})},m=(v,S)=>{let O=0;return v.replace(Ad,()=>{const _=S.find(T=>T.index===O);return O++,_?_.value:h0})},y=(v,S)=>{if(console.log(v,S),!v.data.isCondition)return!1;console.log("┌────────单个设置管道开始判断────────┐"),console.log(S.some(O=>(O==null?void 0:O.value1)==1)),console.log(v.data),v.attr("pipe/style/animation",S.some(O=>(console.log("判断条件是否通过:",(O==null?void 0:O.value1)==1,O.value1,O),(O==null?void 0:O.value1)==1))?d0(v.data.direction):""),console.log("设置过后的属性:",v),console.log("└────────单个设置管道结束判断────────┘")},b=(v,S)=>{if(console.log(v,S),!v.data.isCondition)return!1;for(let O=0;O<v.data.condition.length;O++)if(Number(S)>v.data.condition[O].min&&Number(S)<v.data.condition[O].max)return v.attr("arrow/style/animation",v.data.condition[O].animation===dr?"flashing 2s infinite linear":""),v.attr("arrow/d",v.data.condition[O].direction===wi?Qa:Xm),v.attr("arrow/display",v.data.condition[O].display),!1},w=(v,S)=>{if(!v.data.isCondition||(console.log("进入设置图片阶段:",v),console.log("图片条件判断设置:",v.data.condition),console.log("设备字段数据:",S),!S||S.length===0))return!1;const O=S[0],_=Number(O.value);for(let T=0;T<v.data.condition.length;T++){const A=v.data.condition[T];if(console.log(v.data,"cell.data55555555"),_>A.min&&_<A.max)return A.imageUrl&&(console.log("更换图片为:",Eo(A==null?void 0:A.imageUrl)),v.attr("image/xlink:href",we.isSunOs?A==null?void 0:A.imageUrl:Eo(A==null?void 0:A.imageUrl))),!1}console.log("未匹配到条件,保持原图片")},x=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},C=l.shallowRef(),E=()=>{new ResizeObserver(()=>{x()}).observe(C.value)};return l.onMounted(()=>{c.value=!1,s(),r(),E()}),l.onUnmounted(()=>{c.value=!0,clearInterval(i.value)}),(v,S)=>(l.openBlock(),l.createElementBlock("div",Ij,[l.createElementVNode("div",{id:"preview-container",ref_key:"previewRef",ref:C,onDblclick:x},null,544),u.value?(l.openBlock(),l.createElementBlock("div",Lj,S[0]||(S[0]=[l.createElementVNode("div",{class:"spinner1"},null,-1)]))):l.createCommentVNode("",!0)]))}}),Bj={class:"form-container"},jj={class:"footer"},$j=Nt({__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?Xa("/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(Xe.success("保存成功"),s("close",!0)):Xe.error((d==null?void 0:d.msg)||"保存失败")}):Xa("/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(Xe.success("保存成功"),s("close",!0)):Xe.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",Bj,[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",jj,[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-807a2ed3"]]),zj={class:"form-container"},Fj={class:"footer"},Uj=Nt({__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){Xe.error("请上传图片格式的文件");return}const f=new FormData;f.append("file",h.raw),iD("/file/fileUpload",f).then(p=>{p!=null&&p.isOk?we.isSunOs?(a.value=p==null?void 0:p.data,i.imageUrl=p==null?void 0:p.data):(a.value=Kn.defaults.baseURL+"/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):Xe.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(h=>{if(h)Xa("/custom/savePicture",i).then(f=>{f!=null&&f.isOk?(Xe.success("保存成功"),t("close",!0)):Xe.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=we.isSunOs?s.payload.imageUrl:Eo(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"),C=l.resolveComponent("el-button"),E=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",zj,[l.createVNode(E,{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]=v=>i.imageName=v),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]=v=>i.sort=v),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]=v=>i.isShow=v),"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(wD))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",Fj,[l.createVNode(C,{type:"primary",onClick:u},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(C,{onClick:d},{default:l.withCtx(()=>f[4]||(f[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-8f1bae4f"]]),Hj={class:"form-container"},Gj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},Wj=["src"],Yj=Nt({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Zn("/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=>{(we.isSunOs?Zn:Wm)("/custom/removeGroup/"+f).then(g=>{g.code===200?(Xe.success("删除成功"),t()):Xe.error(g.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=>{(we.isSunOs?Zn:Wm)("/custom/removePicture/"+f).then(g=>{g.code===200?(Xe.success("删除成功"),t()):Xe.error(g.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",Hj,[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",Gj,[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(we.isSunOs)?x.row.imageUrl:l.unref(Eo)(x.row.imageUrl),alt:"",style:{width:"64px",height:"64px"}},null,8,Wj)]),_: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:C=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑 ")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:C=>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($j,{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(Uj,{key:0,payload:a.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-721437e3"]]),qj={class:"page-container"},Xj={class:"tool-bar"},Jj={class:"action"},Kj={class:"el-dropdown-link"},Zj={class:"action",style:{"margin-right":"50px"}},Qj={class:"board"},e$={class:"drawing-board-box"},t$={id:"controls"},n$={key:0,class:"controls-label"},s$={style:{width:"100%",height:"100%",background:"black"}},b0=Nt(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""},itemId:{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=()=>{window.__x6_instances__=[];const L=document.getElementById("drawing-board");s.value=new z({container:L,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",...tt,data:{type:u0()},zIndex:0})}}}),window.__x6_instances__.push(s.value),s.value.use(L3()),s.value.use(B3()),s.value.use(j3()),s.value.use($3()),s.value.use(F3()),s.value.use(U3()),s.value.bindKey(["delete","backspace"],()=>{H3(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{G3(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{W3(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{Y3(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{q3(s.value)});let j=null;s.value.on("edge:click",({cell:P})=>{o.value=P,r.component=p0,r.label="线段属性",i.value=_d()}),s.value.on("edge:mouseenter",({cell:P})=>{clearTimeout(j),P.toFront(),X3(P)}),s.value.on("edge:mouseleave",({cell:P})=>{j=setTimeout(()=>{P.toBack(),P.removeTools()},300)}),s.value.on("node:mouseenter",()=>{Gr("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Gr("#drawing-board",!1)}),s.value.use(new g0),s.value.on("blank:click",({e:P,x:M,y:k})=>{o.value=s,r.component=hD,r.label="画布属性",i.value=_d()}),s.value.on("cell:click",({cell:P})=>{var M,k;if(o.value=P,i.value=_d(),((M=P.data)==null?void 0:M.type)==="text"){r.component=f0,r.label="文本属性";return}if(((k=P.data)==null?void 0:k.type)==="base-shape"){r.component=f0,r.label="基础图形属性";return}if((P==null?void 0:P.shape)==="edge"){r.component=p0,r.label="连线属性";return}if((P==null?void 0:P.shape)==="image"){r.component=Rj,r.label="图片属性";return}r.component=null,r.label=null}),s.value.on("render:done",()=>{Gr("#drawing-board",!1),g()})},c=l.ref(),u=()=>{c.value=new xi({target:s.value,...lD,groups:[{name:"基础组件",graphPadding:30}],search(P,M){var k;return((k=P.label)==null?void 0:k.indexOf(M))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:P=>{const M=P.clone({keepId:!0});return M.label!=="文本"&&(M.label=""),M}});const L=s.value.createNode({...cD}),j=m0.map(P=>(P.ports=y0,s.value.createNode(P)));c.value.load([L,...j],"基础组件"),Zn("/custom/groupList").then(P=>{const M=(P==null?void 0:P.data)||[];M==null||M.forEach(k=>{c.value.addGroup({name:k==null?void 0:k.groupName,graphPadding:30});const $=k==null?void 0:k.pictureList.map(V=>{const U={shape:"image",imageUrl:we.isSunOs?V==null?void 0:V.imageUrl:Eo(V==null?void 0:V.imageUrl),ports:y0,width:64,height:64,label:V.imageName};return s.value.createNode(U)});c.value.load($,k==null?void 0:k.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{const P=c.value.container,M=P.querySelectorAll(".x6-node"),k=m0.length;P.addEventListener("mouseenter",$,!0),P.addEventListener("mouseleave",V,!0),M.forEach((U,F)=>{const q=F>k,X=U.querySelector("text");q&&X&&(Object.assign(X.style,{display:"none",fontSize:"12px",fill:"#ffffff"}),X.setAttribute("x","0%"),X.setAttribute("y","40"),U.style.position="relative",U.style.cursor="pointer")});function $(U){const F=U.target.closest(".x6-node");if(F){const q=Array.from(M).indexOf(F),X=F.querySelector("text");q>k&&X&&(X.style.display="block")}}function V(U){const F=U.target.closest(".x6-node");if(F){const q=Array.from(M).indexOf(F),X=F.querySelector("text");q>k&&X&&(X.style.display="none")}}return()=>{P.removeEventListener("mouseenter",$,!0),P.removeEventListener("mouseleave",V,!0)}},200)})},d=L=>{switch(L){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),Xe.warning("关闭对齐线")):(s.value.enableSnapline(),Xe.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),Xe.warning("关闭框选")):(s.value.enableSelection(),Xe.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":C();break}},h=l.ref(!1),f=l.ref(null),p=()=>{h.value=!0;const L=new Date;s.value.startBatch(L),s.value.disablePanning(),s.value.once("blank:mousedown",({e:j,x:P,y:M})=>{h.value&&(f.value=s.value.addEdge({source:{x:P,y:M},target:{x:P,y:M},...tt,data:{type:u0(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:j,x:P,y:M})=>{h.value&&f.value.setTarget({x:P,y:M})}),s.value.on("blank:mouseup",({e:j,x:P,y:M})=>{h.value=!1,s.value.enablePanning(),s.value.stopBatch(L)})},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(Ja),s.value.drawGrid(Ka),Xe.success("清空成功")},C=()=>{const L=J().format("YYYYMMDDHHmmss");s.value.exportPNG(L,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},E=e,v=l.reactive({show:!1,background:null,grid:null,data:null}),S=()=>{v.background=s.value.options.background,v.grid=s.value.options.grid,v.data=s.value.toJSON(),v.show=!0},O=()=>{v.show=!1},_=()=>{E("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},T=async()=>{if(!t.id){s.value.drawBackground(Ja),s.value.drawGrid(Ka),s.value.fromJSON({cells:[]});return}const L=await Ym(t.id);s.value.drawBackground((L==null?void 0:L.background)||Ja),s.value.drawGrid((L==null?void 0:L.grid)||Ka),s.value.fromJSON((L==null?void 0:L.data)||{cells:[]})},A=l.shallowRef(null),D=()=>{new ResizeObserver(()=>{g()}).observe(A.value)};return l.onMounted(()=>{a(),u(),T(),D()}),(L,j)=>{const P=l.resolveComponent("el-icon"),M=l.resolveComponent("el-button"),k=l.resolveComponent("el-dropdown-item"),$=l.resolveComponent("el-dropdown-menu"),V=l.resolveComponent("el-dropdown"),U=l.resolveComponent("el-scrollbar"),F=l.resolveComponent("el-dialog"),q=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",qj,[l.createElementVNode("div",Xj,[l.createElementVNode("div",Jj,[l.createVNode(V,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode($,null,{default:l.withCtx(()=>[l.createVNode(k,{command:"snapLine"},{default:l.withCtx(()=>j[4]||(j[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(k,{command:"select"},{default:l.withCtx(()=>j[5]||(j[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(k,{command:"drawLine"},{default:l.withCtx(()=>j[6]||(j[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(k,{command:"adaptive"},{default:l.withCtx(()=>j[7]||(j[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(k,{command:"shortcuts"},{default:l.withCtx(()=>j[8]||(j[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(k,{command:"image"},{default:l.withCtx(()=>j[9]||(j[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(k,{command:"clear"},{default:l.withCtx(()=>j[10]||(j[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(k,{command:"export"},{default:l.withCtx(()=>j[11]||(j[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",Kj,[l.createVNode(M,{size:"small",text:""},{default:l.withCtx(()=>[j[3]||(j[3]=l.createTextVNode("工具 ")),l.createVNode(P,null,{default:l.withCtx(()=>[l.createVNode(l.unref(pD))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",Zj,[l.createVNode(l.unref(Kg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(M,{size:"small",icon:l.unref(vD),onClick:S},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Kg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(M,{size:"small",icon:l.unref(yD),onClick:_},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",Qj,[j[12]||(j[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",e$,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:A},null,512)]),l.createElementVNode("div",t$,[r.label?(l.openBlock(),l.createElementBlock("div",n$,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(U,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value,itemId:t.itemId},null,8,["graph","payload","itemId"]))]),_:1})])]),l.createVNode(F,{modelValue:m.show,"onUpdate:modelValue":j[0]||(j[0]=X=>m.show=X),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(Sj)]),_:1},8,["modelValue"]),l.createVNode(F,{modelValue:b.show,"onUpdate:modelValue":j[1]||(j[1]=X=>b.show=X),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[b.show?(l.openBlock(),l.createBlock(Yj,{key:0})):l.createCommentVNode("",!0)]),_:1},8,["modelValue"]),l.createVNode(q,{class:"no-border-drawer",modelValue:v.show,"onUpdate:modelValue":j[2]||(j[2]=X=>v.show=X),onClose:O,title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",s$,[v.show?(l.openBlock(),l.createBlock(Td,{key:0,background:v.background,grid:v.grid,data:v.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-5dc3c2c6"]]),r$=[b0,Td],w0=n=>{r$.forEach(e=>{n.component(e.name,e)})};typeof window<"u"&&window.Vue&&w0(window.Vue),we.isSunOs=!1;const i$=n=>{we.isSunOs=n},o$={install:w0};we.WiringDiagramEditor=b0,we.WiringDiagramPreview=Td,we.default=o$,we.setBaseURL=sD,we.setIsSunOs=i$,we.setToken=rD,Object.defineProperties(we,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});