edgeone 1.6.18 → 1.6.20

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.
@@ -142,7 +142,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
142
142
  `.repeat(e));bz.displayName="Newline";Rb.default=bz});var Pz=J(Fb=>{"use strict";var Tz=Fb&&Fb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fb,"__esModule",{value:!0});var Cke=Tz(yo()),Ake=Tz(cC()),wz=()=>Cke.default.createElement(Ake.default,{flexGrow:1});wz.displayName="Spacer";Fb.default=wz});var dC=J(Lb=>{"use strict";var Dke=Lb&&Lb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lb,"__esModule",{value:!0});var kke=yo(),Ike=Dke(wR()),Oke=()=>kke.useContext(Ike.default);Lb.default=Oke});var Az=J(Mb=>{"use strict";var Nke=Mb&&Mb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mb,"__esModule",{value:!0});var Cz=yo(),Rke=Nke(dC()),Fke=(e,t={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=Rke.default();Cz.useEffect(()=>{if(t.isActive!==!1)return s(!0),()=>{s(!1)}},[t.isActive,s]),Cz.useEffect(()=>{if(t.isActive===!1)return;let n=l=>{let f=String(l),m={upArrow:f==="\x1B[A",downArrow:f==="\x1B[B",leftArrow:f==="\x1B[D",rightArrow:f==="\x1B[C",pageDown:f==="\x1B[6~",pageUp:f==="\x1B[5~",return:f==="\r",escape:f==="\x1B",ctrl:!1,shift:!1,tab:f===" "||f==="\x1B[Z",backspace:f==="\b",delete:f==="\x7F"||f==="\x1B[3~",meta:!1};f<=""&&!m.return&&(f=String.fromCharCode(f.charCodeAt(0)+97-1),m.ctrl=!0),f.startsWith("\x1B")&&(f=f.slice(1),m.meta=!0);let y=f>="A"&&f<="Z",v=f>="\u0410"&&f<="\u042F";f.length===1&&(y||v)&&(m.shift=!0),m.tab&&f==="[Z"&&(m.shift=!0),(m.tab||m.backspace||m.delete)&&(f=""),(!(f==="c"&&m.ctrl)||!a)&&e(f,m)};return r==null||r.on("data",n),()=>{r==null||r.off("data",n)}},[t.isActive,r,a,e])};Mb.default=Fke});var Dz=J(Bb=>{"use strict";var Lke=Bb&&Bb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bb,"__esModule",{value:!0});var Mke=yo(),Bke=Lke(ER()),jke=()=>Mke.useContext(Bke.default);Bb.default=jke});var kz=J(jb=>{"use strict";var qke=jb&&jb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jb,"__esModule",{value:!0});var Uke=yo(),$ke=qke(CR()),Vke=()=>Uke.useContext($ke.default);jb.default=Vke});var Iz=J(qb=>{"use strict";var Hke=qb&&qb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qb,"__esModule",{value:!0});var Wke=yo(),zke=Hke(DR()),Gke=()=>Wke.useContext(zke.default);qb.default=Gke});var Nz=J($b=>{"use strict";var Oz=$b&&$b.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($b,"__esModule",{value:!0});var Ub=yo(),Kke=Oz(uC()),Yke=Oz(dC()),Jke=({isActive:e=!0,autoFocus:t=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=Yke.default(),{activeId:n,add:l,remove:f,activate:m,deactivate:y,focus:v}=Ub.useContext(Kke.default),b=Ub.useMemo(()=>r!=null?r:Math.random().toString().slice(2,7),[r]);return Ub.useEffect(()=>(l(b,{autoFocus:t}),()=>{f(b)}),[b,t]),Ub.useEffect(()=>{e?m(b):y(b)},[e,b]),Ub.useEffect(()=>{if(!(!s||!e))return a(!0),()=>{a(!1)}},[e]),{isFocused:!!b&&n===b,focus:v}};$b.default=Jke});var Rz=J(Vb=>{"use strict";var Xke=Vb&&Vb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vb,"__esModule",{value:!0});var Qke=yo(),Zke=Xke(uC()),eIe=()=>{let e=Qke.useContext(Zke.default);return{enableFocus:e.enableFocus,disableFocus:e.disableFocus,focusNext:e.focusNext,focusPrevious:e.focusPrevious,focus:e.focus}};Vb.default=eIe});var Fz=J(MR=>{"use strict";Object.defineProperty(MR,"__esModule",{value:!0});MR.default=e=>{var t,r,s,a;return{width:(r=(t=e.yogaNode)===null||t===void 0?void 0:t.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(s=e.yogaNode)===null||s===void 0?void 0:s.getComputedHeight())!==null&&a!==void 0?a:0}}});var hC=J(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var tIe=gz();Object.defineProperty(pc,"render",{enumerable:!0,get:function(){return tIe.default}});var rIe=cC();Object.defineProperty(pc,"Box",{enumerable:!0,get:function(){return rIe.default}});var nIe=FR();Object.defineProperty(pc,"Text",{enumerable:!0,get:function(){return nIe.default}});var iIe=xz();Object.defineProperty(pc,"Static",{enumerable:!0,get:function(){return iIe.default}});var sIe=Sz();Object.defineProperty(pc,"Transform",{enumerable:!0,get:function(){return sIe.default}});var oIe=Ez();Object.defineProperty(pc,"Newline",{enumerable:!0,get:function(){return oIe.default}});var aIe=Pz();Object.defineProperty(pc,"Spacer",{enumerable:!0,get:function(){return aIe.default}});var uIe=Az();Object.defineProperty(pc,"useInput",{enumerable:!0,get:function(){return uIe.default}});var cIe=Dz();Object.defineProperty(pc,"useApp",{enumerable:!0,get:function(){return cIe.default}});var lIe=dC();Object.defineProperty(pc,"useStdin",{enumerable:!0,get:function(){return lIe.default}});var pIe=kz();Object.defineProperty(pc,"useStdout",{enumerable:!0,get:function(){return pIe.default}});var fIe=Iz();Object.defineProperty(pc,"useStderr",{enumerable:!0,get:function(){return fIe.default}});var dIe=Nz();Object.defineProperty(pc,"useFocus",{enumerable:!0,get:function(){return dIe.default}});var hIe=Rz();Object.defineProperty(pc,"useFocusManager",{enumerable:!0,get:function(){return hIe.default}});var mIe=Fz();Object.defineProperty(pc,"measureElement",{enumerable:!0,get:function(){return mIe.default}})});var Lz=J((BR,_2)=>{(function(e,t){typeof BR=="object"&&typeof _2<"u"?_2.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(BR,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function r(E){e=E}function s(E){return E instanceof Array||Object.prototype.toString.call(E)==="[object Array]"}function a(E){return E!=null&&Object.prototype.toString.call(E)==="[object Object]"}function n(E,I){return Object.prototype.hasOwnProperty.call(E,I)}function l(E){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(E).length===0;var I;for(I in E)if(n(E,I))return!1;return!0}function f(E){return E===void 0}function m(E){return typeof E=="number"||Object.prototype.toString.call(E)==="[object Number]"}function y(E){return E instanceof Date||Object.prototype.toString.call(E)==="[object Date]"}function v(E,I){var q=[],z,ee=E.length;for(z=0;z<ee;++z)q.push(I(E[z],z));return q}function b(E,I){for(var q in I)n(I,q)&&(E[q]=I[q]);return n(I,"toString")&&(E.toString=I.toString),n(I,"valueOf")&&(E.valueOf=I.valueOf),E}function P(E,I,q,z){return Yh(E,I,q,z,!0).utc()}function k(){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 g(E){return E._pf==null&&(E._pf=k()),E._pf}var B;Array.prototype.some?B=Array.prototype.some:B=function(E){var I=Object(this),q=I.length>>>0,z;for(z=0;z<q;z++)if(z in I&&E.call(this,I[z],z,I))return!0;return!1};function L(E){var I=null,q=!1,z=E._d&&!isNaN(E._d.getTime());if(z&&(I=g(E),q=B.call(I.parsedDateParts,function(ee){return ee!=null}),z=I.overflow<0&&!I.empty&&!I.invalidEra&&!I.invalidMonth&&!I.invalidWeekday&&!I.weekdayMismatch&&!I.nullInput&&!I.invalidFormat&&!I.userInvalidated&&(!I.meridiem||I.meridiem&&q),E._strict&&(z=z&&I.charsLeftOver===0&&I.unusedTokens.length===0&&I.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(E))E._isValid=z;else return z;return E._isValid}function M(E){var I=P(NaN);return E!=null?b(g(I),E):g(I).userInvalidated=!0,I}var G=t.momentProperties=[],oe=!1;function re(E,I){var q,z,ee,De=G.length;if(f(I._isAMomentObject)||(E._isAMomentObject=I._isAMomentObject),f(I._i)||(E._i=I._i),f(I._f)||(E._f=I._f),f(I._l)||(E._l=I._l),f(I._strict)||(E._strict=I._strict),f(I._tzm)||(E._tzm=I._tzm),f(I._isUTC)||(E._isUTC=I._isUTC),f(I._offset)||(E._offset=I._offset),f(I._pf)||(E._pf=g(I)),f(I._locale)||(E._locale=I._locale),De>0)for(q=0;q<De;q++)z=G[q],ee=I[z],f(ee)||(E[z]=ee);return E}function me(E){re(this,E),this._d=new Date(E._d!=null?E._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),oe===!1&&(oe=!0,t.updateOffset(this),oe=!1)}function Ce(E){return E instanceof me||E!=null&&E._isAMomentObject!=null}function Me(E){t.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+E)}function Ve(E,I){var q=!0;return b(function(){if(t.deprecationHandler!=null&&t.deprecationHandler(null,E),q){var z=[],ee,De,vt,fr=arguments.length;for(De=0;De<fr;De++){if(ee="",typeof arguments[De]=="object"){ee+=`
