@jeffchi/logger 3.0.0 → 3.0.1-alpha.1
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.
- package/lib/index.cjs +1 -1
- package/lib/index.mjs +1 -1
- package/package.json +2 -1
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function e(t,e,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,n):a?a.value=n:e.set(t,n),n}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function a(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},o(t)}function i(t){a(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===o(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function u(t,e){a(2,arguments);var n=i(t).getTime(),o=r(e);return new Date(n+o)}var s={};function l(){return s}function d(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function c(t){return c="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},c(t)}function f(t){return a(1,arguments),t instanceof Date||"object"===c(t)&&"[object Date]"===Object.prototype.toString.call(t)}function h(t){if(a(1,arguments),!f(t)&&"number"!=typeof t)return!1;var e=i(t);return!isNaN(Number(e))}function m(t,e){a(2,arguments);var n=r(e);return u(t,-n)}var g=864e5;function v(t){a(1,arguments);var e=1,n=i(t),r=n.getUTCDay(),o=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function w(t){a(1,arguments);var e=i(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=v(r),u=new Date(0);u.setUTCFullYear(n,0,4),u.setUTCHours(0,0,0,0);var s=v(u);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function b(t){a(1,arguments);var e=w(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=v(n);return r}var y=6048e5;function p(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=l(),g=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.weekStartsOn)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==u?u:m.weekStartsOn)&&void 0!==o?o:null===(f=m.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=i(t),w=v.getUTCDay(),b=(w<g?7:0)+w-g;return v.setUTCDate(v.getUTCDate()-b),v.setUTCHours(0,0,0,0),v}function T(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=i(t),g=m.getUTCFullYear(),v=l(),w=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.firstWeekContainsDate)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==u?u:v.firstWeekContainsDate)&&void 0!==o?o:null===(f=v.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==n?n:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(g+1,0,w),b.setUTCHours(0,0,0,0);var y=p(b,e),T=new Date(0);T.setUTCFullYear(g,0,w),T.setUTCHours(0,0,0,0);var C=p(T,e);return m.getTime()>=y.getTime()?g+1:m.getTime()>=C.getTime()?g:g-1}function C(t,e){var n,o,i,u,s,d,c,f;a(1,arguments);var h=l(),m=r(null!==(n=null!==(o=null!==(i=null!==(u=null==e?void 0:e.firstWeekContainsDate)&&void 0!==u?u:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==o?o:null===(c=h.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1),g=T(t,e),v=new Date(0);v.setUTCFullYear(g,0,m),v.setUTCHours(0,0,0,0);var w=p(v,e);return w}var M=6048e5;function S(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var D=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return S("yy"===e?r%100:r,e.length)},k=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):S(n+1,2)},x=function(t,e){return S(t.getUTCDate(),e.length)},U=function(t,e){return S(t.getUTCHours()%12||12,e.length)},P=function(t,e){return S(t.getUTCHours(),e.length)},W=function(t,e){return S(t.getUTCMinutes(),e.length)},E=function(t,e){return S(t.getUTCSeconds(),e.length)},O=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return S(Math.floor(r*Math.pow(10,n-3)),e.length)},N="midnight",L="noon",Y="morning",F="afternoon",j="evening",q="night",A={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return D(t,e)},Y:function(t,e,n,r){var a=T(t,r),o=a>0?a:1-a;return"YY"===e?S(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):S(o,e.length)},R:function(t,e){return S(w(t),e.length)},u:function(t,e){return S(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return S(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return S(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return k(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return S(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var o=function(t,e){a(1,arguments);var n=i(t),r=p(n,e).getTime()-C(n,e).getTime();return Math.round(r/M)+1}(t,r);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):S(o,e.length)},I:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=v(e).getTime()-b(e).getTime();return Math.round(n/y)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):S(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):x(t,e)},D:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/g)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):S(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return S(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return S(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return S(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,a=t.getUTCHours();switch(r=12===a?L:0===a?N:a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,a=t.getUTCHours();switch(r=a>=17?j:a>=12?F:a>=4?Y:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return U(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):P(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):W(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E(t,e)},S:function(t,e){return O(t,e)},X:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return G(a);case"XXXX":case"XX":return H(a);default:return H(a,":")}},x:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return G(a);case"xxxx":case"xx":return H(a);default:return H(a,":")}},O:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},z:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},t:function(t,e,n,r){var a=r._originalDate||t;return S(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return S((r._originalDate||t).getTime(),e.length)}};function R(t,e){var n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;if(0===o)return n+String(a);var i=e||"";return n+String(a)+i+S(o,2)}function G(t,e){return t%60==0?(t>0?"-":"+")+S(Math.abs(t)/60,2):H(t,e)}function H(t,e){var n=e||"",r=t>0?"-":"+",a=Math.abs(t);return r+S(Math.floor(a/60),2)+n+S(a%60,2)}var z=A,B=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Q=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},X={p:Q,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],a=r[1],o=r[2];if(!o)return B(t,e);switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",B(a,e)).replace("{{time}}",Q(o,e))}},I=X,$=["D","DD"],J=["YY","YYYY"];function _(t){return-1!==$.indexOf(t)}function V(t){return-1!==J.indexOf(t)}function K(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Z={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function tt(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var et={date:tt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rt(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var i=t.defaultWidth,u=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[u]||t.values[i]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function at(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;var i,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?it(s,(function(t){return t.test(u)})):ot(s,(function(t){return t.test(u)}));i=t.valueCallback?t.valueCallback(l):l,i=n.valueCallback?n.valueCallback(i):i;var d=e.slice(u.length);return{value:i,rest:d}}}function ot(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function it(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}var ut,st={code:"en-US",formatDistance:function(t,e,n){var r,a=Z[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:et,formatRelative:function(t,e,n,r){return nt[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:rt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:rt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ut={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ut.matchPattern);if(!n)return null;var r=n[0],a=t.match(ut.parsePattern);if(!a)return null;var o=ut.valueCallback?ut.valueCallback(a[0]):a[0];o=e.valueCallback?e.valueCallback(o):o;var i=t.slice(r.length);return{value:o,rest:i}}),era:at({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:at({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:at({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:at({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:at({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,ft=/''/g,ht=/[a-zA-Z]/;function mt(t,e,n){var o,u,s,c,f,g,v,w,b,y,p,T,C,M,S,D,k,x;a(2,arguments);var U=String(e),P=l(),W=null!==(o=null!==(u=null==n?void 0:n.locale)&&void 0!==u?u:P.locale)&&void 0!==o?o:st,E=r(null!==(s=null!==(c=null!==(f=null!==(g=null==n?void 0:n.firstWeekContainsDate)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(w=v.options)||void 0===w?void 0:w.firstWeekContainsDate)&&void 0!==f?f:P.firstWeekContainsDate)&&void 0!==c?c:null===(b=P.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==s?s:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=r(null!==(p=null!==(T=null!==(C=null!==(M=null==n?void 0:n.weekStartsOn)&&void 0!==M?M:null==n||null===(S=n.locale)||void 0===S||null===(D=S.options)||void 0===D?void 0:D.weekStartsOn)&&void 0!==C?C:P.weekStartsOn)&&void 0!==T?T:null===(k=P.locale)||void 0===k||null===(x=k.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!W.localize)throw new RangeError("locale must contain localize property");if(!W.formatLong)throw new RangeError("locale must contain formatLong property");var N=i(t);if(!h(N))throw new RangeError("Invalid time value");var L=d(N),Y=m(N,L),F={firstWeekContainsDate:E,weekStartsOn:O,locale:W,_originalDate:N},j=U.match(dt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,I[e])(t,W.formatLong):t})).join("").match(lt).map((function(r){if("''"===r)return"'";var a=r[0];if("'"===a)return gt(r);var o=z[a];if(o)return null!=n&&n.useAdditionalWeekYearTokens||!V(r)||K(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!_(r)||K(r,e,String(t)),o(Y,r,W.localize,F);if(a.match(ht))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("");return j}function gt(t){var e=t.match(ct);return e?e[1].replace(ft,"'"):t}const vt=t=>"string"==typeof t||"[object String]"===(t=>Object.prototype.toString.call(t))(t),wt=Array.isArray,bt=Number.isInteger,yt=(t,e)=>{let n=null;bt(e)&&(e={wait:e});const{immediate:r,wait:a=100}=e||{};return(...e)=>{n&&clearTimeout(n),r&&!n&&t(...e),n=setTimeout((()=>{t(...e)}),a)}};var pt,Tt,Ct,Mt,St,Dt,kt,xt,Ut,Pt,Wt,Et=()=>{};class Ot{static get cache(){return t(Ot,Tt,"f",Ct)}get defaultLogFile(){return`logs/${mt(Date.now(),"yyyy-MM-dd")}.log`}constructor(){pt.add(this),this.lastWrite=Date.now(),Mt.set(this,void 0),St.set(this,void 0),e(this,Mt,new Map,"f"),Promise.all([import("fs"),import("path")]).then((([t,e])=>{if(!t)return null;const{existsSync:n,mkdirSync:r,writeFile:a}=t,{sep:o,resolve:i,join:u,dirname:s}=e;return{existsSync:n,mkdirSync:r,writeFile:a,join:u,sep:o,resolve:i,dirname:s}})).then((t=>{e(this,St,t,"f")}))}push(e,n){var r;let a=n.file||this.defaultLogFile;if(n.groupByLevel){const t=e.prefix||[],n=null===(r=t.splice(1,1))||void 0===r?void 0:r[0];a=a.replace(/\.log$/,`.${n.replace(/\[|\]/g,"").toLowerCase()}.log`),e.prefix=t}let o=t(this,Mt,"f").get(a);o||(o={Set:new Set,writer:yt((t=>this.flush(t)),1e3)},t(this,Mt,"f").set(a,o));const i=Date.now();o.Set.add(e).size>1e3||i-this.lastWrite>3e4?this.flush(a):o.writer(a)}flush(e){t(this,St,"f")&&t(this,Mt,"f").forEach(((n,r)=>{if(n&&(null===e&&r===this.defaultLogFile||!e||r===e)){const e=Array.from(n.Set);n.Set.clear(),t(this,pt,"m",kt).call(this,r,e),this.lastWrite=Date.now()}}))}}Tt=Ot,Mt=new WeakMap,St=new WeakMap,pt=new WeakSet,Dt=function(e){var n,r;const a=(null===(r=null===(n=t(this,St,"f"))||void 0===n?void 0:n.dirname)||void 0===r?void 0:r.call(n,e||this.defaultLogFile))||"",{existsSync:o,mkdirSync:i}=t(this,St,"f")||{};(null==o?void 0:o(a))||null==i||i(a)},kt=function(e,n){if(wt(n)||(n=[n]),!e)throw new Error("output log file is missed");t(this,pt,"m",Dt).call(this,e);const{writeFile:r}=t(this,St,"f")||{};if(e&&r){const t=n.reduce(((t,{prefix:e=[],data:n})=>[...t,[...e,...n.map(JSON.stringify),"\n"].join(" ")]),[]);null==r||r(e,t.join(""),{flag:"a"},Et)}},Ct={value:new Ot},(Ut=xt||(xt={})).ALL="all",Ut.PRODUCTION="production",Ut.DEVELOPMENET="development",Ut.NONE="none",(Wt=Pt||(Pt={})).LOG="LOG",Wt.WARN="WARN",Wt.INFO="INFO",Wt.ERROR="ERROR",Wt.DEBUG="DEBUG";const Nt={date:!0,env:xt.ALL},Lt=(t,e)=>{const{date:n}=e,r=[];if(t.length&&r.unshift(t.map((t=>`[${t.toUpperCase()}]`)).join(" ")),n){const t=new Date;let e;e=vt(n)?mt(t,n):new Date(t).toISOString(),r.unshift(e)}return r},Yt=t=>("all"===t||process.env.NODE_ENV===t)&&void 0!==console,Ft=(t,e)=>{wt(t)||(t=[t]);const{env:n,outputFile:r,output:a,levels:o=[],...i}={...Nt,...e||{}},u=vt(a)?{file:a}:a||{file:r};return{debug:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.DEBUG}]`,...a];Yt(n||xt.ALL)&&console.debug(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.DEBUG)||Ot.cache.push({prefix:s,data:[...e]},u)},info:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.INFO}]`,...a];Yt(n||xt.ALL)&&console.info(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.INFO)||Ot.cache.push({prefix:s,data:[...e]},u)},log:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.LOG}]`,...a];Yt(n||xt.ALL)&&console.log(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.LOG)||Ot.cache.push({prefix:s,data:[...e]},u)},warn:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.WARN}]`,...a],{disableError:l}=i,d=l?console.debug:console.warn;Yt(n||xt.ALL)&&d(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.WARN)||Ot.cache.push({prefix:s,data:[...e]},u)},error:(e,r)=>{const[a,...s]=Lt(t,{...i}),l=[a,`[${Pt.ERROR}]`,...s],{disableThrow:d,ignoreThrow:c,disableError:f}=i,h=f?console.debug:console.error;if(Yt(n||xt.ALL)&&h(...l,e),(null==o?void 0:o.length)&&!o.includes(Pt.ERROR)||Ot.cache.push({prefix:l,data:[e]},u),!1===c||!1===d)throw new Error(e,{cause:r})}}},jt=Ft;exports.loggerWithTags=Ft,exports.withTags=jt;
|
|
1
|
+
"use strict";function t(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function e(t,e,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,n):a?a.value=n:e.set(t,n),n}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function a(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},o(t)}function i(t){a(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===o(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function u(t,e){a(2,arguments);var n=i(t).getTime(),o=r(e);return new Date(n+o)}var s={};function l(){return s}function d(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function c(t){return c="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},c(t)}function f(t){return a(1,arguments),t instanceof Date||"object"===c(t)&&"[object Date]"===Object.prototype.toString.call(t)}function h(t){if(a(1,arguments),!f(t)&&"number"!=typeof t)return!1;var e=i(t);return!isNaN(Number(e))}function m(t,e){a(2,arguments);var n=r(e);return u(t,-n)}var g=864e5;function v(t){a(1,arguments);var e=1,n=i(t),r=n.getUTCDay(),o=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function w(t){a(1,arguments);var e=i(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=v(r),u=new Date(0);u.setUTCFullYear(n,0,4),u.setUTCHours(0,0,0,0);var s=v(u);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function b(t){a(1,arguments);var e=w(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=v(n);return r}var y=6048e5;function p(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=l(),g=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.weekStartsOn)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==u?u:m.weekStartsOn)&&void 0!==o?o:null===(f=m.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=i(t),w=v.getUTCDay(),b=(w<g?7:0)+w-g;return v.setUTCDate(v.getUTCDate()-b),v.setUTCHours(0,0,0,0),v}function T(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=i(t),g=m.getUTCFullYear(),v=l(),w=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.firstWeekContainsDate)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==u?u:v.firstWeekContainsDate)&&void 0!==o?o:null===(f=v.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==n?n:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(g+1,0,w),b.setUTCHours(0,0,0,0);var y=p(b,e),T=new Date(0);T.setUTCFullYear(g,0,w),T.setUTCHours(0,0,0,0);var C=p(T,e);return m.getTime()>=y.getTime()?g+1:m.getTime()>=C.getTime()?g:g-1}function C(t,e){var n,o,i,u,s,d,c,f;a(1,arguments);var h=l(),m=r(null!==(n=null!==(o=null!==(i=null!==(u=null==e?void 0:e.firstWeekContainsDate)&&void 0!==u?u:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==o?o:null===(c=h.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1),g=T(t,e),v=new Date(0);v.setUTCFullYear(g,0,m),v.setUTCHours(0,0,0,0);var w=p(v,e);return w}var M=6048e5;function S(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var D=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return S("yy"===e?r%100:r,e.length)},k=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):S(n+1,2)},x=function(t,e){return S(t.getUTCDate(),e.length)},U=function(t,e){return S(t.getUTCHours()%12||12,e.length)},P=function(t,e){return S(t.getUTCHours(),e.length)},W=function(t,e){return S(t.getUTCMinutes(),e.length)},E=function(t,e){return S(t.getUTCSeconds(),e.length)},O=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return S(Math.floor(r*Math.pow(10,n-3)),e.length)},N="midnight",L="noon",Y="morning",F="afternoon",j="evening",q="night",A={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return D(t,e)},Y:function(t,e,n,r){var a=T(t,r),o=a>0?a:1-a;return"YY"===e?S(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):S(o,e.length)},R:function(t,e){return S(w(t),e.length)},u:function(t,e){return S(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return S(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return S(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return k(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return S(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var o=function(t,e){a(1,arguments);var n=i(t),r=p(n,e).getTime()-C(n,e).getTime();return Math.round(r/M)+1}(t,r);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):S(o,e.length)},I:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=v(e).getTime()-b(e).getTime();return Math.round(n/y)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):S(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):x(t,e)},D:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/g)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):S(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return S(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return S(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return S(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,a=t.getUTCHours();switch(r=12===a?L:0===a?N:a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,a=t.getUTCHours();switch(r=a>=17?j:a>=12?F:a>=4?Y:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return U(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):P(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):W(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E(t,e)},S:function(t,e){return O(t,e)},X:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return G(a);case"XXXX":case"XX":return H(a);default:return H(a,":")}},x:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return G(a);case"xxxx":case"xx":return H(a);default:return H(a,":")}},O:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},z:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},t:function(t,e,n,r){var a=r._originalDate||t;return S(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return S((r._originalDate||t).getTime(),e.length)}};function R(t,e){var n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;if(0===o)return n+String(a);var i=e||"";return n+String(a)+i+S(o,2)}function G(t,e){return t%60==0?(t>0?"-":"+")+S(Math.abs(t)/60,2):H(t,e)}function H(t,e){var n=e||"",r=t>0?"-":"+",a=Math.abs(t);return r+S(Math.floor(a/60),2)+n+S(a%60,2)}var z=A,B=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Q=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},X={p:Q,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],a=r[1],o=r[2];if(!o)return B(t,e);switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",B(a,e)).replace("{{time}}",Q(o,e))}},I=X,$=["D","DD"],J=["YY","YYYY"];function _(t){return-1!==$.indexOf(t)}function V(t){return-1!==J.indexOf(t)}function K(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Z={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function tt(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var et={date:tt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rt(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var i=t.defaultWidth,u=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[u]||t.values[i]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function at(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;var i,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?it(s,(function(t){return t.test(u)})):ot(s,(function(t){return t.test(u)}));i=t.valueCallback?t.valueCallback(l):l,i=n.valueCallback?n.valueCallback(i):i;var d=e.slice(u.length);return{value:i,rest:d}}}function ot(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function it(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}var ut,st={code:"en-US",formatDistance:function(t,e,n){var r,a=Z[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:et,formatRelative:function(t,e,n,r){return nt[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:rt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:rt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ut={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ut.matchPattern);if(!n)return null;var r=n[0],a=t.match(ut.parsePattern);if(!a)return null;var o=ut.valueCallback?ut.valueCallback(a[0]):a[0];o=e.valueCallback?e.valueCallback(o):o;var i=t.slice(r.length);return{value:o,rest:i}}),era:at({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:at({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:at({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:at({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:at({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,ft=/''/g,ht=/[a-zA-Z]/;function mt(t,e,n){var o,u,s,c,f,g,v,w,b,y,p,T,C,M,S,D,k,x;a(2,arguments);var U=String(e),P=l(),W=null!==(o=null!==(u=null==n?void 0:n.locale)&&void 0!==u?u:P.locale)&&void 0!==o?o:st,E=r(null!==(s=null!==(c=null!==(f=null!==(g=null==n?void 0:n.firstWeekContainsDate)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(w=v.options)||void 0===w?void 0:w.firstWeekContainsDate)&&void 0!==f?f:P.firstWeekContainsDate)&&void 0!==c?c:null===(b=P.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==s?s:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=r(null!==(p=null!==(T=null!==(C=null!==(M=null==n?void 0:n.weekStartsOn)&&void 0!==M?M:null==n||null===(S=n.locale)||void 0===S||null===(D=S.options)||void 0===D?void 0:D.weekStartsOn)&&void 0!==C?C:P.weekStartsOn)&&void 0!==T?T:null===(k=P.locale)||void 0===k||null===(x=k.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!W.localize)throw new RangeError("locale must contain localize property");if(!W.formatLong)throw new RangeError("locale must contain formatLong property");var N=i(t);if(!h(N))throw new RangeError("Invalid time value");var L=d(N),Y=m(N,L),F={firstWeekContainsDate:E,weekStartsOn:O,locale:W,_originalDate:N},j=U.match(dt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,I[e])(t,W.formatLong):t})).join("").match(lt).map((function(r){if("''"===r)return"'";var a=r[0];if("'"===a)return gt(r);var o=z[a];if(o)return null!=n&&n.useAdditionalWeekYearTokens||!V(r)||K(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!_(r)||K(r,e,String(t)),o(Y,r,W.localize,F);if(a.match(ht))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("");return j}function gt(t){var e=t.match(ct);return e?e[1].replace(ft,"'"):t}const vt=t=>"string"==typeof t||"[object String]"===(t=>Object.prototype.toString.call(t))(t),wt=Array.isArray,bt=Number.isInteger,yt=(t,e)=>{let n=null;bt(e)&&(e={wait:e});const{immediate:r,wait:a=100}=e||{};return(...e)=>{n&&clearTimeout(n),r&&!n&&t(...e),n=setTimeout((()=>{t(...e)}),a)}};var pt,Tt,Ct,Mt,St,Dt,kt,xt,Ut,Pt,Wt,Et=()=>{};class Ot{static get cache(){return t(Ot,Tt,"f",Ct)}get defaultLogFile(){return`logs/${mt(Date.now(),"yyyy-MM-dd")}.log`}constructor(){pt.add(this),this.lastWrite=Date.now(),Mt.set(this,void 0),St.set(this,void 0),e(this,Mt,new Map,"f"),Promise.all([import("fs"),import("path")]).then((([t,e])=>{if(!t)return null;const{existsSync:n,mkdirSync:r,writeFile:a}=t,{sep:o,resolve:i,join:u,dirname:s}=e;return{existsSync:n,mkdirSync:r,writeFile:a,join:u,sep:o,resolve:i,dirname:s}})).catch((()=>null)).then((t=>{e(this,St,t,"f")}))}push(e,n){var r;let a=n.file||this.defaultLogFile;if(n.groupByLevel){const t=e.prefix||[],n=null===(r=t.splice(1,1))||void 0===r?void 0:r[0];a=a.replace(/\.log$/,`.${n.replace(/\[|\]/g,"").toLowerCase()}.log`),e.prefix=t}let o=t(this,Mt,"f").get(a);o||(o={Set:new Set,writer:yt((t=>this.flush(t)),1e3)},t(this,Mt,"f").set(a,o));const i=Date.now();o.Set.add(e).size>1e3||i-this.lastWrite>3e4?this.flush(a):o.writer(a)}flush(e){t(this,St,"f")&&t(this,Mt,"f").forEach(((n,r)=>{if(n&&(null===e&&r===this.defaultLogFile||!e||r===e)){const e=Array.from(n.Set);n.Set.clear(),t(this,pt,"m",kt).call(this,r,e),this.lastWrite=Date.now()}}))}}Tt=Ot,Mt=new WeakMap,St=new WeakMap,pt=new WeakSet,Dt=function(e){var n,r;const a=(null===(r=null===(n=t(this,St,"f"))||void 0===n?void 0:n.dirname)||void 0===r?void 0:r.call(n,e||this.defaultLogFile))||"",{existsSync:o,mkdirSync:i}=t(this,St,"f")||{};(null==o?void 0:o(a))||null==i||i(a)},kt=function(e,n){if(wt(n)||(n=[n]),!e)throw new Error("output log file is missed");t(this,pt,"m",Dt).call(this,e);const{writeFile:r}=t(this,St,"f")||{};if(e&&r){const t=n.reduce(((t,{prefix:e=[],data:n})=>[...t,[...e,...n.map(JSON.stringify),"\n"].join(" ")]),[]);null==r||r(e,t.join(""),{flag:"a"},Et)}},Ct={value:new Ot},(Ut=xt||(xt={})).ALL="all",Ut.PRODUCTION="production",Ut.DEVELOPMENET="development",Ut.NONE="none",(Wt=Pt||(Pt={})).LOG="LOG",Wt.WARN="WARN",Wt.INFO="INFO",Wt.ERROR="ERROR",Wt.DEBUG="DEBUG";const Nt={date:!0,env:xt.ALL},Lt=(t,e)=>{const{date:n}=e,r=[];if(t.length&&r.unshift(t.map((t=>`[${t.toUpperCase()}]`)).join(" ")),n){const t=new Date;let e;e=vt(n)?mt(t,n):new Date(t).toISOString(),r.unshift(e)}return r},Yt=t=>("all"===t||process.env.NODE_ENV===t)&&void 0!==console,Ft=(t,e)=>{wt(t)||(t=[t]);const{env:n,outputFile:r,output:a,levels:o=[],...i}={...Nt,...e||{}},u=vt(a)?{file:a}:a||{file:r};return{debug:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.DEBUG}]`,...a];Yt(n||xt.ALL)&&console.debug(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.DEBUG)||Ot.cache.push({prefix:s,data:[...e]},u)},info:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.INFO}]`,...a];Yt(n||xt.ALL)&&console.info(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.INFO)||Ot.cache.push({prefix:s,data:[...e]},u)},log:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.LOG}]`,...a];Yt(n||xt.ALL)&&console.log(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.LOG)||Ot.cache.push({prefix:s,data:[...e]},u)},warn:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.WARN}]`,...a],{disableError:l}=i,d=l?console.debug:console.warn;Yt(n||xt.ALL)&&d(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.WARN)||Ot.cache.push({prefix:s,data:[...e]},u)},error:(e,r)=>{const[a,...s]=Lt(t,{...i}),l=[a,`[${Pt.ERROR}]`,...s],{disableThrow:d,ignoreThrow:c,disableError:f}=i,h=f?console.debug:console.error;if(Yt(n||xt.ALL)&&h(...l,e),(null==o?void 0:o.length)&&!o.includes(Pt.ERROR)||Ot.cache.push({prefix:l,data:[e]},u),!1===c||!1===d)throw new Error(e,{cause:r})}}},jt=Ft;exports.loggerWithTags=Ft,exports.withTags=jt;
|
package/lib/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function e(t,e,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,n):a?a.value=n:e.set(t,n),n}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function a(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},o(t)}function i(t){a(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===o(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function u(t,e){a(2,arguments);var n=i(t).getTime(),o=r(e);return new Date(n+o)}var s={};function l(){return s}function d(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function c(t){return c="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},c(t)}function f(t){return a(1,arguments),t instanceof Date||"object"===c(t)&&"[object Date]"===Object.prototype.toString.call(t)}function h(t){if(a(1,arguments),!f(t)&&"number"!=typeof t)return!1;var e=i(t);return!isNaN(Number(e))}function m(t,e){a(2,arguments);var n=r(e);return u(t,-n)}var g=864e5;function v(t){a(1,arguments);var e=1,n=i(t),r=n.getUTCDay(),o=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function w(t){a(1,arguments);var e=i(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=v(r),u=new Date(0);u.setUTCFullYear(n,0,4),u.setUTCHours(0,0,0,0);var s=v(u);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function b(t){a(1,arguments);var e=w(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=v(n);return r}var y=6048e5;function p(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=l(),g=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.weekStartsOn)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==u?u:m.weekStartsOn)&&void 0!==o?o:null===(f=m.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=i(t),w=v.getUTCDay(),b=(w<g?7:0)+w-g;return v.setUTCDate(v.getUTCDate()-b),v.setUTCHours(0,0,0,0),v}function T(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=i(t),g=m.getUTCFullYear(),v=l(),w=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.firstWeekContainsDate)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==u?u:v.firstWeekContainsDate)&&void 0!==o?o:null===(f=v.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==n?n:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(g+1,0,w),b.setUTCHours(0,0,0,0);var y=p(b,e),T=new Date(0);T.setUTCFullYear(g,0,w),T.setUTCHours(0,0,0,0);var C=p(T,e);return m.getTime()>=y.getTime()?g+1:m.getTime()>=C.getTime()?g:g-1}function C(t,e){var n,o,i,u,s,d,c,f;a(1,arguments);var h=l(),m=r(null!==(n=null!==(o=null!==(i=null!==(u=null==e?void 0:e.firstWeekContainsDate)&&void 0!==u?u:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==o?o:null===(c=h.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1),g=T(t,e),v=new Date(0);v.setUTCFullYear(g,0,m),v.setUTCHours(0,0,0,0);var w=p(v,e);return w}var M=6048e5;function S(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var D=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return S("yy"===e?r%100:r,e.length)},k=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):S(n+1,2)},x=function(t,e){return S(t.getUTCDate(),e.length)},U=function(t,e){return S(t.getUTCHours()%12||12,e.length)},P=function(t,e){return S(t.getUTCHours(),e.length)},W=function(t,e){return S(t.getUTCMinutes(),e.length)},E=function(t,e){return S(t.getUTCSeconds(),e.length)},O=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return S(Math.floor(r*Math.pow(10,n-3)),e.length)},N="midnight",L="noon",Y="morning",F="afternoon",j="evening",q="night",A={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return D(t,e)},Y:function(t,e,n,r){var a=T(t,r),o=a>0?a:1-a;return"YY"===e?S(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):S(o,e.length)},R:function(t,e){return S(w(t),e.length)},u:function(t,e){return S(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return S(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return S(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return k(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return S(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var o=function(t,e){a(1,arguments);var n=i(t),r=p(n,e).getTime()-C(n,e).getTime();return Math.round(r/M)+1}(t,r);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):S(o,e.length)},I:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=v(e).getTime()-b(e).getTime();return Math.round(n/y)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):S(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):x(t,e)},D:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/g)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):S(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return S(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return S(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return S(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,a=t.getUTCHours();switch(r=12===a?L:0===a?N:a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,a=t.getUTCHours();switch(r=a>=17?j:a>=12?F:a>=4?Y:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return U(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):P(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):W(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E(t,e)},S:function(t,e){return O(t,e)},X:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return G(a);case"XXXX":case"XX":return H(a);default:return H(a,":")}},x:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return G(a);case"xxxx":case"xx":return H(a);default:return H(a,":")}},O:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},z:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},t:function(t,e,n,r){var a=r._originalDate||t;return S(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return S((r._originalDate||t).getTime(),e.length)}};function R(t,e){var n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;if(0===o)return n+String(a);var i=e||"";return n+String(a)+i+S(o,2)}function G(t,e){return t%60==0?(t>0?"-":"+")+S(Math.abs(t)/60,2):H(t,e)}function H(t,e){var n=e||"",r=t>0?"-":"+",a=Math.abs(t);return r+S(Math.floor(a/60),2)+n+S(a%60,2)}var z=A,B=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Q=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},X={p:Q,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],a=r[1],o=r[2];if(!o)return B(t,e);switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",B(a,e)).replace("{{time}}",Q(o,e))}},I=X,$=["D","DD"],J=["YY","YYYY"];function _(t){return-1!==$.indexOf(t)}function V(t){return-1!==J.indexOf(t)}function K(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Z={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function tt(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var et={date:tt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rt(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var i=t.defaultWidth,u=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[u]||t.values[i]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function at(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;var i,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?it(s,(function(t){return t.test(u)})):ot(s,(function(t){return t.test(u)}));i=t.valueCallback?t.valueCallback(l):l,i=n.valueCallback?n.valueCallback(i):i;var d=e.slice(u.length);return{value:i,rest:d}}}function ot(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function it(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}var ut,st={code:"en-US",formatDistance:function(t,e,n){var r,a=Z[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:et,formatRelative:function(t,e,n,r){return nt[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:rt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:rt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ut={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ut.matchPattern);if(!n)return null;var r=n[0],a=t.match(ut.parsePattern);if(!a)return null;var o=ut.valueCallback?ut.valueCallback(a[0]):a[0];o=e.valueCallback?e.valueCallback(o):o;var i=t.slice(r.length);return{value:o,rest:i}}),era:at({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:at({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:at({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:at({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:at({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,ft=/''/g,ht=/[a-zA-Z]/;function mt(t,e,n){var o,u,s,c,f,g,v,w,b,y,p,T,C,M,S,D,k,x;a(2,arguments);var U=String(e),P=l(),W=null!==(o=null!==(u=null==n?void 0:n.locale)&&void 0!==u?u:P.locale)&&void 0!==o?o:st,E=r(null!==(s=null!==(c=null!==(f=null!==(g=null==n?void 0:n.firstWeekContainsDate)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(w=v.options)||void 0===w?void 0:w.firstWeekContainsDate)&&void 0!==f?f:P.firstWeekContainsDate)&&void 0!==c?c:null===(b=P.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==s?s:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=r(null!==(p=null!==(T=null!==(C=null!==(M=null==n?void 0:n.weekStartsOn)&&void 0!==M?M:null==n||null===(S=n.locale)||void 0===S||null===(D=S.options)||void 0===D?void 0:D.weekStartsOn)&&void 0!==C?C:P.weekStartsOn)&&void 0!==T?T:null===(k=P.locale)||void 0===k||null===(x=k.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!W.localize)throw new RangeError("locale must contain localize property");if(!W.formatLong)throw new RangeError("locale must contain formatLong property");var N=i(t);if(!h(N))throw new RangeError("Invalid time value");var L=d(N),Y=m(N,L),F={firstWeekContainsDate:E,weekStartsOn:O,locale:W,_originalDate:N},j=U.match(dt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,I[e])(t,W.formatLong):t})).join("").match(lt).map((function(r){if("''"===r)return"'";var a=r[0];if("'"===a)return gt(r);var o=z[a];if(o)return null!=n&&n.useAdditionalWeekYearTokens||!V(r)||K(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!_(r)||K(r,e,String(t)),o(Y,r,W.localize,F);if(a.match(ht))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("");return j}function gt(t){var e=t.match(ct);return e?e[1].replace(ft,"'"):t}const vt=t=>"string"==typeof t||"[object String]"===(t=>Object.prototype.toString.call(t))(t),wt=Array.isArray,bt=Number.isInteger,yt=(t,e)=>{let n=null;bt(e)&&(e={wait:e});const{immediate:r,wait:a=100}=e||{};return(...e)=>{n&&clearTimeout(n),r&&!n&&t(...e),n=setTimeout((()=>{t(...e)}),a)}};var pt,Tt,Ct,Mt,St,Dt,kt,xt,Ut,Pt,Wt,Et=()=>{};class Ot{static get cache(){return t(Ot,Tt,"f",Ct)}get defaultLogFile(){return`logs/${mt(Date.now(),"yyyy-MM-dd")}.log`}constructor(){pt.add(this),this.lastWrite=Date.now(),Mt.set(this,void 0),St.set(this,void 0),e(this,Mt,new Map,"f"),Promise.all([import("fs"),import("path")]).then((([t,e])=>{if(!t)return null;const{existsSync:n,mkdirSync:r,writeFile:a}=t,{sep:o,resolve:i,join:u,dirname:s}=e;return{existsSync:n,mkdirSync:r,writeFile:a,join:u,sep:o,resolve:i,dirname:s}})).then((t=>{e(this,St,t,"f")}))}push(e,n){var r;let a=n.file||this.defaultLogFile;if(n.groupByLevel){const t=e.prefix||[],n=null===(r=t.splice(1,1))||void 0===r?void 0:r[0];a=a.replace(/\.log$/,`.${n.replace(/\[|\]/g,"").toLowerCase()}.log`),e.prefix=t}let o=t(this,Mt,"f").get(a);o||(o={Set:new Set,writer:yt((t=>this.flush(t)),1e3)},t(this,Mt,"f").set(a,o));const i=Date.now();o.Set.add(e).size>1e3||i-this.lastWrite>3e4?this.flush(a):o.writer(a)}flush(e){t(this,St,"f")&&t(this,Mt,"f").forEach(((n,r)=>{if(n&&(null===e&&r===this.defaultLogFile||!e||r===e)){const e=Array.from(n.Set);n.Set.clear(),t(this,pt,"m",kt).call(this,r,e),this.lastWrite=Date.now()}}))}}Tt=Ot,Mt=new WeakMap,St=new WeakMap,pt=new WeakSet,Dt=function(e){var n,r;const a=(null===(r=null===(n=t(this,St,"f"))||void 0===n?void 0:n.dirname)||void 0===r?void 0:r.call(n,e||this.defaultLogFile))||"",{existsSync:o,mkdirSync:i}=t(this,St,"f")||{};(null==o?void 0:o(a))||null==i||i(a)},kt=function(e,n){if(wt(n)||(n=[n]),!e)throw new Error("output log file is missed");t(this,pt,"m",Dt).call(this,e);const{writeFile:r}=t(this,St,"f")||{};if(e&&r){const t=n.reduce(((t,{prefix:e=[],data:n})=>[...t,[...e,...n.map(JSON.stringify),"\n"].join(" ")]),[]);null==r||r(e,t.join(""),{flag:"a"},Et)}},Ct={value:new Ot},(Ut=xt||(xt={})).ALL="all",Ut.PRODUCTION="production",Ut.DEVELOPMENET="development",Ut.NONE="none",(Wt=Pt||(Pt={})).LOG="LOG",Wt.WARN="WARN",Wt.INFO="INFO",Wt.ERROR="ERROR",Wt.DEBUG="DEBUG";const Nt={date:!0,env:xt.ALL},Lt=(t,e)=>{const{date:n}=e,r=[];if(t.length&&r.unshift(t.map((t=>`[${t.toUpperCase()}]`)).join(" ")),n){const t=new Date;let e;e=vt(n)?mt(t,n):new Date(t).toISOString(),r.unshift(e)}return r},Yt=t=>("all"===t||process.env.NODE_ENV===t)&&void 0!==console,Ft=(t,e)=>{wt(t)||(t=[t]);const{env:n,outputFile:r,output:a,levels:o=[],...i}={...Nt,...e||{}},u=vt(a)?{file:a}:a||{file:r};return{debug:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.DEBUG}]`,...a];Yt(n||xt.ALL)&&console.debug(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.DEBUG)||Ot.cache.push({prefix:s,data:[...e]},u)},info:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.INFO}]`,...a];Yt(n||xt.ALL)&&console.info(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.INFO)||Ot.cache.push({prefix:s,data:[...e]},u)},log:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.LOG}]`,...a];Yt(n||xt.ALL)&&console.log(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.LOG)||Ot.cache.push({prefix:s,data:[...e]},u)},warn:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.WARN}]`,...a],{disableError:l}=i,d=l?console.debug:console.warn;Yt(n||xt.ALL)&&d(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.WARN)||Ot.cache.push({prefix:s,data:[...e]},u)},error:(e,r)=>{const[a,...s]=Lt(t,{...i}),l=[a,`[${Pt.ERROR}]`,...s],{disableThrow:d,ignoreThrow:c,disableError:f}=i,h=f?console.debug:console.error;if(Yt(n||xt.ALL)&&h(...l,e),(null==o?void 0:o.length)&&!o.includes(Pt.ERROR)||Ot.cache.push({prefix:l,data:[e]},u),!1===c||!1===d)throw new Error(e,{cause:r})}}},jt=Ft;export{Ft as loggerWithTags,jt as withTags};
|
|
1
|
+
function t(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function e(t,e,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,n):a?a.value=n:e.set(t,n),n}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function a(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},o(t)}function i(t){a(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===o(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function u(t,e){a(2,arguments);var n=i(t).getTime(),o=r(e);return new Date(n+o)}var s={};function l(){return s}function d(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function c(t){return c="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)},c(t)}function f(t){return a(1,arguments),t instanceof Date||"object"===c(t)&&"[object Date]"===Object.prototype.toString.call(t)}function h(t){if(a(1,arguments),!f(t)&&"number"!=typeof t)return!1;var e=i(t);return!isNaN(Number(e))}function m(t,e){a(2,arguments);var n=r(e);return u(t,-n)}var g=864e5;function v(t){a(1,arguments);var e=1,n=i(t),r=n.getUTCDay(),o=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function w(t){a(1,arguments);var e=i(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=v(r),u=new Date(0);u.setUTCFullYear(n,0,4),u.setUTCHours(0,0,0,0);var s=v(u);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function b(t){a(1,arguments);var e=w(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=v(n);return r}var y=6048e5;function p(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=l(),g=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.weekStartsOn)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==u?u:m.weekStartsOn)&&void 0!==o?o:null===(f=m.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=i(t),w=v.getUTCDay(),b=(w<g?7:0)+w-g;return v.setUTCDate(v.getUTCDate()-b),v.setUTCHours(0,0,0,0),v}function T(t,e){var n,o,u,s,d,c,f,h;a(1,arguments);var m=i(t),g=m.getUTCFullYear(),v=l(),w=r(null!==(n=null!==(o=null!==(u=null!==(s=null==e?void 0:e.firstWeekContainsDate)&&void 0!==s?s:null==e||null===(d=e.locale)||void 0===d||null===(c=d.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==u?u:v.firstWeekContainsDate)&&void 0!==o?o:null===(f=v.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==n?n:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(g+1,0,w),b.setUTCHours(0,0,0,0);var y=p(b,e),T=new Date(0);T.setUTCFullYear(g,0,w),T.setUTCHours(0,0,0,0);var C=p(T,e);return m.getTime()>=y.getTime()?g+1:m.getTime()>=C.getTime()?g:g-1}function C(t,e){var n,o,i,u,s,d,c,f;a(1,arguments);var h=l(),m=r(null!==(n=null!==(o=null!==(i=null!==(u=null==e?void 0:e.firstWeekContainsDate)&&void 0!==u?u:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==o?o:null===(c=h.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1),g=T(t,e),v=new Date(0);v.setUTCFullYear(g,0,m),v.setUTCHours(0,0,0,0);var w=p(v,e);return w}var M=6048e5;function S(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var D=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return S("yy"===e?r%100:r,e.length)},k=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):S(n+1,2)},x=function(t,e){return S(t.getUTCDate(),e.length)},U=function(t,e){return S(t.getUTCHours()%12||12,e.length)},P=function(t,e){return S(t.getUTCHours(),e.length)},W=function(t,e){return S(t.getUTCMinutes(),e.length)},E=function(t,e){return S(t.getUTCSeconds(),e.length)},O=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return S(Math.floor(r*Math.pow(10,n-3)),e.length)},N="midnight",L="noon",Y="morning",F="afternoon",j="evening",q="night",A={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return D(t,e)},Y:function(t,e,n,r){var a=T(t,r),o=a>0?a:1-a;return"YY"===e?S(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):S(o,e.length)},R:function(t,e){return S(w(t),e.length)},u:function(t,e){return S(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return S(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return S(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return k(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return S(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var o=function(t,e){a(1,arguments);var n=i(t),r=p(n,e).getTime()-C(n,e).getTime();return Math.round(r/M)+1}(t,r);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):S(o,e.length)},I:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=v(e).getTime()-b(e).getTime();return Math.round(n/y)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):S(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):x(t,e)},D:function(t,e,n){var r=function(t){a(1,arguments);var e=i(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/g)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):S(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return S(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var a=t.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return S(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return S(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,a=t.getUTCHours();switch(r=12===a?L:0===a?N:a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,a=t.getUTCHours();switch(r=a>=17?j:a>=12?F:a>=4?Y:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return U(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):P(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):S(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):W(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E(t,e)},S:function(t,e){return O(t,e)},X:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return G(a);case"XXXX":case"XX":return H(a);default:return H(a,":")}},x:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return G(a);case"xxxx":case"xx":return H(a);default:return H(a,":")}},O:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},z:function(t,e,n,r){var a=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+R(a,":");default:return"GMT"+H(a,":")}},t:function(t,e,n,r){var a=r._originalDate||t;return S(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,n,r){return S((r._originalDate||t).getTime(),e.length)}};function R(t,e){var n=t>0?"-":"+",r=Math.abs(t),a=Math.floor(r/60),o=r%60;if(0===o)return n+String(a);var i=e||"";return n+String(a)+i+S(o,2)}function G(t,e){return t%60==0?(t>0?"-":"+")+S(Math.abs(t)/60,2):H(t,e)}function H(t,e){var n=e||"",r=t>0?"-":"+",a=Math.abs(t);return r+S(Math.floor(a/60),2)+n+S(a%60,2)}var z=A,B=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Q=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},X={p:Q,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],a=r[1],o=r[2];if(!o)return B(t,e);switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",B(a,e)).replace("{{time}}",Q(o,e))}},I=X,$=["D","DD"],J=["YY","YYYY"];function _(t){return-1!==$.indexOf(t)}function V(t){return-1!==J.indexOf(t)}function K(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Z={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function tt(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var et={date:tt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rt(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var i=t.defaultWidth,u=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[u]||t.values[i]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function at(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;var i,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?it(s,(function(t){return t.test(u)})):ot(s,(function(t){return t.test(u)}));i=t.valueCallback?t.valueCallback(l):l,i=n.valueCallback?n.valueCallback(i):i;var d=e.slice(u.length);return{value:i,rest:d}}}function ot(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function it(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}var ut,st={code:"en-US",formatDistance:function(t,e,n){var r,a=Z[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:et,formatRelative:function(t,e,n,r){return nt[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:rt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:rt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ut={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ut.matchPattern);if(!n)return null;var r=n[0],a=t.match(ut.parsePattern);if(!a)return null;var o=ut.valueCallback?ut.valueCallback(a[0]):a[0];o=e.valueCallback?e.valueCallback(o):o;var i=t.slice(r.length);return{value:o,rest:i}}),era:at({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:at({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:at({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:at({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:at({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,ft=/''/g,ht=/[a-zA-Z]/;function mt(t,e,n){var o,u,s,c,f,g,v,w,b,y,p,T,C,M,S,D,k,x;a(2,arguments);var U=String(e),P=l(),W=null!==(o=null!==(u=null==n?void 0:n.locale)&&void 0!==u?u:P.locale)&&void 0!==o?o:st,E=r(null!==(s=null!==(c=null!==(f=null!==(g=null==n?void 0:n.firstWeekContainsDate)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(w=v.options)||void 0===w?void 0:w.firstWeekContainsDate)&&void 0!==f?f:P.firstWeekContainsDate)&&void 0!==c?c:null===(b=P.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==s?s:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=r(null!==(p=null!==(T=null!==(C=null!==(M=null==n?void 0:n.weekStartsOn)&&void 0!==M?M:null==n||null===(S=n.locale)||void 0===S||null===(D=S.options)||void 0===D?void 0:D.weekStartsOn)&&void 0!==C?C:P.weekStartsOn)&&void 0!==T?T:null===(k=P.locale)||void 0===k||null===(x=k.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!W.localize)throw new RangeError("locale must contain localize property");if(!W.formatLong)throw new RangeError("locale must contain formatLong property");var N=i(t);if(!h(N))throw new RangeError("Invalid time value");var L=d(N),Y=m(N,L),F={firstWeekContainsDate:E,weekStartsOn:O,locale:W,_originalDate:N},j=U.match(dt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,I[e])(t,W.formatLong):t})).join("").match(lt).map((function(r){if("''"===r)return"'";var a=r[0];if("'"===a)return gt(r);var o=z[a];if(o)return null!=n&&n.useAdditionalWeekYearTokens||!V(r)||K(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!_(r)||K(r,e,String(t)),o(Y,r,W.localize,F);if(a.match(ht))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("");return j}function gt(t){var e=t.match(ct);return e?e[1].replace(ft,"'"):t}const vt=t=>"string"==typeof t||"[object String]"===(t=>Object.prototype.toString.call(t))(t),wt=Array.isArray,bt=Number.isInteger,yt=(t,e)=>{let n=null;bt(e)&&(e={wait:e});const{immediate:r,wait:a=100}=e||{};return(...e)=>{n&&clearTimeout(n),r&&!n&&t(...e),n=setTimeout((()=>{t(...e)}),a)}};var pt,Tt,Ct,Mt,St,Dt,kt,xt,Ut,Pt,Wt,Et=()=>{};class Ot{static get cache(){return t(Ot,Tt,"f",Ct)}get defaultLogFile(){return`logs/${mt(Date.now(),"yyyy-MM-dd")}.log`}constructor(){pt.add(this),this.lastWrite=Date.now(),Mt.set(this,void 0),St.set(this,void 0),e(this,Mt,new Map,"f"),Promise.all([import("fs"),import("path")]).then((([t,e])=>{if(!t)return null;const{existsSync:n,mkdirSync:r,writeFile:a}=t,{sep:o,resolve:i,join:u,dirname:s}=e;return{existsSync:n,mkdirSync:r,writeFile:a,join:u,sep:o,resolve:i,dirname:s}})).catch((()=>null)).then((t=>{e(this,St,t,"f")}))}push(e,n){var r;let a=n.file||this.defaultLogFile;if(n.groupByLevel){const t=e.prefix||[],n=null===(r=t.splice(1,1))||void 0===r?void 0:r[0];a=a.replace(/\.log$/,`.${n.replace(/\[|\]/g,"").toLowerCase()}.log`),e.prefix=t}let o=t(this,Mt,"f").get(a);o||(o={Set:new Set,writer:yt((t=>this.flush(t)),1e3)},t(this,Mt,"f").set(a,o));const i=Date.now();o.Set.add(e).size>1e3||i-this.lastWrite>3e4?this.flush(a):o.writer(a)}flush(e){t(this,St,"f")&&t(this,Mt,"f").forEach(((n,r)=>{if(n&&(null===e&&r===this.defaultLogFile||!e||r===e)){const e=Array.from(n.Set);n.Set.clear(),t(this,pt,"m",kt).call(this,r,e),this.lastWrite=Date.now()}}))}}Tt=Ot,Mt=new WeakMap,St=new WeakMap,pt=new WeakSet,Dt=function(e){var n,r;const a=(null===(r=null===(n=t(this,St,"f"))||void 0===n?void 0:n.dirname)||void 0===r?void 0:r.call(n,e||this.defaultLogFile))||"",{existsSync:o,mkdirSync:i}=t(this,St,"f")||{};(null==o?void 0:o(a))||null==i||i(a)},kt=function(e,n){if(wt(n)||(n=[n]),!e)throw new Error("output log file is missed");t(this,pt,"m",Dt).call(this,e);const{writeFile:r}=t(this,St,"f")||{};if(e&&r){const t=n.reduce(((t,{prefix:e=[],data:n})=>[...t,[...e,...n.map(JSON.stringify),"\n"].join(" ")]),[]);null==r||r(e,t.join(""),{flag:"a"},Et)}},Ct={value:new Ot},(Ut=xt||(xt={})).ALL="all",Ut.PRODUCTION="production",Ut.DEVELOPMENET="development",Ut.NONE="none",(Wt=Pt||(Pt={})).LOG="LOG",Wt.WARN="WARN",Wt.INFO="INFO",Wt.ERROR="ERROR",Wt.DEBUG="DEBUG";const Nt={date:!0,env:xt.ALL},Lt=(t,e)=>{const{date:n}=e,r=[];if(t.length&&r.unshift(t.map((t=>`[${t.toUpperCase()}]`)).join(" ")),n){const t=new Date;let e;e=vt(n)?mt(t,n):new Date(t).toISOString(),r.unshift(e)}return r},Yt=t=>("all"===t||process.env.NODE_ENV===t)&&void 0!==console,Ft=(t,e)=>{wt(t)||(t=[t]);const{env:n,outputFile:r,output:a,levels:o=[],...i}={...Nt,...e||{}},u=vt(a)?{file:a}:a||{file:r};return{debug:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.DEBUG}]`,...a];Yt(n||xt.ALL)&&console.debug(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.DEBUG)||Ot.cache.push({prefix:s,data:[...e]},u)},info:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.INFO}]`,...a];Yt(n||xt.ALL)&&console.info(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.INFO)||Ot.cache.push({prefix:s,data:[...e]},u)},log:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.LOG}]`,...a];Yt(n||xt.ALL)&&console.log(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.LOG)||Ot.cache.push({prefix:s,data:[...e]},u)},warn:(...e)=>{const[r,...a]=Lt(t,{...i}),s=[r,`[${Pt.WARN}]`,...a],{disableError:l}=i,d=l?console.debug:console.warn;Yt(n||xt.ALL)&&d(...s,...e),(null==o?void 0:o.length)&&!o.includes(Pt.WARN)||Ot.cache.push({prefix:s,data:[...e]},u)},error:(e,r)=>{const[a,...s]=Lt(t,{...i}),l=[a,`[${Pt.ERROR}]`,...s],{disableThrow:d,ignoreThrow:c,disableError:f}=i,h=f?console.debug:console.error;if(Yt(n||xt.ALL)&&h(...l,e),(null==o?void 0:o.length)&&!o.includes(Pt.ERROR)||Ot.cache.push({prefix:l,data:[e]},u),!1===c||!1===d)throw new Error(e,{cause:r})}}},jt=Ft;export{Ft as loggerWithTags,jt as withTags};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffchi/logger",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1-alpha.1",
|
|
4
4
|
"main": "lib/index.cjs",
|
|
5
5
|
"module": "lib/index.mjs",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"push": "git commit -m",
|
|
38
38
|
"postpush": "git push",
|
|
39
39
|
"prepublishOnly": "npm run test main && npm run lint",
|
|
40
|
+
"publish": "git push --follow-tags origin develop && npm pushlish",
|
|
40
41
|
"release": "node release"
|
|
41
42
|
},
|
|
42
43
|
"author": "jeffery·chiang",
|