@fewangsit/wangsvue-fats 1.0.1-alpha.50 → 1.0.1-alpha.51

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.
@@ -0,0 +1,477 @@
1
+ import { f, D as c } from "./datetime.es.js";
2
+ import { D as h } from "./duration.es.js";
3
+ import { S } from "./settings.es.js";
4
+ import { I as v, d as p } from "./errors.es.js";
5
+ import { I as V } from "./impl/invalid.es.js";
6
+ import { F as D } from "./impl/formatter.es.js";
7
+ import { D as O } from "./impl/formats.es.js";
8
+ const d = "Invalid Interval";
9
+ function I(m, t) {
10
+ return !m || !m.isValid ? a.invalid("missing or invalid start") : !t || !t.isValid ? a.invalid("missing or invalid end") : t < m ? a.invalid(
11
+ "end before start",
12
+ `The end of an interval must be after its start, but you had start=${m.toISO()} and end=${t.toISO()}`
13
+ ) : null;
14
+ }
15
+ class a {
16
+ /**
17
+ * @private
18
+ */
19
+ constructor(t) {
20
+ this.s = t.start, this.e = t.end, this.invalid = t.invalid || null, this.isLuxonInterval = !0;
21
+ }
22
+ /**
23
+ * Create an invalid Interval.
24
+ * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent
25
+ * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information
26
+ * @return {Interval}
27
+ */
28
+ static invalid(t, i = null) {
29
+ if (!t)
30
+ throw new v("need to specify a reason the Interval is invalid");
31
+ const e = t instanceof V ? t : new V(t, i);
32
+ if (S.throwOnInvalid)
33
+ throw new p(e);
34
+ return new a({ invalid: e });
35
+ }
36
+ /**
37
+ * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.
38
+ * @param {DateTime|Date|Object} start
39
+ * @param {DateTime|Date|Object} end
40
+ * @return {Interval}
41
+ */
42
+ static fromDateTimes(t, i) {
43
+ const e = f(t), s = f(i), r = I(e, s);
44
+ return r ?? new a({
45
+ start: e,
46
+ end: s
47
+ });
48
+ }
49
+ /**
50
+ * Create an Interval from a start DateTime and a Duration to extend to.
51
+ * @param {DateTime|Date|Object} start
52
+ * @param {Duration|Object|number} duration - the length of the Interval.
53
+ * @return {Interval}
54
+ */
55
+ static after(t, i) {
56
+ const e = h.fromDurationLike(i), s = f(t);
57
+ return a.fromDateTimes(s, s.plus(e));
58
+ }
59
+ /**
60
+ * Create an Interval from an end DateTime and a Duration to extend backwards to.
61
+ * @param {DateTime|Date|Object} end
62
+ * @param {Duration|Object|number} duration - the length of the Interval.
63
+ * @return {Interval}
64
+ */
65
+ static before(t, i) {
66
+ const e = h.fromDurationLike(i), s = f(t);
67
+ return a.fromDateTimes(s.minus(e), s);
68
+ }
69
+ /**
70
+ * Create an Interval from an ISO 8601 string.
71
+ * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.
72
+ * @param {string} text - the ISO string to parse
73
+ * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}
74
+ * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
75
+ * @return {Interval}
76
+ */
77
+ static fromISO(t, i) {
78
+ const [e, s] = (t || "").split("/", 2);
79
+ if (e && s) {
80
+ let r, n;
81
+ try {
82
+ r = c.fromISO(e, i), n = r.isValid;
83
+ } catch {
84
+ n = !1;
85
+ }
86
+ let u, l;
87
+ try {
88
+ u = c.fromISO(s, i), l = u.isValid;
89
+ } catch {
90
+ l = !1;
91
+ }
92
+ if (n && l)
93
+ return a.fromDateTimes(r, u);
94
+ if (n) {
95
+ const o = h.fromISO(s, i);
96
+ if (o.isValid)
97
+ return a.after(r, o);
98
+ } else if (l) {
99
+ const o = h.fromISO(e, i);
100
+ if (o.isValid)
101
+ return a.before(u, o);
102
+ }
103
+ }
104
+ return a.invalid("unparsable", `the input "${t}" can't be parsed as ISO 8601`);
105
+ }
106
+ /**
107
+ * Check if an object is an Interval. Works across context boundaries
108
+ * @param {object} o
109
+ * @return {boolean}
110
+ */
111
+ static isInterval(t) {
112
+ return t && t.isLuxonInterval || !1;
113
+ }
114
+ /**
115
+ * Returns the start of the Interval
116
+ * @type {DateTime}
117
+ */
118
+ get start() {
119
+ return this.isValid ? this.s : null;
120
+ }
121
+ /**
122
+ * Returns the end of the Interval. This is the first instant which is not part of the interval
123
+ * (Interval is half-open).
124
+ * @type {DateTime}
125
+ */
126
+ get end() {
127
+ return this.isValid ? this.e : null;
128
+ }
129
+ /**
130
+ * Returns the last DateTime included in the interval (since end is not part of the interval)
131
+ * @type {DateTime}
132
+ */
133
+ get lastDateTime() {
134
+ return this.isValid && this.e ? this.e.minus(1) : null;
135
+ }
136
+ /**
137
+ * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.
138
+ * @type {boolean}
139
+ */
140
+ get isValid() {
141
+ return this.invalidReason === null;
142
+ }
143
+ /**
144
+ * Returns an error code if this Interval is invalid, or null if the Interval is valid
145
+ * @type {string}
146
+ */
147
+ get invalidReason() {
148
+ return this.invalid ? this.invalid.reason : null;
149
+ }
150
+ /**
151
+ * Returns an explanation of why this Interval became invalid, or null if the Interval is valid
152
+ * @type {string}
153
+ */
154
+ get invalidExplanation() {
155
+ return this.invalid ? this.invalid.explanation : null;
156
+ }
157
+ /**
158
+ * Returns the length of the Interval in the specified unit.
159
+ * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.
160
+ * @return {number}
161
+ */
162
+ length(t = "milliseconds") {
163
+ return this.isValid ? this.toDuration(t).get(t) : NaN;
164
+ }
165
+ /**
166
+ * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.
167
+ * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'
168
+ * asks 'what dates are included in this interval?', not 'how many days long is this interval?'
169
+ * @param {string} [unit='milliseconds'] - the unit of time to count.
170
+ * @param {Object} opts - options
171
+ * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime
172
+ * @return {number}
173
+ */
174
+ count(t = "milliseconds", i) {
175
+ if (!this.isValid) return NaN;
176
+ const e = this.start.startOf(t, i);
177
+ let s;
178
+ return i != null && i.useLocaleWeeks ? s = this.end.reconfigure({ locale: e.locale }) : s = this.end, s = s.startOf(t, i), Math.floor(s.diff(e, t).get(t)) + (s.valueOf() !== this.end.valueOf());
179
+ }
180
+ /**
181
+ * Returns whether this Interval's start and end are both in the same unit of time
182
+ * @param {string} unit - the unit of time to check sameness on
183
+ * @return {boolean}
184
+ */
185
+ hasSame(t) {
186
+ return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, t) : !1;
187
+ }
188
+ /**
189
+ * Return whether this Interval has the same start and end DateTimes.
190
+ * @return {boolean}
191
+ */
192
+ isEmpty() {
193
+ return this.s.valueOf() === this.e.valueOf();
194
+ }
195
+ /**
196
+ * Return whether this Interval's start is after the specified DateTime.
197
+ * @param {DateTime} dateTime
198
+ * @return {boolean}
199
+ */
200
+ isAfter(t) {
201
+ return this.isValid ? this.s > t : !1;
202
+ }
203
+ /**
204
+ * Return whether this Interval's end is before the specified DateTime.
205
+ * @param {DateTime} dateTime
206
+ * @return {boolean}
207
+ */
208
+ isBefore(t) {
209
+ return this.isValid ? this.e <= t : !1;
210
+ }
211
+ /**
212
+ * Return whether this Interval contains the specified DateTime.
213
+ * @param {DateTime} dateTime
214
+ * @return {boolean}
215
+ */
216
+ contains(t) {
217
+ return this.isValid ? this.s <= t && this.e > t : !1;
218
+ }
219
+ /**
220
+ * "Sets" the start and/or end dates. Returns a newly-constructed Interval.
221
+ * @param {Object} values - the values to set
222
+ * @param {DateTime} values.start - the starting DateTime
223
+ * @param {DateTime} values.end - the ending DateTime
224
+ * @return {Interval}
225
+ */
226
+ set({ start: t, end: i } = {}) {
227
+ return this.isValid ? a.fromDateTimes(t || this.s, i || this.e) : this;
228
+ }
229
+ /**
230
+ * Split this Interval at each of the specified DateTimes
231
+ * @param {...DateTime} dateTimes - the unit of time to count.
232
+ * @return {Array}
233
+ */
234
+ splitAt(...t) {
235
+ if (!this.isValid) return [];
236
+ const i = t.map(f).filter((n) => this.contains(n)).sort((n, u) => n.toMillis() - u.toMillis()), e = [];
237
+ let { s } = this, r = 0;
238
+ for (; s < this.e; ) {
239
+ const n = i[r] || this.e, u = +n > +this.e ? this.e : n;
240
+ e.push(a.fromDateTimes(s, u)), s = u, r += 1;
241
+ }
242
+ return e;
243
+ }
244
+ /**
245
+ * Split this Interval into smaller Intervals, each of the specified length.
246
+ * Left over time is grouped into a smaller interval
247
+ * @param {Duration|Object|number} duration - The length of each resulting interval.
248
+ * @return {Array}
249
+ */
250
+ splitBy(t) {
251
+ const i = h.fromDurationLike(t);
252
+ if (!this.isValid || !i.isValid || i.as("milliseconds") === 0)
253
+ return [];
254
+ let { s: e } = this, s = 1, r;
255
+ const n = [];
256
+ for (; e < this.e; ) {
257
+ const u = this.start.plus(i.mapUnits((l) => l * s));
258
+ r = +u > +this.e ? this.e : u, n.push(a.fromDateTimes(e, r)), e = r, s += 1;
259
+ }
260
+ return n;
261
+ }
262
+ /**
263
+ * Split this Interval into the specified number of smaller intervals.
264
+ * @param {number} numberOfParts - The number of Intervals to divide the Interval into.
265
+ * @return {Array}
266
+ */
267
+ divideEqually(t) {
268
+ return this.isValid ? this.splitBy(this.length() / t).slice(0, t) : [];
269
+ }
270
+ /**
271
+ * Return whether this Interval overlaps with the specified Interval
272
+ * @param {Interval} other
273
+ * @return {boolean}
274
+ */
275
+ overlaps(t) {
276
+ return this.e > t.s && this.s < t.e;
277
+ }
278
+ /**
279
+ * Return whether this Interval's end is adjacent to the specified Interval's start.
280
+ * @param {Interval} other
281
+ * @return {boolean}
282
+ */
283
+ abutsStart(t) {
284
+ return this.isValid ? +this.e == +t.s : !1;
285
+ }
286
+ /**
287
+ * Return whether this Interval's start is adjacent to the specified Interval's end.
288
+ * @param {Interval} other
289
+ * @return {boolean}
290
+ */
291
+ abutsEnd(t) {
292
+ return this.isValid ? +t.e == +this.s : !1;
293
+ }
294
+ /**
295
+ * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.
296
+ * @param {Interval} other
297
+ * @return {boolean}
298
+ */
299
+ engulfs(t) {
300
+ return this.isValid ? this.s <= t.s && this.e >= t.e : !1;
301
+ }
302
+ /**
303
+ * Return whether this Interval has the same start and end as the specified Interval.
304
+ * @param {Interval} other
305
+ * @return {boolean}
306
+ */
307
+ equals(t) {
308
+ return !this.isValid || !t.isValid ? !1 : this.s.equals(t.s) && this.e.equals(t.e);
309
+ }
310
+ /**
311
+ * Return an Interval representing the intersection of this Interval and the specified Interval.
312
+ * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.
313
+ * Returns null if the intersection is empty, meaning, the intervals don't intersect.
314
+ * @param {Interval} other
315
+ * @return {Interval}
316
+ */
317
+ intersection(t) {
318
+ if (!this.isValid) return this;
319
+ const i = this.s > t.s ? this.s : t.s, e = this.e < t.e ? this.e : t.e;
320
+ return i >= e ? null : a.fromDateTimes(i, e);
321
+ }
322
+ /**
323
+ * Return an Interval representing the union of this Interval and the specified Interval.
324
+ * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.
325
+ * @param {Interval} other
326
+ * @return {Interval}
327
+ */
328
+ union(t) {
329
+ if (!this.isValid) return this;
330
+ const i = this.s < t.s ? this.s : t.s, e = this.e > t.e ? this.e : t.e;
331
+ return a.fromDateTimes(i, e);
332
+ }
333
+ /**
334
+ * Merge an array of Intervals into an equivalent minimal set of Intervals.
335
+ * Combines overlapping and adjacent Intervals.
336
+ * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval
337
+ * and ending with the latest.
338
+ *
339
+ * @param {Array} intervals
340
+ * @return {Array}
341
+ */
342
+ static merge(t) {
343
+ const [i, e] = t.sort((s, r) => s.s - r.s).reduce(
344
+ ([s, r], n) => r ? r.overlaps(n) || r.abutsStart(n) ? [s, r.union(n)] : [s.concat([r]), n] : [s, n],
345
+ [[], null]
346
+ );
347
+ return e && i.push(e), i;
348
+ }
349
+ /**
350
+ * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.
351
+ * @param {Array} intervals
352
+ * @return {Array}
353
+ */
354
+ static xor(t) {
355
+ let i = null, e = 0;
356
+ const s = [], r = t.map((l) => [
357
+ { time: l.s, type: "s" },
358
+ { time: l.e, type: "e" }
359
+ ]), n = Array.prototype.concat(...r), u = n.sort((l, o) => l.time - o.time);
360
+ for (const l of u)
361
+ e += l.type === "s" ? 1 : -1, e === 1 ? i = l.time : (i && +i != +l.time && s.push(a.fromDateTimes(i, l.time)), i = null);
362
+ return a.merge(s);
363
+ }
364
+ /**
365
+ * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.
366
+ * @param {...Interval} intervals
367
+ * @return {Array}
368
+ */
369
+ difference(...t) {
370
+ return a.xor([this].concat(t)).map((i) => this.intersection(i)).filter((i) => i && !i.isEmpty());
371
+ }
372
+ /**
373
+ * Returns a string representation of this Interval appropriate for debugging.
374
+ * @return {string}
375
+ */
376
+ toString() {
377
+ return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` : d;
378
+ }
379
+ /**
380
+ * Returns a string representation of this Interval appropriate for the REPL.
381
+ * @return {string}
382
+ */
383
+ [Symbol.for("nodejs.util.inspect.custom")]() {
384
+ return this.isValid ? `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }` : `Interval { Invalid, reason: ${this.invalidReason} }`;
385
+ }
386
+ /**
387
+ * Returns a localized string representing this Interval. Accepts the same options as the
388
+ * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as
389
+ * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method
390
+ * is browser-specific, but in general it will return an appropriate representation of the
391
+ * Interval in the assigned locale. Defaults to the system's locale if no locale has been
392
+ * specified.
393
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
394
+ * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or
395
+ * Intl.DateTimeFormat constructor options.
396
+ * @param {Object} opts - Options to override the configuration of the start DateTime.
397
+ * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022
398
+ * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022
399
+ * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022
400
+ * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM
401
+ * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p
402
+ * @return {string}
403
+ */
404
+ toLocaleString(t = O, i = {}) {
405
+ return this.isValid ? D.create(this.s.loc.clone(i), t).formatInterval(this) : d;
406
+ }
407
+ /**
408
+ * Returns an ISO 8601-compliant string representation of this Interval.
409
+ * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
410
+ * @param {Object} opts - The same options as {@link DateTime#toISO}
411
+ * @return {string}
412
+ */
413
+ toISO(t) {
414
+ return this.isValid ? `${this.s.toISO(t)}/${this.e.toISO(t)}` : d;
415
+ }
416
+ /**
417
+ * Returns an ISO 8601-compliant string representation of date of this Interval.
418
+ * The time components are ignored.
419
+ * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
420
+ * @return {string}
421
+ */
422
+ toISODate() {
423
+ return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` : d;
424
+ }
425
+ /**
426
+ * Returns an ISO 8601-compliant string representation of time of this Interval.
427
+ * The date components are ignored.
428
+ * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
429
+ * @param {Object} opts - The same options as {@link DateTime#toISO}
430
+ * @return {string}
431
+ */
432
+ toISOTime(t) {
433
+ return this.isValid ? `${this.s.toISOTime(t)}/${this.e.toISOTime(t)}` : d;
434
+ }
435
+ /**
436
+ * Returns a string representation of this Interval formatted according to the specified format
437
+ * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible
438
+ * formatting tool.
439
+ * @param {string} dateFormat - The format string. This string formats the start and end time.
440
+ * See {@link DateTime#toFormat} for details.
441
+ * @param {Object} opts - Options.
442
+ * @param {string} [opts.separator = ' – '] - A separator to place between the start and end
443
+ * representations.
444
+ * @return {string}
445
+ */
446
+ toFormat(t, { separator: i = " – " } = {}) {
447
+ return this.isValid ? `${this.s.toFormat(t)}${i}${this.e.toFormat(t)}` : d;
448
+ }
449
+ /**
450
+ * Return a Duration representing the time spanned by this interval.
451
+ * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.
452
+ * @param {Object} opts - options that affect the creation of the Duration
453
+ * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
454
+ * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }
455
+ * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }
456
+ * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }
457
+ * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }
458
+ * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }
459
+ * @return {Duration}
460
+ */
461
+ toDuration(t, i) {
462
+ return this.isValid ? this.e.diff(this.s, t, i) : h.invalid(this.invalidReason);
463
+ }
464
+ /**
465
+ * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes
466
+ * @param {function} mapFn
467
+ * @return {Interval}
468
+ * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())
469
+ * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))
470
+ */
471
+ mapEndpoints(t) {
472
+ return a.fromDateTimes(t(this.s), t(this.e));
473
+ }
474
+ }
475
+ export {
476
+ a as I
477
+ };
@@ -0,0 +1,2 @@
1
+ import "./duration.es.js";
2
+ import "./impl/regexParser.es.js";
@@ -0,0 +1,150 @@
1
+ import { S as l } from "./zones/systemZone.es.js";
2
+ import { I as c } from "./zones/IANAZone.es.js";
3
+ import { L as f } from "./impl/locale.es.js";
4
+ import { D as m } from "./datetime.es.js";
5
+ import { n as d } from "./impl/zoneUtil.es.js";
6
+ import { v as g } from "./impl/util.es.js";
7
+ import { r as p } from "./impl/digits.es.js";
8
+ let e = () => Date.now(), a = "system", s = null, r = null, i = null, n = 60, o, u = null;
9
+ class y {
10
+ /**
11
+ * Get the callback for returning the current timestamp.
12
+ * @type {function}
13
+ */
14
+ static get now() {
15
+ return e;
16
+ }
17
+ /**
18
+ * Set the callback for returning the current timestamp.
19
+ * The function should return a number, which will be interpreted as an Epoch millisecond count
20
+ * @type {function}
21
+ * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future
22
+ * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
23
+ */
24
+ static set now(t) {
25
+ e = t;
26
+ }
27
+ /**
28
+ * Set the default time zone to create DateTimes in. Does not affect existing instances.
29
+ * Use the value "system" to reset this value to the system's time zone.
30
+ * @type {string}
31
+ */
32
+ static set defaultZone(t) {
33
+ a = t;
34
+ }
35
+ /**
36
+ * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
37
+ * The default value is the system's time zone (the one set on the machine that runs this code).
38
+ * @type {Zone}
39
+ */
40
+ static get defaultZone() {
41
+ return d(a, l.instance);
42
+ }
43
+ /**
44
+ * Get the default locale to create DateTimes with. Does not affect existing instances.
45
+ * @type {string}
46
+ */
47
+ static get defaultLocale() {
48
+ return s;
49
+ }
50
+ /**
51
+ * Set the default locale to create DateTimes with. Does not affect existing instances.
52
+ * @type {string}
53
+ */
54
+ static set defaultLocale(t) {
55
+ s = t;
56
+ }
57
+ /**
58
+ * Get the default numbering system to create DateTimes with. Does not affect existing instances.
59
+ * @type {string}
60
+ */
61
+ static get defaultNumberingSystem() {
62
+ return r;
63
+ }
64
+ /**
65
+ * Set the default numbering system to create DateTimes with. Does not affect existing instances.
66
+ * @type {string}
67
+ */
68
+ static set defaultNumberingSystem(t) {
69
+ r = t;
70
+ }
71
+ /**
72
+ * Get the default output calendar to create DateTimes with. Does not affect existing instances.
73
+ * @type {string}
74
+ */
75
+ static get defaultOutputCalendar() {
76
+ return i;
77
+ }
78
+ /**
79
+ * Set the default output calendar to create DateTimes with. Does not affect existing instances.
80
+ * @type {string}
81
+ */
82
+ static set defaultOutputCalendar(t) {
83
+ i = t;
84
+ }
85
+ /**
86
+ * @typedef {Object} WeekSettings
87
+ * @property {number} firstDay
88
+ * @property {number} minimalDays
89
+ * @property {number[]} weekend
90
+ */
91
+ /**
92
+ * @return {WeekSettings|null}
93
+ */
94
+ static get defaultWeekSettings() {
95
+ return u;
96
+ }
97
+ /**
98
+ * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and
99
+ * how many days are required in the first week of a year.
100
+ * Does not affect existing instances.
101
+ *
102
+ * @param {WeekSettings|null} weekSettings
103
+ */
104
+ static set defaultWeekSettings(t) {
105
+ u = g(t);
106
+ }
107
+ /**
108
+ * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
109
+ * @type {number}
110
+ */
111
+ static get twoDigitCutoffYear() {
112
+ return n;
113
+ }
114
+ /**
115
+ * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
116
+ * @type {number}
117
+ * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century
118
+ * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century
119
+ * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950
120
+ * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50
121
+ * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
122
+ */
123
+ static set twoDigitCutoffYear(t) {
124
+ n = t % 100;
125
+ }
126
+ /**
127
+ * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
128
+ * @type {boolean}
129
+ */
130
+ static get throwOnInvalid() {
131
+ return o;
132
+ }
133
+ /**
134
+ * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
135
+ * @type {boolean}
136
+ */
137
+ static set throwOnInvalid(t) {
138
+ o = t;
139
+ }
140
+ /**
141
+ * Reset Luxon's global caches. Should only be necessary in testing scenarios.
142
+ * @return {void}
143
+ */
144
+ static resetCaches() {
145
+ f.resetCache(), c.resetCache(), m.resetCache(), p();
146
+ }
147
+ }
148
+ export {
149
+ y as S
150
+ };