@babsey/code-graph 0.8.3 → 0.8.4

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.
@@ -5150,7 +5150,7 @@ class sn extends Ya {
5150
5150
  */
5151
5151
  getNodesByVariableName(t) {
5152
5152
  return this.nodes.filter(
5153
- (n) => n.state?.variableName === t
5153
+ (n) => [n.state.variableName, n._variableName].includes(t)
5154
5154
  );
5155
5155
  }
5156
5156
  /**
@@ -3,7 +3,7 @@ This is likely an internal issue. Please report it on GitHub.`);const m=this.hoo
3
3
  This is likely an internal issue. Please report it on GitHub.`);return t.get(n)}}var Ms;function _(){return Ms.apply(null,arguments)}function ni(e){Ms=e}function ie(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Ye(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(P(e,t))return!1;return!0}function ee(e){return e===void 0}function ge(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Ke(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ss(e,t){var n=[],s,a=e.length;for(s=0;s<a;++s)n.push(t(e[s],s));return n}function Te(e,t){for(var n in t)P(t,n)&&(e[n]=t[n]);return P(t,"toString")&&(e.toString=t.toString),P(t,"valueOf")&&(e.valueOf=t.valueOf),e}function fe(e,t,n,s){return Qs(e,t,n,s,!0).utc()}function si(){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 T(e){return e._pf==null&&(e._pf=si()),e._pf}var an;Array.prototype.some?an=Array.prototype.some:an=function(e){var t=Object(this),n=t.length>>>0,s;for(s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};function rn(e){var t=null,n=!1,s=e._d&&!isNaN(e._d.getTime());if(s&&(t=T(e),n=an.call(t.parsedDateParts,function(a){return a!=null}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(s=s&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=s;else return s;return e._isValid}function mt(e){var t=fe(NaN);return e!=null?Te(T(t),e):T(t).userInvalidated=!0,t}var Os=_.momentProperties=[],on=!1;function ln(e,t){var n,s,a,o=Os.length;if(ee(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),ee(t._i)||(e._i=t._i),ee(t._f)||(e._f=t._f),ee(t._l)||(e._l=t._l),ee(t._strict)||(e._strict=t._strict),ee(t._tzm)||(e._tzm=t._tzm),ee(t._isUTC)||(e._isUTC=t._isUTC),ee(t._offset)||(e._offset=t._offset),ee(t._pf)||(e._pf=T(t)),ee(t._locale)||(e._locale=t._locale),o>0)for(n=0;n<o;n++)s=Os[n],a=t[s],ee(a)||(e[s]=a);return e}function Je(e){ln(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),on===!1&&(on=!0,_.updateOffset(this),on=!1)}function le(e){return e instanceof Je||e!=null&&e._isAMomentObject!=null}function Es(e){_.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function ae(e,t){var n=!0;return Te(function(){if(_.deprecationHandler!=null&&_.deprecationHandler(null,e),n){var s=[],a,o,i,l=arguments.length;for(o=0;o<l;o++){if(a="",typeof arguments[o]=="object"){a+=`
4
4
  [`+o+"] ";for(i in arguments[0])P(arguments[0],i)&&(a+=i+": "+arguments[0][i]+", ");a=a.slice(0,-2)}else a=arguments[o];s.push(a)}Es(e+`
5
5
  Arguments: `+Array.prototype.slice.call(s).join("")+`
6
- `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Ts={};function Is(e,t){_.deprecationHandler!=null&&_.deprecationHandler(e,t),Ts[e]||(Es(t),Ts[e]=!0)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;function pe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function ai(e){var t,n;for(n in e)P(e,n)&&(t=e[n],pe(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function dn(e,t){var n=Te({},e),s;for(s in t)P(t,s)&&(Ye(e[s])&&Ye(t[s])?(n[s]={},Te(n[s],e[s]),Te(n[s],t[s])):t[s]!=null?n[s]=t[s]:delete n[s]);for(s in e)P(e,s)&&!P(t,s)&&Ye(e[s])&&(n[s]=Te({},n[s]));return n}function cn(e){e!=null&&this.set(e)}var un;Object.keys?un=Object.keys:un=function(e){var t,n=[];for(t in e)P(e,t)&&n.push(t);return n};var ri={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function oi(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return pe(s)?s.call(t,n):s}function me(e,t,n){var s=""+Math.abs(e),a=t-s.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var hn=/(\[[^\[]*\])|(\\)?([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,_t=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,fn={},Ue={};function C(e,t,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(Ue[e]=a),t&&(Ue[t[0]]=function(){return me(a.apply(this,arguments),t[1],t[2])}),n&&(Ue[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function ii(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function li(e){var t=e.match(hn),n,s;for(n=0,s=t.length;n<s;n++)Ue[t[n]]?t[n]=Ue[t[n]]:t[n]=ii(t[n]);return function(a){var o="",i;for(i=0;i<s;i++)o+=pe(t[i])?t[i].call(a,e):t[i];return o}}function yt(e,t){return e.isValid()?(t=Ds(t,e.localeData()),fn[t]=fn[t]||li(t),fn[t](e)):e.localeData().invalidDate()}function Ds(e,t){var n=5;function s(a){return t.longDateFormat(a)||a}for(_t.lastIndex=0;n>=0&&_t.test(e);)e=e.replace(_t,s),_t.lastIndex=0,n-=1;return e}var di={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 ci(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(hn).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var ui="Invalid date";function hi(){return this._invalidDate}var fi="%d",pi=/\d{1,2}/;function mi(e){return this._ordinal.replace("%d",e)}var _i={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 yi(e,t,n,s){var a=this._relativeTime[n];return pe(a)?a(e,t,n,s):a.replace(/%d/i,e)}function gi(e,t){var n=this._relativeTime[e>0?"future":"past"];return pe(n)?n(t):n.replace(/%s/i,t)}var xs={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 re(e){return typeof e=="string"?xs[e]||xs[e.toLowerCase()]:void 0}function pn(e){var t={},n,s;for(s in e)P(e,s)&&(n=re(s),n&&(t[n]=e[s]));return t}var ki={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 bi(e){var t=[],n;for(n in e)P(e,n)&&t.push({unit:n,priority:ki[n]});return t.sort(function(s,a){return s.priority-a.priority}),t}var Ys=/\d/,ne=/\d\d/,Rs=/\d{3}/,mn=/\d{4}/,gt=/[+-]?\d{6}/,$=/\d\d?/,Ps=/\d\d\d\d?/,Bs=/\d\d\d\d\d\d?/,kt=/\d{1,3}/,_n=/\d{1,4}/,bt=/[+-]?\d{1,6}/,$e=/\d+/,wt=/[+-]?\d+/,wi=/Z|[+-]\d\d:?\d\d/gi,vt=/Z|[+-]\d\d(?::?\d\d)?/gi,vi=/[+-]?\d+(\.\d{1,3})?/,Xe=/[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,We=/^[1-9]\d?/,yn=/^([1-9]\d|\d)/,Nt;Nt={};function y(e,t,n){Nt[e]=pe(t)?t:function(s,a){return s&&n?n:t}}function Ni(e,t){return P(Nt,e)?Nt[e](t._strict,t._locale):new RegExp(Ci(e))}function Ci(e){return ke(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,s,a,o){return n||s||a||o}))}function ke(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function oe(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function x(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=oe(t)),n}var gn={};function L(e,t){var n,s=t,a;for(typeof e=="string"&&(e=[e]),ge(t)&&(s=function(o,i){i[t]=x(o)}),a=e.length,n=0;n<a;n++)gn[e[n]]=s}function Qe(e,t){L(e,function(n,s,a,o){a._w=a._w||{},t(n,a._w,a,o)})}function Mi(e,t,n){t!=null&&P(gn,e)&&gn[e](t,n._a,n,e)}function Ct(e){return e%4===0&&e%100!==0||e%400===0}var X=0,be=1,_e=2,K=3,de=4,we=5,Re=6,Si=7,Oi=8;C("Y",0,0,function(){var e=this.year();return e<=9999?me(e,4):"+"+e}),C(0,["YY",2],0,function(){return this.year()%100}),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),y("Y",wt),y("YY",$,ne),y("YYYY",_n,mn),y("YYYYY",bt,gt),y("YYYYYY",bt,gt),L(["YYYYY","YYYYYY"],X),L("YYYY",function(e,t){t[X]=e.length===2?_.parseTwoDigitYear(e):x(e)}),L("YY",function(e,t){t[X]=_.parseTwoDigitYear(e)}),L("Y",function(e,t){t[X]=parseInt(e,10)});function et(e){return Ct(e)?366:365}_.parseTwoDigitYear=function(e){return x(e)+(x(e)>68?1900:2e3)};var Vs=He("FullYear",!0);function Ei(){return Ct(this.year())}function He(e,t){return function(n){return n!=null?(Ls(this,e,n),_.updateOffset(this,t),this):tt(this,e)}}function tt(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ls(e,t,n){var s,a,o,i,l;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(a?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(a?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(a?s.setUTCHours(n):s.setHours(n));case"Date":return void(a?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}o=n,i=e.month(),l=e.date(),l=l===29&&i===1&&!Ct(o)?28:l,a?s.setUTCFullYear(o,i,l):s.setFullYear(o,i,l)}}function Ti(e){return e=re(e),pe(this[e])?this[e]():this}function Ii(e,t){if(typeof e=="object"){e=pn(e);var n=bi(e),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](e[n[s].unit])}else if(e=re(e),pe(this[e]))return this[e](t);return this}function Di(e,t){return(e%t+t)%t}var Z;Array.prototype.indexOf?Z=Array.prototype.indexOf:Z=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function kn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Di(t,12);return e+=(t-n)/12,n===1?Ct(e)?29:28:31-n%7%2}C("M",["MM",2],"Mo",function(){return this.month()+1}),C("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),C("MMMM",0,0,function(e){return this.localeData().months(this,e)}),y("M",$,We),y("MM",$,ne),y("MMM",function(e,t){return t.monthsShortRegex(e)}),y("MMMM",function(e,t){return t.monthsRegex(e)}),L(["M","MM"],function(e,t){t[be]=x(e)-1}),L(["MMM","MMMM"],function(e,t,n,s){var a=n._locale.monthsParse(e,s,n._strict);a!=null?t[be]=a:T(n).invalidMonth=e});var xi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),As="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Us=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yi=Xe,Ri=Xe;function Pi(e,t){return e?ie(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Us).test(t)?"format":"standalone"][e.month()]:ie(this._months)?this._months:this._months.standalone}function Bi(e,t){return e?ie(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Us.test(t)?"format":"standalone"][e.month()]:ie(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Vi(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)o=fe([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(a=Z.call(this._shortMonthsParse,i),a!==-1?a:null):(a=Z.call(this._longMonthsParse,i),a!==-1?a:null):t==="MMM"?(a=Z.call(this._shortMonthsParse,i),a!==-1?a:(a=Z.call(this._longMonthsParse,i),a!==-1?a:null)):(a=Z.call(this._longMonthsParse,i),a!==-1?a:(a=Z.call(this._shortMonthsParse,i),a!==-1?a:null))}function Li(e,t,n){var s,a,o;if(this._monthsParseExact)return Vi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(a=fe([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!n&&!this._monthsParse[s]&&(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[s].test(e))return s;if(n&&t==="MMM"&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function $s(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=x(t);else if(t=e.localeData().monthsParse(t),!ge(t))return e}var n=t,s=e.date();return s=s<29?s:Math.min(s,kn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function Ws(e){return e!=null?($s(this,e),_.updateOffset(this,!0),this):tt(this,"Month")}function Ai(){return kn(this.year(),this.month())}function Ui(e){return this._monthsParseExact?(P(this,"_monthsRegex")||Hs.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(P(this,"_monthsShortRegex")||(this._monthsShortRegex=Yi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function $i(e){return this._monthsParseExact?(P(this,"_monthsRegex")||Hs.call(this),e?this._monthsStrictRegex:this._monthsRegex):(P(this,"_monthsRegex")||(this._monthsRegex=Ri),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Hs(){function e(d,c){return c.length-d.length}var t=[],n=[],s=[],a,o,i,l;for(a=0;a<12;a++)o=fe([2e3,a]),i=ke(this.monthsShort(o,"")),l=ke(this.months(o,"")),t.push(i),n.push(l),s.push(l),s.push(i);t.sort(e),n.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Wi(e,t,n,s,a,o,i){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,s,a,o,i),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,s,a,o,i),l}function nt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Mt(e,t,n){var s=7+t-n,a=(7+nt(e,0,s).getUTCDay()-t)%7;return-a+s-1}function Fs(e,t,n,s,a){var o=(7+n-s)%7,i=Mt(e,s,a),l=1+7*(t-1)+o+i,d,c;return l<=0?(d=e-1,c=et(d)+l):l>et(e)?(d=e+1,c=l-et(e)):(d=e,c=l),{year:d,dayOfYear:c}}function st(e,t,n){var s=Mt(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1,o,i;return a<1?(i=e.year()-1,o=a+ve(i,t,n)):a>ve(e.year(),t,n)?(o=a-ve(e.year(),t,n),i=e.year()+1):(i=e.year(),o=a),{week:o,year:i}}function ve(e,t,n){var s=Mt(e,t,n),a=Mt(e+1,t,n);return(et(e)-s+a)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),y("w",$,We),y("ww",$,ne),y("W",$,We),y("WW",$,ne),Qe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=x(e)});function Hi(e){return st(e,this._week.dow,this._week.doy).week}var Fi={dow:0,doy:6};function Gi(){return this._week.dow}function ji(){return this._week.doy}function zi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Zi(e){var t=st(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),y("d",$),y("e",$),y("E",$),y("dd",function(e,t){return t.weekdaysMinRegex(e)}),y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),y("dddd",function(e,t){return t.weekdaysRegex(e)}),Qe(["dd","ddd","dddd"],function(e,t,n,s){var a=n._locale.weekdaysParse(e,s,n._strict);a!=null?t.d=a:T(n).invalidWeekday=e}),Qe(["d","e","E"],function(e,t,n,s){t[s]=x(e)});function qi(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Ki(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function bn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Ji="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gs="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Qi=Xe,el=Xe,tl=Xe;function nl(e,t){var n=ie(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?bn(n,this._week.dow):e?n[e.day()]:n}function sl(e){return e===!0?bn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function al(e){return e===!0?bn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function rl(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)o=fe([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(a=Z.call(this._weekdaysParse,i),a!==-1?a:null):t==="ddd"?(a=Z.call(this._shortWeekdaysParse,i),a!==-1?a:null):(a=Z.call(this._minWeekdaysParse,i),a!==-1?a:null):t==="dddd"?(a=Z.call(this._weekdaysParse,i),a!==-1||(a=Z.call(this._shortWeekdaysParse,i),a!==-1)?a:(a=Z.call(this._minWeekdaysParse,i),a!==-1?a:null)):t==="ddd"?(a=Z.call(this._shortWeekdaysParse,i),a!==-1||(a=Z.call(this._weekdaysParse,i),a!==-1)?a:(a=Z.call(this._minWeekdaysParse,i),a!==-1?a:null)):(a=Z.call(this._minWeekdaysParse,i),a!==-1||(a=Z.call(this._weekdaysParse,i),a!==-1)?a:(a=Z.call(this._shortWeekdaysParse,i),a!==-1?a:null))}function ol(e,t,n){var s,a,o;if(this._weekdaysParseExact)return rl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=fe([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(n&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(n&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function il(e){if(!this.isValid())return e!=null?this:NaN;var t=tt(this,"Day");return e!=null?(e=qi(e,this.localeData()),this.add(e-t,"d")):t}function ll(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function dl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Ki(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function cl(e){return this._weekdaysParseExact?(P(this,"_weekdaysRegex")||wn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(P(this,"_weekdaysRegex")||(this._weekdaysRegex=Qi),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function ul(e){return this._weekdaysParseExact?(P(this,"_weekdaysRegex")||wn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(P(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=el),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function hl(e){return this._weekdaysParseExact?(P(this,"_weekdaysRegex")||wn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(P(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tl),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function wn(){function e(f,w){return w.length-f.length}var t=[],n=[],s=[],a=[],o,i,l,d,c;for(o=0;o<7;o++)i=fe([2e3,1]).day(o),l=ke(this.weekdaysMin(i,"")),d=ke(this.weekdaysShort(i,"")),c=ke(this.weekdays(i,"")),t.push(l),n.push(d),s.push(c),a.push(l),a.push(d),a.push(c);t.sort(e),n.sort(e),s.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function vn(){return this.hours()%12||12}function fl(){return this.hours()||24}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,vn),C("k",["kk",2],0,fl),C("hmm",0,0,function(){return""+vn.apply(this)+me(this.minutes(),2)}),C("hmmss",0,0,function(){return""+vn.apply(this)+me(this.minutes(),2)+me(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+me(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+me(this.minutes(),2)+me(this.seconds(),2)});function js(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}js("a",!0),js("A",!1);function zs(e,t){return t._meridiemParse}y("a",zs),y("A",zs),y("H",$,yn),y("h",$,We),y("k",$,We),y("HH",$,ne),y("hh",$,ne),y("kk",$,ne),y("hmm",Ps),y("hmmss",Bs),y("Hmm",Ps),y("Hmmss",Bs),L(["H","HH"],K),L(["k","kk"],function(e,t,n){var s=x(e);t[K]=s===24?0:s}),L(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),L(["h","hh"],function(e,t,n){t[K]=x(e),T(n).bigHour=!0}),L("hmm",function(e,t,n){var s=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s)),T(n).bigHour=!0}),L("hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s,2)),t[we]=x(e.substr(a)),T(n).bigHour=!0}),L("Hmm",function(e,t,n){var s=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s))}),L("Hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s,2)),t[we]=x(e.substr(a))});function pl(e){return(e+"").toLowerCase().charAt(0)==="p"}var ml=/[ap]\.?m?\.?/i,_l=He("Hours",!0);function yl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Zs={calendar:ri,longDateFormat:di,invalidDate:ui,ordinal:fi,dayOfMonthOrdinalParse:pi,relativeTime:_i,months:xi,monthsShort:As,week:Fi,weekdays:Ji,weekdaysMin:Xi,weekdaysShort:Gs,meridiemParse:ml},F={},at={},rt;function gl(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function qs(e){return e&&e.toLowerCase().replace("_","-")}function kl(e){for(var t=0,n,s,a,o;t<e.length;){for(o=qs(e[t]).split("-"),n=o.length,s=qs(e[t+1]),s=s?s.split("-"):null;n>0;){if(a=St(o.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&gl(o,s)>=n-1)break;n--}t++}return rt}function bl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function St(e){var t=null,n;if(F[e]===void 0&&typeof module<"u"&&module&&module.exports&&bl(e))try{t=rt._abbr,n=require,n("./locale/"+e),Ie(t)}catch{F[e]=null}return F[e]}function Ie(e,t){var n;return e&&(ee(t)?n=Ne(e):n=Nn(e,t),n?rt=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rt._abbr}function Nn(e,t){if(t!==null){var n,s=Zs;if(t.abbr=e,F[e]!=null)Is("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=F[e]._config;else if(t.parentLocale!=null)if(F[t.parentLocale]!=null)s=F[t.parentLocale]._config;else if(n=St(t.parentLocale),n!=null)s=n._config;else return at[t.parentLocale]||(at[t.parentLocale]=[]),at[t.parentLocale].push({name:e,config:t}),null;return F[e]=new cn(dn(s,t)),at[e]&&at[e].forEach(function(a){Nn(a.name,a.config)}),Ie(e),F[e]}else return delete F[e],null}function wl(e,t){if(t!=null){var n,s,a=Zs;F[e]!=null&&F[e].parentLocale!=null?F[e].set(dn(F[e]._config,t)):(s=St(e),s!=null&&(a=s._config),t=dn(a,t),s==null&&(t.abbr=e),n=new cn(t),n.parentLocale=F[e],F[e]=n),Ie(e)}else F[e]!=null&&(F[e].parentLocale!=null?(F[e]=F[e].parentLocale,e===Ie()&&Ie(e)):F[e]!=null&&delete F[e]);return F[e]}function Ne(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rt;if(!ie(e)){if(t=St(e),t)return t;e=[e]}return kl(e)}function vl(){return un(F)}function Cn(e){var t,n=e._a;return n&&T(e).overflow===-2&&(t=n[be]<0||n[be]>11?be:n[_e]<1||n[_e]>kn(n[X],n[be])?_e:n[K]<0||n[K]>24||n[K]===24&&(n[de]!==0||n[we]!==0||n[Re]!==0)?K:n[de]<0||n[de]>59?de:n[we]<0||n[we]>59?we:n[Re]<0||n[Re]>999?Re:-1,T(e)._overflowDayOfYear&&(t<X||t>_e)&&(t=_e),T(e)._overflowWeeks&&t===-1&&(t=Si),T(e)._overflowWeekday&&t===-1&&(t=Oi),T(e).overflow=t),e}var Nl=/^\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)?)?$/,Cl=/^\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)?)?$/,Ml=/Z|[+-]\d\d(?::?\d\d)?/,Ot=[["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]],Mn=[["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/]],Sl=/^\/?Date\((-?\d+)/i,Ol=/^(?:(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}))$/,El={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ks(e){var t,n,s=e._i,a=Nl.exec(s)||Cl.exec(s),o,i,l,d,c=Ot.length,f=Mn.length;if(a){for(T(e).iso=!0,t=0,n=c;t<n;t++)if(Ot[t][1].exec(a[1])){i=Ot[t][0],o=Ot[t][2]!==!1;break}if(i==null){e._isValid=!1;return}if(a[3]){for(t=0,n=f;t<n;t++)if(Mn[t][1].exec(a[3])){l=(a[2]||" ")+Mn[t][0];break}if(l==null){e._isValid=!1;return}}if(!o&&l!=null){e._isValid=!1;return}if(a[4])if(Ml.exec(a[4]))d="Z";else{e._isValid=!1;return}e._f=i+(l||"")+(d||""),On(e)}else e._isValid=!1}function Tl(e,t,n,s,a,o){var i=[Il(e),As.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return o&&i.push(parseInt(o,10)),i}function Il(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Dl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function xl(e,t,n){if(e){var s=Gs.indexOf(e),a=new Date(t[0],t[1],t[2]).getDay();if(s!==a)return T(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Yl(e,t,n){if(e)return El[e];if(t)return 0;var s=parseInt(n,10),a=s%100,o=(s-a)/100;return o*60+a}function Js(e){var t=Ol.exec(Dl(e._i)),n;if(t){if(n=Tl(t[4],t[3],t[2],t[5],t[6],t[7]),!xl(t[1],n,e))return;e._a=n,e._tzm=Yl(t[8],t[9],t[10]),e._d=nt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),T(e).rfc2822=!0}else e._isValid=!1}function Rl(e){var t=Sl.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Ks(e),e._isValid===!1)delete e._isValid;else return;if(Js(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:_.createFromInputFallback(e)}_.createFromInputFallback=ae("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Fe(e,t,n){return e??t??n}function Pl(e){var t=new Date(_.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Sn(e){var t,n,s=[],a,o,i;if(!e._d){for(a=Pl(e),e._w&&e._a[_e]==null&&e._a[be]==null&&Bl(e),e._dayOfYear!=null&&(i=Fe(e._a[X],a[X]),(e._dayOfYear>et(i)||e._dayOfYear===0)&&(T(e)._overflowDayOfYear=!0),n=nt(i,0,e._dayOfYear),e._a[be]=n.getUTCMonth(),e._a[_e]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[K]===24&&e._a[de]===0&&e._a[we]===0&&e._a[Re]===0&&(e._nextDay=!0,e._a[K]=0),e._d=(e._useUTC?nt:Wi).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[K]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(T(e).weekdayMismatch=!0)}}function Bl(e){var t,n,s,a,o,i,l,d,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,n=Fe(t.GG,e._a[X],st(W(),1,4).year),s=Fe(t.W,1),a=Fe(t.E,1),(a<1||a>7)&&(d=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=st(W(),o,i),n=Fe(t.gg,e._a[X],c.year),s=Fe(t.w,c.week),t.d!=null?(a=t.d,(a<0||a>6)&&(d=!0)):t.e!=null?(a=t.e+o,(t.e<0||t.e>6)&&(d=!0)):a=o),s<1||s>ve(n,o,i)?T(e)._overflowWeeks=!0:d!=null?T(e)._overflowWeekday=!0:(l=Fs(n,s,a,o,i),e._a[X]=l.year,e._dayOfYear=l.dayOfYear)}_.ISO_8601=function(){},_.RFC_2822=function(){};function On(e){if(e._f===_.ISO_8601){Ks(e);return}if(e._f===_.RFC_2822){Js(e);return}e._a=[],T(e).empty=!0;var t=""+e._i,n,s,a,o,i,l=t.length,d=0,c,f;for(a=Ds(e._f,e._locale).match(hn)||[],f=a.length,n=0;n<f;n++)o=a[n],s=(t.match(Ni(o,e))||[])[0],s&&(i=t.substr(0,t.indexOf(s)),i.length>0&&T(e).unusedInput.push(i),t=t.slice(t.indexOf(s)+s.length),d+=s.length),Ue[o]?(s?T(e).empty=!1:T(e).unusedTokens.push(o),Mi(o,s,e)):e._strict&&!s&&T(e).unusedTokens.push(o);T(e).charsLeftOver=l-d,t.length>0&&T(e).unusedInput.push(t),e._a[K]<=12&&T(e).bigHour===!0&&e._a[K]>0&&(T(e).bigHour=void 0),T(e).parsedDateParts=e._a.slice(0),T(e).meridiem=e._meridiem,e._a[K]=Vl(e._locale,e._a[K],e._meridiem),c=T(e).era,c!==null&&(e._a[X]=e._locale.erasConvertYear(c,e._a[X])),Sn(e),Cn(e)}function Vl(e,t,n){var s;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(s=e.isPM(n),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function Ll(e){var t,n,s,a,o,i,l=!1,d=e._f.length;if(d===0){T(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<d;a++)o=0,i=!1,t=ln({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[a],On(t),rn(t)&&(i=!0),o+=T(t).charsLeftOver,o+=T(t).unusedTokens.length*10,T(t).score=o,l?o<s&&(s=o,n=t):(s==null||o<s||i)&&(s=o,n=t,i&&(l=!0));Te(e,n||t)}function Al(e){if(!e._d){var t=pn(e._i),n=t.day===void 0?t.date:t.day;e._a=Ss([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),Sn(e)}}function Ul(e){var t=new Je(Cn(Xs(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Xs(e){var t=e._i,n=e._f;return e._locale=e._locale||Ne(e._l),t===null||n===void 0&&t===""?mt({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),le(t)?new Je(Cn(t)):(Ke(t)?e._d=t:ie(n)?Ll(e):n?On(e):$l(e),rn(e)||(e._d=null),e))}function $l(e){var t=e._i;ee(t)?e._d=new Date(_.now()):Ke(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Rl(e):ie(t)?(e._a=Ss(t.slice(0),function(n){return parseInt(n,10)}),Sn(e)):Ye(t)?Al(e):ge(t)?e._d=new Date(t):_.createFromInputFallback(e)}function Qs(e,t,n,s,a){var o={};return(t===!0||t===!1)&&(s=t,t=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(Ye(e)&&sn(e)||ie(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=n,o._i=e,o._f=t,o._strict=s,Ul(o)}function W(e,t,n,s){return Qs(e,t,n,s,!1)}var Wl=ae("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:mt()}),Hl=ae("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:mt()});function ea(e,t){var n,s;if(t.length===1&&ie(t[0])&&(t=t[0]),!t.length)return W();for(n=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][e](n))&&(n=t[s]);return n}function Fl(){var e=[].slice.call(arguments,0);return ea("isBefore",e)}function Gl(){var e=[].slice.call(arguments,0);return ea("isAfter",e)}var jl=function(){return Date.now?Date.now():+new Date},ot=["year","quarter","month","week","day","hour","minute","second","millisecond"];function zl(e){var t,n=!1,s,a=ot.length;for(t in e)if(P(e,t)&&!(Z.call(ot,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(s=0;s<a;++s)if(e[ot[s]]){if(n)return!1;parseFloat(e[ot[s]])!==x(e[ot[s]])&&(n=!0)}return!0}function Zl(){return this._isValid}function ql(){return ce(NaN)}function Et(e){var t=pn(e),n=t.year||0,s=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,i=t.day||0,l=t.hour||0,d=t.minute||0,c=t.second||0,f=t.millisecond||0;this._isValid=zl(t),this._milliseconds=+f+c*1e3+d*6e4+l*1e3*60*60,this._days=+i+o*7,this._months=+a+s*3+n*12,this._data={},this._locale=Ne(),this._bubble()}function Tt(e){return e instanceof Et}function En(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Kl(e,t,n){var s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0,i;for(i=0;i<s;i++)x(e[i])!==x(t[i])&&o++;return o+a}function ta(e,t){C(e,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+me(~~(n/60),2)+t+me(~~n%60,2)})}ta("Z",":"),ta("ZZ",""),y("Z",vt),y("ZZ",vt),L(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Tn(vt,e)});var Jl=/([\+\-]|\d\d)/gi;function Tn(e,t){var n=(t||"").match(e),s,a,o;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Jl)||["-",0,0],o=+(a[1]*60)+x(a[2]),o===0?0:a[0]==="+"?o:-o)}function In(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(le(e)||Ke(e)?e.valueOf():W(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),_.updateOffset(n,!1),n):W(e).local()}function Dn(e){return-Math.round(e._d.getTimezoneOffset())}_.updateOffset=function(){};function Xl(e,t,n){var s=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Tn(vt,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(a=Dn(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?ra(this,ce(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Dn(this)}function Ql(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ed(e){return this.utcOffset(0,e)}function td(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Dn(this),"m")),this}function nd(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Tn(wi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function sd(e){return this.isValid()?(e=e?W(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function ad(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function rd(){if(!ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ln(e,this),e=Xs(e),e._a?(t=e._isUTC?fe(e._a):W(e._a),this._isDSTShifted=this.isValid()&&Kl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function od(){return this.isValid()?!this._isUTC:!1}function id(){return this.isValid()?this._isUTC:!1}function na(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ld=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,dd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ce(e,t){var n=e,s=null,a,o,i;return Tt(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ge(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(s=ld.exec(e))?(a=s[1]==="-"?-1:1,n={y:0,d:x(s[_e])*a,h:x(s[K])*a,m:x(s[de])*a,s:x(s[we])*a,ms:x(En(s[Re]*1e3))*a}):(s=dd.exec(e))?(a=s[1]==="-"?-1:1,n={y:Pe(s[2],a),M:Pe(s[3],a),w:Pe(s[4],a),d:Pe(s[5],a),h:Pe(s[6],a),m:Pe(s[7],a),s:Pe(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=cd(W(n.from),W(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),o=new Et(n),Tt(e)&&P(e,"_locale")&&(o._locale=e._locale),Tt(e)&&P(e,"_isValid")&&(o._isValid=e._isValid),o}ce.fn=Et.prototype,ce.invalid=ql;function Pe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function sa(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function cd(e,t){var n;return e.isValid()&&t.isValid()?(t=In(t,e),e.isBefore(t)?n=sa(e,t):(n=sa(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function aa(e,t){return function(n,s){var a,o;return s!==null&&!isNaN(+s)&&(Is(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=s,s=o),a=ce(n,s),ra(this,a,e),this}}function ra(e,t,n,s){var a=t._milliseconds,o=En(t._days),i=En(t._months);e.isValid()&&(s=s??!0,i&&$s(e,tt(e,"Month")+i*n),o&&Ls(e,"Date",tt(e,"Date")+o*n),a&&e._d.setTime(e._d.valueOf()+a*n),s&&_.updateOffset(e,o||i))}var ud=aa(1,"add"),hd=aa(-1,"subtract");function oa(e){return typeof e=="string"||e instanceof String}function fd(e){return le(e)||Ke(e)||oa(e)||ge(e)||md(e)||pd(e)||e===null||e===void 0}function pd(e){var t=Ye(e)&&!sn(e),n=!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"],a,o,i=s.length;for(a=0;a<i;a+=1)o=s[a],n=n||P(e,o);return t&&n}function md(e){var t=ie(e),n=!1;return t&&(n=e.filter(function(s){return!ge(s)&&oa(e)}).length===0),t&&n}function _d(e){var t=Ye(e)&&!sn(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,o;for(a=0;a<s.length;a+=1)o=s[a],n=n||P(e,o);return t&&n}function yd(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function gd(e,t){arguments.length===1&&(arguments[0]?fd(arguments[0])?(e=arguments[0],t=void 0):_d(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||W(),s=In(n,this).startOf("day"),a=_.calendarFormat(this,s)||"sameElse",o=t&&(pe(t[a])?t[a].call(this,n):t[a]);return this.format(o||this.localeData().calendar(a,this,W(n)))}function kd(){return new Je(this)}function bd(e,t){var n=le(e)?e:W(e);return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function wd(e,t){var n=le(e)?e:W(e);return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function vd(e,t,n,s){var a=le(e)?e:W(e),o=le(t)?t:W(t);return this.isValid()&&a.isValid()&&o.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(a,n):!this.isBefore(a,n))&&(s[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function Nd(e,t){var n=le(e)?e:W(e),s;return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function Cd(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Md(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Sd(e,t,n){var s,a,o;if(!this.isValid())return NaN;if(s=In(e,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,t=re(t),t){case"year":o=It(this,s)/12;break;case"month":o=It(this,s);break;case"quarter":o=It(this,s)/3;break;case"second":o=(this-s)/1e3;break;case"minute":o=(this-s)/6e4;break;case"hour":o=(this-s)/36e5;break;case"day":o=(this-s-a)/864e5;break;case"week":o=(this-s-a)/6048e5;break;default:o=this-s}return n?o:oe(o)}function It(e,t){if(e.date()<t.date())return-It(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),s=e.clone().add(n,"months"),a,o;return t-s<0?(a=e.clone().add(n-1,"months"),o=(t-s)/(s-a)):(a=e.clone().add(n+1,"months"),o=(t-s)/(a-s)),-(n+o)||0}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Od(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ed(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?yt(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):pe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",yt(n,"Z")):yt(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Td(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,s,a,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+s+a+o)}function Id(e){e||(e=this.isUtc()?_.defaultFormatUtc:_.defaultFormat);var t=yt(this,e);return this.localeData().postformat(t)}function Dd(e,t){return this.isValid()&&(le(e)&&e.isValid()||W(e).isValid())?ce({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function xd(e){return this.from(W(),e)}function Yd(e,t){return this.isValid()&&(le(e)&&e.isValid()||W(e).isValid())?ce({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Rd(e){return this.to(W(),e)}function ia(e){var t;return e===void 0?this._locale._abbr:(t=Ne(e),t!=null&&(this._locale=t),this)}var la=ae("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function da(){return this._locale}var Dt=1e3,Ge=60*Dt,xt=60*Ge,ca=(365*400+97)*24*xt;function je(e,t){return(e%t+t)%t}function ua(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ca:new Date(e,t,n).valueOf()}function ha(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ca:Date.UTC(e,t,n)}function Pd(e){var t,n;if(e=re(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ha:ua,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=je(t+(this._isUTC?0:this.utcOffset()*Ge),xt);break;case"minute":t=this._d.valueOf(),t-=je(t,Ge);break;case"second":t=this._d.valueOf(),t-=je(t,Dt);break}return this._d.setTime(t),_.updateOffset(this,!0),this}function Bd(e){var t,n;if(e=re(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ha:ua,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=xt-je(t+(this._isUTC?0:this.utcOffset()*Ge),xt)-1;break;case"minute":t=this._d.valueOf(),t+=Ge-je(t,Ge)-1;break;case"second":t=this._d.valueOf(),t+=Dt-je(t,Dt)-1;break}return this._d.setTime(t),_.updateOffset(this,!0),this}function Vd(){return this._d.valueOf()-(this._offset||0)*6e4}function Ld(){return Math.floor(this.valueOf()/1e3)}function Ad(){return new Date(this.valueOf())}function Ud(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function $d(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Wd(){return this.isValid()?this.toISOString():null}function Hd(){return rn(this)}function Fd(){return Te({},T(this))}function Gd(){return T(this).overflow}function jd(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),y("N",xn),y("NN",xn),y("NNN",xn),y("NNNN",sc),y("NNNNN",ac),L(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var a=n._locale.erasParse(e,s,n._strict);a?T(n).era=a:T(n).invalidEra=e}),y("y",$e),y("yy",$e),y("yyy",$e),y("yyyy",$e),y("yo",rc),L(["y","yy","yyy","yyyy"],X),L(["yo"],function(e,t,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[X]=n._locale.eraYearOrdinalParse(e,a):t[X]=parseInt(e,10)});function zd(e,t){var n,s,a,o=this._eras||Ne("en")._eras;for(n=0,s=o.length;n<s;++n)switch(typeof o[n].since==="string"&&(a=_(o[n].since).startOf("day"),o[n].since=a.valueOf()),typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":a=_(o[n].until).startOf("day").valueOf(),o[n].until=a.valueOf();break}return o}function Zd(e,t,n){var s,a,o=this.eras(),i,l,d;for(e=e.toUpperCase(),s=0,a=o.length;s<a;++s)if(i=o[s].name.toUpperCase(),l=o[s].abbr.toUpperCase(),d=o[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(l===e)return o[s];break;case"NNNN":if(i===e)return o[s];break;case"NNNNN":if(d===e)return o[s];break}else if([i,l,d].indexOf(e)>=0)return o[s]}function qd(e,t){var n=e.since<=e.until?1:-1;return t===void 0?_(e.since).year():_(e.since).year()+(t-e.offset)*n}function Kd(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].name;return""}function Jd(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].narrow;return""}function Xd(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].abbr;return""}function Qd(){var e,t,n,s,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return(this.year()-_(a[e].since).year())*n+a[e].offset;return this.year()}function ec(e){return P(this,"_erasNameRegex")||Yn.call(this),e?this._erasNameRegex:this._erasRegex}function tc(e){return P(this,"_erasAbbrRegex")||Yn.call(this),e?this._erasAbbrRegex:this._erasRegex}function nc(e){return P(this,"_erasNarrowRegex")||Yn.call(this),e?this._erasNarrowRegex:this._erasRegex}function xn(e,t){return t.erasAbbrRegex(e)}function sc(e,t){return t.erasNameRegex(e)}function ac(e,t){return t.erasNarrowRegex(e)}function rc(e,t){return t._eraYearOrdinalRegex||$e}function Yn(){var e=[],t=[],n=[],s=[],a,o,i,l,d,c=this.eras();for(a=0,o=c.length;a<o;++a)i=ke(c[a].name),l=ke(c[a].abbr),d=ke(c[a].narrow),t.push(i),e.push(l),n.push(d),s.push(i),s.push(l),s.push(d);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Yt(e,t){C(0,[e,e.length],0,t)}Yt("gggg","weekYear"),Yt("ggggg","weekYear"),Yt("GGGG","isoWeekYear"),Yt("GGGGG","isoWeekYear"),y("G",wt),y("g",wt),y("GG",$,ne),y("gg",$,ne),y("GGGG",_n,mn),y("gggg",_n,mn),y("GGGGG",bt,gt),y("ggggg",bt,gt),Qe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=x(e)}),Qe(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)});function oc(e){return fa.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function ic(e){return fa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function lc(){return ve(this.year(),1,4)}function dc(){return ve(this.isoWeekYear(),1,4)}function cc(){var e=this.localeData()._week;return ve(this.year(),e.dow,e.doy)}function uc(){var e=this.localeData()._week;return ve(this.weekYear(),e.dow,e.doy)}function fa(e,t,n,s,a){var o;return e==null?st(this,s,a).year:(o=ve(e,s,a),t>o&&(t=o),hc.call(this,e,t,n,s,a))}function hc(e,t,n,s,a){var o=Fs(e,t,n,s,a),i=nt(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}C("Q",0,"Qo","quarter"),y("Q",Ys),L("Q",function(e,t){t[be]=(x(e)-1)*3});function fc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}C("D",["DD",2],"Do","date"),y("D",$,We),y("DD",$,ne),y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),L(["D","DD"],_e),L("Do",function(e,t){t[_e]=x(e.match($)[0])});var pa=He("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),y("DDD",kt),y("DDDD",Rs),L(["DDD","DDDD"],function(e,t,n){n._dayOfYear=x(e)});function pc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}C("m",["mm",2],0,"minute"),y("m",$,yn),y("mm",$,ne),L(["m","mm"],de);var mc=He("Minutes",!1);C("s",["ss",2],0,"second"),y("s",$,yn),y("ss",$,ne),L(["s","ss"],we);var _c=He("Seconds",!1);C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return this.millisecond()*10}),C(0,["SSSSS",5],0,function(){return this.millisecond()*100}),C(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),C(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),C(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),C(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),y("S",kt,Ys),y("SS",kt,ne),y("SSS",kt,Rs);var De,ma;for(De="SSSS";De.length<=9;De+="S")y(De,$e);function yc(e,t){t[Re]=x(("0."+e)*1e3)}for(De="S";De.length<=9;De+="S")L(De,yc);ma=He("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");function gc(){return this._isUTC?"UTC":""}function kc(){return this._isUTC?"Coordinated Universal Time":""}var u=Je.prototype;u.add=ud,u.calendar=gd,u.clone=kd,u.diff=Sd,u.endOf=Bd,u.format=Id,u.from=Dd,u.fromNow=xd,u.to=Yd,u.toNow=Rd,u.get=Ti,u.invalidAt=Gd,u.isAfter=bd,u.isBefore=wd,u.isBetween=vd,u.isSame=Nd,u.isSameOrAfter=Cd,u.isSameOrBefore=Md,u.isValid=Hd,u.lang=la,u.locale=ia,u.localeData=da,u.max=Hl,u.min=Wl,u.parsingFlags=Fd,u.set=Ii,u.startOf=Pd,u.subtract=hd,u.toArray=Ud,u.toObject=$d,u.toDate=Ad,u.toISOString=Ed,u.inspect=Td,typeof Symbol<"u"&&Symbol.for!=null&&(u[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),u.toJSON=Wd,u.toString=Od,u.unix=Ld,u.valueOf=Vd,u.creationData=jd,u.eraName=Kd,u.eraNarrow=Jd,u.eraAbbr=Xd,u.eraYear=Qd,u.year=Vs,u.isLeapYear=Ei,u.weekYear=oc,u.isoWeekYear=ic,u.quarter=u.quarters=fc,u.month=Ws,u.daysInMonth=Ai,u.week=u.weeks=zi,u.isoWeek=u.isoWeeks=Zi,u.weeksInYear=cc,u.weeksInWeekYear=uc,u.isoWeeksInYear=lc,u.isoWeeksInISOWeekYear=dc,u.date=pa,u.day=u.days=il,u.weekday=ll,u.isoWeekday=dl,u.dayOfYear=pc,u.hour=u.hours=_l,u.minute=u.minutes=mc,u.second=u.seconds=_c,u.millisecond=u.milliseconds=ma,u.utcOffset=Xl,u.utc=ed,u.local=td,u.parseZone=nd,u.hasAlignedHourOffset=sd,u.isDST=ad,u.isLocal=od,u.isUtcOffset=id,u.isUtc=na,u.isUTC=na,u.zoneAbbr=gc,u.zoneName=kc,u.dates=ae("dates accessor is deprecated. Use date instead.",pa),u.months=ae("months accessor is deprecated. Use month instead",Ws),u.years=ae("years accessor is deprecated. Use year instead",Vs),u.zone=ae("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ql),u.isDSTShifted=ae("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rd);function bc(e){return W(e*1e3)}function wc(){return W.apply(null,arguments).parseZone()}function _a(e){return e}var B=cn.prototype;B.calendar=oi,B.longDateFormat=ci,B.invalidDate=hi,B.ordinal=mi,B.preparse=_a,B.postformat=_a,B.relativeTime=yi,B.pastFuture=gi,B.set=ai,B.eras=zd,B.erasParse=Zd,B.erasConvertYear=qd,B.erasAbbrRegex=tc,B.erasNameRegex=ec,B.erasNarrowRegex=nc,B.months=Pi,B.monthsShort=Bi,B.monthsParse=Li,B.monthsRegex=$i,B.monthsShortRegex=Ui,B.week=Hi,B.firstDayOfYear=ji,B.firstDayOfWeek=Gi,B.weekdays=nl,B.weekdaysMin=al,B.weekdaysShort=sl,B.weekdaysParse=ol,B.weekdaysRegex=cl,B.weekdaysShortRegex=ul,B.weekdaysMinRegex=hl,B.isPM=pl,B.meridiem=yl;function Rt(e,t,n,s){var a=Ne(),o=fe().set(s,t);return a[n](o,e)}function ya(e,t,n){if(ge(e)&&(t=e,e=void 0),e=e||"",t!=null)return Rt(e,t,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Rt(e,s,n,"month");return a}function Rn(e,t,n,s){typeof e=="boolean"?(ge(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ge(t)&&(n=t,t=void 0),t=t||"");var a=Ne(),o=e?a._week.dow:0,i,l=[];if(n!=null)return Rt(t,(n+o)%7,s,"day");for(i=0;i<7;i++)l[i]=Rt(t,(i+o)%7,s,"day");return l}function vc(e,t){return ya(e,t,"months")}function Nc(e,t){return ya(e,t,"monthsShort")}function Cc(e,t,n){return Rn(e,t,n,"weekdays")}function Mc(e,t,n){return Rn(e,t,n,"weekdaysShort")}function Sc(e,t,n){return Rn(e,t,n,"weekdaysMin")}Ie("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(e){var t=e%10,n=x(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),_.lang=ae("moment.lang is deprecated. Use moment.locale instead.",Ie),_.langData=ae("moment.langData is deprecated. Use moment.localeData instead.",Ne);var Ce=Math.abs;function Oc(){var e=this._data;return this._milliseconds=Ce(this._milliseconds),this._days=Ce(this._days),this._months=Ce(this._months),e.milliseconds=Ce(e.milliseconds),e.seconds=Ce(e.seconds),e.minutes=Ce(e.minutes),e.hours=Ce(e.hours),e.months=Ce(e.months),e.years=Ce(e.years),this}function ga(e,t,n,s){var a=ce(t,n);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function Ec(e,t){return ga(this,e,t,1)}function Tc(e,t){return ga(this,e,t,-1)}function ka(e){return e<0?Math.floor(e):Math.ceil(e)}function Ic(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,a,o,i,l,d;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ka(Pn(n)+t)*864e5,t=0,n=0),s.milliseconds=e%1e3,a=oe(e/1e3),s.seconds=a%60,o=oe(a/60),s.minutes=o%60,i=oe(o/60),s.hours=i%24,t+=oe(i/24),d=oe(ba(t)),n+=d,t-=ka(Pn(d)),l=oe(n/12),n%=12,s.days=t,s.months=n,s.years=l,this}function ba(e){return e*4800/146097}function Pn(e){return e*146097/4800}function Dc(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(e=re(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,n=this._months+ba(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function Me(e){return function(){return this.as(e)}}var wa=Me("ms"),xc=Me("s"),Yc=Me("m"),Rc=Me("h"),Pc=Me("d"),Bc=Me("w"),Vc=Me("M"),Lc=Me("Q"),Ac=Me("y"),Uc=wa;function $c(){return ce(this)}function Wc(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Be(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hc=Be("milliseconds"),Fc=Be("seconds"),Gc=Be("minutes"),jc=Be("hours"),zc=Be("days"),Zc=Be("months"),qc=Be("years");function Kc(){return oe(this.days()/7)}var Se=Math.round,ze={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jc(e,t,n,s,a){return a.relativeTime(t||1,!!n,e,s)}function Xc(e,t,n,s){var a=ce(e).abs(),o=Se(a.as("s")),i=Se(a.as("m")),l=Se(a.as("h")),d=Se(a.as("d")),c=Se(a.as("M")),f=Se(a.as("w")),w=Se(a.as("y")),m=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||i<=1&&["m"]||i<n.m&&["mm",i]||l<=1&&["h"]||l<n.h&&["hh",l]||d<=1&&["d"]||d<n.d&&["dd",d];return n.w!=null&&(m=m||f<=1&&["w"]||f<n.w&&["ww",f]),m=m||c<=1&&["M"]||c<n.M&&["MM",c]||w<=1&&["y"]||["yy",w],m[2]=t,m[3]=+e>0,m[4]=s,Jc.apply(null,m)}function Qc(e){return e===void 0?Se:typeof e=="function"?(Se=e,!0):!1}function eu(e,t){return ze[e]===void 0?!1:t===void 0?ze[e]:(ze[e]=t,e==="s"&&(ze.ss=t-1),!0)}function tu(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=ze,a,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(s=Object.assign({},ze,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),o=Xc(this,!n,s,a),n&&(o=a.pastFuture(+this,o)),a.postformat(o)}var Bn=Math.abs;function Ze(e){return(e>0)-(e<0)||+e}function Pt(){if(!this.isValid())return this.localeData().invalidDate();var e=Bn(this._milliseconds)/1e3,t=Bn(this._days),n=Bn(this._months),s,a,o,i,l=this.asSeconds(),d,c,f,w;return l?(s=oe(e/60),a=oe(s/60),e%=60,s%=60,o=oe(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",d=l<0?"-":"",c=Ze(this._months)!==Ze(l)?"-":"",f=Ze(this._days)!==Ze(l)?"-":"",w=Ze(this._milliseconds)!==Ze(l)?"-":"",d+"P"+(o?c+o+"Y":"")+(n?c+n+"M":"")+(t?f+t+"D":"")+(a||s||e?"T":"")+(a?w+a+"H":"")+(s?w+s+"M":"")+(e?w+i+"S":"")):"P0D"}var Y=Et.prototype;Y.isValid=Zl,Y.abs=Oc,Y.add=Ec,Y.subtract=Tc,Y.as=Dc,Y.asMilliseconds=wa,Y.asSeconds=xc,Y.asMinutes=Yc,Y.asHours=Rc,Y.asDays=Pc,Y.asWeeks=Bc,Y.asMonths=Vc,Y.asQuarters=Lc,Y.asYears=Ac,Y.valueOf=Uc,Y._bubble=Ic,Y.clone=$c,Y.get=Wc,Y.milliseconds=Hc,Y.seconds=Fc,Y.minutes=Gc,Y.hours=jc,Y.days=zc,Y.weeks=Kc,Y.months=Zc,Y.years=qc,Y.humanize=tu,Y.toISOString=Pt,Y.toString=Pt,Y.toJSON=Pt,Y.locale=ia,Y.localeData=da,Y.toIsoString=ae("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Pt),Y.lang=la,C("X",0,0,"unix"),C("x",0,0,"valueOf"),y("x",wt),y("X",vi),L("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),L("x",function(e,t,n){n._d=new Date(x(e))});_.version="2.30.1",ni(W),_.fn=u,_.min=Fl,_.max=Gl,_.now=jl,_.utc=fe,_.unix=bc,_.months=vc,_.isDate=Ke,_.locale=Ie,_.invalid=mt,_.duration=ce,_.isMoment=le,_.weekdays=Cc,_.parseZone=wc,_.localeData=Ne,_.isDuration=Tt,_.monthsShort=Nc,_.weekdaysMin=Sc,_.defineLocale=Nn,_.updateLocale=wl,_.locales=vl,_.weekdaysShort=Mc,_.normalizeUnits=re,_.relativeTimeRounding=Qc,_.relativeTimeThreshold=eu,_.calendarFormat=yd,_.prototype=u,_.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 nu="code-graph",su=(e,t="",n="json")=>{const s=document.createElement("a");s.setAttribute("href",`data:text/${n};charset=UTF-8,${encodeURIComponent(e)}`);const a=_().format("YYMMDD_HHMMSS");s.setAttribute("download",`${nu}_${a}_${t}.${n}`),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},au=(e="json")=>{const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("id","fileElem"),t.setAttribute("multiple","true"),t.setAttribute("accept",`${e}/*`),t.style.display="none",document.body.appendChild(t),t.click(),t},Vn="CLEAR_ALL",Ln="DOWNLOAD_EDITOR_STATE",va="RUN_ENGINE",An="TOGGLE_MINIMAP",Un="TOGGLE_PALETTE",$n="UPLOAD_EDITOR_STATE",Na=(e,t,n)=>{const s=n.zoomToFit.paddingLeft;t.registerCommand(Vn,{execute:()=>{t.executeCommand(S.Commands.CLEAR_CLIPBOARD_COMMAND),t.executeCommand(S.Commands.CLEAR_HISTORY_COMMAND),e.value.clear(),e.value.editor.code.clear()},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(Ln,{execute:()=>{const a=e.value.editor.save();su(JSON.stringify(a,null,2),e.value.shortId)},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(An,{execute:()=>n.enableMinimap=!n.enableMinimap,canExecute:()=>e.value.nodes.length>1}),t.registerCommand(Un,{execute:()=>{n.palette.enabled=!n.palette.enabled,n.zoomToFit.paddingLeft=n.palette.enabled?s:50},canExecute:()=>!0}),t.registerCommand($n,{execute:()=>{const a=au();a.addEventListener("change",()=>{document.body.removeChild(a);const o=a.files;if(!o||o.length<=0)return!1;const i=new FileReader;i.onload=l=>{if(l.target?.result){const d=l.target.result;if(d.length===0)return;const c=JSON.parse(d);e.value.editor.load(c),e.value.code?.engine?.runOnce(null)}},i.readAsText(o.item(0))})},canExecute:()=>!0})},Ca=e=>{const t={command:Vn,title:"Clear all",icon:r.computed(()=>rs)},n={command:Ln,title:"Download editor state",icon:r.computed(()=>ns)},s={command:An,title:"Toggle minimap",icon:r.computed(()=>e.enableMinimap?is:os)},a={command:Un,title:"Toggle palette",icon:r.computed(()=>e.palette.enabled?ss:$t)},o={command:$n,title:"Upload editor state",icon:r.computed(()=>ds)};e.toolbar.commands=[a,t,o,n,...S.DEFAULT_TOOLBAR_COMMANDS,s]},Ma=(e,t,n)=>{n.registerCommand(va,{execute:()=>t.runOnce(null),canExecute:()=>e.nodes.length>0})};function Sa(e){const t=Symbol("CodeEngineToken");e.engine=new Cs(e.editor),Ma(e.editor.graph,e.engine,e.commandHandler),e.loadEditor=n=>{e.engine?.pause(),e.displayedGraph.clear(),e.editor.load(n),e.commandHandler.executeCommand(S.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(S.Commands.CLEAR_HISTORY_COMMAND),e.engine?.resume(),e.engine?.runOnce(null)},e.newGraph=()=>{e.engine?.pause(),e.displayedGraph.clear(),e.commandHandler.executeCommand(S.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(S.Commands.CLEAR_HISTORY_COMMAND),e.displayedGraph.id=xe.v4(),e.engine?.resume(),e.engine?.runOnce(null)},e.subscribe=()=>{e.displayedGraph.nodeEvents.titleChanged.subscribe(t,()=>{e.engine?.runOnce(null)}),e.displayedGraph.events.addConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onConnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onConnected()}),e.displayedGraph.events.removeConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onUnconnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onUnconnected()}),e.engine?.events.beforeRun.subscribe(t,()=>{e.displayedGraph.onUpdate(),e.engine?.pause(),e.displayedGraph.sortNodes(),e.engine?.resume()}),e.engine?.events.afterRun.subscribe(t,n=>{e.engine?.pause(),he.applyResult(n,e.editor),e.code.state.lockCode||e.code.renderCode({nodes:e.editor.graph.scriptedCodeNodes,modules:e.editor.code.modules}),e.engine?.resume()})},e.unsubscribe=()=>{e.displayedGraph.events.addConnection.unsubscribe(t),e.displayedGraph.events.removeConnection.unsubscribe(t),e.engine?.events.beforeRun.unsubscribe(t),e.engine?.events.afterRun.unsubscribe(t)}}const Bt=350;class it extends q.Graph{code=null;editor;_state=r.reactive({codeTemplate:"{{ #nodes }}{{ script }}{{ /nodes }}",lockCode:!1});constructor(t,n){super(t,n),this.editor=t,this.template=n,t.code&&(this.code=t.code)}get codeNodes(){return Wn(this)}get connections(){return super.connections}set connections(t){this._connections=t}get nodeIds(){return this.nodes.map(t=>t.id)}get nodes(){return super.nodes}set nodes(t){this._nodes=t}get scriptedCodeNodes(){return this.nodes.filter(t=>!t.state?.integrated)}get selectedNodeIds(){return this.selectedNodes.map(t=>t.id)}get shortId(){return this.id.slice(0,6)}get state(){return this._state}get visibleNodes(){return this.nodes.filter(t=>!t.state?.hidden)}addNode(t,n){return t.state&&n&&(t.state.props=n),super.addNode(t)}addNodeAtCoordinates=(t,n={x:0,y:0},s)=>(this.addNode(t,s),t.position&&(t.position=n),t);addConnection(t,n){t&&t?.name!=="_code"&&(t.hidden=!1),n&&n?.name!=="_code"&&(n.hidden=!1),super.addConnection(t,n)}clear(){this.selectedNodes=[],this._nodes=[],this._connections=[]}findNodeByType(t){return this.nodes.find(n=>n.type===t)}getNodesByType(t){return this.nodes.filter(n=>n.type===t)}getNodesByVariableName(t){return this.nodes.filter(n=>n.state?.variableName===t)}hasConnection(t,n){return this.connections.some(s=>s.from.id===t.id&&s.to.id===n.id)}load(t){const n=super.load(t);return this.nodes.forEach(s=>s.afterGraphLoaded()),n}onUpdate(){this.nodes.forEach(t=>t.onGraphUpdate())}renderCode(t){return Le.render(this.state?.codeTemplate||"",t)}sortNodes(){if(!(this.nodes.length===0||this.connections.length===0))try{let t=this.nodeIds;const n=this.connections.filter(o=>t.includes(o.to.nodeId)&&t.includes(o.from.nodeId)).map(o=>[o.to.nodeId,o.from.nodeId]);t.reverse(),t=Ra.array(t,n),t.reverse();const s=this.nodes.map(o=>o.id).filter(o=>!t.includes(o));t=[...t,...s];const a=t.map(o=>this.findNodeById(o));a&&(this.nodes=a)}catch{console.warn("Failed to sort nodes.")}}}const Wn=e=>{const t=[];return e.nodes.length===0||e.nodes.forEach(n=>{n&&(n.hasOwnProperty("subgraph")?t.push(...Wn(n.subgraph)):n.hasOwnProperty("isCodeNode")&&t.push(n))}),t},ru=(e=0,t=100)=>({x:e*(Bt+70),y:t}),ou=e=>{const t={...e.position};return t.x-=Bt+70,t.y+=50,t},Hn="__baklava_SubgraphInputNode",Fn="__baklava_SubgraphOutputNode";class Oa extends ht{graphInterfaceId;constructor(){super(),this.graphInterfaceId=xe.v4()}onPlaced(){super.onPlaced(),this.initializeIo()}load(t){super.load(t),this.graphInterfaceId=t.graphInterfaceId}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}update(){}}class Gn extends Oa{static isGraphInputNode(t){return t.type===Hn}type=Hn;inputs={name:new q.NodeInterface("Name","Input")};outputs={placeholder:new q.NodeInterface("Value",void 0)}}class jn extends Oa{static isGraphOutputNode(t){return t.type===Fn}type=Fn;inputs={name:new q.NodeInterface("Name","Output"),placeholder:new q.NodeInterface("Value",void 0)};outputs={output:new q.NodeInterface("Output",void 0).setHidden(!0)};calculate=({placeholder:t})=>({output:t})}const iu=["component","connectionCount","events","hidden","hooks","id","isCodeNode","isInput","name","nodeId","port","templateId","value"];function Ea(e){return class extends zt{type=q.getGraphNodeTypeString(e);get title(){return this._title}set title(n){this.template.name=n}inputs={};outputs={};template=e;subgraph;update(){}onConnected(){}onUnconnected(){}calculate=async(n,s)=>{if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const a=s.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)a.set(l.nodeInterfaceId,n[l.id]);const o=await s.engine.runGraph(this.subgraph,a,s.globalValues);s.engine.pause(),he.applyResult(o,s.engine.editor),s.engine.resume();const i={};for(const l of this.subgraph.outputs)i[l.id]=o.get(l.nodeId)?.get("output");return i._calculationResults=o,this.lockCode||(i._code=this.renderCode({inputs:n,...s.globalValues})),this.updateOutputValues(i),i};load(n){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(n.graphState),super.load(n)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,n=>{this._title=n}),this.initialize()}onDestroy(){this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),this.subgraph?.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.state.codeTemplate=`{{ #nodes }}{{ script }}
6
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Ts={};function Is(e,t){_.deprecationHandler!=null&&_.deprecationHandler(e,t),Ts[e]||(Es(t),Ts[e]=!0)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;function pe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function ai(e){var t,n;for(n in e)P(e,n)&&(t=e[n],pe(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function dn(e,t){var n=Te({},e),s;for(s in t)P(t,s)&&(Ye(e[s])&&Ye(t[s])?(n[s]={},Te(n[s],e[s]),Te(n[s],t[s])):t[s]!=null?n[s]=t[s]:delete n[s]);for(s in e)P(e,s)&&!P(t,s)&&Ye(e[s])&&(n[s]=Te({},n[s]));return n}function cn(e){e!=null&&this.set(e)}var un;Object.keys?un=Object.keys:un=function(e){var t,n=[];for(t in e)P(e,t)&&n.push(t);return n};var ri={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function oi(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return pe(s)?s.call(t,n):s}function me(e,t,n){var s=""+Math.abs(e),a=t-s.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var hn=/(\[[^\[]*\])|(\\)?([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,_t=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,fn={},Ue={};function C(e,t,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(Ue[e]=a),t&&(Ue[t[0]]=function(){return me(a.apply(this,arguments),t[1],t[2])}),n&&(Ue[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function ii(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function li(e){var t=e.match(hn),n,s;for(n=0,s=t.length;n<s;n++)Ue[t[n]]?t[n]=Ue[t[n]]:t[n]=ii(t[n]);return function(a){var o="",i;for(i=0;i<s;i++)o+=pe(t[i])?t[i].call(a,e):t[i];return o}}function yt(e,t){return e.isValid()?(t=Ds(t,e.localeData()),fn[t]=fn[t]||li(t),fn[t](e)):e.localeData().invalidDate()}function Ds(e,t){var n=5;function s(a){return t.longDateFormat(a)||a}for(_t.lastIndex=0;n>=0&&_t.test(e);)e=e.replace(_t,s),_t.lastIndex=0,n-=1;return e}var di={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 ci(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(hn).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var ui="Invalid date";function hi(){return this._invalidDate}var fi="%d",pi=/\d{1,2}/;function mi(e){return this._ordinal.replace("%d",e)}var _i={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 yi(e,t,n,s){var a=this._relativeTime[n];return pe(a)?a(e,t,n,s):a.replace(/%d/i,e)}function gi(e,t){var n=this._relativeTime[e>0?"future":"past"];return pe(n)?n(t):n.replace(/%s/i,t)}var xs={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 re(e){return typeof e=="string"?xs[e]||xs[e.toLowerCase()]:void 0}function pn(e){var t={},n,s;for(s in e)P(e,s)&&(n=re(s),n&&(t[n]=e[s]));return t}var ki={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 bi(e){var t=[],n;for(n in e)P(e,n)&&t.push({unit:n,priority:ki[n]});return t.sort(function(s,a){return s.priority-a.priority}),t}var Ys=/\d/,ne=/\d\d/,Rs=/\d{3}/,mn=/\d{4}/,gt=/[+-]?\d{6}/,$=/\d\d?/,Ps=/\d\d\d\d?/,Bs=/\d\d\d\d\d\d?/,kt=/\d{1,3}/,_n=/\d{1,4}/,bt=/[+-]?\d{1,6}/,$e=/\d+/,wt=/[+-]?\d+/,wi=/Z|[+-]\d\d:?\d\d/gi,vt=/Z|[+-]\d\d(?::?\d\d)?/gi,vi=/[+-]?\d+(\.\d{1,3})?/,Xe=/[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,We=/^[1-9]\d?/,yn=/^([1-9]\d|\d)/,Nt;Nt={};function y(e,t,n){Nt[e]=pe(t)?t:function(s,a){return s&&n?n:t}}function Ni(e,t){return P(Nt,e)?Nt[e](t._strict,t._locale):new RegExp(Ci(e))}function Ci(e){return ke(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,s,a,o){return n||s||a||o}))}function ke(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function oe(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function x(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=oe(t)),n}var gn={};function L(e,t){var n,s=t,a;for(typeof e=="string"&&(e=[e]),ge(t)&&(s=function(o,i){i[t]=x(o)}),a=e.length,n=0;n<a;n++)gn[e[n]]=s}function Qe(e,t){L(e,function(n,s,a,o){a._w=a._w||{},t(n,a._w,a,o)})}function Mi(e,t,n){t!=null&&P(gn,e)&&gn[e](t,n._a,n,e)}function Ct(e){return e%4===0&&e%100!==0||e%400===0}var X=0,be=1,_e=2,K=3,de=4,we=5,Re=6,Si=7,Oi=8;C("Y",0,0,function(){var e=this.year();return e<=9999?me(e,4):"+"+e}),C(0,["YY",2],0,function(){return this.year()%100}),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),y("Y",wt),y("YY",$,ne),y("YYYY",_n,mn),y("YYYYY",bt,gt),y("YYYYYY",bt,gt),L(["YYYYY","YYYYYY"],X),L("YYYY",function(e,t){t[X]=e.length===2?_.parseTwoDigitYear(e):x(e)}),L("YY",function(e,t){t[X]=_.parseTwoDigitYear(e)}),L("Y",function(e,t){t[X]=parseInt(e,10)});function et(e){return Ct(e)?366:365}_.parseTwoDigitYear=function(e){return x(e)+(x(e)>68?1900:2e3)};var Vs=He("FullYear",!0);function Ei(){return Ct(this.year())}function He(e,t){return function(n){return n!=null?(Ls(this,e,n),_.updateOffset(this,t),this):tt(this,e)}}function tt(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ls(e,t,n){var s,a,o,i,l;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(a?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(a?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(a?s.setUTCHours(n):s.setHours(n));case"Date":return void(a?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}o=n,i=e.month(),l=e.date(),l=l===29&&i===1&&!Ct(o)?28:l,a?s.setUTCFullYear(o,i,l):s.setFullYear(o,i,l)}}function Ti(e){return e=re(e),pe(this[e])?this[e]():this}function Ii(e,t){if(typeof e=="object"){e=pn(e);var n=bi(e),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](e[n[s].unit])}else if(e=re(e),pe(this[e]))return this[e](t);return this}function Di(e,t){return(e%t+t)%t}var Z;Array.prototype.indexOf?Z=Array.prototype.indexOf:Z=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function kn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Di(t,12);return e+=(t-n)/12,n===1?Ct(e)?29:28:31-n%7%2}C("M",["MM",2],"Mo",function(){return this.month()+1}),C("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),C("MMMM",0,0,function(e){return this.localeData().months(this,e)}),y("M",$,We),y("MM",$,ne),y("MMM",function(e,t){return t.monthsShortRegex(e)}),y("MMMM",function(e,t){return t.monthsRegex(e)}),L(["M","MM"],function(e,t){t[be]=x(e)-1}),L(["MMM","MMMM"],function(e,t,n,s){var a=n._locale.monthsParse(e,s,n._strict);a!=null?t[be]=a:T(n).invalidMonth=e});var xi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),As="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Us=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yi=Xe,Ri=Xe;function Pi(e,t){return e?ie(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Us).test(t)?"format":"standalone"][e.month()]:ie(this._months)?this._months:this._months.standalone}function Bi(e,t){return e?ie(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Us.test(t)?"format":"standalone"][e.month()]:ie(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Vi(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)o=fe([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(a=Z.call(this._shortMonthsParse,i),a!==-1?a:null):(a=Z.call(this._longMonthsParse,i),a!==-1?a:null):t==="MMM"?(a=Z.call(this._shortMonthsParse,i),a!==-1?a:(a=Z.call(this._longMonthsParse,i),a!==-1?a:null)):(a=Z.call(this._longMonthsParse,i),a!==-1?a:(a=Z.call(this._shortMonthsParse,i),a!==-1?a:null))}function Li(e,t,n){var s,a,o;if(this._monthsParseExact)return Vi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(a=fe([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!n&&!this._monthsParse[s]&&(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[s].test(e))return s;if(n&&t==="MMM"&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function $s(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=x(t);else if(t=e.localeData().monthsParse(t),!ge(t))return e}var n=t,s=e.date();return s=s<29?s:Math.min(s,kn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function Ws(e){return e!=null?($s(this,e),_.updateOffset(this,!0),this):tt(this,"Month")}function Ai(){return kn(this.year(),this.month())}function Ui(e){return this._monthsParseExact?(P(this,"_monthsRegex")||Hs.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(P(this,"_monthsShortRegex")||(this._monthsShortRegex=Yi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function $i(e){return this._monthsParseExact?(P(this,"_monthsRegex")||Hs.call(this),e?this._monthsStrictRegex:this._monthsRegex):(P(this,"_monthsRegex")||(this._monthsRegex=Ri),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Hs(){function e(d,c){return c.length-d.length}var t=[],n=[],s=[],a,o,i,l;for(a=0;a<12;a++)o=fe([2e3,a]),i=ke(this.monthsShort(o,"")),l=ke(this.months(o,"")),t.push(i),n.push(l),s.push(l),s.push(i);t.sort(e),n.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Wi(e,t,n,s,a,o,i){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,s,a,o,i),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,s,a,o,i),l}function nt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Mt(e,t,n){var s=7+t-n,a=(7+nt(e,0,s).getUTCDay()-t)%7;return-a+s-1}function Fs(e,t,n,s,a){var o=(7+n-s)%7,i=Mt(e,s,a),l=1+7*(t-1)+o+i,d,c;return l<=0?(d=e-1,c=et(d)+l):l>et(e)?(d=e+1,c=l-et(e)):(d=e,c=l),{year:d,dayOfYear:c}}function st(e,t,n){var s=Mt(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1,o,i;return a<1?(i=e.year()-1,o=a+ve(i,t,n)):a>ve(e.year(),t,n)?(o=a-ve(e.year(),t,n),i=e.year()+1):(i=e.year(),o=a),{week:o,year:i}}function ve(e,t,n){var s=Mt(e,t,n),a=Mt(e+1,t,n);return(et(e)-s+a)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),y("w",$,We),y("ww",$,ne),y("W",$,We),y("WW",$,ne),Qe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=x(e)});function Hi(e){return st(e,this._week.dow,this._week.doy).week}var Fi={dow:0,doy:6};function Gi(){return this._week.dow}function ji(){return this._week.doy}function zi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Zi(e){var t=st(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),y("d",$),y("e",$),y("E",$),y("dd",function(e,t){return t.weekdaysMinRegex(e)}),y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),y("dddd",function(e,t){return t.weekdaysRegex(e)}),Qe(["dd","ddd","dddd"],function(e,t,n,s){var a=n._locale.weekdaysParse(e,s,n._strict);a!=null?t.d=a:T(n).invalidWeekday=e}),Qe(["d","e","E"],function(e,t,n,s){t[s]=x(e)});function qi(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Ki(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function bn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Ji="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gs="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Qi=Xe,el=Xe,tl=Xe;function nl(e,t){var n=ie(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?bn(n,this._week.dow):e?n[e.day()]:n}function sl(e){return e===!0?bn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function al(e){return e===!0?bn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function rl(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)o=fe([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(a=Z.call(this._weekdaysParse,i),a!==-1?a:null):t==="ddd"?(a=Z.call(this._shortWeekdaysParse,i),a!==-1?a:null):(a=Z.call(this._minWeekdaysParse,i),a!==-1?a:null):t==="dddd"?(a=Z.call(this._weekdaysParse,i),a!==-1||(a=Z.call(this._shortWeekdaysParse,i),a!==-1)?a:(a=Z.call(this._minWeekdaysParse,i),a!==-1?a:null)):t==="ddd"?(a=Z.call(this._shortWeekdaysParse,i),a!==-1||(a=Z.call(this._weekdaysParse,i),a!==-1)?a:(a=Z.call(this._minWeekdaysParse,i),a!==-1?a:null)):(a=Z.call(this._minWeekdaysParse,i),a!==-1||(a=Z.call(this._weekdaysParse,i),a!==-1)?a:(a=Z.call(this._shortWeekdaysParse,i),a!==-1?a:null))}function ol(e,t,n){var s,a,o;if(this._weekdaysParseExact)return rl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=fe([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(n&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(n&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function il(e){if(!this.isValid())return e!=null?this:NaN;var t=tt(this,"Day");return e!=null?(e=qi(e,this.localeData()),this.add(e-t,"d")):t}function ll(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function dl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Ki(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function cl(e){return this._weekdaysParseExact?(P(this,"_weekdaysRegex")||wn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(P(this,"_weekdaysRegex")||(this._weekdaysRegex=Qi),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function ul(e){return this._weekdaysParseExact?(P(this,"_weekdaysRegex")||wn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(P(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=el),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function hl(e){return this._weekdaysParseExact?(P(this,"_weekdaysRegex")||wn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(P(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tl),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function wn(){function e(f,w){return w.length-f.length}var t=[],n=[],s=[],a=[],o,i,l,d,c;for(o=0;o<7;o++)i=fe([2e3,1]).day(o),l=ke(this.weekdaysMin(i,"")),d=ke(this.weekdaysShort(i,"")),c=ke(this.weekdays(i,"")),t.push(l),n.push(d),s.push(c),a.push(l),a.push(d),a.push(c);t.sort(e),n.sort(e),s.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function vn(){return this.hours()%12||12}function fl(){return this.hours()||24}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,vn),C("k",["kk",2],0,fl),C("hmm",0,0,function(){return""+vn.apply(this)+me(this.minutes(),2)}),C("hmmss",0,0,function(){return""+vn.apply(this)+me(this.minutes(),2)+me(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+me(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+me(this.minutes(),2)+me(this.seconds(),2)});function js(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}js("a",!0),js("A",!1);function zs(e,t){return t._meridiemParse}y("a",zs),y("A",zs),y("H",$,yn),y("h",$,We),y("k",$,We),y("HH",$,ne),y("hh",$,ne),y("kk",$,ne),y("hmm",Ps),y("hmmss",Bs),y("Hmm",Ps),y("Hmmss",Bs),L(["H","HH"],K),L(["k","kk"],function(e,t,n){var s=x(e);t[K]=s===24?0:s}),L(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),L(["h","hh"],function(e,t,n){t[K]=x(e),T(n).bigHour=!0}),L("hmm",function(e,t,n){var s=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s)),T(n).bigHour=!0}),L("hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s,2)),t[we]=x(e.substr(a)),T(n).bigHour=!0}),L("Hmm",function(e,t,n){var s=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s))}),L("Hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[K]=x(e.substr(0,s)),t[de]=x(e.substr(s,2)),t[we]=x(e.substr(a))});function pl(e){return(e+"").toLowerCase().charAt(0)==="p"}var ml=/[ap]\.?m?\.?/i,_l=He("Hours",!0);function yl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Zs={calendar:ri,longDateFormat:di,invalidDate:ui,ordinal:fi,dayOfMonthOrdinalParse:pi,relativeTime:_i,months:xi,monthsShort:As,week:Fi,weekdays:Ji,weekdaysMin:Xi,weekdaysShort:Gs,meridiemParse:ml},F={},at={},rt;function gl(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function qs(e){return e&&e.toLowerCase().replace("_","-")}function kl(e){for(var t=0,n,s,a,o;t<e.length;){for(o=qs(e[t]).split("-"),n=o.length,s=qs(e[t+1]),s=s?s.split("-"):null;n>0;){if(a=St(o.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&gl(o,s)>=n-1)break;n--}t++}return rt}function bl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function St(e){var t=null,n;if(F[e]===void 0&&typeof module<"u"&&module&&module.exports&&bl(e))try{t=rt._abbr,n=require,n("./locale/"+e),Ie(t)}catch{F[e]=null}return F[e]}function Ie(e,t){var n;return e&&(ee(t)?n=Ne(e):n=Nn(e,t),n?rt=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rt._abbr}function Nn(e,t){if(t!==null){var n,s=Zs;if(t.abbr=e,F[e]!=null)Is("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=F[e]._config;else if(t.parentLocale!=null)if(F[t.parentLocale]!=null)s=F[t.parentLocale]._config;else if(n=St(t.parentLocale),n!=null)s=n._config;else return at[t.parentLocale]||(at[t.parentLocale]=[]),at[t.parentLocale].push({name:e,config:t}),null;return F[e]=new cn(dn(s,t)),at[e]&&at[e].forEach(function(a){Nn(a.name,a.config)}),Ie(e),F[e]}else return delete F[e],null}function wl(e,t){if(t!=null){var n,s,a=Zs;F[e]!=null&&F[e].parentLocale!=null?F[e].set(dn(F[e]._config,t)):(s=St(e),s!=null&&(a=s._config),t=dn(a,t),s==null&&(t.abbr=e),n=new cn(t),n.parentLocale=F[e],F[e]=n),Ie(e)}else F[e]!=null&&(F[e].parentLocale!=null?(F[e]=F[e].parentLocale,e===Ie()&&Ie(e)):F[e]!=null&&delete F[e]);return F[e]}function Ne(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rt;if(!ie(e)){if(t=St(e),t)return t;e=[e]}return kl(e)}function vl(){return un(F)}function Cn(e){var t,n=e._a;return n&&T(e).overflow===-2&&(t=n[be]<0||n[be]>11?be:n[_e]<1||n[_e]>kn(n[X],n[be])?_e:n[K]<0||n[K]>24||n[K]===24&&(n[de]!==0||n[we]!==0||n[Re]!==0)?K:n[de]<0||n[de]>59?de:n[we]<0||n[we]>59?we:n[Re]<0||n[Re]>999?Re:-1,T(e)._overflowDayOfYear&&(t<X||t>_e)&&(t=_e),T(e)._overflowWeeks&&t===-1&&(t=Si),T(e)._overflowWeekday&&t===-1&&(t=Oi),T(e).overflow=t),e}var Nl=/^\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)?)?$/,Cl=/^\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)?)?$/,Ml=/Z|[+-]\d\d(?::?\d\d)?/,Ot=[["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]],Mn=[["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/]],Sl=/^\/?Date\((-?\d+)/i,Ol=/^(?:(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}))$/,El={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ks(e){var t,n,s=e._i,a=Nl.exec(s)||Cl.exec(s),o,i,l,d,c=Ot.length,f=Mn.length;if(a){for(T(e).iso=!0,t=0,n=c;t<n;t++)if(Ot[t][1].exec(a[1])){i=Ot[t][0],o=Ot[t][2]!==!1;break}if(i==null){e._isValid=!1;return}if(a[3]){for(t=0,n=f;t<n;t++)if(Mn[t][1].exec(a[3])){l=(a[2]||" ")+Mn[t][0];break}if(l==null){e._isValid=!1;return}}if(!o&&l!=null){e._isValid=!1;return}if(a[4])if(Ml.exec(a[4]))d="Z";else{e._isValid=!1;return}e._f=i+(l||"")+(d||""),On(e)}else e._isValid=!1}function Tl(e,t,n,s,a,o){var i=[Il(e),As.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return o&&i.push(parseInt(o,10)),i}function Il(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Dl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function xl(e,t,n){if(e){var s=Gs.indexOf(e),a=new Date(t[0],t[1],t[2]).getDay();if(s!==a)return T(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Yl(e,t,n){if(e)return El[e];if(t)return 0;var s=parseInt(n,10),a=s%100,o=(s-a)/100;return o*60+a}function Js(e){var t=Ol.exec(Dl(e._i)),n;if(t){if(n=Tl(t[4],t[3],t[2],t[5],t[6],t[7]),!xl(t[1],n,e))return;e._a=n,e._tzm=Yl(t[8],t[9],t[10]),e._d=nt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),T(e).rfc2822=!0}else e._isValid=!1}function Rl(e){var t=Sl.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Ks(e),e._isValid===!1)delete e._isValid;else return;if(Js(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:_.createFromInputFallback(e)}_.createFromInputFallback=ae("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Fe(e,t,n){return e??t??n}function Pl(e){var t=new Date(_.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Sn(e){var t,n,s=[],a,o,i;if(!e._d){for(a=Pl(e),e._w&&e._a[_e]==null&&e._a[be]==null&&Bl(e),e._dayOfYear!=null&&(i=Fe(e._a[X],a[X]),(e._dayOfYear>et(i)||e._dayOfYear===0)&&(T(e)._overflowDayOfYear=!0),n=nt(i,0,e._dayOfYear),e._a[be]=n.getUTCMonth(),e._a[_e]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[K]===24&&e._a[de]===0&&e._a[we]===0&&e._a[Re]===0&&(e._nextDay=!0,e._a[K]=0),e._d=(e._useUTC?nt:Wi).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[K]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(T(e).weekdayMismatch=!0)}}function Bl(e){var t,n,s,a,o,i,l,d,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,n=Fe(t.GG,e._a[X],st(W(),1,4).year),s=Fe(t.W,1),a=Fe(t.E,1),(a<1||a>7)&&(d=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=st(W(),o,i),n=Fe(t.gg,e._a[X],c.year),s=Fe(t.w,c.week),t.d!=null?(a=t.d,(a<0||a>6)&&(d=!0)):t.e!=null?(a=t.e+o,(t.e<0||t.e>6)&&(d=!0)):a=o),s<1||s>ve(n,o,i)?T(e)._overflowWeeks=!0:d!=null?T(e)._overflowWeekday=!0:(l=Fs(n,s,a,o,i),e._a[X]=l.year,e._dayOfYear=l.dayOfYear)}_.ISO_8601=function(){},_.RFC_2822=function(){};function On(e){if(e._f===_.ISO_8601){Ks(e);return}if(e._f===_.RFC_2822){Js(e);return}e._a=[],T(e).empty=!0;var t=""+e._i,n,s,a,o,i,l=t.length,d=0,c,f;for(a=Ds(e._f,e._locale).match(hn)||[],f=a.length,n=0;n<f;n++)o=a[n],s=(t.match(Ni(o,e))||[])[0],s&&(i=t.substr(0,t.indexOf(s)),i.length>0&&T(e).unusedInput.push(i),t=t.slice(t.indexOf(s)+s.length),d+=s.length),Ue[o]?(s?T(e).empty=!1:T(e).unusedTokens.push(o),Mi(o,s,e)):e._strict&&!s&&T(e).unusedTokens.push(o);T(e).charsLeftOver=l-d,t.length>0&&T(e).unusedInput.push(t),e._a[K]<=12&&T(e).bigHour===!0&&e._a[K]>0&&(T(e).bigHour=void 0),T(e).parsedDateParts=e._a.slice(0),T(e).meridiem=e._meridiem,e._a[K]=Vl(e._locale,e._a[K],e._meridiem),c=T(e).era,c!==null&&(e._a[X]=e._locale.erasConvertYear(c,e._a[X])),Sn(e),Cn(e)}function Vl(e,t,n){var s;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(s=e.isPM(n),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function Ll(e){var t,n,s,a,o,i,l=!1,d=e._f.length;if(d===0){T(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<d;a++)o=0,i=!1,t=ln({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[a],On(t),rn(t)&&(i=!0),o+=T(t).charsLeftOver,o+=T(t).unusedTokens.length*10,T(t).score=o,l?o<s&&(s=o,n=t):(s==null||o<s||i)&&(s=o,n=t,i&&(l=!0));Te(e,n||t)}function Al(e){if(!e._d){var t=pn(e._i),n=t.day===void 0?t.date:t.day;e._a=Ss([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),Sn(e)}}function Ul(e){var t=new Je(Cn(Xs(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Xs(e){var t=e._i,n=e._f;return e._locale=e._locale||Ne(e._l),t===null||n===void 0&&t===""?mt({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),le(t)?new Je(Cn(t)):(Ke(t)?e._d=t:ie(n)?Ll(e):n?On(e):$l(e),rn(e)||(e._d=null),e))}function $l(e){var t=e._i;ee(t)?e._d=new Date(_.now()):Ke(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Rl(e):ie(t)?(e._a=Ss(t.slice(0),function(n){return parseInt(n,10)}),Sn(e)):Ye(t)?Al(e):ge(t)?e._d=new Date(t):_.createFromInputFallback(e)}function Qs(e,t,n,s,a){var o={};return(t===!0||t===!1)&&(s=t,t=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(Ye(e)&&sn(e)||ie(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=n,o._i=e,o._f=t,o._strict=s,Ul(o)}function W(e,t,n,s){return Qs(e,t,n,s,!1)}var Wl=ae("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:mt()}),Hl=ae("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:mt()});function ea(e,t){var n,s;if(t.length===1&&ie(t[0])&&(t=t[0]),!t.length)return W();for(n=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][e](n))&&(n=t[s]);return n}function Fl(){var e=[].slice.call(arguments,0);return ea("isBefore",e)}function Gl(){var e=[].slice.call(arguments,0);return ea("isAfter",e)}var jl=function(){return Date.now?Date.now():+new Date},ot=["year","quarter","month","week","day","hour","minute","second","millisecond"];function zl(e){var t,n=!1,s,a=ot.length;for(t in e)if(P(e,t)&&!(Z.call(ot,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(s=0;s<a;++s)if(e[ot[s]]){if(n)return!1;parseFloat(e[ot[s]])!==x(e[ot[s]])&&(n=!0)}return!0}function Zl(){return this._isValid}function ql(){return ce(NaN)}function Et(e){var t=pn(e),n=t.year||0,s=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,i=t.day||0,l=t.hour||0,d=t.minute||0,c=t.second||0,f=t.millisecond||0;this._isValid=zl(t),this._milliseconds=+f+c*1e3+d*6e4+l*1e3*60*60,this._days=+i+o*7,this._months=+a+s*3+n*12,this._data={},this._locale=Ne(),this._bubble()}function Tt(e){return e instanceof Et}function En(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Kl(e,t,n){var s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0,i;for(i=0;i<s;i++)x(e[i])!==x(t[i])&&o++;return o+a}function ta(e,t){C(e,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+me(~~(n/60),2)+t+me(~~n%60,2)})}ta("Z",":"),ta("ZZ",""),y("Z",vt),y("ZZ",vt),L(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Tn(vt,e)});var Jl=/([\+\-]|\d\d)/gi;function Tn(e,t){var n=(t||"").match(e),s,a,o;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Jl)||["-",0,0],o=+(a[1]*60)+x(a[2]),o===0?0:a[0]==="+"?o:-o)}function In(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(le(e)||Ke(e)?e.valueOf():W(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),_.updateOffset(n,!1),n):W(e).local()}function Dn(e){return-Math.round(e._d.getTimezoneOffset())}_.updateOffset=function(){};function Xl(e,t,n){var s=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Tn(vt,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(a=Dn(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?ra(this,ce(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Dn(this)}function Ql(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ed(e){return this.utcOffset(0,e)}function td(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Dn(this),"m")),this}function nd(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Tn(wi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function sd(e){return this.isValid()?(e=e?W(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function ad(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function rd(){if(!ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ln(e,this),e=Xs(e),e._a?(t=e._isUTC?fe(e._a):W(e._a),this._isDSTShifted=this.isValid()&&Kl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function od(){return this.isValid()?!this._isUTC:!1}function id(){return this.isValid()?this._isUTC:!1}function na(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ld=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,dd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ce(e,t){var n=e,s=null,a,o,i;return Tt(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ge(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(s=ld.exec(e))?(a=s[1]==="-"?-1:1,n={y:0,d:x(s[_e])*a,h:x(s[K])*a,m:x(s[de])*a,s:x(s[we])*a,ms:x(En(s[Re]*1e3))*a}):(s=dd.exec(e))?(a=s[1]==="-"?-1:1,n={y:Pe(s[2],a),M:Pe(s[3],a),w:Pe(s[4],a),d:Pe(s[5],a),h:Pe(s[6],a),m:Pe(s[7],a),s:Pe(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=cd(W(n.from),W(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),o=new Et(n),Tt(e)&&P(e,"_locale")&&(o._locale=e._locale),Tt(e)&&P(e,"_isValid")&&(o._isValid=e._isValid),o}ce.fn=Et.prototype,ce.invalid=ql;function Pe(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function sa(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function cd(e,t){var n;return e.isValid()&&t.isValid()?(t=In(t,e),e.isBefore(t)?n=sa(e,t):(n=sa(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function aa(e,t){return function(n,s){var a,o;return s!==null&&!isNaN(+s)&&(Is(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=s,s=o),a=ce(n,s),ra(this,a,e),this}}function ra(e,t,n,s){var a=t._milliseconds,o=En(t._days),i=En(t._months);e.isValid()&&(s=s??!0,i&&$s(e,tt(e,"Month")+i*n),o&&Ls(e,"Date",tt(e,"Date")+o*n),a&&e._d.setTime(e._d.valueOf()+a*n),s&&_.updateOffset(e,o||i))}var ud=aa(1,"add"),hd=aa(-1,"subtract");function oa(e){return typeof e=="string"||e instanceof String}function fd(e){return le(e)||Ke(e)||oa(e)||ge(e)||md(e)||pd(e)||e===null||e===void 0}function pd(e){var t=Ye(e)&&!sn(e),n=!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"],a,o,i=s.length;for(a=0;a<i;a+=1)o=s[a],n=n||P(e,o);return t&&n}function md(e){var t=ie(e),n=!1;return t&&(n=e.filter(function(s){return!ge(s)&&oa(e)}).length===0),t&&n}function _d(e){var t=Ye(e)&&!sn(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,o;for(a=0;a<s.length;a+=1)o=s[a],n=n||P(e,o);return t&&n}function yd(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function gd(e,t){arguments.length===1&&(arguments[0]?fd(arguments[0])?(e=arguments[0],t=void 0):_d(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||W(),s=In(n,this).startOf("day"),a=_.calendarFormat(this,s)||"sameElse",o=t&&(pe(t[a])?t[a].call(this,n):t[a]);return this.format(o||this.localeData().calendar(a,this,W(n)))}function kd(){return new Je(this)}function bd(e,t){var n=le(e)?e:W(e);return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function wd(e,t){var n=le(e)?e:W(e);return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function vd(e,t,n,s){var a=le(e)?e:W(e),o=le(t)?t:W(t);return this.isValid()&&a.isValid()&&o.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(a,n):!this.isBefore(a,n))&&(s[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function Nd(e,t){var n=le(e)?e:W(e),s;return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function Cd(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Md(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Sd(e,t,n){var s,a,o;if(!this.isValid())return NaN;if(s=In(e,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,t=re(t),t){case"year":o=It(this,s)/12;break;case"month":o=It(this,s);break;case"quarter":o=It(this,s)/3;break;case"second":o=(this-s)/1e3;break;case"minute":o=(this-s)/6e4;break;case"hour":o=(this-s)/36e5;break;case"day":o=(this-s-a)/864e5;break;case"week":o=(this-s-a)/6048e5;break;default:o=this-s}return n?o:oe(o)}function It(e,t){if(e.date()<t.date())return-It(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),s=e.clone().add(n,"months"),a,o;return t-s<0?(a=e.clone().add(n-1,"months"),o=(t-s)/(s-a)):(a=e.clone().add(n+1,"months"),o=(t-s)/(a-s)),-(n+o)||0}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Od(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ed(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?yt(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):pe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",yt(n,"Z")):yt(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Td(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,s,a,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+s+a+o)}function Id(e){e||(e=this.isUtc()?_.defaultFormatUtc:_.defaultFormat);var t=yt(this,e);return this.localeData().postformat(t)}function Dd(e,t){return this.isValid()&&(le(e)&&e.isValid()||W(e).isValid())?ce({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function xd(e){return this.from(W(),e)}function Yd(e,t){return this.isValid()&&(le(e)&&e.isValid()||W(e).isValid())?ce({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Rd(e){return this.to(W(),e)}function ia(e){var t;return e===void 0?this._locale._abbr:(t=Ne(e),t!=null&&(this._locale=t),this)}var la=ae("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function da(){return this._locale}var Dt=1e3,Ge=60*Dt,xt=60*Ge,ca=(365*400+97)*24*xt;function je(e,t){return(e%t+t)%t}function ua(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ca:new Date(e,t,n).valueOf()}function ha(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ca:Date.UTC(e,t,n)}function Pd(e){var t,n;if(e=re(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ha:ua,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=je(t+(this._isUTC?0:this.utcOffset()*Ge),xt);break;case"minute":t=this._d.valueOf(),t-=je(t,Ge);break;case"second":t=this._d.valueOf(),t-=je(t,Dt);break}return this._d.setTime(t),_.updateOffset(this,!0),this}function Bd(e){var t,n;if(e=re(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ha:ua,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=xt-je(t+(this._isUTC?0:this.utcOffset()*Ge),xt)-1;break;case"minute":t=this._d.valueOf(),t+=Ge-je(t,Ge)-1;break;case"second":t=this._d.valueOf(),t+=Dt-je(t,Dt)-1;break}return this._d.setTime(t),_.updateOffset(this,!0),this}function Vd(){return this._d.valueOf()-(this._offset||0)*6e4}function Ld(){return Math.floor(this.valueOf()/1e3)}function Ad(){return new Date(this.valueOf())}function Ud(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function $d(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Wd(){return this.isValid()?this.toISOString():null}function Hd(){return rn(this)}function Fd(){return Te({},T(this))}function Gd(){return T(this).overflow}function jd(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),y("N",xn),y("NN",xn),y("NNN",xn),y("NNNN",sc),y("NNNNN",ac),L(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var a=n._locale.erasParse(e,s,n._strict);a?T(n).era=a:T(n).invalidEra=e}),y("y",$e),y("yy",$e),y("yyy",$e),y("yyyy",$e),y("yo",rc),L(["y","yy","yyy","yyyy"],X),L(["yo"],function(e,t,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[X]=n._locale.eraYearOrdinalParse(e,a):t[X]=parseInt(e,10)});function zd(e,t){var n,s,a,o=this._eras||Ne("en")._eras;for(n=0,s=o.length;n<s;++n)switch(typeof o[n].since==="string"&&(a=_(o[n].since).startOf("day"),o[n].since=a.valueOf()),typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":a=_(o[n].until).startOf("day").valueOf(),o[n].until=a.valueOf();break}return o}function Zd(e,t,n){var s,a,o=this.eras(),i,l,d;for(e=e.toUpperCase(),s=0,a=o.length;s<a;++s)if(i=o[s].name.toUpperCase(),l=o[s].abbr.toUpperCase(),d=o[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(l===e)return o[s];break;case"NNNN":if(i===e)return o[s];break;case"NNNNN":if(d===e)return o[s];break}else if([i,l,d].indexOf(e)>=0)return o[s]}function qd(e,t){var n=e.since<=e.until?1:-1;return t===void 0?_(e.since).year():_(e.since).year()+(t-e.offset)*n}function Kd(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].name;return""}function Jd(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].narrow;return""}function Xd(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].abbr;return""}function Qd(){var e,t,n,s,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return(this.year()-_(a[e].since).year())*n+a[e].offset;return this.year()}function ec(e){return P(this,"_erasNameRegex")||Yn.call(this),e?this._erasNameRegex:this._erasRegex}function tc(e){return P(this,"_erasAbbrRegex")||Yn.call(this),e?this._erasAbbrRegex:this._erasRegex}function nc(e){return P(this,"_erasNarrowRegex")||Yn.call(this),e?this._erasNarrowRegex:this._erasRegex}function xn(e,t){return t.erasAbbrRegex(e)}function sc(e,t){return t.erasNameRegex(e)}function ac(e,t){return t.erasNarrowRegex(e)}function rc(e,t){return t._eraYearOrdinalRegex||$e}function Yn(){var e=[],t=[],n=[],s=[],a,o,i,l,d,c=this.eras();for(a=0,o=c.length;a<o;++a)i=ke(c[a].name),l=ke(c[a].abbr),d=ke(c[a].narrow),t.push(i),e.push(l),n.push(d),s.push(i),s.push(l),s.push(d);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Yt(e,t){C(0,[e,e.length],0,t)}Yt("gggg","weekYear"),Yt("ggggg","weekYear"),Yt("GGGG","isoWeekYear"),Yt("GGGGG","isoWeekYear"),y("G",wt),y("g",wt),y("GG",$,ne),y("gg",$,ne),y("GGGG",_n,mn),y("gggg",_n,mn),y("GGGGG",bt,gt),y("ggggg",bt,gt),Qe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=x(e)}),Qe(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)});function oc(e){return fa.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function ic(e){return fa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function lc(){return ve(this.year(),1,4)}function dc(){return ve(this.isoWeekYear(),1,4)}function cc(){var e=this.localeData()._week;return ve(this.year(),e.dow,e.doy)}function uc(){var e=this.localeData()._week;return ve(this.weekYear(),e.dow,e.doy)}function fa(e,t,n,s,a){var o;return e==null?st(this,s,a).year:(o=ve(e,s,a),t>o&&(t=o),hc.call(this,e,t,n,s,a))}function hc(e,t,n,s,a){var o=Fs(e,t,n,s,a),i=nt(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}C("Q",0,"Qo","quarter"),y("Q",Ys),L("Q",function(e,t){t[be]=(x(e)-1)*3});function fc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}C("D",["DD",2],"Do","date"),y("D",$,We),y("DD",$,ne),y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),L(["D","DD"],_e),L("Do",function(e,t){t[_e]=x(e.match($)[0])});var pa=He("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),y("DDD",kt),y("DDDD",Rs),L(["DDD","DDDD"],function(e,t,n){n._dayOfYear=x(e)});function pc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}C("m",["mm",2],0,"minute"),y("m",$,yn),y("mm",$,ne),L(["m","mm"],de);var mc=He("Minutes",!1);C("s",["ss",2],0,"second"),y("s",$,yn),y("ss",$,ne),L(["s","ss"],we);var _c=He("Seconds",!1);C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return this.millisecond()*10}),C(0,["SSSSS",5],0,function(){return this.millisecond()*100}),C(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),C(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),C(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),C(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),y("S",kt,Ys),y("SS",kt,ne),y("SSS",kt,Rs);var De,ma;for(De="SSSS";De.length<=9;De+="S")y(De,$e);function yc(e,t){t[Re]=x(("0."+e)*1e3)}for(De="S";De.length<=9;De+="S")L(De,yc);ma=He("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");function gc(){return this._isUTC?"UTC":""}function kc(){return this._isUTC?"Coordinated Universal Time":""}var u=Je.prototype;u.add=ud,u.calendar=gd,u.clone=kd,u.diff=Sd,u.endOf=Bd,u.format=Id,u.from=Dd,u.fromNow=xd,u.to=Yd,u.toNow=Rd,u.get=Ti,u.invalidAt=Gd,u.isAfter=bd,u.isBefore=wd,u.isBetween=vd,u.isSame=Nd,u.isSameOrAfter=Cd,u.isSameOrBefore=Md,u.isValid=Hd,u.lang=la,u.locale=ia,u.localeData=da,u.max=Hl,u.min=Wl,u.parsingFlags=Fd,u.set=Ii,u.startOf=Pd,u.subtract=hd,u.toArray=Ud,u.toObject=$d,u.toDate=Ad,u.toISOString=Ed,u.inspect=Td,typeof Symbol<"u"&&Symbol.for!=null&&(u[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),u.toJSON=Wd,u.toString=Od,u.unix=Ld,u.valueOf=Vd,u.creationData=jd,u.eraName=Kd,u.eraNarrow=Jd,u.eraAbbr=Xd,u.eraYear=Qd,u.year=Vs,u.isLeapYear=Ei,u.weekYear=oc,u.isoWeekYear=ic,u.quarter=u.quarters=fc,u.month=Ws,u.daysInMonth=Ai,u.week=u.weeks=zi,u.isoWeek=u.isoWeeks=Zi,u.weeksInYear=cc,u.weeksInWeekYear=uc,u.isoWeeksInYear=lc,u.isoWeeksInISOWeekYear=dc,u.date=pa,u.day=u.days=il,u.weekday=ll,u.isoWeekday=dl,u.dayOfYear=pc,u.hour=u.hours=_l,u.minute=u.minutes=mc,u.second=u.seconds=_c,u.millisecond=u.milliseconds=ma,u.utcOffset=Xl,u.utc=ed,u.local=td,u.parseZone=nd,u.hasAlignedHourOffset=sd,u.isDST=ad,u.isLocal=od,u.isUtcOffset=id,u.isUtc=na,u.isUTC=na,u.zoneAbbr=gc,u.zoneName=kc,u.dates=ae("dates accessor is deprecated. Use date instead.",pa),u.months=ae("months accessor is deprecated. Use month instead",Ws),u.years=ae("years accessor is deprecated. Use year instead",Vs),u.zone=ae("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ql),u.isDSTShifted=ae("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rd);function bc(e){return W(e*1e3)}function wc(){return W.apply(null,arguments).parseZone()}function _a(e){return e}var B=cn.prototype;B.calendar=oi,B.longDateFormat=ci,B.invalidDate=hi,B.ordinal=mi,B.preparse=_a,B.postformat=_a,B.relativeTime=yi,B.pastFuture=gi,B.set=ai,B.eras=zd,B.erasParse=Zd,B.erasConvertYear=qd,B.erasAbbrRegex=tc,B.erasNameRegex=ec,B.erasNarrowRegex=nc,B.months=Pi,B.monthsShort=Bi,B.monthsParse=Li,B.monthsRegex=$i,B.monthsShortRegex=Ui,B.week=Hi,B.firstDayOfYear=ji,B.firstDayOfWeek=Gi,B.weekdays=nl,B.weekdaysMin=al,B.weekdaysShort=sl,B.weekdaysParse=ol,B.weekdaysRegex=cl,B.weekdaysShortRegex=ul,B.weekdaysMinRegex=hl,B.isPM=pl,B.meridiem=yl;function Rt(e,t,n,s){var a=Ne(),o=fe().set(s,t);return a[n](o,e)}function ya(e,t,n){if(ge(e)&&(t=e,e=void 0),e=e||"",t!=null)return Rt(e,t,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Rt(e,s,n,"month");return a}function Rn(e,t,n,s){typeof e=="boolean"?(ge(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ge(t)&&(n=t,t=void 0),t=t||"");var a=Ne(),o=e?a._week.dow:0,i,l=[];if(n!=null)return Rt(t,(n+o)%7,s,"day");for(i=0;i<7;i++)l[i]=Rt(t,(i+o)%7,s,"day");return l}function vc(e,t){return ya(e,t,"months")}function Nc(e,t){return ya(e,t,"monthsShort")}function Cc(e,t,n){return Rn(e,t,n,"weekdays")}function Mc(e,t,n){return Rn(e,t,n,"weekdaysShort")}function Sc(e,t,n){return Rn(e,t,n,"weekdaysMin")}Ie("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(e){var t=e%10,n=x(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),_.lang=ae("moment.lang is deprecated. Use moment.locale instead.",Ie),_.langData=ae("moment.langData is deprecated. Use moment.localeData instead.",Ne);var Ce=Math.abs;function Oc(){var e=this._data;return this._milliseconds=Ce(this._milliseconds),this._days=Ce(this._days),this._months=Ce(this._months),e.milliseconds=Ce(e.milliseconds),e.seconds=Ce(e.seconds),e.minutes=Ce(e.minutes),e.hours=Ce(e.hours),e.months=Ce(e.months),e.years=Ce(e.years),this}function ga(e,t,n,s){var a=ce(t,n);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function Ec(e,t){return ga(this,e,t,1)}function Tc(e,t){return ga(this,e,t,-1)}function ka(e){return e<0?Math.floor(e):Math.ceil(e)}function Ic(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,a,o,i,l,d;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ka(Pn(n)+t)*864e5,t=0,n=0),s.milliseconds=e%1e3,a=oe(e/1e3),s.seconds=a%60,o=oe(a/60),s.minutes=o%60,i=oe(o/60),s.hours=i%24,t+=oe(i/24),d=oe(ba(t)),n+=d,t-=ka(Pn(d)),l=oe(n/12),n%=12,s.days=t,s.months=n,s.years=l,this}function ba(e){return e*4800/146097}function Pn(e){return e*146097/4800}function Dc(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(e=re(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,n=this._months+ba(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function Me(e){return function(){return this.as(e)}}var wa=Me("ms"),xc=Me("s"),Yc=Me("m"),Rc=Me("h"),Pc=Me("d"),Bc=Me("w"),Vc=Me("M"),Lc=Me("Q"),Ac=Me("y"),Uc=wa;function $c(){return ce(this)}function Wc(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Be(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hc=Be("milliseconds"),Fc=Be("seconds"),Gc=Be("minutes"),jc=Be("hours"),zc=Be("days"),Zc=Be("months"),qc=Be("years");function Kc(){return oe(this.days()/7)}var Se=Math.round,ze={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jc(e,t,n,s,a){return a.relativeTime(t||1,!!n,e,s)}function Xc(e,t,n,s){var a=ce(e).abs(),o=Se(a.as("s")),i=Se(a.as("m")),l=Se(a.as("h")),d=Se(a.as("d")),c=Se(a.as("M")),f=Se(a.as("w")),w=Se(a.as("y")),m=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||i<=1&&["m"]||i<n.m&&["mm",i]||l<=1&&["h"]||l<n.h&&["hh",l]||d<=1&&["d"]||d<n.d&&["dd",d];return n.w!=null&&(m=m||f<=1&&["w"]||f<n.w&&["ww",f]),m=m||c<=1&&["M"]||c<n.M&&["MM",c]||w<=1&&["y"]||["yy",w],m[2]=t,m[3]=+e>0,m[4]=s,Jc.apply(null,m)}function Qc(e){return e===void 0?Se:typeof e=="function"?(Se=e,!0):!1}function eu(e,t){return ze[e]===void 0?!1:t===void 0?ze[e]:(ze[e]=t,e==="s"&&(ze.ss=t-1),!0)}function tu(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=ze,a,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(s=Object.assign({},ze,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),o=Xc(this,!n,s,a),n&&(o=a.pastFuture(+this,o)),a.postformat(o)}var Bn=Math.abs;function Ze(e){return(e>0)-(e<0)||+e}function Pt(){if(!this.isValid())return this.localeData().invalidDate();var e=Bn(this._milliseconds)/1e3,t=Bn(this._days),n=Bn(this._months),s,a,o,i,l=this.asSeconds(),d,c,f,w;return l?(s=oe(e/60),a=oe(s/60),e%=60,s%=60,o=oe(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",d=l<0?"-":"",c=Ze(this._months)!==Ze(l)?"-":"",f=Ze(this._days)!==Ze(l)?"-":"",w=Ze(this._milliseconds)!==Ze(l)?"-":"",d+"P"+(o?c+o+"Y":"")+(n?c+n+"M":"")+(t?f+t+"D":"")+(a||s||e?"T":"")+(a?w+a+"H":"")+(s?w+s+"M":"")+(e?w+i+"S":"")):"P0D"}var Y=Et.prototype;Y.isValid=Zl,Y.abs=Oc,Y.add=Ec,Y.subtract=Tc,Y.as=Dc,Y.asMilliseconds=wa,Y.asSeconds=xc,Y.asMinutes=Yc,Y.asHours=Rc,Y.asDays=Pc,Y.asWeeks=Bc,Y.asMonths=Vc,Y.asQuarters=Lc,Y.asYears=Ac,Y.valueOf=Uc,Y._bubble=Ic,Y.clone=$c,Y.get=Wc,Y.milliseconds=Hc,Y.seconds=Fc,Y.minutes=Gc,Y.hours=jc,Y.days=zc,Y.weeks=Kc,Y.months=Zc,Y.years=qc,Y.humanize=tu,Y.toISOString=Pt,Y.toString=Pt,Y.toJSON=Pt,Y.locale=ia,Y.localeData=da,Y.toIsoString=ae("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Pt),Y.lang=la,C("X",0,0,"unix"),C("x",0,0,"valueOf"),y("x",wt),y("X",vi),L("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),L("x",function(e,t,n){n._d=new Date(x(e))});_.version="2.30.1",ni(W),_.fn=u,_.min=Fl,_.max=Gl,_.now=jl,_.utc=fe,_.unix=bc,_.months=vc,_.isDate=Ke,_.locale=Ie,_.invalid=mt,_.duration=ce,_.isMoment=le,_.weekdays=Cc,_.parseZone=wc,_.localeData=Ne,_.isDuration=Tt,_.monthsShort=Nc,_.weekdaysMin=Sc,_.defineLocale=Nn,_.updateLocale=wl,_.locales=vl,_.weekdaysShort=Mc,_.normalizeUnits=re,_.relativeTimeRounding=Qc,_.relativeTimeThreshold=eu,_.calendarFormat=yd,_.prototype=u,_.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 nu="code-graph",su=(e,t="",n="json")=>{const s=document.createElement("a");s.setAttribute("href",`data:text/${n};charset=UTF-8,${encodeURIComponent(e)}`);const a=_().format("YYMMDD_HHMMSS");s.setAttribute("download",`${nu}_${a}_${t}.${n}`),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},au=(e="json")=>{const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("id","fileElem"),t.setAttribute("multiple","true"),t.setAttribute("accept",`${e}/*`),t.style.display="none",document.body.appendChild(t),t.click(),t},Vn="CLEAR_ALL",Ln="DOWNLOAD_EDITOR_STATE",va="RUN_ENGINE",An="TOGGLE_MINIMAP",Un="TOGGLE_PALETTE",$n="UPLOAD_EDITOR_STATE",Na=(e,t,n)=>{const s=n.zoomToFit.paddingLeft;t.registerCommand(Vn,{execute:()=>{t.executeCommand(S.Commands.CLEAR_CLIPBOARD_COMMAND),t.executeCommand(S.Commands.CLEAR_HISTORY_COMMAND),e.value.clear(),e.value.editor.code.clear()},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(Ln,{execute:()=>{const a=e.value.editor.save();su(JSON.stringify(a,null,2),e.value.shortId)},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(An,{execute:()=>n.enableMinimap=!n.enableMinimap,canExecute:()=>e.value.nodes.length>1}),t.registerCommand(Un,{execute:()=>{n.palette.enabled=!n.palette.enabled,n.zoomToFit.paddingLeft=n.palette.enabled?s:50},canExecute:()=>!0}),t.registerCommand($n,{execute:()=>{const a=au();a.addEventListener("change",()=>{document.body.removeChild(a);const o=a.files;if(!o||o.length<=0)return!1;const i=new FileReader;i.onload=l=>{if(l.target?.result){const d=l.target.result;if(d.length===0)return;const c=JSON.parse(d);e.value.editor.load(c),e.value.code?.engine?.runOnce(null)}},i.readAsText(o.item(0))})},canExecute:()=>!0})},Ca=e=>{const t={command:Vn,title:"Clear all",icon:r.computed(()=>rs)},n={command:Ln,title:"Download editor state",icon:r.computed(()=>ns)},s={command:An,title:"Toggle minimap",icon:r.computed(()=>e.enableMinimap?is:os)},a={command:Un,title:"Toggle palette",icon:r.computed(()=>e.palette.enabled?ss:$t)},o={command:$n,title:"Upload editor state",icon:r.computed(()=>ds)};e.toolbar.commands=[a,t,o,n,...S.DEFAULT_TOOLBAR_COMMANDS,s]},Ma=(e,t,n)=>{n.registerCommand(va,{execute:()=>t.runOnce(null),canExecute:()=>e.nodes.length>0})};function Sa(e){const t=Symbol("CodeEngineToken");e.engine=new Cs(e.editor),Ma(e.editor.graph,e.engine,e.commandHandler),e.loadEditor=n=>{e.engine?.pause(),e.displayedGraph.clear(),e.editor.load(n),e.commandHandler.executeCommand(S.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(S.Commands.CLEAR_HISTORY_COMMAND),e.engine?.resume(),e.engine?.runOnce(null)},e.newGraph=()=>{e.engine?.pause(),e.displayedGraph.clear(),e.commandHandler.executeCommand(S.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(S.Commands.CLEAR_HISTORY_COMMAND),e.displayedGraph.id=xe.v4(),e.engine?.resume(),e.engine?.runOnce(null)},e.subscribe=()=>{e.displayedGraph.nodeEvents.titleChanged.subscribe(t,()=>{e.engine?.runOnce(null)}),e.displayedGraph.events.addConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onConnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onConnected()}),e.displayedGraph.events.removeConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onUnconnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onUnconnected()}),e.engine?.events.beforeRun.subscribe(t,()=>{e.displayedGraph.onUpdate(),e.engine?.pause(),e.displayedGraph.sortNodes(),e.engine?.resume()}),e.engine?.events.afterRun.subscribe(t,n=>{e.engine?.pause(),he.applyResult(n,e.editor),e.code.state.lockCode||e.code.renderCode({nodes:e.editor.graph.scriptedCodeNodes,modules:e.editor.code.modules}),e.engine?.resume()})},e.unsubscribe=()=>{e.displayedGraph.events.addConnection.unsubscribe(t),e.displayedGraph.events.removeConnection.unsubscribe(t),e.engine?.events.beforeRun.unsubscribe(t),e.engine?.events.afterRun.unsubscribe(t)}}const Bt=350;class it extends q.Graph{code=null;editor;_state=r.reactive({codeTemplate:"{{ #nodes }}{{ script }}{{ /nodes }}",lockCode:!1});constructor(t,n){super(t,n),this.editor=t,this.template=n,t.code&&(this.code=t.code)}get codeNodes(){return Wn(this)}get connections(){return super.connections}set connections(t){this._connections=t}get nodeIds(){return this.nodes.map(t=>t.id)}get nodes(){return super.nodes}set nodes(t){this._nodes=t}get scriptedCodeNodes(){return this.nodes.filter(t=>!t.state?.integrated)}get selectedNodeIds(){return this.selectedNodes.map(t=>t.id)}get shortId(){return this.id.slice(0,6)}get state(){return this._state}get visibleNodes(){return this.nodes.filter(t=>!t.state?.hidden)}addNode(t,n){return t.state&&n&&(t.state.props=n),super.addNode(t)}addNodeAtCoordinates=(t,n={x:0,y:0},s)=>(this.addNode(t,s),t.position&&(t.position=n),t);addConnection(t,n){t&&t?.name!=="_code"&&(t.hidden=!1),n&&n?.name!=="_code"&&(n.hidden=!1),super.addConnection(t,n)}clear(){this.selectedNodes=[],this._nodes=[],this._connections=[]}findNodeByType(t){return this.nodes.find(n=>n.type===t)}getNodesByType(t){return this.nodes.filter(n=>n.type===t)}getNodesByVariableName(t){return this.nodes.filter(n=>[n.state.variableName,n._variableName].includes(t))}hasConnection(t,n){return this.connections.some(s=>s.from.id===t.id&&s.to.id===n.id)}load(t){const n=super.load(t);return this.nodes.forEach(s=>s.afterGraphLoaded()),n}onUpdate(){this.nodes.forEach(t=>t.onGraphUpdate())}renderCode(t){return Le.render(this.state?.codeTemplate||"",t)}sortNodes(){if(!(this.nodes.length===0||this.connections.length===0))try{let t=this.nodeIds;const n=this.connections.filter(o=>t.includes(o.to.nodeId)&&t.includes(o.from.nodeId)).map(o=>[o.to.nodeId,o.from.nodeId]);t.reverse(),t=Ra.array(t,n),t.reverse();const s=this.nodes.map(o=>o.id).filter(o=>!t.includes(o));t=[...t,...s];const a=t.map(o=>this.findNodeById(o));a&&(this.nodes=a)}catch{console.warn("Failed to sort nodes.")}}}const Wn=e=>{const t=[];return e.nodes.length===0||e.nodes.forEach(n=>{n&&(n.hasOwnProperty("subgraph")?t.push(...Wn(n.subgraph)):n.hasOwnProperty("isCodeNode")&&t.push(n))}),t},ru=(e=0,t=100)=>({x:e*(Bt+70),y:t}),ou=e=>{const t={...e.position};return t.x-=Bt+70,t.y+=50,t},Hn="__baklava_SubgraphInputNode",Fn="__baklava_SubgraphOutputNode";class Oa extends ht{graphInterfaceId;constructor(){super(),this.graphInterfaceId=xe.v4()}onPlaced(){super.onPlaced(),this.initializeIo()}load(t){super.load(t),this.graphInterfaceId=t.graphInterfaceId}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}update(){}}class Gn extends Oa{static isGraphInputNode(t){return t.type===Hn}type=Hn;inputs={name:new q.NodeInterface("Name","Input")};outputs={placeholder:new q.NodeInterface("Value",void 0)}}class jn extends Oa{static isGraphOutputNode(t){return t.type===Fn}type=Fn;inputs={name:new q.NodeInterface("Name","Output"),placeholder:new q.NodeInterface("Value",void 0)};outputs={output:new q.NodeInterface("Output",void 0).setHidden(!0)};calculate=({placeholder:t})=>({output:t})}const iu=["component","connectionCount","events","hidden","hooks","id","isCodeNode","isInput","name","nodeId","port","templateId","value"];function Ea(e){return class extends zt{type=q.getGraphNodeTypeString(e);get title(){return this._title}set title(n){this.template.name=n}inputs={};outputs={};template=e;subgraph;update(){}onConnected(){}onUnconnected(){}calculate=async(n,s)=>{if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const a=s.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)a.set(l.nodeInterfaceId,n[l.id]);const o=await s.engine.runGraph(this.subgraph,a,s.globalValues);s.engine.pause(),he.applyResult(o,s.engine.editor),s.engine.resume();const i={};for(const l of this.subgraph.outputs)i[l.id]=o.get(l.nodeId)?.get("output");return i._calculationResults=o,this.lockCode||(i._code=this.renderCode({inputs:n,...s.globalValues})),this.updateOutputValues(i),i};load(n){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(n.graphState),super.load(n)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,n=>{this._title=n}),this.initialize()}onDestroy(){this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),this.subgraph?.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.state.codeTemplate=`{{ #nodes }}{{ script }}
7
7
  {{ /nodes }}`,this.events.update.emit(null)}renderCode(n){return this.subgraph?this.subgraph.renderCode({nodes:this.subgraph.scriptedCodeNodes}):Le.render(this.state.codeTemplate,n)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const n of this.subgraph.inputs)n.id in this.inputs?this.inputs[n.id].name=n.name:this.addInput(n.id,this.createProxyInterface(n,!0));for(const n of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===n)||this.removeInput(n);for(const n of this.subgraph.outputs)n.id in this.outputs?this.outputs[n.id].name=n.name:this.addOutput(n.id,this.createProxyInterface(n,!1));for(const n of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===n)||this.removeOutput(n);this.addInput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.addOutput("_calculationResults",new q.NodeInterface("_calculationResults",void 0).setHidden(!0))}createProxyInterface(n,s){const a=new Q(n.name,void 0);return new Proxy(a,{get:(o,i)=>{if(iu.includes(i)||i in o||typeof i=="string"&&i.startsWith("__v_"))return Reflect.get(o,i);let l;s?l=this.subgraph?.nodes.find(w=>Gn.isGraphInputNode(w)&&w.graphInterfaceId===n.id)?.outputs.placeholder.id:l=this.subgraph?.nodes.find(w=>jn.isGraphOutputNode(w)&&w.graphInterfaceId===n.id)?.inputs.placeholder.id;const d=this.subgraph?.connections.find(f=>l===(s?f.from:f.to)?.id),c=s?d?.to:d?.from;if(c)return Reflect.get(c,i)}})}}}class lt extends q.GraphTemplate{static fromGraph(t,n){return new lt(t.save(),n)}constructor(t,n){super(t,n)}get shortId(){return this.id.slice(0,6)}createGraph(t){const n=new Map,s=m=>{const D=xe.v4();return n.set(m,D),D},a=m=>{const D=n.get(m);if(!D)throw new Error(`Unable to create graph from template: Could not map old id ${m} to new id`);return D},o=m=>Oo(m,D=>({id:s(D.id),templateId:D.id,value:D.value})),i=this.nodes.map(m=>({...m,id:s(m.id),inputs:o(m.inputs),outputs:o(m.outputs)})),l=this.connections.map(m=>({id:s(m.id),from:a(m.from),to:a(m.to)})),d=this.inputs.map(m=>({id:m.id,name:m.name,nodeId:a(m.nodeId),nodeInterfaceId:a(m.nodeInterfaceId)})),c=this.outputs.map(m=>({id:m.id,name:m.name,nodeId:a(m.nodeId),nodeInterfaceId:a(m.nodeInterfaceId)})),f={id:xe.v4(),nodes:i,connections:l,inputs:d,outputs:c};return t||(t=new it(this.editor)),t.load(f).forEach(m=>console.warn(m)),t.template=this,t}}const lu=e=>!(e instanceof it);function Ta(e,t){return{switchGraph:s=>{let a;if(lu(s))a=new it(e.value),s.createGraph(a);else{if(s!==e.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");a=s}t.value&&t.value!==e.value.graph&&t.value.destroy(),a.panning=a.panning??s.panning??{x:0,y:0},a.scaling=a.scaling??s.scaling??1,a.selectedNodes=a.selectedNodes??[],a.sidebar=a.sidebar??{visible:!1,nodeId:"",optionName:""},t.value=a,a.code?.engine?.runOnce(null)}}}class zn extends Gn{_title="Subgraph Input";inputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),name:new S.TextInputInterface("Name","Input").setPort(!1)};outputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),placeholder:new q.NodeInterface("Connection",void 0)}}class Zn extends jn{_title="Subgraph Output";inputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),name:new S.TextInputInterface("Name","Output").setPort(!1),placeholder:new q.NodeInterface("Connection",void 0)};outputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),output:new q.NodeInterface("Output",void 0).setHidden(!0)}}const Ia="CREATE_SUBGRAPH",Da=[q.GRAPH_INPUT_NODE_TYPE,q.GRAPH_OUTPUT_NODE_TYPE];function xa(e,t,n){const s=()=>e.value.selectedNodes.filter(o=>!Da.includes(o.type)).length>0,a=()=>{const{viewModel:o}=S.useViewModel(),i=e.value,l=e.value.editor;if(i.selectedNodes.length===0)return;const d=i.selectedNodes.filter(O=>!Da.includes(O.type)),c=d.flatMap(O=>Object.values(O.inputs)),f=d.flatMap(O=>Object.values(O.outputs)),w=i.connections.filter(O=>!f.includes(O.from)&&c.includes(O.to)),m=i.connections.filter(O=>f.includes(O.from)&&!c.includes(O.to)),D=i.connections.filter(O=>f.includes(O.from)&&c.includes(O.to)),g=d.map(O=>O.save()),M=D.map(O=>({id:O.id,from:O.from.id,to:O.to.id})),h=new Map,{xLeft:k,xRight:A,yTop:V}=du(d);for(const[O,J]of w.entries()){const te=new zn;te.inputs.name.value=J.to.name,g.push({...te.save(),position:{x:A-o.value.settings.nodes.defaultWidth-100,y:V+O*200}}),M.push({id:xe.v4(),from:te.outputs.placeholder.id,to:J.to.id}),h.set(J.to.id,te.graphInterfaceId)}for(const[O,J]of m.entries()){const te=new Zn;te.inputs.name.value=J.from.name,g.push({...te.save(),position:{x:k+100,y:V+O*200}}),M.push({id:xe.v4(),from:J.from.id,to:te.inputs.placeholder.id}),h.set(J.from.id,te.graphInterfaceId)}const H=r.reactive(new lt({connections:M,nodes:g,inputs:[],outputs:[]},l));l.addGraphTemplate(H);const Oe=l.nodeTypes.get(q.getGraphNodeTypeString(H));if(!Oe)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");i.activeTransactions++;const Ee=r.reactive(new Oe.type);i.addNode(Ee);const dt=Math.round(d.map(O=>O.position.x).reduce((O,J)=>O+J,0)/d.length),ye=Math.round(d.map(O=>O.position.y).reduce((O,J)=>O+J,0)/d.length);Ee.position.x=dt,Ee.position.y=ye,w.forEach(O=>{i.removeConnection(O),i.addConnection(O.from,Ee.inputs[h.get(O.to.id)])}),m.forEach(O=>{i.removeConnection(O),i.addConnection(Ee.outputs[h.get(O.from.id)],O.to)}),d.forEach(O=>i.removeNode(O)),i.activeTransactions--,t.canExecuteCommand(S.Commands.SAVE_SUBGRAPH_COMMAND)&&t.executeCommand(S.Commands.SAVE_SUBGRAPH_COMMAND),n(H),e.value.panning={...i.panning},e.value.scaling=i.scaling};t.registerCommand(Ia,{canExecute:s,execute:a})}function du(e){const t=e.reduce((a,o)=>{const i=o.position.x;return i<a?i:a},1/0),n=e.reduce((a,o)=>{const i=o.position.y;return i<a?i:a},1/0);return{xLeft:e.reduce((a,o)=>{const i=o.position.x+o.width;return i>a?i:a},-1/0),xRight:t,yTop:n}}class cu extends q.Editor{code;graph;constructor(t){super(),this.code=t,this.graph=new it(this)}get graphIds(){const t=[];return this.graphs.forEach(n=>t.push(n.id)),t.map(n=>n.slice(0,6)).join(", ")}get graphTemplateIds(){const t=[];return this.graphTemplates.forEach(n=>t.push(n.id)),t.map(n=>n.slice(0,6)).join(", ")}addGraphTemplate(t){if(this.events.beforeAddGraphTemplate.emit(t).prevented)return;this._graphTemplates.push(t),this.graphTemplateEvents.addTarget(t.events),this.graphTemplateHooks.addTarget(t.hooks);const n=Ea(t);this.registerNodeType(n,{category:"Subgraphs",title:t.name}),this.events.addGraphTemplate.emit(t)}load(t){try{for(super._loading=!0,t=this.hooks.load.execute(t);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);t.graphTemplates.forEach(s=>{const a=new lt(s,this);this.addGraphTemplate(a)});const n=this.graph.load(t.graph);return this.events.loaded.emit(),n.forEach(s=>console.warn(s)),n}finally{super._loading=!1}}registerCategoryModule(t,n){this.code.state.modules[t]=n}}function uu(e){const t=r.ref(e?.code??new pt),n=r.ref(e?.existingEditor??new cu(t.value)),s=Symbol("ViewModelToken"),a=r.ref(null),o=r.shallowReadonly(a),{switchGraph:i}=Ta(n,a),l=r.computed(()=>o.value&&o.value!==n.value.graph),d=r.reactive(S.DEFAULT_SETTINGS());d.nodes.defaultWidth=Bt;const c=S.useCommandHandler(),f=S.useHistory(o,c),w=S.useClipboard(o,n,c),m={renderNode:new Jn.SequentialHook(null),renderInterface:new Jn.SequentialHook(null)},D=r.reactive({clipboard:w,code:t,commandHandler:c,displayedGraph:o,editor:n,history:f,hooks:m,isReady:!1,isSubgraph:l,onBeforeUnmount:()=>{},onMounted:()=>{},settings:d,switchGraph:i});return t.value.registerViewModel(D),Sa(D),S.registerDeleteNodesCommand(o,c),xa(o,c,i),S.registerSaveSubgraphCommand(o,c),S.registerSwitchToMainGraphCommand(o,c,i),S.registerSidebarCommands(o,c),S.registerZoomToFitCommands(o,c,d),Na(o,c,d),Ca(d),r.watch(n,(g,M)=>{M&&(M.events.registerGraph.unsubscribe(s),M.graphEvents.beforeAddNode.unsubscribe(s),g.nodeHooks.beforeLoad.unsubscribe(s),g.nodeHooks.afterSave.unsubscribe(s),g.graphTemplateHooks.beforeLoad.unsubscribe(s),g.graphTemplateHooks.afterSave.unsubscribe(s),g.graph.hooks.load.unsubscribe(s),g.graph.hooks.save.unsubscribe(s)),g&&(g.nodeHooks.beforeLoad.subscribe(s,(h,k)=>(k.position=h.position??{x:0,y:0},k.state&&(k.state.integrated=h.integrated,h.props&&(k.state.props=h.props),h.variableName&&(k.state.variableName=h.variableName)),h)),g.nodeHooks.afterSave.subscribe(s,(h,k)=>(h.position=k.position,k.state&&(h.integrated=k.state.integrated,k.state.props&&(h.props=k.state.props),k.state.variableName&&(h.variableName=k.state.variableName)),h)),g.graphTemplateHooks.beforeLoad.subscribe(s,(h,k)=>(k.panning=h.panning,k.scaling=h.scaling,h)),g.graphTemplateHooks.afterSave.subscribe(s,(h,k)=>(h.panning=k.panning,h.scaling=k.scaling,h)),g.graph.hooks.load.subscribe(s,(h,k)=>(k.panning=h.panning,k.scaling=h.scaling,h)),g.graph.hooks.save.subscribe(s,(h,k)=>(h.panning=k.panning,h.scaling=k.scaling,h)),g.graphEvents.beforeAddNode.subscribe(s,h=>S.setViewNodeProperties(h,{defaultWidth:d.nodes.defaultWidth})),n.value.registerNodeType(zn,{category:"Subgraphs"}),n.value.registerNodeType(Zn,{category:"Subgraphs"}),i(g.graph))},{immediate:!0}),r.nextTick(()=>D.isReady=!0),D}const hu=Object.freeze(Object.defineProperty({__proto__:null,default:`{{ #modules }}
8
8
  {{ . }}
9
9
  {{ /modules }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babsey/code-graph",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "author": "babsey <spreizer@web.de>",
5
5
  "license": "MIT",
6
6
  "type": "module",