The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
function R(e,t){return e-t*Math.floor(e/t)}const X=1721426;function C(e,t,r,n){t=W(e,t);let a=t-1,o=-2;return r<=2?o=0:k(t)&&(o=-1),X-1+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+Math.floor((367*r-362)/12+o+n)}function k(e){return e%4===0&&(e%100!==0||e%400===0)}function W(e,t){return e==="BC"?1-t:t}function ye(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const me={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class I{fromJulianDay(t){let r=t,n=r-X,a=Math.floor(n/146097),o=R(n,146097),c=Math.floor(o/36524),i=R(o,36524),l=Math.floor(i/1461),f=R(i,1461),$=Math.floor(f/365),p=a*400+c*100+l*4+$+(c!==4&&$!==4?1:0),[g,w]=ye(p),m=r-C(g,w,1,1),Z=2;r<C(g,w,3,1)?Z=0:k(w)&&(Z=1);let G=Math.floor(((m+Z)*12+373)/367),$e=r-C(g,w,G,1)+1;return new x(g,w,G,$e)}toJulianDay(t){return C(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return me[k(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return k(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const Me={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function be(e,t){return t=d(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function pe(e,t){return t=d(t,e.calendar),e=j(e),t=j(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Ge(e,t){return _(e.calendar,t.calendar)&&pe(e,t)}function _(e,t){var r,n,a,o;return(o=(a=(r=e.isEqual)===null||r===void 0?void 0:r.call(e,t))!==null&&a!==void 0?a:(n=t.isEqual)===null||n===void 0?void 0:n.call(t,e))!==null&&o!==void 0?o:e.identifier===t.identifier}function Ke(e,t){return be(e,De(t))}function je(e,t,r){let n=e.calendar.toJulianDay(e),a=xe(t),o=Math.ceil(n+1-a)%7;return o<0&&(o+=7),o}function we(e){return u(Date.now(),e)}function De(e){return Se(we(e))}function ee(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function ge(e,t){return K(e)-K(t)}function K(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let T=null;function te(){return T==null&&(T=new Intl.DateTimeFormat().resolvedOptions().timeZone),T}function j(e){return e.subtract({days:e.day-1})}function ze(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}const z=new Map,L=new Map;function Ie(e){if(Intl.Locale){let r=z.get(e);return r||(r=new Intl.Locale(e).maximize().region,r&&z.set(e,r)),r}let t=e.split("-")[1];return t==="u"?void 0:t}function xe(e){let t=L.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo(),t))return L.set(e,t),t.firstDay}let r=Ie(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];n==="mon"?t={firstDay:1}:n==="tue"?t={firstDay:2}:n==="wed"?t={firstDay:3}:n==="thu"?t={firstDay:4}:n==="fri"?t={firstDay:5}:n==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:r&&Me[r]||0};L.set(e,t)}return t.firstDay}function M(e){e=d(e,new I);let t=W(e.era,e.year);return re(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function re(e,t,r,n,a,o,c){let i=new Date;return i.setUTCHours(n,a,o,c),i.setUTCFullYear(e,t-1,r),i.getTime()}function S(e,t){if(t==="UTC")return 0;if(e>0&&t===te())return new Date(e).getTimezoneOffset()*-6e4;let{year:r,month:n,day:a,hour:o,minute:c,second:i}=ne(e,t);return re(r,n,a,o,c,i,0)-Math.floor(e/1e3)*1e3}const Q=new Map;function ne(e,t){let r=Q.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Q.set(t,r));let n=r.formatToParts(new Date(e)),a={};for(let o of n)o.type!=="literal"&&(a[o.type]=o.value);return{year:a.era==="BC"||a.era==="B"?-a.year+1:+a.year,month:+a.month,day:+a.day,hour:a.hour==="24"?0:+a.hour,minute:+a.minute,second:+a.second}}const U=864e5;function ve(e,t){let r=M(e),n=r-S(r-U,t),a=r-S(r+U,t);return ae(e,t,n,a)}function ae(e,t,r,n){return(r===n?[r]:[r,n]).filter(o=>Ee(e,t,o))}function Ee(e,t,r){let n=ne(r,t);return e.year===n.year&&e.month===n.month&&e.day===n.day&&e.hour===n.hour&&e.minute===n.minute&&e.second===n.second}function h(e,t,r="compatible"){let n=b(e);if(t==="UTC")return M(n);if(t===te()&&r==="compatible"){n=d(n,new I);let l=new Date,f=W(n.era,n.year);return l.setFullYear(f,n.month-1,n.day),l.setHours(n.hour,n.minute,n.second,n.millisecond),l.getTime()}let a=M(n),o=S(a-U,t),c=S(a+U,t),i=ae(n,t,a-o,a-c);if(i.length===1)return i[0];if(i.length>1)switch(r){case"compatible":case"earlier":return i[0];case"later":return i[i.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case"earlier":return Math.min(a-o,a-c);case"compatible":case"later":return Math.max(a-o,a-c);case"reject":throw new RangeError("No such absolute time found")}}function oe(e,t,r="compatible"){return new Date(h(e,t,r))}function u(e,t){let r=S(e,t),n=new Date(e+r),a=n.getUTCFullYear(),o=n.getUTCMonth()+1,c=n.getUTCDate(),i=n.getUTCHours(),l=n.getUTCMinutes(),f=n.getUTCSeconds(),$=n.getUTCMilliseconds();return new v(a<1?"BC":"AD",a<1?-a+1:a,o,c,t,r,i,l,f,$)}function Se(e){return new x(e.calendar,e.era,e.year,e.month,e.day)}function b(e,t){let r=0,n=0,a=0,o=0;if("timeZone"in e)({hour:r,minute:n,second:a,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:r,minute:n,second:a,millisecond:o}=t),new A(e.calendar,e.era,e.year,e.month,e.day,r,n,a,o)}function d(e,t){if(_(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=r.era,n.year=r.year,n.month=r.month,n.day=r.day,D(n),n}function Ae(e,t,r){if(e instanceof v)return e.timeZone===t?e:Ye(e,t);let n=h(e,t,r);return u(n,t)}function Ce(e){let t=M(e)-e.offset;return new Date(t)}function Ye(e,t){let r=M(e)-e.offset;return d(u(r,t),e.calendar)}const E=36e5;function B(e,t){let r=e.copy(),n="hour"in r?Be(r,t):0;N(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,F(r),ie(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=n,ke(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let a=r.calendar.getYearsInEra(r);if(r.year>a){var o,c;let l=(o=(c=r.calendar).isInverseEra)===null||o===void 0?void 0:o.call(c,r);r.year=a,r.month=l?1:r.calendar.getMonthsInYear(r),r.day=l?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let i=r.calendar.getMonthsInYear(r);return r.month>i&&(r.month=i,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function N(e,t){var r,n;!((r=(n=e.calendar).isInverseEra)===null||r===void 0)&&r.call(n,e)&&(t=-t),e.year+=t}function F(e){for(;e.month<1;)N(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,N(e,1)}function ke(e){for(;e.day<1;)e.month--,F(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,F(e)}function ie(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function D(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),ie(e)}function ce(e){let t={};for(let r in e)typeof e[r]=="number"&&(t[r]=-e[r]);return t}function le(e,t){return B(e,ce(t))}function J(e,t){let r=e.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),D(r),r}function O(e,t){let r=e.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),Oe(r),r}function Ue(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Y(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Y(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Y(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Y(e.hour,24),t}function Oe(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Y(e,t){let r=e%t;return r<0&&(r+=t),r}function Be(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,Ue(e)}function H(e,t,r,n){let a=e.copy();switch(t){case"era":{let i=e.calendar.getEras(),l=i.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=y(l,r,0,i.length-1,n?.round),a.era=i[l],D(a);break}case"year":var o,c;!((o=(c=a.calendar).isInverseEra)===null||o===void 0)&&o.call(c,a)&&(r=-r),a.year=y(e.year,r,-1/0,9999,n?.round),a.year===-1/0&&(a.year=1),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e);break;case"month":a.month=y(e.month,r,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":a.day=y(e.day,r,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(a),D(a),a}function se(e,t,r,n){let a=e.copy();switch(t){case"hour":{let o=e.hour,c=0,i=23;if(n?.hourCycle===12){let l=o>=12;c=l?12:0,i=l?23:11}a.hour=y(o,r,c,i,n?.round);break}case"minute":a.minute=y(e.minute,r,0,59,n?.round);break;case"second":a.second=y(e.second,r,0,59,n?.round);break;case"millisecond":a.millisecond=y(e.millisecond,r,0,999,n?.round);break;default:throw new Error("Unsupported field "+t)}return a}function y(e,t,r,n,a=!1){if(a){e+=Math.sign(t),e<r&&(e=n);let o=Math.abs(t);t>0?e=Math.ceil(e/o)*o:e=Math.floor(e/o)*o,e>n&&(e=r)}else e+=t,e<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function fe(e,t){let r;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let a=B(b(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});r=h(a,e.timeZone)}else r=M(e)-e.offset;r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5;let n=u(r,e.timeZone);return d(n,e.calendar)}function Ze(e,t){return fe(e,ce(t))}function Re(e,t,r,n){switch(t){case"hour":{let a=0,o=23;if(n?.hourCycle===12){let m=e.hour>=12;a=m?12:0,o=m?23:11}let c=b(e),i=d(O(c,{hour:a}),new I),l=[h(i,e.timeZone,"earlier"),h(i,e.timeZone,"later")].filter(m=>u(m,e.timeZone).day===i.day)[0],f=d(O(c,{hour:o}),new I),$=[h(f,e.timeZone,"earlier"),h(f,e.timeZone,"later")].filter(m=>u(m,e.timeZone).day===f.day).pop(),p=M(e)-e.offset,g=Math.floor(p/E),w=p%E;return p=y(g,r,Math.floor(l/E),Math.floor($/E),n?.round)*E+w,d(u(p,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return se(e,t,r,n);case"era":case"year":case"month":case"day":{let a=H(b(e),t,r,n),o=h(a,e.timeZone);return d(u(o,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function Te(e,t,r){let n=b(e),a=O(J(n,t),t);if(a.compare(n)===0)return e;let o=h(a,e.timeZone,r);return d(u(o,e.timeZone),e.calendar)}const Le=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,Ne=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,Fe=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,de=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function Qe(e){let t=e.match(Le);if(!t)throw de.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let r=new x(s(t[1],0,9999),s(t[2],1,12),1);return r.day=s(t[3],1,r.calendar.getDaysInMonth(r)),r}function Xe(e){let t=e.match(Ne);if(!t)throw de.test(e)?new Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date time string: "+e);let r=s(t[1],-9999,9999),n=r<1?"BC":"AD",a=new A(n,r<1?-r+1:r,s(t[2],1,12),1,t[4]?s(t[4],0,23):0,t[5]?s(t[5],0,59):0,t[6]?s(t[6],0,59):0,t[7]?s(t[7],0,1/0)*1e3:0);return a.day=s(t[3],0,a.calendar.getDaysInMonth(a)),a}function _e(e,t){let r=e.match(Fe);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=s(r[1],-9999,9999),a=n<1?"BC":"AD",o=new v(a,n<1?-n+1:n,s(r[2],1,12),1,r[11],0,r[4]?s(r[4],0,23):0,r[5]?s(r[5],0,59):0,r[6]?s(r[6],0,59):0,r[7]?s(r[7],0,1/0)*1e3:0);o.day=s(r[3],0,o.calendar.getDaysInMonth(o));let c=b(o),i;if(r[8]){let $=s(r[8],-23,23);var l,f;if(o.offset=Math.sign($)*(Math.abs($)*36e5+s((l=r[9])!==null&&l!==void 0?l:"0",0,59)*6e4+s((f=r[10])!==null&&f!==void 0?f:"0",0,59)*1e3),i=M(o)-o.offset,!ve(c,o.timeZone).includes(i))throw new Error(`Offset ${ue(o.offset)} is invalid for ${q(o)} in ${o.timeZone}`)}else i=h(b(c),o.timeZone,t);return u(i,o.timeZone)}function s(e,t,r){let n=Number(e);if(n<t||n>r)throw new RangeError(`Value out of range: ${t} <= ${n} <= ${r}`);return n}function We(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function he(e){let t=d(e,new I),r;return t.era==="BC"?r=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):r=String(t.year).padStart(4,"0"),`${r}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function q(e){return`${he(e)}T${We(e)}`}function ue(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let r=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),a=Math.floor(e%36e5%6e4/1e3),o=`${t}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return a!==0&&(o+=`:${String(a).padStart(2,"0")}`),o}function Je(e){return`${q(e)}${ue(e.offset)}[${e.timeZone}]`}function He(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function P(e,t,r){He(e,t),t.set(e,r)}function V(e){let t=typeof e[0]=="object"?e.shift():new I,r;if(typeof e[0]=="string")r=e.shift();else{let c=t.getEras();r=c[c.length-1]}let n=e.shift(),a=e.shift(),o=e.shift();return[t,r,n,a,o]}var qe=new WeakMap;class x{copy(){return this.era?new x(this.calendar,this.era,this.year,this.month,this.day):new x(this.calendar,this.year,this.month,this.day)}add(t){return B(this,t)}subtract(t){return le(this,t)}set(t){return J(this,t)}cycle(t,r,n){return H(this,t,r,n)}toDate(t){return oe(this,t)}toString(){return he(this)}compare(t){return ee(this,t)}constructor(...t){P(this,qe,{writable:!0,value:void 0});let[r,n,a,o,c]=V(t);this.calendar=r,this.era=n,this.year=a,this.month=o,this.day=c,D(this)}}var Pe=new WeakMap;class A{copy(){return this.era?new A(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new A(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return B(this,t)}subtract(t){return le(this,t)}set(t){return J(O(this,t),t)}cycle(t,r,n){switch(t){case"era":case"year":case"month":case"day":return H(this,t,r,n);default:return se(this,t,r,n)}}toDate(t,r){return oe(this,t,r)}toString(){return q(this)}compare(t){let r=ee(this,t);return r===0?ge(this,b(t)):r}constructor(...t){P(this,Pe,{writable:!0,value:void 0});let[r,n,a,o,c]=V(t);this.calendar=r,this.era=n,this.year=a,this.month=o,this.day=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,D(this)}}var Ve=new WeakMap;class v{copy(){return this.era?new v(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new v(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return fe(this,t)}subtract(t){return Ze(this,t)}set(t,r){return Te(this,t,r)}cycle(t,r,n){return Re(this,t,r,n)}toDate(){return Ce(this)}toString(){return Je(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Ae(t,this.timeZone).toDate().getTime()}constructor(...t){P(this,Ve,{writable:!0,value:void 0});let[r,n,a,o,c]=V(t),i=t.shift(),l=t.shift();this.calendar=r,this.era=n,this.year=a,this.month=o,this.day=c,this.timeZone=i,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,D(this)}}export{x as $,A as a,De as b,te as c,Xe as d,Qe as e,v as f,_e as g,d as h,je as i,pe as j,j as k,ze as l,be as m,Ke as n,Ge as o};