143
143
  [`+De+"] ";for(vt in arguments[0])n(arguments[0],vt)&&(ee+=vt+": "+arguments[0][vt]+", ");ee=ee.slice(0,-2)}else ee=arguments[De];z.push(ee)}Me(E+`
144
144
  Arguments: `+Array.prototype.slice.call(z).join("")+`
145
- `+new Error().stack),q=!1}return I.apply(this,arguments)},I)}var Le={};function Pt(E,I){t.deprecationHandler!=null&&t.deprecationHandler(E,I),Le[E]||(Me(I),Le[E]=!0)}t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;function lt(E){return typeof Function<"u"&&E instanceof Function||Object.prototype.toString.call(E)==="[object Function]"}function ut(E){var I,q;for(q in E)n(E,q)&&(I=E[q],lt(I)?this[q]=I:this["_"+q]=I);this._config=E,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function je(E,I){var q=b({},E),z;for(z in I)n(I,z)&&(a(E[z])&&a(I[z])?(q[z]={},b(q[z],E[z]),b(q[z],I[z])):I[z]!=null?q[z]=I[z]:delete q[z]);for(z in E)n(E,z)&&!n(I,z)&&a(E[z])&&(q[z]=b({},q[z]));return q}function se(E){E!=null&&this.set(E)}var ke;Object.keys?ke=Object.keys:ke=function(E){var I,q=[];for(I in E)n(E,I)&&q.push(I);return q};var Ke={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Se(E,I,q){var z=this._calendar[E]||this._calendar.sameElse;return lt(z)?z.call(I,q):z}function Te(E,I,q){var z=""+Math.abs(E),ee=I-z.length,De=E>=0;return(De?q?"+":"":"-")+Math.pow(10,Math.max(0,ee)).toString().substr(1)+z}var Fe=/(\[[^\[]*\])|(\\)?([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,it=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,It={},Zt={};function Qe(E,I,q,z){var ee=z;typeof z=="string"&&(ee=function(){return this[z]()}),E&&(Zt[E]=ee),I&&(Zt[I[0]]=function(){return Te(ee.apply(this,arguments),I[1],I[2])}),q&&(Zt[q]=function(){return this.localeData().ordinal(ee.apply(this,arguments),E)})}function Ot(E){return E.match(/\[[\s\S]/)?E.replace(/^\[|\]$/g,""):E.replace(/\\/g,"")}function Ae(E){var I=E.match(Fe),q,z;for(q=0,z=I.length;q<z;q++)Zt[I[q]]?I[q]=Zt[I[q]]:I[q]=Ot(I[q]);return function(ee){var De="",vt;for(vt=0;vt<z;vt++)De+=lt(I[vt])?I[vt].call(ee,E):I[vt];return De}}function Ze(E,I){return E.isValid()?(I=at(I,E.localeData()),It[I]=It[I]||Ae(I),It[I](E)):E.localeData().invalidDate()}function at(E,I){var q=5;function z(ee){return I.longDateFormat(ee)||ee}for(it.lastIndex=0;q>=0&&it.test(E);)E=E.replace(it,z),it.lastIndex=0,q-=1;return E}var qt={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 Tt(E){var I=this._longDateFormat[E],q=this._longDateFormat[E.toUpperCase()];return I||!q?I:(this._longDateFormat[E]=q.match(Fe).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[E])}var pt="Invalid date";function ht(){return this._invalidDate}var C="%d",At=/\d{1,2}/;function Kt(E){return this._ordinal.replace("%d",E)}var Jr={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 xt(E,I,q,z){var ee=this._relativeTime[q];return lt(ee)?ee(E,I,q,z):ee.replace(/%d/i,E)}function St(E,I){var q=this._relativeTime[E>0?"future":"past"];return lt(q)?q(I):q.replace(/%s/i,I)}var tr={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 ge(E){return typeof E=="string"?tr[E]||tr[E.toLowerCase()]:void 0}function Ye(E){var I={},q,z;for(z in E)n(E,z)&&(q=ge(z),q&&(I[q]=E[z]));return I}var Ut={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 rr(E){var I=[],q;for(q in E)n(E,q)&&I.push({unit:q,priority:Ut[q]});return I.sort(function(z,ee){return z.priority-ee.priority}),I}var $r=/\d/,Vr=/\d\d/,Hn=/\d{3}/,jn=/\d{4}/,ei=/[+-]?\d{6}/,En=/\d\d?/,$o=/\d\d\d\d?/,Qo=/\d\d\d\d\d\d?/,ps=/\d{1,3}/,Vo=/\d{1,4}/,Vu=/[+-]?\d{1,6}/,za=/\d+/,rt=/[+-]?\d+/,Ft=/Z|[+-]\d\d:?\d\d/gi,Dt=/Z|[+-]\d\d(?::?\d\d)?/gi,Jt=/[+-]?\d+(\.\d{1,3})?/,Ir=/[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,xr=/^[1-9]\d?/,In=/^([1-9]\d|\d)/,_i;_i={};function Mt(E,I,q){_i[E]=lt(I)?I:function(z,ee){return z&&q?q:I}}function Ai(E,I){return n(_i,E)?_i[E](I._strict,I._locale):new RegExp(Ps(E))}function Ps(E){return Di(E.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(I,q,z,ee,De){return q||z||ee||De}))}function Di(E){return E.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Si(E){return E<0?Math.ceil(E)||0:Math.floor(E)}function sn(E){var I=+E,q=0;return I!==0&&isFinite(I)&&(q=Si(I)),q}var Ws={};function On(E,I){var q,z=I,ee;for(typeof E=="string"&&(E=[E]),m(I)&&(z=function(De,vt){vt[I]=sn(De)}),ee=E.length,q=0;q<ee;q++)Ws[E[q]]=z}function Ss(E,I){On(E,function(q,z,ee,De){ee._w=ee._w||{},I(q,ee._w,ee,De)})}function Hu(E,I,q){I!=null&&n(Ws,E)&&Ws[E](I,q._a,q,E)}function to(E){return E%4===0&&E%100!==0||E%400===0}var ur=0,Ao=1,co=2,Cs=3,Do=4,lo=5,js=6,Zc=7,fu=8;Qe("Y",0,0,function(){var E=this.year();return E<=9999?Te(E,4):"+"+E}),Qe(0,["YY",2],0,function(){return this.year()%100}),Qe(0,["YYYY",4],0,"year"),Qe(0,["YYYYY",5],0,"year"),Qe(0,["YYYYYY",6,!0],0,"year"),Mt("Y",rt),Mt("YY",En,Vr),Mt("YYYY",Vo,jn),Mt("YYYYY",Vu,ei),Mt("YYYYYY",Vu,ei),On(["YYYYY","YYYYYY"],ur),On("YYYY",function(E,I){I[ur]=E.length===2?t.parseTwoDigitYear(E):sn(E)}),On("YY",function(E,I){I[ur]=t.parseTwoDigitYear(E)}),On("Y",function(E,I){I[ur]=parseInt(E,10)});function Oa(E){return to(E)?366:365}t.parseTwoDigitYear=function(E){return sn(E)+(sn(E)>68?1900:2e3)};var Wu=tn("FullYear",!0);function Fl(){return to(this.year())}function tn(E,I){return function(q){return q!=null?(el(this,E,q),t.updateOffset(this,I),this):vc(this,E)}}function vc(E,I){if(!E.isValid())return NaN;var q=E._d,z=E._isUTC;switch(I){case"Milliseconds":return z?q.getUTCMilliseconds():q.getMilliseconds();case"Seconds":return z?q.getUTCSeconds():q.getSeconds();case"Minutes":return z?q.getUTCMinutes():q.getMinutes();case"Hours":return z?q.getUTCHours():q.getHours();case"Date":return z?q.getUTCDate():q.getDate();case"Day":return z?q.getUTCDay():q.getDay();case"Month":return z?q.getUTCMonth():q.getMonth();case"FullYear":return z?q.getUTCFullYear():q.getFullYear();default:return NaN}}function el(E,I,q){var z,ee,De,vt,fr;if(!(!E.isValid()||isNaN(q))){switch(z=E._d,ee=E._isUTC,I){case"Milliseconds":return void(ee?z.setUTCMilliseconds(q):z.setMilliseconds(q));case"Seconds":return void(ee?z.setUTCSeconds(q):z.setSeconds(q));case"Minutes":return void(ee?z.setUTCMinutes(q):z.setMinutes(q));case"Hours":return void(ee?z.setUTCHours(q):z.setHours(q));case"Date":return void(ee?z.setUTCDate(q):z.setDate(q));case"FullYear":break;default:return}De=q,vt=E.month(),fr=E.date(),fr=fr===29&&vt===1&&!to(De)?28:fr,ee?z.setUTCFullYear(De,vt,fr):z.setFullYear(De,vt,fr)}}function du(E){return E=ge(E),lt(this[E])?this[E]():this}function fs(E,I){if(typeof E=="object"){E=Ye(E);var q=rr(E),z,ee=q.length;for(z=0;z<ee;z++)this[q[z].unit](E[q[z].unit])}else if(E=ge(E),lt(this[E]))return this[E](I);return this}function Ji(E,I){return(E%I+I)%I}var Bi;Array.prototype.indexOf?Bi=Array.prototype.indexOf:Bi=function(E){var I;for(I=0;I<this.length;++I)if(this[I]===E)return I;return-1};function zs(E,I){if(isNaN(E)||isNaN(I))return NaN;var q=Ji(I,12);return E+=(I-q)/12,q===1?to(E)?29:28:31-q%7%2}Qe("M",["MM",2],"Mo",function(){return this.month()+1}),Qe("MMM",0,0,function(E){return this.localeData().monthsShort(this,E)}),Qe("MMMM",0,0,function(E){return this.localeData().months(this,E)}),Mt("M",En,xr),Mt("MM",En,Vr),Mt("MMM",function(E,I){return I.monthsShortRegex(E)}),Mt("MMMM",function(E,I){return I.monthsRegex(E)}),On(["M","MM"],function(E,I){I[Ao]=sn(E)-1}),On(["MMM","MMMM"],function(E,I,q,z){var ee=q._locale.monthsParse(E,z,q._strict);ee!=null?I[Ao]=ee:g(q).invalidMonth=E});var ko="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Na="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Zo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Io=Ir,Ll=Ir;function Z0(E,I){return E?s(this._months)?this._months[E.month()]:this._months[(this._months.isFormat||Zo).test(I)?"format":"standalone"][E.month()]:s(this._months)?this._months:this._months.standalone}function kp(E,I){return E?s(this._monthsShort)?this._monthsShort[E.month()]:this._monthsShort[Zo.test(I)?"format":"standalone"][E.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ml(E,I,q){var z,ee,De,vt=E.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],z=0;z<12;++z)De=P([2e3,z]),this._shortMonthsParse[z]=this.monthsShort(De,"").toLocaleLowerCase(),this._longMonthsParse[z]=this.months(De,"").toLocaleLowerCase();return q?I==="MMM"?(ee=Bi.call(this._shortMonthsParse,vt),ee!==-1?ee:null):(ee=Bi.call(this._longMonthsParse,vt),ee!==-1?ee:null):I==="MMM"?(ee=Bi.call(this._shortMonthsParse,vt),ee!==-1?ee:(ee=Bi.call(this._longMonthsParse,vt),ee!==-1?ee:null)):(ee=Bi.call(this._longMonthsParse,vt),ee!==-1?ee:(ee=Bi.call(this._shortMonthsParse,vt),ee!==-1?ee:null))}function ga(E,I,q){var z,ee,De;if(this._monthsParseExact)return Ml.call(this,E,I,q);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),z=0;z<12;z++){if(ee=P([2e3,z]),q&&!this._longMonthsParse[z]&&(this._longMonthsParse[z]=new RegExp("^"+this.months(ee,"").replace(".","")+"$","i"),this._shortMonthsParse[z]=new RegExp("^"+this.monthsShort(ee,"").replace(".","")+"$","i")),!q&&!this._monthsParse[z]&&(De="^"+this.months(ee,"")+"|^"+this.monthsShort(ee,""),this._monthsParse[z]=new RegExp(De.replace(".",""),"i")),q&&I==="MMMM"&&this._longMonthsParse[z].test(E))return z;if(q&&I==="MMM"&&this._shortMonthsParse[z].test(E))return z;if(!q&&this._monthsParse[z].test(E))return z}}function jt(E,I){if(!E.isValid())return E;if(typeof I=="string"){if(/^\d+$/.test(I))I=sn(I);else if(I=E.localeData().monthsParse(I),!m(I))return E}var q=I,z=E.date();return z=z<29?z:Math.min(z,zs(E.year(),q)),E._isUTC?E._d.setUTCMonth(q,z):E._d.setMonth(q,z),E}function hu(E){return E!=null?(jt(this,E),t.updateOffset(this,!0),this):vc(this,"Month")}function em(){return zs(this.year(),this.month())}function Ip(E){return this._monthsParseExact?(n(this,"_monthsRegex")||xc.call(this),E?this._monthsShortStrictRegex:this._monthsShortRegex):(n(this,"_monthsShortRegex")||(this._monthsShortRegex=Io),this._monthsShortStrictRegex&&E?this._monthsShortStrictRegex:this._monthsShortRegex)}function ns(E){return this._monthsParseExact?(n(this,"_monthsRegex")||xc.call(this),E?this._monthsStrictRegex:this._monthsRegex):(n(this,"_monthsRegex")||(this._monthsRegex=Ll),this._monthsStrictRegex&&E?this._monthsStrictRegex:this._monthsRegex)}function xc(){function E(dn,fi){return fi.length-dn.length}var I=[],q=[],z=[],ee,De,vt,fr;for(ee=0;ee<12;ee++)De=P([2e3,ee]),vt=Di(this.monthsShort(De,"")),fr=Di(this.months(De,"")),I.push(vt),q.push(fr),z.push(fr),z.push(vt);I.sort(E),q.sort(E),z.sort(E),this._monthsRegex=new RegExp("^("+z.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+q.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+I.join("|")+")","i")}function Vh(E,I,q,z,ee,De,vt){var fr;return E<100&&E>=0?(fr=new Date(E+400,I,q,z,ee,De,vt),isFinite(fr.getFullYear())&&fr.setFullYear(E)):fr=new Date(E,I,q,z,ee,De,vt),fr}function Sf(E){var I,q;return E<100&&E>=0?(q=Array.prototype.slice.call(arguments),q[0]=E+400,I=new Date(Date.UTC.apply(null,q)),isFinite(I.getUTCFullYear())&&I.setUTCFullYear(E)):I=new Date(Date.UTC.apply(null,arguments)),I}function tl(E,I,q){var z=7+I-q,ee=(7+Sf(E,0,z).getUTCDay()-I)%7;return-ee+z-1}function Od(E,I,q,z,ee){var De=(7+q-z)%7,vt=tl(E,z,ee),fr=1+7*(I-1)+De+vt,dn,fi;return fr<=0?(dn=E-1,fi=Oa(dn)+fr):fr>Oa(E)?(dn=E+1,fi=fr-Oa(E)):(dn=E,fi=fr),{year:dn,dayOfYear:fi}}function or(E,I,q){var z=tl(E.year(),I,q),ee=Math.floor((E.dayOfYear()-z-1)/7)+1,De,vt;return ee<1?(vt=E.year()-1,De=ee+ji(vt,I,q)):ee>ji(E.year(),I,q)?(De=ee-ji(E.year(),I,q),vt=E.year()+1):(vt=E.year(),De=ee),{week:De,year:vt}}function ji(E,I,q){var z=tl(E,I,q),ee=tl(E+1,I,q);return(Oa(E)-z+ee)/7}Qe("w",["ww",2],"wo","week"),Qe("W",["WW",2],"Wo","isoWeek"),Mt("w",En,xr),Mt("ww",En,Vr),Mt("W",En,xr),Mt("WW",En,Vr),Ss(["w","ww","W","WW"],function(E,I,q,z){I[z.substr(0,1)]=sn(E)});function Nd(E){return or(E,this._week.dow,this._week.doy).week}var Bl={dow:0,doy:6};function mu(){return this._week.dow}function bf(){return this._week.doy}function tm(E){var I=this.localeData().week(this);return E==null?I:this.add((E-I)*7,"d")}function Hh(E){var I=or(this,1,4).week;return E==null?I:this.add((E-I)*7,"d")}Qe("d",0,"do","day"),Qe("dd",0,0,function(E){return this.localeData().weekdaysMin(this,E)}),Qe("ddd",0,0,function(E){return this.localeData().weekdaysShort(this,E)}),Qe("dddd",0,0,function(E){return this.localeData().weekdays(this,E)}),Qe("e",0,0,"weekday"),Qe("E",0,0,"isoWeekday"),Mt("d",En),Mt("e",En),Mt("E",En),Mt("dd",function(E,I){return I.weekdaysMinRegex(E)}),Mt("ddd",function(E,I){return I.weekdaysShortRegex(E)}),Mt("dddd",function(E,I){return I.weekdaysRegex(E)}),Ss(["dd","ddd","dddd"],function(E,I,q,z){var ee=q._locale.weekdaysParse(E,z,q._strict);ee!=null?I.d=ee:g(q).invalidWeekday=E}),Ss(["d","e","E"],function(E,I,q,z){I[z]=sn(E)});function rm(E,I){return typeof E!="string"?E:isNaN(E)?(E=I.weekdaysParse(E),typeof E=="number"?E:null):parseInt(E,10)}function Ra(E,I){return typeof E=="string"?I.weekdaysParse(E)%7||7:isNaN(E)?null:E}function Fa(E,I){return E.slice(I,7).concat(E.slice(0,I))}var Wh="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),zh="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Op="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ea=Ir,Np=Ir,La=Ir;function rl(E,I){var q=s(this._weekdays)?this._weekdays:this._weekdays[E&&E!==!0&&this._weekdays.isFormat.test(I)?"format":"standalone"];return E===!0?Fa(q,this._week.dow):E?q[E.day()]:q}function yu(E){return E===!0?Fa(this._weekdaysShort,this._week.dow):E?this._weekdaysShort[E.day()]:this._weekdaysShort}function zu(E){return E===!0?Fa(this._weekdaysMin,this._week.dow):E?this._weekdaysMin[E.day()]:this._weekdaysMin}function _c(E,I,q){var z,ee,De,vt=E.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)De=P([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(De,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(De,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(De,"").toLocaleLowerCase();return q?I==="dddd"?(ee=Bi.call(this._weekdaysParse,vt),ee!==-1?ee:null):I==="ddd"?(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1?ee:null):(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1?ee:null):I==="dddd"?(ee=Bi.call(this._weekdaysParse,vt),ee!==-1||(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1)?ee:(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1?ee:null)):I==="ddd"?(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1||(ee=Bi.call(this._weekdaysParse,vt),ee!==-1)?ee:(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1?ee:null)):(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1||(ee=Bi.call(this._weekdaysParse,vt),ee!==-1)?ee:(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1?ee:null))}function Sc(E,I,q){var z,ee,De;if(this._weekdaysParseExact)return _c.call(this,E,I,q);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(ee=P([2e3,1]).day(z),q&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(ee,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(ee,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(ee,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[z]||(De="^"+this.weekdays(ee,"")+"|^"+this.weekdaysShort(ee,"")+"|^"+this.weekdaysMin(ee,""),this._weekdaysParse[z]=new RegExp(De.replace(".",""),"i")),q&&I==="dddd"&&this._fullWeekdaysParse[z].test(E))return z;if(q&&I==="ddd"&&this._shortWeekdaysParse[z].test(E))return z;if(q&&I==="dd"&&this._minWeekdaysParse[z].test(E))return z;if(!q&&this._weekdaysParse[z].test(E))return z}}function Ns(E){if(!this.isValid())return E!=null?this:NaN;var I=vc(this,"Day");return E!=null?(E=rm(E,this.localeData()),this.add(E-I,"d")):I}function Tn(E){if(!this.isValid())return E!=null?this:NaN;var I=(this.day()+7-this.localeData()._week.dow)%7;return E==null?I:this.add(E-I,"d")}function Gu(E){if(!this.isValid())return E!=null?this:NaN;if(E!=null){var I=Ra(E,this.localeData());return this.day(this.day()%7?I:I-7)}else return this.day()||7}function Gh(E){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||ql.call(this),E?this._weekdaysStrictRegex:this._weekdaysRegex):(n(this,"_weekdaysRegex")||(this._weekdaysRegex=ea),this._weekdaysStrictRegex&&E?this._weekdaysStrictRegex:this._weekdaysRegex)}function Gs(E){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||ql.call(this),E?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(n(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Np),this._weekdaysShortStrictRegex&&E?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function jl(E){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||ql.call(this),E?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(n(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=La),this._weekdaysMinStrictRegex&&E?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ql(){function E(ia,eu){return eu.length-ia.length}var I=[],q=[],z=[],ee=[],De,vt,fr,dn,fi;for(De=0;De<7;De++)vt=P([2e3,1]).day(De),fr=Di(this.weekdaysMin(vt,"")),dn=Di(this.weekdaysShort(vt,"")),fi=Di(this.weekdays(vt,"")),I.push(fr),q.push(dn),z.push(fi),ee.push(fr),ee.push(dn),ee.push(fi);I.sort(E),q.sort(E),z.sort(E),ee.sort(E),this._weekdaysRegex=new RegExp("^("+ee.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+q.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+I.join("|")+")","i")}function Ma(){return this.hours()%12||12}function Rp(){return this.hours()||24}Qe("H",["HH",2],0,"hour"),Qe("h",["hh",2],0,Ma),Qe("k",["kk",2],0,Rp),Qe("hmm",0,0,function(){return""+Ma.apply(this)+Te(this.minutes(),2)}),Qe("hmmss",0,0,function(){return""+Ma.apply(this)+Te(this.minutes(),2)+Te(this.seconds(),2)}),Qe("Hmm",0,0,function(){return""+this.hours()+Te(this.minutes(),2)}),Qe("Hmmss",0,0,function(){return""+this.hours()+Te(this.minutes(),2)+Te(this.seconds(),2)});function Oo(E,I){Qe(E,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),I)})}Oo("a",!0),Oo("A",!1);function Fp(E,I){return I._meridiemParse}Mt("a",Fp),Mt("A",Fp),Mt("H",En,In),Mt("h",En,xr),Mt("k",En,xr),Mt("HH",En,Vr),Mt("hh",En,Vr),Mt("kk",En,Vr),Mt("hmm",$o),Mt("hmmss",Qo),Mt("Hmm",$o),Mt("Hmmss",Qo),On(["H","HH"],Cs),On(["k","kk"],function(E,I,q){var z=sn(E);I[Cs]=z===24?0:z}),On(["a","A"],function(E,I,q){q._isPm=q._locale.isPM(E),q._meridiem=E}),On(["h","hh"],function(E,I,q){I[Cs]=sn(E),g(q).bigHour=!0}),On("hmm",function(E,I,q){var z=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z)),g(q).bigHour=!0}),On("hmmss",function(E,I,q){var z=E.length-4,ee=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z,2)),I[lo]=sn(E.substr(ee)),g(q).bigHour=!0}),On("Hmm",function(E,I,q){var z=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z))}),On("Hmmss",function(E,I,q){var z=E.length-4,ee=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z,2)),I[lo]=sn(E.substr(ee))});function Kh(E){return(E+"").toLowerCase().charAt(0)==="p"}var Ga=/[ap]\.?m?\.?/i,va=tn("Hours",!0);function Lp(E,I,q){return E>11?q?"pm":"PM":q?"am":"AM"}var nl={calendar:Ke,longDateFormat:qt,invalidDate:pt,ordinal:C,dayOfMonthOrdinalParse:At,relativeTime:Jr,months:ko,monthsShort:Na,week:Bl,weekdays:Wh,weekdaysMin:Op,weekdaysShort:zh,meridiemParse:Ga},bs={},ro={},Ku;function Ef(E,I){var q,z=Math.min(E.length,I.length);for(q=0;q<z;q+=1)if(E[q]!==I[q])return q;return z}function gu(E){return E&&E.toLowerCase().replace("_","-")}function il(E){for(var I=0,q,z,ee,De;I<E.length;){for(De=gu(E[I]).split("-"),q=De.length,z=gu(E[I+1]),z=z?z.split("-"):null;q>0;){if(ee=Z(De.slice(0,q).join("-")),ee)return ee;if(z&&z.length>=q&&Ef(De,z)>=q-1)break;q--}I++}return Ku}function ue(E){return!!(E&&E.match("^[^/\\\\]*$"))}function Z(E){var I=null,q;if(bs[E]===void 0&&typeof _2<"u"&&_2&&_2.exports&&ue(E))try{I=Ku._abbr,q=require,q("./locale/"+E),ae(I)}catch{bs[E]=null}return bs[E]}function ae(E,I){var q;return E&&(f(I)?q=Je(E):q=Re(E,I),q?Ku=q:typeof console<"u"&&console.warn&&console.warn("Locale "+E+" not found. Did you forget to load it?")),Ku._abbr}function Re(E,I){if(I!==null){var q,z=nl;if(I.abbr=E,bs[E]!=null)Pt("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."),z=bs[E]._config;else if(I.parentLocale!=null)if(bs[I.parentLocale]!=null)z=bs[I.parentLocale]._config;else if(q=Z(I.parentLocale),q!=null)z=q._config;else return ro[I.parentLocale]||(ro[I.parentLocale]=[]),ro[I.parentLocale].push({name:E,config:I}),null;return bs[E]=new se(je(z,I)),ro[E]&&ro[E].forEach(function(ee){Re(ee.name,ee.config)}),ae(E),bs[E]}else return delete bs[E],null}function nt(E,I){if(I!=null){var q,z,ee=nl;bs[E]!=null&&bs[E].parentLocale!=null?bs[E].set(je(bs[E]._config,I)):(z=Z(E),z!=null&&(ee=z._config),I=je(ee,I),z==null&&(I.abbr=E),q=new se(I),q.parentLocale=bs[E],bs[E]=q),ae(E)}else bs[E]!=null&&(bs[E].parentLocale!=null?(bs[E]=bs[E].parentLocale,E===ae()&&ae(E)):bs[E]!=null&&delete bs[E]);return bs[E]}function Je(E){var I;if(E&&E._locale&&E._locale._abbr&&(E=E._locale._abbr),!E)return Ku;if(!s(E)){if(I=Z(E),I)return I;E=[E]}return il(E)}function gt(){return ke(bs)}function _t(E){var I,q=E._a;return q&&g(E).overflow===-2&&(I=q[Ao]<0||q[Ao]>11?Ao:q[co]<1||q[co]>zs(q[ur],q[Ao])?co:q[Cs]<0||q[Cs]>24||q[Cs]===24&&(q[Do]!==0||q[lo]!==0||q[js]!==0)?Cs:q[Do]<0||q[Do]>59?Do:q[lo]<0||q[lo]>59?lo:q[js]<0||q[js]>999?js:-1,g(E)._overflowDayOfYear&&(I<ur||I>co)&&(I=co),g(E)._overflowWeeks&&I===-1&&(I=Zc),g(E)._overflowWeekday&&I===-1&&(I=fu),g(E).overflow=I),E}var $t=/^\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)?)?$/,_r=/^\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)?)?$/,An=/Z|[+-]\d\d(?::?\d\d)?/,ti=[["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]],Nn=[["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/]],Ba=/^\/?Date\((-?\d+)/i,Ul=/^(?:(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}))$/,xa={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function No(E){var I,q,z=E._i,ee=$t.exec(z)||_r.exec(z),De,vt,fr,dn,fi=ti.length,ia=Nn.length;if(ee){for(g(E).iso=!0,I=0,q=fi;I<q;I++)if(ti[I][1].exec(ee[1])){vt=ti[I][0],De=ti[I][2]!==!1;break}if(vt==null){E._isValid=!1;return}if(ee[3]){for(I=0,q=ia;I<q;I++)if(Nn[I][1].exec(ee[3])){fr=(ee[2]||" ")+Nn[I][0];break}if(fr==null){E._isValid=!1;return}}if(!De&&fr!=null){E._isValid=!1;return}if(ee[4])if(An.exec(ee[4]))dn="Z";else{E._isValid=!1;return}E._f=vt+(fr||"")+(dn||""),Ho(E)}else E._isValid=!1}function ui(E,I,q,z,ee,De){var vt=[on(E),Na.indexOf(I),parseInt(q,10),parseInt(z,10),parseInt(ee,10)];return De&&vt.push(parseInt(De,10)),vt}function on(E){var I=parseInt(E,10);return I<=49?2e3+I:I<=999?1900+I:I}function Nr(E){return E.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function rn(E,I,q){if(E){var z=zh.indexOf(E),ee=new Date(I[0],I[1],I[2]).getDay();if(z!==ee)return g(q).weekdayMismatch=!0,q._isValid=!1,!1}return!0}function ri(E,I,q){if(E)return xa[E];if(I)return 0;var z=parseInt(q,10),ee=z%100,De=(z-ee)/100;return De*60+ee}function Ii(E){var I=Ul.exec(Nr(E._i)),q;if(I){if(q=ui(I[4],I[3],I[2],I[5],I[6],I[7]),!rn(I[1],q,E))return;E._a=q,E._tzm=ri(I[8],I[9],I[10]),E._d=Sf.apply(null,E._a),E._d.setUTCMinutes(E._d.getUTCMinutes()-E._tzm),g(E).rfc2822=!0}else E._isValid=!1}function Ks(E){var I=Ba.exec(E._i);if(I!==null){E._d=new Date(+I[1]);return}if(No(E),E._isValid===!1)delete E._isValid;else return;if(Ii(E),E._isValid===!1)delete E._isValid;else return;E._strict?E._isValid=!1:t.createFromInputFallback(E)}t.createFromInputFallback=Ve("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 _o(E,I,q){return E!=null?E:I!=null?I:q}function bc(E){var I=new Date(t.now());return E._useUTC?[I.getUTCFullYear(),I.getUTCMonth(),I.getUTCDate()]:[I.getFullYear(),I.getMonth(),I.getDate()]}function no(E){var I,q,z=[],ee,De,vt;if(!E._d){for(ee=bc(E),E._w&&E._a[co]==null&&E._a[Ao]==null&&ja(E),E._dayOfYear!=null&&(vt=_o(E._a[ur],ee[ur]),(E._dayOfYear>Oa(vt)||E._dayOfYear===0)&&(g(E)._overflowDayOfYear=!0),q=Sf(vt,0,E._dayOfYear),E._a[Ao]=q.getUTCMonth(),E._a[co]=q.getUTCDate()),I=0;I<3&&E._a[I]==null;++I)E._a[I]=z[I]=ee[I];for(;I<7;I++)E._a[I]=z[I]=E._a[I]==null?I===2?1:0:E._a[I];E._a[Cs]===24&&E._a[Do]===0&&E._a[lo]===0&&E._a[js]===0&&(E._nextDay=!0,E._a[Cs]=0),E._d=(E._useUTC?Sf:Vh).apply(null,z),De=E._useUTC?E._d.getUTCDay():E._d.getDay(),E._tzm!=null&&E._d.setUTCMinutes(E._d.getUTCMinutes()-E._tzm),E._nextDay&&(E._a[Cs]=24),E._w&&typeof E._w.d<"u"&&E._w.d!==De&&(g(E).weekdayMismatch=!0)}}function ja(E){var I,q,z,ee,De,vt,fr,dn,fi;I=E._w,I.GG!=null||I.W!=null||I.E!=null?(De=1,vt=4,q=_o(I.GG,E._a[ur],or(wn(),1,4).year),z=_o(I.W,1),ee=_o(I.E,1),(ee<1||ee>7)&&(dn=!0)):(De=E._locale._week.dow,vt=E._locale._week.doy,fi=or(wn(),De,vt),q=_o(I.gg,E._a[ur],fi.year),z=_o(I.w,fi.week),I.d!=null?(ee=I.d,(ee<0||ee>6)&&(dn=!0)):I.e!=null?(ee=I.e+De,(I.e<0||I.e>6)&&(dn=!0)):ee=De),z<1||z>ji(q,De,vt)?g(E)._overflowWeeks=!0:dn!=null?g(E)._overflowWeekday=!0:(fr=Od(q,z,ee,De,vt),E._a[ur]=fr.year,E._dayOfYear=fr.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function Ho(E){if(E._f===t.ISO_8601){No(E);return}if(E._f===t.RFC_2822){Ii(E);return}E._a=[],g(E).empty=!0;var I=""+E._i,q,z,ee,De,vt,fr=I.length,dn=0,fi,ia;for(ee=at(E._f,E._locale).match(Fe)||[],ia=ee.length,q=0;q<ia;q++)De=ee[q],z=(I.match(Ai(De,E))||[])[0],z&&(vt=I.substr(0,I.indexOf(z)),vt.length>0&&g(E).unusedInput.push(vt),I=I.slice(I.indexOf(z)+z.length),dn+=z.length),Zt[De]?(z?g(E).empty=!1:g(E).unusedTokens.push(De),Hu(De,z,E)):E._strict&&!z&&g(E).unusedTokens.push(De);g(E).charsLeftOver=fr-dn,I.length>0&&g(E).unusedInput.push(I),E._a[Cs]<=12&&g(E).bigHour===!0&&E._a[Cs]>0&&(g(E).bigHour=void 0),g(E).parsedDateParts=E._a.slice(0),g(E).meridiem=E._meridiem,E._a[Cs]=$l(E._locale,E._a[Cs],E._meridiem),fi=g(E).era,fi!==null&&(E._a[ur]=E._locale.erasConvertYear(fi,E._a[ur])),no(E),_t(E)}function $l(E,I,q){var z;return q==null?I:E.meridiemHour!=null?E.meridiemHour(I,q):(E.isPM!=null&&(z=E.isPM(q),z&&I<12&&(I+=12),!z&&I===12&&(I=0)),I)}function Mp(E){var I,q,z,ee,De,vt,fr=!1,dn=E._f.length;if(dn===0){g(E).invalidFormat=!0,E._d=new Date(NaN);return}for(ee=0;ee<dn;ee++)De=0,vt=!1,I=re({},E),E._useUTC!=null&&(I._useUTC=E._useUTC),I._f=E._f[ee],Ho(I),L(I)&&(vt=!0),De+=g(I).charsLeftOver,De+=g(I).unusedTokens.length*10,g(I).score=De,fr?De<z&&(z=De,q=I):(z==null||De<z||vt)&&(z=De,q=I,vt&&(fr=!0));b(E,q||I)}function Yu(E){if(!E._d){var I=Ye(E._i),q=I.day===void 0?I.date:I.day;E._a=v([I.year,I.month,q,I.hour,I.minute,I.second,I.millisecond],function(z){return z&&parseInt(z,10)}),no(E)}}function Bp(E){var I=new me(_t(Wo(E)));return I._nextDay&&(I.add(1,"d"),I._nextDay=void 0),I}function Wo(E){var I=E._i,q=E._f;return E._locale=E._locale||Je(E._l),I===null||q===void 0&&I===""?M({nullInput:!0}):(typeof I=="string"&&(E._i=I=E._locale.preparse(I)),Ce(I)?new me(_t(I)):(y(I)?E._d=I:s(q)?Mp(E):q?Ho(E):qi(E),L(E)||(E._d=null),E))}function qi(E){var I=E._i;f(I)?E._d=new Date(t.now()):y(I)?E._d=new Date(I.valueOf()):typeof I=="string"?Ks(E):s(I)?(E._a=v(I.slice(0),function(q){return parseInt(q,10)}),no(E)):a(I)?Yu(E):m(I)?E._d=new Date(I):t.createFromInputFallback(E)}function Yh(E,I,q,z,ee){var De={};return(I===!0||I===!1)&&(z=I,I=void 0),(q===!0||q===!1)&&(z=q,q=void 0),(a(E)&&l(E)||s(E)&&E.length===0)&&(E=void 0),De._isAMomentObject=!0,De._useUTC=De._isUTC=ee,De._l=q,De._i=E,De._f=I,De._strict=z,Bp(De)}function wn(E,I,q,z){return Yh(E,I,q,z,!1)}var Jh=Ve("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var E=wn.apply(null,arguments);return this.isValid()&&E.isValid()?E<this?this:E:M()}),zo=Ve("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var E=wn.apply(null,arguments);return this.isValid()&&E.isValid()?E>this?this:E:M()});function oi(E,I){var q,z;if(I.length===1&&s(I[0])&&(I=I[0]),!I.length)return wn();for(q=I[0],z=1;z<I.length;++z)(!I[z].isValid()||I[z][E](q))&&(q=I[z]);return q}function Ka(){var E=[].slice.call(arguments,0);return oi("isBefore",E)}function Rd(){var E=[].slice.call(arguments,0);return oi("isAfter",E)}var Tf=function(){return Date.now?Date.now():+new Date},wf=["year","quarter","month","week","day","hour","minute","second","millisecond"];function mv(E){var I,q=!1,z,ee=wf.length;for(I in E)if(n(E,I)&&!(Bi.call(wf,I)!==-1&&(E[I]==null||!isNaN(E[I]))))return!1;for(z=0;z<ee;++z)if(E[wf[z]]){if(q)return!1;parseFloat(E[wf[z]])!==sn(E[wf[z]])&&(q=!0)}return!0}function Fd(){return this._isValid}function nm(){return So(NaN)}function Ec(E){var I=Ye(E),q=I.year||0,z=I.quarter||0,ee=I.month||0,De=I.week||I.isoWeek||0,vt=I.day||0,fr=I.hour||0,dn=I.minute||0,fi=I.second||0,ia=I.millisecond||0;this._isValid=mv(I),this._milliseconds=+ia+fi*1e3+dn*6e4+fr*1e3*60*60,this._days=+vt+De*7,this._months=+ee+z*3+q*12,this._data={},this._locale=Je(),this._bubble()}function qa(E){return E instanceof Ec}function sl(E){return E<0?Math.round(-1*E)*-1:Math.round(E)}function Ya(E,I,q){var z=Math.min(E.length,I.length),ee=Math.abs(E.length-I.length),De=0,vt;for(vt=0;vt<z;vt++)(q&&E[vt]!==I[vt]||!q&&sn(E[vt])!==sn(I[vt]))&&De++;return De+ee}function jp(E,I){Qe(E,0,0,function(){var q=this.utcOffset(),z="+";return q<0&&(q=-q,z="-"),z+Te(~~(q/60),2)+I+Te(~~q%60,2)})}jp("Z",":"),jp("ZZ",""),Mt("Z",Dt),Mt("ZZ",Dt),On(["Z","ZZ"],function(E,I,q){q._useUTC=!0,q._tzm=Ro(Dt,E)});var Ys=/([\+\-]|\d\d)/gi;function Ro(E,I){var q=(I||"").match(E),z,ee,De;return q===null?null:(z=q[q.length-1]||[],ee=(z+"").match(Ys)||["-",0,0],De=+(ee[1]*60)+sn(ee[2]),De===0?0:ee[0]==="+"?De:-De)}function io(E,I){var q,z;return I._isUTC?(q=I.clone(),z=(Ce(E)||y(E)?E.valueOf():wn(E).valueOf())-q.valueOf(),q._d.setTime(q._d.valueOf()+z),t.updateOffset(q,!1),q):wn(E).local()}function Tc(E){return-Math.round(E._d.getTimezoneOffset())}t.updateOffset=function(){};function Pf(E,I,q){var z=this._offset||0,ee;if(!this.isValid())return E!=null?this:NaN;if(E!=null){if(typeof E=="string"){if(E=Ro(Dt,E),E===null)return this}else Math.abs(E)<16&&!q&&(E=E*60);return!this._isUTC&&I&&(ee=Tc(this)),this._offset=E,this._isUTC=!0,ee!=null&&this.add(ee,"m"),z!==E&&(!I||this._changeInProgress?ba(this,So(E-z,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?z:Tc(this)}function bi(E,I){return E!=null?(typeof E!="string"&&(E=-E),this.utcOffset(E,I),this):-this.utcOffset()}function im(E){return this.utcOffset(0,E)}function sm(E){return this._isUTC&&(this.utcOffset(0,E),this._isUTC=!1,E&&this.subtract(Tc(this),"m")),this}function ta(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var E=Ro(Ft,this._i);E!=null?this.utcOffset(E):this.utcOffset(0,!0)}return this}function Sa(E){return this.isValid()?(E=E?wn(E).utcOffset():0,(this.utcOffset()-E)%60===0):!1}function Ja(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Vl(){if(!f(this._isDSTShifted))return this._isDSTShifted;var E={},I;return re(E,this),E=Wo(E),E._a?(I=E._isUTC?P(E._a):wn(E._a),this._isDSTShifted=this.isValid()&&Ya(E._a,I.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Hl(){return this.isValid()?!this._isUTC:!1}function Wl(){return this.isValid()?this._isUTC:!1}function Ei(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ju=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,zl=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function So(E,I){var q=E,z=null,ee,De,vt;return qa(E)?q={ms:E._milliseconds,d:E._days,M:E._months}:m(E)||!isNaN(+E)?(q={},I?q[I]=+E:q.milliseconds=+E):(z=Ju.exec(E))?(ee=z[1]==="-"?-1:1,q={y:0,d:sn(z[co])*ee,h:sn(z[Cs])*ee,m:sn(z[Do])*ee,s:sn(z[lo])*ee,ms:sn(sl(z[js]*1e3))*ee}):(z=zl.exec(E))?(ee=z[1]==="-"?-1:1,q={y:ol(z[2],ee),M:ol(z[3],ee),w:ol(z[4],ee),d:ol(z[5],ee),h:ol(z[6],ee),m:ol(z[7],ee),s:ol(z[8],ee)}):q==null?q={}:typeof q=="object"&&("from"in q||"to"in q)&&(vt=om(wn(q.from),wn(q.to)),q={},q.ms=vt.milliseconds,q.M=vt.months),De=new Ec(q),qa(E)&&n(E,"_locale")&&(De._locale=E._locale),qa(E)&&n(E,"_isValid")&&(De._isValid=E._isValid),De}So.fn=Ec.prototype,So.invalid=nm;function ol(E,I){var q=E&&parseFloat(E.replace(",","."));return(isNaN(q)?0:q)*I}function Xu(E,I){var q={};return q.months=I.month()-E.month()+(I.year()-E.year())*12,E.clone().add(q.months,"M").isAfter(I)&&--q.months,q.milliseconds=+I-+E.clone().add(q.months,"M"),q}function om(E,I){var q;return E.isValid()&&I.isValid()?(I=io(I,E),E.isBefore(I)?q=Xu(E,I):(q=Xu(I,E),q.milliseconds=-q.milliseconds,q.months=-q.months),q):{milliseconds:0,months:0}}function qp(E,I){return function(q,z){var ee,De;return z!==null&&!isNaN(+z)&&(Pt(I,"moment()."+I+"(period, number) is deprecated. Please use moment()."+I+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),De=q,q=z,z=De),ee=So(q,z),ba(this,ee,E),this}}function ba(E,I,q,z){var ee=I._milliseconds,De=sl(I._days),vt=sl(I._months);E.isValid()&&(z=z==null?!0:z,vt&&jt(E,vc(E,"Month")+vt*q),De&&el(E,"Date",vc(E,"Date")+De*q),ee&&E._d.setTime(E._d.valueOf()+ee*q),z&&t.updateOffset(E,De||vt))}var ni=qp(1,"add"),Ld=qp(-1,"subtract");function Xh(E){return typeof E=="string"||E instanceof String}function Qh(E){return Ce(E)||y(E)||Xh(E)||m(E)||Hy(E)||Vy(E)||E===null||E===void 0}function Vy(E){var I=a(E)&&!l(E),q=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],ee,De,vt=z.length;for(ee=0;ee<vt;ee+=1)De=z[ee],q=q||n(E,De);return I&&q}function Hy(E){var I=s(E),q=!1;return I&&(q=E.filter(function(z){return!m(z)&&Xh(E)}).length===0),I&&q}function yv(E){var I=a(E)&&!l(E),q=!1,z=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],ee,De;for(ee=0;ee<z.length;ee+=1)De=z[ee],q=q||n(E,De);return I&&q}function vx(E,I){var q=E.diff(I,"days",!0);return q<-6?"sameElse":q<-1?"lastWeek":q<0?"lastDay":q<1?"sameDay":q<2?"nextDay":q<7?"nextWeek":"sameElse"}function am(E,I){arguments.length===1&&(arguments[0]?Qh(arguments[0])?(E=arguments[0],I=void 0):yv(arguments[0])&&(I=arguments[0],E=void 0):(E=void 0,I=void 0));var q=E||wn(),z=io(q,this).startOf("day"),ee=t.calendarFormat(this,z)||"sameElse",De=I&&(lt(I[ee])?I[ee].call(this,q):I[ee]);return this.format(De||this.localeData().calendar(ee,this,wn(q)))}function Zh(){return new me(this)}function gv(E,I){var q=Ce(E)?E:wn(E);return this.isValid()&&q.isValid()?(I=ge(I)||"millisecond",I==="millisecond"?this.valueOf()>q.valueOf():q.valueOf()<this.clone().startOf(I).valueOf()):!1}function Qu(E,I){var q=Ce(E)?E:wn(E);return this.isValid()&&q.isValid()?(I=ge(I)||"millisecond",I==="millisecond"?this.valueOf()<q.valueOf():this.clone().endOf(I).valueOf()<q.valueOf()):!1}function Gl(E,I,q,z){var ee=Ce(E)?E:wn(E),De=Ce(I)?I:wn(I);return this.isValid()&&ee.isValid()&&De.isValid()?(z=z||"()",(z[0]==="("?this.isAfter(ee,q):!this.isBefore(ee,q))&&(z[1]===")"?this.isBefore(De,q):!this.isAfter(De,q))):!1}function Ea(E,I){var q=Ce(E)?E:wn(E),z;return this.isValid()&&q.isValid()?(I=ge(I)||"millisecond",I==="millisecond"?this.valueOf()===q.valueOf():(z=q.valueOf(),this.clone().startOf(I).valueOf()<=z&&z<=this.clone().endOf(I).valueOf())):!1}function vu(E,I){return this.isSame(E,I)||this.isAfter(E,I)}function Ta(E,I){return this.isSame(E,I)||this.isBefore(E,I)}function Up(E,I,q){var z,ee,De;if(!this.isValid())return NaN;if(z=io(E,this),!z.isValid())return NaN;switch(ee=(z.utcOffset()-this.utcOffset())*6e4,I=ge(I),I){case"year":De=xu(this,z)/12;break;case"month":De=xu(this,z);break;case"quarter":De=xu(this,z)/3;break;case"second":De=(this-z)/1e3;break;case"minute":De=(this-z)/6e4;break;case"hour":De=(this-z)/36e5;break;case"day":De=(this-z-ee)/864e5;break;case"week":De=(this-z-ee)/6048e5;break;default:De=this-z}return q?De:Si(De)}function xu(E,I){if(E.date()<I.date())return-xu(I,E);var q=(I.year()-E.year())*12+(I.month()-E.month()),z=E.clone().add(q,"months"),ee,De;return I-z<0?(ee=E.clone().add(q-1,"months"),De=(I-z)/(z-ee)):(ee=E.clone().add(q+1,"months"),De=(I-z)/(ee-z)),-(q+De)||0}t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function al(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Cf(E){if(!this.isValid())return null;var I=E!==!0,q=I?this.clone().utc():this;return q.year()<0||q.year()>9999?Ze(q,I?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):lt(Date.prototype.toISOString)?I?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ze(q,"Z")):Ze(q,I?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Af(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var E="moment",I="",q,z,ee,De;return this.isLocal()||(E=this.utcOffset()===0?"moment.utc":"moment.parseZone",I="Z"),q="["+E+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",ee="-MM-DD[T]HH:mm:ss.SSS",De=I+'[")]',this.format(q+z+ee+De)}function Md(E){E||(E=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var I=Ze(this,E);return this.localeData().postformat(I)}function Wy(E,I){return this.isValid()&&(Ce(E)&&E.isValid()||wn(E).isValid())?So({to:this,from:E}).locale(this.locale()).humanize(!I):this.localeData().invalidDate()}function um(E){return this.from(wn(),E)}function Df(E,I){return this.isValid()&&(Ce(E)&&E.isValid()||wn(E).isValid())?So({from:this,to:E}).locale(this.locale()).humanize(!I):this.localeData().invalidDate()}function Kl(E){return this.to(wn(),E)}function cm(E){var I;return E===void 0?this._locale._abbr:(I=Je(E),I!=null&&(this._locale=I),this)}var _u=Ve("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 lm(){return this._locale}var ul=1e3,wc=60*ul,Yl=60*wc,zy=(365*400+97)*24*Yl;function Ti(E,I){return(E%I+I)%I}function Fo(E,I,q){return E<100&&E>=0?new Date(E+400,I,q)-zy:new Date(E,I,q).valueOf()}function Su(E,I,q){return E<100&&E>=0?Date.UTC(E+400,I,q)-zy:Date.UTC(E,I,q)}function Zu(E){var I,q;if(E=ge(E),E===void 0||E==="millisecond"||!this.isValid())return this;switch(q=this._isUTC?Su:Fo,E){case"year":I=q(this.year(),0,1);break;case"quarter":I=q(this.year(),this.month()-this.month()%3,1);break;case"month":I=q(this.year(),this.month(),1);break;case"week":I=q(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":I=q(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":I=q(this.year(),this.month(),this.date());break;case"hour":I=this._d.valueOf(),I-=Ti(I+(this._isUTC?0:this.utcOffset()*wc),Yl);break;case"minute":I=this._d.valueOf(),I-=Ti(I,wc);break;case"second":I=this._d.valueOf(),I-=Ti(I,ul);break}return this._d.setTime(I),t.updateOffset(this,!0),this}function cl(E){var I,q;if(E=ge(E),E===void 0||E==="millisecond"||!this.isValid())return this;switch(q=this._isUTC?Su:Fo,E){case"year":I=q(this.year()+1,0,1)-1;break;case"quarter":I=q(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":I=q(this.year(),this.month()+1,1)-1;break;case"week":I=q(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":I=q(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":I=q(this.year(),this.month(),this.date()+1)-1;break;case"hour":I=this._d.valueOf(),I+=Yl-Ti(I+(this._isUTC?0:this.utcOffset()*wc),Yl)-1;break;case"minute":I=this._d.valueOf(),I+=wc-Ti(I,wc)-1;break;case"second":I=this._d.valueOf(),I+=ul-Ti(I,ul)-1;break}return this._d.setTime(I),t.updateOffset(this,!0),this}function Xa(){return this._d.valueOf()-(this._offset||0)*6e4}function $p(){return Math.floor(this.valueOf()/1e3)}function ll(){return new Date(this.valueOf())}function vv(){var E=this;return[E.year(),E.month(),E.date(),E.hour(),E.minute(),E.second(),E.millisecond()]}function pm(){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 kf(){return this.isValid()?this.toISOString():null}function Bd(){return L(this)}function xx(){return b({},g(this))}function Gy(){return g(this).overflow}function e0(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Qe("N",0,0,"eraAbbr"),Qe("NN",0,0,"eraAbbr"),Qe("NNN",0,0,"eraAbbr"),Qe("NNNN",0,0,"eraName"),Qe("NNNNN",0,0,"eraNarrow"),Qe("y",["y",1],"yo","eraYear"),Qe("y",["yy",2],0,"eraYear"),Qe("y",["yyy",3],0,"eraYear"),Qe("y",["yyyy",4],0,"eraYear"),Mt("N",qd),Mt("NN",qd),Mt("NNN",qd),Mt("NNNN",r0),Mt("NNNNN",n0),On(["N","NN","NNN","NNNN","NNNNN"],function(E,I,q,z){var ee=q._locale.erasParse(E,z,q._strict);ee?g(q).era=ee:g(q).invalidEra=E}),Mt("y",za),Mt("yy",za),Mt("yyy",za),Mt("yyyy",za),Mt("yo",dm),On(["y","yy","yyy","yyyy"],ur),On(["yo"],function(E,I,q,z){var ee;q._locale._eraYearOrdinalRegex&&(ee=E.match(q._locale._eraYearOrdinalRegex)),q._locale.eraYearOrdinalParse?I[ur]=q._locale.eraYearOrdinalParse(E,ee):I[ur]=parseInt(E,10)});function Ky(E,I){var q,z,ee,De=this._eras||Je("en")._eras;for(q=0,z=De.length;q<z;++q){switch(typeof De[q].since){case"string":ee=t(De[q].since).startOf("day"),De[q].since=ee.valueOf();break}switch(typeof De[q].until){case"undefined":De[q].until=1/0;break;case"string":ee=t(De[q].until).startOf("day").valueOf(),De[q].until=ee.valueOf();break}}return De}function Yy(E,I,q){var z,ee,De=this.eras(),vt,fr,dn;for(E=E.toUpperCase(),z=0,ee=De.length;z<ee;++z)if(vt=De[z].name.toUpperCase(),fr=De[z].abbr.toUpperCase(),dn=De[z].narrow.toUpperCase(),q)switch(I){case"N":case"NN":case"NNN":if(fr===E)return De[z];break;case"NNNN":if(vt===E)return De[z];break;case"NNNNN":if(dn===E)return De[z];break}else if([vt,fr,dn].indexOf(E)>=0)return De[z]}function fm(E,I){var q=E.since<=E.until?1:-1;return I===void 0?t(E.since).year():t(E.since).year()+(I-E.offset)*q}function Vp(){var E,I,q,z=this.localeData().eras();for(E=0,I=z.length;E<I;++E)if(q=this.clone().startOf("day").valueOf(),z[E].since<=q&&q<=z[E].until||z[E].until<=q&&q<=z[E].since)return z[E].name;return""}function Jy(){var E,I,q,z=this.localeData().eras();for(E=0,I=z.length;E<I;++E)if(q=this.clone().startOf("day").valueOf(),z[E].since<=q&&q<=z[E].until||z[E].until<=q&&q<=z[E].since)return z[E].narrow;return""}function xv(){var E,I,q,z=this.localeData().eras();for(E=0,I=z.length;E<I;++E)if(q=this.clone().startOf("day").valueOf(),z[E].since<=q&&q<=z[E].until||z[E].until<=q&&q<=z[E].since)return z[E].abbr;return""}function jd(){var E,I,q,z,ee=this.localeData().eras();for(E=0,I=ee.length;E<I;++E)if(q=ee[E].since<=ee[E].until?1:-1,z=this.clone().startOf("day").valueOf(),ee[E].since<=z&&z<=ee[E].until||ee[E].until<=z&&z<=ee[E].since)return(this.year()-t(ee[E].since).year())*q+ee[E].offset;return this.year()}function wa(E){return n(this,"_erasNameRegex")||Of.call(this),E?this._erasNameRegex:this._erasRegex}function t0(E){return n(this,"_erasAbbrRegex")||Of.call(this),E?this._erasAbbrRegex:this._erasRegex}function If(E){return n(this,"_erasNarrowRegex")||Of.call(this),E?this._erasNarrowRegex:this._erasRegex}function qd(E,I){return I.erasAbbrRegex(E)}function r0(E,I){return I.erasNameRegex(E)}function n0(E,I){return I.erasNarrowRegex(E)}function dm(E,I){return I._eraYearOrdinalRegex||za}function Of(){var E=[],I=[],q=[],z=[],ee,De,vt,fr,dn,fi=this.eras();for(ee=0,De=fi.length;ee<De;++ee)vt=Di(fi[ee].name),fr=Di(fi[ee].abbr),dn=Di(fi[ee].narrow),I.push(vt),E.push(fr),q.push(dn),z.push(vt),z.push(fr),z.push(dn);this._erasRegex=new RegExp("^("+z.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+I.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+E.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+q.join("|")+")","i")}Qe(0,["gg",2],0,function(){return this.weekYear()%100}),Qe(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Nf(E,I){Qe(0,[E,E.length],0,I)}Nf("gggg","weekYear"),Nf("ggggg","weekYear"),Nf("GGGG","isoWeekYear"),Nf("GGGGG","isoWeekYear"),Mt("G",rt),Mt("g",rt),Mt("GG",En,Vr),Mt("gg",En,Vr),Mt("GGGG",Vo,jn),Mt("gggg",Vo,jn),Mt("GGGGG",Vu,ei),Mt("ggggg",Vu,ei),Ss(["gggg","ggggg","GGGG","GGGGG"],function(E,I,q,z){I[z.substr(0,2)]=sn(E)}),Ss(["gg","GG"],function(E,I,q,z){I[z]=t.parseTwoDigitYear(E)});function Rf(E){return bu.call(this,E,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Xy(E){return bu.call(this,E,this.isoWeek(),this.isoWeekday(),1,4)}function i0(){return ji(this.year(),1,4)}function s0(){return ji(this.isoWeekYear(),1,4)}function Jl(){var E=this.localeData()._week;return ji(this.year(),E.dow,E.doy)}function Hp(){var E=this.localeData()._week;return ji(this.weekYear(),E.dow,E.doy)}function bu(E,I,q,z,ee){var De;return E==null?or(this,z,ee).year:(De=ji(E,z,ee),I>De&&(I=De),Wp.call(this,E,I,q,z,ee))}function Wp(E,I,q,z,ee){var De=Od(E,I,q,z,ee),vt=Sf(De.year,0,De.dayOfYear);return this.year(vt.getUTCFullYear()),this.month(vt.getUTCMonth()),this.date(vt.getUTCDate()),this}Qe("Q",0,"Qo","quarter"),Mt("Q",$r),On("Q",function(E,I){I[Ao]=(sn(E)-1)*3});function hm(E){return E==null?Math.ceil((this.month()+1)/3):this.month((E-1)*3+this.month()%3)}Qe("D",["DD",2],"Do","date"),Mt("D",En,xr),Mt("DD",En,Vr),Mt("Do",function(E,I){return E?I._dayOfMonthOrdinalParse||I._ordinalParse:I._dayOfMonthOrdinalParseLenient}),On(["D","DD"],co),On("Do",function(E,I){I[co]=sn(E.match(En)[0])});var Xl=tn("Date",!0);Qe("DDD",["DDDD",3],"DDDo","dayOfYear"),Mt("DDD",ps),Mt("DDDD",Hn),On(["DDD","DDDD"],function(E,I,q){q._dayOfYear=sn(E)});function Pc(E){var I=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return E==null?I:this.add(E-I,"d")}Qe("m",["mm",2],0,"minute"),Mt("m",En,In),Mt("mm",En,Vr),On(["m","mm"],Do);var mm=tn("Minutes",!1);Qe("s",["ss",2],0,"second"),Mt("s",En,In),Mt("ss",En,Vr),On(["s","ss"],lo);var Ud=tn("Seconds",!1);Qe("S",0,0,function(){return~~(this.millisecond()/100)}),Qe(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Qe(0,["SSS",3],0,"millisecond"),Qe(0,["SSSS",4],0,function(){return this.millisecond()*10}),Qe(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Qe(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Qe(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Qe(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Qe(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Mt("S",ps,$r),Mt("SS",ps,Vr),Mt("SSS",ps,Hn);var ec,ym;for(ec="SSSS";ec.length<=9;ec+="S")Mt(ec,za);function Qy(E,I){I[js]=sn(("0."+E)*1e3)}for(ec="S";ec.length<=9;ec+="S")On(ec,Qy);ym=tn("Milliseconds",!1),Qe("z",0,0,"zoneAbbr"),Qe("zz",0,0,"zoneName");function o0(){return this._isUTC?"UTC":""}function a0(){return this._isUTC?"Coordinated Universal Time":""}var Yt=me.prototype;Yt.add=ni,Yt.calendar=am,Yt.clone=Zh,Yt.diff=Up,Yt.endOf=cl,Yt.format=Md,Yt.from=Wy,Yt.fromNow=um,Yt.to=Df,Yt.toNow=Kl,Yt.get=du,Yt.invalidAt=Gy,Yt.isAfter=gv,Yt.isBefore=Qu,Yt.isBetween=Gl,Yt.isSame=Ea,Yt.isSameOrAfter=vu,Yt.isSameOrBefore=Ta,Yt.isValid=Bd,Yt.lang=_u,Yt.locale=cm,Yt.localeData=lm,Yt.max=zo,Yt.min=Jh,Yt.parsingFlags=xx,Yt.set=fs,Yt.startOf=Zu,Yt.subtract=Ld,Yt.toArray=vv,Yt.toObject=pm,Yt.toDate=ll,Yt.toISOString=Cf,Yt.inspect=Af,typeof Symbol<"u"&&Symbol.for!=null&&(Yt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Yt.toJSON=kf,Yt.toString=al,Yt.unix=$p,Yt.valueOf=Xa,Yt.creationData=e0,Yt.eraName=Vp,Yt.eraNarrow=Jy,Yt.eraAbbr=xv,Yt.eraYear=jd,Yt.year=Wu,Yt.isLeapYear=Fl,Yt.weekYear=Rf,Yt.isoWeekYear=Xy,Yt.quarter=Yt.quarters=hm,Yt.month=hu,Yt.daysInMonth=em,Yt.week=Yt.weeks=tm,Yt.isoWeek=Yt.isoWeeks=Hh,Yt.weeksInYear=Jl,Yt.weeksInWeekYear=Hp,Yt.isoWeeksInYear=i0,Yt.isoWeeksInISOWeekYear=s0,Yt.date=Xl,Yt.day=Yt.days=Ns,Yt.weekday=Tn,Yt.isoWeekday=Gu,Yt.dayOfYear=Pc,Yt.hour=Yt.hours=va,Yt.minute=Yt.minutes=mm,Yt.second=Yt.seconds=Ud,Yt.millisecond=Yt.milliseconds=ym,Yt.utcOffset=Pf,Yt.utc=im,Yt.local=sm,Yt.parseZone=ta,Yt.hasAlignedHourOffset=Sa,Yt.isDST=Ja,Yt.isLocal=Hl,Yt.isUtcOffset=Wl,Yt.isUtc=Ei,Yt.isUTC=Ei,Yt.zoneAbbr=o0,Yt.zoneName=a0,Yt.dates=Ve("dates accessor is deprecated. Use date instead.",Xl),Yt.months=Ve("months accessor is deprecated. Use month instead",hu),Yt.years=Ve("years accessor is deprecated. Use year instead",Wu),Yt.zone=Ve("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",bi),Yt.isDSTShifted=Ve("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Vl);function fn(E){return wn(E*1e3)}function ra(){return wn.apply(null,arguments).parseZone()}function po(E){return E}var Pn=se.prototype;Pn.calendar=Se,Pn.longDateFormat=Tt,Pn.invalidDate=ht,Pn.ordinal=Kt,Pn.preparse=po,Pn.postformat=po,Pn.relativeTime=xt,Pn.pastFuture=St,Pn.set=ut,Pn.eras=Ky,Pn.erasParse=Yy,Pn.erasConvertYear=fm,Pn.erasAbbrRegex=t0,Pn.erasNameRegex=wa,Pn.erasNarrowRegex=If,Pn.months=Z0,Pn.monthsShort=kp,Pn.monthsParse=ga,Pn.monthsRegex=ns,Pn.monthsShortRegex=Ip,Pn.week=Nd,Pn.firstDayOfYear=bf,Pn.firstDayOfWeek=mu,Pn.weekdays=rl,Pn.weekdaysMin=zu,Pn.weekdaysShort=yu,Pn.weekdaysParse=Sc,Pn.weekdaysRegex=Gh,Pn.weekdaysShortRegex=Gs,Pn.weekdaysMinRegex=jl,Pn.isPM=Kh,Pn.meridiem=Lp;function Ua(E,I,q,z){var ee=Je(),De=P().set(z,I);return ee[q](De,E)}function $d(E,I,q){if(m(E)&&(I=E,E=void 0),E=E||"",I!=null)return Ua(E,I,q,"month");var z,ee=[];for(z=0;z<12;z++)ee[z]=Ua(E,z,q,"month");return ee}function Js(E,I,q,z){typeof E=="boolean"?(m(I)&&(q=I,I=void 0),I=I||""):(I=E,q=I,E=!1,m(I)&&(q=I,I=void 0),I=I||"");var ee=Je(),De=E?ee._week.dow:0,vt,fr=[];if(q!=null)return Ua(I,(q+De)%7,z,"day");for(vt=0;vt<7;vt++)fr[vt]=Ua(I,(vt+De)%7,z,"day");return fr}function Vd(E,I){return $d(E,I,"months")}function Rn(E,I){return $d(E,I,"monthsShort")}function Ff(E,I,q){return Js(E,I,q,"weekdays")}function zp(E,I,q){return Js(E,I,q,"weekdaysShort")}function gm(E,I,q){return Js(E,I,q,"weekdaysMin")}ae("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 I=E%10,q=sn(E%100/10)===1?"th":I===1?"st":I===2?"nd":I===3?"rd":"th";return E+q}}),t.lang=Ve("moment.lang is deprecated. Use moment.locale instead.",ae),t.langData=Ve("moment.langData is deprecated. Use moment.localeData instead.",Je);var Cc=Math.abs;function vm(){var E=this._data;return this._milliseconds=Cc(this._milliseconds),this._days=Cc(this._days),this._months=Cc(this._months),E.milliseconds=Cc(E.milliseconds),E.seconds=Cc(E.seconds),E.minutes=Cc(E.minutes),E.hours=Cc(E.hours),E.months=Cc(E.months),E.years=Cc(E.years),this}function u0(E,I,q,z){var ee=So(I,q);return E._milliseconds+=z*ee._milliseconds,E._days+=z*ee._days,E._months+=z*ee._months,E._bubble()}function Ql(E,I){return u0(this,E,I,1)}function Ar(E,I){return u0(this,E,I,-1)}function Gp(E){return E<0?Math.floor(E):Math.ceil(E)}function xm(){var E=this._milliseconds,I=this._days,q=this._months,z=this._data,ee,De,vt,fr,dn;return E>=0&&I>=0&&q>=0||E<=0&&I<=0&&q<=0||(E+=Gp(Ac(q)+I)*864e5,I=0,q=0),z.milliseconds=E%1e3,ee=Si(E/1e3),z.seconds=ee%60,De=Si(ee/60),z.minutes=De%60,vt=Si(De/60),z.hours=vt%24,I+=Si(vt/24),dn=Si(Eu(I)),q+=dn,I-=Gp(Ac(dn)),fr=Si(q/12),q%=12,z.days=I,z.months=q,z.years=fr,this}function Eu(E){return E*4800/146097}function Ac(E){return E*146097/4800}function Hd(E){if(!this.isValid())return NaN;var I,q,z=this._milliseconds;if(E=ge(E),E==="month"||E==="quarter"||E==="year")switch(I=this._days+z/864e5,q=this._months+Eu(I),E){case"month":return q;case"quarter":return q/3;case"year":return q/12}else switch(I=this._days+Math.round(Ac(this._months)),E){case"week":return I/7+z/6048e5;case"day":return I+z/864e5;case"hour":return I*24+z/36e5;case"minute":return I*1440+z/6e4;case"second":return I*86400+z/1e3;case"millisecond":return Math.floor(I*864e5)+z;default:throw new Error("Unknown unit "+E)}}function Qa(E){return function(){return this.as(E)}}var Lf=Qa("ms"),_m=Qa("s"),pl=Qa("m"),Wd=Qa("h"),Kp=Qa("d"),Mf=Qa("w"),tc=Qa("M"),Dc=Qa("Q"),zd=Qa("y"),Yp=Lf;function Pa(){return So(this)}function Ui(E){return E=ge(E),this.isValid()?this[E+"s"]():NaN}function Oi(E){return function(){return this.isValid()?this._data[E]:NaN}}var c0=Oi("milliseconds"),Za=Oi("seconds"),Zy=Oi("minutes"),Bf=Oi("hours"),Sm=Oi("days"),_v=Oi("months"),bm=Oi("years");function l0(){return Si(this.days()/7)}var Tu=Math.round,Zl={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jf(E,I,q,z,ee){return ee.relativeTime(I||1,!!q,E,z)}function eg(E,I,q,z){var ee=So(E).abs(),De=Tu(ee.as("s")),vt=Tu(ee.as("m")),fr=Tu(ee.as("h")),dn=Tu(ee.as("d")),fi=Tu(ee.as("M")),ia=Tu(ee.as("w")),eu=Tu(ee.as("y")),qs=De<=q.ss&&["s",De]||De<q.s&&["ss",De]||vt<=1&&["m"]||vt<q.m&&["mm",vt]||fr<=1&&["h"]||fr<q.h&&["hh",fr]||dn<=1&&["d"]||dn<q.d&&["dd",dn];return q.w!=null&&(qs=qs||ia<=1&&["w"]||ia<q.w&&["ww",ia]),qs=qs||fi<=1&&["M"]||fi<q.M&&["MM",fi]||eu<=1&&["y"]||["yy",eu],qs[2]=I,qs[3]=+E>0,qs[4]=z,jf.apply(null,qs)}function tg(E){return E===void 0?Tu:typeof E=="function"?(Tu=E,!0):!1}function Gd(E,I){return Zl[E]===void 0?!1:I===void 0?Zl[E]:(Zl[E]=I,E==="s"&&(Zl.ss=I-1),!0)}function Sv(E,I){if(!this.isValid())return this.localeData().invalidDate();var q=!1,z=Zl,ee,De;return typeof E=="object"&&(I=E,E=!1),typeof E=="boolean"&&(q=E),typeof I=="object"&&(z=Object.assign({},Zl,I),I.s!=null&&I.ss==null&&(z.ss=I.s-1)),ee=this.localeData(),De=eg(this,!q,z,ee),q&&(De=ee.pastFuture(+this,De)),ee.postformat(De)}var p0=Math.abs;function ep(E){return(E>0)-(E<0)||+E}function na(){if(!this.isValid())return this.localeData().invalidDate();var E=p0(this._milliseconds)/1e3,I=p0(this._days),q=p0(this._months),z,ee,De,vt,fr=this.asSeconds(),dn,fi,ia,eu;return fr?(z=Si(E/60),ee=Si(z/60),E%=60,z%=60,De=Si(q/12),q%=12,vt=E?E.toFixed(3).replace(/\.?0+$/,""):"",dn=fr<0?"-":"",fi=ep(this._months)!==ep(fr)?"-":"",ia=ep(this._days)!==ep(fr)?"-":"",eu=ep(this._milliseconds)!==ep(fr)?"-":"",dn+"P"+(De?fi+De+"Y":"")+(q?fi+q+"M":"")+(I?ia+I+"D":"")+(ee||z||E?"T":"")+(ee?eu+ee+"H":"")+(z?eu+z+"M":"")+(E?eu+vt+"S":"")):"P0D"}var qn=Ec.prototype;qn.isValid=Fd,qn.abs=vm,qn.add=Ql,qn.subtract=Ar,qn.as=Hd,qn.asMilliseconds=Lf,qn.asSeconds=_m,qn.asMinutes=pl,qn.asHours=Wd,qn.asDays=Kp,qn.asWeeks=Mf,qn.asMonths=tc,qn.asQuarters=Dc,qn.asYears=zd,qn.valueOf=Yp,qn._bubble=xm,qn.clone=Pa,qn.get=Ui,qn.milliseconds=c0,qn.seconds=Za,qn.minutes=Zy,qn.hours=Bf,qn.days=Sm,qn.weeks=l0,qn.months=_v,qn.years=bm,qn.humanize=Sv,qn.toISOString=na,qn.toString=na,qn.toJSON=na,qn.locale=cm,qn.localeData=lm,qn.toIsoString=Ve("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",na),qn.lang=_u,Qe("X",0,0,"unix"),Qe("x",0,0,"valueOf"),Mt("x",rt),Mt("X",Jt),On("X",function(E,I,q){q._d=new Date(parseFloat(E)*1e3)}),On("x",function(E,I,q){q._d=new Date(sn(E))});return t.version="2.30.1",r(wn),t.fn=Yt,t.min=Ka,t.max=Rd,t.now=Tf,t.utc=P,t.unix=fn,t.months=Vd,t.isDate=y,t.locale=ae,t.invalid=M,t.duration=So,t.isMoment=Ce,t.weekdays=Ff,t.parseZone=ra,t.localeData=Je,t.isDuration=qa,t.monthsShort=Rn,t.weekdaysMin=gm,t.defineLocale=Re,t.updateLocale=nt,t.locales=gt,t.weekdaysShort=zp,t.normalizeUnits=ge,t.relativeTimeRounding=tg,t.relativeTimeThreshold=Gd,t.calendarFormat=vx,t.prototype=Yt,t.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"},t})});function D0(){return!process.stdout.isTTY||process.env.FORCE_NON_TTY==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.PAGES_SOURCE==="skills"||process.env.EDGEONE_NON_INTERACTIVE==="1"}function mC({prefix:e="cli"}){return Vs.default.createElement(Bs.Text,{color:"grey"},"[",e,"]")}function yi(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m\x1B[31m[\u2718] \x1B[0m${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t}),Vs.default.createElement(Bs.Text,{color:"red"},"[\u2718] "),e));r()}function yC(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m\x1B[32m[\u2714] \x1B[0m${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t}),Vs.default.createElement(Bs.Text,{color:"green"},"[\u2714] "),e));r()}function pi(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m \x1B[33mWARNING:\x1B[0m ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t}),Vs.default.createElement(Bs.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Mz(e){if(D0()){console.log(e);return}let{unmount:t}=(0,Bs.render)(Vs.default.createElement(Bs.Text,{color:"cyan"},e));t()}function Ct(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t})," ",e));r()}function jR({timestamp:e}){return Vs.default.createElement(Bs.Box,{width:13},Vs.default.createElement(Bs.Text,{color:"grey"},(0,Hb.default)(e).format("HH:mm:ss.SSS")))}function Bz(e,t){if(D0()){console.log(`${(0,Hb.default)(t).format("HH:mm:ss.SSS")} ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Box,null,Vs.default.createElement(jR,{timestamp:t}),Vs.default.createElement(Bs.Text,null,e)));r()}function jz(e,t){if(D0()){console.log(`${(0,Hb.default)(t).format("HH:mm:ss.SSS")} [WARNING] ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Box,null,Vs.default.createElement(jR,{timestamp:t}),Vs.default.createElement(Bs.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Vs.default.createElement(Bs.Text,null," ",e)));r()}function qR(e,t){if(D0()){console.log(`${(0,Hb.default)(t).format("HH:mm:ss.SSS")} [ERROR] ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Box,null,Vs.default.createElement(jR,{timestamp:t}),Vs.default.createElement(Bs.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Vs.default.createElement(Bs.Text,null," ",e)));r()}var Bs,Vs,Hb,ua=ft(()=>{Bs=Lt(hC()),Vs=Lt(yo()),Hb=Lt(Lz())});var Uz,qz=ft(()=>{Uz={name:"edgeone",version:"1.6.18",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/pages/templates","./edgeone-dist/pages/dev/runner-worker.js","./edgeone-dist/pages/observability-python/**","./edgeone-dist/libs-pages-blob-python/**","./edgeone-dist/libs-pages-agent-toolkit/**","./edgeone-dist/studio/**","./libs-pages-blob-python/**","./libs-pages-agent-toolkit/**"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai ./libs-kv-client",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run build:kv-client && npm run prepare:blob-wheel && npm run prepare:agent-toolkit-wheel && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js","build:kv-client":"node ./scripts/build-kv-client.js","prepare:blob-wheel":"node ./scripts/prepare-pages-blob-wheel.js","prepare:agent-toolkit-wheel":"node ./scripts/prepare-pages-agent-toolkit-wheel.js","verify:publish-assets":"node ./scripts/verify-publish-assets.js","upload:agent-version-manifest":"node ./scripts/upload-agent-version-manifest.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build && npm run verify:publish-assets",prepublishOnly:"npm run build && npm run verify:publish-assets",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:observability":"vitest run --config src/agent/observability/node/tests/vitest.config.ts && cd src/agent/observability/python && uv run pytest tests/ -q"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/is-spa":"^0.0.3","@edgeone/nuxt-pages":"1.1.0","@edgeone/opennextjs-pages":"0.2.10","@edgeone/pages-agent-toolkit":"^0.1.34","@edgeone/pages-blob":"^0.0.13",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1",giget:"^2.0.0","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0",vitest:"^4.0.17"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@opentelemetry/api":"^1.9.1","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-metrics-otlp-http":"^0.55.0","@opentelemetry/exporter-trace-otlp-http":"^0.55.0","@opentelemetry/instrumentation":"^0.55.0","@opentelemetry/otlp-transformer":"^0.55.0","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.40.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24","@vitest/coverage-v8":"^4.0.17",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",protobufjs:"^8.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2",zod:"^3.23.8","zod-to-json-schema":"^3.23.5"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}}});function vIe(){var e,t;return{run_id:gIe,cli_version:(t=(e=Uz)==null?void 0:e.version)!=null?t:"unknown",node_version:process.version,os_platform:$R.default.platform(),os_arch:$R.default.arch(),app_type:"cli",app_id:process.env.AppId||void 0,uin:process.env.Uin||void 0,instance_id:process.env.ProjectId||void 0,is_ci:process.env.CI==="true"}}function xIe(e,t){try{if(typeof process.send!="function")return;process.send(JSON.stringify({name:e,value:JSON.stringify(t)}))}catch{}}function lu(e){var r;let t={...vIe(),...e};xIe((r=t.event_name)!=null?r:"unknown",t)}function ld(e){if(e==null)return{message:"unknown error",stack:""};if(typeof e=="string")return{message:gC(e,UR),stack:""};if(typeof e=="object"){let t=e,r=gC(typeof t.message=="string"?t.message:String(t),UR),s=gC(typeof t.stack=="string"?t.stack:"",_Ie);return{message:r,stack:s}}return{message:gC(String(e),UR),stack:""}}function gC(e,t){return e.length>t?e.slice(0,t)+"\u2026[truncated]":e}var $R,uu,cu,gIe,VR,UR,_Ie,fy=ft(()=>{$R=Lt(require("os"));qz();uu={COMMAND:"command",REQUEST:"request",LOCAL_FLOW:"local_flow",EXIT:"exit"},cu={SUCCESS:"success",FAIL:"fail",START:"start"},gIe=`cli-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;VR=(e,t)=>{let r=ld(t);lu({event_name:"error",event_scope:uu.COMMAND,event_result:cu.FAIL,error_message:`${e} ${r.message}`.trim(),error_stack:r.stack})},UR=500,_Ie=2e3});var Wb,S2,HR=ft(()=>{Wb={NEXTJS:"nextjs",NUXTJS:"nuxtjs",ASTRO:"astro",UNKNOWN:"unknown"},S2={FRAMEWORK_DETECT:"framework_detect",PLUGIN_RESOLVE:"plugin_resolve",PLUGIN_LOAD:"plugin_load",PLUGIN_HOOK:"plugin_hook",CONFIG_LOAD:"config_load"}});function EIe(e){if((e==null?void 0:e.code)===bIe)return!0;let t=typeof e=="string"?e:e==null?void 0:e.message;return t==null?void 0:t.includes(SIe)}async function Fg(e=!1){try{let t=await TP(e);return lu({event_name:"Config:Load:Success",event_scope:uu.LOCAL_FLOW,event_phase:S2.CONFIG_LOAD,event_result:cu.SUCCESS,has_build_command:(t==null?void 0:t.buildCommand)!=null,has_install_command:(t==null?void 0:t.installCommand)!=null,has_output_directory:(t==null?void 0:t.outputDirectory)!=null,has_node_version:(t==null?void 0:t.nodeVersion)!=null}),t}catch(t){let r=ld(t);if(lu({event_name:"Config:Load:Fail",event_scope:uu.LOCAL_FLOW,event_phase:S2.CONFIG_LOAD,event_result:cu.FAIL,error_message:r.message}),EIe(t))throw t;return od()&&console.error("%c [ error ]-80","font-size:13px; background:pink; color:#bf2c9f;",t),null}}var SIe,bIe,WR=ft(()=>{n2();xP();fy();HR();SIe="[BLOCKING_CONFIG_ERROR]",bIe="BLOCKING_CONFIG_ERROR"});var vC,fc,xC=ft(()=>{vC=[{funcName:"onRequestGet",method:"GET"},{funcName:"onRequestPost",method:"POST"},{funcName:"onRequestDelete",method:"DELETE"},{funcName:"onRequestPatch",method:"PATCH"},{funcName:"onRequestPut",method:"PUT"},{funcName:"onRequestHead",method:"HEAD"},{funcName:"onRequestOptions",method:"OPTIONS"}],fc=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"]});async function TIe(e){let t;_C.default.statSync(e).isFile()?t=b2.default.resolve(b2.default.dirname(e)):t=e;let r=b2.default.parse(t).root;if(t===r)return null;for(;t!==r;){let s=b2.default.join(t,"package.json");try{return await _C.default.promises.access(s),s}catch{if(t=b2.default.dirname(t),t===r)break}}return null}async function E2(e){if(e.endsWith(".mjs"))return"esm";if(e.endsWith(".cjs"))return"commonjs";try{let t=await TIe(e);if(t&&JSON.parse(await _C.default.promises.readFile(t,"utf-8")).type==="module")return"esm"}catch(t){console.warn("Failed to read package.json:",t)}return"commonjs"}var _C,b2,zb=ft(()=>{_C=Lt(require("fs")),b2=Lt(require("path"))});function PIe(e){let t=zR.default.extname(e);return wIe[t]||"ts"}function DIe(e){return e.split(",").map(t=>t.trim()).map(t=>{let r=t.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(!r)return"";let[,s,a]=r;return!AIe.has(a)||s===a?"":`const ${a} = ${s};`}).filter(Boolean).join(`
145
+ `+new Error().stack),q=!1}return I.apply(this,arguments)},I)}var Le={};function Pt(E,I){t.deprecationHandler!=null&&t.deprecationHandler(E,I),Le[E]||(Me(I),Le[E]=!0)}t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;function lt(E){return typeof Function<"u"&&E instanceof Function||Object.prototype.toString.call(E)==="[object Function]"}function ut(E){var I,q;for(q in E)n(E,q)&&(I=E[q],lt(I)?this[q]=I:this["_"+q]=I);this._config=E,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function je(E,I){var q=b({},E),z;for(z in I)n(I,z)&&(a(E[z])&&a(I[z])?(q[z]={},b(q[z],E[z]),b(q[z],I[z])):I[z]!=null?q[z]=I[z]:delete q[z]);for(z in E)n(E,z)&&!n(I,z)&&a(E[z])&&(q[z]=b({},q[z]));return q}function se(E){E!=null&&this.set(E)}var ke;Object.keys?ke=Object.keys:ke=function(E){var I,q=[];for(I in E)n(E,I)&&q.push(I);return q};var Ke={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Se(E,I,q){var z=this._calendar[E]||this._calendar.sameElse;return lt(z)?z.call(I,q):z}function Te(E,I,q){var z=""+Math.abs(E),ee=I-z.length,De=E>=0;return(De?q?"+":"":"-")+Math.pow(10,Math.max(0,ee)).toString().substr(1)+z}var Fe=/(\[[^\[]*\])|(\\)?([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,it=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,It={},Zt={};function Qe(E,I,q,z){var ee=z;typeof z=="string"&&(ee=function(){return this[z]()}),E&&(Zt[E]=ee),I&&(Zt[I[0]]=function(){return Te(ee.apply(this,arguments),I[1],I[2])}),q&&(Zt[q]=function(){return this.localeData().ordinal(ee.apply(this,arguments),E)})}function Ot(E){return E.match(/\[[\s\S]/)?E.replace(/^\[|\]$/g,""):E.replace(/\\/g,"")}function Ae(E){var I=E.match(Fe),q,z;for(q=0,z=I.length;q<z;q++)Zt[I[q]]?I[q]=Zt[I[q]]:I[q]=Ot(I[q]);return function(ee){var De="",vt;for(vt=0;vt<z;vt++)De+=lt(I[vt])?I[vt].call(ee,E):I[vt];return De}}function Ze(E,I){return E.isValid()?(I=at(I,E.localeData()),It[I]=It[I]||Ae(I),It[I](E)):E.localeData().invalidDate()}function at(E,I){var q=5;function z(ee){return I.longDateFormat(ee)||ee}for(it.lastIndex=0;q>=0&&it.test(E);)E=E.replace(it,z),it.lastIndex=0,q-=1;return E}var qt={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 Tt(E){var I=this._longDateFormat[E],q=this._longDateFormat[E.toUpperCase()];return I||!q?I:(this._longDateFormat[E]=q.match(Fe).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[E])}var pt="Invalid date";function ht(){return this._invalidDate}var C="%d",At=/\d{1,2}/;function Kt(E){return this._ordinal.replace("%d",E)}var Jr={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 xt(E,I,q,z){var ee=this._relativeTime[q];return lt(ee)?ee(E,I,q,z):ee.replace(/%d/i,E)}function St(E,I){var q=this._relativeTime[E>0?"future":"past"];return lt(q)?q(I):q.replace(/%s/i,I)}var tr={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 ge(E){return typeof E=="string"?tr[E]||tr[E.toLowerCase()]:void 0}function Ye(E){var I={},q,z;for(z in E)n(E,z)&&(q=ge(z),q&&(I[q]=E[z]));return I}var Ut={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 rr(E){var I=[],q;for(q in E)n(E,q)&&I.push({unit:q,priority:Ut[q]});return I.sort(function(z,ee){return z.priority-ee.priority}),I}var $r=/\d/,Vr=/\d\d/,Hn=/\d{3}/,jn=/\d{4}/,ei=/[+-]?\d{6}/,En=/\d\d?/,$o=/\d\d\d\d?/,Qo=/\d\d\d\d\d\d?/,ps=/\d{1,3}/,Vo=/\d{1,4}/,Vu=/[+-]?\d{1,6}/,za=/\d+/,rt=/[+-]?\d+/,Ft=/Z|[+-]\d\d:?\d\d/gi,Dt=/Z|[+-]\d\d(?::?\d\d)?/gi,Jt=/[+-]?\d+(\.\d{1,3})?/,Ir=/[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,xr=/^[1-9]\d?/,In=/^([1-9]\d|\d)/,_i;_i={};function Mt(E,I,q){_i[E]=lt(I)?I:function(z,ee){return z&&q?q:I}}function Ai(E,I){return n(_i,E)?_i[E](I._strict,I._locale):new RegExp(Ps(E))}function Ps(E){return Di(E.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(I,q,z,ee,De){return q||z||ee||De}))}function Di(E){return E.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Si(E){return E<0?Math.ceil(E)||0:Math.floor(E)}function sn(E){var I=+E,q=0;return I!==0&&isFinite(I)&&(q=Si(I)),q}var Ws={};function On(E,I){var q,z=I,ee;for(typeof E=="string"&&(E=[E]),m(I)&&(z=function(De,vt){vt[I]=sn(De)}),ee=E.length,q=0;q<ee;q++)Ws[E[q]]=z}function Ss(E,I){On(E,function(q,z,ee,De){ee._w=ee._w||{},I(q,ee._w,ee,De)})}function Hu(E,I,q){I!=null&&n(Ws,E)&&Ws[E](I,q._a,q,E)}function to(E){return E%4===0&&E%100!==0||E%400===0}var ur=0,Ao=1,co=2,Cs=3,Do=4,lo=5,js=6,Zc=7,fu=8;Qe("Y",0,0,function(){var E=this.year();return E<=9999?Te(E,4):"+"+E}),Qe(0,["YY",2],0,function(){return this.year()%100}),Qe(0,["YYYY",4],0,"year"),Qe(0,["YYYYY",5],0,"year"),Qe(0,["YYYYYY",6,!0],0,"year"),Mt("Y",rt),Mt("YY",En,Vr),Mt("YYYY",Vo,jn),Mt("YYYYY",Vu,ei),Mt("YYYYYY",Vu,ei),On(["YYYYY","YYYYYY"],ur),On("YYYY",function(E,I){I[ur]=E.length===2?t.parseTwoDigitYear(E):sn(E)}),On("YY",function(E,I){I[ur]=t.parseTwoDigitYear(E)}),On("Y",function(E,I){I[ur]=parseInt(E,10)});function Oa(E){return to(E)?366:365}t.parseTwoDigitYear=function(E){return sn(E)+(sn(E)>68?1900:2e3)};var Wu=tn("FullYear",!0);function Fl(){return to(this.year())}function tn(E,I){return function(q){return q!=null?(el(this,E,q),t.updateOffset(this,I),this):vc(this,E)}}function vc(E,I){if(!E.isValid())return NaN;var q=E._d,z=E._isUTC;switch(I){case"Milliseconds":return z?q.getUTCMilliseconds():q.getMilliseconds();case"Seconds":return z?q.getUTCSeconds():q.getSeconds();case"Minutes":return z?q.getUTCMinutes():q.getMinutes();case"Hours":return z?q.getUTCHours():q.getHours();case"Date":return z?q.getUTCDate():q.getDate();case"Day":return z?q.getUTCDay():q.getDay();case"Month":return z?q.getUTCMonth():q.getMonth();case"FullYear":return z?q.getUTCFullYear():q.getFullYear();default:return NaN}}function el(E,I,q){var z,ee,De,vt,fr;if(!(!E.isValid()||isNaN(q))){switch(z=E._d,ee=E._isUTC,I){case"Milliseconds":return void(ee?z.setUTCMilliseconds(q):z.setMilliseconds(q));case"Seconds":return void(ee?z.setUTCSeconds(q):z.setSeconds(q));case"Minutes":return void(ee?z.setUTCMinutes(q):z.setMinutes(q));case"Hours":return void(ee?z.setUTCHours(q):z.setHours(q));case"Date":return void(ee?z.setUTCDate(q):z.setDate(q));case"FullYear":break;default:return}De=q,vt=E.month(),fr=E.date(),fr=fr===29&&vt===1&&!to(De)?28:fr,ee?z.setUTCFullYear(De,vt,fr):z.setFullYear(De,vt,fr)}}function du(E){return E=ge(E),lt(this[E])?this[E]():this}function fs(E,I){if(typeof E=="object"){E=Ye(E);var q=rr(E),z,ee=q.length;for(z=0;z<ee;z++)this[q[z].unit](E[q[z].unit])}else if(E=ge(E),lt(this[E]))return this[E](I);return this}function Ji(E,I){return(E%I+I)%I}var Bi;Array.prototype.indexOf?Bi=Array.prototype.indexOf:Bi=function(E){var I;for(I=0;I<this.length;++I)if(this[I]===E)return I;return-1};function zs(E,I){if(isNaN(E)||isNaN(I))return NaN;var q=Ji(I,12);return E+=(I-q)/12,q===1?to(E)?29:28:31-q%7%2}Qe("M",["MM",2],"Mo",function(){return this.month()+1}),Qe("MMM",0,0,function(E){return this.localeData().monthsShort(this,E)}),Qe("MMMM",0,0,function(E){return this.localeData().months(this,E)}),Mt("M",En,xr),Mt("MM",En,Vr),Mt("MMM",function(E,I){return I.monthsShortRegex(E)}),Mt("MMMM",function(E,I){return I.monthsRegex(E)}),On(["M","MM"],function(E,I){I[Ao]=sn(E)-1}),On(["MMM","MMMM"],function(E,I,q,z){var ee=q._locale.monthsParse(E,z,q._strict);ee!=null?I[Ao]=ee:g(q).invalidMonth=E});var ko="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Na="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Zo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Io=Ir,Ll=Ir;function Z0(E,I){return E?s(this._months)?this._months[E.month()]:this._months[(this._months.isFormat||Zo).test(I)?"format":"standalone"][E.month()]:s(this._months)?this._months:this._months.standalone}function kp(E,I){return E?s(this._monthsShort)?this._monthsShort[E.month()]:this._monthsShort[Zo.test(I)?"format":"standalone"][E.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ml(E,I,q){var z,ee,De,vt=E.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],z=0;z<12;++z)De=P([2e3,z]),this._shortMonthsParse[z]=this.monthsShort(De,"").toLocaleLowerCase(),this._longMonthsParse[z]=this.months(De,"").toLocaleLowerCase();return q?I==="MMM"?(ee=Bi.call(this._shortMonthsParse,vt),ee!==-1?ee:null):(ee=Bi.call(this._longMonthsParse,vt),ee!==-1?ee:null):I==="MMM"?(ee=Bi.call(this._shortMonthsParse,vt),ee!==-1?ee:(ee=Bi.call(this._longMonthsParse,vt),ee!==-1?ee:null)):(ee=Bi.call(this._longMonthsParse,vt),ee!==-1?ee:(ee=Bi.call(this._shortMonthsParse,vt),ee!==-1?ee:null))}function ga(E,I,q){var z,ee,De;if(this._monthsParseExact)return Ml.call(this,E,I,q);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),z=0;z<12;z++){if(ee=P([2e3,z]),q&&!this._longMonthsParse[z]&&(this._longMonthsParse[z]=new RegExp("^"+this.months(ee,"").replace(".","")+"$","i"),this._shortMonthsParse[z]=new RegExp("^"+this.monthsShort(ee,"").replace(".","")+"$","i")),!q&&!this._monthsParse[z]&&(De="^"+this.months(ee,"")+"|^"+this.monthsShort(ee,""),this._monthsParse[z]=new RegExp(De.replace(".",""),"i")),q&&I==="MMMM"&&this._longMonthsParse[z].test(E))return z;if(q&&I==="MMM"&&this._shortMonthsParse[z].test(E))return z;if(!q&&this._monthsParse[z].test(E))return z}}function jt(E,I){if(!E.isValid())return E;if(typeof I=="string"){if(/^\d+$/.test(I))I=sn(I);else if(I=E.localeData().monthsParse(I),!m(I))return E}var q=I,z=E.date();return z=z<29?z:Math.min(z,zs(E.year(),q)),E._isUTC?E._d.setUTCMonth(q,z):E._d.setMonth(q,z),E}function hu(E){return E!=null?(jt(this,E),t.updateOffset(this,!0),this):vc(this,"Month")}function em(){return zs(this.year(),this.month())}function Ip(E){return this._monthsParseExact?(n(this,"_monthsRegex")||xc.call(this),E?this._monthsShortStrictRegex:this._monthsShortRegex):(n(this,"_monthsShortRegex")||(this._monthsShortRegex=Io),this._monthsShortStrictRegex&&E?this._monthsShortStrictRegex:this._monthsShortRegex)}function ns(E){return this._monthsParseExact?(n(this,"_monthsRegex")||xc.call(this),E?this._monthsStrictRegex:this._monthsRegex):(n(this,"_monthsRegex")||(this._monthsRegex=Ll),this._monthsStrictRegex&&E?this._monthsStrictRegex:this._monthsRegex)}function xc(){function E(dn,fi){return fi.length-dn.length}var I=[],q=[],z=[],ee,De,vt,fr;for(ee=0;ee<12;ee++)De=P([2e3,ee]),vt=Di(this.monthsShort(De,"")),fr=Di(this.months(De,"")),I.push(vt),q.push(fr),z.push(fr),z.push(vt);I.sort(E),q.sort(E),z.sort(E),this._monthsRegex=new RegExp("^("+z.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+q.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+I.join("|")+")","i")}function Vh(E,I,q,z,ee,De,vt){var fr;return E<100&&E>=0?(fr=new Date(E+400,I,q,z,ee,De,vt),isFinite(fr.getFullYear())&&fr.setFullYear(E)):fr=new Date(E,I,q,z,ee,De,vt),fr}function Sf(E){var I,q;return E<100&&E>=0?(q=Array.prototype.slice.call(arguments),q[0]=E+400,I=new Date(Date.UTC.apply(null,q)),isFinite(I.getUTCFullYear())&&I.setUTCFullYear(E)):I=new Date(Date.UTC.apply(null,arguments)),I}function tl(E,I,q){var z=7+I-q,ee=(7+Sf(E,0,z).getUTCDay()-I)%7;return-ee+z-1}function Od(E,I,q,z,ee){var De=(7+q-z)%7,vt=tl(E,z,ee),fr=1+7*(I-1)+De+vt,dn,fi;return fr<=0?(dn=E-1,fi=Oa(dn)+fr):fr>Oa(E)?(dn=E+1,fi=fr-Oa(E)):(dn=E,fi=fr),{year:dn,dayOfYear:fi}}function or(E,I,q){var z=tl(E.year(),I,q),ee=Math.floor((E.dayOfYear()-z-1)/7)+1,De,vt;return ee<1?(vt=E.year()-1,De=ee+ji(vt,I,q)):ee>ji(E.year(),I,q)?(De=ee-ji(E.year(),I,q),vt=E.year()+1):(vt=E.year(),De=ee),{week:De,year:vt}}function ji(E,I,q){var z=tl(E,I,q),ee=tl(E+1,I,q);return(Oa(E)-z+ee)/7}Qe("w",["ww",2],"wo","week"),Qe("W",["WW",2],"Wo","isoWeek"),Mt("w",En,xr),Mt("ww",En,Vr),Mt("W",En,xr),Mt("WW",En,Vr),Ss(["w","ww","W","WW"],function(E,I,q,z){I[z.substr(0,1)]=sn(E)});function Nd(E){return or(E,this._week.dow,this._week.doy).week}var Bl={dow:0,doy:6};function mu(){return this._week.dow}function bf(){return this._week.doy}function tm(E){var I=this.localeData().week(this);return E==null?I:this.add((E-I)*7,"d")}function Hh(E){var I=or(this,1,4).week;return E==null?I:this.add((E-I)*7,"d")}Qe("d",0,"do","day"),Qe("dd",0,0,function(E){return this.localeData().weekdaysMin(this,E)}),Qe("ddd",0,0,function(E){return this.localeData().weekdaysShort(this,E)}),Qe("dddd",0,0,function(E){return this.localeData().weekdays(this,E)}),Qe("e",0,0,"weekday"),Qe("E",0,0,"isoWeekday"),Mt("d",En),Mt("e",En),Mt("E",En),Mt("dd",function(E,I){return I.weekdaysMinRegex(E)}),Mt("ddd",function(E,I){return I.weekdaysShortRegex(E)}),Mt("dddd",function(E,I){return I.weekdaysRegex(E)}),Ss(["dd","ddd","dddd"],function(E,I,q,z){var ee=q._locale.weekdaysParse(E,z,q._strict);ee!=null?I.d=ee:g(q).invalidWeekday=E}),Ss(["d","e","E"],function(E,I,q,z){I[z]=sn(E)});function rm(E,I){return typeof E!="string"?E:isNaN(E)?(E=I.weekdaysParse(E),typeof E=="number"?E:null):parseInt(E,10)}function Ra(E,I){return typeof E=="string"?I.weekdaysParse(E)%7||7:isNaN(E)?null:E}function Fa(E,I){return E.slice(I,7).concat(E.slice(0,I))}var Wh="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),zh="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Op="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ea=Ir,Np=Ir,La=Ir;function rl(E,I){var q=s(this._weekdays)?this._weekdays:this._weekdays[E&&E!==!0&&this._weekdays.isFormat.test(I)?"format":"standalone"];return E===!0?Fa(q,this._week.dow):E?q[E.day()]:q}function yu(E){return E===!0?Fa(this._weekdaysShort,this._week.dow):E?this._weekdaysShort[E.day()]:this._weekdaysShort}function zu(E){return E===!0?Fa(this._weekdaysMin,this._week.dow):E?this._weekdaysMin[E.day()]:this._weekdaysMin}function _c(E,I,q){var z,ee,De,vt=E.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)De=P([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(De,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(De,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(De,"").toLocaleLowerCase();return q?I==="dddd"?(ee=Bi.call(this._weekdaysParse,vt),ee!==-1?ee:null):I==="ddd"?(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1?ee:null):(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1?ee:null):I==="dddd"?(ee=Bi.call(this._weekdaysParse,vt),ee!==-1||(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1)?ee:(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1?ee:null)):I==="ddd"?(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1||(ee=Bi.call(this._weekdaysParse,vt),ee!==-1)?ee:(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1?ee:null)):(ee=Bi.call(this._minWeekdaysParse,vt),ee!==-1||(ee=Bi.call(this._weekdaysParse,vt),ee!==-1)?ee:(ee=Bi.call(this._shortWeekdaysParse,vt),ee!==-1?ee:null))}function Sc(E,I,q){var z,ee,De;if(this._weekdaysParseExact)return _c.call(this,E,I,q);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(ee=P([2e3,1]).day(z),q&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(ee,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(ee,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(ee,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[z]||(De="^"+this.weekdays(ee,"")+"|^"+this.weekdaysShort(ee,"")+"|^"+this.weekdaysMin(ee,""),this._weekdaysParse[z]=new RegExp(De.replace(".",""),"i")),q&&I==="dddd"&&this._fullWeekdaysParse[z].test(E))return z;if(q&&I==="ddd"&&this._shortWeekdaysParse[z].test(E))return z;if(q&&I==="dd"&&this._minWeekdaysParse[z].test(E))return z;if(!q&&this._weekdaysParse[z].test(E))return z}}function Ns(E){if(!this.isValid())return E!=null?this:NaN;var I=vc(this,"Day");return E!=null?(E=rm(E,this.localeData()),this.add(E-I,"d")):I}function Tn(E){if(!this.isValid())return E!=null?this:NaN;var I=(this.day()+7-this.localeData()._week.dow)%7;return E==null?I:this.add(E-I,"d")}function Gu(E){if(!this.isValid())return E!=null?this:NaN;if(E!=null){var I=Ra(E,this.localeData());return this.day(this.day()%7?I:I-7)}else return this.day()||7}function Gh(E){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||ql.call(this),E?this._weekdaysStrictRegex:this._weekdaysRegex):(n(this,"_weekdaysRegex")||(this._weekdaysRegex=ea),this._weekdaysStrictRegex&&E?this._weekdaysStrictRegex:this._weekdaysRegex)}function Gs(E){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||ql.call(this),E?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(n(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Np),this._weekdaysShortStrictRegex&&E?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function jl(E){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||ql.call(this),E?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(n(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=La),this._weekdaysMinStrictRegex&&E?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ql(){function E(ia,eu){return eu.length-ia.length}var I=[],q=[],z=[],ee=[],De,vt,fr,dn,fi;for(De=0;De<7;De++)vt=P([2e3,1]).day(De),fr=Di(this.weekdaysMin(vt,"")),dn=Di(this.weekdaysShort(vt,"")),fi=Di(this.weekdays(vt,"")),I.push(fr),q.push(dn),z.push(fi),ee.push(fr),ee.push(dn),ee.push(fi);I.sort(E),q.sort(E),z.sort(E),ee.sort(E),this._weekdaysRegex=new RegExp("^("+ee.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+q.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+I.join("|")+")","i")}function Ma(){return this.hours()%12||12}function Rp(){return this.hours()||24}Qe("H",["HH",2],0,"hour"),Qe("h",["hh",2],0,Ma),Qe("k",["kk",2],0,Rp),Qe("hmm",0,0,function(){return""+Ma.apply(this)+Te(this.minutes(),2)}),Qe("hmmss",0,0,function(){return""+Ma.apply(this)+Te(this.minutes(),2)+Te(this.seconds(),2)}),Qe("Hmm",0,0,function(){return""+this.hours()+Te(this.minutes(),2)}),Qe("Hmmss",0,0,function(){return""+this.hours()+Te(this.minutes(),2)+Te(this.seconds(),2)});function Oo(E,I){Qe(E,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),I)})}Oo("a",!0),Oo("A",!1);function Fp(E,I){return I._meridiemParse}Mt("a",Fp),Mt("A",Fp),Mt("H",En,In),Mt("h",En,xr),Mt("k",En,xr),Mt("HH",En,Vr),Mt("hh",En,Vr),Mt("kk",En,Vr),Mt("hmm",$o),Mt("hmmss",Qo),Mt("Hmm",$o),Mt("Hmmss",Qo),On(["H","HH"],Cs),On(["k","kk"],function(E,I,q){var z=sn(E);I[Cs]=z===24?0:z}),On(["a","A"],function(E,I,q){q._isPm=q._locale.isPM(E),q._meridiem=E}),On(["h","hh"],function(E,I,q){I[Cs]=sn(E),g(q).bigHour=!0}),On("hmm",function(E,I,q){var z=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z)),g(q).bigHour=!0}),On("hmmss",function(E,I,q){var z=E.length-4,ee=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z,2)),I[lo]=sn(E.substr(ee)),g(q).bigHour=!0}),On("Hmm",function(E,I,q){var z=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z))}),On("Hmmss",function(E,I,q){var z=E.length-4,ee=E.length-2;I[Cs]=sn(E.substr(0,z)),I[Do]=sn(E.substr(z,2)),I[lo]=sn(E.substr(ee))});function Kh(E){return(E+"").toLowerCase().charAt(0)==="p"}var Ga=/[ap]\.?m?\.?/i,va=tn("Hours",!0);function Lp(E,I,q){return E>11?q?"pm":"PM":q?"am":"AM"}var nl={calendar:Ke,longDateFormat:qt,invalidDate:pt,ordinal:C,dayOfMonthOrdinalParse:At,relativeTime:Jr,months:ko,monthsShort:Na,week:Bl,weekdays:Wh,weekdaysMin:Op,weekdaysShort:zh,meridiemParse:Ga},bs={},ro={},Ku;function Ef(E,I){var q,z=Math.min(E.length,I.length);for(q=0;q<z;q+=1)if(E[q]!==I[q])return q;return z}function gu(E){return E&&E.toLowerCase().replace("_","-")}function il(E){for(var I=0,q,z,ee,De;I<E.length;){for(De=gu(E[I]).split("-"),q=De.length,z=gu(E[I+1]),z=z?z.split("-"):null;q>0;){if(ee=Z(De.slice(0,q).join("-")),ee)return ee;if(z&&z.length>=q&&Ef(De,z)>=q-1)break;q--}I++}return Ku}function ue(E){return!!(E&&E.match("^[^/\\\\]*$"))}function Z(E){var I=null,q;if(bs[E]===void 0&&typeof _2<"u"&&_2&&_2.exports&&ue(E))try{I=Ku._abbr,q=require,q("./locale/"+E),ae(I)}catch{bs[E]=null}return bs[E]}function ae(E,I){var q;return E&&(f(I)?q=Je(E):q=Re(E,I),q?Ku=q:typeof console<"u"&&console.warn&&console.warn("Locale "+E+" not found. Did you forget to load it?")),Ku._abbr}function Re(E,I){if(I!==null){var q,z=nl;if(I.abbr=E,bs[E]!=null)Pt("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."),z=bs[E]._config;else if(I.parentLocale!=null)if(bs[I.parentLocale]!=null)z=bs[I.parentLocale]._config;else if(q=Z(I.parentLocale),q!=null)z=q._config;else return ro[I.parentLocale]||(ro[I.parentLocale]=[]),ro[I.parentLocale].push({name:E,config:I}),null;return bs[E]=new se(je(z,I)),ro[E]&&ro[E].forEach(function(ee){Re(ee.name,ee.config)}),ae(E),bs[E]}else return delete bs[E],null}function nt(E,I){if(I!=null){var q,z,ee=nl;bs[E]!=null&&bs[E].parentLocale!=null?bs[E].set(je(bs[E]._config,I)):(z=Z(E),z!=null&&(ee=z._config),I=je(ee,I),z==null&&(I.abbr=E),q=new se(I),q.parentLocale=bs[E],bs[E]=q),ae(E)}else bs[E]!=null&&(bs[E].parentLocale!=null?(bs[E]=bs[E].parentLocale,E===ae()&&ae(E)):bs[E]!=null&&delete bs[E]);return bs[E]}function Je(E){var I;if(E&&E._locale&&E._locale._abbr&&(E=E._locale._abbr),!E)return Ku;if(!s(E)){if(I=Z(E),I)return I;E=[E]}return il(E)}function gt(){return ke(bs)}function _t(E){var I,q=E._a;return q&&g(E).overflow===-2&&(I=q[Ao]<0||q[Ao]>11?Ao:q[co]<1||q[co]>zs(q[ur],q[Ao])?co:q[Cs]<0||q[Cs]>24||q[Cs]===24&&(q[Do]!==0||q[lo]!==0||q[js]!==0)?Cs:q[Do]<0||q[Do]>59?Do:q[lo]<0||q[lo]>59?lo:q[js]<0||q[js]>999?js:-1,g(E)._overflowDayOfYear&&(I<ur||I>co)&&(I=co),g(E)._overflowWeeks&&I===-1&&(I=Zc),g(E)._overflowWeekday&&I===-1&&(I=fu),g(E).overflow=I),E}var $t=/^\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)?)?$/,_r=/^\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)?)?$/,An=/Z|[+-]\d\d(?::?\d\d)?/,ti=[["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]],Nn=[["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/]],Ba=/^\/?Date\((-?\d+)/i,Ul=/^(?:(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}))$/,xa={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function No(E){var I,q,z=E._i,ee=$t.exec(z)||_r.exec(z),De,vt,fr,dn,fi=ti.length,ia=Nn.length;if(ee){for(g(E).iso=!0,I=0,q=fi;I<q;I++)if(ti[I][1].exec(ee[1])){vt=ti[I][0],De=ti[I][2]!==!1;break}if(vt==null){E._isValid=!1;return}if(ee[3]){for(I=0,q=ia;I<q;I++)if(Nn[I][1].exec(ee[3])){fr=(ee[2]||" ")+Nn[I][0];break}if(fr==null){E._isValid=!1;return}}if(!De&&fr!=null){E._isValid=!1;return}if(ee[4])if(An.exec(ee[4]))dn="Z";else{E._isValid=!1;return}E._f=vt+(fr||"")+(dn||""),Ho(E)}else E._isValid=!1}function ui(E,I,q,z,ee,De){var vt=[on(E),Na.indexOf(I),parseInt(q,10),parseInt(z,10),parseInt(ee,10)];return De&&vt.push(parseInt(De,10)),vt}function on(E){var I=parseInt(E,10);return I<=49?2e3+I:I<=999?1900+I:I}function Nr(E){return E.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function rn(E,I,q){if(E){var z=zh.indexOf(E),ee=new Date(I[0],I[1],I[2]).getDay();if(z!==ee)return g(q).weekdayMismatch=!0,q._isValid=!1,!1}return!0}function ri(E,I,q){if(E)return xa[E];if(I)return 0;var z=parseInt(q,10),ee=z%100,De=(z-ee)/100;return De*60+ee}function Ii(E){var I=Ul.exec(Nr(E._i)),q;if(I){if(q=ui(I[4],I[3],I[2],I[5],I[6],I[7]),!rn(I[1],q,E))return;E._a=q,E._tzm=ri(I[8],I[9],I[10]),E._d=Sf.apply(null,E._a),E._d.setUTCMinutes(E._d.getUTCMinutes()-E._tzm),g(E).rfc2822=!0}else E._isValid=!1}function Ks(E){var I=Ba.exec(E._i);if(I!==null){E._d=new Date(+I[1]);return}if(No(E),E._isValid===!1)delete E._isValid;else return;if(Ii(E),E._isValid===!1)delete E._isValid;else return;E._strict?E._isValid=!1:t.createFromInputFallback(E)}t.createFromInputFallback=Ve("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 _o(E,I,q){return E!=null?E:I!=null?I:q}function bc(E){var I=new Date(t.now());return E._useUTC?[I.getUTCFullYear(),I.getUTCMonth(),I.getUTCDate()]:[I.getFullYear(),I.getMonth(),I.getDate()]}function no(E){var I,q,z=[],ee,De,vt;if(!E._d){for(ee=bc(E),E._w&&E._a[co]==null&&E._a[Ao]==null&&ja(E),E._dayOfYear!=null&&(vt=_o(E._a[ur],ee[ur]),(E._dayOfYear>Oa(vt)||E._dayOfYear===0)&&(g(E)._overflowDayOfYear=!0),q=Sf(vt,0,E._dayOfYear),E._a[Ao]=q.getUTCMonth(),E._a[co]=q.getUTCDate()),I=0;I<3&&E._a[I]==null;++I)E._a[I]=z[I]=ee[I];for(;I<7;I++)E._a[I]=z[I]=E._a[I]==null?I===2?1:0:E._a[I];E._a[Cs]===24&&E._a[Do]===0&&E._a[lo]===0&&E._a[js]===0&&(E._nextDay=!0,E._a[Cs]=0),E._d=(E._useUTC?Sf:Vh).apply(null,z),De=E._useUTC?E._d.getUTCDay():E._d.getDay(),E._tzm!=null&&E._d.setUTCMinutes(E._d.getUTCMinutes()-E._tzm),E._nextDay&&(E._a[Cs]=24),E._w&&typeof E._w.d<"u"&&E._w.d!==De&&(g(E).weekdayMismatch=!0)}}function ja(E){var I,q,z,ee,De,vt,fr,dn,fi;I=E._w,I.GG!=null||I.W!=null||I.E!=null?(De=1,vt=4,q=_o(I.GG,E._a[ur],or(wn(),1,4).year),z=_o(I.W,1),ee=_o(I.E,1),(ee<1||ee>7)&&(dn=!0)):(De=E._locale._week.dow,vt=E._locale._week.doy,fi=or(wn(),De,vt),q=_o(I.gg,E._a[ur],fi.year),z=_o(I.w,fi.week),I.d!=null?(ee=I.d,(ee<0||ee>6)&&(dn=!0)):I.e!=null?(ee=I.e+De,(I.e<0||I.e>6)&&(dn=!0)):ee=De),z<1||z>ji(q,De,vt)?g(E)._overflowWeeks=!0:dn!=null?g(E)._overflowWeekday=!0:(fr=Od(q,z,ee,De,vt),E._a[ur]=fr.year,E._dayOfYear=fr.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function Ho(E){if(E._f===t.ISO_8601){No(E);return}if(E._f===t.RFC_2822){Ii(E);return}E._a=[],g(E).empty=!0;var I=""+E._i,q,z,ee,De,vt,fr=I.length,dn=0,fi,ia;for(ee=at(E._f,E._locale).match(Fe)||[],ia=ee.length,q=0;q<ia;q++)De=ee[q],z=(I.match(Ai(De,E))||[])[0],z&&(vt=I.substr(0,I.indexOf(z)),vt.length>0&&g(E).unusedInput.push(vt),I=I.slice(I.indexOf(z)+z.length),dn+=z.length),Zt[De]?(z?g(E).empty=!1:g(E).unusedTokens.push(De),Hu(De,z,E)):E._strict&&!z&&g(E).unusedTokens.push(De);g(E).charsLeftOver=fr-dn,I.length>0&&g(E).unusedInput.push(I),E._a[Cs]<=12&&g(E).bigHour===!0&&E._a[Cs]>0&&(g(E).bigHour=void 0),g(E).parsedDateParts=E._a.slice(0),g(E).meridiem=E._meridiem,E._a[Cs]=$l(E._locale,E._a[Cs],E._meridiem),fi=g(E).era,fi!==null&&(E._a[ur]=E._locale.erasConvertYear(fi,E._a[ur])),no(E),_t(E)}function $l(E,I,q){var z;return q==null?I:E.meridiemHour!=null?E.meridiemHour(I,q):(E.isPM!=null&&(z=E.isPM(q),z&&I<12&&(I+=12),!z&&I===12&&(I=0)),I)}function Mp(E){var I,q,z,ee,De,vt,fr=!1,dn=E._f.length;if(dn===0){g(E).invalidFormat=!0,E._d=new Date(NaN);return}for(ee=0;ee<dn;ee++)De=0,vt=!1,I=re({},E),E._useUTC!=null&&(I._useUTC=E._useUTC),I._f=E._f[ee],Ho(I),L(I)&&(vt=!0),De+=g(I).charsLeftOver,De+=g(I).unusedTokens.length*10,g(I).score=De,fr?De<z&&(z=De,q=I):(z==null||De<z||vt)&&(z=De,q=I,vt&&(fr=!0));b(E,q||I)}function Yu(E){if(!E._d){var I=Ye(E._i),q=I.day===void 0?I.date:I.day;E._a=v([I.year,I.month,q,I.hour,I.minute,I.second,I.millisecond],function(z){return z&&parseInt(z,10)}),no(E)}}function Bp(E){var I=new me(_t(Wo(E)));return I._nextDay&&(I.add(1,"d"),I._nextDay=void 0),I}function Wo(E){var I=E._i,q=E._f;return E._locale=E._locale||Je(E._l),I===null||q===void 0&&I===""?M({nullInput:!0}):(typeof I=="string"&&(E._i=I=E._locale.preparse(I)),Ce(I)?new me(_t(I)):(y(I)?E._d=I:s(q)?Mp(E):q?Ho(E):qi(E),L(E)||(E._d=null),E))}function qi(E){var I=E._i;f(I)?E._d=new Date(t.now()):y(I)?E._d=new Date(I.valueOf()):typeof I=="string"?Ks(E):s(I)?(E._a=v(I.slice(0),function(q){return parseInt(q,10)}),no(E)):a(I)?Yu(E):m(I)?E._d=new Date(I):t.createFromInputFallback(E)}function Yh(E,I,q,z,ee){var De={};return(I===!0||I===!1)&&(z=I,I=void 0),(q===!0||q===!1)&&(z=q,q=void 0),(a(E)&&l(E)||s(E)&&E.length===0)&&(E=void 0),De._isAMomentObject=!0,De._useUTC=De._isUTC=ee,De._l=q,De._i=E,De._f=I,De._strict=z,Bp(De)}function wn(E,I,q,z){return Yh(E,I,q,z,!1)}var Jh=Ve("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var E=wn.apply(null,arguments);return this.isValid()&&E.isValid()?E<this?this:E:M()}),zo=Ve("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var E=wn.apply(null,arguments);return this.isValid()&&E.isValid()?E>this?this:E:M()});function oi(E,I){var q,z;if(I.length===1&&s(I[0])&&(I=I[0]),!I.length)return wn();for(q=I[0],z=1;z<I.length;++z)(!I[z].isValid()||I[z][E](q))&&(q=I[z]);return q}function Ka(){var E=[].slice.call(arguments,0);return oi("isBefore",E)}function Rd(){var E=[].slice.call(arguments,0);return oi("isAfter",E)}var Tf=function(){return Date.now?Date.now():+new Date},wf=["year","quarter","month","week","day","hour","minute","second","millisecond"];function mv(E){var I,q=!1,z,ee=wf.length;for(I in E)if(n(E,I)&&!(Bi.call(wf,I)!==-1&&(E[I]==null||!isNaN(E[I]))))return!1;for(z=0;z<ee;++z)if(E[wf[z]]){if(q)return!1;parseFloat(E[wf[z]])!==sn(E[wf[z]])&&(q=!0)}return!0}function Fd(){return this._isValid}function nm(){return So(NaN)}function Ec(E){var I=Ye(E),q=I.year||0,z=I.quarter||0,ee=I.month||0,De=I.week||I.isoWeek||0,vt=I.day||0,fr=I.hour||0,dn=I.minute||0,fi=I.second||0,ia=I.millisecond||0;this._isValid=mv(I),this._milliseconds=+ia+fi*1e3+dn*6e4+fr*1e3*60*60,this._days=+vt+De*7,this._months=+ee+z*3+q*12,this._data={},this._locale=Je(),this._bubble()}function qa(E){return E instanceof Ec}function sl(E){return E<0?Math.round(-1*E)*-1:Math.round(E)}function Ya(E,I,q){var z=Math.min(E.length,I.length),ee=Math.abs(E.length-I.length),De=0,vt;for(vt=0;vt<z;vt++)(q&&E[vt]!==I[vt]||!q&&sn(E[vt])!==sn(I[vt]))&&De++;return De+ee}function jp(E,I){Qe(E,0,0,function(){var q=this.utcOffset(),z="+";return q<0&&(q=-q,z="-"),z+Te(~~(q/60),2)+I+Te(~~q%60,2)})}jp("Z",":"),jp("ZZ",""),Mt("Z",Dt),Mt("ZZ",Dt),On(["Z","ZZ"],function(E,I,q){q._useUTC=!0,q._tzm=Ro(Dt,E)});var Ys=/([\+\-]|\d\d)/gi;function Ro(E,I){var q=(I||"").match(E),z,ee,De;return q===null?null:(z=q[q.length-1]||[],ee=(z+"").match(Ys)||["-",0,0],De=+(ee[1]*60)+sn(ee[2]),De===0?0:ee[0]==="+"?De:-De)}function io(E,I){var q,z;return I._isUTC?(q=I.clone(),z=(Ce(E)||y(E)?E.valueOf():wn(E).valueOf())-q.valueOf(),q._d.setTime(q._d.valueOf()+z),t.updateOffset(q,!1),q):wn(E).local()}function Tc(E){return-Math.round(E._d.getTimezoneOffset())}t.updateOffset=function(){};function Pf(E,I,q){var z=this._offset||0,ee;if(!this.isValid())return E!=null?this:NaN;if(E!=null){if(typeof E=="string"){if(E=Ro(Dt,E),E===null)return this}else Math.abs(E)<16&&!q&&(E=E*60);return!this._isUTC&&I&&(ee=Tc(this)),this._offset=E,this._isUTC=!0,ee!=null&&this.add(ee,"m"),z!==E&&(!I||this._changeInProgress?ba(this,So(E-z,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?z:Tc(this)}function bi(E,I){return E!=null?(typeof E!="string"&&(E=-E),this.utcOffset(E,I),this):-this.utcOffset()}function im(E){return this.utcOffset(0,E)}function sm(E){return this._isUTC&&(this.utcOffset(0,E),this._isUTC=!1,E&&this.subtract(Tc(this),"m")),this}function ta(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var E=Ro(Ft,this._i);E!=null?this.utcOffset(E):this.utcOffset(0,!0)}return this}function Sa(E){return this.isValid()?(E=E?wn(E).utcOffset():0,(this.utcOffset()-E)%60===0):!1}function Ja(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Vl(){if(!f(this._isDSTShifted))return this._isDSTShifted;var E={},I;return re(E,this),E=Wo(E),E._a?(I=E._isUTC?P(E._a):wn(E._a),this._isDSTShifted=this.isValid()&&Ya(E._a,I.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Hl(){return this.isValid()?!this._isUTC:!1}function Wl(){return this.isValid()?this._isUTC:!1}function Ei(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ju=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,zl=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function So(E,I){var q=E,z=null,ee,De,vt;return qa(E)?q={ms:E._milliseconds,d:E._days,M:E._months}:m(E)||!isNaN(+E)?(q={},I?q[I]=+E:q.milliseconds=+E):(z=Ju.exec(E))?(ee=z[1]==="-"?-1:1,q={y:0,d:sn(z[co])*ee,h:sn(z[Cs])*ee,m:sn(z[Do])*ee,s:sn(z[lo])*ee,ms:sn(sl(z[js]*1e3))*ee}):(z=zl.exec(E))?(ee=z[1]==="-"?-1:1,q={y:ol(z[2],ee),M:ol(z[3],ee),w:ol(z[4],ee),d:ol(z[5],ee),h:ol(z[6],ee),m:ol(z[7],ee),s:ol(z[8],ee)}):q==null?q={}:typeof q=="object"&&("from"in q||"to"in q)&&(vt=om(wn(q.from),wn(q.to)),q={},q.ms=vt.milliseconds,q.M=vt.months),De=new Ec(q),qa(E)&&n(E,"_locale")&&(De._locale=E._locale),qa(E)&&n(E,"_isValid")&&(De._isValid=E._isValid),De}So.fn=Ec.prototype,So.invalid=nm;function ol(E,I){var q=E&&parseFloat(E.replace(",","."));return(isNaN(q)?0:q)*I}function Xu(E,I){var q={};return q.months=I.month()-E.month()+(I.year()-E.year())*12,E.clone().add(q.months,"M").isAfter(I)&&--q.months,q.milliseconds=+I-+E.clone().add(q.months,"M"),q}function om(E,I){var q;return E.isValid()&&I.isValid()?(I=io(I,E),E.isBefore(I)?q=Xu(E,I):(q=Xu(I,E),q.milliseconds=-q.milliseconds,q.months=-q.months),q):{milliseconds:0,months:0}}function qp(E,I){return function(q,z){var ee,De;return z!==null&&!isNaN(+z)&&(Pt(I,"moment()."+I+"(period, number) is deprecated. Please use moment()."+I+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),De=q,q=z,z=De),ee=So(q,z),ba(this,ee,E),this}}function ba(E,I,q,z){var ee=I._milliseconds,De=sl(I._days),vt=sl(I._months);E.isValid()&&(z=z==null?!0:z,vt&&jt(E,vc(E,"Month")+vt*q),De&&el(E,"Date",vc(E,"Date")+De*q),ee&&E._d.setTime(E._d.valueOf()+ee*q),z&&t.updateOffset(E,De||vt))}var ni=qp(1,"add"),Ld=qp(-1,"subtract");function Xh(E){return typeof E=="string"||E instanceof String}function Qh(E){return Ce(E)||y(E)||Xh(E)||m(E)||Hy(E)||Vy(E)||E===null||E===void 0}function Vy(E){var I=a(E)&&!l(E),q=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],ee,De,vt=z.length;for(ee=0;ee<vt;ee+=1)De=z[ee],q=q||n(E,De);return I&&q}function Hy(E){var I=s(E),q=!1;return I&&(q=E.filter(function(z){return!m(z)&&Xh(E)}).length===0),I&&q}function yv(E){var I=a(E)&&!l(E),q=!1,z=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],ee,De;for(ee=0;ee<z.length;ee+=1)De=z[ee],q=q||n(E,De);return I&&q}function vx(E,I){var q=E.diff(I,"days",!0);return q<-6?"sameElse":q<-1?"lastWeek":q<0?"lastDay":q<1?"sameDay":q<2?"nextDay":q<7?"nextWeek":"sameElse"}function am(E,I){arguments.length===1&&(arguments[0]?Qh(arguments[0])?(E=arguments[0],I=void 0):yv(arguments[0])&&(I=arguments[0],E=void 0):(E=void 0,I=void 0));var q=E||wn(),z=io(q,this).startOf("day"),ee=t.calendarFormat(this,z)||"sameElse",De=I&&(lt(I[ee])?I[ee].call(this,q):I[ee]);return this.format(De||this.localeData().calendar(ee,this,wn(q)))}function Zh(){return new me(this)}function gv(E,I){var q=Ce(E)?E:wn(E);return this.isValid()&&q.isValid()?(I=ge(I)||"millisecond",I==="millisecond"?this.valueOf()>q.valueOf():q.valueOf()<this.clone().startOf(I).valueOf()):!1}function Qu(E,I){var q=Ce(E)?E:wn(E);return this.isValid()&&q.isValid()?(I=ge(I)||"millisecond",I==="millisecond"?this.valueOf()<q.valueOf():this.clone().endOf(I).valueOf()<q.valueOf()):!1}function Gl(E,I,q,z){var ee=Ce(E)?E:wn(E),De=Ce(I)?I:wn(I);return this.isValid()&&ee.isValid()&&De.isValid()?(z=z||"()",(z[0]==="("?this.isAfter(ee,q):!this.isBefore(ee,q))&&(z[1]===")"?this.isBefore(De,q):!this.isAfter(De,q))):!1}function Ea(E,I){var q=Ce(E)?E:wn(E),z;return this.isValid()&&q.isValid()?(I=ge(I)||"millisecond",I==="millisecond"?this.valueOf()===q.valueOf():(z=q.valueOf(),this.clone().startOf(I).valueOf()<=z&&z<=this.clone().endOf(I).valueOf())):!1}function vu(E,I){return this.isSame(E,I)||this.isAfter(E,I)}function Ta(E,I){return this.isSame(E,I)||this.isBefore(E,I)}function Up(E,I,q){var z,ee,De;if(!this.isValid())return NaN;if(z=io(E,this),!z.isValid())return NaN;switch(ee=(z.utcOffset()-this.utcOffset())*6e4,I=ge(I),I){case"year":De=xu(this,z)/12;break;case"month":De=xu(this,z);break;case"quarter":De=xu(this,z)/3;break;case"second":De=(this-z)/1e3;break;case"minute":De=(this-z)/6e4;break;case"hour":De=(this-z)/36e5;break;case"day":De=(this-z-ee)/864e5;break;case"week":De=(this-z-ee)/6048e5;break;default:De=this-z}return q?De:Si(De)}function xu(E,I){if(E.date()<I.date())return-xu(I,E);var q=(I.year()-E.year())*12+(I.month()-E.month()),z=E.clone().add(q,"months"),ee,De;return I-z<0?(ee=E.clone().add(q-1,"months"),De=(I-z)/(z-ee)):(ee=E.clone().add(q+1,"months"),De=(I-z)/(ee-z)),-(q+De)||0}t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function al(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Cf(E){if(!this.isValid())return null;var I=E!==!0,q=I?this.clone().utc():this;return q.year()<0||q.year()>9999?Ze(q,I?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):lt(Date.prototype.toISOString)?I?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ze(q,"Z")):Ze(q,I?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Af(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var E="moment",I="",q,z,ee,De;return this.isLocal()||(E=this.utcOffset()===0?"moment.utc":"moment.parseZone",I="Z"),q="["+E+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",ee="-MM-DD[T]HH:mm:ss.SSS",De=I+'[")]',this.format(q+z+ee+De)}function Md(E){E||(E=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var I=Ze(this,E);return this.localeData().postformat(I)}function Wy(E,I){return this.isValid()&&(Ce(E)&&E.isValid()||wn(E).isValid())?So({to:this,from:E}).locale(this.locale()).humanize(!I):this.localeData().invalidDate()}function um(E){return this.from(wn(),E)}function Df(E,I){return this.isValid()&&(Ce(E)&&E.isValid()||wn(E).isValid())?So({from:this,to:E}).locale(this.locale()).humanize(!I):this.localeData().invalidDate()}function Kl(E){return this.to(wn(),E)}function cm(E){var I;return E===void 0?this._locale._abbr:(I=Je(E),I!=null&&(this._locale=I),this)}var _u=Ve("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 lm(){return this._locale}var ul=1e3,wc=60*ul,Yl=60*wc,zy=(365*400+97)*24*Yl;function Ti(E,I){return(E%I+I)%I}function Fo(E,I,q){return E<100&&E>=0?new Date(E+400,I,q)-zy:new Date(E,I,q).valueOf()}function Su(E,I,q){return E<100&&E>=0?Date.UTC(E+400,I,q)-zy:Date.UTC(E,I,q)}function Zu(E){var I,q;if(E=ge(E),E===void 0||E==="millisecond"||!this.isValid())return this;switch(q=this._isUTC?Su:Fo,E){case"year":I=q(this.year(),0,1);break;case"quarter":I=q(this.year(),this.month()-this.month()%3,1);break;case"month":I=q(this.year(),this.month(),1);break;case"week":I=q(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":I=q(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":I=q(this.year(),this.month(),this.date());break;case"hour":I=this._d.valueOf(),I-=Ti(I+(this._isUTC?0:this.utcOffset()*wc),Yl);break;case"minute":I=this._d.valueOf(),I-=Ti(I,wc);break;case"second":I=this._d.valueOf(),I-=Ti(I,ul);break}return this._d.setTime(I),t.updateOffset(this,!0),this}function cl(E){var I,q;if(E=ge(E),E===void 0||E==="millisecond"||!this.isValid())return this;switch(q=this._isUTC?Su:Fo,E){case"year":I=q(this.year()+1,0,1)-1;break;case"quarter":I=q(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":I=q(this.year(),this.month()+1,1)-1;break;case"week":I=q(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":I=q(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":I=q(this.year(),this.month(),this.date()+1)-1;break;case"hour":I=this._d.valueOf(),I+=Yl-Ti(I+(this._isUTC?0:this.utcOffset()*wc),Yl)-1;break;case"minute":I=this._d.valueOf(),I+=wc-Ti(I,wc)-1;break;case"second":I=this._d.valueOf(),I+=ul-Ti(I,ul)-1;break}return this._d.setTime(I),t.updateOffset(this,!0),this}function Xa(){return this._d.valueOf()-(this._offset||0)*6e4}function $p(){return Math.floor(this.valueOf()/1e3)}function ll(){return new Date(this.valueOf())}function vv(){var E=this;return[E.year(),E.month(),E.date(),E.hour(),E.minute(),E.second(),E.millisecond()]}function pm(){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 kf(){return this.isValid()?this.toISOString():null}function Bd(){return L(this)}function xx(){return b({},g(this))}function Gy(){return g(this).overflow}function e0(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Qe("N",0,0,"eraAbbr"),Qe("NN",0,0,"eraAbbr"),Qe("NNN",0,0,"eraAbbr"),Qe("NNNN",0,0,"eraName"),Qe("NNNNN",0,0,"eraNarrow"),Qe("y",["y",1],"yo","eraYear"),Qe("y",["yy",2],0,"eraYear"),Qe("y",["yyy",3],0,"eraYear"),Qe("y",["yyyy",4],0,"eraYear"),Mt("N",qd),Mt("NN",qd),Mt("NNN",qd),Mt("NNNN",r0),Mt("NNNNN",n0),On(["N","NN","NNN","NNNN","NNNNN"],function(E,I,q,z){var ee=q._locale.erasParse(E,z,q._strict);ee?g(q).era=ee:g(q).invalidEra=E}),Mt("y",za),Mt("yy",za),Mt("yyy",za),Mt("yyyy",za),Mt("yo",dm),On(["y","yy","yyy","yyyy"],ur),On(["yo"],function(E,I,q,z){var ee;q._locale._eraYearOrdinalRegex&&(ee=E.match(q._locale._eraYearOrdinalRegex)),q._locale.eraYearOrdinalParse?I[ur]=q._locale.eraYearOrdinalParse(E,ee):I[ur]=parseInt(E,10)});function Ky(E,I){var q,z,ee,De=this._eras||Je("en")._eras;for(q=0,z=De.length;q<z;++q){switch(typeof De[q].since){case"string":ee=t(De[q].since).startOf("day"),De[q].since=ee.valueOf();break}switch(typeof De[q].until){case"undefined":De[q].until=1/0;break;case"string":ee=t(De[q].until).startOf("day").valueOf(),De[q].until=ee.valueOf();break}}return De}function Yy(E,I,q){var z,ee,De=this.eras(),vt,fr,dn;for(E=E.toUpperCase(),z=0,ee=De.length;z<ee;++z)if(vt=De[z].name.toUpperCase(),fr=De[z].abbr.toUpperCase(),dn=De[z].narrow.toUpperCase(),q)switch(I){case"N":case"NN":case"NNN":if(fr===E)return De[z];break;case"NNNN":if(vt===E)return De[z];break;case"NNNNN":if(dn===E)return De[z];break}else if([vt,fr,dn].indexOf(E)>=0)return De[z]}function fm(E,I){var q=E.since<=E.until?1:-1;return I===void 0?t(E.since).year():t(E.since).year()+(I-E.offset)*q}function Vp(){var E,I,q,z=this.localeData().eras();for(E=0,I=z.length;E<I;++E)if(q=this.clone().startOf("day").valueOf(),z[E].since<=q&&q<=z[E].until||z[E].until<=q&&q<=z[E].since)return z[E].name;return""}function Jy(){var E,I,q,z=this.localeData().eras();for(E=0,I=z.length;E<I;++E)if(q=this.clone().startOf("day").valueOf(),z[E].since<=q&&q<=z[E].until||z[E].until<=q&&q<=z[E].since)return z[E].narrow;return""}function xv(){var E,I,q,z=this.localeData().eras();for(E=0,I=z.length;E<I;++E)if(q=this.clone().startOf("day").valueOf(),z[E].since<=q&&q<=z[E].until||z[E].until<=q&&q<=z[E].since)return z[E].abbr;return""}function jd(){var E,I,q,z,ee=this.localeData().eras();for(E=0,I=ee.length;E<I;++E)if(q=ee[E].since<=ee[E].until?1:-1,z=this.clone().startOf("day").valueOf(),ee[E].since<=z&&z<=ee[E].until||ee[E].until<=z&&z<=ee[E].since)return(this.year()-t(ee[E].since).year())*q+ee[E].offset;return this.year()}function wa(E){return n(this,"_erasNameRegex")||Of.call(this),E?this._erasNameRegex:this._erasRegex}function t0(E){return n(this,"_erasAbbrRegex")||Of.call(this),E?this._erasAbbrRegex:this._erasRegex}function If(E){return n(this,"_erasNarrowRegex")||Of.call(this),E?this._erasNarrowRegex:this._erasRegex}function qd(E,I){return I.erasAbbrRegex(E)}function r0(E,I){return I.erasNameRegex(E)}function n0(E,I){return I.erasNarrowRegex(E)}function dm(E,I){return I._eraYearOrdinalRegex||za}function Of(){var E=[],I=[],q=[],z=[],ee,De,vt,fr,dn,fi=this.eras();for(ee=0,De=fi.length;ee<De;++ee)vt=Di(fi[ee].name),fr=Di(fi[ee].abbr),dn=Di(fi[ee].narrow),I.push(vt),E.push(fr),q.push(dn),z.push(vt),z.push(fr),z.push(dn);this._erasRegex=new RegExp("^("+z.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+I.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+E.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+q.join("|")+")","i")}Qe(0,["gg",2],0,function(){return this.weekYear()%100}),Qe(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Nf(E,I){Qe(0,[E,E.length],0,I)}Nf("gggg","weekYear"),Nf("ggggg","weekYear"),Nf("GGGG","isoWeekYear"),Nf("GGGGG","isoWeekYear"),Mt("G",rt),Mt("g",rt),Mt("GG",En,Vr),Mt("gg",En,Vr),Mt("GGGG",Vo,jn),Mt("gggg",Vo,jn),Mt("GGGGG",Vu,ei),Mt("ggggg",Vu,ei),Ss(["gggg","ggggg","GGGG","GGGGG"],function(E,I,q,z){I[z.substr(0,2)]=sn(E)}),Ss(["gg","GG"],function(E,I,q,z){I[z]=t.parseTwoDigitYear(E)});function Rf(E){return bu.call(this,E,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Xy(E){return bu.call(this,E,this.isoWeek(),this.isoWeekday(),1,4)}function i0(){return ji(this.year(),1,4)}function s0(){return ji(this.isoWeekYear(),1,4)}function Jl(){var E=this.localeData()._week;return ji(this.year(),E.dow,E.doy)}function Hp(){var E=this.localeData()._week;return ji(this.weekYear(),E.dow,E.doy)}function bu(E,I,q,z,ee){var De;return E==null?or(this,z,ee).year:(De=ji(E,z,ee),I>De&&(I=De),Wp.call(this,E,I,q,z,ee))}function Wp(E,I,q,z,ee){var De=Od(E,I,q,z,ee),vt=Sf(De.year,0,De.dayOfYear);return this.year(vt.getUTCFullYear()),this.month(vt.getUTCMonth()),this.date(vt.getUTCDate()),this}Qe("Q",0,"Qo","quarter"),Mt("Q",$r),On("Q",function(E,I){I[Ao]=(sn(E)-1)*3});function hm(E){return E==null?Math.ceil((this.month()+1)/3):this.month((E-1)*3+this.month()%3)}Qe("D",["DD",2],"Do","date"),Mt("D",En,xr),Mt("DD",En,Vr),Mt("Do",function(E,I){return E?I._dayOfMonthOrdinalParse||I._ordinalParse:I._dayOfMonthOrdinalParseLenient}),On(["D","DD"],co),On("Do",function(E,I){I[co]=sn(E.match(En)[0])});var Xl=tn("Date",!0);Qe("DDD",["DDDD",3],"DDDo","dayOfYear"),Mt("DDD",ps),Mt("DDDD",Hn),On(["DDD","DDDD"],function(E,I,q){q._dayOfYear=sn(E)});function Pc(E){var I=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return E==null?I:this.add(E-I,"d")}Qe("m",["mm",2],0,"minute"),Mt("m",En,In),Mt("mm",En,Vr),On(["m","mm"],Do);var mm=tn("Minutes",!1);Qe("s",["ss",2],0,"second"),Mt("s",En,In),Mt("ss",En,Vr),On(["s","ss"],lo);var Ud=tn("Seconds",!1);Qe("S",0,0,function(){return~~(this.millisecond()/100)}),Qe(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Qe(0,["SSS",3],0,"millisecond"),Qe(0,["SSSS",4],0,function(){return this.millisecond()*10}),Qe(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Qe(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Qe(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Qe(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Qe(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Mt("S",ps,$r),Mt("SS",ps,Vr),Mt("SSS",ps,Hn);var ec,ym;for(ec="SSSS";ec.length<=9;ec+="S")Mt(ec,za);function Qy(E,I){I[js]=sn(("0."+E)*1e3)}for(ec="S";ec.length<=9;ec+="S")On(ec,Qy);ym=tn("Milliseconds",!1),Qe("z",0,0,"zoneAbbr"),Qe("zz",0,0,"zoneName");function o0(){return this._isUTC?"UTC":""}function a0(){return this._isUTC?"Coordinated Universal Time":""}var Yt=me.prototype;Yt.add=ni,Yt.calendar=am,Yt.clone=Zh,Yt.diff=Up,Yt.endOf=cl,Yt.format=Md,Yt.from=Wy,Yt.fromNow=um,Yt.to=Df,Yt.toNow=Kl,Yt.get=du,Yt.invalidAt=Gy,Yt.isAfter=gv,Yt.isBefore=Qu,Yt.isBetween=Gl,Yt.isSame=Ea,Yt.isSameOrAfter=vu,Yt.isSameOrBefore=Ta,Yt.isValid=Bd,Yt.lang=_u,Yt.locale=cm,Yt.localeData=lm,Yt.max=zo,Yt.min=Jh,Yt.parsingFlags=xx,Yt.set=fs,Yt.startOf=Zu,Yt.subtract=Ld,Yt.toArray=vv,Yt.toObject=pm,Yt.toDate=ll,Yt.toISOString=Cf,Yt.inspect=Af,typeof Symbol<"u"&&Symbol.for!=null&&(Yt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Yt.toJSON=kf,Yt.toString=al,Yt.unix=$p,Yt.valueOf=Xa,Yt.creationData=e0,Yt.eraName=Vp,Yt.eraNarrow=Jy,Yt.eraAbbr=xv,Yt.eraYear=jd,Yt.year=Wu,Yt.isLeapYear=Fl,Yt.weekYear=Rf,Yt.isoWeekYear=Xy,Yt.quarter=Yt.quarters=hm,Yt.month=hu,Yt.daysInMonth=em,Yt.week=Yt.weeks=tm,Yt.isoWeek=Yt.isoWeeks=Hh,Yt.weeksInYear=Jl,Yt.weeksInWeekYear=Hp,Yt.isoWeeksInYear=i0,Yt.isoWeeksInISOWeekYear=s0,Yt.date=Xl,Yt.day=Yt.days=Ns,Yt.weekday=Tn,Yt.isoWeekday=Gu,Yt.dayOfYear=Pc,Yt.hour=Yt.hours=va,Yt.minute=Yt.minutes=mm,Yt.second=Yt.seconds=Ud,Yt.millisecond=Yt.milliseconds=ym,Yt.utcOffset=Pf,Yt.utc=im,Yt.local=sm,Yt.parseZone=ta,Yt.hasAlignedHourOffset=Sa,Yt.isDST=Ja,Yt.isLocal=Hl,Yt.isUtcOffset=Wl,Yt.isUtc=Ei,Yt.isUTC=Ei,Yt.zoneAbbr=o0,Yt.zoneName=a0,Yt.dates=Ve("dates accessor is deprecated. Use date instead.",Xl),Yt.months=Ve("months accessor is deprecated. Use month instead",hu),Yt.years=Ve("years accessor is deprecated. Use year instead",Wu),Yt.zone=Ve("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",bi),Yt.isDSTShifted=Ve("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Vl);function fn(E){return wn(E*1e3)}function ra(){return wn.apply(null,arguments).parseZone()}function po(E){return E}var Pn=se.prototype;Pn.calendar=Se,Pn.longDateFormat=Tt,Pn.invalidDate=ht,Pn.ordinal=Kt,Pn.preparse=po,Pn.postformat=po,Pn.relativeTime=xt,Pn.pastFuture=St,Pn.set=ut,Pn.eras=Ky,Pn.erasParse=Yy,Pn.erasConvertYear=fm,Pn.erasAbbrRegex=t0,Pn.erasNameRegex=wa,Pn.erasNarrowRegex=If,Pn.months=Z0,Pn.monthsShort=kp,Pn.monthsParse=ga,Pn.monthsRegex=ns,Pn.monthsShortRegex=Ip,Pn.week=Nd,Pn.firstDayOfYear=bf,Pn.firstDayOfWeek=mu,Pn.weekdays=rl,Pn.weekdaysMin=zu,Pn.weekdaysShort=yu,Pn.weekdaysParse=Sc,Pn.weekdaysRegex=Gh,Pn.weekdaysShortRegex=Gs,Pn.weekdaysMinRegex=jl,Pn.isPM=Kh,Pn.meridiem=Lp;function Ua(E,I,q,z){var ee=Je(),De=P().set(z,I);return ee[q](De,E)}function $d(E,I,q){if(m(E)&&(I=E,E=void 0),E=E||"",I!=null)return Ua(E,I,q,"month");var z,ee=[];for(z=0;z<12;z++)ee[z]=Ua(E,z,q,"month");return ee}function Js(E,I,q,z){typeof E=="boolean"?(m(I)&&(q=I,I=void 0),I=I||""):(I=E,q=I,E=!1,m(I)&&(q=I,I=void 0),I=I||"");var ee=Je(),De=E?ee._week.dow:0,vt,fr=[];if(q!=null)return Ua(I,(q+De)%7,z,"day");for(vt=0;vt<7;vt++)fr[vt]=Ua(I,(vt+De)%7,z,"day");return fr}function Vd(E,I){return $d(E,I,"months")}function Rn(E,I){return $d(E,I,"monthsShort")}function Ff(E,I,q){return Js(E,I,q,"weekdays")}function zp(E,I,q){return Js(E,I,q,"weekdaysShort")}function gm(E,I,q){return Js(E,I,q,"weekdaysMin")}ae("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 I=E%10,q=sn(E%100/10)===1?"th":I===1?"st":I===2?"nd":I===3?"rd":"th";return E+q}}),t.lang=Ve("moment.lang is deprecated. Use moment.locale instead.",ae),t.langData=Ve("moment.langData is deprecated. Use moment.localeData instead.",Je);var Cc=Math.abs;function vm(){var E=this._data;return this._milliseconds=Cc(this._milliseconds),this._days=Cc(this._days),this._months=Cc(this._months),E.milliseconds=Cc(E.milliseconds),E.seconds=Cc(E.seconds),E.minutes=Cc(E.minutes),E.hours=Cc(E.hours),E.months=Cc(E.months),E.years=Cc(E.years),this}function u0(E,I,q,z){var ee=So(I,q);return E._milliseconds+=z*ee._milliseconds,E._days+=z*ee._days,E._months+=z*ee._months,E._bubble()}function Ql(E,I){return u0(this,E,I,1)}function Ar(E,I){return u0(this,E,I,-1)}function Gp(E){return E<0?Math.floor(E):Math.ceil(E)}function xm(){var E=this._milliseconds,I=this._days,q=this._months,z=this._data,ee,De,vt,fr,dn;return E>=0&&I>=0&&q>=0||E<=0&&I<=0&&q<=0||(E+=Gp(Ac(q)+I)*864e5,I=0,q=0),z.milliseconds=E%1e3,ee=Si(E/1e3),z.seconds=ee%60,De=Si(ee/60),z.minutes=De%60,vt=Si(De/60),z.hours=vt%24,I+=Si(vt/24),dn=Si(Eu(I)),q+=dn,I-=Gp(Ac(dn)),fr=Si(q/12),q%=12,z.days=I,z.months=q,z.years=fr,this}function Eu(E){return E*4800/146097}function Ac(E){return E*146097/4800}function Hd(E){if(!this.isValid())return NaN;var I,q,z=this._milliseconds;if(E=ge(E),E==="month"||E==="quarter"||E==="year")switch(I=this._days+z/864e5,q=this._months+Eu(I),E){case"month":return q;case"quarter":return q/3;case"year":return q/12}else switch(I=this._days+Math.round(Ac(this._months)),E){case"week":return I/7+z/6048e5;case"day":return I+z/864e5;case"hour":return I*24+z/36e5;case"minute":return I*1440+z/6e4;case"second":return I*86400+z/1e3;case"millisecond":return Math.floor(I*864e5)+z;default:throw new Error("Unknown unit "+E)}}function Qa(E){return function(){return this.as(E)}}var Lf=Qa("ms"),_m=Qa("s"),pl=Qa("m"),Wd=Qa("h"),Kp=Qa("d"),Mf=Qa("w"),tc=Qa("M"),Dc=Qa("Q"),zd=Qa("y"),Yp=Lf;function Pa(){return So(this)}function Ui(E){return E=ge(E),this.isValid()?this[E+"s"]():NaN}function Oi(E){return function(){return this.isValid()?this._data[E]:NaN}}var c0=Oi("milliseconds"),Za=Oi("seconds"),Zy=Oi("minutes"),Bf=Oi("hours"),Sm=Oi("days"),_v=Oi("months"),bm=Oi("years");function l0(){return Si(this.days()/7)}var Tu=Math.round,Zl={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jf(E,I,q,z,ee){return ee.relativeTime(I||1,!!q,E,z)}function eg(E,I,q,z){var ee=So(E).abs(),De=Tu(ee.as("s")),vt=Tu(ee.as("m")),fr=Tu(ee.as("h")),dn=Tu(ee.as("d")),fi=Tu(ee.as("M")),ia=Tu(ee.as("w")),eu=Tu(ee.as("y")),qs=De<=q.ss&&["s",De]||De<q.s&&["ss",De]||vt<=1&&["m"]||vt<q.m&&["mm",vt]||fr<=1&&["h"]||fr<q.h&&["hh",fr]||dn<=1&&["d"]||dn<q.d&&["dd",dn];return q.w!=null&&(qs=qs||ia<=1&&["w"]||ia<q.w&&["ww",ia]),qs=qs||fi<=1&&["M"]||fi<q.M&&["MM",fi]||eu<=1&&["y"]||["yy",eu],qs[2]=I,qs[3]=+E>0,qs[4]=z,jf.apply(null,qs)}function tg(E){return E===void 0?Tu:typeof E=="function"?(Tu=E,!0):!1}function Gd(E,I){return Zl[E]===void 0?!1:I===void 0?Zl[E]:(Zl[E]=I,E==="s"&&(Zl.ss=I-1),!0)}function Sv(E,I){if(!this.isValid())return this.localeData().invalidDate();var q=!1,z=Zl,ee,De;return typeof E=="object"&&(I=E,E=!1),typeof E=="boolean"&&(q=E),typeof I=="object"&&(z=Object.assign({},Zl,I),I.s!=null&&I.ss==null&&(z.ss=I.s-1)),ee=this.localeData(),De=eg(this,!q,z,ee),q&&(De=ee.pastFuture(+this,De)),ee.postformat(De)}var p0=Math.abs;function ep(E){return(E>0)-(E<0)||+E}function na(){if(!this.isValid())return this.localeData().invalidDate();var E=p0(this._milliseconds)/1e3,I=p0(this._days),q=p0(this._months),z,ee,De,vt,fr=this.asSeconds(),dn,fi,ia,eu;return fr?(z=Si(E/60),ee=Si(z/60),E%=60,z%=60,De=Si(q/12),q%=12,vt=E?E.toFixed(3).replace(/\.?0+$/,""):"",dn=fr<0?"-":"",fi=ep(this._months)!==ep(fr)?"-":"",ia=ep(this._days)!==ep(fr)?"-":"",eu=ep(this._milliseconds)!==ep(fr)?"-":"",dn+"P"+(De?fi+De+"Y":"")+(q?fi+q+"M":"")+(I?ia+I+"D":"")+(ee||z||E?"T":"")+(ee?eu+ee+"H":"")+(z?eu+z+"M":"")+(E?eu+vt+"S":"")):"P0D"}var qn=Ec.prototype;qn.isValid=Fd,qn.abs=vm,qn.add=Ql,qn.subtract=Ar,qn.as=Hd,qn.asMilliseconds=Lf,qn.asSeconds=_m,qn.asMinutes=pl,qn.asHours=Wd,qn.asDays=Kp,qn.asWeeks=Mf,qn.asMonths=tc,qn.asQuarters=Dc,qn.asYears=zd,qn.valueOf=Yp,qn._bubble=xm,qn.clone=Pa,qn.get=Ui,qn.milliseconds=c0,qn.seconds=Za,qn.minutes=Zy,qn.hours=Bf,qn.days=Sm,qn.weeks=l0,qn.months=_v,qn.years=bm,qn.humanize=Sv,qn.toISOString=na,qn.toString=na,qn.toJSON=na,qn.locale=cm,qn.localeData=lm,qn.toIsoString=Ve("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",na),qn.lang=_u,Qe("X",0,0,"unix"),Qe("x",0,0,"valueOf"),Mt("x",rt),Mt("X",Jt),On("X",function(E,I,q){q._d=new Date(parseFloat(E)*1e3)}),On("x",function(E,I,q){q._d=new Date(sn(E))});return t.version="2.30.1",r(wn),t.fn=Yt,t.min=Ka,t.max=Rd,t.now=Tf,t.utc=P,t.unix=fn,t.months=Vd,t.isDate=y,t.locale=ae,t.invalid=M,t.duration=So,t.isMoment=Ce,t.weekdays=Ff,t.parseZone=ra,t.localeData=Je,t.isDuration=qa,t.monthsShort=Rn,t.weekdaysMin=gm,t.defineLocale=Re,t.updateLocale=nt,t.locales=gt,t.weekdaysShort=zp,t.normalizeUnits=ge,t.relativeTimeRounding=tg,t.relativeTimeThreshold=Gd,t.calendarFormat=vx,t.prototype=Yt,t.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"},t})});function D0(){return!process.stdout.isTTY||process.env.FORCE_NON_TTY==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.PAGES_SOURCE==="skills"||process.env.EDGEONE_NON_INTERACTIVE==="1"}function mC({prefix:e="cli"}){return Vs.default.createElement(Bs.Text,{color:"grey"},"[",e,"]")}function yi(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m\x1B[31m[\u2718] \x1B[0m${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t}),Vs.default.createElement(Bs.Text,{color:"red"},"[\u2718] "),e));r()}function yC(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m\x1B[32m[\u2714] \x1B[0m${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t}),Vs.default.createElement(Bs.Text,{color:"green"},"[\u2714] "),e));r()}function pi(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m \x1B[33mWARNING:\x1B[0m ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t}),Vs.default.createElement(Bs.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Mz(e){if(D0()){console.log(e);return}let{unmount:t}=(0,Bs.render)(Vs.default.createElement(Bs.Text,{color:"cyan"},e));t()}function Ct(e,t="cli"){if(D0()){console.log(`\x1B[90m[${t}]\x1B[0m ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Text,null,Vs.default.createElement(mC,{prefix:t})," ",e));r()}function jR({timestamp:e}){return Vs.default.createElement(Bs.Box,{width:13},Vs.default.createElement(Bs.Text,{color:"grey"},(0,Hb.default)(e).format("HH:mm:ss.SSS")))}function Bz(e,t){if(D0()){console.log(`${(0,Hb.default)(t).format("HH:mm:ss.SSS")} ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Box,null,Vs.default.createElement(jR,{timestamp:t}),Vs.default.createElement(Bs.Text,null,e)));r()}function jz(e,t){if(D0()){console.log(`${(0,Hb.default)(t).format("HH:mm:ss.SSS")} [WARNING] ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Box,null,Vs.default.createElement(jR,{timestamp:t}),Vs.default.createElement(Bs.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Vs.default.createElement(Bs.Text,null," ",e)));r()}function qR(e,t){if(D0()){console.log(`${(0,Hb.default)(t).format("HH:mm:ss.SSS")} [ERROR] ${e}`);return}let{unmount:r}=(0,Bs.render)(Vs.default.createElement(Bs.Box,null,Vs.default.createElement(jR,{timestamp:t}),Vs.default.createElement(Bs.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Vs.default.createElement(Bs.Text,null," ",e)));r()}var Bs,Vs,Hb,ua=ft(()=>{Bs=Lt(hC()),Vs=Lt(yo()),Hb=Lt(Lz())});var Uz,qz=ft(()=>{Uz={name:"edgeone",version:"1.6.20",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/pages/templates","./edgeone-dist/pages/dev/runner-worker.js","./edgeone-dist/pages/observability-python/**","./edgeone-dist/libs-pages-blob-python/**","./edgeone-dist/libs-pages-agent-toolkit/**","./edgeone-dist/studio/**","./libs-pages-blob-python/**","./libs-pages-agent-toolkit/**"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai ./libs-kv-client",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run build:kv-client && npm run prepare:blob-wheel && npm run prepare:agent-toolkit-wheel && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js","build:kv-client":"node ./scripts/build-kv-client.js","prepare:blob-wheel":"node ./scripts/prepare-pages-blob-wheel.js","prepare:agent-toolkit-wheel":"node ./scripts/prepare-pages-agent-toolkit-wheel.js","verify:publish-assets":"node ./scripts/verify-publish-assets.js","upload:agent-version-manifest":"node ./scripts/upload-agent-version-manifest.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build && npm run verify:publish-assets",prepublishOnly:"npm run build && npm run verify:publish-assets",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:observability":"vitest run --config src/agent/observability/node/tests/vitest.config.ts && cd src/agent/observability/python && uv run pytest tests/ -q"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/is-spa":"^0.0.3","@edgeone/nuxt-pages":"1.1.0","@edgeone/opennextjs-pages":"0.2.10","@edgeone/pages-agent-toolkit":"^0.1.34","@edgeone/pages-blob":"^0.0.13",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1",giget:"^2.0.0","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0",vitest:"^4.0.17"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@opentelemetry/api":"^1.9.1","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-metrics-otlp-http":"^0.55.0","@opentelemetry/exporter-trace-otlp-http":"^0.55.0","@opentelemetry/instrumentation":"^0.55.0","@opentelemetry/otlp-transformer":"^0.55.0","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.40.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24","@vitest/coverage-v8":"^4.0.17",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",protobufjs:"^8.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2",zod:"^3.23.8","zod-to-json-schema":"^3.23.5"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}}});function vIe(){var e,t;return{run_id:gIe,cli_version:(t=(e=Uz)==null?void 0:e.version)!=null?t:"unknown",node_version:process.version,os_platform:$R.default.platform(),os_arch:$R.default.arch(),app_type:"cli",app_id:process.env.AppId||void 0,uin:process.env.Uin||void 0,instance_id:process.env.ProjectId||void 0,is_ci:process.env.CI==="true"}}function xIe(e,t){try{if(typeof process.send!="function")return;process.send(JSON.stringify({name:e,value:JSON.stringify(t)}))}catch{}}function lu(e){var r;let t={...vIe(),...e};xIe((r=t.event_name)!=null?r:"unknown",t)}function ld(e){if(e==null)return{message:"unknown error",stack:""};if(typeof e=="string")return{message:gC(e,UR),stack:""};if(typeof e=="object"){let t=e,r=gC(typeof t.message=="string"?t.message:String(t),UR),s=gC(typeof t.stack=="string"?t.stack:"",_Ie);return{message:r,stack:s}}return{message:gC(String(e),UR),stack:""}}function gC(e,t){return e.length>t?e.slice(0,t)+"\u2026[truncated]":e}var $R,uu,cu,gIe,VR,UR,_Ie,fy=ft(()=>{$R=Lt(require("os"));qz();uu={COMMAND:"command",REQUEST:"request",LOCAL_FLOW:"local_flow",EXIT:"exit"},cu={SUCCESS:"success",FAIL:"fail",START:"start"},gIe=`cli-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;VR=(e,t)=>{let r=ld(t);lu({event_name:"error",event_scope:uu.COMMAND,event_result:cu.FAIL,error_message:`${e} ${r.message}`.trim(),error_stack:r.stack})},UR=500,_Ie=2e3});var Wb,S2,HR=ft(()=>{Wb={NEXTJS:"nextjs",NUXTJS:"nuxtjs",ASTRO:"astro",UNKNOWN:"unknown"},S2={FRAMEWORK_DETECT:"framework_detect",PLUGIN_RESOLVE:"plugin_resolve",PLUGIN_LOAD:"plugin_load",PLUGIN_HOOK:"plugin_hook",CONFIG_LOAD:"config_load"}});function EIe(e){if((e==null?void 0:e.code)===bIe)return!0;let t=typeof e=="string"?e:e==null?void 0:e.message;return t==null?void 0:t.includes(SIe)}async function Fg(e=!1){try{let t=await TP(e);return lu({event_name:"Config:Load:Success",event_scope:uu.LOCAL_FLOW,event_phase:S2.CONFIG_LOAD,event_result:cu.SUCCESS,has_build_command:(t==null?void 0:t.buildCommand)!=null,has_install_command:(t==null?void 0:t.installCommand)!=null,has_output_directory:(t==null?void 0:t.outputDirectory)!=null,has_node_version:(t==null?void 0:t.nodeVersion)!=null}),t}catch(t){let r=ld(t);if(lu({event_name:"Config:Load:Fail",event_scope:uu.LOCAL_FLOW,event_phase:S2.CONFIG_LOAD,event_result:cu.FAIL,error_message:r.message}),EIe(t))throw t;return od()&&console.error("%c [ error ]-80","font-size:13px; background:pink; color:#bf2c9f;",t),null}}var SIe,bIe,WR=ft(()=>{n2();xP();fy();HR();SIe="[BLOCKING_CONFIG_ERROR]",bIe="BLOCKING_CONFIG_ERROR"});var vC,fc,xC=ft(()=>{vC=[{funcName:"onRequestGet",method:"GET"},{funcName:"onRequestPost",method:"POST"},{funcName:"onRequestDelete",method:"DELETE"},{funcName:"onRequestPatch",method:"PATCH"},{funcName:"onRequestPut",method:"PUT"},{funcName:"onRequestHead",method:"HEAD"},{funcName:"onRequestOptions",method:"OPTIONS"}],fc=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"]});async function TIe(e){let t;_C.default.statSync(e).isFile()?t=b2.default.resolve(b2.default.dirname(e)):t=e;let r=b2.default.parse(t).root;if(t===r)return null;for(;t!==r;){let s=b2.default.join(t,"package.json");try{return await _C.default.promises.access(s),s}catch{if(t=b2.default.dirname(t),t===r)break}}return null}async function E2(e){if(e.endsWith(".mjs"))return"esm";if(e.endsWith(".cjs"))return"commonjs";try{let t=await TIe(e);if(t&&JSON.parse(await _C.default.promises.readFile(t,"utf-8")).type==="module")return"esm"}catch(t){console.warn("Failed to read package.json:",t)}return"commonjs"}var _C,b2,zb=ft(()=>{_C=Lt(require("fs")),b2=Lt(require("path"))});function PIe(e){let t=zR.default.extname(e);return wIe[t]||"ts"}function DIe(e){return e.split(",").map(t=>t.trim()).map(t=>{let r=t.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(!r)return"";let[,s,a]=r;return!AIe.has(a)||s===a?"":`const ${a} = ${s};`}).filter(Boolean).join(`
146
146
  `)}async function Hz(e,t,r,s){let a=`mod_${CIe++}`,l=(await Vz.default.build({stdin:{contents:e,loader:PIe(r),resolveDir:zR.default.dirname(r)},write:!1,bundle:!0,format:"esm",platform:"node",target:"node14",minify:!1,resolveExtensions:[".ts",".js",".mjs",".json"],nodePaths:[process.cwd()],absWorkingDir:process.cwd(),external:(s==null?void 0:s.externalModules)||[]})).outputFiles[0].text,f=[];l=l.replace(/^import\s+[^'"]*['"][^'"]*['"]\s*;?\n/gm,b=>(f.push(b),"")),l=l.replace(/export (async )?function/g,"$1function"),l=l.replace(/export const/g,"const"),l=l.replace(/export let/g,"let"),l=l.replace(/export var/g,"var"),l=l.replace(/export default/g,""),l=l.replace(/export\s*\{([^}]+)\};?/g,(b,P)=>DIe(P)),l=l.replace(/export class/g,"class");let m=/const\s+app\s*=/.test(l),y=`${f.join(`
147
147
  `)}`;return{code:s!=null&&s.isFramework?`
148
148
  const ${a} = (() => {
@@ -1360,7 +1360,6 @@ Source:
1360
1360
  message: "The requested path does not exist"
1361
1361
  }));
1362
1362
  const endTime = Date.now();
1363
- console.log(\`Makers response status: 404\`);
1364
1363
  return;
1365
1364
  }
1366
1365
 
@@ -1508,7 +1507,6 @@ ${t?`
1508
1507
  }));
1509
1508
  } finally {
1510
1509
  const endTime = Date.now();
1511
- console.log(\`Makers response status: \${response?.status || 'unknown'}\`);
1512
1510
  }
1513
1511
  }
1514
1512
  `}var r5=ft(()=>{wM()});function sk(){return rmt()}function rmt(){return`
@@ -6337,7 +6335,7 @@ globalThis.__EDGEONE_CLOUD_FUNCTION_AGENT_STORE__ = {
6337
6335
  finalHeaders[REQUEST_CONVERSATION_ID_HEADER] = context.agent.conversation_id;
6338
6336
  }
6339
6337
 
6340
- console.log('Makers response status: ' + String(finalStatusCode));
6338
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (context.server ? context.server.requestId : '') + '|statusCode=' + String(finalStatusCode) + '|');
6341
6339
 
6342
6340
  return originalWriteHead.call(res, finalStatusCode, statusMessage, finalHeaders);
6343
6341
  };
@@ -6462,6 +6460,7 @@ globalThis.__EDGEONE_CLOUD_FUNCTION_AGENT_STORE__ = {
6462
6460
  // Internal error from user function - intercept
6463
6461
  console.error('Framework function error:', frameworkError);
6464
6462
  if (!res.headersSent) {
6463
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (context.server ? context.server.requestId : '') + '|statusCode=502|');
6465
6464
  res.writeHead(502, {
6466
6465
  'Content-Type': 'application/json',
6467
6466
  'Functions-Request-Id': context.server ? context.server.requestId : '',
@@ -6519,6 +6518,7 @@ globalThis.__EDGEONE_CLOUD_FUNCTION_AGENT_STORE__ = {
6519
6518
  const requestEndTime = Date.now();
6520
6519
  // console.log(\`Request processing time: \${requestEndTime - requestStartTime}ms\`);
6521
6520
 
6521
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (context.server ? context.server.requestId : '') + '|statusCode=' + String(response?.status || 200) + '|');
6522
6522
  await handleResponse(res, response, getResponsePassHeaders(context, agentConversationId));
6523
6523
  return;
6524
6524
  }
@@ -6566,6 +6566,7 @@ globalThis.__EDGEONE_CLOUD_FUNCTION_AGENT_STORE__ = {
6566
6566
  // console.log(\`Request processing time: \${requestEndTime - requestStartTime}ms\`);
6567
6567
 
6568
6568
 
6569
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (context.server ? context.server.requestId : '') + '|statusCode=' + String(response?.status || 200) + '|');
6569
6570
  await handleResponse(res, response, getResponsePassHeaders(context, agentConversationId));
6570
6571
  return;
6571
6572
  }
@@ -6600,6 +6601,7 @@ globalThis.__EDGEONE_CLOUD_FUNCTION_AGENT_STORE__ = {
6600
6601
  const requestEndTime = Date.now();
6601
6602
  // console.log(\`Request processing time: \${requestEndTime - requestStartTime}ms\`);
6602
6603
 
6604
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (context.server ? context.server.requestId : '') + '|statusCode=' + String(response?.status || 200) + '|');
6603
6605
  await handleResponse(res, response, getResponsePassHeaders(context, agentConversationId));
6604
6606
  return;
6605
6607
  }`}generateMethodHandlerCode(t){return`
@@ -6728,7 +6730,7 @@ globalThis.__EDGEONE_CLOUD_FUNCTION_AGENT_STORE__ = {
6728
6730
  }
6729
6731
  } catch (handlerError) {
6730
6732
  // \u7528\u6237\u51FD\u6570\u5185\u90E8\u9519\u8BEF - \u62E6\u622A
6731
- console.log('Makers response status: ', 502);
6733
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (context.server ? context.server.requestId : '') + '|statusCode=502|');
6732
6734
  response = new Response(JSON.stringify({
6733
6735
  error: 'Internal Server Error',
6734
6736
  message: handlerError.message
@@ -7128,10 +7130,10 @@ const server = http.createServer(async (req, res) => {
7128
7130
  }
7129
7131
  }
7130
7132
 
7131
- console.log(\`Makers request path: \${fullPath}\`);
7133
+ const scfRequestId = req.headers['x-scf-request-id'] || '';
7132
7134
 
7133
7135
  let response = null;
7134
-
7136
+
7135
7137
  ${r}
7136
7138
 
7137
7139
  // Return 404 if no matching route is found
@@ -7154,11 +7156,13 @@ const server = http.createServer(async (req, res) => {
7154
7156
  if (!res.headers) {
7155
7157
  res.headers = {};
7156
7158
  }
7159
+ console.log(\`Makers request path: \${fullPath} |scfRequestId=\${scfRequestId}|statusCode=\${response?.status || 200}|\`);
7157
7160
  // Handle response, set functions-request-id header
7158
7161
  await handleResponse(res, response, getResponsePassHeaders(context, agentConversationId));
7159
7162
 
7160
7163
  } catch (error) {
7161
7164
  console.error('server error', error);
7165
+ console.log('Makers request path: ' + fullPath + ' |scfRequestId=' + (req.headers['x-scf-request-id'] || '') + '|statusCode=502|');
7162
7166
  // User function internal error / internal 502 - intercept
7163
7167
  res.writeHead(502, {
7164
7168
  "Content-Type": "application/json",
@@ -8252,45 +8256,45 @@ export = cryptoShim;
8252
8256
  addEventListener('fetch', (event, hookCtx) => {
8253
8257
  const res = usercode(event, hookCtx);
8254
8258
  event.respondWith(res);
8255
- });`,jS(Cxt,this.bundleText),Ct("\u2728 Compiled edge functions successfully"),lu({event_name:"Pages Build:Edge Function:Success",event_scope:uu.LOCAL_FLOW,event_phase:"builder",event_result:cu.SUCCESS,command:"pages",subcommand:"build",builder_type:"edge-function",duration_ms:Date.now()-t})}let a=y=>![/\(\?[=!<]/,/\(\?>/,/\\(\d+)/,/\(\?\(/].some(b=>b.test(y)),n=((m=this.middlewareConfig)==null?void 0:m.normalizedMatcher)||[],l=n.some(y=>y.regex&&!a(y.regex)),f=this.middlewareConfig?{runtime:this.middlewareConfig.runtime||"edge-functions",matcher:l?[{source:"/:path*"}]:n.map(y=>({source:y.source}))}:null;if(this.logicText||this.middlewareBundleCode||await j9()){let y=(this.functionList||[]).map(L=>{let M=tk(L.routePath);return{src:M.src,routePath:L.routePath,method:L.method,_specificity:M.specificity,_matchType:rk(M.src),_prefix:nk(M.src)}});y.sort((L,M)=>L._prefix!==M._prefix?L._prefix.localeCompare(M._prefix):L._matchType!==M._matchType?L._matchType-M._matchType:M._specificity-L._specificity);let v=y.map(L=>{let M=L.method,G=fc.every(re=>M.includes(re))&&M.length===fc.length,oe={src:L.src};return!G&&M.length>0&&(oe.methods=M),oe}),b=JSON.stringify({routes:v,middleware:f},null,2);jS(ale,b);let P=Mh.readFileSync(Wr(ale),"utf-8"),k=JSON.parse(P),g=k.routes.map((L,M)=>{var G;return{...L,routePath:(G=y[M])==null?void 0:G.routePath}}),B=JSON.stringify({routes:g,middleware:k.middleware});return{bundle:this.bundleText,meta:B,routes:k.routes,middleware:f,watch:[]}}return{bundle:this.bundleText,meta:JSON.stringify({routes:[],middleware:null}),routes:[],middleware:f,watch:[]}}async readIndexFiles(t){try{let r=Mh.readdirSync(t);for(let s of r){let a=wxt.join(t,s);if(Mh.statSync(a).isDirectory())this.readIndexFiles(a);else if(/\.(ts|js|cjs|tsx|jsx)$/.test(s)){let l=Mh.readFileSync(a,"utf-8");if(this.isPagesFunction(l)){let f=this.bundleAndGetString(a);f&&this.isPagesFunction(f.text)&&this.arrangeText(f)}}}}catch(r){this.mode==="dev"&&console.log("error",r.message)}}isPagesFunction(t){return t.indexOf("onRequest")>-1}calculateSpecificity(t){let r=t.split("/").filter(f=>f.length>0),s=0,a=0;for(let f of r)f.startsWith("[[")&&f.endsWith("]]")?a+=2:f.startsWith("[")&&f.endsWith("]")?a+=1:s+=1;let n=r.length;return s*1e3+n*100-a*10}matchPath(t){let r=/^\/(?:[^/]+\/)*\[\[(.+?)\]\]$/;if(r.test(t)&&t.indexOf("[[")>-1){let s=r.exec(t);if(s[1])return{id:s[1],mode:2,left:t.replace(`[[${s[1]}]]`,"")}}else if(ule.test(t)){let s=ule.exec(t),a=/\[(.*?)\]/g,l=t.match(a).map(m=>m.slice(1,-1)),f=JSON.parse(JSON.stringify(t));if(l==null||l.forEach(m=>{f=f.replace(`[${m}]`,"([^/]*)")}),f=f.replace(/\//g,"\\/"),s[1])return{id:l,mode:1,left:f}}else return{id:"",mode:0,left:""}}arrangeText(t){let r=t.text;if(/onRequest(?![a-zA-Z])/.test(r)){r=t.text.replace(/\}\)\(\)\;\n(?:\/\*[\s\S]*?\*\/\n?)*responseFoo/,`
8259
+ });`,jS(Cxt,this.bundleText),Ct("\u2728 Compiled edge functions successfully"),lu({event_name:"Pages Build:Edge Function:Success",event_scope:uu.LOCAL_FLOW,event_phase:"builder",event_result:cu.SUCCESS,command:"pages",subcommand:"build",builder_type:"edge-function",duration_ms:Date.now()-t})}let a=y=>![/\(\?[=!<]/,/\(\?>/,/\\(\d+)/,/\(\?\(/].some(b=>b.test(y)),n=((m=this.middlewareConfig)==null?void 0:m.normalizedMatcher)||[],l=n.some(y=>y.regex&&!a(y.regex)),f=this.middlewareConfig?{runtime:this.middlewareConfig.runtime||"edge-functions",matcher:l?[{source:"/:path*"}]:n.map(y=>({source:y.source}))}:null;if(this.logicText||this.middlewareBundleCode||await j9()){let y=(this.functionList||[]).map(L=>{let M=tk(L.routePath);return{src:M.src,routePath:L.routePath,method:L.method,_specificity:M.specificity,_matchType:rk(M.src),_prefix:nk(M.src)}});y.sort((L,M)=>L._prefix!==M._prefix?L._prefix.localeCompare(M._prefix):L._matchType!==M._matchType?L._matchType-M._matchType:M._specificity-L._specificity);let v=y.map(L=>{let M=L.method,G=fc.every(re=>M.includes(re))&&M.length===fc.length,oe={src:L.src};return!G&&M.length>0&&(oe.methods=M),oe}),b=JSON.stringify({routes:v,middleware:f},null,2);jS(ale,b);let P=Mh.readFileSync(Wr(ale),"utf-8"),k=JSON.parse(P),g=k.routes.map((L,M)=>{var G;return{...L,routePath:(G=y[M])==null?void 0:G.routePath}}),B=JSON.stringify({routes:g,middleware:k.middleware});return{bundle:this.bundleText,meta:B,routes:k.routes,middleware:f,watch:[]}}return{bundle:this.bundleText,meta:JSON.stringify({routes:[],middleware:null}),routes:[],middleware:f,watch:[]}}async readIndexFiles(t){try{let r=Mh.readdirSync(t);for(let s of r){let a=wxt.join(t,s);if(Mh.statSync(a).isDirectory())this.readIndexFiles(a);else if(/\.(ts|js|cjs|tsx|jsx)$/.test(s)){let l=Mh.readFileSync(a,"utf-8");if(this.isPagesFunction(l)){let f=this.bundleAndGetString(a);f&&this.isPagesFunction(f.text)&&this.arrangeText(f)}}}}catch(r){this.mode==="dev"&&console.log("error",r.message)}}isPagesFunction(t){return t.indexOf("onRequest")>-1}calculateSpecificity(t){let r=t.split("/").filter(f=>f.length>0),s=0,a=0;for(let f of r)f.startsWith("[[")&&f.endsWith("]]")?a+=2:f.startsWith("[")&&f.endsWith("]")?a+=1:s+=1;let n=r.length;return s*1e3+n*100-a*10}matchPath(t){let r=/^\/(?:[^/]+\/)*\[\[(.+?)\]\]$/;if(r.test(t)&&t.indexOf("[[")>-1){let s=r.exec(t);if(s[1])return{id:s[1],mode:2,left:t.replace(`[[${s[1]}]]`,"")}}else if(ule.test(t)){let s=ule.exec(t),a=/\[(.*?)\]/g,l=t.match(a).map(m=>m.slice(1,-1)),f=JSON.parse(JSON.stringify(t));if(l==null||l.forEach(m=>{f=f.replace(`[${m}]`,"([^/]*)")}),f=f.replace(/\//g,"\\/"),s[1])return{id:l,mode:1,left:f}}else return{id:"",mode:0,left:""}}arrangeText(t){let r=t.text,a=/onRequest(?![a-zA-Z])/.test(t.text);if(a&&this.recordFunc(t,"onRequest"),vC.forEach(n=>{if(t.text.indexOf(n.funcName)>-1){r=t.text.replace(/\}\)\(\)\;\n(?:\/\*[\s\S]*?\*\/\n?)*responseFoo/,`
8260
+ pagesFunctionResponse = ${n.funcName};
8261
+ })();`);let l=this.matchPath(t.path)||{id:"",mode:0,left:""};if(l.mode===0){let f=`
8262
+ if(!matchedFunc && '${t.path}' === urlInfo.pathname && request.method === '${n.method}') {
8263
+ matchedFunc = true;
8264
+ ${r}
8265
+ }
8266
+ `;this.addLogicSnippet(l.mode,f,t.path),this.recordFunc(t,n.funcName)}else if(l.mode===1){let f=`
8267
+ if(!matchedFunc && /^${l.left}$/.test(urlInfo.pathname) && request.method === '${n.method}') {
8268
+ routeParams = ${JSON.stringify(l)};
8269
+ matchedFunc = true;
8270
+ ${r}
8271
+ }
8272
+ `;this.addLogicSnippet(l.mode,f,t.path),this.recordFunc(t,n.funcName)}else if(l.mode===2){let f=cle.exec(`${t.path}`),y=`
8273
+ if(!matchedFunc && /^${`${t.path}`.replace(`[[${f[1]}]]`,"").replace(/\//g,"\\/")}(.+?)$/.test(urlInfo.pathname) && request.method === '${n.method}') {
8274
+ routeParams = ${JSON.stringify(l)};
8275
+ matchedFunc = true;
8276
+ ${r}
8277
+ }
8278
+ `;this.addLogicSnippet(l.mode,y,t.path),this.recordFunc(t,n.funcName)}}}),a){r=t.text.replace(/\}\)\(\)\;\n(?:\/\*[\s\S]*?\*\/\n?)*responseFoo/,`
8256
8279
  pagesFunctionResponse = onRequest;
8257
- })();`);let a=this.matchPath(`${t.path}`)||{id:"",mode:0,left:""};if(a.mode===0){let n=`
8280
+ })();`);let n=this.matchPath(`${t.path}`)||{id:"",mode:0,left:""};if(n.mode===0){let l=`
8258
8281
  if(!matchedFunc && '${t.path}' === urlInfo.pathname) {
8259
8282
  matchedFunc = true;
8260
8283
  ${r}
8261
8284
  }
8262
- `;this.addLogicSnippet(a.mode,n,t.path),this.recordFunc(t,"onRequest")}else if(a.mode===1){let n=`
8263
- if(!matchedFunc && /^${a.left}$/.test(urlInfo.pathname)) {
8264
- routeParams = ${JSON.stringify(a)};
8285
+ `;this.addLogicSnippet(n.mode,l,t.path)}else if(n.mode===1){let l=`
8286
+ if(!matchedFunc && /^${n.left}$/.test(urlInfo.pathname)) {
8287
+ routeParams = ${JSON.stringify(n)};
8265
8288
  matchedFunc = true;
8266
8289
  ${r}
8267
8290
  }
8268
- `;this.addLogicSnippet(a.mode,n,t.path),this.recordFunc(t,"onRequest")}else if(a.mode===2){let n=cle.exec(`${t.path}`),f=`
8269
- if(!matchedFunc && /^${`${t.path}`.replace(`[[${n[1]}]]`,"").replace(/\//g,"\\/")}(.+?)$/.test(urlInfo.pathname)) {
8270
- routeParams = ${JSON.stringify(a)};
8291
+ `;this.addLogicSnippet(n.mode,l,t.path)}else if(n.mode===2){let l=cle.exec(`${t.path}`),m=`
8292
+ if(!matchedFunc && /^${`${t.path}`.replace(`[[${l[1]}]]`,"").replace(/\//g,"\\/")}(.+?)$/.test(urlInfo.pathname)) {
8293
+ routeParams = ${JSON.stringify(n)};
8271
8294
  matchedFunc = true;
8272
8295
  ${r}
8273
8296
  }
8274
- `;this.addLogicSnippet(a.mode,f,t.path),this.recordFunc(t,"onRequest")}}vC.forEach(a=>{if(r.indexOf(a.funcName)>-1){r=t.text.replace(/\}\)\(\)\;\n(?:\/\*[\s\S]*?\*\/\n?)*responseFoo/,`
8275
- pagesFunctionResponse = ${a.funcName};
8276
- })();`);let n=this.matchPath(t.path)||{id:"",mode:0,left:""};if(n.mode===0){let l=`
8277
- if(!matchedFunc && '${t.path}' === urlInfo.pathname && request.method === '${a.method}') {
8278
- matchedFunc = true;
8279
- ${r}
8280
- }
8281
- `;this.addLogicSnippet(n.mode,l,t.path),this.recordFunc(t,a.funcName)}else if(n.mode===1){let l=`
8282
- if(!matchedFunc && /^${n.left}$/.test(urlInfo.pathname) && request.method === '${a.method}') {
8283
- routeParams = ${JSON.stringify(n)};
8284
- matchedFunc = true;
8285
- ${r}
8286
- }
8287
- `;this.addLogicSnippet(n.mode,l,t.path),this.recordFunc(t,a.funcName)}else if(n.mode===2){let l=cle.exec(`${t.path}`),m=`
8288
- if(!matchedFunc && /^${`${t.path}`.replace(`[[${l[1]}]]`,"").replace(/\//g,"\\/")}(.+?)$/.test(urlInfo.pathname) && request.method === '${a.method}') {
8289
- routeParams = ${JSON.stringify(n)};
8290
- matchedFunc = true;
8291
- ${r}
8292
- }
8293
- `;this.addLogicSnippet(n.mode,m,t.path),this.recordFunc(t,a.funcName)}}}),this.functionIndex=this.functionIndex+1}getMountPath(t){let r=t.replace(/\/([^/]+)$/g,"");return r||"/"}recordFunc(t,r){try{let s=t.path.replace(this.FUNCTIONPATH.replace(/\.\//,""),"").replace(/\/\[\[([^/]+)\]\]$/,"/:$1*").replace(/\/\[([^/]+)\]/g,"/:$1").replace(/[^\w/:*\-]/g,"");this.functionListKeys.push(s);let a=fc,n=[];if(r==="onRequest"){for(let f of a)t.text.toLowerCase().includes("onrequest"+f.toLowerCase())&&n.push(f);n.length||(n=[...fc])}else n=[r.replace("onRequest","").toUpperCase()];let l=this.functionList.findIndex(f=>f.routePath===s);if(l>=0){let f=this.functionList[l],m=Array.isArray(f.method)?f.method:[f.method],y=Array.isArray(n)?n:[n],v=[...new Set([...m,...y])],b=[...new Set([...f.module,`${t.filePath}:${r}`])];this.functionList[l]={...f,method:v,module:b}}else{let f={routePath:s,mountPath:this.getMountPath(s),method:n,module:[`${t.filePath}:${r}`]};this.functionList.push(f)}}catch(s){console.log(s.message)}}addLogicSnippet(t,r,s){let a=this.calculateSpecificity(s);this.logicSegments.push({priority:t,specificity:a,index:this.logicSegmentsIndex++,code:r})}bundleAndGetString(t){let r={};for(let l in this.env)/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(l)&&typeof this.env[l]=="string"&&(r[`env.${l}`]=JSON.stringify(this.env[l]));let s=Pxt.buildSync({entryPoints:[t],bundle:!0,write:!1,outfile:"./.tef_dist/assets.js",define:r}),{outputFiles:a}=s,n;for(let l of a)if(l.path.includes(".css"))this.cssText+=l.text;else{let f=/\.(js|ts|cjs|tsx|jsx)$/,m=l.text;t=t.replace(/\\/g,"/");let y=t.replace(/\/index\.(js|ts|cjs|tsx|jsx)/,".js").replace(f,"").replace(this.FUNCTIONPATH.replace(/\.\//,""),"");n={filePath:t.replace(this.FUNCTIONPATH,""),path:y===""?"/":y,text:`${m}responseFoo`}}return n}}});var Ry=J((x9t,dle)=>{"use strict";var ple=["nodebuffer","arraybuffer","fragments"],fle=typeof Blob<"u";fle&&ple.push("blob");dle.exports={BINARY_TYPES:ple,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:fle,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var XT=J((_9t,Yk)=>{"use strict";var{EMPTY_BUFFER:Axt}=Ry(),q9=Buffer[Symbol.species];function Dxt(e,t){if(e.length===0)return Axt;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),s=0;for(let a=0;a<e.length;a++){let n=e[a];r.set(n,s),s+=n.length}return s<t?new q9(r.buffer,r.byteOffset,s):r}function hle(e,t,r,s,a){for(let n=0;n<a;n++)r[s+n]=e[n]^t[n&3]}function mle(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function kxt(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function U9(e){if(U9.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new q9(e):ArrayBuffer.isView(e)?t=new q9(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),U9.readOnly=!1),t}Yk.exports={concat:Dxt,mask:hle,toArrayBuffer:kxt,toBuffer:U9,unmask:mle};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=require("bufferutil");Yk.exports.mask=function(t,r,s,a,n){n<48?hle(t,r,s,a,n):e.mask(t,r,s,a,n)},Yk.exports.unmask=function(t,r){t.length<32?mle(t,r):e.unmask(t,r)}}catch{}});var vle=J((S9t,gle)=>{"use strict";var yle=Symbol("kDone"),$9=Symbol("kRun"),V9=class{constructor(t){this[yle]=()=>{this.pending--,this[$9]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[$9]()}[$9](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[yle])}}};gle.exports=V9});var ZT=J((b9t,ble)=>{"use strict";var QT=require("zlib"),xle=XT(),Ixt=vle(),{kStatusCode:_le}=Ry(),Oxt=Buffer[Symbol.species],Nxt=Buffer.from([0,0,255,255]),Xk=Symbol("permessage-deflate"),Fy=Symbol("total-length"),B_=Symbol("callback"),lv=Symbol("buffers"),j_=Symbol("error"),Jk,H9=class{constructor(t,r,s){if(this._maxPayload=s|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Jk){let a=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Jk=new Ixt(a)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[B_];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,s=t.find(a=>!(r.serverNoContextTakeover===!1&&a.server_no_context_takeover||a.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>a.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!a.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(s=>{let a=r[s];if(a.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(a=a[0],s==="client_max_window_bits"){if(a!==!0){let n=+a;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${a}`);a=n}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${a}`)}else if(s==="server_max_window_bits"){let n=+a;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${a}`);a=n}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(a!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${a}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=a})}),t}decompress(t,r,s){Jk.add(a=>{this._decompress(t,r,(n,l)=>{a(),s(n,l)})})}compress(t,r,s){Jk.add(a=>{this._compress(t,r,(n,l)=>{a(),s(n,l)})})}_decompress(t,r,s){let a=this._isServer?"client":"server";if(!this._inflate){let n=`${a}_max_window_bits`,l=typeof this.params[n]!="number"?QT.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=QT.createInflateRaw({...this._options.zlibInflateOptions,windowBits:l}),this._inflate[Xk]=this,this._inflate[Fy]=0,this._inflate[lv]=[],this._inflate.on("error",Fxt),this._inflate.on("data",Sle)}this._inflate[B_]=s,this._inflate.write(t),r&&this._inflate.write(Nxt),this._inflate.flush(()=>{let n=this._inflate[j_];if(n){this._inflate.close(),this._inflate=null,s(n);return}let l=xle.concat(this._inflate[lv],this._inflate[Fy]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Fy]=0,this._inflate[lv]=[],r&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),s(null,l)})}_compress(t,r,s){let a=this._isServer?"server":"client";if(!this._deflate){let n=`${a}_max_window_bits`,l=typeof this.params[n]!="number"?QT.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=QT.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:l}),this._deflate[Fy]=0,this._deflate[lv]=[],this._deflate.on("data",Rxt)}this._deflate[B_]=s,this._deflate.write(t),this._deflate.flush(QT.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=xle.concat(this._deflate[lv],this._deflate[Fy]);r&&(n=new Oxt(n.buffer,n.byteOffset,n.length-4)),this._deflate[B_]=null,this._deflate[Fy]=0,this._deflate[lv]=[],r&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),s(null,n)})}};ble.exports=H9;function Rxt(e){this[lv].push(e),this[Fy]+=e.length}function Sle(e){if(this[Fy]+=e.length,this[Xk]._maxPayload<1||this[Fy]<=this[Xk]._maxPayload){this[lv].push(e);return}this[j_]=new RangeError("Max payload size exceeded"),this[j_].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[j_][_le]=1009,this.removeListener("data",Sle),this.reset()}function Fxt(e){if(this[Xk]._inflate=null,this[j_]){this[B_](this[j_]);return}e[_le]=1007,this[B_](e)}});var q_=J((E9t,Qk)=>{"use strict";var{isUtf8:Ele}=require("buffer"),{hasBlob:Lxt}=Ry(),Mxt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Bxt(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function W9(e){let t=e.length,r=0;for(;r<t;)if(!(e[r]&128))r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function jxt(e){return Lxt&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Qk.exports={isBlob:jxt,isValidStatusCode:Bxt,isValidUTF8:W9,tokenChars:Mxt};if(Ele)Qk.exports.isValidUTF8=function(e){return e.length<24?W9(e):Ele(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");Qk.exports.isValidUTF8=function(t){return t.length<32?W9(t):e(t)}}catch{}});var J9=J((T9t,kle)=>{"use strict";var{Writable:qxt}=require("stream"),Tle=ZT(),{BINARY_TYPES:Uxt,EMPTY_BUFFER:wle,kStatusCode:$xt,kWebSocket:Vxt}=Ry(),{concat:z9,toArrayBuffer:Hxt,unmask:Wxt}=XT(),{isValidStatusCode:zxt,isValidUTF8:Ple}=q_(),Zk=Buffer[Symbol.species],Ad=0,Cle=1,Ale=2,Dle=3,G9=4,K9=5,eI=6,Y9=class extends qxt{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||Uxt[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Vxt]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Ad}_write(t,r,s){if(this._opcode===8&&this._state==Ad)return s();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(s)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new Zk(s.buffer,s.byteOffset+t,s.length-t),new Zk(s.buffer,s.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let s=this._buffers[0],a=r.length-t;t>=s.length?r.set(this._buffers.shift(),a):(r.set(new Uint8Array(s.buffer,s.byteOffset,t),a),this._buffers[0]=new Zk(s.buffer,s.byteOffset+t,s.length-t)),t-=s.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Ad:this.getInfo(t);break;case Cle:this.getPayloadLength16(t);break;case Ale:this.getPayloadLength64(t);break;case Dle:this.getMask();break;case G9:this.getData(t);break;case K9:case eI:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if(r[0]&48){let a=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(a);return}let s=(r[0]&64)===64;if(s&&!this._extensions[Tle.extensionName]){let a=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(a);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let a=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(a);return}if(!this._fragmented){let a=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(a);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let a=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(a);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let a=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(a);return}if(s){let a=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(a);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let a=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(a);return}}else{let a=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(a);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let a=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(a);return}}else if(this._masked){let a=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(a);return}this._payloadLength===126?this._state=Cle:this._payloadLength===127?this._state=Ale:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let a=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(a);return}this._payloadLength=s*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=Dle:this._state=G9}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=G9}getData(t){let r=wle;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&Wxt(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=K9,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[Tle.extensionName].decompress(t,this._fin,(a,n)=>{if(a)return r(a);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let l=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(l);return}this._fragments.push(n)}this.dataMessage(r),this._state===Ad&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Ad;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let a;this._binaryType==="nodebuffer"?a=z9(s,r):this._binaryType==="arraybuffer"?a=Hxt(z9(s,r)):this._binaryType==="blob"?a=new Blob(s):a=s,this._allowSynchronousEvents?(this.emit("message",a,!0),this._state=Ad):(this._state=eI,setImmediate(()=>{this.emit("message",a,!0),this._state=Ad,this.startLoop(t)}))}else{let a=z9(s,r);if(!this._skipUTF8Validation&&!Ple(a)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(n);return}this._state===K9||this._allowSynchronousEvents?(this.emit("message",a,!1),this._state=Ad):(this._state=eI,setImmediate(()=>{this.emit("message",a,!1),this._state=Ad,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,wle),this.end();else{let s=t.readUInt16BE(0);if(!zxt(s)){let n=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(n);return}let a=new Zk(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Ple(a)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(n);return}this._loop=!1,this.emit("conclude",s,a),this.end()}this._state=Ad;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Ad):(this._state=eI,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Ad,this.startLoop(r)}))}createError(t,r,s,a,n){this._loop=!1,this._errored=!0;let l=new t(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(l,this.createError),l.code=n,l[$xt]=a,l}};kle.exports=Y9});var Z9=J((P9t,Nle)=>{"use strict";var{Duplex:w9t}=require("stream"),{randomFillSync:Gxt}=require("crypto"),Ile=ZT(),{EMPTY_BUFFER:Kxt,kWebSocket:Yxt,NOOP:Jxt}=Ry(),{isBlob:U_,isValidStatusCode:Xxt}=q_(),{mask:Ole,toBuffer:px}=XT(),Dd=Symbol("kByteLength"),Qxt=Buffer.alloc(4),tI=8*1024,fx,$_=tI,Bh=0,Zxt=1,e2t=2,X9=class e{constructor(t,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Bh,this.onerror=Jxt,this[Yxt]=void 0}static frame(t,r){let s,a=!1,n=2,l=!1;r.mask&&(s=r.maskBuffer||Qxt,r.generateMask?r.generateMask(s):($_===tI&&(fx===void 0&&(fx=Buffer.alloc(tI)),Gxt(fx,0,tI),$_=0),s[0]=fx[$_++],s[1]=fx[$_++],s[2]=fx[$_++],s[3]=fx[$_++]),l=(s[0]|s[1]|s[2]|s[3])===0,n=6);let f;typeof t=="string"?(!r.mask||l)&&r[Dd]!==void 0?f=r[Dd]:(t=Buffer.from(t),f=t.length):(f=t.length,a=r.mask&&r.readOnly&&!l);let m=f;f>=65536?(n+=8,m=127):f>125&&(n+=2,m=126);let y=Buffer.allocUnsafe(a?f+n:n);return y[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(y[0]|=64),y[1]=m,m===126?y.writeUInt16BE(f,2):m===127&&(y[2]=y[3]=0,y.writeUIntBE(f,4,6)),r.mask?(y[1]|=128,y[n-4]=s[0],y[n-3]=s[1],y[n-2]=s[2],y[n-1]=s[3],l?[y,t]:a?(Ole(t,s,y,n,f),[y]):(Ole(t,s,t,0,f),[y,t])):[y,t]}close(t,r,s,a){let n;if(t===void 0)n=Kxt;else{if(typeof t!="number"||!Xxt(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(t,0);else{let f=Buffer.byteLength(r);if(f>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+f),n.writeUInt16BE(t,0),typeof r=="string"?n.write(r,2):n.set(r,2)}}let l={[Dd]:n.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Bh?this.enqueue([this.dispatch,n,!1,l,a]):this.sendFrame(e.frame(n,l),a)}ping(t,r,s){let a,n;if(typeof t=="string"?(a=Buffer.byteLength(t),n=!1):U_(t)?(a=t.size,n=!1):(t=px(t),a=t.length,n=px.readOnly),a>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[Dd]:a,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};U_(t)?this._state!==Bh?this.enqueue([this.getBlobData,t,!1,l,s]):this.getBlobData(t,!1,l,s):this._state!==Bh?this.enqueue([this.dispatch,t,!1,l,s]):this.sendFrame(e.frame(t,l),s)}pong(t,r,s){let a,n;if(typeof t=="string"?(a=Buffer.byteLength(t),n=!1):U_(t)?(a=t.size,n=!1):(t=px(t),a=t.length,n=px.readOnly),a>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[Dd]:a,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};U_(t)?this._state!==Bh?this.enqueue([this.getBlobData,t,!1,l,s]):this.getBlobData(t,!1,l,s):this._state!==Bh?this.enqueue([this.dispatch,t,!1,l,s]):this.sendFrame(e.frame(t,l),s)}send(t,r,s){let a=this._extensions[Ile.extensionName],n=r.binary?2:1,l=r.compress,f,m;typeof t=="string"?(f=Buffer.byteLength(t),m=!1):U_(t)?(f=t.size,m=!1):(t=px(t),f=t.length,m=px.readOnly),this._firstFragment?(this._firstFragment=!1,l&&a&&a.params[a._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(l=f>=a._threshold),this._compress=l):(l=!1,n=0),r.fin&&(this._firstFragment=!0);let y={[Dd]:f,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:m,rsv1:l};U_(t)?this._state!==Bh?this.enqueue([this.getBlobData,t,this._compress,y,s]):this.getBlobData(t,this._compress,y,s):this._state!==Bh?this.enqueue([this.dispatch,t,this._compress,y,s]):this.dispatch(t,this._compress,y,s)}getBlobData(t,r,s,a){this._bufferedBytes+=s[Dd],this._state=e2t,t.arrayBuffer().then(n=>{if(this._socket.destroyed){let f=new Error("The socket was closed while the blob was being read");process.nextTick(Q9,this,f,a);return}this._bufferedBytes-=s[Dd];let l=px(n);r?this.dispatch(l,r,s,a):(this._state=Bh,this.sendFrame(e.frame(l,s),a),this.dequeue())}).catch(n=>{process.nextTick(t2t,this,n,a)})}dispatch(t,r,s,a){if(!r){this.sendFrame(e.frame(t,s),a);return}let n=this._extensions[Ile.extensionName];this._bufferedBytes+=s[Dd],this._state=Zxt,n.compress(t,s.fin,(l,f)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Q9(this,m,a);return}this._bufferedBytes-=s[Dd],this._state=Bh,s.readOnly=!1,this.sendFrame(e.frame(f,s),a),this.dequeue()})}dequeue(){for(;this._state===Bh&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Dd],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Dd],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Nle.exports=X9;function Q9(e,t,r){typeof r=="function"&&r(t);for(let s=0;s<e._queue.length;s++){let a=e._queue[s],n=a[a.length-1];typeof n=="function"&&n(t)}}function t2t(e,t,r){Q9(e,t,r),e.onerror(t)}});var $le=J((C9t,Ule)=>{"use strict";var{kForOnEventAttribute:ew,kListener:ej}=Ry(),Rle=Symbol("kCode"),Fle=Symbol("kData"),Lle=Symbol("kError"),Mle=Symbol("kMessage"),Ble=Symbol("kReason"),V_=Symbol("kTarget"),jle=Symbol("kType"),qle=Symbol("kWasClean"),Ly=class{constructor(t){this[V_]=null,this[jle]=t}get target(){return this[V_]}get type(){return this[jle]}};Object.defineProperty(Ly.prototype,"target",{enumerable:!0});Object.defineProperty(Ly.prototype,"type",{enumerable:!0});var dx=class extends Ly{constructor(t,r={}){super(t),this[Rle]=r.code===void 0?0:r.code,this[Ble]=r.reason===void 0?"":r.reason,this[qle]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Rle]}get reason(){return this[Ble]}get wasClean(){return this[qle]}};Object.defineProperty(dx.prototype,"code",{enumerable:!0});Object.defineProperty(dx.prototype,"reason",{enumerable:!0});Object.defineProperty(dx.prototype,"wasClean",{enumerable:!0});var H_=class extends Ly{constructor(t,r={}){super(t),this[Lle]=r.error===void 0?null:r.error,this[Mle]=r.message===void 0?"":r.message}get error(){return this[Lle]}get message(){return this[Mle]}};Object.defineProperty(H_.prototype,"error",{enumerable:!0});Object.defineProperty(H_.prototype,"message",{enumerable:!0});var tw=class extends Ly{constructor(t,r={}){super(t),this[Fle]=r.data===void 0?null:r.data}get data(){return this[Fle]}};Object.defineProperty(tw.prototype,"data",{enumerable:!0});var r2t={addEventListener(e,t,r={}){for(let a of this.listeners(e))if(!r[ew]&&a[ej]===t&&!a[ew])return;let s;if(e==="message")s=function(n,l){let f=new tw("message",{data:l?n:n.toString()});f[V_]=this,rI(t,this,f)};else if(e==="close")s=function(n,l){let f=new dx("close",{code:n,reason:l.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[V_]=this,rI(t,this,f)};else if(e==="error")s=function(n){let l=new H_("error",{error:n,message:n.message});l[V_]=this,rI(t,this,l)};else if(e==="open")s=function(){let n=new Ly("open");n[V_]=this,rI(t,this,n)};else return;s[ew]=!!r[ew],s[ej]=t,r.once?this.once(e,s):this.on(e,s)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[ej]===t&&!r[ew]){this.removeListener(e,r);break}}};Ule.exports={CloseEvent:dx,ErrorEvent:H_,Event:Ly,EventTarget:r2t,MessageEvent:tw};function rI(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var tj=J((A9t,Vle)=>{"use strict";var{tokenChars:rw}=q_();function J0(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function n2t(e){let t=Object.create(null),r=Object.create(null),s=!1,a=!1,n=!1,l,f,m=-1,y=-1,v=-1,b=0;for(;b<e.length;b++)if(y=e.charCodeAt(b),l===void 0)if(v===-1&&rw[y]===1)m===-1&&(m=b);else if(b!==0&&(y===32||y===9))v===-1&&m!==-1&&(v=b);else if(y===59||y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b);let k=e.slice(m,v);y===44?(J0(t,k,r),r=Object.create(null)):l=k,m=v=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);else if(f===void 0)if(v===-1&&rw[y]===1)m===-1&&(m=b);else if(y===32||y===9)v===-1&&m!==-1&&(v=b);else if(y===59||y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b),J0(r,e.slice(m,v),!0),y===44&&(J0(t,l,r),r=Object.create(null),l=void 0),m=v=-1}else if(y===61&&m!==-1&&v===-1)f=e.slice(m,b),m=v=-1;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(a){if(rw[y]!==1)throw new SyntaxError(`Unexpected character at index ${b}`);m===-1?m=b:s||(s=!0),a=!1}else if(n)if(rw[y]===1)m===-1&&(m=b);else if(y===34&&m!==-1)n=!1,v=b;else if(y===92)a=!0;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(y===34&&e.charCodeAt(b-1)===61)n=!0;else if(v===-1&&rw[y]===1)m===-1&&(m=b);else if(m!==-1&&(y===32||y===9))v===-1&&(v=b);else if(y===59||y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b);let k=e.slice(m,v);s&&(k=k.replace(/\\/g,""),s=!1),J0(r,f,k),y===44&&(J0(t,l,r),r=Object.create(null),l=void 0),f=void 0,m=v=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);if(m===-1||n||y===32||y===9)throw new SyntaxError("Unexpected end of input");v===-1&&(v=b);let P=e.slice(m,v);return l===void 0?J0(t,P,r):(f===void 0?J0(r,P,!0):s?J0(r,f,P.replace(/\\/g,"")):J0(r,f,P),J0(t,l,r)),t}function i2t(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(s=>[t].concat(Object.keys(s).map(a=>{let n=s[a];return Array.isArray(n)||(n=[n]),n.map(l=>l===!0?a:`${a}=${l}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Vle.exports={format:i2t,parse:n2t}});var oI=J((I9t,tpe)=>{"use strict";var s2t=require("events"),o2t=require("https"),a2t=require("http"),zle=require("net"),u2t=require("tls"),{randomBytes:c2t,createHash:l2t}=require("crypto"),{Duplex:D9t,Readable:k9t}=require("stream"),{URL:rj}=require("url"),pv=ZT(),p2t=J9(),f2t=Z9(),{isBlob:d2t}=q_(),{BINARY_TYPES:Hle,EMPTY_BUFFER:nI,GUID:h2t,kForOnEventAttribute:nj,kListener:m2t,kStatusCode:y2t,kWebSocket:Uu,NOOP:Gle}=Ry(),{EventTarget:{addEventListener:g2t,removeEventListener:v2t}}=$le(),{format:x2t,parse:_2t}=tj(),{toBuffer:S2t}=XT(),b2t=30*1e3,Kle=Symbol("kAborted"),ij=[8,13],My=["CONNECTING","OPEN","CLOSING","CLOSED"],E2t=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Uo=class e extends s2t{constructor(t,r,s){super(),this._binaryType=Hle[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=nI,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),Yle(this,t,r,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Hle.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,s){let a=new p2t({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),n=new f2t(t,this._extensions,s.generateMask);this._receiver=a,this._sender=n,this._socket=t,a[Uu]=this,n[Uu]=this,t[Uu]=this,a.on("conclude",P2t),a.on("drain",C2t),a.on("error",A2t),a.on("message",D2t),a.on("ping",k2t),a.on("pong",I2t),n.onerror=O2t,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Qle),t.on("data",sI),t.on("end",Zle),t.on("error",epe),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[pv.extensionName]&&this._extensions[pv.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){_f(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Xle(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,s){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){sj(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||nI,r,s)}pong(t,r,s){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){sj(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||nI,r,s)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,s){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){sj(this,t,s);return}let a={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[pv.extensionName]||(a.compress=!1),this._sender.send(t||nI,a,s)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){_f(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Uo,"CONNECTING",{enumerable:!0,value:My.indexOf("CONNECTING")});Object.defineProperty(Uo.prototype,"CONNECTING",{enumerable:!0,value:My.indexOf("CONNECTING")});Object.defineProperty(Uo,"OPEN",{enumerable:!0,value:My.indexOf("OPEN")});Object.defineProperty(Uo.prototype,"OPEN",{enumerable:!0,value:My.indexOf("OPEN")});Object.defineProperty(Uo,"CLOSING",{enumerable:!0,value:My.indexOf("CLOSING")});Object.defineProperty(Uo.prototype,"CLOSING",{enumerable:!0,value:My.indexOf("CLOSING")});Object.defineProperty(Uo,"CLOSED",{enumerable:!0,value:My.indexOf("CLOSED")});Object.defineProperty(Uo.prototype,"CLOSED",{enumerable:!0,value:My.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Uo.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Uo.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[nj])return t[m2t];return null},set(t){for(let r of this.listeners(e))if(r[nj]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[nj]:!0})}})});Uo.prototype.addEventListener=g2t;Uo.prototype.removeEventListener=v2t;tpe.exports=Uo;function Yle(e,t,r,s){let a={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:ij[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=a.autoPong,!ij.includes(a.protocolVersion))throw new RangeError(`Unsupported protocol version: ${a.protocolVersion} (supported versions: ${ij.join(", ")})`);let n;if(t instanceof rj)n=t;else try{n=new rj(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),e._url=n.href;let l=n.protocol==="wss:",f=n.protocol==="ws+unix:",m;if(n.protocol!=="ws:"&&!l&&!f?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:f&&!n.pathname?m="The URL's pathname is empty":n.hash&&(m="The URL contains a fragment identifier"),m){let B=new SyntaxError(m);if(e._redirects===0)throw B;iI(e,B);return}let y=l?443:80,v=c2t(16).toString("base64"),b=l?o2t.request:a2t.request,P=new Set,k;if(a.createConnection=a.createConnection||(l?w2t:T2t),a.defaultPort=a.defaultPort||y,a.port=n.port||y,a.host=n.hostname.startsWith("[")?n.hostname.slice(1,-1):n.hostname,a.headers={...a.headers,"Sec-WebSocket-Version":a.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"},a.path=n.pathname+n.search,a.timeout=a.handshakeTimeout,a.perMessageDeflate&&(k=new pv(a.perMessageDeflate!==!0?a.perMessageDeflate:{},!1,a.maxPayload),a.headers["Sec-WebSocket-Extensions"]=x2t({[pv.extensionName]:k.offer()})),r.length){for(let B of r){if(typeof B!="string"||!E2t.test(B)||P.has(B))throw new SyntaxError("An invalid or duplicated subprotocol was specified");P.add(B)}a.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(a.origin&&(a.protocolVersion<13?a.headers["Sec-WebSocket-Origin"]=a.origin:a.headers.Origin=a.origin),(n.username||n.password)&&(a.auth=`${n.username}:${n.password}`),f){let B=a.path.split(":");a.socketPath=B[0],a.path=B[1]}let g;if(a.followRedirects){if(e._redirects===0){e._originalIpc=f,e._originalSecure=l,e._originalHostOrSocketPath=f?a.socketPath:n.host;let B=s&&s.headers;if(s={...s,headers:{}},B)for(let[L,M]of Object.entries(B))s.headers[L.toLowerCase()]=M}else if(e.listenerCount("redirect")===0){let B=f?e._originalIpc?a.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:n.host===e._originalHostOrSocketPath;(!B||e._originalSecure&&!l)&&(delete a.headers.authorization,delete a.headers.cookie,B||delete a.headers.host,a.auth=void 0)}a.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(a.auth).toString("base64")),g=e._req=b(a),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=b(a);a.timeout&&g.on("timeout",()=>{_f(e,g,"Opening handshake has timed out")}),g.on("error",B=>{g===null||g[Kle]||(g=e._req=null,iI(e,B))}),g.on("response",B=>{let L=B.headers.location,M=B.statusCode;if(L&&a.followRedirects&&M>=300&&M<400){if(++e._redirects>a.maxRedirects){_f(e,g,"Maximum redirects exceeded");return}g.abort();let G;try{G=new rj(L,t)}catch{let re=new SyntaxError(`Invalid URL: ${L}`);iI(e,re);return}Yle(e,G,r,s)}else e.emit("unexpected-response",g,B)||_f(e,g,`Unexpected server response: ${B.statusCode}`)}),g.on("upgrade",(B,L,M)=>{if(e.emit("upgrade",B),e.readyState!==Uo.CONNECTING)return;g=e._req=null;let G=B.headers.upgrade;if(G===void 0||G.toLowerCase()!=="websocket"){_f(e,L,"Invalid Upgrade header");return}let oe=l2t("sha1").update(v+h2t).digest("base64");if(B.headers["sec-websocket-accept"]!==oe){_f(e,L,"Invalid Sec-WebSocket-Accept header");return}let re=B.headers["sec-websocket-protocol"],me;if(re!==void 0?P.size?P.has(re)||(me="Server sent an invalid subprotocol"):me="Server sent a subprotocol but none was requested":P.size&&(me="Server sent no subprotocol"),me){_f(e,L,me);return}re&&(e._protocol=re);let Ce=B.headers["sec-websocket-extensions"];if(Ce!==void 0){if(!k){_f(e,L,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Me;try{Me=_2t(Ce)}catch{_f(e,L,"Invalid Sec-WebSocket-Extensions header");return}let Ve=Object.keys(Me);if(Ve.length!==1||Ve[0]!==pv.extensionName){_f(e,L,"Server indicated an extension that was not requested");return}try{k.accept(Me[pv.extensionName])}catch{_f(e,L,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[pv.extensionName]=k}e.setSocket(L,M,{allowSynchronousEvents:a.allowSynchronousEvents,generateMask:a.generateMask,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation})}),a.finishRequest?a.finishRequest(g,e):g.end()}function iI(e,t){e._readyState=Uo.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function T2t(e){return e.path=e.socketPath,zle.connect(e)}function w2t(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=zle.isIP(e.host)?"":e.host),u2t.connect(e)}function _f(e,t,r){e._readyState=Uo.CLOSING;let s=new Error(r);Error.captureStackTrace(s,_f),t.setHeader?(t[Kle]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(iI,e,s)):(t.destroy(s),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function sj(e,t,r){if(t){let s=d2t(t)?t.size:S2t(t).length;e._socket?e._sender._bufferedBytes+=s:e._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${e.readyState} (${My[e.readyState]})`);process.nextTick(r,s)}}function P2t(e,t){let r=this[Uu];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Uu]!==void 0&&(r._socket.removeListener("data",sI),process.nextTick(Jle,r._socket),e===1005?r.close():r.close(e,t))}function C2t(){let e=this[Uu];e.isPaused||e._socket.resume()}function A2t(e){let t=this[Uu];t._socket[Uu]!==void 0&&(t._socket.removeListener("data",sI),process.nextTick(Jle,t._socket),t.close(e[y2t])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function Wle(){this[Uu].emitClose()}function D2t(e,t){this[Uu].emit("message",e,t)}function k2t(e){let t=this[Uu];t._autoPong&&t.pong(e,!this._isServer,Gle),t.emit("ping",e)}function I2t(e){this[Uu].emit("pong",e)}function Jle(e){e.resume()}function O2t(e){let t=this[Uu];t.readyState!==Uo.CLOSED&&(t.readyState===Uo.OPEN&&(t._readyState=Uo.CLOSING,Xle(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function Xle(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),b2t)}function Qle(){let e=this[Uu];this.removeListener("close",Qle),this.removeListener("data",sI),this.removeListener("end",Zle),e._readyState=Uo.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[Uu]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Wle),e._receiver.on("finish",Wle))}function sI(e){this[Uu]._receiver.write(e)||this.pause()}function Zle(){let e=this[Uu];e._readyState=Uo.CLOSING,e._receiver.end(),this.end()}function epe(){let e=this[Uu];this.removeListener("error",epe),this.on("error",Gle),e&&(e._readyState=Uo.CLOSING,this.destroy())}});var spe=J((N9t,ipe)=>{"use strict";var O9t=oI(),{Duplex:N2t}=require("stream");function rpe(e){e.emit("close")}function R2t(){!this.destroyed&&this._writableState.finished&&this.destroy()}function npe(e){this.removeListener("error",npe),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function F2t(e,t){let r=!0,s=new N2t({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(n,l){let f=!l&&s._readableState.objectMode?n.toString():n;s.push(f)||e.pause()}),e.once("error",function(n){s.destroyed||(r=!1,s.destroy(n))}),e.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(a,n){if(e.readyState===e.CLOSED){n(a),process.nextTick(rpe,s);return}let l=!1;e.once("error",function(m){l=!0,n(m)}),e.once("close",function(){l||n(a),process.nextTick(rpe,s)}),r&&e.terminate()},s._final=function(a){if(e.readyState===e.CONNECTING){e.once("open",function(){s._final(a)});return}e._socket!==null&&(e._socket._writableState.finished?(a(),s._readableState.endEmitted&&s.destroy()):(e._socket.once("finish",function(){a()}),e.close()))},s._read=function(){e.isPaused&&e.resume()},s._write=function(a,n,l){if(e.readyState===e.CONNECTING){e.once("open",function(){s._write(a,n,l)});return}e.send(a,l)},s.on("end",R2t),s.on("error",npe),s}ipe.exports=F2t});var ape=J((R9t,ope)=>{"use strict";var{tokenChars:L2t}=q_();function M2t(e){let t=new Set,r=-1,s=-1,a=0;for(a;a<e.length;a++){let l=e.charCodeAt(a);if(s===-1&&L2t[l]===1)r===-1&&(r=a);else if(a!==0&&(l===32||l===9))s===-1&&r!==-1&&(s=a);else if(l===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${a}`);s===-1&&(s=a);let f=e.slice(r,s);if(t.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);t.add(f),r=s=-1}else throw new SyntaxError(`Unexpected character at index ${a}`)}if(r===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let n=e.slice(r,a);if(t.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return t.add(n),t}ope.exports={parse:M2t}});var hpe=J((L9t,dpe)=>{"use strict";var B2t=require("events"),aI=require("http"),{Duplex:F9t}=require("stream"),{createHash:j2t}=require("crypto"),upe=tj(),hx=ZT(),q2t=ape(),U2t=oI(),{GUID:$2t,kWebSocket:V2t}=Ry(),H2t=/^[+/0-9A-Za-z]{22}==$/,cpe=0,lpe=1,fpe=2,oj=class extends B2t{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:U2t,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=aI.createServer((s,a)=>{let n=aI.STATUS_CODES[426];a.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),a.end(n)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=W2t(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(a,n,l)=>{this.handleUpgrade(a,n,l,s)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=cpe}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===fpe){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(nw,this);return}if(t&&this.once("close",t),this._state!==lpe)if(this._state=lpe,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(nw,this):process.nextTick(nw,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{nw(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,s,a){r.on("error",ppe);let n=t.headers["sec-websocket-key"],l=t.headers.upgrade,f=+t.headers["sec-websocket-version"];if(t.method!=="GET"){mx(this,t,r,405,"Invalid HTTP method");return}if(l===void 0||l.toLowerCase()!=="websocket"){mx(this,t,r,400,"Invalid Upgrade header");return}if(n===void 0||!H2t.test(n)){mx(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(f!==13&&f!==8){mx(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){iw(r,400);return}let m=t.headers["sec-websocket-protocol"],y=new Set;if(m!==void 0)try{y=q2t.parse(m)}catch{mx(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let v=t.headers["sec-websocket-extensions"],b={};if(this.options.perMessageDeflate&&v!==void 0){let P=new hx(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let k=upe.parse(v);k[hx.extensionName]&&(P.accept(k[hx.extensionName]),b[hx.extensionName]=P)}catch{mx(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let P={origin:t.headers[`${f===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(P,(k,g,B,L)=>{if(!k)return iw(r,g||401,B,L);this.completeUpgrade(b,n,y,t,r,s,a)});return}if(!this.options.verifyClient(P))return iw(r,401)}this.completeUpgrade(b,n,y,t,r,s,a)}completeUpgrade(t,r,s,a,n,l,f){if(!n.readable||!n.writable)return n.destroy();if(n[V2t])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>cpe)return iw(n,503);let y=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${j2t("sha1").update(r+$2t).digest("base64")}`],v=new this.options.WebSocket(null,void 0,this.options);if(s.size){let b=this.options.handleProtocols?this.options.handleProtocols(s,a):s.values().next().value;b&&(y.push(`Sec-WebSocket-Protocol: ${b}`),v._protocol=b)}if(t[hx.extensionName]){let b=t[hx.extensionName].params,P=upe.format({[hx.extensionName]:[b]});y.push(`Sec-WebSocket-Extensions: ${P}`),v._extensions=t}this.emit("headers",y,a),n.write(y.concat(`\r
8297
+ `;this.addLogicSnippet(n.mode,m,t.path)}}this.functionIndex=this.functionIndex+1}getMountPath(t){let r=t.replace(/\/([^/]+)$/g,"");return r||"/"}recordFunc(t,r){try{let s=t.path.replace(this.FUNCTIONPATH.replace(/\.\//,""),"").replace(/\/\[\[([^/]+)\]\]$/,"/:$1*").replace(/\/\[([^/]+)\]/g,"/:$1").replace(/[^\w/:*\-]/g,"");this.functionListKeys.push(s);let a=fc,n=[];if(r==="onRequest"){for(let f of a)t.text.toLowerCase().includes("onrequest"+f.toLowerCase())&&n.push(f);n.length||(n=[...fc])}else n=[r.replace("onRequest","").toUpperCase()];let l=this.functionList.findIndex(f=>f.routePath===s);if(l>=0){let f=this.functionList[l],m=Array.isArray(f.method)?f.method:[f.method],y=Array.isArray(n)?n:[n],v=[...new Set([...m,...y])],b=[...new Set([...f.module,`${t.filePath}:${r}`])];this.functionList[l]={...f,method:v,module:b}}else{let f={routePath:s,mountPath:this.getMountPath(s),method:n,module:[`${t.filePath}:${r}`]};this.functionList.push(f)}}catch(s){console.log(s.message)}}addLogicSnippet(t,r,s){let a=this.calculateSpecificity(s);this.logicSegments.push({priority:t,specificity:a,index:this.logicSegmentsIndex++,code:r})}bundleAndGetString(t){let r={};for(let l in this.env)/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(l)&&typeof this.env[l]=="string"&&(r[`env.${l}`]=JSON.stringify(this.env[l]));let s=Pxt.buildSync({entryPoints:[t],bundle:!0,write:!1,outfile:"./.tef_dist/assets.js",define:r}),{outputFiles:a}=s,n;for(let l of a)if(l.path.includes(".css"))this.cssText+=l.text;else{let f=/\.(js|ts|cjs|tsx|jsx)$/,m=l.text;t=t.replace(/\\/g,"/");let y=t.replace(/\/index\.(js|ts|cjs|tsx|jsx)/,".js").replace(f,"").replace(this.FUNCTIONPATH.replace(/\.\//,""),"");n={filePath:t.replace(this.FUNCTIONPATH,""),path:y===""?"/":y,text:`${m}responseFoo`}}return n}}});var Ry=J((x9t,dle)=>{"use strict";var ple=["nodebuffer","arraybuffer","fragments"],fle=typeof Blob<"u";fle&&ple.push("blob");dle.exports={BINARY_TYPES:ple,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:fle,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var XT=J((_9t,Yk)=>{"use strict";var{EMPTY_BUFFER:Axt}=Ry(),q9=Buffer[Symbol.species];function Dxt(e,t){if(e.length===0)return Axt;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),s=0;for(let a=0;a<e.length;a++){let n=e[a];r.set(n,s),s+=n.length}return s<t?new q9(r.buffer,r.byteOffset,s):r}function hle(e,t,r,s,a){for(let n=0;n<a;n++)r[s+n]=e[n]^t[n&3]}function mle(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function kxt(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function U9(e){if(U9.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new q9(e):ArrayBuffer.isView(e)?t=new q9(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),U9.readOnly=!1),t}Yk.exports={concat:Dxt,mask:hle,toArrayBuffer:kxt,toBuffer:U9,unmask:mle};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=require("bufferutil");Yk.exports.mask=function(t,r,s,a,n){n<48?hle(t,r,s,a,n):e.mask(t,r,s,a,n)},Yk.exports.unmask=function(t,r){t.length<32?mle(t,r):e.unmask(t,r)}}catch{}});var vle=J((S9t,gle)=>{"use strict";var yle=Symbol("kDone"),$9=Symbol("kRun"),V9=class{constructor(t){this[yle]=()=>{this.pending--,this[$9]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[$9]()}[$9](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[yle])}}};gle.exports=V9});var ZT=J((b9t,ble)=>{"use strict";var QT=require("zlib"),xle=XT(),Ixt=vle(),{kStatusCode:_le}=Ry(),Oxt=Buffer[Symbol.species],Nxt=Buffer.from([0,0,255,255]),Xk=Symbol("permessage-deflate"),Fy=Symbol("total-length"),B_=Symbol("callback"),lv=Symbol("buffers"),j_=Symbol("error"),Jk,H9=class{constructor(t,r,s){if(this._maxPayload=s|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Jk){let a=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Jk=new Ixt(a)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[B_];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,s=t.find(a=>!(r.serverNoContextTakeover===!1&&a.server_no_context_takeover||a.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>a.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!a.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(s=>{let a=r[s];if(a.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(a=a[0],s==="client_max_window_bits"){if(a!==!0){let n=+a;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${a}`);a=n}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${a}`)}else if(s==="server_max_window_bits"){let n=+a;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${a}`);a=n}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(a!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${a}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=a})}),t}decompress(t,r,s){Jk.add(a=>{this._decompress(t,r,(n,l)=>{a(),s(n,l)})})}compress(t,r,s){Jk.add(a=>{this._compress(t,r,(n,l)=>{a(),s(n,l)})})}_decompress(t,r,s){let a=this._isServer?"client":"server";if(!this._inflate){let n=`${a}_max_window_bits`,l=typeof this.params[n]!="number"?QT.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=QT.createInflateRaw({...this._options.zlibInflateOptions,windowBits:l}),this._inflate[Xk]=this,this._inflate[Fy]=0,this._inflate[lv]=[],this._inflate.on("error",Fxt),this._inflate.on("data",Sle)}this._inflate[B_]=s,this._inflate.write(t),r&&this._inflate.write(Nxt),this._inflate.flush(()=>{let n=this._inflate[j_];if(n){this._inflate.close(),this._inflate=null,s(n);return}let l=xle.concat(this._inflate[lv],this._inflate[Fy]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Fy]=0,this._inflate[lv]=[],r&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),s(null,l)})}_compress(t,r,s){let a=this._isServer?"server":"client";if(!this._deflate){let n=`${a}_max_window_bits`,l=typeof this.params[n]!="number"?QT.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=QT.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:l}),this._deflate[Fy]=0,this._deflate[lv]=[],this._deflate.on("data",Rxt)}this._deflate[B_]=s,this._deflate.write(t),this._deflate.flush(QT.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=xle.concat(this._deflate[lv],this._deflate[Fy]);r&&(n=new Oxt(n.buffer,n.byteOffset,n.length-4)),this._deflate[B_]=null,this._deflate[Fy]=0,this._deflate[lv]=[],r&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),s(null,n)})}};ble.exports=H9;function Rxt(e){this[lv].push(e),this[Fy]+=e.length}function Sle(e){if(this[Fy]+=e.length,this[Xk]._maxPayload<1||this[Fy]<=this[Xk]._maxPayload){this[lv].push(e);return}this[j_]=new RangeError("Max payload size exceeded"),this[j_].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[j_][_le]=1009,this.removeListener("data",Sle),this.reset()}function Fxt(e){if(this[Xk]._inflate=null,this[j_]){this[B_](this[j_]);return}e[_le]=1007,this[B_](e)}});var q_=J((E9t,Qk)=>{"use strict";var{isUtf8:Ele}=require("buffer"),{hasBlob:Lxt}=Ry(),Mxt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Bxt(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function W9(e){let t=e.length,r=0;for(;r<t;)if(!(e[r]&128))r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function jxt(e){return Lxt&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Qk.exports={isBlob:jxt,isValidStatusCode:Bxt,isValidUTF8:W9,tokenChars:Mxt};if(Ele)Qk.exports.isValidUTF8=function(e){return e.length<24?W9(e):Ele(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");Qk.exports.isValidUTF8=function(t){return t.length<32?W9(t):e(t)}}catch{}});var J9=J((T9t,kle)=>{"use strict";var{Writable:qxt}=require("stream"),Tle=ZT(),{BINARY_TYPES:Uxt,EMPTY_BUFFER:wle,kStatusCode:$xt,kWebSocket:Vxt}=Ry(),{concat:z9,toArrayBuffer:Hxt,unmask:Wxt}=XT(),{isValidStatusCode:zxt,isValidUTF8:Ple}=q_(),Zk=Buffer[Symbol.species],Ad=0,Cle=1,Ale=2,Dle=3,G9=4,K9=5,eI=6,Y9=class extends qxt{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||Uxt[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Vxt]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Ad}_write(t,r,s){if(this._opcode===8&&this._state==Ad)return s();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(s)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new Zk(s.buffer,s.byteOffset+t,s.length-t),new Zk(s.buffer,s.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let s=this._buffers[0],a=r.length-t;t>=s.length?r.set(this._buffers.shift(),a):(r.set(new Uint8Array(s.buffer,s.byteOffset,t),a),this._buffers[0]=new Zk(s.buffer,s.byteOffset+t,s.length-t)),t-=s.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Ad:this.getInfo(t);break;case Cle:this.getPayloadLength16(t);break;case Ale:this.getPayloadLength64(t);break;case Dle:this.getMask();break;case G9:this.getData(t);break;case K9:case eI:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if(r[0]&48){let a=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(a);return}let s=(r[0]&64)===64;if(s&&!this._extensions[Tle.extensionName]){let a=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(a);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let a=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(a);return}if(!this._fragmented){let a=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(a);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let a=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(a);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let a=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(a);return}if(s){let a=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(a);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let a=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(a);return}}else{let a=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(a);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let a=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(a);return}}else if(this._masked){let a=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(a);return}this._payloadLength===126?this._state=Cle:this._payloadLength===127?this._state=Ale:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let a=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(a);return}this._payloadLength=s*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=Dle:this._state=G9}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=G9}getData(t){let r=wle;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&Wxt(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=K9,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[Tle.extensionName].decompress(t,this._fin,(a,n)=>{if(a)return r(a);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let l=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(l);return}this._fragments.push(n)}this.dataMessage(r),this._state===Ad&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Ad;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let a;this._binaryType==="nodebuffer"?a=z9(s,r):this._binaryType==="arraybuffer"?a=Hxt(z9(s,r)):this._binaryType==="blob"?a=new Blob(s):a=s,this._allowSynchronousEvents?(this.emit("message",a,!0),this._state=Ad):(this._state=eI,setImmediate(()=>{this.emit("message",a,!0),this._state=Ad,this.startLoop(t)}))}else{let a=z9(s,r);if(!this._skipUTF8Validation&&!Ple(a)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(n);return}this._state===K9||this._allowSynchronousEvents?(this.emit("message",a,!1),this._state=Ad):(this._state=eI,setImmediate(()=>{this.emit("message",a,!1),this._state=Ad,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,wle),this.end();else{let s=t.readUInt16BE(0);if(!zxt(s)){let n=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(n);return}let a=new Zk(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Ple(a)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(n);return}this._loop=!1,this.emit("conclude",s,a),this.end()}this._state=Ad;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Ad):(this._state=eI,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Ad,this.startLoop(r)}))}createError(t,r,s,a,n){this._loop=!1,this._errored=!0;let l=new t(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(l,this.createError),l.code=n,l[$xt]=a,l}};kle.exports=Y9});var Z9=J((P9t,Nle)=>{"use strict";var{Duplex:w9t}=require("stream"),{randomFillSync:Gxt}=require("crypto"),Ile=ZT(),{EMPTY_BUFFER:Kxt,kWebSocket:Yxt,NOOP:Jxt}=Ry(),{isBlob:U_,isValidStatusCode:Xxt}=q_(),{mask:Ole,toBuffer:px}=XT(),Dd=Symbol("kByteLength"),Qxt=Buffer.alloc(4),tI=8*1024,fx,$_=tI,Bh=0,Zxt=1,e2t=2,X9=class e{constructor(t,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Bh,this.onerror=Jxt,this[Yxt]=void 0}static frame(t,r){let s,a=!1,n=2,l=!1;r.mask&&(s=r.maskBuffer||Qxt,r.generateMask?r.generateMask(s):($_===tI&&(fx===void 0&&(fx=Buffer.alloc(tI)),Gxt(fx,0,tI),$_=0),s[0]=fx[$_++],s[1]=fx[$_++],s[2]=fx[$_++],s[3]=fx[$_++]),l=(s[0]|s[1]|s[2]|s[3])===0,n=6);let f;typeof t=="string"?(!r.mask||l)&&r[Dd]!==void 0?f=r[Dd]:(t=Buffer.from(t),f=t.length):(f=t.length,a=r.mask&&r.readOnly&&!l);let m=f;f>=65536?(n+=8,m=127):f>125&&(n+=2,m=126);let y=Buffer.allocUnsafe(a?f+n:n);return y[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(y[0]|=64),y[1]=m,m===126?y.writeUInt16BE(f,2):m===127&&(y[2]=y[3]=0,y.writeUIntBE(f,4,6)),r.mask?(y[1]|=128,y[n-4]=s[0],y[n-3]=s[1],y[n-2]=s[2],y[n-1]=s[3],l?[y,t]:a?(Ole(t,s,y,n,f),[y]):(Ole(t,s,t,0,f),[y,t])):[y,t]}close(t,r,s,a){let n;if(t===void 0)n=Kxt;else{if(typeof t!="number"||!Xxt(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(t,0);else{let f=Buffer.byteLength(r);if(f>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+f),n.writeUInt16BE(t,0),typeof r=="string"?n.write(r,2):n.set(r,2)}}let l={[Dd]:n.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Bh?this.enqueue([this.dispatch,n,!1,l,a]):this.sendFrame(e.frame(n,l),a)}ping(t,r,s){let a,n;if(typeof t=="string"?(a=Buffer.byteLength(t),n=!1):U_(t)?(a=t.size,n=!1):(t=px(t),a=t.length,n=px.readOnly),a>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[Dd]:a,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};U_(t)?this._state!==Bh?this.enqueue([this.getBlobData,t,!1,l,s]):this.getBlobData(t,!1,l,s):this._state!==Bh?this.enqueue([this.dispatch,t,!1,l,s]):this.sendFrame(e.frame(t,l),s)}pong(t,r,s){let a,n;if(typeof t=="string"?(a=Buffer.byteLength(t),n=!1):U_(t)?(a=t.size,n=!1):(t=px(t),a=t.length,n=px.readOnly),a>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[Dd]:a,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};U_(t)?this._state!==Bh?this.enqueue([this.getBlobData,t,!1,l,s]):this.getBlobData(t,!1,l,s):this._state!==Bh?this.enqueue([this.dispatch,t,!1,l,s]):this.sendFrame(e.frame(t,l),s)}send(t,r,s){let a=this._extensions[Ile.extensionName],n=r.binary?2:1,l=r.compress,f,m;typeof t=="string"?(f=Buffer.byteLength(t),m=!1):U_(t)?(f=t.size,m=!1):(t=px(t),f=t.length,m=px.readOnly),this._firstFragment?(this._firstFragment=!1,l&&a&&a.params[a._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(l=f>=a._threshold),this._compress=l):(l=!1,n=0),r.fin&&(this._firstFragment=!0);let y={[Dd]:f,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:m,rsv1:l};U_(t)?this._state!==Bh?this.enqueue([this.getBlobData,t,this._compress,y,s]):this.getBlobData(t,this._compress,y,s):this._state!==Bh?this.enqueue([this.dispatch,t,this._compress,y,s]):this.dispatch(t,this._compress,y,s)}getBlobData(t,r,s,a){this._bufferedBytes+=s[Dd],this._state=e2t,t.arrayBuffer().then(n=>{if(this._socket.destroyed){let f=new Error("The socket was closed while the blob was being read");process.nextTick(Q9,this,f,a);return}this._bufferedBytes-=s[Dd];let l=px(n);r?this.dispatch(l,r,s,a):(this._state=Bh,this.sendFrame(e.frame(l,s),a),this.dequeue())}).catch(n=>{process.nextTick(t2t,this,n,a)})}dispatch(t,r,s,a){if(!r){this.sendFrame(e.frame(t,s),a);return}let n=this._extensions[Ile.extensionName];this._bufferedBytes+=s[Dd],this._state=Zxt,n.compress(t,s.fin,(l,f)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Q9(this,m,a);return}this._bufferedBytes-=s[Dd],this._state=Bh,s.readOnly=!1,this.sendFrame(e.frame(f,s),a),this.dequeue()})}dequeue(){for(;this._state===Bh&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Dd],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Dd],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Nle.exports=X9;function Q9(e,t,r){typeof r=="function"&&r(t);for(let s=0;s<e._queue.length;s++){let a=e._queue[s],n=a[a.length-1];typeof n=="function"&&n(t)}}function t2t(e,t,r){Q9(e,t,r),e.onerror(t)}});var $le=J((C9t,Ule)=>{"use strict";var{kForOnEventAttribute:ew,kListener:ej}=Ry(),Rle=Symbol("kCode"),Fle=Symbol("kData"),Lle=Symbol("kError"),Mle=Symbol("kMessage"),Ble=Symbol("kReason"),V_=Symbol("kTarget"),jle=Symbol("kType"),qle=Symbol("kWasClean"),Ly=class{constructor(t){this[V_]=null,this[jle]=t}get target(){return this[V_]}get type(){return this[jle]}};Object.defineProperty(Ly.prototype,"target",{enumerable:!0});Object.defineProperty(Ly.prototype,"type",{enumerable:!0});var dx=class extends Ly{constructor(t,r={}){super(t),this[Rle]=r.code===void 0?0:r.code,this[Ble]=r.reason===void 0?"":r.reason,this[qle]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Rle]}get reason(){return this[Ble]}get wasClean(){return this[qle]}};Object.defineProperty(dx.prototype,"code",{enumerable:!0});Object.defineProperty(dx.prototype,"reason",{enumerable:!0});Object.defineProperty(dx.prototype,"wasClean",{enumerable:!0});var H_=class extends Ly{constructor(t,r={}){super(t),this[Lle]=r.error===void 0?null:r.error,this[Mle]=r.message===void 0?"":r.message}get error(){return this[Lle]}get message(){return this[Mle]}};Object.defineProperty(H_.prototype,"error",{enumerable:!0});Object.defineProperty(H_.prototype,"message",{enumerable:!0});var tw=class extends Ly{constructor(t,r={}){super(t),this[Fle]=r.data===void 0?null:r.data}get data(){return this[Fle]}};Object.defineProperty(tw.prototype,"data",{enumerable:!0});var r2t={addEventListener(e,t,r={}){for(let a of this.listeners(e))if(!r[ew]&&a[ej]===t&&!a[ew])return;let s;if(e==="message")s=function(n,l){let f=new tw("message",{data:l?n:n.toString()});f[V_]=this,rI(t,this,f)};else if(e==="close")s=function(n,l){let f=new dx("close",{code:n,reason:l.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[V_]=this,rI(t,this,f)};else if(e==="error")s=function(n){let l=new H_("error",{error:n,message:n.message});l[V_]=this,rI(t,this,l)};else if(e==="open")s=function(){let n=new Ly("open");n[V_]=this,rI(t,this,n)};else return;s[ew]=!!r[ew],s[ej]=t,r.once?this.once(e,s):this.on(e,s)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[ej]===t&&!r[ew]){this.removeListener(e,r);break}}};Ule.exports={CloseEvent:dx,ErrorEvent:H_,Event:Ly,EventTarget:r2t,MessageEvent:tw};function rI(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var tj=J((A9t,Vle)=>{"use strict";var{tokenChars:rw}=q_();function J0(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function n2t(e){let t=Object.create(null),r=Object.create(null),s=!1,a=!1,n=!1,l,f,m=-1,y=-1,v=-1,b=0;for(;b<e.length;b++)if(y=e.charCodeAt(b),l===void 0)if(v===-1&&rw[y]===1)m===-1&&(m=b);else if(b!==0&&(y===32||y===9))v===-1&&m!==-1&&(v=b);else if(y===59||y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b);let k=e.slice(m,v);y===44?(J0(t,k,r),r=Object.create(null)):l=k,m=v=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);else if(f===void 0)if(v===-1&&rw[y]===1)m===-1&&(m=b);else if(y===32||y===9)v===-1&&m!==-1&&(v=b);else if(y===59||y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b),J0(r,e.slice(m,v),!0),y===44&&(J0(t,l,r),r=Object.create(null),l=void 0),m=v=-1}else if(y===61&&m!==-1&&v===-1)f=e.slice(m,b),m=v=-1;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(a){if(rw[y]!==1)throw new SyntaxError(`Unexpected character at index ${b}`);m===-1?m=b:s||(s=!0),a=!1}else if(n)if(rw[y]===1)m===-1&&(m=b);else if(y===34&&m!==-1)n=!1,v=b;else if(y===92)a=!0;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(y===34&&e.charCodeAt(b-1)===61)n=!0;else if(v===-1&&rw[y]===1)m===-1&&(m=b);else if(m!==-1&&(y===32||y===9))v===-1&&(v=b);else if(y===59||y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b);let k=e.slice(m,v);s&&(k=k.replace(/\\/g,""),s=!1),J0(r,f,k),y===44&&(J0(t,l,r),r=Object.create(null),l=void 0),f=void 0,m=v=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);if(m===-1||n||y===32||y===9)throw new SyntaxError("Unexpected end of input");v===-1&&(v=b);let P=e.slice(m,v);return l===void 0?J0(t,P,r):(f===void 0?J0(r,P,!0):s?J0(r,f,P.replace(/\\/g,"")):J0(r,f,P),J0(t,l,r)),t}function i2t(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(s=>[t].concat(Object.keys(s).map(a=>{let n=s[a];return Array.isArray(n)||(n=[n]),n.map(l=>l===!0?a:`${a}=${l}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Vle.exports={format:i2t,parse:n2t}});var oI=J((I9t,tpe)=>{"use strict";var s2t=require("events"),o2t=require("https"),a2t=require("http"),zle=require("net"),u2t=require("tls"),{randomBytes:c2t,createHash:l2t}=require("crypto"),{Duplex:D9t,Readable:k9t}=require("stream"),{URL:rj}=require("url"),pv=ZT(),p2t=J9(),f2t=Z9(),{isBlob:d2t}=q_(),{BINARY_TYPES:Hle,EMPTY_BUFFER:nI,GUID:h2t,kForOnEventAttribute:nj,kListener:m2t,kStatusCode:y2t,kWebSocket:Uu,NOOP:Gle}=Ry(),{EventTarget:{addEventListener:g2t,removeEventListener:v2t}}=$le(),{format:x2t,parse:_2t}=tj(),{toBuffer:S2t}=XT(),b2t=30*1e3,Kle=Symbol("kAborted"),ij=[8,13],My=["CONNECTING","OPEN","CLOSING","CLOSED"],E2t=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Uo=class e extends s2t{constructor(t,r,s){super(),this._binaryType=Hle[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=nI,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),Yle(this,t,r,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Hle.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,s){let a=new p2t({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),n=new f2t(t,this._extensions,s.generateMask);this._receiver=a,this._sender=n,this._socket=t,a[Uu]=this,n[Uu]=this,t[Uu]=this,a.on("conclude",P2t),a.on("drain",C2t),a.on("error",A2t),a.on("message",D2t),a.on("ping",k2t),a.on("pong",I2t),n.onerror=O2t,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Qle),t.on("data",sI),t.on("end",Zle),t.on("error",epe),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[pv.extensionName]&&this._extensions[pv.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){_f(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Xle(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,s){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){sj(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||nI,r,s)}pong(t,r,s){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){sj(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||nI,r,s)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,s){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){sj(this,t,s);return}let a={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[pv.extensionName]||(a.compress=!1),this._sender.send(t||nI,a,s)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){_f(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Uo,"CONNECTING",{enumerable:!0,value:My.indexOf("CONNECTING")});Object.defineProperty(Uo.prototype,"CONNECTING",{enumerable:!0,value:My.indexOf("CONNECTING")});Object.defineProperty(Uo,"OPEN",{enumerable:!0,value:My.indexOf("OPEN")});Object.defineProperty(Uo.prototype,"OPEN",{enumerable:!0,value:My.indexOf("OPEN")});Object.defineProperty(Uo,"CLOSING",{enumerable:!0,value:My.indexOf("CLOSING")});Object.defineProperty(Uo.prototype,"CLOSING",{enumerable:!0,value:My.indexOf("CLOSING")});Object.defineProperty(Uo,"CLOSED",{enumerable:!0,value:My.indexOf("CLOSED")});Object.defineProperty(Uo.prototype,"CLOSED",{enumerable:!0,value:My.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Uo.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Uo.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[nj])return t[m2t];return null},set(t){for(let r of this.listeners(e))if(r[nj]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[nj]:!0})}})});Uo.prototype.addEventListener=g2t;Uo.prototype.removeEventListener=v2t;tpe.exports=Uo;function Yle(e,t,r,s){let a={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:ij[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=a.autoPong,!ij.includes(a.protocolVersion))throw new RangeError(`Unsupported protocol version: ${a.protocolVersion} (supported versions: ${ij.join(", ")})`);let n;if(t instanceof rj)n=t;else try{n=new rj(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),e._url=n.href;let l=n.protocol==="wss:",f=n.protocol==="ws+unix:",m;if(n.protocol!=="ws:"&&!l&&!f?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:f&&!n.pathname?m="The URL's pathname is empty":n.hash&&(m="The URL contains a fragment identifier"),m){let B=new SyntaxError(m);if(e._redirects===0)throw B;iI(e,B);return}let y=l?443:80,v=c2t(16).toString("base64"),b=l?o2t.request:a2t.request,P=new Set,k;if(a.createConnection=a.createConnection||(l?w2t:T2t),a.defaultPort=a.defaultPort||y,a.port=n.port||y,a.host=n.hostname.startsWith("[")?n.hostname.slice(1,-1):n.hostname,a.headers={...a.headers,"Sec-WebSocket-Version":a.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"},a.path=n.pathname+n.search,a.timeout=a.handshakeTimeout,a.perMessageDeflate&&(k=new pv(a.perMessageDeflate!==!0?a.perMessageDeflate:{},!1,a.maxPayload),a.headers["Sec-WebSocket-Extensions"]=x2t({[pv.extensionName]:k.offer()})),r.length){for(let B of r){if(typeof B!="string"||!E2t.test(B)||P.has(B))throw new SyntaxError("An invalid or duplicated subprotocol was specified");P.add(B)}a.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(a.origin&&(a.protocolVersion<13?a.headers["Sec-WebSocket-Origin"]=a.origin:a.headers.Origin=a.origin),(n.username||n.password)&&(a.auth=`${n.username}:${n.password}`),f){let B=a.path.split(":");a.socketPath=B[0],a.path=B[1]}let g;if(a.followRedirects){if(e._redirects===0){e._originalIpc=f,e._originalSecure=l,e._originalHostOrSocketPath=f?a.socketPath:n.host;let B=s&&s.headers;if(s={...s,headers:{}},B)for(let[L,M]of Object.entries(B))s.headers[L.toLowerCase()]=M}else if(e.listenerCount("redirect")===0){let B=f?e._originalIpc?a.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:n.host===e._originalHostOrSocketPath;(!B||e._originalSecure&&!l)&&(delete a.headers.authorization,delete a.headers.cookie,B||delete a.headers.host,a.auth=void 0)}a.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(a.auth).toString("base64")),g=e._req=b(a),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=b(a);a.timeout&&g.on("timeout",()=>{_f(e,g,"Opening handshake has timed out")}),g.on("error",B=>{g===null||g[Kle]||(g=e._req=null,iI(e,B))}),g.on("response",B=>{let L=B.headers.location,M=B.statusCode;if(L&&a.followRedirects&&M>=300&&M<400){if(++e._redirects>a.maxRedirects){_f(e,g,"Maximum redirects exceeded");return}g.abort();let G;try{G=new rj(L,t)}catch{let re=new SyntaxError(`Invalid URL: ${L}`);iI(e,re);return}Yle(e,G,r,s)}else e.emit("unexpected-response",g,B)||_f(e,g,`Unexpected server response: ${B.statusCode}`)}),g.on("upgrade",(B,L,M)=>{if(e.emit("upgrade",B),e.readyState!==Uo.CONNECTING)return;g=e._req=null;let G=B.headers.upgrade;if(G===void 0||G.toLowerCase()!=="websocket"){_f(e,L,"Invalid Upgrade header");return}let oe=l2t("sha1").update(v+h2t).digest("base64");if(B.headers["sec-websocket-accept"]!==oe){_f(e,L,"Invalid Sec-WebSocket-Accept header");return}let re=B.headers["sec-websocket-protocol"],me;if(re!==void 0?P.size?P.has(re)||(me="Server sent an invalid subprotocol"):me="Server sent a subprotocol but none was requested":P.size&&(me="Server sent no subprotocol"),me){_f(e,L,me);return}re&&(e._protocol=re);let Ce=B.headers["sec-websocket-extensions"];if(Ce!==void 0){if(!k){_f(e,L,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Me;try{Me=_2t(Ce)}catch{_f(e,L,"Invalid Sec-WebSocket-Extensions header");return}let Ve=Object.keys(Me);if(Ve.length!==1||Ve[0]!==pv.extensionName){_f(e,L,"Server indicated an extension that was not requested");return}try{k.accept(Me[pv.extensionName])}catch{_f(e,L,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[pv.extensionName]=k}e.setSocket(L,M,{allowSynchronousEvents:a.allowSynchronousEvents,generateMask:a.generateMask,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation})}),a.finishRequest?a.finishRequest(g,e):g.end()}function iI(e,t){e._readyState=Uo.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function T2t(e){return e.path=e.socketPath,zle.connect(e)}function w2t(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=zle.isIP(e.host)?"":e.host),u2t.connect(e)}function _f(e,t,r){e._readyState=Uo.CLOSING;let s=new Error(r);Error.captureStackTrace(s,_f),t.setHeader?(t[Kle]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(iI,e,s)):(t.destroy(s),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function sj(e,t,r){if(t){let s=d2t(t)?t.size:S2t(t).length;e._socket?e._sender._bufferedBytes+=s:e._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${e.readyState} (${My[e.readyState]})`);process.nextTick(r,s)}}function P2t(e,t){let r=this[Uu];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Uu]!==void 0&&(r._socket.removeListener("data",sI),process.nextTick(Jle,r._socket),e===1005?r.close():r.close(e,t))}function C2t(){let e=this[Uu];e.isPaused||e._socket.resume()}function A2t(e){let t=this[Uu];t._socket[Uu]!==void 0&&(t._socket.removeListener("data",sI),process.nextTick(Jle,t._socket),t.close(e[y2t])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function Wle(){this[Uu].emitClose()}function D2t(e,t){this[Uu].emit("message",e,t)}function k2t(e){let t=this[Uu];t._autoPong&&t.pong(e,!this._isServer,Gle),t.emit("ping",e)}function I2t(e){this[Uu].emit("pong",e)}function Jle(e){e.resume()}function O2t(e){let t=this[Uu];t.readyState!==Uo.CLOSED&&(t.readyState===Uo.OPEN&&(t._readyState=Uo.CLOSING,Xle(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function Xle(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),b2t)}function Qle(){let e=this[Uu];this.removeListener("close",Qle),this.removeListener("data",sI),this.removeListener("end",Zle),e._readyState=Uo.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[Uu]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Wle),e._receiver.on("finish",Wle))}function sI(e){this[Uu]._receiver.write(e)||this.pause()}function Zle(){let e=this[Uu];e._readyState=Uo.CLOSING,e._receiver.end(),this.end()}function epe(){let e=this[Uu];this.removeListener("error",epe),this.on("error",Gle),e&&(e._readyState=Uo.CLOSING,this.destroy())}});var spe=J((N9t,ipe)=>{"use strict";var O9t=oI(),{Duplex:N2t}=require("stream");function rpe(e){e.emit("close")}function R2t(){!this.destroyed&&this._writableState.finished&&this.destroy()}function npe(e){this.removeListener("error",npe),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function F2t(e,t){let r=!0,s=new N2t({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(n,l){let f=!l&&s._readableState.objectMode?n.toString():n;s.push(f)||e.pause()}),e.once("error",function(n){s.destroyed||(r=!1,s.destroy(n))}),e.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(a,n){if(e.readyState===e.CLOSED){n(a),process.nextTick(rpe,s);return}let l=!1;e.once("error",function(m){l=!0,n(m)}),e.once("close",function(){l||n(a),process.nextTick(rpe,s)}),r&&e.terminate()},s._final=function(a){if(e.readyState===e.CONNECTING){e.once("open",function(){s._final(a)});return}e._socket!==null&&(e._socket._writableState.finished?(a(),s._readableState.endEmitted&&s.destroy()):(e._socket.once("finish",function(){a()}),e.close()))},s._read=function(){e.isPaused&&e.resume()},s._write=function(a,n,l){if(e.readyState===e.CONNECTING){e.once("open",function(){s._write(a,n,l)});return}e.send(a,l)},s.on("end",R2t),s.on("error",npe),s}ipe.exports=F2t});var ape=J((R9t,ope)=>{"use strict";var{tokenChars:L2t}=q_();function M2t(e){let t=new Set,r=-1,s=-1,a=0;for(a;a<e.length;a++){let l=e.charCodeAt(a);if(s===-1&&L2t[l]===1)r===-1&&(r=a);else if(a!==0&&(l===32||l===9))s===-1&&r!==-1&&(s=a);else if(l===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${a}`);s===-1&&(s=a);let f=e.slice(r,s);if(t.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);t.add(f),r=s=-1}else throw new SyntaxError(`Unexpected character at index ${a}`)}if(r===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let n=e.slice(r,a);if(t.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return t.add(n),t}ope.exports={parse:M2t}});var hpe=J((L9t,dpe)=>{"use strict";var B2t=require("events"),aI=require("http"),{Duplex:F9t}=require("stream"),{createHash:j2t}=require("crypto"),upe=tj(),hx=ZT(),q2t=ape(),U2t=oI(),{GUID:$2t,kWebSocket:V2t}=Ry(),H2t=/^[+/0-9A-Za-z]{22}==$/,cpe=0,lpe=1,fpe=2,oj=class extends B2t{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:U2t,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=aI.createServer((s,a)=>{let n=aI.STATUS_CODES[426];a.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),a.end(n)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=W2t(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(a,n,l)=>{this.handleUpgrade(a,n,l,s)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=cpe}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===fpe){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(nw,this);return}if(t&&this.once("close",t),this._state!==lpe)if(this._state=lpe,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(nw,this):process.nextTick(nw,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{nw(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,s,a){r.on("error",ppe);let n=t.headers["sec-websocket-key"],l=t.headers.upgrade,f=+t.headers["sec-websocket-version"];if(t.method!=="GET"){mx(this,t,r,405,"Invalid HTTP method");return}if(l===void 0||l.toLowerCase()!=="websocket"){mx(this,t,r,400,"Invalid Upgrade header");return}if(n===void 0||!H2t.test(n)){mx(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(f!==13&&f!==8){mx(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){iw(r,400);return}let m=t.headers["sec-websocket-protocol"],y=new Set;if(m!==void 0)try{y=q2t.parse(m)}catch{mx(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let v=t.headers["sec-websocket-extensions"],b={};if(this.options.perMessageDeflate&&v!==void 0){let P=new hx(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let k=upe.parse(v);k[hx.extensionName]&&(P.accept(k[hx.extensionName]),b[hx.extensionName]=P)}catch{mx(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let P={origin:t.headers[`${f===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(P,(k,g,B,L)=>{if(!k)return iw(r,g||401,B,L);this.completeUpgrade(b,n,y,t,r,s,a)});return}if(!this.options.verifyClient(P))return iw(r,401)}this.completeUpgrade(b,n,y,t,r,s,a)}completeUpgrade(t,r,s,a,n,l,f){if(!n.readable||!n.writable)return n.destroy();if(n[V2t])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>cpe)return iw(n,503);let y=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${j2t("sha1").update(r+$2t).digest("base64")}`],v=new this.options.WebSocket(null,void 0,this.options);if(s.size){let b=this.options.handleProtocols?this.options.handleProtocols(s,a):s.values().next().value;b&&(y.push(`Sec-WebSocket-Protocol: ${b}`),v._protocol=b)}if(t[hx.extensionName]){let b=t[hx.extensionName].params,P=upe.format({[hx.extensionName]:[b]});y.push(`Sec-WebSocket-Extensions: ${P}`),v._extensions=t}this.emit("headers",y,a),n.write(y.concat(`\r
8294
8298
  `).join(`\r
8295
8299
  `)),n.removeListener("error",ppe),v.setSocket(n,l,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(v),v.on("close",()=>{this.clients.delete(v),this._shouldEmitClose&&!this.clients.size&&process.nextTick(nw,this)})),f(v,a)}};dpe.exports=oj;function W2t(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let s of Object.keys(t))e.removeListener(s,t[s])}}function nw(e){e._state=fpe,e.emit("close")}function ppe(){this.destroy()}function iw(e,t,r,s){r=r||aI.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${aI.STATUS_CODES[t]}\r
8296
8300
  `+Object.keys(s).map(a=>`${a}: ${s[a]}`).join(`\r
@@ -8650,8 +8654,6 @@ async function requestHandler(req, res) {
8650
8654
  }
8651
8655
  runtimeUrl = xForwardedProto + '://' + host + pathname + search;
8652
8656
  }
8653
- console.log(\`Makers request path: \${fullPath}\`);
8654
-
8655
8657
  const rawBody = await readBody(req);
8656
8658
  // \u6309 content-type \u505A\u4E00\u6B21\u534F\u8BAE\u5C42\u89E3\u7801\uFF0C\u4E1A\u52A1 handler \u76F4\u63A5\u6D88\u8D39\u7ED3\u6784\u5316 body\u3002
8657
8659
  const body = EdgeoneBodyParser.parseBodyByContentType(rawBody, String(req.headers['content-type'] || ''));
@@ -8672,6 +8674,9 @@ async function requestHandler(req, res) {
8672
8674
  body,
8673
8675
  });
8674
8676
 
8677
+ const statusCode = runtimeResponse.status || 200;
8678
+ console.log(\`Makers request path: \${fullPath} |scfRequestId=\${requestId}|statusCode=\${statusCode}|\`);
8679
+
8675
8680
  // handleResponse \u8D1F\u8D23\u628A\u6807\u51C6 Response \u5199\u56DE Node res\uFF0C\u5E76\u8865\u5145\u5E73\u53F0\u8FFD\u8E2A\u5934\u3002
8676
8681
  await handleResponse(res, runtimeResponse, {
8677
8682
  'functions-request-id': requestId,
@@ -8692,6 +8697,7 @@ const server = http.createServer((req, res) => {
8692
8697
  const requestId = String(req.headers['x-scf-request-id'] || '');
8693
8698
  // \u4EC5\u515C\u5E95\u672A\u6355\u83B7\u5F02\u5E38\uFF1B\u4E1A\u52A1\u53EF\u9884\u671F\u9519\u8BEF\u5E94\u5728 runtime \u5185\u88AB\u6620\u5C04\u4E3A\u6807\u51C6\u4E1A\u52A1\u7801\u8FD4\u56DE\u3002
8694
8699
  console.error('[agent-runtime] Request failed with status 502:', error?.message || 'Unknown error');
8700
+ console.log(\`Makers request path: \${req.url || '/'} |scfRequestId=\${requestId}|statusCode=502|\`);
8695
8701
  res.writeHead(502, {
8696
8702
  "Content-Type": "application/json",
8697
8703
  "Functions-Request-Id": requestId,
@@ -89157,17 +89163,17 @@ ${this.generateStoreInitCode()}
89157
89163
  # ============================================================
89158
89164
 
89159
89165
  def _pages_log_request(method, path, headers=None):
89160
- """\u8F93\u51FA Pages \u5E73\u53F0\u6807\u51C6\u8BF7\u6C42\u65E5\u5FD7\uFF0C\u90E8\u7F72\u73AF\u5883\u4E0B\u5305\u542B\u5B8C\u6574 URL\uFF08\u542B host\uFF09"""
89166
+ """\u8BA1\u7B97\u5E76\u8FD4\u56DE full_path \u548C scf_request_id\uFF0C\u4E0D\u6253\u5370\u65E5\u5FD7\uFF08\u65E5\u5FD7\u5408\u5E76\u5230 _pages_log_response\uFF09"""
89161
89167
  full_path = path
89168
+ scf_request_id = ''
89162
89169
  if headers:
89163
- # \u5224\u65AD\u662F\u5426\u4E3A\u7C7B dict \u63A5\u53E3\uFF08dict / Flask EnvironHeaders / Werkzeug Headers \u7B49\uFF09
89164
- # Flask \u7684 request.headers \u4E0D\u662F dict\uFF0C\u4F46\u6709 .get() \u65B9\u6CD5
89165
89170
  is_dict_like = hasattr(headers, 'get') and not isinstance(headers, list)
89166
89171
  host = headers.get('eo-pages-host', '') if is_dict_like else _get_asgi_header(headers, b'eo-pages-host')
89172
+ scf_request_id = headers.get('x-scf-request-id', '') if is_dict_like else _get_asgi_header(headers, b'x-scf-request-id')
89167
89173
  if host:
89168
89174
  proto = headers.get('x-forwarded-proto', 'https') if is_dict_like else (_get_asgi_header(headers, b'x-forwarded-proto') or 'https')
89169
89175
  full_path = f"{proto}://{host}{path}"
89170
- print(f"Makers request path: {full_path}", file=sys.stderr)
89176
+ return full_path, scf_request_id
89171
89177
 
89172
89178
  def _get_asgi_header(headers, name):
89173
89179
  """\u4ECE ASGI headers\uFF08list of (bytes, bytes) \u5143\u7EC4\uFF09\u4E2D\u83B7\u53D6\u6307\u5B9A header \u503C"""
@@ -89178,9 +89184,14 @@ def _get_asgi_header(headers, name):
89178
89184
  return v.decode('latin1') if isinstance(v, bytes) else v
89179
89185
  return ''
89180
89186
 
89181
- def _pages_log_response(method, path, status_code, elapsed_ms=None):
89182
- """\u8F93\u51FA Pages \u5E73\u53F0\u6807\u51C6\u54CD\u5E94\u65E5\u5FD7"""
89183
- print(f"Makers response status: {status_code}", file=sys.stderr)
89187
+ def _pages_log_response(method, path, status_code, elapsed_ms=None, headers=None, full_path=None, scf_request_id=None):
89188
+ """\u8F93\u51FA Pages \u5E73\u53F0\u7EDF\u4E00\u65E5\u5FD7\uFF08path + scfRequestId + statusCode \u5408\u5E76\u4E3A\u4E00\u6761\uFF09"""
89189
+ _full_path = full_path or path
89190
+ _scf_request_id = scf_request_id or ''
89191
+ if not _scf_request_id and headers:
89192
+ is_dict_like = hasattr(headers, 'get') and not isinstance(headers, list)
89193
+ _scf_request_id = headers.get('x-scf-request-id', '') if is_dict_like else _get_asgi_header(headers, b'x-scf-request-id')
89194
+ print(f"Makers request path: {_full_path} |scfRequestId={_scf_request_id}|statusCode={status_code}|", file=sys.stderr)
89184
89195
 
89185
89196
  def _pages_inject_headers(headers_dict, status_code, request_headers=None):
89186
89197
  """
@@ -89576,7 +89587,7 @@ class ASGIPathStripMiddleware:
89576
89587
  scope = dict(scope)
89577
89588
  request_path = scope.get('path', '/')
89578
89589
  request_method = scope.get('method', 'GET')
89579
- _pages_log_request(request_method, request_path, scope.get('headers'))
89590
+ _full_path, _scf_request_id = _pages_log_request(request_method, request_path, scope.get('headers'))
89580
89591
  start_time = time.time()
89581
89592
 
89582
89593
  # \u4F7F\u7528\u9759\u6001\u524D\u7F00\u8FDB\u884C\u8DEF\u5F84\u5265\u79BB
@@ -89646,7 +89657,7 @@ class ASGIPathStripMiddleware:
89646
89657
  if not response_logged:
89647
89658
  response_logged = True
89648
89659
  elapsed_ms = (time.time() - start_time) * 1000
89649
- _pages_log_response(request_method, request_path, status_code, elapsed_ms)
89660
+ _pages_log_response(request_method, request_path, status_code, elapsed_ms, _scope_req_headers, _full_path, _scf_request_id)
89650
89661
  await send(message)
89651
89662
  else:
89652
89663
  # \u6709 body \u7684\u8BF7\u6C42\u6216\u5DF2\u5E26\u5C3E\u90E8\u659C\u6760\uFF1A\u76F4\u63A5\u8C03\u7528\uFF0C\u4E0D\u505A probe+retry
@@ -89663,7 +89674,7 @@ class ASGIPathStripMiddleware:
89663
89674
  if not response_logged:
89664
89675
  response_logged = True
89665
89676
  elapsed_ms = (time.time() - start_time) * 1000
89666
- _pages_log_response(request_method, request_path, status_code, elapsed_ms)
89677
+ _pages_log_response(request_method, request_path, status_code, elapsed_ms, _scope_req_headers, _full_path, _scf_request_id)
89667
89678
  await send(message)
89668
89679
  await self.app(scope, receive, pages_send)
89669
89680
  else:
@@ -89789,24 +89800,24 @@ class ASGIDispatcher:
89789
89800
 
89790
89801
  request_path = scope['path']
89791
89802
  request_method = scope.get('method', 'GET')
89792
- _pages_log_request(request_method, request_path, scope.get('headers'))
89803
+ _full_path, _scf_request_id = _pages_log_request(request_method, request_path, scope.get('headers'))
89793
89804
  start_time = time.time()
89794
-
89805
+
89795
89806
  # \u5C1D\u8BD5\u7528\u539F\u59CB path \u5339\u914D\u8DEF\u7531\uFF08\u540C\u65F6\u68C0\u67E5 HTTP \u65B9\u6CD5\uFF09
89796
89807
  app_type, handler, route_config, _, params = self._match_route(request_path, request_method)
89797
-
89808
+
89798
89809
  if app_type == 'method_not_allowed':
89799
89810
  elapsed_ms = (time.time() - start_time) * 1000
89800
- _pages_log_response(request_method, request_path, 405, elapsed_ms)
89811
+ _pages_log_response(request_method, request_path, 405, elapsed_ms, scope.get('headers'), _full_path, _scf_request_id)
89801
89812
  await self._send_response(send, 405, b'Method Not Allowed')
89802
89813
  return
89803
-
89814
+
89804
89815
  if app_type is None:
89805
89816
  elapsed_ms = (time.time() - start_time) * 1000
89806
- _pages_log_response(request_method, request_path, 404, elapsed_ms)
89817
+ _pages_log_response(request_method, request_path, 404, elapsed_ms, scope.get('headers'), _full_path, _scf_request_id)
89807
89818
  await self._send_response(send, 404, b'Not Found')
89808
89819
  return
89809
-
89820
+
89810
89821
  # \u5305\u88C5 send \u51FD\u6570\uFF0C\u6CE8\u5165 Pages \u5E73\u53F0 header \u548C\u65E5\u5FD7
89811
89822
  response_logged = False
89812
89823
  _scope_req_headers = scope.get('headers')
@@ -89821,9 +89832,9 @@ class ASGIDispatcher:
89821
89832
  if not response_logged:
89822
89833
  response_logged = True
89823
89834
  elapsed_ms = (time.time() - start_time) * 1000
89824
- _pages_log_response(request_method, request_path, status_code, elapsed_ms)
89835
+ _pages_log_response(request_method, request_path, status_code, elapsed_ms, _scope_req_headers, _full_path, _scf_request_id)
89825
89836
  await send(message)
89826
-
89837
+
89827
89838
  # \u5265\u79BB\u8DEF\u7531\u524D\u7F00\uFF08\u4EC5\u5BF9\u9759\u6001\u6302\u8F7D\u8DEF\u5F84\u751F\u6548\uFF0C\u52A8\u6001\u8DEF\u7531\u4E0D\u5265\u79BB\uFF09
89828
89839
  mount_path = route_config['path'] if route_config else '/'
89829
89840
  static_prefix = _extract_static_prefix(mount_path)
@@ -90288,10 +90299,10 @@ app = Flask(__name__)
90288
90299
  def catch_all(path):
90289
90300
  """\u6355\u83B7\u6240\u6709\u8BF7\u6C42\u5E76\u5206\u53D1\u5230\u5BF9\u5E94\u7684\u5904\u7406\u51FD\u6570"""
90290
90301
  request_path = '/' + path if path else '/'
90291
- _pages_log_request(request.method, request_path, request.headers)
90302
+ _full_path, _scf_request_id = _pages_log_request(request.method, request_path, request.headers)
90292
90303
  start_time = time.time()
90293
90304
  app_type, handler, route, params = get_handler_for_path(request_path, request.method)
90294
-
90305
+
90295
90306
  if app_type == 'method_not_allowed':
90296
90307
  resp = Response('Method Not Allowed', status=405, content_type='text/plain')
90297
90308
  elif app_type == 'handler':
@@ -90302,7 +90313,7 @@ def catch_all(path):
90302
90313
  resp = _handle_asgi_request(handler, request, route)
90303
90314
  else:
90304
90315
  resp = Response('Not Found', status=404, content_type='text/plain')
90305
-
90316
+
90306
90317
  elapsed_ms = (time.time() - start_time) * 1000
90307
90318
  # \u76F4\u63A5\u8BBE\u7F6E\u5E73\u53F0 header \u5230 resp \u4E0A (align with Node cloud function)
90308
90319
  scf_request_id = request.headers.get('X-Scf-Request-Id', '') or os.environ.get('_LAMBDA_RUNTIME_REQUEST_ID', '')
@@ -90313,7 +90324,7 @@ def catch_all(path):
90313
90324
  _cid = getattr(_current_conversation_id, 'value', None) if '_current_conversation_id' in globals() else None
90314
90325
  if _cid:
90315
90326
  resp.headers['makers-conversation-id'] = _cid
90316
- _pages_log_response(request.method, request_path, resp.status_code, elapsed_ms)
90327
+ _pages_log_response(request.method, request_path, resp.status_code, elapsed_ms, request.headers, _full_path, _scf_request_id)
90317
90328
  return resp
90318
90329
 
90319
90330
  def _handle_handler_request(handler, req, params=None):
@@ -90921,7 +90932,6 @@ func __edgeonePagesMiddleware() gin.HandlerFunc {
90921
90932
  }
90922
90933
  fullPath = fmt.Sprintf("%s://%s%s", proto, host, r.RequestURI)
90923
90934
  }
90924
- fmt.Printf("Makers request path: %s\\n", fullPath)
90925
90935
 
90926
90936
  // 2. SCF request ID
90927
90937
  scfRequestID := r.Header.Get("x-scf-request-id")
@@ -90938,7 +90948,7 @@ func __edgeonePagesMiddleware() gin.HandlerFunc {
90938
90948
  "code": "FUNCTION_INVOCATION_FAILED",
90939
90949
  "message": fmt.Sprintf("%v", err),
90940
90950
  })
90941
- fmt.Printf("Makers response status: %d\\n", http.StatusBadGateway)
90951
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, http.StatusBadGateway)
90942
90952
  }
90943
90953
  }()
90944
90954
 
@@ -90960,7 +90970,7 @@ func __edgeonePagesMiddleware() gin.HandlerFunc {
90960
90970
  }
90961
90971
  }
90962
90972
 
90963
- fmt.Printf("Makers response status: %d\\n", statusCode)
90973
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, statusCode)
90964
90974
  }
90965
90975
  }
90966
90976
  `}generateEchoPagesMiddleware(t="main",r="/"){return`package ${t}
@@ -91074,8 +91084,6 @@ func __edgeonePagesMiddleware() echo.MiddlewareFunc {
91074
91084
  }
91075
91085
  fullPath = fmt.Sprintf("%s://%s%s", proto, host, r.RequestURI)
91076
91086
  }
91077
- fmt.Printf("Makers request path: %s\\n", fullPath)
91078
-
91079
91087
  // 2. SCF request ID
91080
91088
  scfRequestID := r.Header.Get("x-scf-request-id")
91081
91089
  c.Response().Header().Set("Functions-Request-Id", scfRequestID)
@@ -91103,7 +91111,7 @@ func __edgeonePagesMiddleware() echo.MiddlewareFunc {
91103
91111
  }
91104
91112
  }
91105
91113
 
91106
- fmt.Printf("Makers response status: %d\\n", statusCode)
91114
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, statusCode)
91107
91115
  return err
91108
91116
  }
91109
91117
  }
@@ -91233,7 +91241,6 @@ ${s}
91233
91241
  }
91234
91242
  fullPath = fmt.Sprintf("%s://%s%s", proto, host, c.OriginalURL())
91235
91243
  }
91236
- fmt.Printf("Makers request path: %s\\n", fullPath)
91237
91244
 
91238
91245
  // 2. SCF request ID
91239
91246
  scfRequestID := c.Get("x-scf-request-id")
@@ -91258,7 +91265,7 @@ ${s}
91258
91265
  }
91259
91266
  }
91260
91267
 
91261
- fmt.Printf("Makers response status: %d\\n", statusCode)
91268
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, statusCode)
91262
91269
  return err
91263
91270
  }
91264
91271
  }
@@ -91371,7 +91378,6 @@ func __edgeonePagesMiddleware(next http.Handler) http.Handler {
91371
91378
  }
91372
91379
  fullPath = fmt.Sprintf("%s://%s%s", proto, host, r.RequestURI)
91373
91380
  }
91374
- fmt.Printf("\\nMakers request path: %s\\n", fullPath)
91375
91381
 
91376
91382
  // 2. SCF request ID
91377
91383
  scfRequestID := r.Header.Get("x-scf-request-id")
@@ -91390,7 +91396,7 @@ func __edgeonePagesMiddleware(next http.Handler) http.Handler {
91390
91396
  "code": "FUNCTION_INVOCATION_FAILED",
91391
91397
  "message": fmt.Sprintf("%v", err),
91392
91398
  })
91393
- fmt.Printf("Makers response status: %d\\n", http.StatusBadGateway)
91399
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, http.StatusBadGateway)
91394
91400
  }
91395
91401
  }()
91396
91402
 
@@ -91410,7 +91416,7 @@ func __edgeonePagesMiddleware(next http.Handler) http.Handler {
91410
91416
  }
91411
91417
  }
91412
91418
 
91413
- fmt.Printf("Makers response status: %d\\n", statusCode)
91419
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, statusCode)
91414
91420
  })
91415
91421
  }
91416
91422
 
@@ -91593,8 +91599,6 @@ func main() {
91593
91599
  fullPath = fmt.Sprintf("%s://%s%s", proto, host, r.RequestURI)
91594
91600
  }
91595
91601
 
91596
- fmt.Printf("Makers request path: %s\\n", fullPath)
91597
-
91598
91602
  // SCF context headers
91599
91603
  scfRequestID := r.Header.Get("x-scf-request-id")
91600
91604
  w.Header().Set("Functions-Request-Id", scfRequestID)
@@ -91609,7 +91613,7 @@ func main() {
91609
91613
  "error": "Not Found",
91610
91614
  "message": "The requested path does not exist",
91611
91615
  })
91612
- fmt.Printf("Makers response status: %d\\n", http.StatusNotFound)
91616
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, http.StatusNotFound)
91613
91617
  return
91614
91618
  }
91615
91619
 
@@ -91628,9 +91632,9 @@ func main() {
91628
91632
  "code": "FUNCTION_INVOCATION_FAILED",
91629
91633
  "message": fmt.Sprintf("%v", err),
91630
91634
  })
91631
- fmt.Printf("Makers response status: %d\\n", http.StatusBadGateway)
91635
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, http.StatusBadGateway)
91632
91636
  } else {
91633
- fmt.Printf("Makers response status: %d\\n", rec.statusCode)
91637
+ fmt.Printf("Makers request path: %s |scfRequestId=%s|statusCode=%d|\\n", fullPath, scfRequestID, rec.statusCode)
91634
91638
  }
91635
91639
  }()
91636
91640