@bereasoftware/time-guard 2.8.0 → 2.9.0
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/dist/adapters/temporal.adapter.d.ts +6 -2
- package/dist/angular/index.cjs +1 -1
- package/dist/angular/index.es.js +6 -3
- package/dist/calendars/index.es.js +1 -1
- package/dist/core-BDQnStek.cjs +1 -0
- package/dist/{core-Dxn1aRFk.js → core-GHK7isoa.js} +29 -15
- package/dist/locales/index.es.js +2 -2
- package/dist/{locales-3Mw99lQ-.js → locales-Dwe5oGoy.js} +1 -1
- package/dist/native/index.cjs +1 -1
- package/dist/native/index.es.js +3 -3
- package/dist/plugins/advanced-format/index.d.ts +8 -0
- package/dist/plugins/advanced-format.cjs +1 -1
- package/dist/plugins/advanced-format.es.js +11 -6
- package/dist/plugins/duration/index.d.ts +6 -0
- package/dist/plugins/duration.cjs +1 -1
- package/dist/plugins/duration.es.js +12 -8
- package/dist/plugins/manager.d.ts +6 -2
- package/dist/plugins/relative-time/index.d.ts +6 -0
- package/dist/plugins/relative-time.cjs +1 -1
- package/dist/plugins/relative-time.es.js +4 -1
- package/dist/qwik/index.cjs +1 -1
- package/dist/qwik/index.es.js +29 -26
- package/dist/qwik.d.ts +5 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.es.js +2 -2
- package/dist/solid/index.cjs +1 -1
- package/dist/solid/index.es.js +12 -10
- package/dist/solid.d.ts +5 -2
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.es.js +2 -2
- package/dist/time-guard.cjs +1 -1
- package/dist/time-guard.es.js +3 -3
- package/dist/time-guard.iife.js +1 -1
- package/dist/time-guard.umd.js +1 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.es.js +33 -33
- package/dist/vue.d.ts +5 -3
- package/package.json +2 -2
- package/dist/core-TqmHKXY1.cjs +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -577,6 +577,16 @@ export interface ITimeGuardPlugin {
|
|
|
577
577
|
name: string;
|
|
578
578
|
version: string;
|
|
579
579
|
install(timeGuard: typeof TimeGuard, config?: unknown): void;
|
|
580
|
+
/**
|
|
581
|
+
* Reverses whatever install() did to `timeGuard`'s prototype/static
|
|
582
|
+
* surface (deleting added members, restoring wrapped ones). Optional
|
|
583
|
+
* for backward compatibility with plugins written before this hook
|
|
584
|
+
* existed — PluginManager.unuse()/clear() only call it if present, so
|
|
585
|
+
* omitting it just means re-registering the same plugin after a clear()
|
|
586
|
+
* stacks a new patch instead of starting clean (the pre-existing
|
|
587
|
+
* behavior, unchanged for plugins that don't implement this).
|
|
588
|
+
*/
|
|
589
|
+
uninstall?(timeGuard: typeof TimeGuard): void;
|
|
580
590
|
}
|
|
581
591
|
/**
|
|
582
592
|
* Factory interface
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../core-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../core-BDQnStek.cjs");let t=require("vue");var n=Symbol(`TimeGuardConfig`),r=new WeakMap,i={mounted(e,t){a(e,t)},updated(e,t){a(e,t)},unmounted(e){let t=r.get(e);t&&(clearInterval(t),r.delete(e))}};function a(t,n){let i=r.get(t);i&&(clearInterval(i),r.delete(t));let a=n.value;if(a==null){t.textContent=``;return}let o=n.arg||`format`,s=t.getAttribute(`data-pattern`)||`YYYY-MM-DD HH:mm:ss`,c=t.getAttribute(`data-locale`)||void 0,l=parseInt(t.getAttribute(`data-interval`)||`60000`,10),u=t.getAttribute(`data-numeric`)||void 0,d=()=>{try{let n=e.i.from(a);if(o===`relative`){let r=e.i.now();t.textContent=n.since(r).humanize({locale:c,numeric:u})}else t.textContent=c?n.locale(c).format(s):n.format(s)}catch{t.textContent=String(a)}};d(),(o===`relative`||t.getAttribute(`data-live`)===`true`)&&r.set(t,setInterval(d,l))}var o={install(e,t){e.provide(n,t),e.directive(`time-guard`,i)}};function s(r,i){let a=(0,t.inject)(n,void 0),o=i??a,s=(0,t.ref)(e.i.from((0,t.toValue)(r),o));return(0,t.watch)([()=>(0,t.toValue)(r),()=>o?.locale,()=>o?.timezone,()=>o?.strict],()=>{s.value=e.i.from((0,t.toValue)(r),o)}),s}function c(r){let i=(0,t.inject)(n,void 0),a=r?.config??i,o=r?.interval??1e3,s=(0,t.ref)(e.i.now(a)),c=setInterval(()=>{s.value=e.i.now(a)},o);return(0,t.onUnmounted)(()=>{clearInterval(c)}),s}function l(r,i){let a=(0,t.inject)(n,void 0),o=i?.interval??6e4,s=i?.locale??a?.locale,c=i?.numeric,l=(0,t.ref)(``),u=()=>{l.value=e.o(r,{locale:s,numeric:c})};u();let d=setInterval(u,o);return(0,t.watch)([()=>r,()=>s,()=>c],()=>{u()},{deep:!0}),(0,t.onUnmounted)(()=>{clearInterval(d)}),l}exports.TimeGuardConfigKey=n,exports.TimeGuardVuePlugin=o,exports.useCurrentTime=c,exports.useRelativeTime=l,exports.useTimeGuard=s,exports.vTimeGuard=i;
|
package/dist/vue/index.es.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
/*! time-guard v2.
|
|
2
|
-
import { i as e, o as t } from "../core-
|
|
3
|
-
import { inject as n, onUnmounted as r, ref as i,
|
|
1
|
+
/*! time-guard v2.9.0 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
|
|
2
|
+
import { i as e, o as t } from "../core-GHK7isoa.js";
|
|
3
|
+
import { inject as n, onUnmounted as r, ref as i, toValue as a, watch as o } from "vue";
|
|
4
4
|
//#region src/vue.ts
|
|
5
|
-
var
|
|
5
|
+
var s = Symbol("TimeGuardConfig"), c = /* @__PURE__ */ new WeakMap(), l = {
|
|
6
6
|
mounted(e, t) {
|
|
7
|
-
|
|
7
|
+
u(e, t);
|
|
8
8
|
},
|
|
9
9
|
updated(e, t) {
|
|
10
|
-
|
|
10
|
+
u(e, t);
|
|
11
11
|
},
|
|
12
12
|
unmounted(e) {
|
|
13
|
-
let t =
|
|
14
|
-
t && (clearInterval(t),
|
|
13
|
+
let t = c.get(e);
|
|
14
|
+
t && (clearInterval(t), c.delete(e));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
let r =
|
|
19
|
-
r && (clearInterval(r),
|
|
17
|
+
function u(t, n) {
|
|
18
|
+
let r = c.get(t);
|
|
19
|
+
r && (clearInterval(r), c.delete(t));
|
|
20
20
|
let i = n.value;
|
|
21
21
|
if (i == null) {
|
|
22
22
|
t.textContent = "";
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
let a = n.arg || "format", o = t.getAttribute("data-pattern") || "YYYY-MM-DD HH:mm:ss",
|
|
25
|
+
let a = n.arg || "format", o = t.getAttribute("data-pattern") || "YYYY-MM-DD HH:mm:ss", s = t.getAttribute("data-locale") || void 0, l = parseInt(t.getAttribute("data-interval") || "60000", 10), u = t.getAttribute("data-numeric") || void 0, d = () => {
|
|
26
26
|
try {
|
|
27
27
|
let n = e.from(i);
|
|
28
28
|
if (a === "relative") {
|
|
29
29
|
let r = e.now();
|
|
30
30
|
t.textContent = n.since(r).humanize({
|
|
31
|
-
locale:
|
|
31
|
+
locale: s,
|
|
32
32
|
numeric: u
|
|
33
33
|
});
|
|
34
|
-
} else t.textContent =
|
|
34
|
+
} else t.textContent = s ? n.locale(s).format(o) : n.format(o);
|
|
35
35
|
} catch {
|
|
36
36
|
t.textContent = String(i);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
d(), (a === "relative" || t.getAttribute("data-live") === "true") &&
|
|
39
|
+
d(), (a === "relative" || t.getAttribute("data-live") === "true") && c.set(t, setInterval(d, l));
|
|
40
40
|
}
|
|
41
|
-
var
|
|
42
|
-
e.provide(
|
|
41
|
+
var d = { install(e, t) {
|
|
42
|
+
e.provide(s, t), e.directive("time-guard", l);
|
|
43
43
|
} };
|
|
44
|
-
function
|
|
45
|
-
let
|
|
46
|
-
return
|
|
47
|
-
() => t,
|
|
48
|
-
() =>
|
|
49
|
-
() =>
|
|
50
|
-
() =>
|
|
44
|
+
function f(t, r) {
|
|
45
|
+
let c = n(s, void 0), l = r ?? c, u = i(e.from(a(t), l));
|
|
46
|
+
return o([
|
|
47
|
+
() => a(t),
|
|
48
|
+
() => l?.locale,
|
|
49
|
+
() => l?.timezone,
|
|
50
|
+
() => l?.strict
|
|
51
51
|
], () => {
|
|
52
|
-
|
|
53
|
-
}),
|
|
52
|
+
u.value = e.from(a(t), l);
|
|
53
|
+
}), u;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let a = n(
|
|
57
|
-
l.value = e.now(
|
|
55
|
+
function p(t) {
|
|
56
|
+
let a = n(s, void 0), o = t?.config ?? a, c = t?.interval ?? 1e3, l = i(e.now(o)), u = setInterval(() => {
|
|
57
|
+
l.value = e.now(o);
|
|
58
58
|
}, c);
|
|
59
59
|
return r(() => {
|
|
60
60
|
clearInterval(u);
|
|
61
61
|
}), l;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let c = n(
|
|
63
|
+
function m(e, a) {
|
|
64
|
+
let c = n(s, void 0), l = a?.interval ?? 6e4, u = a?.locale ?? c?.locale, d = a?.numeric, f = i(""), p = () => {
|
|
65
65
|
f.value = t(e, {
|
|
66
66
|
locale: u,
|
|
67
67
|
numeric: d
|
|
@@ -69,7 +69,7 @@ function p(e, s) {
|
|
|
69
69
|
};
|
|
70
70
|
p();
|
|
71
71
|
let m = setInterval(p, l);
|
|
72
|
-
return
|
|
72
|
+
return o([
|
|
73
73
|
() => e,
|
|
74
74
|
() => u,
|
|
75
75
|
() => d
|
|
@@ -80,4 +80,4 @@ function p(e, s) {
|
|
|
80
80
|
}), f;
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
|
-
export {
|
|
83
|
+
export { s as TimeGuardConfigKey, d as TimeGuardVuePlugin, p as useCurrentTime, m as useRelativeTime, f as useTimeGuard, l as vTimeGuard };
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ref, Plugin, Directive } from 'vue';
|
|
1
|
+
import { MaybeRefOrGetter, Ref, Plugin, Directive } from 'vue';
|
|
2
2
|
import { TimeGuard, ITimeGuardConfig } from './core';
|
|
3
3
|
/**
|
|
4
4
|
* Unique symbol key for injecting TimeGuard global configuration.
|
|
@@ -11,10 +11,12 @@ export declare const vTimeGuard: Directive<HTMLElement, unknown>;
|
|
|
11
11
|
export declare const TimeGuardVuePlugin: Plugin;
|
|
12
12
|
/**
|
|
13
13
|
* Vue Composable to create a reactive Ref of a TimeGuard instance.
|
|
14
|
-
* Automatically updates when input or configuration changes
|
|
14
|
+
* Automatically updates when input or configuration changes — input may be
|
|
15
|
+
* a plain value, a Ref, or a getter (anything toValue() accepts); passing a
|
|
16
|
+
* Ref/getter is what makes this actually reactive to that source changing.
|
|
15
17
|
* Inherits global injected configuration as fallback.
|
|
16
18
|
*/
|
|
17
|
-
export declare function useTimeGuard(input?: unknown
|
|
19
|
+
export declare function useTimeGuard(input?: MaybeRefOrGetter<unknown>, config?: ITimeGuardConfig): Ref<TimeGuard>;
|
|
18
20
|
/**
|
|
19
21
|
* Vue Composable to get a reactive TimeGuard Ref representing the current time.
|
|
20
22
|
* Automatically updates on a specified interval (default: 1000ms).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bereasoftware/time-guard",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/time-guard.cjs",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"not IE 11",
|
|
145
145
|
"> 1%"
|
|
146
146
|
],
|
|
147
|
-
"homepage": "https://
|
|
147
|
+
"homepage": "https://time-guard.bereasoft.com/",
|
|
148
148
|
"scripts": {
|
|
149
149
|
"dev:docs": "pnpm --prefix docs-app install && pnpm --prefix docs-app dev",
|
|
150
150
|
"build:docs": "pnpm --prefix docs-app build",
|
package/dist/core-TqmHKXY1.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./locales-bc-5kDuZ.cjs");var t=null;function n(){if(t)return t;let e=globalThis.Temporal;if(!e)throw Error(`Temporal API not loaded. Make sure @js-temporal/polyfill is imported in your app.`);return t=e,e}var r=class{static parseToPlainDateTime(e){let t=n();return this.isPlainDateTime(e)?e:this.isZonedDateTime(e)?e.toPlainDateTime():this.isPlainDate(e)?e.toPlainDateTime({hour:0,minute:0,second:0,millisecond:0}):this.isPlainTime(e)?t.Now.plainDateTimeISO().withPlainTime(e):typeof e==`object`&&e&&`getTime`in e&&typeof e.getTime==`function`?this.fromDate(e):typeof e==`number`?this.fromUnix(e):typeof e==`string`?this.parseISOString(e):typeof e==`object`&&e?this.fromObject(e):t.Now.plainDateTimeISO()}static fromDate(e){let t=n(),[r,i]=e.toISOString().split(`T`);return t.PlainDateTime.from(r+`T`+i.slice(0,-1))}static fromUnix(e){return this.fromDate(new Date(e))}static parseISOString(e){let t=n();try{if(e.includes(`T`)||/ \d{2}:\d{2}/.test(e)){let n=e.replace(` `,`T`).replace(/(?:Z|[+-]\d{2}:\d{2})$/i,``);return t.PlainDateTime.from(n)}return t.PlainDate.from(e).toPlainDateTime({hour:0})}catch{return t.Now.plainDateTimeISO()}}static fromObject(e){let t=n(),r=e.year||t.Now.plainDateISO().year,i=e.month||1,a=e.day||1,o=e.hour||0,s=e.minute||0,c=e.second||0,l=e.millisecond||0;return t.PlainDateTime.from({year:this.toFiniteInteger(r),month:this.toFiniteInteger(i),day:this.toFiniteInteger(a),hour:this.toFiniteInteger(o),minute:this.toFiniteInteger(s),second:this.toFiniteInteger(c),millisecond:this.toFiniteInteger(l)})}static toDate(e){let t=this.toPlainDateTime(e);return new Date(t.toString())}static toUnix(e){let t=this.toPlainDateTime(e);return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond)}static toISOString(e){return this.toPlainDateTime(e).toString({smallestUnit:`millisecond`})+`Z`}static toPlainDateTime(e){return this.isPlainDateTime(e)?e:e.toPlainDateTime()}static isPlainDateTime(e){return typeof e==`object`&&!!e&&`year`in e&&`month`in e&&`day`in e&&`hour`in e}static isZonedDateTime(e){return typeof e==`object`&&!!e&&`timeZone`in e}static isPlainDate(e){return typeof e==`object`&&!!e&&`year`in e&&`month`in e&&`day`in e&&!(`hour`in e)&&`toPlainDateTime`in e}static isPlainTime(e){return typeof e==`object`&&!!e&&`hour`in e&&!(`year`in e)}static toFiniteInteger(e){let t=Number(e);if(!Number.isFinite(t))throw Error(`Temporal error: Expected finite integer, got ${e}`);return Math.trunc(t)}static validatePlainDateTime(e){for(let t of[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`]){let n=e[t];if(typeof n!=`number`||!Number.isFinite(n)||!Number.isInteger(n))throw typeof console<`u`&&typeof console.error==`function`&&console.error(`TemporalAdapter.validatePlainDateTime: campo inválido`,t,n,e),Error(`Temporal error: Expected finite integer for ${t}, got ${n}`)}}static now(){return n().Now.plainDateTimeISO()}static nowInTimezone(e){return n().Now.zonedDateTimeISO(e)}static compare(e,t){let r=n();if(this.validatePlainDateTime(e),this.validatePlainDateTime(t),r.PlainDateTime&&typeof r.PlainDateTime.compare==`function`)return r.PlainDateTime.compare(e,t);let i=e.toString(),a=t.toString();return i<a?-1:+(i>a)}},i=class{localeManager;constructor(){this.localeManager=e.c.getInstance()}format(e,t,n){let r=this.localeManager.getLocale(n),i=[],a=t.replace(/\[([^\]]+)\]/g,(e,t)=>(i.push(t),`~${i.length-1}~`));a=a.replace(/"([^"]*)"/g,(e,t)=>(i.push(t),`~${i.length-1}~`));let o=a.replace(/Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|SSS/g,t=>{switch(t){case`YYYY`:return String(e.year).padStart(4,`0`);case`YY`:return String(e.year).slice(-2);case`Y`:return String(e.year);case`MMMM`:return r.months[e.month-1];case`MMM`:return r.monthsShort[e.month-1];case`MM`:return String(e.month).padStart(2,`0`);case`M`:return String(e.month);case`DD`:return String(e.day).padStart(2,`0`);case`D`:return String(e.day);case`dddd`:return r.weekdays[e.dayOfWeek%7];case`ddd`:return r.weekdaysShort[e.dayOfWeek%7];case`dd`:return r.weekdaysMin[e.dayOfWeek%7];case`d`:return String(e.dayOfWeek);case`HH`:return String(e.hour).padStart(2,`0`);case`H`:return String(e.hour);case`hh`:return String(e.hour%12||12).padStart(2,`0`);case`h`:return String(e.hour%12||12);case`mm`:return String(e.minute).padStart(2,`0`);case`m`:return String(e.minute);case`ss`:return String(e.second).padStart(2,`0`);case`s`:return String(e.second);case`SSS`:return String(e.millisecond).padStart(3,`0`);case`a`:case`A`:let n=r.meridiem||{am:`am`,pm:`pm`},i=e.hour>=12?n.pm:n.am;return t===`a`?i.toLowerCase():i.toUpperCase();default:return t}});return i.forEach((e,t)=>{o=o.replace(`~${t}~`,e)}),o}getPreset(e){let t={iso:`YYYY-MM-DDTHH:mm:ss.SSSZ`,date:`YYYY-MM-DD`,time:`HH:mm:ss`,datetime:`YYYY-MM-DD HH:mm:ss`,rfc2822:`ddd, DD MMM YYYY HH:mm:ss Z`,rfc3339:`YYYY-MM-DDTHH:mm:ssZ`,utc:`YYYY-MM-DDTHH:mm:ss[Z]`};return t[e]||t.iso}formatPreset(e,t,n){let r=this.getPreset(t);return this.format(e,r,n)}},a={en:{year:[`year`,`years`],month:[`month`,`months`],week:[`week`,`weeks`],day:[`day`,`days`],hour:[`hour`,`hours`],minute:[`minute`,`minutes`],second:[`second`,`seconds`],millisecond:[`millisecond`,`milliseconds`]},es:{year:[`año`,`años`],month:[`mes`,`meses`],week:[`semana`,`semanas`],day:[`día`,`días`],hour:[`hora`,`horas`],minute:[`minuto`,`minutos`],second:[`segundo`,`segundos`],millisecond:[`milisegundo`,`milisegundos`]},fr:{year:[`année`,`années`],month:[`mois`,`mois`],week:[`semaine`,`semaines`],day:[`jour`,`jours`],hour:[`heure`,`heures`],minute:[`minute`,`minutes`],second:[`seconde`,`secondes`],millisecond:[`milliseconde`,`millisecondes`]}},o={en:`and`,es:`y`,fr:`et`,de:`und`,it:`e`,pt:`e`};function s(e,t,n){return((a[t]||a.en)[e]||[e,e+`s`])[n===1?0:1]}function c(e){return o[e]||`and`}function l(e,t){if(e.length===0)return``;if(e.length===1)return e[0];let n=c(t);return e.length===2?`${e[0]} ${n} ${e[1]}`:e.slice(0,-1).join(`, `)+` ${n} ${e[e.length-1]}`}function u(e){return{en:`0 seconds`,es:`0 segundos`,fr:`0 secondes`}[e]||`0 seconds`}var d=class{id=`gregory`;name=`Gregorian Calendar`;locale=`en`;monthNames=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];monthNamesShort=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];weekdayNames=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];weekdayNamesShort=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];getMonthName(e,t=!1){return(t?this.monthNamesShort:this.monthNames)[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?this.weekdayNamesShort:this.weekdayNames)[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}daysInMonth(e,t){return t===2&&this.isLeapYear(e)?29:[31,28,31,30,31,30,31,31,30,31,30,31][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?366:365}},f=class e{static instance;calendars=new Map;defaultCalendar=`gregory`;constructor(){this.register(new d)}static getInstance(){return e.instance||=new e,e.instance}register(e){this.calendars.has(e.id)&&console.warn(`Calendar "${e.id}" is already registered. Overwriting...`),this.calendars.set(e.id,e)}get(e){return this.calendars.get(e)}list(){return Array.from(this.calendars.keys())}setDefault(e){if(!this.calendars.has(e)){console.warn(`Calendar "${e}" is not registered. Keeping "${this.defaultCalendar}" as default.`);return}this.defaultCalendar=e}getDefault(){let e=this.calendars.get(this.defaultCalendar);if(!e)throw Error(`Default calendar '${this.defaultCalendar}' not found`);return e}},p=f.getInstance(),m=class e{static instance;plugins=new Map;static getInstance(){return e.instance||=new e,e.instance}static use(t,n,r){e.getInstance().register(t,n,r)}static useMultiple(t,n,r){let i=e.getInstance();t.forEach(e=>i.register(e,n,r))}static getPlugin(t){return e.getInstance().plugins.get(t)}static hasPlugin(t){return e.getInstance().plugins.has(t)}static listPlugins(){let t=e.getInstance();return Array.from(t.plugins.keys())}static unuse(t){return e.getInstance().plugins.delete(t)}static clear(){e.getInstance().plugins.clear()}register(e,t,n){if(this.plugins.has(e.name)){console.warn(`Plugin "${e.name}" is already registered. Skipping...`);return}try{e.install(t,n),this.plugins.set(e.name,e),process.env.NODE_ENV!==`production`&&console.warn(`Plugin "${e.name}" v${e.version} registered successfully`)}catch(t){throw console.error(`Failed to register plugin "${e.name}":`,t),Error(`Failed to register plugin "${e.name}": ${t instanceof Error?t.message:String(t)}`)}}},h=1e3,g=h*60,_=g*60,v=_*24,y=v*7,b=365.25,x=b/12*v,S=b*v,C=` days`;function w(e){return(e.years||0)*S+(e.months||0)*x+(e.weeks||0)*y+(e.days||0)*v+(e.hours||0)*_+(e.minutes||0)*g+(e.seconds||0)*h+(e.milliseconds||0)}var T=class{_value;_tg1;_tg2;_mode;_breakdownData;_locale;constructor(e,t,n,r=`exact`,i,a){this._value=e,this._tg1=t,this._tg2=n,this._mode=r,this._breakdownData=i||null,this._locale=a||`en`}as(e){return this._tg1.diff(this._tg2,e)}breakdown(){return this._breakdownData}format(e){let t=e||this._locale;if(!this._breakdownData)return`${Math.abs(this._tg1.diff(this._tg2,`day`))}${C}`;let n=[],r=this._breakdownData;return r.years!==0&&n.push(`${r.years} ${s(`year`,t,r.years)}`),r.months!==0&&n.push(`${r.months} ${s(`month`,t,r.months)}`),r.weeks!==0&&n.push(`${r.weeks} ${s(`week`,t,r.weeks)}`),r.days!==0&&n.push(`${r.days} ${s(`day`,t,r.days)}`),r.hours!==0&&n.push(`${r.hours} ${s(`hour`,t,r.hours)}`),r.minutes!==0&&n.push(`${r.minutes} ${s(`minute`,t,r.minutes)}`),r.seconds!==0&&n.push(`${r.seconds} ${s(`second`,t,r.seconds)}`),n.length===0?u(t):l(n,t)}getMode(){return this._mode}valueOf(){return this._value}toString(){return this._mode===`calendar`&&this._breakdownData?this.format():this._value.toString()}toJSON(){return this._value}},E=class{years;months;weeks;days;hours;minutes;seconds;milliseconds;_locale;_startDate;_endDate;_steps=[];_mode=`exact`;_leapYearFlags=[];_calculationTimeMs=0;constructor(e,t=`en`,n){this.years=e.years,this.months=e.months,this.weeks=e.weeks,this.days=e.days,this.hours=e.hours,this.minutes=e.minutes,this.seconds=e.seconds,this.milliseconds=e.milliseconds,this._locale=t,n&&(this._startDate=n.startDate,this._endDate=n.endDate,this._steps=n.steps||[],this._mode=n.mode||`exact`,this._leapYearFlags=n.leapYearFlags||[],this._calculationTimeMs=n.calculationTimeMs||0)}humanize(e){let t=e?.locale||this._locale,n=e?.fullBreakdown??!1,r=e?.numeric??`always`,i=[{unit:`year`,value:this.years},{unit:`month`,value:this.months},{unit:`week`,value:this.weeks},{unit:`day`,value:this.days},{unit:`hour`,value:this.hours},{unit:`minute`,value:this.minutes},{unit:`second`,value:this.seconds},{unit:`millisecond`,value:this.milliseconds}].filter(e=>e.value!==0);if(i.length===0)return`0 seconds`;if(!n||i.length===1){let e=i[0];try{return new Intl.RelativeTimeFormat(t,{numeric:r,style:`long`}).format(e.value,e.unit)}catch{let n=Math.abs(e.value);return`${n} ${this.pluralizeUnit(e.unit,n,t)}`}}return l(i.map(e=>{let n=Math.abs(e.value);return`${n} ${s(e.unit,t,n)}`}),t)}total(e){let t=0;switch(t+=this.years*S,t+=this.months*x,t+=this.weeks*y,t+=this.days*v,t+=this.hours*_,t+=this.minutes*g,t+=this.seconds*h,t+=this.milliseconds,e){case`millisecond`:return t;case`second`:return t/h;case`minute`:return t/g;case`hour`:return t/_;case`day`:return t/v;case`week`:return t/y;case`month`:return t/x;case`year`:return t/S;case`microsecond`:return t*1e3;case`nanosecond`:return t*1e6;default:throw Error(`Unsupported unit: ${e}`)}}toString(){return this.humanize({fullBreakdown:!0})}toJSON(){return{years:this.years,months:this.months,weeks:this.weeks,days:this.days,hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds}}explain(){let e=[...this._steps];e.length===0&&(e=this.generateExplanationSteps());let t=[];if(this._startDate&&this._endDate&&t.push(`Calculated duration from ${this._startDate} to ${this._endDate}`),this._leapYearFlags&&this._leapYearFlags.length>0){let e=this._leapYearFlags.filter(e=>e.isLeap).map(e=>e.year);e.length>0&&t.push(`Leap year(s) detected: ${e.join(`, `)}`)}return t.push(`Breakdown: ${this.years} year(s), ${this.months} month(s), ${this.days} day(s)`),t.push(`Mode: ${this._mode} calculation`),{input:this._startDate&&this._endDate?[this._startDate,this._endDate]:[],steps:e,breakdown:{years:this.years,months:this.months,weeks:this.weeks,days:this.days,hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds},mode:this._mode,explanation:t.join(`. `),locale:this._locale,leapYearFlags:this._leapYearFlags.length>0?this._leapYearFlags:void 0,metadata:{calculationTimeMs:this._calculationTimeMs,precision:`day`}}}generateExplanationSteps(){let e=[];if(this._startDate&&this._endDate?e.push(`Input: ${this._startDate} to ${this._endDate}`):e.push(`Duration calculation started`),this.years>0&&e.push(`Years: ${this.years}`),this.months>0&&e.push(`Months: ${this.months}`),this.weeks>0&&e.push(`Weeks: ${this.weeks}`),this.days>0&&e.push(`Days: ${this.days}`),this.hours>0&&e.push(`Hours: ${this.hours}`),this.minutes>0&&e.push(`Minutes: ${this.minutes}`),this.seconds>0&&e.push(`Seconds: ${this.seconds}`),this.milliseconds>0&&e.push(`Milliseconds: ${this.milliseconds}`),this._leapYearFlags&&this._leapYearFlags.length>0)for(let t of this._leapYearFlags)t.isLeap&&e.push(`${t.year} is a leap year (February has ${t.daysInFebruary} days)`);let t=[this.years>0?`${this.years}y`:``,this.months>0?`${this.months}m`:``,this.days>0?`${this.days}d`:``,this.hours>0?`${this.hours}h`:``,this.minutes>0?`${this.minutes}min`:``,this.seconds>0?`${this.seconds}s`:``].filter(e=>e.length>0).join(` `);return e.push(`Total: ${t||`0`}`),e}pluralizeUnit(e,t,n){return s(e,n,t)}},D=class e{_start;_end;_ordered;constructor(e,t){this._start=e,this._end=t}get start(){return this._start}get end(){return this._end}getOrdered(){if(!this._ordered){let e=r.toPlainDateTime(this._start.toTemporal()),t=r.toPlainDateTime(this._end.toTemporal());this._ordered=r.compare(e,t)<=0?[e,t]:[t,e]}return this._ordered}toDuration(){return O.between(this._start,this._end)}inMonths(){return this.toDuration().total(`month`)}humanize(e){return this.toDuration().humanize(e)}in(e){return this.toDuration().total(e)}contains(e){let t=e instanceof O?e:new O(e),n=r.toPlainDateTime(t.toTemporal()),[i,a]=this.getOrdered();return r.compare(n,i)>=0&&r.compare(n,a)<=0}overlaps(e){let[t,n]=this.getOrdered(),[i,a]=e.getOrdered();return r.compare(t,a)<=0&&r.compare(i,n)<=0}intersect(t){if(!this.overlaps(t))return null;let[n,i]=this.getOrdered(),[a,o]=t.getOrdered(),s=r.compare(n,a)>=0?n:a,c=r.compare(i,o)<=0?i:o;return new e(O.fromTemporal(s,{locale:this._start.locale()}),O.fromTemporal(c,{locale:this._end.locale()}))}union(t){let[n,i]=this.getOrdered(),[a,o]=t.getOrdered(),s=r.compare(n,a)<=0?n:a,c=r.compare(i,o)>=0?i:o;return new e(O.fromTemporal(s,{locale:this._start.locale()}),O.fromTemporal(c,{locale:this._end.locale()}))}},O=class e{temporal;config;formatterInstance;static holidays=new Set;static registerHolidays(t){t.forEach(t=>{try{let n=new e(t);this.holidays.add(n.format(`YYYY-MM-DD`))}catch{}})}static clearHolidays(){this.holidays.clear()}static getRegisteredHolidays(){return Array.from(this.holidays).sort()}static ZERO_DURATION={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0};static isLeapYearValue(e){return e%4==0&&e%100!=0||e%400==0}static toDurationParts(e){return{years:Math.floor(e.years||0),months:Math.floor(e.months||0),weeks:Math.floor(e.weeks||0),days:Math.floor(e.days||0),hours:Math.floor(e.hours||0),minutes:Math.floor(e.minutes||0),seconds:Math.floor(e.seconds||0),milliseconds:Math.floor(e.milliseconds||0)}}constructor(t,n){this.formatterInstance=new i,this.config={locale:n?.locale||`en`,timezone:n?.timezone||`UTC`,strict:n?.strict??!1};let a=t instanceof e?t.toTemporal():t;if(this.temporal=r.parseToPlainDateTime(a),this.config.timezone&&this.config.timezone!==`UTC`)try{let e=this.temporal.toZonedDateTime(this.config.timezone);this.temporal=e}catch{}}static now(t){return new e(void 0,t)}static from(t,n){return new e(t,n)}static fromTemporal(t,n){let r=new e(void 0,n);return r.temporal=t,r}static between(e,t){let n=r.toPlainDateTime(e.temporal),i=r.toPlainDateTime(t.temporal),[a,o]=r.compare(n,i)<=0?[e,t]:[t,e];return a.until(o)}static range(t,n){return new D(t instanceof e?t:new e(t),n instanceof e?n:new e(n))}toTemporal(){return this.temporal}toDate(){return r.toDate(this.temporal)}toISOString(){return r.toISOString(this.temporal)}valueOf(){return r.toUnix(this.temporal)}unix(){return Math.floor(this.valueOf()/1e3)}toJSON(){return this.toISOString()}[Symbol.toPrimitive](e){return e===`number`?this.valueOf():this.toISOString()}toString(){return this.format(`YYYY-MM-DD HH:mm:ss`)}locale(e){if(e===void 0)return this.config.locale;let t=this.clone();return t.config.locale=e,t}timezone(e){if(e===void 0)return this.config.timezone;let t=this.clone();t.config.timezone=e;try{t.temporal=r.toPlainDateTime(t.temporal).toZonedDateTime(e)}catch{}return t}format(e){let t=r.toPlainDateTime(this.temporal),n=[`iso`,`date`,`time`,`datetime`,`rfc2822`,`rfc3339`,`utc`].includes(e)?this.formatterInstance.getPreset(e):e;return this.formatterInstance.format(t,n,this.config.locale)}get(e){let t=r.toPlainDateTime(this.temporal);return e===`week`?t.weekOfYear:t[{year:`year`,month:`month`,day:`day`,hour:`hour`,minute:`minute`,second:`second`,millisecond:`millisecond`,microsecond:`microsecond`,nanosecond:`nanosecond`}[e]]}static UNIT_TO_PLURAL={year:`years`,month:`months`,week:`weeks`,day:`days`,hour:`hours`,minute:`minutes`,second:`seconds`,millisecond:`milliseconds`,microsecond:`microseconds`,nanosecond:`nanoseconds`,years:`years`,months:`months`,weeks:`weeks`,days:`days`,hours:`hours`,minutes:`minutes`,seconds:`seconds`,milliseconds:`milliseconds`,microseconds:`microseconds`,nanoseconds:`nanoseconds`};add(t){let n=r.toPlainDateTime(this.temporal),i={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},a=!1;return Object.entries(t).forEach(([t,n])=>{if(n!==void 0&&n!==0){let r=Number(n);if(Number.isFinite(r)){let n=e.UNIT_TO_PLURAL[t]||t;i[n]=Math.trunc(r),a=!0}}}),a?(n=n.add(i),e.fromTemporal(n,this.config)):this}subtract(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]=n?-n:0}),this.add(t)}diff(e,t){let n=r.toPlainDateTime(this.temporal),i=r.toPlainDateTime(e.temporal),a={year:`years`,month:`months`,week:`weeks`,day:`days`,hour:`hours`,minute:`minutes`,second:`seconds`,millisecond:`milliseconds`,microsecond:`microseconds`,nanosecond:`nanoseconds`};if(typeof t==`string`){let e=t,r=a[e],o=n.since(i,{largestUnit:e,smallestUnit:e});return Math.round(o[r]||0)}let o=t||{},s=o.mode||`exact`,c=o.unit||`millisecond`,l=o.locale||this.config.locale;if(s===`exact`){let r=a[c],o=n.since(i,{smallestUnit:c}),u=Math.round(o[r]||0);if(t===void 0||typeof t==`object`){let t=w(o);return new T(Math.round(t),this,e,s,void 0,l)}return u}if(s===`calendar`){let t=r.compare(n,i)<0,a=t?i:n,o=t?n:i,c=a.since(o,{largestUnit:`month`,smallestUnit:`millisecond`}),u={years:Math.floor(c.years||0),months:Math.floor(c.months||0),weeks:Math.floor(c.weeks||0),days:Math.floor(c.days||0),hours:Math.floor(c.hours||0),minutes:Math.floor(c.minutes||0),seconds:Math.floor(c.seconds||0),milliseconds:Math.floor(c.milliseconds||0)},d=w(c);return new T(Math.round(d),this,e,s,u,l)}let u=w(n.since(i,{smallestUnit:`millisecond`}));return new T(Math.round(u),this,e,s,void 0,l)}isBefore(e){let t=r.toPlainDateTime(this.temporal),n=r.toPlainDateTime(e.temporal);return r.compare(t,n)<0}isAfter(e){let t=r.toPlainDateTime(this.temporal),n=r.toPlainDateTime(e.temporal);return r.compare(t,n)>0}isSame(e,t){if(!t)return r.compare(r.toPlainDateTime(this.temporal),r.toPlainDateTime(e.temporal))===0;let n=r.toPlainDateTime(this.temporal),i=r.toPlainDateTime(e.temporal);switch(t){case`year`:return n.year===i.year;case`month`:return n.year===i.year&&n.month===i.month;case`day`:return n.year===i.year&&n.month===i.month&&n.day===i.day;case`hour`:return n.year===i.year&&n.month===i.month&&n.day===i.day&&n.hour===i.hour;case`minute`:return n.year===i.year&&n.month===i.month&&n.day===i.day&&n.hour===i.hour&&n.minute===i.minute;case`second`:return n.year===i.year&&n.month===i.month&&n.day===i.day&&n.hour===i.hour&&n.minute===i.minute&&n.second===i.second;default:return!1}}isBetween(e,t,n,i=`[]`){let a=r.toPlainDateTime(this.temporal),o=r.toPlainDateTime(e.temporal),s=r.toPlainDateTime(t.temporal),c=!0,l=!0;if(n){let e=this.clone().startOf(n),t=this.clone().endOf(n),i=r.toPlainDateTime(e.temporal),a=r.toPlainDateTime(t.temporal);c=r.compare(i,o)>=0,l=r.compare(a,s)<=0}else c=r.compare(a,o)>=0,l=r.compare(a,s)<=0;let u=i[0]===`[`,d=i[1]===`]`;return(u?c:r.compare(a,o)>0)&&(d?l:r.compare(a,s)<0)}clone(){return e.fromTemporal(this.temporal,this.config)}startOf(t){let n=r.toPlainDateTime(this.temporal),i={};switch(t){case`year`:i.month=1,i.day=1,i.hour=0,i.minute=0,i.second=0,i.millisecond=0;break;case`month`:i.day=1,i.hour=0,i.minute=0,i.second=0,i.millisecond=0;break;case`week`:case`day`:i.hour=0,i.minute=0,i.second=0,i.millisecond=0;break;case`hour`:i.minute=0,i.second=0,i.millisecond=0;break;case`minute`:i.second=0,i.millisecond=0;break;case`second`:i.millisecond=0;break}let a=n.with(i);return e.fromTemporal(a,this.config)}endOf(e){return this.startOf(e).add({[e]:1}).subtract({millisecond:1})}set(t){let n=r.toPlainDateTime(this.temporal).with(t);return e.fromTemporal(n,this.config)}year(){return r.toPlainDateTime(this.temporal).year}month(){return r.toPlainDateTime(this.temporal).month}day(){return r.toPlainDateTime(this.temporal).day}hour(){return r.toPlainDateTime(this.temporal).hour}minute(){return r.toPlainDateTime(this.temporal).minute}second(){return r.toPlainDateTime(this.temporal).second}millisecond(){return r.toPlainDateTime(this.temporal).millisecond}dayOfWeek(){return r.toPlainDateTime(this.temporal).dayOfWeek}dayOfYear(){return r.toPlainDateTime(this.temporal).dayOfYear}weekOfYear(){return r.toPlainDateTime(this.temporal).weekOfYear}daysInMonth(){return r.toPlainDateTime(this.temporal).add({months:1}).with({day:1}).subtract({days:1}).day}daysInYear(){let t=this.year();return e.isLeapYearValue(t)?366:365}inLeapYear(){let t=r.toPlainDateTime(this.temporal);return e.isLeapYearValue(t.year)}until(t,n){let i=r.toPlainDateTime(this.temporal),a=r.toPlainDateTime(t.temporal),o=performance.now();try{let t={largestUnit:n?.largestUnit||`year`};n?.smallestUnit&&(t.smallestUnit=n.smallestUnit);let r=a.since(i,t),s=e.toDurationParts(r),c=i.year,l=a.year,u=[];for(let t=c;t<=l;t++){let n=e.isLeapYearValue(t);u.push({year:t,isLeap:n,daysInFebruary:n?29:28})}let d=this.generateUntilSteps(i,a,s,u),f=performance.now()-o;return new E(s,this.config.locale,{startDate:i.toString(),endDate:a.toString(),steps:d,mode:`exact`,leapYearFlags:u.filter(e=>e.isLeap),calculationTimeMs:f})}catch{return new E(e.ZERO_DURATION,this.config.locale,{startDate:i.toString(),endDate:a.toString(),steps:[`Calculation failed, returning zero duration`],mode:`estimated`})}}generateUntilSteps(t,n,r,i){let a=[];a.push(`Parsed dates: ${t.year}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)} (day ${t.dayOfYear} of ${e.isLeapYearValue(t.year)?366:365})`),a.push(`to ${n.year}-${String(n.month).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)} (day ${n.dayOfYear} of ${e.isLeapYearValue(n.year)?366:365})`);let o=i.filter(e=>e.isLeap);if(o.length>0)for(let e of o)a.push(`${e.year} is a leap year (February has ${e.daysInFebruary} days)`);if(r.years>0&&a.push(`Years: ${r.years}`),r.months>0&&a.push(`Months: ${r.months}`),r.days>0&&a.push(`Days: ${r.days}`),r.hours>0||r.minutes>0||r.seconds>0){let e=[];r.hours>0&&e.push(`${r.hours}h`),r.minutes>0&&e.push(`${r.minutes}m`),r.seconds>0&&e.push(`${r.seconds}s`),a.push(`Time: ${e.join(` `)}`)}let s=r.years*365.25+r.months*30.4375+r.days+r.hours/24;return a.push(`Total: approximately ${s.toFixed(2)} days`),a}round(e={}){let{smallestUnit:t=`millisecond`,roundingMode:n=`halfExpand`}=e,i=r.toPlainDateTime(this.temporal),a={year:i.year,month:i.month,day:i.day,hour:i.hour,minute:i.minute,second:i.second,millisecond:i.millisecond,microsecond:i.microsecond||0,nanosecond:i.nanosecond||0,week:0},o=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],s=o.indexOf(t);if(s===-1)return this.clone();let c={};for(let e=0;e<s;e++){let t=o[e];c[t]=a[t]}let l=o[s],u=a[l];s+1<o.length&&((e,t)=>{switch(e){case`ceil`:return t>0;case`floor`:case`trunc`:return!1;case`halfExpand`:case`halfFloor`:case`halfCeil`:return t>=5;case`expand`:return t>0;default:return t>=5}})(n,a[o[s+1]])&&(u+=1),c[l]=u;for(let e=s+1;e<o.length;e++)c[o[e]]=0;return this.set(c)}toPlainDate(){let e=r.toPlainDateTime(this.temporal);return{year:e.year,month:e.month,day:e.day,dayOfWeek:e.dayOfWeek}}toPlainTime(){let e=r.toPlainDateTime(this.temporal);return{hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond}}withDate(e,t,n){return this.set({year:e,month:t,day:n})}withTime(e,t=0,n=0,r=0){return this.set({hour:e,minute:t,second:n,millisecond:r})}getOffset(){return this.temporal?.offset||`Z`}getOffsetNanoseconds(){return this.temporal?.offsetNanoseconds||0}getTimeZoneId(){return this.temporal?.timeZoneId||null}startOfDay(){return this.startOf(`day`)}endOfDay(){return this.endOf(`day`)}since(t,n){let i=r.toPlainDateTime(this.temporal),a=r.toPlainDateTime(t.temporal),o=performance.now();try{let t={largestUnit:n?.largestUnit||`year`};n?.smallestUnit&&(t.smallestUnit=n.smallestUnit);let r=i.since(a,t),s=e.toDurationParts(r),c=a.year,l=i.year,u=[];for(let t=c;t<=l;t++){let n=e.isLeapYearValue(t);u.push({year:t,isLeap:n,daysInFebruary:n?29:28})}let d=this.generateUntilSteps(a,i,s,u),f=performance.now()-o;return new E(s,this.config.locale,{startDate:a.toString(),endDate:i.toString(),steps:d,mode:`exact`,leapYearFlags:u.filter(e=>e.isLeap),calculationTimeMs:f})}catch{return new E(e.ZERO_DURATION,this.config.locale,{startDate:a.toString(),endDate:i.toString(),steps:[`Calculation failed, returning zero duration`],mode:`estimated`})}}toDurationString(t){let n=t?this.until(t):this.until(e.now()),r=[];n.years&&r.push(`${n.years}Y`),n.months&&r.push(`${n.months}M`),n.days&&r.push(`${n.days}D`);let i=[];n.hours&&i.push(`${n.hours}H`),n.minutes&&i.push(`${n.minutes}M`),n.seconds&&i.push(`${n.seconds}S`);let a=`P${r.join(``)}${i.length>0?`T`+i.join(``):``}`;return a===`P`?`PT0S`:a}isPast(){return this.isBefore(e.now())}isFuture(){return this.isAfter(e.now())}isToday(){return this.isSame(e.now(),`day`)}isTomorrow(){return this.isSame(e.now().add({day:1}),`day`)}isYesterday(){return this.isSame(e.now().subtract({day:1}),`day`)}isWeekend(){let e=r.toPlainDateTime(this.temporal);return e.dayOfWeek===6||e.dayOfWeek===7}isHoliday(){let t=String(this.get(`year`)).padStart(4,`0`),n=String(this.get(`month`)).padStart(2,`0`),r=String(this.get(`day`)).padStart(2,`0`);return e.holidays.has(`${t}-${n}-${r}`)}isBusinessDay(){return!this.isWeekend()&&!this.isHoliday()}addBusinessDays(e){let t=Math.trunc(e);if(!Number.isFinite(t)||t===0)return this;let n=this.clone(),r=Math.abs(t),i=t>0?1:-1;for(;r>0;)n=n.add({day:i}),n.isBusinessDay()&&r--;return n}subtractBusinessDays(e){return this.addBusinessDays(-e)}},k=1e3,A=6e4;function j(e,t){let n=O.from(e),r=O.now();return n.since(r).humanize(t)}function M(e,t,n){return new D(O.from(e,n),O.from(t,n))}function N(e,t){return new O(e,t)}var P=`2.8.0`;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return m}});
|