@keboola/design 4.1.2 → 4.2.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/AGENTS.md +17 -10
- package/dist/index.cjs +4707 -325
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +4446 -64
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Slot, Root as Root$1, Slottable } from '@radix-ui/react-slot';
|
|
2
2
|
export { Slot } from '@radix-ui/react-slot';
|
|
3
3
|
import * as lucide_react_star from 'lucide-react';
|
|
4
|
-
import
|
|
4
|
+
import React27, { createContext, forwardRef, useMemo, useRef, useEffect, useImperativeHandle, Fragment, use, useState, useReducer, useCallback, useId, Children, useLayoutEffect, useContext, isValidElement } from 'react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
7
7
|
import { Root as Root$6, Trigger, Portal, Content, Provider } from '@radix-ui/react-tooltip';
|
|
@@ -23,7 +23,6 @@ import { Root as Root$2, Trigger as Trigger$2, Close as Close$1, Portal as Porta
|
|
|
23
23
|
import { Root as Root$a, Trigger as Trigger$3, Portal as Portal$4, Content as Content$4 } from '@radix-ui/react-hover-card';
|
|
24
24
|
import { Command as Command$1, CommandInput as CommandInput$1, defaultFilter, useCommandState } from 'cmdk';
|
|
25
25
|
export { defaultFilter, useCommandState } from 'cmdk';
|
|
26
|
-
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
27
26
|
import TextareaAutosize from 'react-textarea-autosize';
|
|
28
27
|
import * as RLabel from '@radix-ui/react-label';
|
|
29
28
|
import { Root as Root$3, Thumb } from '@radix-ui/react-switch';
|
|
@@ -450,12 +449,12 @@ var require_checkPropTypes = __commonJS({
|
|
|
450
449
|
loggedTypeFailures = {};
|
|
451
450
|
has = require_has();
|
|
452
451
|
printWarning = function(text) {
|
|
453
|
-
var
|
|
452
|
+
var message2 = "Warning: " + text;
|
|
454
453
|
if (typeof console !== "undefined") {
|
|
455
|
-
console.error(
|
|
454
|
+
console.error(message2);
|
|
456
455
|
}
|
|
457
456
|
try {
|
|
458
|
-
throw new Error(
|
|
457
|
+
throw new Error(message2);
|
|
459
458
|
} catch (x) {
|
|
460
459
|
}
|
|
461
460
|
};
|
|
@@ -517,12 +516,12 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
517
516
|
};
|
|
518
517
|
if (process.env.NODE_ENV !== "production") {
|
|
519
518
|
printWarning = function(text) {
|
|
520
|
-
var
|
|
519
|
+
var message2 = "Warning: " + text;
|
|
521
520
|
if (typeof console !== "undefined") {
|
|
522
|
-
console.error(
|
|
521
|
+
console.error(message2);
|
|
523
522
|
}
|
|
524
523
|
try {
|
|
525
|
-
throw new Error(
|
|
524
|
+
throw new Error(message2);
|
|
526
525
|
} catch (x) {
|
|
527
526
|
}
|
|
528
527
|
};
|
|
@@ -568,8 +567,8 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
568
567
|
return x !== x && y !== y;
|
|
569
568
|
}
|
|
570
569
|
}
|
|
571
|
-
function PropTypeError(
|
|
572
|
-
this.message =
|
|
570
|
+
function PropTypeError(message2, data) {
|
|
571
|
+
this.message = message2;
|
|
573
572
|
this.data = data && typeof data === "object" ? data : {};
|
|
574
573
|
this.stack = "";
|
|
575
574
|
}
|
|
@@ -3924,7 +3923,7 @@ var PopconfirmConfirm = ({
|
|
|
3924
3923
|
onClick?.(event);
|
|
3925
3924
|
onConfirm(event);
|
|
3926
3925
|
};
|
|
3927
|
-
const
|
|
3926
|
+
const defaultLabel2 = (() => {
|
|
3928
3927
|
if (children) return children;
|
|
3929
3928
|
return variant === "danger" ? "Delete" : "Confirm";
|
|
3930
3929
|
})();
|
|
@@ -3937,7 +3936,7 @@ var PopconfirmConfirm = ({
|
|
|
3937
3936
|
ref,
|
|
3938
3937
|
className: cn("tw-flex-1", className),
|
|
3939
3938
|
isLoading,
|
|
3940
|
-
children:
|
|
3939
|
+
children: defaultLabel2
|
|
3941
3940
|
}
|
|
3942
3941
|
) });
|
|
3943
3942
|
};
|
|
@@ -4116,6 +4115,4367 @@ var CommandGroup = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
4116
4115
|
...props
|
|
4117
4116
|
}
|
|
4118
4117
|
);
|
|
4118
|
+
|
|
4119
|
+
// ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzName/index.js
|
|
4120
|
+
function tzName(timeZone, date, format2 = "long") {
|
|
4121
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
4122
|
+
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
4123
|
+
hour: "numeric",
|
|
4124
|
+
timeZone,
|
|
4125
|
+
timeZoneName: format2
|
|
4126
|
+
}).format(date).split(/\s/g).slice(2).join(" ");
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
// ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzOffset/index.js
|
|
4130
|
+
var offsetFormatCache = {};
|
|
4131
|
+
var offsetCache = {};
|
|
4132
|
+
function tzOffset(timeZone, date) {
|
|
4133
|
+
try {
|
|
4134
|
+
const format2 = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
|
|
4135
|
+
timeZone,
|
|
4136
|
+
timeZoneName: "longOffset"
|
|
4137
|
+
}).format;
|
|
4138
|
+
const offsetStr = format2(date).split("GMT")[1];
|
|
4139
|
+
if (offsetStr in offsetCache) return offsetCache[offsetStr];
|
|
4140
|
+
return calcOffset(offsetStr, offsetStr.split(":"));
|
|
4141
|
+
} catch {
|
|
4142
|
+
if (timeZone in offsetCache) return offsetCache[timeZone];
|
|
4143
|
+
const captures = timeZone?.match(offsetRe);
|
|
4144
|
+
if (captures) return calcOffset(timeZone, captures.slice(1));
|
|
4145
|
+
return NaN;
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
var offsetRe = /([+-]\d\d):?(\d\d)?/;
|
|
4149
|
+
function calcOffset(cacheStr, values) {
|
|
4150
|
+
const hours = +(values[0] || 0);
|
|
4151
|
+
const minutes = +(values[1] || 0);
|
|
4152
|
+
const seconds = +(values[2] || 0) / 60;
|
|
4153
|
+
return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
// ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/date/mini.js
|
|
4157
|
+
var TZDateMini = class _TZDateMini extends Date {
|
|
4158
|
+
//#region static
|
|
4159
|
+
constructor(...args) {
|
|
4160
|
+
super();
|
|
4161
|
+
if (args.length > 1 && typeof args[args.length - 1] === "string") {
|
|
4162
|
+
this.timeZone = args.pop();
|
|
4163
|
+
}
|
|
4164
|
+
this.internal = /* @__PURE__ */ new Date();
|
|
4165
|
+
if (isNaN(tzOffset(this.timeZone, this))) {
|
|
4166
|
+
this.setTime(NaN);
|
|
4167
|
+
} else {
|
|
4168
|
+
if (!args.length) {
|
|
4169
|
+
this.setTime(Date.now());
|
|
4170
|
+
} else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
|
|
4171
|
+
this.setTime(args[0]);
|
|
4172
|
+
} else if (typeof args[0] === "string") {
|
|
4173
|
+
this.setTime(+new Date(args[0]));
|
|
4174
|
+
} else if (args[0] instanceof Date) {
|
|
4175
|
+
this.setTime(+args[0]);
|
|
4176
|
+
} else {
|
|
4177
|
+
this.setTime(+new Date(...args));
|
|
4178
|
+
adjustToSystemTZ(this);
|
|
4179
|
+
syncToInternal(this);
|
|
4180
|
+
}
|
|
4181
|
+
}
|
|
4182
|
+
}
|
|
4183
|
+
static tz(tz, ...args) {
|
|
4184
|
+
return args.length ? new _TZDateMini(...args, tz) : new _TZDateMini(Date.now(), tz);
|
|
4185
|
+
}
|
|
4186
|
+
//#endregion
|
|
4187
|
+
//#region time zone
|
|
4188
|
+
withTimeZone(timeZone) {
|
|
4189
|
+
return new _TZDateMini(+this, timeZone);
|
|
4190
|
+
}
|
|
4191
|
+
getTimezoneOffset() {
|
|
4192
|
+
const offset = -tzOffset(this.timeZone, this);
|
|
4193
|
+
return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
|
|
4194
|
+
}
|
|
4195
|
+
//#endregion
|
|
4196
|
+
//#region time
|
|
4197
|
+
setTime(time) {
|
|
4198
|
+
Date.prototype.setTime.apply(this, arguments);
|
|
4199
|
+
syncToInternal(this);
|
|
4200
|
+
return +this;
|
|
4201
|
+
}
|
|
4202
|
+
//#endregion
|
|
4203
|
+
//#region date-fns integration
|
|
4204
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
|
|
4205
|
+
return new _TZDateMini(+new Date(date), this.timeZone);
|
|
4206
|
+
}
|
|
4207
|
+
//#endregion
|
|
4208
|
+
};
|
|
4209
|
+
var re = /^(get|set)(?!UTC)/;
|
|
4210
|
+
Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
|
|
4211
|
+
if (!re.test(method)) return;
|
|
4212
|
+
const utcMethod = method.replace(re, "$1UTC");
|
|
4213
|
+
if (!TZDateMini.prototype[utcMethod]) return;
|
|
4214
|
+
if (method.startsWith("get")) {
|
|
4215
|
+
TZDateMini.prototype[method] = function() {
|
|
4216
|
+
return this.internal[utcMethod]();
|
|
4217
|
+
};
|
|
4218
|
+
} else {
|
|
4219
|
+
TZDateMini.prototype[method] = function() {
|
|
4220
|
+
Date.prototype[utcMethod].apply(this.internal, arguments);
|
|
4221
|
+
syncFromInternal(this);
|
|
4222
|
+
return +this;
|
|
4223
|
+
};
|
|
4224
|
+
TZDateMini.prototype[utcMethod] = function() {
|
|
4225
|
+
Date.prototype[utcMethod].apply(this, arguments);
|
|
4226
|
+
syncToInternal(this);
|
|
4227
|
+
return +this;
|
|
4228
|
+
};
|
|
4229
|
+
}
|
|
4230
|
+
});
|
|
4231
|
+
function syncToInternal(date) {
|
|
4232
|
+
date.internal.setTime(+date);
|
|
4233
|
+
date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, date) * 60));
|
|
4234
|
+
}
|
|
4235
|
+
function syncFromInternal(date) {
|
|
4236
|
+
Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
|
|
4237
|
+
Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
|
|
4238
|
+
adjustToSystemTZ(date);
|
|
4239
|
+
}
|
|
4240
|
+
function adjustToSystemTZ(date) {
|
|
4241
|
+
const baseOffset = tzOffset(date.timeZone, date);
|
|
4242
|
+
const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
|
|
4243
|
+
const prevHour = /* @__PURE__ */ new Date(+date);
|
|
4244
|
+
prevHour.setUTCHours(prevHour.getUTCHours() - 1);
|
|
4245
|
+
const systemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
|
|
4246
|
+
const prevHourSystemOffset = -(/* @__PURE__ */ new Date(+prevHour)).getTimezoneOffset();
|
|
4247
|
+
const systemDSTChange = systemOffset - prevHourSystemOffset;
|
|
4248
|
+
const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();
|
|
4249
|
+
if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);
|
|
4250
|
+
const offsetDiff = systemOffset - offset;
|
|
4251
|
+
if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
|
|
4252
|
+
const systemDate = /* @__PURE__ */ new Date(+date);
|
|
4253
|
+
systemDate.setUTCSeconds(0);
|
|
4254
|
+
const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
|
|
4255
|
+
const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
|
|
4256
|
+
if (secondsOffset || systemSecondsOffset) {
|
|
4257
|
+
date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
|
|
4258
|
+
Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
|
|
4259
|
+
}
|
|
4260
|
+
const postBaseOffset = tzOffset(date.timeZone, date);
|
|
4261
|
+
const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
|
|
4262
|
+
const postSystemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
|
|
4263
|
+
const postOffsetDiff = postSystemOffset - postOffset;
|
|
4264
|
+
const offsetChanged = postOffset !== offset;
|
|
4265
|
+
const postDiff = postOffsetDiff - offsetDiff;
|
|
4266
|
+
if (offsetChanged && postDiff) {
|
|
4267
|
+
Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
|
|
4268
|
+
const newBaseOffset = tzOffset(date.timeZone, date);
|
|
4269
|
+
const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
|
|
4270
|
+
const offsetChange = postOffset - newOffset;
|
|
4271
|
+
if (offsetChange) {
|
|
4272
|
+
date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
|
|
4273
|
+
Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
|
|
4274
|
+
}
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4278
|
+
// ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/date/index.js
|
|
4279
|
+
var TZDate = class _TZDate extends TZDateMini {
|
|
4280
|
+
//#region static
|
|
4281
|
+
static tz(tz, ...args) {
|
|
4282
|
+
return args.length ? new _TZDate(...args, tz) : new _TZDate(Date.now(), tz);
|
|
4283
|
+
}
|
|
4284
|
+
//#endregion
|
|
4285
|
+
//#region representation
|
|
4286
|
+
toISOString() {
|
|
4287
|
+
const [sign, hours, minutes] = this.tzComponents();
|
|
4288
|
+
const tz = `${sign}${hours}:${minutes}`;
|
|
4289
|
+
return this.internal.toISOString().slice(0, -1) + tz;
|
|
4290
|
+
}
|
|
4291
|
+
toString() {
|
|
4292
|
+
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
4293
|
+
}
|
|
4294
|
+
toDateString() {
|
|
4295
|
+
const [day, date, month, year] = this.internal.toUTCString().split(" ");
|
|
4296
|
+
return `${day?.slice(0, -1)} ${month} ${date} ${year}`;
|
|
4297
|
+
}
|
|
4298
|
+
toTimeString() {
|
|
4299
|
+
const time = this.internal.toUTCString().split(" ")[4];
|
|
4300
|
+
const [sign, hours, minutes] = this.tzComponents();
|
|
4301
|
+
return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
|
|
4302
|
+
}
|
|
4303
|
+
toLocaleString(locales, options) {
|
|
4304
|
+
return Date.prototype.toLocaleString.call(this, locales, {
|
|
4305
|
+
...options,
|
|
4306
|
+
timeZone: options?.timeZone || this.timeZone
|
|
4307
|
+
});
|
|
4308
|
+
}
|
|
4309
|
+
toLocaleDateString(locales, options) {
|
|
4310
|
+
return Date.prototype.toLocaleDateString.call(this, locales, {
|
|
4311
|
+
...options,
|
|
4312
|
+
timeZone: options?.timeZone || this.timeZone
|
|
4313
|
+
});
|
|
4314
|
+
}
|
|
4315
|
+
toLocaleTimeString(locales, options) {
|
|
4316
|
+
return Date.prototype.toLocaleTimeString.call(this, locales, {
|
|
4317
|
+
...options,
|
|
4318
|
+
timeZone: options?.timeZone || this.timeZone
|
|
4319
|
+
});
|
|
4320
|
+
}
|
|
4321
|
+
//#endregion
|
|
4322
|
+
//#region private
|
|
4323
|
+
tzComponents() {
|
|
4324
|
+
const offset = this.getTimezoneOffset();
|
|
4325
|
+
const sign = offset > 0 ? "-" : "+";
|
|
4326
|
+
const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
|
|
4327
|
+
const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
|
|
4328
|
+
return [sign, hours, minutes];
|
|
4329
|
+
}
|
|
4330
|
+
//#endregion
|
|
4331
|
+
withTimeZone(timeZone) {
|
|
4332
|
+
return new _TZDate(+this, timeZone);
|
|
4333
|
+
}
|
|
4334
|
+
//#region date-fns integration
|
|
4335
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
|
|
4336
|
+
return new _TZDate(+new Date(date), this.timeZone);
|
|
4337
|
+
}
|
|
4338
|
+
//#endregion
|
|
4339
|
+
};
|
|
4340
|
+
var millisecondsInWeek = 6048e5;
|
|
4341
|
+
var millisecondsInDay = 864e5;
|
|
4342
|
+
var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
4343
|
+
|
|
4344
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
|
|
4345
|
+
function constructFrom(date, value) {
|
|
4346
|
+
if (typeof date === "function") return date(value);
|
|
4347
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
4348
|
+
return date[constructFromSymbol](value);
|
|
4349
|
+
if (date instanceof Date) return new date.constructor(value);
|
|
4350
|
+
return new Date(value);
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
|
|
4354
|
+
function toDate(argument, context) {
|
|
4355
|
+
return constructFrom(context || argument, argument);
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4358
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
|
|
4359
|
+
function addDays(date, amount, options) {
|
|
4360
|
+
const _date = toDate(date, options?.in);
|
|
4361
|
+
if (isNaN(amount)) return constructFrom(date, NaN);
|
|
4362
|
+
if (!amount) return _date;
|
|
4363
|
+
_date.setDate(_date.getDate() + amount);
|
|
4364
|
+
return _date;
|
|
4365
|
+
}
|
|
4366
|
+
|
|
4367
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js
|
|
4368
|
+
function addMonths(date, amount, options) {
|
|
4369
|
+
const _date = toDate(date, options?.in);
|
|
4370
|
+
if (isNaN(amount)) return constructFrom(date, NaN);
|
|
4371
|
+
if (!amount) {
|
|
4372
|
+
return _date;
|
|
4373
|
+
}
|
|
4374
|
+
const dayOfMonth = _date.getDate();
|
|
4375
|
+
const endOfDesiredMonth = constructFrom(date, _date.getTime());
|
|
4376
|
+
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
|
|
4377
|
+
const daysInMonth = endOfDesiredMonth.getDate();
|
|
4378
|
+
if (dayOfMonth >= daysInMonth) {
|
|
4379
|
+
return endOfDesiredMonth;
|
|
4380
|
+
} else {
|
|
4381
|
+
_date.setFullYear(
|
|
4382
|
+
endOfDesiredMonth.getFullYear(),
|
|
4383
|
+
endOfDesiredMonth.getMonth(),
|
|
4384
|
+
dayOfMonth
|
|
4385
|
+
);
|
|
4386
|
+
return _date;
|
|
4387
|
+
}
|
|
4388
|
+
}
|
|
4389
|
+
|
|
4390
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
|
|
4391
|
+
var defaultOptions = {};
|
|
4392
|
+
function getDefaultOptions() {
|
|
4393
|
+
return defaultOptions;
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4396
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
|
|
4397
|
+
function startOfWeek(date, options) {
|
|
4398
|
+
const defaultOptions4 = getDefaultOptions();
|
|
4399
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions4.weekStartsOn ?? defaultOptions4.locale?.options?.weekStartsOn ?? 0;
|
|
4400
|
+
const _date = toDate(date, options?.in);
|
|
4401
|
+
const day = _date.getDay();
|
|
4402
|
+
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
4403
|
+
_date.setDate(_date.getDate() - diff);
|
|
4404
|
+
_date.setHours(0, 0, 0, 0);
|
|
4405
|
+
return _date;
|
|
4406
|
+
}
|
|
4407
|
+
|
|
4408
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
|
|
4409
|
+
function startOfISOWeek(date, options) {
|
|
4410
|
+
return startOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
4411
|
+
}
|
|
4412
|
+
|
|
4413
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
|
|
4414
|
+
function getISOWeekYear(date, options) {
|
|
4415
|
+
const _date = toDate(date, options?.in);
|
|
4416
|
+
const year = _date.getFullYear();
|
|
4417
|
+
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
|
|
4418
|
+
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
4419
|
+
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
4420
|
+
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
|
|
4421
|
+
const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
|
|
4422
|
+
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
4423
|
+
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
4424
|
+
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
|
|
4425
|
+
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
4426
|
+
return year + 1;
|
|
4427
|
+
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
4428
|
+
return year;
|
|
4429
|
+
} else {
|
|
4430
|
+
return year - 1;
|
|
4431
|
+
}
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
4435
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
|
4436
|
+
const _date = toDate(date);
|
|
4437
|
+
const utcDate = new Date(
|
|
4438
|
+
Date.UTC(
|
|
4439
|
+
_date.getFullYear(),
|
|
4440
|
+
_date.getMonth(),
|
|
4441
|
+
_date.getDate(),
|
|
4442
|
+
_date.getHours(),
|
|
4443
|
+
_date.getMinutes(),
|
|
4444
|
+
_date.getSeconds(),
|
|
4445
|
+
_date.getMilliseconds()
|
|
4446
|
+
)
|
|
4447
|
+
);
|
|
4448
|
+
utcDate.setUTCFullYear(_date.getFullYear());
|
|
4449
|
+
return +date - +utcDate;
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
|
|
4453
|
+
function normalizeDates(context, ...dates) {
|
|
4454
|
+
const normalize = constructFrom.bind(
|
|
4455
|
+
null,
|
|
4456
|
+
dates.find((date) => typeof date === "object")
|
|
4457
|
+
);
|
|
4458
|
+
return dates.map(normalize);
|
|
4459
|
+
}
|
|
4460
|
+
|
|
4461
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
|
|
4462
|
+
function startOfDay(date, options) {
|
|
4463
|
+
const _date = toDate(date, options?.in);
|
|
4464
|
+
_date.setHours(0, 0, 0, 0);
|
|
4465
|
+
return _date;
|
|
4466
|
+
}
|
|
4467
|
+
|
|
4468
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
|
|
4469
|
+
function differenceInCalendarDays(laterDate, earlierDate, options) {
|
|
4470
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
4471
|
+
options?.in,
|
|
4472
|
+
laterDate,
|
|
4473
|
+
earlierDate
|
|
4474
|
+
);
|
|
4475
|
+
const laterStartOfDay = startOfDay(laterDate_);
|
|
4476
|
+
const earlierStartOfDay = startOfDay(earlierDate_);
|
|
4477
|
+
const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
|
|
4478
|
+
const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
|
|
4479
|
+
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
|
|
4480
|
+
}
|
|
4481
|
+
|
|
4482
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
|
|
4483
|
+
function startOfISOWeekYear(date, options) {
|
|
4484
|
+
const year = getISOWeekYear(date, options);
|
|
4485
|
+
const fourthOfJanuary = constructFrom(date, 0);
|
|
4486
|
+
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
4487
|
+
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
4488
|
+
return startOfISOWeek(fourthOfJanuary);
|
|
4489
|
+
}
|
|
4490
|
+
|
|
4491
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js
|
|
4492
|
+
function addWeeks(date, amount, options) {
|
|
4493
|
+
return addDays(date, amount * 7, options);
|
|
4494
|
+
}
|
|
4495
|
+
|
|
4496
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js
|
|
4497
|
+
function addYears(date, amount, options) {
|
|
4498
|
+
return addMonths(date, amount * 12, options);
|
|
4499
|
+
}
|
|
4500
|
+
|
|
4501
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/max.js
|
|
4502
|
+
function max(dates, options) {
|
|
4503
|
+
let result;
|
|
4504
|
+
let context = options?.in;
|
|
4505
|
+
dates.forEach((date) => {
|
|
4506
|
+
if (!context && typeof date === "object")
|
|
4507
|
+
context = constructFrom.bind(null, date);
|
|
4508
|
+
const date_ = toDate(date, context);
|
|
4509
|
+
if (!result || result < date_ || isNaN(+date_)) result = date_;
|
|
4510
|
+
});
|
|
4511
|
+
return constructFrom(context, result || NaN);
|
|
4512
|
+
}
|
|
4513
|
+
|
|
4514
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/min.js
|
|
4515
|
+
function min(dates, options) {
|
|
4516
|
+
let result;
|
|
4517
|
+
let context = options?.in;
|
|
4518
|
+
dates.forEach((date) => {
|
|
4519
|
+
if (!context && typeof date === "object")
|
|
4520
|
+
context = constructFrom.bind(null, date);
|
|
4521
|
+
const date_ = toDate(date, context);
|
|
4522
|
+
if (!result || result > date_ || isNaN(+date_)) result = date_;
|
|
4523
|
+
});
|
|
4524
|
+
return constructFrom(context, result || NaN);
|
|
4525
|
+
}
|
|
4526
|
+
|
|
4527
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js
|
|
4528
|
+
function isSameDay(laterDate, earlierDate, options) {
|
|
4529
|
+
const [dateLeft_, dateRight_] = normalizeDates(
|
|
4530
|
+
options?.in,
|
|
4531
|
+
laterDate,
|
|
4532
|
+
earlierDate
|
|
4533
|
+
);
|
|
4534
|
+
return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
|
|
4535
|
+
}
|
|
4536
|
+
|
|
4537
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
|
|
4538
|
+
function isDate(value) {
|
|
4539
|
+
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
|
|
4543
|
+
function isValid(date) {
|
|
4544
|
+
return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
|
|
4545
|
+
}
|
|
4546
|
+
|
|
4547
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js
|
|
4548
|
+
function differenceInCalendarMonths(laterDate, earlierDate, options) {
|
|
4549
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
4550
|
+
options?.in,
|
|
4551
|
+
laterDate,
|
|
4552
|
+
earlierDate
|
|
4553
|
+
);
|
|
4554
|
+
const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
|
|
4555
|
+
const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
|
|
4556
|
+
return yearsDiff * 12 + monthsDiff;
|
|
4557
|
+
}
|
|
4558
|
+
|
|
4559
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js
|
|
4560
|
+
function endOfMonth(date, options) {
|
|
4561
|
+
const _date = toDate(date, options?.in);
|
|
4562
|
+
const month = _date.getMonth();
|
|
4563
|
+
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
4564
|
+
_date.setHours(23, 59, 59, 999);
|
|
4565
|
+
return _date;
|
|
4566
|
+
}
|
|
4567
|
+
|
|
4568
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeInterval.js
|
|
4569
|
+
function normalizeInterval(context, interval) {
|
|
4570
|
+
const [start, end] = normalizeDates(context, interval.start, interval.end);
|
|
4571
|
+
return { start, end };
|
|
4572
|
+
}
|
|
4573
|
+
|
|
4574
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMonthOfInterval.js
|
|
4575
|
+
function eachMonthOfInterval(interval, options) {
|
|
4576
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
4577
|
+
let reversed = +start > +end;
|
|
4578
|
+
const endTime = reversed ? +start : +end;
|
|
4579
|
+
const date = reversed ? end : start;
|
|
4580
|
+
date.setHours(0, 0, 0, 0);
|
|
4581
|
+
date.setDate(1);
|
|
4582
|
+
let step = 1;
|
|
4583
|
+
const dates = [];
|
|
4584
|
+
while (+date <= endTime) {
|
|
4585
|
+
dates.push(constructFrom(start, date));
|
|
4586
|
+
date.setMonth(date.getMonth() + step);
|
|
4587
|
+
}
|
|
4588
|
+
return reversed ? dates.reverse() : dates;
|
|
4589
|
+
}
|
|
4590
|
+
|
|
4591
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js
|
|
4592
|
+
function startOfMonth(date, options) {
|
|
4593
|
+
const _date = toDate(date, options?.in);
|
|
4594
|
+
_date.setDate(1);
|
|
4595
|
+
_date.setHours(0, 0, 0, 0);
|
|
4596
|
+
return _date;
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4599
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYear.js
|
|
4600
|
+
function endOfYear(date, options) {
|
|
4601
|
+
const _date = toDate(date, options?.in);
|
|
4602
|
+
const year = _date.getFullYear();
|
|
4603
|
+
_date.setFullYear(year + 1, 0, 0);
|
|
4604
|
+
_date.setHours(23, 59, 59, 999);
|
|
4605
|
+
return _date;
|
|
4606
|
+
}
|
|
4607
|
+
|
|
4608
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js
|
|
4609
|
+
function startOfYear(date, options) {
|
|
4610
|
+
const date_ = toDate(date, options?.in);
|
|
4611
|
+
date_.setFullYear(date_.getFullYear(), 0, 1);
|
|
4612
|
+
date_.setHours(0, 0, 0, 0);
|
|
4613
|
+
return date_;
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4616
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachYearOfInterval.js
|
|
4617
|
+
function eachYearOfInterval(interval, options) {
|
|
4618
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
4619
|
+
let reversed = +start > +end;
|
|
4620
|
+
const endTime = reversed ? +start : +end;
|
|
4621
|
+
const date = reversed ? end : start;
|
|
4622
|
+
date.setHours(0, 0, 0, 0);
|
|
4623
|
+
date.setMonth(0, 1);
|
|
4624
|
+
let step = 1;
|
|
4625
|
+
const dates = [];
|
|
4626
|
+
while (+date <= endTime) {
|
|
4627
|
+
dates.push(constructFrom(start, date));
|
|
4628
|
+
date.setFullYear(date.getFullYear() + step);
|
|
4629
|
+
}
|
|
4630
|
+
return reversed ? dates.reverse() : dates;
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfWeek.js
|
|
4634
|
+
function endOfWeek(date, options) {
|
|
4635
|
+
const defaultOptions4 = getDefaultOptions();
|
|
4636
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions4.weekStartsOn ?? defaultOptions4.locale?.options?.weekStartsOn ?? 0;
|
|
4637
|
+
const _date = toDate(date, options?.in);
|
|
4638
|
+
const day = _date.getDay();
|
|
4639
|
+
const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
|
|
4640
|
+
_date.setDate(_date.getDate() + diff);
|
|
4641
|
+
_date.setHours(23, 59, 59, 999);
|
|
4642
|
+
return _date;
|
|
4643
|
+
}
|
|
4644
|
+
|
|
4645
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfISOWeek.js
|
|
4646
|
+
function endOfISOWeek(date, options) {
|
|
4647
|
+
return endOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
4648
|
+
}
|
|
4649
|
+
|
|
4650
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
|
4651
|
+
var formatDistanceLocale = {
|
|
4652
|
+
lessThanXSeconds: {
|
|
4653
|
+
one: "less than a second",
|
|
4654
|
+
other: "less than {{count}} seconds"
|
|
4655
|
+
},
|
|
4656
|
+
xSeconds: {
|
|
4657
|
+
one: "1 second",
|
|
4658
|
+
other: "{{count}} seconds"
|
|
4659
|
+
},
|
|
4660
|
+
halfAMinute: "half a minute",
|
|
4661
|
+
lessThanXMinutes: {
|
|
4662
|
+
one: "less than a minute",
|
|
4663
|
+
other: "less than {{count}} minutes"
|
|
4664
|
+
},
|
|
4665
|
+
xMinutes: {
|
|
4666
|
+
one: "1 minute",
|
|
4667
|
+
other: "{{count}} minutes"
|
|
4668
|
+
},
|
|
4669
|
+
aboutXHours: {
|
|
4670
|
+
one: "about 1 hour",
|
|
4671
|
+
other: "about {{count}} hours"
|
|
4672
|
+
},
|
|
4673
|
+
xHours: {
|
|
4674
|
+
one: "1 hour",
|
|
4675
|
+
other: "{{count}} hours"
|
|
4676
|
+
},
|
|
4677
|
+
xDays: {
|
|
4678
|
+
one: "1 day",
|
|
4679
|
+
other: "{{count}} days"
|
|
4680
|
+
},
|
|
4681
|
+
aboutXWeeks: {
|
|
4682
|
+
one: "about 1 week",
|
|
4683
|
+
other: "about {{count}} weeks"
|
|
4684
|
+
},
|
|
4685
|
+
xWeeks: {
|
|
4686
|
+
one: "1 week",
|
|
4687
|
+
other: "{{count}} weeks"
|
|
4688
|
+
},
|
|
4689
|
+
aboutXMonths: {
|
|
4690
|
+
one: "about 1 month",
|
|
4691
|
+
other: "about {{count}} months"
|
|
4692
|
+
},
|
|
4693
|
+
xMonths: {
|
|
4694
|
+
one: "1 month",
|
|
4695
|
+
other: "{{count}} months"
|
|
4696
|
+
},
|
|
4697
|
+
aboutXYears: {
|
|
4698
|
+
one: "about 1 year",
|
|
4699
|
+
other: "about {{count}} years"
|
|
4700
|
+
},
|
|
4701
|
+
xYears: {
|
|
4702
|
+
one: "1 year",
|
|
4703
|
+
other: "{{count}} years"
|
|
4704
|
+
},
|
|
4705
|
+
overXYears: {
|
|
4706
|
+
one: "over 1 year",
|
|
4707
|
+
other: "over {{count}} years"
|
|
4708
|
+
},
|
|
4709
|
+
almostXYears: {
|
|
4710
|
+
one: "almost 1 year",
|
|
4711
|
+
other: "almost {{count}} years"
|
|
4712
|
+
}
|
|
4713
|
+
};
|
|
4714
|
+
var formatDistance = (token, count, options) => {
|
|
4715
|
+
let result;
|
|
4716
|
+
const tokenValue = formatDistanceLocale[token];
|
|
4717
|
+
if (typeof tokenValue === "string") {
|
|
4718
|
+
result = tokenValue;
|
|
4719
|
+
} else if (count === 1) {
|
|
4720
|
+
result = tokenValue.one;
|
|
4721
|
+
} else {
|
|
4722
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
4723
|
+
}
|
|
4724
|
+
if (options?.addSuffix) {
|
|
4725
|
+
if (options.comparison && options.comparison > 0) {
|
|
4726
|
+
return "in " + result;
|
|
4727
|
+
} else {
|
|
4728
|
+
return result + " ago";
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
return result;
|
|
4732
|
+
};
|
|
4733
|
+
|
|
4734
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
4735
|
+
function buildFormatLongFn(args) {
|
|
4736
|
+
return (options = {}) => {
|
|
4737
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
4738
|
+
const format2 = args.formats[width] || args.formats[args.defaultWidth];
|
|
4739
|
+
return format2;
|
|
4740
|
+
};
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4743
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js
|
|
4744
|
+
var dateFormats = {
|
|
4745
|
+
full: "EEEE, MMMM do, y",
|
|
4746
|
+
long: "MMMM do, y",
|
|
4747
|
+
medium: "MMM d, y",
|
|
4748
|
+
short: "MM/dd/yyyy"
|
|
4749
|
+
};
|
|
4750
|
+
var timeFormats = {
|
|
4751
|
+
full: "h:mm:ss a zzzz",
|
|
4752
|
+
long: "h:mm:ss a z",
|
|
4753
|
+
medium: "h:mm:ss a",
|
|
4754
|
+
short: "h:mm a"
|
|
4755
|
+
};
|
|
4756
|
+
var dateTimeFormats = {
|
|
4757
|
+
full: "{{date}} 'at' {{time}}",
|
|
4758
|
+
long: "{{date}} 'at' {{time}}",
|
|
4759
|
+
medium: "{{date}}, {{time}}",
|
|
4760
|
+
short: "{{date}}, {{time}}"
|
|
4761
|
+
};
|
|
4762
|
+
var formatLong = {
|
|
4763
|
+
date: buildFormatLongFn({
|
|
4764
|
+
formats: dateFormats,
|
|
4765
|
+
defaultWidth: "full"
|
|
4766
|
+
}),
|
|
4767
|
+
time: buildFormatLongFn({
|
|
4768
|
+
formats: timeFormats,
|
|
4769
|
+
defaultWidth: "full"
|
|
4770
|
+
}),
|
|
4771
|
+
dateTime: buildFormatLongFn({
|
|
4772
|
+
formats: dateTimeFormats,
|
|
4773
|
+
defaultWidth: "full"
|
|
4774
|
+
})
|
|
4775
|
+
};
|
|
4776
|
+
|
|
4777
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
|
|
4778
|
+
var formatRelativeLocale = {
|
|
4779
|
+
lastWeek: "'last' eeee 'at' p",
|
|
4780
|
+
yesterday: "'yesterday at' p",
|
|
4781
|
+
today: "'today at' p",
|
|
4782
|
+
tomorrow: "'tomorrow at' p",
|
|
4783
|
+
nextWeek: "eeee 'at' p",
|
|
4784
|
+
other: "P"
|
|
4785
|
+
};
|
|
4786
|
+
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
4787
|
+
|
|
4788
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
4789
|
+
function buildLocalizeFn(args) {
|
|
4790
|
+
return (value, options) => {
|
|
4791
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
4792
|
+
let valuesArray;
|
|
4793
|
+
if (context === "formatting" && args.formattingValues) {
|
|
4794
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
4795
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
4796
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
4797
|
+
} else {
|
|
4798
|
+
const defaultWidth = args.defaultWidth;
|
|
4799
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
4800
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
4801
|
+
}
|
|
4802
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
4803
|
+
return valuesArray[index];
|
|
4804
|
+
};
|
|
4805
|
+
}
|
|
4806
|
+
|
|
4807
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js
|
|
4808
|
+
var eraValues = {
|
|
4809
|
+
narrow: ["B", "A"],
|
|
4810
|
+
abbreviated: ["BC", "AD"],
|
|
4811
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
4812
|
+
};
|
|
4813
|
+
var quarterValues = {
|
|
4814
|
+
narrow: ["1", "2", "3", "4"],
|
|
4815
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
4816
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
4817
|
+
};
|
|
4818
|
+
var monthValues = {
|
|
4819
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
4820
|
+
abbreviated: [
|
|
4821
|
+
"Jan",
|
|
4822
|
+
"Feb",
|
|
4823
|
+
"Mar",
|
|
4824
|
+
"Apr",
|
|
4825
|
+
"May",
|
|
4826
|
+
"Jun",
|
|
4827
|
+
"Jul",
|
|
4828
|
+
"Aug",
|
|
4829
|
+
"Sep",
|
|
4830
|
+
"Oct",
|
|
4831
|
+
"Nov",
|
|
4832
|
+
"Dec"
|
|
4833
|
+
],
|
|
4834
|
+
wide: [
|
|
4835
|
+
"January",
|
|
4836
|
+
"February",
|
|
4837
|
+
"March",
|
|
4838
|
+
"April",
|
|
4839
|
+
"May",
|
|
4840
|
+
"June",
|
|
4841
|
+
"July",
|
|
4842
|
+
"August",
|
|
4843
|
+
"September",
|
|
4844
|
+
"October",
|
|
4845
|
+
"November",
|
|
4846
|
+
"December"
|
|
4847
|
+
]
|
|
4848
|
+
};
|
|
4849
|
+
var dayValues = {
|
|
4850
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
4851
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
4852
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
4853
|
+
wide: [
|
|
4854
|
+
"Sunday",
|
|
4855
|
+
"Monday",
|
|
4856
|
+
"Tuesday",
|
|
4857
|
+
"Wednesday",
|
|
4858
|
+
"Thursday",
|
|
4859
|
+
"Friday",
|
|
4860
|
+
"Saturday"
|
|
4861
|
+
]
|
|
4862
|
+
};
|
|
4863
|
+
var dayPeriodValues = {
|
|
4864
|
+
narrow: {
|
|
4865
|
+
am: "a",
|
|
4866
|
+
pm: "p",
|
|
4867
|
+
midnight: "mi",
|
|
4868
|
+
noon: "n",
|
|
4869
|
+
morning: "morning",
|
|
4870
|
+
afternoon: "afternoon",
|
|
4871
|
+
evening: "evening",
|
|
4872
|
+
night: "night"
|
|
4873
|
+
},
|
|
4874
|
+
abbreviated: {
|
|
4875
|
+
am: "AM",
|
|
4876
|
+
pm: "PM",
|
|
4877
|
+
midnight: "midnight",
|
|
4878
|
+
noon: "noon",
|
|
4879
|
+
morning: "morning",
|
|
4880
|
+
afternoon: "afternoon",
|
|
4881
|
+
evening: "evening",
|
|
4882
|
+
night: "night"
|
|
4883
|
+
},
|
|
4884
|
+
wide: {
|
|
4885
|
+
am: "a.m.",
|
|
4886
|
+
pm: "p.m.",
|
|
4887
|
+
midnight: "midnight",
|
|
4888
|
+
noon: "noon",
|
|
4889
|
+
morning: "morning",
|
|
4890
|
+
afternoon: "afternoon",
|
|
4891
|
+
evening: "evening",
|
|
4892
|
+
night: "night"
|
|
4893
|
+
}
|
|
4894
|
+
};
|
|
4895
|
+
var formattingDayPeriodValues = {
|
|
4896
|
+
narrow: {
|
|
4897
|
+
am: "a",
|
|
4898
|
+
pm: "p",
|
|
4899
|
+
midnight: "mi",
|
|
4900
|
+
noon: "n",
|
|
4901
|
+
morning: "in the morning",
|
|
4902
|
+
afternoon: "in the afternoon",
|
|
4903
|
+
evening: "in the evening",
|
|
4904
|
+
night: "at night"
|
|
4905
|
+
},
|
|
4906
|
+
abbreviated: {
|
|
4907
|
+
am: "AM",
|
|
4908
|
+
pm: "PM",
|
|
4909
|
+
midnight: "midnight",
|
|
4910
|
+
noon: "noon",
|
|
4911
|
+
morning: "in the morning",
|
|
4912
|
+
afternoon: "in the afternoon",
|
|
4913
|
+
evening: "in the evening",
|
|
4914
|
+
night: "at night"
|
|
4915
|
+
},
|
|
4916
|
+
wide: {
|
|
4917
|
+
am: "a.m.",
|
|
4918
|
+
pm: "p.m.",
|
|
4919
|
+
midnight: "midnight",
|
|
4920
|
+
noon: "noon",
|
|
4921
|
+
morning: "in the morning",
|
|
4922
|
+
afternoon: "in the afternoon",
|
|
4923
|
+
evening: "in the evening",
|
|
4924
|
+
night: "at night"
|
|
4925
|
+
}
|
|
4926
|
+
};
|
|
4927
|
+
var ordinalNumber = (dirtyNumber, _options) => {
|
|
4928
|
+
const number = Number(dirtyNumber);
|
|
4929
|
+
const rem100 = number % 100;
|
|
4930
|
+
if (rem100 > 20 || rem100 < 10) {
|
|
4931
|
+
switch (rem100 % 10) {
|
|
4932
|
+
case 1:
|
|
4933
|
+
return number + "st";
|
|
4934
|
+
case 2:
|
|
4935
|
+
return number + "nd";
|
|
4936
|
+
case 3:
|
|
4937
|
+
return number + "rd";
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
return number + "th";
|
|
4941
|
+
};
|
|
4942
|
+
var localize = {
|
|
4943
|
+
ordinalNumber,
|
|
4944
|
+
era: buildLocalizeFn({
|
|
4945
|
+
values: eraValues,
|
|
4946
|
+
defaultWidth: "wide"
|
|
4947
|
+
}),
|
|
4948
|
+
quarter: buildLocalizeFn({
|
|
4949
|
+
values: quarterValues,
|
|
4950
|
+
defaultWidth: "wide",
|
|
4951
|
+
argumentCallback: (quarter) => quarter - 1
|
|
4952
|
+
}),
|
|
4953
|
+
month: buildLocalizeFn({
|
|
4954
|
+
values: monthValues,
|
|
4955
|
+
defaultWidth: "wide"
|
|
4956
|
+
}),
|
|
4957
|
+
day: buildLocalizeFn({
|
|
4958
|
+
values: dayValues,
|
|
4959
|
+
defaultWidth: "wide"
|
|
4960
|
+
}),
|
|
4961
|
+
dayPeriod: buildLocalizeFn({
|
|
4962
|
+
values: dayPeriodValues,
|
|
4963
|
+
defaultWidth: "wide",
|
|
4964
|
+
formattingValues: formattingDayPeriodValues,
|
|
4965
|
+
defaultFormattingWidth: "wide"
|
|
4966
|
+
})
|
|
4967
|
+
};
|
|
4968
|
+
|
|
4969
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
4970
|
+
function buildMatchFn(args) {
|
|
4971
|
+
return (string, options = {}) => {
|
|
4972
|
+
const width = options.width;
|
|
4973
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
4974
|
+
const matchResult = string.match(matchPattern);
|
|
4975
|
+
if (!matchResult) {
|
|
4976
|
+
return null;
|
|
4977
|
+
}
|
|
4978
|
+
const matchedString = matchResult[0];
|
|
4979
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
4980
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
4981
|
+
// [TODO] -- I challenge you to fix the type
|
|
4982
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
4983
|
+
);
|
|
4984
|
+
let value;
|
|
4985
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
4986
|
+
value = options.valueCallback ? (
|
|
4987
|
+
// [TODO] -- I challenge you to fix the type
|
|
4988
|
+
options.valueCallback(value)
|
|
4989
|
+
) : value;
|
|
4990
|
+
const rest = string.slice(matchedString.length);
|
|
4991
|
+
return { value, rest };
|
|
4992
|
+
};
|
|
4993
|
+
}
|
|
4994
|
+
function findKey(object, predicate) {
|
|
4995
|
+
for (const key in object) {
|
|
4996
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
4997
|
+
return key;
|
|
4998
|
+
}
|
|
4999
|
+
}
|
|
5000
|
+
return void 0;
|
|
5001
|
+
}
|
|
5002
|
+
function findIndex(array, predicate) {
|
|
5003
|
+
for (let key = 0; key < array.length; key++) {
|
|
5004
|
+
if (predicate(array[key])) {
|
|
5005
|
+
return key;
|
|
5006
|
+
}
|
|
5007
|
+
}
|
|
5008
|
+
return void 0;
|
|
5009
|
+
}
|
|
5010
|
+
|
|
5011
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
5012
|
+
function buildMatchPatternFn(args) {
|
|
5013
|
+
return (string, options = {}) => {
|
|
5014
|
+
const matchResult = string.match(args.matchPattern);
|
|
5015
|
+
if (!matchResult) return null;
|
|
5016
|
+
const matchedString = matchResult[0];
|
|
5017
|
+
const parseResult = string.match(args.parsePattern);
|
|
5018
|
+
if (!parseResult) return null;
|
|
5019
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
5020
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
5021
|
+
const rest = string.slice(matchedString.length);
|
|
5022
|
+
return { value, rest };
|
|
5023
|
+
};
|
|
5024
|
+
}
|
|
5025
|
+
|
|
5026
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js
|
|
5027
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
5028
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
|
5029
|
+
var matchEraPatterns = {
|
|
5030
|
+
narrow: /^(b|a)/i,
|
|
5031
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
5032
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
5033
|
+
};
|
|
5034
|
+
var parseEraPatterns = {
|
|
5035
|
+
any: [/^b/i, /^(a|c)/i]
|
|
5036
|
+
};
|
|
5037
|
+
var matchQuarterPatterns = {
|
|
5038
|
+
narrow: /^[1234]/i,
|
|
5039
|
+
abbreviated: /^q[1234]/i,
|
|
5040
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
5041
|
+
};
|
|
5042
|
+
var parseQuarterPatterns = {
|
|
5043
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
5044
|
+
};
|
|
5045
|
+
var matchMonthPatterns = {
|
|
5046
|
+
narrow: /^[jfmasond]/i,
|
|
5047
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
5048
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
5049
|
+
};
|
|
5050
|
+
var parseMonthPatterns = {
|
|
5051
|
+
narrow: [
|
|
5052
|
+
/^j/i,
|
|
5053
|
+
/^f/i,
|
|
5054
|
+
/^m/i,
|
|
5055
|
+
/^a/i,
|
|
5056
|
+
/^m/i,
|
|
5057
|
+
/^j/i,
|
|
5058
|
+
/^j/i,
|
|
5059
|
+
/^a/i,
|
|
5060
|
+
/^s/i,
|
|
5061
|
+
/^o/i,
|
|
5062
|
+
/^n/i,
|
|
5063
|
+
/^d/i
|
|
5064
|
+
],
|
|
5065
|
+
any: [
|
|
5066
|
+
/^ja/i,
|
|
5067
|
+
/^f/i,
|
|
5068
|
+
/^mar/i,
|
|
5069
|
+
/^ap/i,
|
|
5070
|
+
/^may/i,
|
|
5071
|
+
/^jun/i,
|
|
5072
|
+
/^jul/i,
|
|
5073
|
+
/^au/i,
|
|
5074
|
+
/^s/i,
|
|
5075
|
+
/^o/i,
|
|
5076
|
+
/^n/i,
|
|
5077
|
+
/^d/i
|
|
5078
|
+
]
|
|
5079
|
+
};
|
|
5080
|
+
var matchDayPatterns = {
|
|
5081
|
+
narrow: /^[smtwf]/i,
|
|
5082
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
5083
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
5084
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
5085
|
+
};
|
|
5086
|
+
var parseDayPatterns = {
|
|
5087
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
5088
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
5089
|
+
};
|
|
5090
|
+
var matchDayPeriodPatterns = {
|
|
5091
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
5092
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
5093
|
+
};
|
|
5094
|
+
var parseDayPeriodPatterns = {
|
|
5095
|
+
any: {
|
|
5096
|
+
am: /^a/i,
|
|
5097
|
+
pm: /^p/i,
|
|
5098
|
+
midnight: /^mi/i,
|
|
5099
|
+
noon: /^no/i,
|
|
5100
|
+
morning: /morning/i,
|
|
5101
|
+
afternoon: /afternoon/i,
|
|
5102
|
+
evening: /evening/i,
|
|
5103
|
+
night: /night/i
|
|
5104
|
+
}
|
|
5105
|
+
};
|
|
5106
|
+
var match = {
|
|
5107
|
+
ordinalNumber: buildMatchPatternFn({
|
|
5108
|
+
matchPattern: matchOrdinalNumberPattern,
|
|
5109
|
+
parsePattern: parseOrdinalNumberPattern,
|
|
5110
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
5111
|
+
}),
|
|
5112
|
+
era: buildMatchFn({
|
|
5113
|
+
matchPatterns: matchEraPatterns,
|
|
5114
|
+
defaultMatchWidth: "wide",
|
|
5115
|
+
parsePatterns: parseEraPatterns,
|
|
5116
|
+
defaultParseWidth: "any"
|
|
5117
|
+
}),
|
|
5118
|
+
quarter: buildMatchFn({
|
|
5119
|
+
matchPatterns: matchQuarterPatterns,
|
|
5120
|
+
defaultMatchWidth: "wide",
|
|
5121
|
+
parsePatterns: parseQuarterPatterns,
|
|
5122
|
+
defaultParseWidth: "any",
|
|
5123
|
+
valueCallback: (index) => index + 1
|
|
5124
|
+
}),
|
|
5125
|
+
month: buildMatchFn({
|
|
5126
|
+
matchPatterns: matchMonthPatterns,
|
|
5127
|
+
defaultMatchWidth: "wide",
|
|
5128
|
+
parsePatterns: parseMonthPatterns,
|
|
5129
|
+
defaultParseWidth: "any"
|
|
5130
|
+
}),
|
|
5131
|
+
day: buildMatchFn({
|
|
5132
|
+
matchPatterns: matchDayPatterns,
|
|
5133
|
+
defaultMatchWidth: "wide",
|
|
5134
|
+
parsePatterns: parseDayPatterns,
|
|
5135
|
+
defaultParseWidth: "any"
|
|
5136
|
+
}),
|
|
5137
|
+
dayPeriod: buildMatchFn({
|
|
5138
|
+
matchPatterns: matchDayPeriodPatterns,
|
|
5139
|
+
defaultMatchWidth: "any",
|
|
5140
|
+
parsePatterns: parseDayPeriodPatterns,
|
|
5141
|
+
defaultParseWidth: "any"
|
|
5142
|
+
})
|
|
5143
|
+
};
|
|
5144
|
+
|
|
5145
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js
|
|
5146
|
+
var enUS = {
|
|
5147
|
+
code: "en-US",
|
|
5148
|
+
formatDistance,
|
|
5149
|
+
formatLong,
|
|
5150
|
+
formatRelative,
|
|
5151
|
+
localize,
|
|
5152
|
+
match,
|
|
5153
|
+
options: {
|
|
5154
|
+
weekStartsOn: 0,
|
|
5155
|
+
firstWeekContainsDate: 1
|
|
5156
|
+
}
|
|
5157
|
+
};
|
|
5158
|
+
|
|
5159
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js
|
|
5160
|
+
function getDayOfYear(date, options) {
|
|
5161
|
+
const _date = toDate(date, options?.in);
|
|
5162
|
+
const diff = differenceInCalendarDays(_date, startOfYear(_date));
|
|
5163
|
+
const dayOfYear = diff + 1;
|
|
5164
|
+
return dayOfYear;
|
|
5165
|
+
}
|
|
5166
|
+
|
|
5167
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js
|
|
5168
|
+
function getISOWeek(date, options) {
|
|
5169
|
+
const _date = toDate(date, options?.in);
|
|
5170
|
+
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
|
5171
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
5172
|
+
}
|
|
5173
|
+
|
|
5174
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js
|
|
5175
|
+
function getWeekYear(date, options) {
|
|
5176
|
+
const _date = toDate(date, options?.in);
|
|
5177
|
+
const year = _date.getFullYear();
|
|
5178
|
+
const defaultOptions4 = getDefaultOptions();
|
|
5179
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions4.firstWeekContainsDate ?? defaultOptions4.locale?.options?.firstWeekContainsDate ?? 1;
|
|
5180
|
+
const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
|
|
5181
|
+
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
5182
|
+
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
5183
|
+
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
|
|
5184
|
+
const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
|
|
5185
|
+
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
5186
|
+
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
5187
|
+
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
|
|
5188
|
+
if (+_date >= +startOfNextYear) {
|
|
5189
|
+
return year + 1;
|
|
5190
|
+
} else if (+_date >= +startOfThisYear) {
|
|
5191
|
+
return year;
|
|
5192
|
+
} else {
|
|
5193
|
+
return year - 1;
|
|
5194
|
+
}
|
|
5195
|
+
}
|
|
5196
|
+
|
|
5197
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js
|
|
5198
|
+
function startOfWeekYear(date, options) {
|
|
5199
|
+
const defaultOptions4 = getDefaultOptions();
|
|
5200
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions4.firstWeekContainsDate ?? defaultOptions4.locale?.options?.firstWeekContainsDate ?? 1;
|
|
5201
|
+
const year = getWeekYear(date, options);
|
|
5202
|
+
const firstWeek = constructFrom(options?.in || date, 0);
|
|
5203
|
+
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
5204
|
+
firstWeek.setHours(0, 0, 0, 0);
|
|
5205
|
+
const _date = startOfWeek(firstWeek, options);
|
|
5206
|
+
return _date;
|
|
5207
|
+
}
|
|
5208
|
+
|
|
5209
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js
|
|
5210
|
+
function getWeek(date, options) {
|
|
5211
|
+
const _date = toDate(date, options?.in);
|
|
5212
|
+
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
|
|
5213
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
5214
|
+
}
|
|
5215
|
+
|
|
5216
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/addLeadingZeros.js
|
|
5217
|
+
function addLeadingZeros(number, targetLength) {
|
|
5218
|
+
const sign = number < 0 ? "-" : "";
|
|
5219
|
+
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
|
5220
|
+
return sign + output;
|
|
5221
|
+
}
|
|
5222
|
+
|
|
5223
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/lightFormatters.js
|
|
5224
|
+
var lightFormatters = {
|
|
5225
|
+
// Year
|
|
5226
|
+
y(date, token) {
|
|
5227
|
+
const signedYear = date.getFullYear();
|
|
5228
|
+
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
5229
|
+
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
|
5230
|
+
},
|
|
5231
|
+
// Month
|
|
5232
|
+
M(date, token) {
|
|
5233
|
+
const month = date.getMonth();
|
|
5234
|
+
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
5235
|
+
},
|
|
5236
|
+
// Day of the month
|
|
5237
|
+
d(date, token) {
|
|
5238
|
+
return addLeadingZeros(date.getDate(), token.length);
|
|
5239
|
+
},
|
|
5240
|
+
// AM or PM
|
|
5241
|
+
a(date, token) {
|
|
5242
|
+
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
|
5243
|
+
switch (token) {
|
|
5244
|
+
case "a":
|
|
5245
|
+
case "aa":
|
|
5246
|
+
return dayPeriodEnumValue.toUpperCase();
|
|
5247
|
+
case "aaa":
|
|
5248
|
+
return dayPeriodEnumValue;
|
|
5249
|
+
case "aaaaa":
|
|
5250
|
+
return dayPeriodEnumValue[0];
|
|
5251
|
+
case "aaaa":
|
|
5252
|
+
default:
|
|
5253
|
+
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
5254
|
+
}
|
|
5255
|
+
},
|
|
5256
|
+
// Hour [1-12]
|
|
5257
|
+
h(date, token) {
|
|
5258
|
+
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
|
5259
|
+
},
|
|
5260
|
+
// Hour [0-23]
|
|
5261
|
+
H(date, token) {
|
|
5262
|
+
return addLeadingZeros(date.getHours(), token.length);
|
|
5263
|
+
},
|
|
5264
|
+
// Minute
|
|
5265
|
+
m(date, token) {
|
|
5266
|
+
return addLeadingZeros(date.getMinutes(), token.length);
|
|
5267
|
+
},
|
|
5268
|
+
// Second
|
|
5269
|
+
s(date, token) {
|
|
5270
|
+
return addLeadingZeros(date.getSeconds(), token.length);
|
|
5271
|
+
},
|
|
5272
|
+
// Fraction of second
|
|
5273
|
+
S(date, token) {
|
|
5274
|
+
const numberOfDigits = token.length;
|
|
5275
|
+
const milliseconds = date.getMilliseconds();
|
|
5276
|
+
const fractionalSeconds = Math.trunc(
|
|
5277
|
+
milliseconds * Math.pow(10, numberOfDigits - 3)
|
|
5278
|
+
);
|
|
5279
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
5280
|
+
}
|
|
5281
|
+
};
|
|
5282
|
+
|
|
5283
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js
|
|
5284
|
+
var dayPeriodEnum = {
|
|
5285
|
+
midnight: "midnight",
|
|
5286
|
+
noon: "noon",
|
|
5287
|
+
morning: "morning",
|
|
5288
|
+
afternoon: "afternoon",
|
|
5289
|
+
evening: "evening",
|
|
5290
|
+
night: "night"
|
|
5291
|
+
};
|
|
5292
|
+
var formatters = {
|
|
5293
|
+
// Era
|
|
5294
|
+
G: function(date, token, localize2) {
|
|
5295
|
+
const era = date.getFullYear() > 0 ? 1 : 0;
|
|
5296
|
+
switch (token) {
|
|
5297
|
+
// AD, BC
|
|
5298
|
+
case "G":
|
|
5299
|
+
case "GG":
|
|
5300
|
+
case "GGG":
|
|
5301
|
+
return localize2.era(era, { width: "abbreviated" });
|
|
5302
|
+
// A, B
|
|
5303
|
+
case "GGGGG":
|
|
5304
|
+
return localize2.era(era, { width: "narrow" });
|
|
5305
|
+
// Anno Domini, Before Christ
|
|
5306
|
+
case "GGGG":
|
|
5307
|
+
default:
|
|
5308
|
+
return localize2.era(era, { width: "wide" });
|
|
5309
|
+
}
|
|
5310
|
+
},
|
|
5311
|
+
// Year
|
|
5312
|
+
y: function(date, token, localize2) {
|
|
5313
|
+
if (token === "yo") {
|
|
5314
|
+
const signedYear = date.getFullYear();
|
|
5315
|
+
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
5316
|
+
return localize2.ordinalNumber(year, { unit: "year" });
|
|
5317
|
+
}
|
|
5318
|
+
return lightFormatters.y(date, token);
|
|
5319
|
+
},
|
|
5320
|
+
// Local week-numbering year
|
|
5321
|
+
Y: function(date, token, localize2, options) {
|
|
5322
|
+
const signedWeekYear = getWeekYear(date, options);
|
|
5323
|
+
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
5324
|
+
if (token === "YY") {
|
|
5325
|
+
const twoDigitYear = weekYear % 100;
|
|
5326
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
5327
|
+
}
|
|
5328
|
+
if (token === "Yo") {
|
|
5329
|
+
return localize2.ordinalNumber(weekYear, { unit: "year" });
|
|
5330
|
+
}
|
|
5331
|
+
return addLeadingZeros(weekYear, token.length);
|
|
5332
|
+
},
|
|
5333
|
+
// ISO week-numbering year
|
|
5334
|
+
R: function(date, token) {
|
|
5335
|
+
const isoWeekYear = getISOWeekYear(date);
|
|
5336
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
5337
|
+
},
|
|
5338
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
5339
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
5340
|
+
// | Year | `y` | `u` |
|
|
5341
|
+
// |------|-----|-----|
|
|
5342
|
+
// | AC 1 | 1 | 1 |
|
|
5343
|
+
// | BC 1 | 1 | 0 |
|
|
5344
|
+
// | BC 2 | 2 | -1 |
|
|
5345
|
+
// Also `yy` always returns the last two digits of a year,
|
|
5346
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
5347
|
+
u: function(date, token) {
|
|
5348
|
+
const year = date.getFullYear();
|
|
5349
|
+
return addLeadingZeros(year, token.length);
|
|
5350
|
+
},
|
|
5351
|
+
// Quarter
|
|
5352
|
+
Q: function(date, token, localize2) {
|
|
5353
|
+
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
5354
|
+
switch (token) {
|
|
5355
|
+
// 1, 2, 3, 4
|
|
5356
|
+
case "Q":
|
|
5357
|
+
return String(quarter);
|
|
5358
|
+
// 01, 02, 03, 04
|
|
5359
|
+
case "QQ":
|
|
5360
|
+
return addLeadingZeros(quarter, 2);
|
|
5361
|
+
// 1st, 2nd, 3rd, 4th
|
|
5362
|
+
case "Qo":
|
|
5363
|
+
return localize2.ordinalNumber(quarter, { unit: "quarter" });
|
|
5364
|
+
// Q1, Q2, Q3, Q4
|
|
5365
|
+
case "QQQ":
|
|
5366
|
+
return localize2.quarter(quarter, {
|
|
5367
|
+
width: "abbreviated",
|
|
5368
|
+
context: "formatting"
|
|
5369
|
+
});
|
|
5370
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
5371
|
+
case "QQQQQ":
|
|
5372
|
+
return localize2.quarter(quarter, {
|
|
5373
|
+
width: "narrow",
|
|
5374
|
+
context: "formatting"
|
|
5375
|
+
});
|
|
5376
|
+
// 1st quarter, 2nd quarter, ...
|
|
5377
|
+
case "QQQQ":
|
|
5378
|
+
default:
|
|
5379
|
+
return localize2.quarter(quarter, {
|
|
5380
|
+
width: "wide",
|
|
5381
|
+
context: "formatting"
|
|
5382
|
+
});
|
|
5383
|
+
}
|
|
5384
|
+
},
|
|
5385
|
+
// Stand-alone quarter
|
|
5386
|
+
q: function(date, token, localize2) {
|
|
5387
|
+
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
5388
|
+
switch (token) {
|
|
5389
|
+
// 1, 2, 3, 4
|
|
5390
|
+
case "q":
|
|
5391
|
+
return String(quarter);
|
|
5392
|
+
// 01, 02, 03, 04
|
|
5393
|
+
case "qq":
|
|
5394
|
+
return addLeadingZeros(quarter, 2);
|
|
5395
|
+
// 1st, 2nd, 3rd, 4th
|
|
5396
|
+
case "qo":
|
|
5397
|
+
return localize2.ordinalNumber(quarter, { unit: "quarter" });
|
|
5398
|
+
// Q1, Q2, Q3, Q4
|
|
5399
|
+
case "qqq":
|
|
5400
|
+
return localize2.quarter(quarter, {
|
|
5401
|
+
width: "abbreviated",
|
|
5402
|
+
context: "standalone"
|
|
5403
|
+
});
|
|
5404
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
5405
|
+
case "qqqqq":
|
|
5406
|
+
return localize2.quarter(quarter, {
|
|
5407
|
+
width: "narrow",
|
|
5408
|
+
context: "standalone"
|
|
5409
|
+
});
|
|
5410
|
+
// 1st quarter, 2nd quarter, ...
|
|
5411
|
+
case "qqqq":
|
|
5412
|
+
default:
|
|
5413
|
+
return localize2.quarter(quarter, {
|
|
5414
|
+
width: "wide",
|
|
5415
|
+
context: "standalone"
|
|
5416
|
+
});
|
|
5417
|
+
}
|
|
5418
|
+
},
|
|
5419
|
+
// Month
|
|
5420
|
+
M: function(date, token, localize2) {
|
|
5421
|
+
const month = date.getMonth();
|
|
5422
|
+
switch (token) {
|
|
5423
|
+
case "M":
|
|
5424
|
+
case "MM":
|
|
5425
|
+
return lightFormatters.M(date, token);
|
|
5426
|
+
// 1st, 2nd, ..., 12th
|
|
5427
|
+
case "Mo":
|
|
5428
|
+
return localize2.ordinalNumber(month + 1, { unit: "month" });
|
|
5429
|
+
// Jan, Feb, ..., Dec
|
|
5430
|
+
case "MMM":
|
|
5431
|
+
return localize2.month(month, {
|
|
5432
|
+
width: "abbreviated",
|
|
5433
|
+
context: "formatting"
|
|
5434
|
+
});
|
|
5435
|
+
// J, F, ..., D
|
|
5436
|
+
case "MMMMM":
|
|
5437
|
+
return localize2.month(month, {
|
|
5438
|
+
width: "narrow",
|
|
5439
|
+
context: "formatting"
|
|
5440
|
+
});
|
|
5441
|
+
// January, February, ..., December
|
|
5442
|
+
case "MMMM":
|
|
5443
|
+
default:
|
|
5444
|
+
return localize2.month(month, { width: "wide", context: "formatting" });
|
|
5445
|
+
}
|
|
5446
|
+
},
|
|
5447
|
+
// Stand-alone month
|
|
5448
|
+
L: function(date, token, localize2) {
|
|
5449
|
+
const month = date.getMonth();
|
|
5450
|
+
switch (token) {
|
|
5451
|
+
// 1, 2, ..., 12
|
|
5452
|
+
case "L":
|
|
5453
|
+
return String(month + 1);
|
|
5454
|
+
// 01, 02, ..., 12
|
|
5455
|
+
case "LL":
|
|
5456
|
+
return addLeadingZeros(month + 1, 2);
|
|
5457
|
+
// 1st, 2nd, ..., 12th
|
|
5458
|
+
case "Lo":
|
|
5459
|
+
return localize2.ordinalNumber(month + 1, { unit: "month" });
|
|
5460
|
+
// Jan, Feb, ..., Dec
|
|
5461
|
+
case "LLL":
|
|
5462
|
+
return localize2.month(month, {
|
|
5463
|
+
width: "abbreviated",
|
|
5464
|
+
context: "standalone"
|
|
5465
|
+
});
|
|
5466
|
+
// J, F, ..., D
|
|
5467
|
+
case "LLLLL":
|
|
5468
|
+
return localize2.month(month, {
|
|
5469
|
+
width: "narrow",
|
|
5470
|
+
context: "standalone"
|
|
5471
|
+
});
|
|
5472
|
+
// January, February, ..., December
|
|
5473
|
+
case "LLLL":
|
|
5474
|
+
default:
|
|
5475
|
+
return localize2.month(month, { width: "wide", context: "standalone" });
|
|
5476
|
+
}
|
|
5477
|
+
},
|
|
5478
|
+
// Local week of year
|
|
5479
|
+
w: function(date, token, localize2, options) {
|
|
5480
|
+
const week = getWeek(date, options);
|
|
5481
|
+
if (token === "wo") {
|
|
5482
|
+
return localize2.ordinalNumber(week, { unit: "week" });
|
|
5483
|
+
}
|
|
5484
|
+
return addLeadingZeros(week, token.length);
|
|
5485
|
+
},
|
|
5486
|
+
// ISO week of year
|
|
5487
|
+
I: function(date, token, localize2) {
|
|
5488
|
+
const isoWeek = getISOWeek(date);
|
|
5489
|
+
if (token === "Io") {
|
|
5490
|
+
return localize2.ordinalNumber(isoWeek, { unit: "week" });
|
|
5491
|
+
}
|
|
5492
|
+
return addLeadingZeros(isoWeek, token.length);
|
|
5493
|
+
},
|
|
5494
|
+
// Day of the month
|
|
5495
|
+
d: function(date, token, localize2) {
|
|
5496
|
+
if (token === "do") {
|
|
5497
|
+
return localize2.ordinalNumber(date.getDate(), { unit: "date" });
|
|
5498
|
+
}
|
|
5499
|
+
return lightFormatters.d(date, token);
|
|
5500
|
+
},
|
|
5501
|
+
// Day of year
|
|
5502
|
+
D: function(date, token, localize2) {
|
|
5503
|
+
const dayOfYear = getDayOfYear(date);
|
|
5504
|
+
if (token === "Do") {
|
|
5505
|
+
return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
|
5506
|
+
}
|
|
5507
|
+
return addLeadingZeros(dayOfYear, token.length);
|
|
5508
|
+
},
|
|
5509
|
+
// Day of week
|
|
5510
|
+
E: function(date, token, localize2) {
|
|
5511
|
+
const dayOfWeek = date.getDay();
|
|
5512
|
+
switch (token) {
|
|
5513
|
+
// Tue
|
|
5514
|
+
case "E":
|
|
5515
|
+
case "EE":
|
|
5516
|
+
case "EEE":
|
|
5517
|
+
return localize2.day(dayOfWeek, {
|
|
5518
|
+
width: "abbreviated",
|
|
5519
|
+
context: "formatting"
|
|
5520
|
+
});
|
|
5521
|
+
// T
|
|
5522
|
+
case "EEEEE":
|
|
5523
|
+
return localize2.day(dayOfWeek, {
|
|
5524
|
+
width: "narrow",
|
|
5525
|
+
context: "formatting"
|
|
5526
|
+
});
|
|
5527
|
+
// Tu
|
|
5528
|
+
case "EEEEEE":
|
|
5529
|
+
return localize2.day(dayOfWeek, {
|
|
5530
|
+
width: "short",
|
|
5531
|
+
context: "formatting"
|
|
5532
|
+
});
|
|
5533
|
+
// Tuesday
|
|
5534
|
+
case "EEEE":
|
|
5535
|
+
default:
|
|
5536
|
+
return localize2.day(dayOfWeek, {
|
|
5537
|
+
width: "wide",
|
|
5538
|
+
context: "formatting"
|
|
5539
|
+
});
|
|
5540
|
+
}
|
|
5541
|
+
},
|
|
5542
|
+
// Local day of week
|
|
5543
|
+
e: function(date, token, localize2, options) {
|
|
5544
|
+
const dayOfWeek = date.getDay();
|
|
5545
|
+
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
5546
|
+
switch (token) {
|
|
5547
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
5548
|
+
case "e":
|
|
5549
|
+
return String(localDayOfWeek);
|
|
5550
|
+
// Padded numerical value
|
|
5551
|
+
case "ee":
|
|
5552
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
|
5553
|
+
// 1st, 2nd, ..., 7th
|
|
5554
|
+
case "eo":
|
|
5555
|
+
return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
5556
|
+
case "eee":
|
|
5557
|
+
return localize2.day(dayOfWeek, {
|
|
5558
|
+
width: "abbreviated",
|
|
5559
|
+
context: "formatting"
|
|
5560
|
+
});
|
|
5561
|
+
// T
|
|
5562
|
+
case "eeeee":
|
|
5563
|
+
return localize2.day(dayOfWeek, {
|
|
5564
|
+
width: "narrow",
|
|
5565
|
+
context: "formatting"
|
|
5566
|
+
});
|
|
5567
|
+
// Tu
|
|
5568
|
+
case "eeeeee":
|
|
5569
|
+
return localize2.day(dayOfWeek, {
|
|
5570
|
+
width: "short",
|
|
5571
|
+
context: "formatting"
|
|
5572
|
+
});
|
|
5573
|
+
// Tuesday
|
|
5574
|
+
case "eeee":
|
|
5575
|
+
default:
|
|
5576
|
+
return localize2.day(dayOfWeek, {
|
|
5577
|
+
width: "wide",
|
|
5578
|
+
context: "formatting"
|
|
5579
|
+
});
|
|
5580
|
+
}
|
|
5581
|
+
},
|
|
5582
|
+
// Stand-alone local day of week
|
|
5583
|
+
c: function(date, token, localize2, options) {
|
|
5584
|
+
const dayOfWeek = date.getDay();
|
|
5585
|
+
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
5586
|
+
switch (token) {
|
|
5587
|
+
// Numerical value (same as in `e`)
|
|
5588
|
+
case "c":
|
|
5589
|
+
return String(localDayOfWeek);
|
|
5590
|
+
// Padded numerical value
|
|
5591
|
+
case "cc":
|
|
5592
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
|
5593
|
+
// 1st, 2nd, ..., 7th
|
|
5594
|
+
case "co":
|
|
5595
|
+
return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
5596
|
+
case "ccc":
|
|
5597
|
+
return localize2.day(dayOfWeek, {
|
|
5598
|
+
width: "abbreviated",
|
|
5599
|
+
context: "standalone"
|
|
5600
|
+
});
|
|
5601
|
+
// T
|
|
5602
|
+
case "ccccc":
|
|
5603
|
+
return localize2.day(dayOfWeek, {
|
|
5604
|
+
width: "narrow",
|
|
5605
|
+
context: "standalone"
|
|
5606
|
+
});
|
|
5607
|
+
// Tu
|
|
5608
|
+
case "cccccc":
|
|
5609
|
+
return localize2.day(dayOfWeek, {
|
|
5610
|
+
width: "short",
|
|
5611
|
+
context: "standalone"
|
|
5612
|
+
});
|
|
5613
|
+
// Tuesday
|
|
5614
|
+
case "cccc":
|
|
5615
|
+
default:
|
|
5616
|
+
return localize2.day(dayOfWeek, {
|
|
5617
|
+
width: "wide",
|
|
5618
|
+
context: "standalone"
|
|
5619
|
+
});
|
|
5620
|
+
}
|
|
5621
|
+
},
|
|
5622
|
+
// ISO day of week
|
|
5623
|
+
i: function(date, token, localize2) {
|
|
5624
|
+
const dayOfWeek = date.getDay();
|
|
5625
|
+
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
5626
|
+
switch (token) {
|
|
5627
|
+
// 2
|
|
5628
|
+
case "i":
|
|
5629
|
+
return String(isoDayOfWeek);
|
|
5630
|
+
// 02
|
|
5631
|
+
case "ii":
|
|
5632
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
5633
|
+
// 2nd
|
|
5634
|
+
case "io":
|
|
5635
|
+
return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
|
5636
|
+
// Tue
|
|
5637
|
+
case "iii":
|
|
5638
|
+
return localize2.day(dayOfWeek, {
|
|
5639
|
+
width: "abbreviated",
|
|
5640
|
+
context: "formatting"
|
|
5641
|
+
});
|
|
5642
|
+
// T
|
|
5643
|
+
case "iiiii":
|
|
5644
|
+
return localize2.day(dayOfWeek, {
|
|
5645
|
+
width: "narrow",
|
|
5646
|
+
context: "formatting"
|
|
5647
|
+
});
|
|
5648
|
+
// Tu
|
|
5649
|
+
case "iiiiii":
|
|
5650
|
+
return localize2.day(dayOfWeek, {
|
|
5651
|
+
width: "short",
|
|
5652
|
+
context: "formatting"
|
|
5653
|
+
});
|
|
5654
|
+
// Tuesday
|
|
5655
|
+
case "iiii":
|
|
5656
|
+
default:
|
|
5657
|
+
return localize2.day(dayOfWeek, {
|
|
5658
|
+
width: "wide",
|
|
5659
|
+
context: "formatting"
|
|
5660
|
+
});
|
|
5661
|
+
}
|
|
5662
|
+
},
|
|
5663
|
+
// AM or PM
|
|
5664
|
+
a: function(date, token, localize2) {
|
|
5665
|
+
const hours = date.getHours();
|
|
5666
|
+
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
5667
|
+
switch (token) {
|
|
5668
|
+
case "a":
|
|
5669
|
+
case "aa":
|
|
5670
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5671
|
+
width: "abbreviated",
|
|
5672
|
+
context: "formatting"
|
|
5673
|
+
});
|
|
5674
|
+
case "aaa":
|
|
5675
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5676
|
+
width: "abbreviated",
|
|
5677
|
+
context: "formatting"
|
|
5678
|
+
}).toLowerCase();
|
|
5679
|
+
case "aaaaa":
|
|
5680
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5681
|
+
width: "narrow",
|
|
5682
|
+
context: "formatting"
|
|
5683
|
+
});
|
|
5684
|
+
case "aaaa":
|
|
5685
|
+
default:
|
|
5686
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5687
|
+
width: "wide",
|
|
5688
|
+
context: "formatting"
|
|
5689
|
+
});
|
|
5690
|
+
}
|
|
5691
|
+
},
|
|
5692
|
+
// AM, PM, midnight, noon
|
|
5693
|
+
b: function(date, token, localize2) {
|
|
5694
|
+
const hours = date.getHours();
|
|
5695
|
+
let dayPeriodEnumValue;
|
|
5696
|
+
if (hours === 12) {
|
|
5697
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
5698
|
+
} else if (hours === 0) {
|
|
5699
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
5700
|
+
} else {
|
|
5701
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
5702
|
+
}
|
|
5703
|
+
switch (token) {
|
|
5704
|
+
case "b":
|
|
5705
|
+
case "bb":
|
|
5706
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5707
|
+
width: "abbreviated",
|
|
5708
|
+
context: "formatting"
|
|
5709
|
+
});
|
|
5710
|
+
case "bbb":
|
|
5711
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5712
|
+
width: "abbreviated",
|
|
5713
|
+
context: "formatting"
|
|
5714
|
+
}).toLowerCase();
|
|
5715
|
+
case "bbbbb":
|
|
5716
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5717
|
+
width: "narrow",
|
|
5718
|
+
context: "formatting"
|
|
5719
|
+
});
|
|
5720
|
+
case "bbbb":
|
|
5721
|
+
default:
|
|
5722
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5723
|
+
width: "wide",
|
|
5724
|
+
context: "formatting"
|
|
5725
|
+
});
|
|
5726
|
+
}
|
|
5727
|
+
},
|
|
5728
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
5729
|
+
B: function(date, token, localize2) {
|
|
5730
|
+
const hours = date.getHours();
|
|
5731
|
+
let dayPeriodEnumValue;
|
|
5732
|
+
if (hours >= 17) {
|
|
5733
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
5734
|
+
} else if (hours >= 12) {
|
|
5735
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
5736
|
+
} else if (hours >= 4) {
|
|
5737
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
5738
|
+
} else {
|
|
5739
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
5740
|
+
}
|
|
5741
|
+
switch (token) {
|
|
5742
|
+
case "B":
|
|
5743
|
+
case "BB":
|
|
5744
|
+
case "BBB":
|
|
5745
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5746
|
+
width: "abbreviated",
|
|
5747
|
+
context: "formatting"
|
|
5748
|
+
});
|
|
5749
|
+
case "BBBBB":
|
|
5750
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5751
|
+
width: "narrow",
|
|
5752
|
+
context: "formatting"
|
|
5753
|
+
});
|
|
5754
|
+
case "BBBB":
|
|
5755
|
+
default:
|
|
5756
|
+
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
5757
|
+
width: "wide",
|
|
5758
|
+
context: "formatting"
|
|
5759
|
+
});
|
|
5760
|
+
}
|
|
5761
|
+
},
|
|
5762
|
+
// Hour [1-12]
|
|
5763
|
+
h: function(date, token, localize2) {
|
|
5764
|
+
if (token === "ho") {
|
|
5765
|
+
let hours = date.getHours() % 12;
|
|
5766
|
+
if (hours === 0) hours = 12;
|
|
5767
|
+
return localize2.ordinalNumber(hours, { unit: "hour" });
|
|
5768
|
+
}
|
|
5769
|
+
return lightFormatters.h(date, token);
|
|
5770
|
+
},
|
|
5771
|
+
// Hour [0-23]
|
|
5772
|
+
H: function(date, token, localize2) {
|
|
5773
|
+
if (token === "Ho") {
|
|
5774
|
+
return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
|
|
5775
|
+
}
|
|
5776
|
+
return lightFormatters.H(date, token);
|
|
5777
|
+
},
|
|
5778
|
+
// Hour [0-11]
|
|
5779
|
+
K: function(date, token, localize2) {
|
|
5780
|
+
const hours = date.getHours() % 12;
|
|
5781
|
+
if (token === "Ko") {
|
|
5782
|
+
return localize2.ordinalNumber(hours, { unit: "hour" });
|
|
5783
|
+
}
|
|
5784
|
+
return addLeadingZeros(hours, token.length);
|
|
5785
|
+
},
|
|
5786
|
+
// Hour [1-24]
|
|
5787
|
+
k: function(date, token, localize2) {
|
|
5788
|
+
let hours = date.getHours();
|
|
5789
|
+
if (hours === 0) hours = 24;
|
|
5790
|
+
if (token === "ko") {
|
|
5791
|
+
return localize2.ordinalNumber(hours, { unit: "hour" });
|
|
5792
|
+
}
|
|
5793
|
+
return addLeadingZeros(hours, token.length);
|
|
5794
|
+
},
|
|
5795
|
+
// Minute
|
|
5796
|
+
m: function(date, token, localize2) {
|
|
5797
|
+
if (token === "mo") {
|
|
5798
|
+
return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
|
5799
|
+
}
|
|
5800
|
+
return lightFormatters.m(date, token);
|
|
5801
|
+
},
|
|
5802
|
+
// Second
|
|
5803
|
+
s: function(date, token, localize2) {
|
|
5804
|
+
if (token === "so") {
|
|
5805
|
+
return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
|
|
5806
|
+
}
|
|
5807
|
+
return lightFormatters.s(date, token);
|
|
5808
|
+
},
|
|
5809
|
+
// Fraction of second
|
|
5810
|
+
S: function(date, token) {
|
|
5811
|
+
return lightFormatters.S(date, token);
|
|
5812
|
+
},
|
|
5813
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
5814
|
+
X: function(date, token, _localize) {
|
|
5815
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
5816
|
+
if (timezoneOffset === 0) {
|
|
5817
|
+
return "Z";
|
|
5818
|
+
}
|
|
5819
|
+
switch (token) {
|
|
5820
|
+
// Hours and optional minutes
|
|
5821
|
+
case "X":
|
|
5822
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
5823
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
5824
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
5825
|
+
// so this token always has the same output as `XX`
|
|
5826
|
+
case "XXXX":
|
|
5827
|
+
case "XX":
|
|
5828
|
+
return formatTimezone(timezoneOffset);
|
|
5829
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
5830
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
5831
|
+
// so this token always has the same output as `XXX`
|
|
5832
|
+
case "XXXXX":
|
|
5833
|
+
case "XXX":
|
|
5834
|
+
// Hours and minutes with `:` delimiter
|
|
5835
|
+
default:
|
|
5836
|
+
return formatTimezone(timezoneOffset, ":");
|
|
5837
|
+
}
|
|
5838
|
+
},
|
|
5839
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
5840
|
+
x: function(date, token, _localize) {
|
|
5841
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
5842
|
+
switch (token) {
|
|
5843
|
+
// Hours and optional minutes
|
|
5844
|
+
case "x":
|
|
5845
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
5846
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
5847
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
5848
|
+
// so this token always has the same output as `xx`
|
|
5849
|
+
case "xxxx":
|
|
5850
|
+
case "xx":
|
|
5851
|
+
return formatTimezone(timezoneOffset);
|
|
5852
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
5853
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
5854
|
+
// so this token always has the same output as `xxx`
|
|
5855
|
+
case "xxxxx":
|
|
5856
|
+
case "xxx":
|
|
5857
|
+
// Hours and minutes with `:` delimiter
|
|
5858
|
+
default:
|
|
5859
|
+
return formatTimezone(timezoneOffset, ":");
|
|
5860
|
+
}
|
|
5861
|
+
},
|
|
5862
|
+
// Timezone (GMT)
|
|
5863
|
+
O: function(date, token, _localize) {
|
|
5864
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
5865
|
+
switch (token) {
|
|
5866
|
+
// Short
|
|
5867
|
+
case "O":
|
|
5868
|
+
case "OO":
|
|
5869
|
+
case "OOO":
|
|
5870
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
5871
|
+
// Long
|
|
5872
|
+
case "OOOO":
|
|
5873
|
+
default:
|
|
5874
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
5875
|
+
}
|
|
5876
|
+
},
|
|
5877
|
+
// Timezone (specific non-location)
|
|
5878
|
+
z: function(date, token, _localize) {
|
|
5879
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
5880
|
+
switch (token) {
|
|
5881
|
+
// Short
|
|
5882
|
+
case "z":
|
|
5883
|
+
case "zz":
|
|
5884
|
+
case "zzz":
|
|
5885
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
5886
|
+
// Long
|
|
5887
|
+
case "zzzz":
|
|
5888
|
+
default:
|
|
5889
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
5890
|
+
}
|
|
5891
|
+
},
|
|
5892
|
+
// Seconds timestamp
|
|
5893
|
+
t: function(date, token, _localize) {
|
|
5894
|
+
const timestamp = Math.trunc(+date / 1e3);
|
|
5895
|
+
return addLeadingZeros(timestamp, token.length);
|
|
5896
|
+
},
|
|
5897
|
+
// Milliseconds timestamp
|
|
5898
|
+
T: function(date, token, _localize) {
|
|
5899
|
+
return addLeadingZeros(+date, token.length);
|
|
5900
|
+
}
|
|
5901
|
+
};
|
|
5902
|
+
function formatTimezoneShort(offset, delimiter = "") {
|
|
5903
|
+
const sign = offset > 0 ? "-" : "+";
|
|
5904
|
+
const absOffset = Math.abs(offset);
|
|
5905
|
+
const hours = Math.trunc(absOffset / 60);
|
|
5906
|
+
const minutes = absOffset % 60;
|
|
5907
|
+
if (minutes === 0) {
|
|
5908
|
+
return sign + String(hours);
|
|
5909
|
+
}
|
|
5910
|
+
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
5911
|
+
}
|
|
5912
|
+
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
|
5913
|
+
if (offset % 60 === 0) {
|
|
5914
|
+
const sign = offset > 0 ? "-" : "+";
|
|
5915
|
+
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
5916
|
+
}
|
|
5917
|
+
return formatTimezone(offset, delimiter);
|
|
5918
|
+
}
|
|
5919
|
+
function formatTimezone(offset, delimiter = "") {
|
|
5920
|
+
const sign = offset > 0 ? "-" : "+";
|
|
5921
|
+
const absOffset = Math.abs(offset);
|
|
5922
|
+
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
|
5923
|
+
const minutes = addLeadingZeros(absOffset % 60, 2);
|
|
5924
|
+
return sign + hours + delimiter + minutes;
|
|
5925
|
+
}
|
|
5926
|
+
|
|
5927
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/longFormatters.js
|
|
5928
|
+
var dateLongFormatter = (pattern, formatLong2) => {
|
|
5929
|
+
switch (pattern) {
|
|
5930
|
+
case "P":
|
|
5931
|
+
return formatLong2.date({ width: "short" });
|
|
5932
|
+
case "PP":
|
|
5933
|
+
return formatLong2.date({ width: "medium" });
|
|
5934
|
+
case "PPP":
|
|
5935
|
+
return formatLong2.date({ width: "long" });
|
|
5936
|
+
case "PPPP":
|
|
5937
|
+
default:
|
|
5938
|
+
return formatLong2.date({ width: "full" });
|
|
5939
|
+
}
|
|
5940
|
+
};
|
|
5941
|
+
var timeLongFormatter = (pattern, formatLong2) => {
|
|
5942
|
+
switch (pattern) {
|
|
5943
|
+
case "p":
|
|
5944
|
+
return formatLong2.time({ width: "short" });
|
|
5945
|
+
case "pp":
|
|
5946
|
+
return formatLong2.time({ width: "medium" });
|
|
5947
|
+
case "ppp":
|
|
5948
|
+
return formatLong2.time({ width: "long" });
|
|
5949
|
+
case "pppp":
|
|
5950
|
+
default:
|
|
5951
|
+
return formatLong2.time({ width: "full" });
|
|
5952
|
+
}
|
|
5953
|
+
};
|
|
5954
|
+
var dateTimeLongFormatter = (pattern, formatLong2) => {
|
|
5955
|
+
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
5956
|
+
const datePattern = matchResult[1];
|
|
5957
|
+
const timePattern = matchResult[2];
|
|
5958
|
+
if (!timePattern) {
|
|
5959
|
+
return dateLongFormatter(pattern, formatLong2);
|
|
5960
|
+
}
|
|
5961
|
+
let dateTimeFormat;
|
|
5962
|
+
switch (datePattern) {
|
|
5963
|
+
case "P":
|
|
5964
|
+
dateTimeFormat = formatLong2.dateTime({ width: "short" });
|
|
5965
|
+
break;
|
|
5966
|
+
case "PP":
|
|
5967
|
+
dateTimeFormat = formatLong2.dateTime({ width: "medium" });
|
|
5968
|
+
break;
|
|
5969
|
+
case "PPP":
|
|
5970
|
+
dateTimeFormat = formatLong2.dateTime({ width: "long" });
|
|
5971
|
+
break;
|
|
5972
|
+
case "PPPP":
|
|
5973
|
+
default:
|
|
5974
|
+
dateTimeFormat = formatLong2.dateTime({ width: "full" });
|
|
5975
|
+
break;
|
|
5976
|
+
}
|
|
5977
|
+
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
|
|
5978
|
+
};
|
|
5979
|
+
var longFormatters = {
|
|
5980
|
+
p: timeLongFormatter,
|
|
5981
|
+
P: dateTimeLongFormatter
|
|
5982
|
+
};
|
|
5983
|
+
|
|
5984
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/protectedTokens.js
|
|
5985
|
+
var dayOfYearTokenRE = /^D+$/;
|
|
5986
|
+
var weekYearTokenRE = /^Y+$/;
|
|
5987
|
+
var throwTokens = ["D", "DD", "YY", "YYYY"];
|
|
5988
|
+
function isProtectedDayOfYearToken(token) {
|
|
5989
|
+
return dayOfYearTokenRE.test(token);
|
|
5990
|
+
}
|
|
5991
|
+
function isProtectedWeekYearToken(token) {
|
|
5992
|
+
return weekYearTokenRE.test(token);
|
|
5993
|
+
}
|
|
5994
|
+
function warnOrThrowProtectedError(token, format2, input) {
|
|
5995
|
+
const _message = message(token, format2, input);
|
|
5996
|
+
console.warn(_message);
|
|
5997
|
+
if (throwTokens.includes(token)) throw new RangeError(_message);
|
|
5998
|
+
}
|
|
5999
|
+
function message(token, format2, input) {
|
|
6000
|
+
const subject = token[0] === "Y" ? "years" : "days of the month";
|
|
6001
|
+
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
6002
|
+
}
|
|
6003
|
+
|
|
6004
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js
|
|
6005
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
6006
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
6007
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
6008
|
+
var doubleQuoteRegExp = /''/g;
|
|
6009
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
6010
|
+
function format(date, formatStr, options) {
|
|
6011
|
+
const defaultOptions4 = getDefaultOptions();
|
|
6012
|
+
const locale = options?.locale ?? defaultOptions4.locale ?? enUS;
|
|
6013
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions4.firstWeekContainsDate ?? defaultOptions4.locale?.options?.firstWeekContainsDate ?? 1;
|
|
6014
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions4.weekStartsOn ?? defaultOptions4.locale?.options?.weekStartsOn ?? 0;
|
|
6015
|
+
const originalDate = toDate(date, options?.in);
|
|
6016
|
+
if (!isValid(originalDate)) {
|
|
6017
|
+
throw new RangeError("Invalid time value");
|
|
6018
|
+
}
|
|
6019
|
+
let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
|
|
6020
|
+
const firstCharacter = substring[0];
|
|
6021
|
+
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
6022
|
+
const longFormatter = longFormatters[firstCharacter];
|
|
6023
|
+
return longFormatter(substring, locale.formatLong);
|
|
6024
|
+
}
|
|
6025
|
+
return substring;
|
|
6026
|
+
}).join("").match(formattingTokensRegExp).map((substring) => {
|
|
6027
|
+
if (substring === "''") {
|
|
6028
|
+
return { isToken: false, value: "'" };
|
|
6029
|
+
}
|
|
6030
|
+
const firstCharacter = substring[0];
|
|
6031
|
+
if (firstCharacter === "'") {
|
|
6032
|
+
return { isToken: false, value: cleanEscapedString(substring) };
|
|
6033
|
+
}
|
|
6034
|
+
if (formatters[firstCharacter]) {
|
|
6035
|
+
return { isToken: true, value: substring };
|
|
6036
|
+
}
|
|
6037
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
6038
|
+
throw new RangeError(
|
|
6039
|
+
"Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
|
|
6040
|
+
);
|
|
6041
|
+
}
|
|
6042
|
+
return { isToken: false, value: substring };
|
|
6043
|
+
});
|
|
6044
|
+
if (locale.localize.preprocessor) {
|
|
6045
|
+
parts = locale.localize.preprocessor(originalDate, parts);
|
|
6046
|
+
}
|
|
6047
|
+
const formatterOptions = {
|
|
6048
|
+
firstWeekContainsDate,
|
|
6049
|
+
weekStartsOn,
|
|
6050
|
+
locale
|
|
6051
|
+
};
|
|
6052
|
+
return parts.map((part) => {
|
|
6053
|
+
if (!part.isToken) return part.value;
|
|
6054
|
+
const token = part.value;
|
|
6055
|
+
if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
|
|
6056
|
+
warnOrThrowProtectedError(token, formatStr, String(date));
|
|
6057
|
+
}
|
|
6058
|
+
const formatter = formatters[token[0]];
|
|
6059
|
+
return formatter(originalDate, token, locale.localize, formatterOptions);
|
|
6060
|
+
}).join("");
|
|
6061
|
+
}
|
|
6062
|
+
function cleanEscapedString(input) {
|
|
6063
|
+
const matched = input.match(escapedStringRegExp);
|
|
6064
|
+
if (!matched) {
|
|
6065
|
+
return input;
|
|
6066
|
+
}
|
|
6067
|
+
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
6068
|
+
}
|
|
6069
|
+
|
|
6070
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInMonth.js
|
|
6071
|
+
function getDaysInMonth(date, options) {
|
|
6072
|
+
const _date = toDate(date, options?.in);
|
|
6073
|
+
const year = _date.getFullYear();
|
|
6074
|
+
const monthIndex = _date.getMonth();
|
|
6075
|
+
const lastDayOfMonth = constructFrom(_date, 0);
|
|
6076
|
+
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
|
|
6077
|
+
lastDayOfMonth.setHours(0, 0, 0, 0);
|
|
6078
|
+
return lastDayOfMonth.getDate();
|
|
6079
|
+
}
|
|
6080
|
+
|
|
6081
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMonth.js
|
|
6082
|
+
function getMonth(date, options) {
|
|
6083
|
+
return toDate(date, options?.in).getMonth();
|
|
6084
|
+
}
|
|
6085
|
+
|
|
6086
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getYear.js
|
|
6087
|
+
function getYear(date, options) {
|
|
6088
|
+
return toDate(date, options?.in).getFullYear();
|
|
6089
|
+
}
|
|
6090
|
+
|
|
6091
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isAfter.js
|
|
6092
|
+
function isAfter(date, dateToCompare) {
|
|
6093
|
+
return +toDate(date) > +toDate(dateToCompare);
|
|
6094
|
+
}
|
|
6095
|
+
|
|
6096
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isBefore.js
|
|
6097
|
+
function isBefore(date, dateToCompare) {
|
|
6098
|
+
return +toDate(date) < +toDate(dateToCompare);
|
|
6099
|
+
}
|
|
6100
|
+
|
|
6101
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMonth.js
|
|
6102
|
+
function isSameMonth(laterDate, earlierDate, options) {
|
|
6103
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
6104
|
+
options?.in,
|
|
6105
|
+
laterDate,
|
|
6106
|
+
earlierDate
|
|
6107
|
+
);
|
|
6108
|
+
return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
|
|
6109
|
+
}
|
|
6110
|
+
|
|
6111
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js
|
|
6112
|
+
function isSameYear(laterDate, earlierDate, options) {
|
|
6113
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
6114
|
+
options?.in,
|
|
6115
|
+
laterDate,
|
|
6116
|
+
earlierDate
|
|
6117
|
+
);
|
|
6118
|
+
return laterDate_.getFullYear() === earlierDate_.getFullYear();
|
|
6119
|
+
}
|
|
6120
|
+
|
|
6121
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMonth.js
|
|
6122
|
+
function setMonth(date, month, options) {
|
|
6123
|
+
const _date = toDate(date, options?.in);
|
|
6124
|
+
const year = _date.getFullYear();
|
|
6125
|
+
const day = _date.getDate();
|
|
6126
|
+
const midMonth = constructFrom(date, 0);
|
|
6127
|
+
midMonth.setFullYear(year, month, 15);
|
|
6128
|
+
midMonth.setHours(0, 0, 0, 0);
|
|
6129
|
+
const daysInMonth = getDaysInMonth(midMonth);
|
|
6130
|
+
_date.setMonth(month, Math.min(day, daysInMonth));
|
|
6131
|
+
return _date;
|
|
6132
|
+
}
|
|
6133
|
+
|
|
6134
|
+
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setYear.js
|
|
6135
|
+
function setYear(date, year, options) {
|
|
6136
|
+
const date_ = toDate(date, options?.in);
|
|
6137
|
+
if (isNaN(+date_)) return constructFrom(date, NaN);
|
|
6138
|
+
date_.setFullYear(year);
|
|
6139
|
+
return date_;
|
|
6140
|
+
}
|
|
6141
|
+
|
|
6142
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js
|
|
6143
|
+
var FIVE_WEEKS = 5;
|
|
6144
|
+
var FOUR_WEEKS = 4;
|
|
6145
|
+
function getBroadcastWeeksInMonth(month, dateLib) {
|
|
6146
|
+
const firstDayOfMonth = dateLib.startOfMonth(month);
|
|
6147
|
+
const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
|
|
6148
|
+
const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
|
|
6149
|
+
const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
|
|
6150
|
+
const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek) ? FIVE_WEEKS : FOUR_WEEKS;
|
|
6151
|
+
return numberOfWeeks;
|
|
6152
|
+
}
|
|
6153
|
+
|
|
6154
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js
|
|
6155
|
+
function startOfBroadcastWeek(date, dateLib) {
|
|
6156
|
+
const firstOfMonth = dateLib.startOfMonth(date);
|
|
6157
|
+
const dayOfWeek = firstOfMonth.getDay();
|
|
6158
|
+
if (dayOfWeek === 1) {
|
|
6159
|
+
return firstOfMonth;
|
|
6160
|
+
} else if (dayOfWeek === 0) {
|
|
6161
|
+
return dateLib.addDays(firstOfMonth, -1 * 6);
|
|
6162
|
+
} else {
|
|
6163
|
+
return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
|
|
6164
|
+
}
|
|
6165
|
+
}
|
|
6166
|
+
|
|
6167
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js
|
|
6168
|
+
function endOfBroadcastWeek(date, dateLib) {
|
|
6169
|
+
const startDate = startOfBroadcastWeek(date, dateLib);
|
|
6170
|
+
const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
|
|
6171
|
+
const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
|
|
6172
|
+
return endDate;
|
|
6173
|
+
}
|
|
6174
|
+
|
|
6175
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/locale/en-US.js
|
|
6176
|
+
var enUS2 = {
|
|
6177
|
+
...enUS,
|
|
6178
|
+
labels: {
|
|
6179
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
6180
|
+
let formatDate3;
|
|
6181
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
6182
|
+
formatDate3 = dateLib.format.bind(dateLib);
|
|
6183
|
+
} else {
|
|
6184
|
+
formatDate3 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
|
|
6185
|
+
}
|
|
6186
|
+
let label = formatDate3(date, "PPPP");
|
|
6187
|
+
if (modifiers.today)
|
|
6188
|
+
label = `Today, ${label}`;
|
|
6189
|
+
if (modifiers.selected)
|
|
6190
|
+
label = `${label}, selected`;
|
|
6191
|
+
return label;
|
|
6192
|
+
},
|
|
6193
|
+
labelMonthDropdown: "Choose the Month",
|
|
6194
|
+
labelNext: "Go to the Next Month",
|
|
6195
|
+
labelPrevious: "Go to the Previous Month",
|
|
6196
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
6197
|
+
labelYearDropdown: "Choose the Year",
|
|
6198
|
+
labelGrid: (date, options, dateLib) => {
|
|
6199
|
+
let formatDate3;
|
|
6200
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
6201
|
+
formatDate3 = dateLib.format.bind(dateLib);
|
|
6202
|
+
} else {
|
|
6203
|
+
formatDate3 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
|
|
6204
|
+
}
|
|
6205
|
+
return formatDate3(date, "LLLL yyyy");
|
|
6206
|
+
},
|
|
6207
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
6208
|
+
let formatDate3;
|
|
6209
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
6210
|
+
formatDate3 = dateLib.format.bind(dateLib);
|
|
6211
|
+
} else {
|
|
6212
|
+
formatDate3 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
|
|
6213
|
+
}
|
|
6214
|
+
let label = formatDate3(date, "PPPP");
|
|
6215
|
+
if (modifiers?.today) {
|
|
6216
|
+
label = `Today, ${label}`;
|
|
6217
|
+
}
|
|
6218
|
+
return label;
|
|
6219
|
+
},
|
|
6220
|
+
labelNav: "Navigation bar",
|
|
6221
|
+
labelWeekNumberHeader: "Week Number",
|
|
6222
|
+
labelWeekday: (date, options, dateLib) => {
|
|
6223
|
+
let formatDate3;
|
|
6224
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
6225
|
+
formatDate3 = dateLib.format.bind(dateLib);
|
|
6226
|
+
} else {
|
|
6227
|
+
formatDate3 = (d, pattern) => format(d, pattern, { locale: enUS, ...options });
|
|
6228
|
+
}
|
|
6229
|
+
return formatDate3(date, "cccc");
|
|
6230
|
+
}
|
|
6231
|
+
}
|
|
6232
|
+
};
|
|
6233
|
+
|
|
6234
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/classes/DateLib.js
|
|
6235
|
+
var DateLib = class _DateLib {
|
|
6236
|
+
/**
|
|
6237
|
+
* Creates an instance of `DateLib`.
|
|
6238
|
+
*
|
|
6239
|
+
* @param options Configuration options for the date library.
|
|
6240
|
+
* @param overrides Custom overrides for the date library functions.
|
|
6241
|
+
*/
|
|
6242
|
+
constructor(options, overrides) {
|
|
6243
|
+
this.Date = Date;
|
|
6244
|
+
this.today = () => {
|
|
6245
|
+
if (this.overrides?.today) {
|
|
6246
|
+
return this.overrides.today();
|
|
6247
|
+
}
|
|
6248
|
+
if (this.options.timeZone) {
|
|
6249
|
+
return TZDate.tz(this.options.timeZone);
|
|
6250
|
+
}
|
|
6251
|
+
return new this.Date();
|
|
6252
|
+
};
|
|
6253
|
+
this.newDate = (year, monthIndex, date) => {
|
|
6254
|
+
if (this.overrides?.newDate) {
|
|
6255
|
+
return this.overrides.newDate(year, monthIndex, date);
|
|
6256
|
+
}
|
|
6257
|
+
if (this.options.timeZone) {
|
|
6258
|
+
return new TZDate(year, monthIndex, date, this.options.timeZone);
|
|
6259
|
+
}
|
|
6260
|
+
return new Date(year, monthIndex, date);
|
|
6261
|
+
};
|
|
6262
|
+
this.addDays = (date, amount) => {
|
|
6263
|
+
return this.overrides?.addDays ? this.overrides.addDays(date, amount) : addDays(date, amount);
|
|
6264
|
+
};
|
|
6265
|
+
this.addMonths = (date, amount) => {
|
|
6266
|
+
return this.overrides?.addMonths ? this.overrides.addMonths(date, amount) : addMonths(date, amount);
|
|
6267
|
+
};
|
|
6268
|
+
this.addWeeks = (date, amount) => {
|
|
6269
|
+
return this.overrides?.addWeeks ? this.overrides.addWeeks(date, amount) : addWeeks(date, amount);
|
|
6270
|
+
};
|
|
6271
|
+
this.addYears = (date, amount) => {
|
|
6272
|
+
return this.overrides?.addYears ? this.overrides.addYears(date, amount) : addYears(date, amount);
|
|
6273
|
+
};
|
|
6274
|
+
this.differenceInCalendarDays = (dateLeft, dateRight) => {
|
|
6275
|
+
return this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(dateLeft, dateRight) : differenceInCalendarDays(dateLeft, dateRight);
|
|
6276
|
+
};
|
|
6277
|
+
this.differenceInCalendarMonths = (dateLeft, dateRight) => {
|
|
6278
|
+
return this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight) : differenceInCalendarMonths(dateLeft, dateRight);
|
|
6279
|
+
};
|
|
6280
|
+
this.eachMonthOfInterval = (interval) => {
|
|
6281
|
+
return this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(interval) : eachMonthOfInterval(interval);
|
|
6282
|
+
};
|
|
6283
|
+
this.eachYearOfInterval = (interval) => {
|
|
6284
|
+
const years = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(interval) : eachYearOfInterval(interval);
|
|
6285
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
6286
|
+
if (uniqueYears.size === years.length) {
|
|
6287
|
+
return years;
|
|
6288
|
+
}
|
|
6289
|
+
const yearsArray = [];
|
|
6290
|
+
uniqueYears.forEach((y) => {
|
|
6291
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
6292
|
+
});
|
|
6293
|
+
return yearsArray;
|
|
6294
|
+
};
|
|
6295
|
+
this.endOfBroadcastWeek = (date) => {
|
|
6296
|
+
return this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(date) : endOfBroadcastWeek(date, this);
|
|
6297
|
+
};
|
|
6298
|
+
this.endOfISOWeek = (date) => {
|
|
6299
|
+
return this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(date) : endOfISOWeek(date);
|
|
6300
|
+
};
|
|
6301
|
+
this.endOfMonth = (date) => {
|
|
6302
|
+
return this.overrides?.endOfMonth ? this.overrides.endOfMonth(date) : endOfMonth(date);
|
|
6303
|
+
};
|
|
6304
|
+
this.endOfWeek = (date, options2) => {
|
|
6305
|
+
return this.overrides?.endOfWeek ? this.overrides.endOfWeek(date, options2) : endOfWeek(date, this.options);
|
|
6306
|
+
};
|
|
6307
|
+
this.endOfYear = (date) => {
|
|
6308
|
+
return this.overrides?.endOfYear ? this.overrides.endOfYear(date) : endOfYear(date);
|
|
6309
|
+
};
|
|
6310
|
+
this.format = (date, formatStr, _options) => {
|
|
6311
|
+
const formatted = this.overrides?.format ? this.overrides.format(date, formatStr, this.options) : format(date, formatStr, this.options);
|
|
6312
|
+
if (this.options.numerals && this.options.numerals !== "latn") {
|
|
6313
|
+
return this.replaceDigits(formatted);
|
|
6314
|
+
}
|
|
6315
|
+
return formatted;
|
|
6316
|
+
};
|
|
6317
|
+
this.getISOWeek = (date) => {
|
|
6318
|
+
return this.overrides?.getISOWeek ? this.overrides.getISOWeek(date) : getISOWeek(date);
|
|
6319
|
+
};
|
|
6320
|
+
this.getMonth = (date, _options) => {
|
|
6321
|
+
return this.overrides?.getMonth ? this.overrides.getMonth(date, this.options) : getMonth(date, this.options);
|
|
6322
|
+
};
|
|
6323
|
+
this.getYear = (date, _options) => {
|
|
6324
|
+
return this.overrides?.getYear ? this.overrides.getYear(date, this.options) : getYear(date, this.options);
|
|
6325
|
+
};
|
|
6326
|
+
this.getWeek = (date, _options) => {
|
|
6327
|
+
return this.overrides?.getWeek ? this.overrides.getWeek(date, this.options) : getWeek(date, this.options);
|
|
6328
|
+
};
|
|
6329
|
+
this.isAfter = (date, dateToCompare) => {
|
|
6330
|
+
return this.overrides?.isAfter ? this.overrides.isAfter(date, dateToCompare) : isAfter(date, dateToCompare);
|
|
6331
|
+
};
|
|
6332
|
+
this.isBefore = (date, dateToCompare) => {
|
|
6333
|
+
return this.overrides?.isBefore ? this.overrides.isBefore(date, dateToCompare) : isBefore(date, dateToCompare);
|
|
6334
|
+
};
|
|
6335
|
+
this.isDate = (value) => {
|
|
6336
|
+
return this.overrides?.isDate ? this.overrides.isDate(value) : isDate(value);
|
|
6337
|
+
};
|
|
6338
|
+
this.isSameDay = (dateLeft, dateRight) => {
|
|
6339
|
+
return this.overrides?.isSameDay ? this.overrides.isSameDay(dateLeft, dateRight) : isSameDay(dateLeft, dateRight);
|
|
6340
|
+
};
|
|
6341
|
+
this.isSameMonth = (dateLeft, dateRight) => {
|
|
6342
|
+
return this.overrides?.isSameMonth ? this.overrides.isSameMonth(dateLeft, dateRight) : isSameMonth(dateLeft, dateRight);
|
|
6343
|
+
};
|
|
6344
|
+
this.isSameYear = (dateLeft, dateRight) => {
|
|
6345
|
+
return this.overrides?.isSameYear ? this.overrides.isSameYear(dateLeft, dateRight) : isSameYear(dateLeft, dateRight);
|
|
6346
|
+
};
|
|
6347
|
+
this.max = (dates) => {
|
|
6348
|
+
return this.overrides?.max ? this.overrides.max(dates) : max(dates);
|
|
6349
|
+
};
|
|
6350
|
+
this.min = (dates) => {
|
|
6351
|
+
return this.overrides?.min ? this.overrides.min(dates) : min(dates);
|
|
6352
|
+
};
|
|
6353
|
+
this.setMonth = (date, month) => {
|
|
6354
|
+
return this.overrides?.setMonth ? this.overrides.setMonth(date, month) : setMonth(date, month);
|
|
6355
|
+
};
|
|
6356
|
+
this.setYear = (date, year) => {
|
|
6357
|
+
return this.overrides?.setYear ? this.overrides.setYear(date, year) : setYear(date, year);
|
|
6358
|
+
};
|
|
6359
|
+
this.startOfBroadcastWeek = (date, _dateLib) => {
|
|
6360
|
+
return this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(date, this) : startOfBroadcastWeek(date, this);
|
|
6361
|
+
};
|
|
6362
|
+
this.startOfDay = (date) => {
|
|
6363
|
+
return this.overrides?.startOfDay ? this.overrides.startOfDay(date) : startOfDay(date);
|
|
6364
|
+
};
|
|
6365
|
+
this.startOfISOWeek = (date) => {
|
|
6366
|
+
return this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(date) : startOfISOWeek(date);
|
|
6367
|
+
};
|
|
6368
|
+
this.startOfMonth = (date) => {
|
|
6369
|
+
return this.overrides?.startOfMonth ? this.overrides.startOfMonth(date) : startOfMonth(date);
|
|
6370
|
+
};
|
|
6371
|
+
this.startOfWeek = (date, _options) => {
|
|
6372
|
+
return this.overrides?.startOfWeek ? this.overrides.startOfWeek(date, this.options) : startOfWeek(date, this.options);
|
|
6373
|
+
};
|
|
6374
|
+
this.startOfYear = (date) => {
|
|
6375
|
+
return this.overrides?.startOfYear ? this.overrides.startOfYear(date) : startOfYear(date);
|
|
6376
|
+
};
|
|
6377
|
+
this.options = { locale: enUS2, ...options };
|
|
6378
|
+
this.overrides = overrides;
|
|
6379
|
+
}
|
|
6380
|
+
/**
|
|
6381
|
+
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
6382
|
+
* digits.
|
|
6383
|
+
*
|
|
6384
|
+
* @since 9.5.0
|
|
6385
|
+
* @returns A record mapping Arabic digits to the target numerals.
|
|
6386
|
+
*/
|
|
6387
|
+
getDigitMap() {
|
|
6388
|
+
const { numerals = "latn" } = this.options;
|
|
6389
|
+
const formatter = new Intl.NumberFormat("en-US", {
|
|
6390
|
+
numberingSystem: numerals
|
|
6391
|
+
});
|
|
6392
|
+
const digitMap = {};
|
|
6393
|
+
for (let i = 0; i < 10; i++) {
|
|
6394
|
+
digitMap[i.toString()] = formatter.format(i);
|
|
6395
|
+
}
|
|
6396
|
+
return digitMap;
|
|
6397
|
+
}
|
|
6398
|
+
/**
|
|
6399
|
+
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
6400
|
+
*
|
|
6401
|
+
* @since 9.5.0
|
|
6402
|
+
* @param input The string containing Arabic digits.
|
|
6403
|
+
* @returns The string with digits replaced.
|
|
6404
|
+
*/
|
|
6405
|
+
replaceDigits(input) {
|
|
6406
|
+
const digitMap = this.getDigitMap();
|
|
6407
|
+
return input.replace(/\d/g, (digit) => digitMap[digit] || digit);
|
|
6408
|
+
}
|
|
6409
|
+
/**
|
|
6410
|
+
* Formats a number using the configured numbering system.
|
|
6411
|
+
*
|
|
6412
|
+
* @since 9.5.0
|
|
6413
|
+
* @param value The number to format.
|
|
6414
|
+
* @returns The formatted number as a string.
|
|
6415
|
+
*/
|
|
6416
|
+
formatNumber(value) {
|
|
6417
|
+
return this.replaceDigits(value.toString());
|
|
6418
|
+
}
|
|
6419
|
+
/**
|
|
6420
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
6421
|
+
* locale.
|
|
6422
|
+
*/
|
|
6423
|
+
getMonthYearOrder() {
|
|
6424
|
+
const code = this.options.locale?.code;
|
|
6425
|
+
if (!code) {
|
|
6426
|
+
return "month-first";
|
|
6427
|
+
}
|
|
6428
|
+
return _DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
6429
|
+
}
|
|
6430
|
+
/**
|
|
6431
|
+
* Formats the month/year pair respecting locale conventions.
|
|
6432
|
+
*
|
|
6433
|
+
* @since 9.11.0
|
|
6434
|
+
*/
|
|
6435
|
+
formatMonthYear(date) {
|
|
6436
|
+
const { locale, timeZone, numerals } = this.options;
|
|
6437
|
+
const localeCode = locale?.code;
|
|
6438
|
+
if (localeCode && _DateLib.yearFirstLocales.has(localeCode)) {
|
|
6439
|
+
try {
|
|
6440
|
+
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
6441
|
+
month: "long",
|
|
6442
|
+
year: "numeric",
|
|
6443
|
+
timeZone,
|
|
6444
|
+
numberingSystem: numerals
|
|
6445
|
+
});
|
|
6446
|
+
const formatted = intl.format(date);
|
|
6447
|
+
return formatted;
|
|
6448
|
+
} catch {
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
6452
|
+
return this.format(date, pattern);
|
|
6453
|
+
}
|
|
6454
|
+
};
|
|
6455
|
+
DateLib.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
6456
|
+
"eu",
|
|
6457
|
+
"hu",
|
|
6458
|
+
"ja",
|
|
6459
|
+
"ja-Hira",
|
|
6460
|
+
"ja-JP",
|
|
6461
|
+
"ko",
|
|
6462
|
+
"ko-KR",
|
|
6463
|
+
"lt",
|
|
6464
|
+
"lt-LT",
|
|
6465
|
+
"lv",
|
|
6466
|
+
"lv-LV",
|
|
6467
|
+
"mn",
|
|
6468
|
+
"mn-MN",
|
|
6469
|
+
"zh",
|
|
6470
|
+
"zh-CN",
|
|
6471
|
+
"zh-HK",
|
|
6472
|
+
"zh-TW"
|
|
6473
|
+
]);
|
|
6474
|
+
var defaultDateLib = new DateLib();
|
|
6475
|
+
|
|
6476
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js
|
|
6477
|
+
var CalendarDay = class {
|
|
6478
|
+
constructor(date, displayMonth, dateLib = defaultDateLib) {
|
|
6479
|
+
this.date = date;
|
|
6480
|
+
this.displayMonth = displayMonth;
|
|
6481
|
+
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
6482
|
+
this.dateLib = dateLib;
|
|
6483
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
6484
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
6485
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
6486
|
+
}
|
|
6487
|
+
/**
|
|
6488
|
+
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
6489
|
+
* date and the displayed month.
|
|
6490
|
+
*
|
|
6491
|
+
* @param day The `CalendarDay` to compare with.
|
|
6492
|
+
* @returns `true` if the days are equal, otherwise `false`.
|
|
6493
|
+
*/
|
|
6494
|
+
isEqualTo(day) {
|
|
6495
|
+
return this.dateLib.isSameDay(day.date, this.date) && this.dateLib.isSameMonth(day.displayMonth, this.displayMonth);
|
|
6496
|
+
}
|
|
6497
|
+
};
|
|
6498
|
+
|
|
6499
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js
|
|
6500
|
+
var CalendarMonth = class {
|
|
6501
|
+
constructor(month, weeks) {
|
|
6502
|
+
this.date = month;
|
|
6503
|
+
this.weeks = weeks;
|
|
6504
|
+
}
|
|
6505
|
+
};
|
|
6506
|
+
|
|
6507
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js
|
|
6508
|
+
var CalendarWeek = class {
|
|
6509
|
+
constructor(weekNumber, days) {
|
|
6510
|
+
this.days = days;
|
|
6511
|
+
this.weekNumber = weekNumber;
|
|
6512
|
+
}
|
|
6513
|
+
};
|
|
6514
|
+
|
|
6515
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/components/custom-components.js
|
|
6516
|
+
var custom_components_exports = {};
|
|
6517
|
+
__export(custom_components_exports, {
|
|
6518
|
+
Button: () => Button2,
|
|
6519
|
+
CaptionLabel: () => CaptionLabel,
|
|
6520
|
+
Chevron: () => Chevron,
|
|
6521
|
+
Day: () => Day,
|
|
6522
|
+
DayButton: () => DayButton,
|
|
6523
|
+
Dropdown: () => Dropdown,
|
|
6524
|
+
DropdownNav: () => DropdownNav,
|
|
6525
|
+
Footer: () => Footer,
|
|
6526
|
+
Month: () => Month,
|
|
6527
|
+
MonthCaption: () => MonthCaption,
|
|
6528
|
+
MonthGrid: () => MonthGrid,
|
|
6529
|
+
Months: () => Months,
|
|
6530
|
+
MonthsDropdown: () => MonthsDropdown,
|
|
6531
|
+
Nav: () => Nav,
|
|
6532
|
+
NextMonthButton: () => NextMonthButton,
|
|
6533
|
+
Option: () => Option,
|
|
6534
|
+
PreviousMonthButton: () => PreviousMonthButton,
|
|
6535
|
+
Root: () => Root15,
|
|
6536
|
+
Select: () => Select,
|
|
6537
|
+
Week: () => Week,
|
|
6538
|
+
WeekNumber: () => WeekNumber,
|
|
6539
|
+
WeekNumberHeader: () => WeekNumberHeader,
|
|
6540
|
+
Weekday: () => Weekday,
|
|
6541
|
+
Weekdays: () => Weekdays,
|
|
6542
|
+
Weeks: () => Weeks,
|
|
6543
|
+
YearsDropdown: () => YearsDropdown
|
|
6544
|
+
});
|
|
6545
|
+
function Button2(props) {
|
|
6546
|
+
return React27.createElement("button", { ...props });
|
|
6547
|
+
}
|
|
6548
|
+
function CaptionLabel(props) {
|
|
6549
|
+
return React27.createElement("span", { ...props });
|
|
6550
|
+
}
|
|
6551
|
+
function Chevron(props) {
|
|
6552
|
+
const { size = 24, orientation = "left", className } = props;
|
|
6553
|
+
return (
|
|
6554
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
6555
|
+
React27.createElement(
|
|
6556
|
+
"svg",
|
|
6557
|
+
{ className, width: size, height: size, viewBox: "0 0 24 24" },
|
|
6558
|
+
orientation === "up" && React27.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
6559
|
+
orientation === "down" && React27.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
6560
|
+
orientation === "left" && React27.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
6561
|
+
orientation === "right" && React27.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
6562
|
+
)
|
|
6563
|
+
);
|
|
6564
|
+
}
|
|
6565
|
+
function Day(props) {
|
|
6566
|
+
const { day, modifiers, ...tdProps } = props;
|
|
6567
|
+
return React27.createElement("td", { ...tdProps });
|
|
6568
|
+
}
|
|
6569
|
+
function DayButton(props) {
|
|
6570
|
+
const { day, modifiers, ...buttonProps } = props;
|
|
6571
|
+
const ref = React27.useRef(null);
|
|
6572
|
+
React27.useEffect(() => {
|
|
6573
|
+
if (modifiers.focused)
|
|
6574
|
+
ref.current?.focus();
|
|
6575
|
+
}, [modifiers.focused]);
|
|
6576
|
+
return React27.createElement("button", { ref, ...buttonProps });
|
|
6577
|
+
}
|
|
6578
|
+
|
|
6579
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/UI.js
|
|
6580
|
+
var UI;
|
|
6581
|
+
(function(UI2) {
|
|
6582
|
+
UI2["Root"] = "root";
|
|
6583
|
+
UI2["Chevron"] = "chevron";
|
|
6584
|
+
UI2["Day"] = "day";
|
|
6585
|
+
UI2["DayButton"] = "day_button";
|
|
6586
|
+
UI2["CaptionLabel"] = "caption_label";
|
|
6587
|
+
UI2["Dropdowns"] = "dropdowns";
|
|
6588
|
+
UI2["Dropdown"] = "dropdown";
|
|
6589
|
+
UI2["DropdownRoot"] = "dropdown_root";
|
|
6590
|
+
UI2["Footer"] = "footer";
|
|
6591
|
+
UI2["MonthGrid"] = "month_grid";
|
|
6592
|
+
UI2["MonthCaption"] = "month_caption";
|
|
6593
|
+
UI2["MonthsDropdown"] = "months_dropdown";
|
|
6594
|
+
UI2["Month"] = "month";
|
|
6595
|
+
UI2["Months"] = "months";
|
|
6596
|
+
UI2["Nav"] = "nav";
|
|
6597
|
+
UI2["NextMonthButton"] = "button_next";
|
|
6598
|
+
UI2["PreviousMonthButton"] = "button_previous";
|
|
6599
|
+
UI2["Week"] = "week";
|
|
6600
|
+
UI2["Weeks"] = "weeks";
|
|
6601
|
+
UI2["Weekday"] = "weekday";
|
|
6602
|
+
UI2["Weekdays"] = "weekdays";
|
|
6603
|
+
UI2["WeekNumber"] = "week_number";
|
|
6604
|
+
UI2["WeekNumberHeader"] = "week_number_header";
|
|
6605
|
+
UI2["YearsDropdown"] = "years_dropdown";
|
|
6606
|
+
})(UI || (UI = {}));
|
|
6607
|
+
var DayFlag;
|
|
6608
|
+
(function(DayFlag2) {
|
|
6609
|
+
DayFlag2["disabled"] = "disabled";
|
|
6610
|
+
DayFlag2["hidden"] = "hidden";
|
|
6611
|
+
DayFlag2["outside"] = "outside";
|
|
6612
|
+
DayFlag2["focused"] = "focused";
|
|
6613
|
+
DayFlag2["today"] = "today";
|
|
6614
|
+
})(DayFlag || (DayFlag = {}));
|
|
6615
|
+
var SelectionState;
|
|
6616
|
+
(function(SelectionState2) {
|
|
6617
|
+
SelectionState2["range_end"] = "range_end";
|
|
6618
|
+
SelectionState2["range_middle"] = "range_middle";
|
|
6619
|
+
SelectionState2["range_start"] = "range_start";
|
|
6620
|
+
SelectionState2["selected"] = "selected";
|
|
6621
|
+
})(SelectionState || (SelectionState = {}));
|
|
6622
|
+
var Animation;
|
|
6623
|
+
(function(Animation2) {
|
|
6624
|
+
Animation2["weeks_before_enter"] = "weeks_before_enter";
|
|
6625
|
+
Animation2["weeks_before_exit"] = "weeks_before_exit";
|
|
6626
|
+
Animation2["weeks_after_enter"] = "weeks_after_enter";
|
|
6627
|
+
Animation2["weeks_after_exit"] = "weeks_after_exit";
|
|
6628
|
+
Animation2["caption_after_enter"] = "caption_after_enter";
|
|
6629
|
+
Animation2["caption_after_exit"] = "caption_after_exit";
|
|
6630
|
+
Animation2["caption_before_enter"] = "caption_before_enter";
|
|
6631
|
+
Animation2["caption_before_exit"] = "caption_before_exit";
|
|
6632
|
+
})(Animation || (Animation = {}));
|
|
6633
|
+
|
|
6634
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/components/Dropdown.js
|
|
6635
|
+
function Dropdown(props) {
|
|
6636
|
+
const { options, className, components, classNames, ...selectProps } = props;
|
|
6637
|
+
const cssClassSelect = [classNames[UI.Dropdown], className].join(" ");
|
|
6638
|
+
const selectedOption = options?.find(({ value }) => value === selectProps.value);
|
|
6639
|
+
return React27.createElement(
|
|
6640
|
+
"span",
|
|
6641
|
+
{ "data-disabled": selectProps.disabled, className: classNames[UI.DropdownRoot] },
|
|
6642
|
+
React27.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled }) => React27.createElement(components.Option, { key: value, value, disabled }, label))),
|
|
6643
|
+
React27.createElement(
|
|
6644
|
+
"span",
|
|
6645
|
+
{ className: classNames[UI.CaptionLabel], "aria-hidden": true },
|
|
6646
|
+
selectedOption?.label,
|
|
6647
|
+
React27.createElement(components.Chevron, { orientation: "down", size: 18, className: classNames[UI.Chevron] })
|
|
6648
|
+
)
|
|
6649
|
+
);
|
|
6650
|
+
}
|
|
6651
|
+
function DropdownNav(props) {
|
|
6652
|
+
return React27.createElement("div", { ...props });
|
|
6653
|
+
}
|
|
6654
|
+
function Footer(props) {
|
|
6655
|
+
return React27.createElement("div", { ...props });
|
|
6656
|
+
}
|
|
6657
|
+
function Month(props) {
|
|
6658
|
+
const { calendarMonth, displayIndex, ...divProps } = props;
|
|
6659
|
+
return React27.createElement("div", { ...divProps }, props.children);
|
|
6660
|
+
}
|
|
6661
|
+
function MonthCaption(props) {
|
|
6662
|
+
const { calendarMonth, displayIndex, ...divProps } = props;
|
|
6663
|
+
return React27.createElement("div", { ...divProps });
|
|
6664
|
+
}
|
|
6665
|
+
function MonthGrid(props) {
|
|
6666
|
+
return React27.createElement("table", { ...props });
|
|
6667
|
+
}
|
|
6668
|
+
function Months(props) {
|
|
6669
|
+
return React27.createElement("div", { ...props });
|
|
6670
|
+
}
|
|
6671
|
+
var dayPickerContext = createContext(void 0);
|
|
6672
|
+
function useDayPicker() {
|
|
6673
|
+
const context = useContext(dayPickerContext);
|
|
6674
|
+
if (context === void 0) {
|
|
6675
|
+
throw new Error("useDayPicker() must be used within a custom component.");
|
|
6676
|
+
}
|
|
6677
|
+
return context;
|
|
6678
|
+
}
|
|
6679
|
+
|
|
6680
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
|
|
6681
|
+
function MonthsDropdown(props) {
|
|
6682
|
+
const { components } = useDayPicker();
|
|
6683
|
+
return React27.createElement(components.Dropdown, { ...props });
|
|
6684
|
+
}
|
|
6685
|
+
function Nav(props) {
|
|
6686
|
+
const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
|
|
6687
|
+
const { components, classNames, labels: { labelPrevious: labelPrevious2, labelNext: labelNext2 } } = useDayPicker();
|
|
6688
|
+
const handleNextClick = useCallback((e) => {
|
|
6689
|
+
if (nextMonth) {
|
|
6690
|
+
onNextClick?.(e);
|
|
6691
|
+
}
|
|
6692
|
+
}, [nextMonth, onNextClick]);
|
|
6693
|
+
const handlePreviousClick = useCallback((e) => {
|
|
6694
|
+
if (previousMonth) {
|
|
6695
|
+
onPreviousClick?.(e);
|
|
6696
|
+
}
|
|
6697
|
+
}, [previousMonth, onPreviousClick]);
|
|
6698
|
+
return React27.createElement(
|
|
6699
|
+
"nav",
|
|
6700
|
+
{ ...navProps },
|
|
6701
|
+
React27.createElement(
|
|
6702
|
+
components.PreviousMonthButton,
|
|
6703
|
+
{ type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick },
|
|
6704
|
+
React27.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: "left" })
|
|
6705
|
+
),
|
|
6706
|
+
React27.createElement(
|
|
6707
|
+
components.NextMonthButton,
|
|
6708
|
+
{ type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick },
|
|
6709
|
+
React27.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, orientation: "right", className: classNames[UI.Chevron] })
|
|
6710
|
+
)
|
|
6711
|
+
);
|
|
6712
|
+
}
|
|
6713
|
+
function NextMonthButton(props) {
|
|
6714
|
+
const { components } = useDayPicker();
|
|
6715
|
+
return React27.createElement(components.Button, { ...props });
|
|
6716
|
+
}
|
|
6717
|
+
function Option(props) {
|
|
6718
|
+
return React27.createElement("option", { ...props });
|
|
6719
|
+
}
|
|
6720
|
+
function PreviousMonthButton(props) {
|
|
6721
|
+
const { components } = useDayPicker();
|
|
6722
|
+
return React27.createElement(components.Button, { ...props });
|
|
6723
|
+
}
|
|
6724
|
+
function Root15(props) {
|
|
6725
|
+
const { rootRef, ...rest } = props;
|
|
6726
|
+
return React27.createElement("div", { ...rest, ref: rootRef });
|
|
6727
|
+
}
|
|
6728
|
+
function Select(props) {
|
|
6729
|
+
return React27.createElement("select", { ...props });
|
|
6730
|
+
}
|
|
6731
|
+
function Week(props) {
|
|
6732
|
+
const { week, ...trProps } = props;
|
|
6733
|
+
return React27.createElement("tr", { ...trProps });
|
|
6734
|
+
}
|
|
6735
|
+
function Weekday(props) {
|
|
6736
|
+
return React27.createElement("th", { ...props });
|
|
6737
|
+
}
|
|
6738
|
+
function Weekdays(props) {
|
|
6739
|
+
return React27.createElement(
|
|
6740
|
+
"thead",
|
|
6741
|
+
{ "aria-hidden": true },
|
|
6742
|
+
React27.createElement("tr", { ...props })
|
|
6743
|
+
);
|
|
6744
|
+
}
|
|
6745
|
+
function WeekNumber(props) {
|
|
6746
|
+
const { week, ...thProps } = props;
|
|
6747
|
+
return React27.createElement("th", { ...thProps });
|
|
6748
|
+
}
|
|
6749
|
+
function WeekNumberHeader(props) {
|
|
6750
|
+
return React27.createElement("th", { ...props });
|
|
6751
|
+
}
|
|
6752
|
+
function Weeks(props) {
|
|
6753
|
+
return React27.createElement("tbody", { ...props });
|
|
6754
|
+
}
|
|
6755
|
+
function YearsDropdown(props) {
|
|
6756
|
+
const { components } = useDayPicker();
|
|
6757
|
+
return React27.createElement(components.Dropdown, { ...props });
|
|
6758
|
+
}
|
|
6759
|
+
|
|
6760
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
|
|
6761
|
+
function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {
|
|
6762
|
+
let { from, to } = range;
|
|
6763
|
+
const { differenceInCalendarDays: differenceInCalendarDays2, isSameDay: isSameDay2 } = dateLib;
|
|
6764
|
+
if (from && to) {
|
|
6765
|
+
const isRangeInverted = differenceInCalendarDays2(to, from) < 0;
|
|
6766
|
+
if (isRangeInverted) {
|
|
6767
|
+
[from, to] = [to, from];
|
|
6768
|
+
}
|
|
6769
|
+
const isInRange = differenceInCalendarDays2(date, from) >= (excludeEnds ? 1 : 0) && differenceInCalendarDays2(to, date) >= (excludeEnds ? 1 : 0);
|
|
6770
|
+
return isInRange;
|
|
6771
|
+
}
|
|
6772
|
+
if (!excludeEnds && to) {
|
|
6773
|
+
return isSameDay2(to, date);
|
|
6774
|
+
}
|
|
6775
|
+
if (!excludeEnds && from) {
|
|
6776
|
+
return isSameDay2(from, date);
|
|
6777
|
+
}
|
|
6778
|
+
return false;
|
|
6779
|
+
}
|
|
6780
|
+
|
|
6781
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/typeguards.js
|
|
6782
|
+
function isDateInterval(matcher) {
|
|
6783
|
+
return Boolean(matcher && typeof matcher === "object" && "before" in matcher && "after" in matcher);
|
|
6784
|
+
}
|
|
6785
|
+
function isDateRange(value) {
|
|
6786
|
+
return Boolean(value && typeof value === "object" && "from" in value);
|
|
6787
|
+
}
|
|
6788
|
+
function isDateAfterType(value) {
|
|
6789
|
+
return Boolean(value && typeof value === "object" && "after" in value);
|
|
6790
|
+
}
|
|
6791
|
+
function isDateBeforeType(value) {
|
|
6792
|
+
return Boolean(value && typeof value === "object" && "before" in value);
|
|
6793
|
+
}
|
|
6794
|
+
function isDayOfWeekType(value) {
|
|
6795
|
+
return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
|
|
6796
|
+
}
|
|
6797
|
+
function isDatesArray(value, dateLib) {
|
|
6798
|
+
return Array.isArray(value) && value.every(dateLib.isDate);
|
|
6799
|
+
}
|
|
6800
|
+
|
|
6801
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js
|
|
6802
|
+
function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
6803
|
+
const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
|
|
6804
|
+
const { isSameDay: isSameDay2, differenceInCalendarDays: differenceInCalendarDays2, isAfter: isAfter2 } = dateLib;
|
|
6805
|
+
return matchersArr.some((matcher) => {
|
|
6806
|
+
if (typeof matcher === "boolean") {
|
|
6807
|
+
return matcher;
|
|
6808
|
+
}
|
|
6809
|
+
if (dateLib.isDate(matcher)) {
|
|
6810
|
+
return isSameDay2(date, matcher);
|
|
6811
|
+
}
|
|
6812
|
+
if (isDatesArray(matcher, dateLib)) {
|
|
6813
|
+
return matcher.some((matcherDate) => isSameDay2(date, matcherDate));
|
|
6814
|
+
}
|
|
6815
|
+
if (isDateRange(matcher)) {
|
|
6816
|
+
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
6817
|
+
}
|
|
6818
|
+
if (isDayOfWeekType(matcher)) {
|
|
6819
|
+
if (!Array.isArray(matcher.dayOfWeek)) {
|
|
6820
|
+
return matcher.dayOfWeek === date.getDay();
|
|
6821
|
+
}
|
|
6822
|
+
return matcher.dayOfWeek.includes(date.getDay());
|
|
6823
|
+
}
|
|
6824
|
+
if (isDateInterval(matcher)) {
|
|
6825
|
+
const diffBefore = differenceInCalendarDays2(matcher.before, date);
|
|
6826
|
+
const diffAfter = differenceInCalendarDays2(matcher.after, date);
|
|
6827
|
+
const isDayBefore = diffBefore > 0;
|
|
6828
|
+
const isDayAfter = diffAfter < 0;
|
|
6829
|
+
const isClosedInterval = isAfter2(matcher.before, matcher.after);
|
|
6830
|
+
if (isClosedInterval) {
|
|
6831
|
+
return isDayAfter && isDayBefore;
|
|
6832
|
+
} else {
|
|
6833
|
+
return isDayBefore || isDayAfter;
|
|
6834
|
+
}
|
|
6835
|
+
}
|
|
6836
|
+
if (isDateAfterType(matcher)) {
|
|
6837
|
+
return differenceInCalendarDays2(date, matcher.after) > 0;
|
|
6838
|
+
}
|
|
6839
|
+
if (isDateBeforeType(matcher)) {
|
|
6840
|
+
return differenceInCalendarDays2(matcher.before, date) > 0;
|
|
6841
|
+
}
|
|
6842
|
+
if (typeof matcher === "function") {
|
|
6843
|
+
return matcher(date);
|
|
6844
|
+
}
|
|
6845
|
+
return false;
|
|
6846
|
+
});
|
|
6847
|
+
}
|
|
6848
|
+
|
|
6849
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js
|
|
6850
|
+
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
6851
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today() } = props;
|
|
6852
|
+
const { isSameDay: isSameDay2, isSameMonth: isSameMonth2, startOfMonth: startOfMonth2, isBefore: isBefore2, endOfMonth: endOfMonth2, isAfter: isAfter2 } = dateLib;
|
|
6853
|
+
const computedNavStart = navStart && startOfMonth2(navStart);
|
|
6854
|
+
const computedNavEnd = navEnd && endOfMonth2(navEnd);
|
|
6855
|
+
const internalModifiersMap = {
|
|
6856
|
+
[DayFlag.focused]: [],
|
|
6857
|
+
[DayFlag.outside]: [],
|
|
6858
|
+
[DayFlag.disabled]: [],
|
|
6859
|
+
[DayFlag.hidden]: [],
|
|
6860
|
+
[DayFlag.today]: []
|
|
6861
|
+
};
|
|
6862
|
+
const customModifiersMap = {};
|
|
6863
|
+
for (const day of days) {
|
|
6864
|
+
const { date, displayMonth } = day;
|
|
6865
|
+
const isOutside = Boolean(displayMonth && !isSameMonth2(date, displayMonth));
|
|
6866
|
+
const isBeforeNavStart = Boolean(computedNavStart && isBefore2(date, computedNavStart));
|
|
6867
|
+
const isAfterNavEnd = Boolean(computedNavEnd && isAfter2(date, computedNavEnd));
|
|
6868
|
+
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
|
|
6869
|
+
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || isBeforeNavStart || isAfterNavEnd || // Broadcast calendar will show outside days as default
|
|
6870
|
+
!broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
|
|
6871
|
+
const isToday = isSameDay2(date, today);
|
|
6872
|
+
if (isOutside)
|
|
6873
|
+
internalModifiersMap.outside.push(day);
|
|
6874
|
+
if (isDisabled)
|
|
6875
|
+
internalModifiersMap.disabled.push(day);
|
|
6876
|
+
if (isHidden)
|
|
6877
|
+
internalModifiersMap.hidden.push(day);
|
|
6878
|
+
if (isToday)
|
|
6879
|
+
internalModifiersMap.today.push(day);
|
|
6880
|
+
if (modifiers) {
|
|
6881
|
+
Object.keys(modifiers).forEach((name) => {
|
|
6882
|
+
const modifierValue = modifiers?.[name];
|
|
6883
|
+
const isMatch = modifierValue ? dateMatchModifiers(date, modifierValue, dateLib) : false;
|
|
6884
|
+
if (!isMatch)
|
|
6885
|
+
return;
|
|
6886
|
+
if (customModifiersMap[name]) {
|
|
6887
|
+
customModifiersMap[name].push(day);
|
|
6888
|
+
} else {
|
|
6889
|
+
customModifiersMap[name] = [day];
|
|
6890
|
+
}
|
|
6891
|
+
});
|
|
6892
|
+
}
|
|
6893
|
+
}
|
|
6894
|
+
return (day) => {
|
|
6895
|
+
const dayFlags = {
|
|
6896
|
+
[DayFlag.focused]: false,
|
|
6897
|
+
[DayFlag.disabled]: false,
|
|
6898
|
+
[DayFlag.hidden]: false,
|
|
6899
|
+
[DayFlag.outside]: false,
|
|
6900
|
+
[DayFlag.today]: false
|
|
6901
|
+
};
|
|
6902
|
+
const customModifiers = {};
|
|
6903
|
+
for (const name in internalModifiersMap) {
|
|
6904
|
+
const days2 = internalModifiersMap[name];
|
|
6905
|
+
dayFlags[name] = days2.some((d) => d === day);
|
|
6906
|
+
}
|
|
6907
|
+
for (const name in customModifiersMap) {
|
|
6908
|
+
customModifiers[name] = customModifiersMap[name].some((d) => d === day);
|
|
6909
|
+
}
|
|
6910
|
+
return {
|
|
6911
|
+
...dayFlags,
|
|
6912
|
+
// custom modifiers should override all the previous ones
|
|
6913
|
+
...customModifiers
|
|
6914
|
+
};
|
|
6915
|
+
};
|
|
6916
|
+
}
|
|
6917
|
+
|
|
6918
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js
|
|
6919
|
+
function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
|
|
6920
|
+
const modifierClassNames = Object.entries(modifiers).filter(([, active]) => active === true).reduce((previousValue, [key]) => {
|
|
6921
|
+
if (modifiersClassNames[key]) {
|
|
6922
|
+
previousValue.push(modifiersClassNames[key]);
|
|
6923
|
+
} else if (classNames[DayFlag[key]]) {
|
|
6924
|
+
previousValue.push(classNames[DayFlag[key]]);
|
|
6925
|
+
} else if (classNames[SelectionState[key]]) {
|
|
6926
|
+
previousValue.push(classNames[SelectionState[key]]);
|
|
6927
|
+
}
|
|
6928
|
+
return previousValue;
|
|
6929
|
+
}, [classNames[UI.Day]]);
|
|
6930
|
+
return modifierClassNames;
|
|
6931
|
+
}
|
|
6932
|
+
|
|
6933
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getComponents.js
|
|
6934
|
+
function getComponents(customComponents) {
|
|
6935
|
+
return {
|
|
6936
|
+
...custom_components_exports,
|
|
6937
|
+
...customComponents
|
|
6938
|
+
};
|
|
6939
|
+
}
|
|
6940
|
+
|
|
6941
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js
|
|
6942
|
+
function getDataAttributes(props) {
|
|
6943
|
+
const dataAttributes = {
|
|
6944
|
+
"data-mode": props.mode ?? void 0,
|
|
6945
|
+
"data-required": "required" in props ? props.required : void 0,
|
|
6946
|
+
"data-multiple-months": props.numberOfMonths && props.numberOfMonths > 1 || void 0,
|
|
6947
|
+
"data-week-numbers": props.showWeekNumber || void 0,
|
|
6948
|
+
"data-broadcast-calendar": props.broadcastCalendar || void 0,
|
|
6949
|
+
"data-nav-layout": props.navLayout || void 0
|
|
6950
|
+
};
|
|
6951
|
+
Object.entries(props).forEach(([key, val]) => {
|
|
6952
|
+
if (key.startsWith("data-")) {
|
|
6953
|
+
dataAttributes[key] = val;
|
|
6954
|
+
}
|
|
6955
|
+
});
|
|
6956
|
+
return dataAttributes;
|
|
6957
|
+
}
|
|
6958
|
+
|
|
6959
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js
|
|
6960
|
+
function getDefaultClassNames() {
|
|
6961
|
+
const classNames = {};
|
|
6962
|
+
for (const key in UI) {
|
|
6963
|
+
classNames[UI[key]] = `rdp-${UI[key]}`;
|
|
6964
|
+
}
|
|
6965
|
+
for (const key in DayFlag) {
|
|
6966
|
+
classNames[DayFlag[key]] = `rdp-${DayFlag[key]}`;
|
|
6967
|
+
}
|
|
6968
|
+
for (const key in SelectionState) {
|
|
6969
|
+
classNames[SelectionState[key]] = `rdp-${SelectionState[key]}`;
|
|
6970
|
+
}
|
|
6971
|
+
for (const key in Animation) {
|
|
6972
|
+
classNames[Animation[key]] = `rdp-${Animation[key]}`;
|
|
6973
|
+
}
|
|
6974
|
+
return classNames;
|
|
6975
|
+
}
|
|
6976
|
+
|
|
6977
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/index.js
|
|
6978
|
+
var formatters_exports = {};
|
|
6979
|
+
__export(formatters_exports, {
|
|
6980
|
+
formatCaption: () => formatCaption,
|
|
6981
|
+
formatDay: () => formatDay,
|
|
6982
|
+
formatMonthCaption: () => formatMonthCaption,
|
|
6983
|
+
formatMonthDropdown: () => formatMonthDropdown,
|
|
6984
|
+
formatWeekNumber: () => formatWeekNumber,
|
|
6985
|
+
formatWeekNumberHeader: () => formatWeekNumberHeader,
|
|
6986
|
+
formatWeekdayName: () => formatWeekdayName,
|
|
6987
|
+
formatYearCaption: () => formatYearCaption,
|
|
6988
|
+
formatYearDropdown: () => formatYearDropdown
|
|
6989
|
+
});
|
|
6990
|
+
|
|
6991
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js
|
|
6992
|
+
function formatCaption(month, options, dateLib) {
|
|
6993
|
+
const lib = dateLib ?? new DateLib(options);
|
|
6994
|
+
return lib.formatMonthYear(month);
|
|
6995
|
+
}
|
|
6996
|
+
var formatMonthCaption = formatCaption;
|
|
6997
|
+
|
|
6998
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatDay.js
|
|
6999
|
+
function formatDay(date, options, dateLib) {
|
|
7000
|
+
return (dateLib ?? new DateLib(options)).format(date, "d");
|
|
7001
|
+
}
|
|
7002
|
+
|
|
7003
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js
|
|
7004
|
+
function formatMonthDropdown(month, dateLib = defaultDateLib) {
|
|
7005
|
+
return dateLib.format(month, "LLLL");
|
|
7006
|
+
}
|
|
7007
|
+
|
|
7008
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js
|
|
7009
|
+
function formatWeekdayName(weekday, options, dateLib) {
|
|
7010
|
+
return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
|
|
7011
|
+
}
|
|
7012
|
+
|
|
7013
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js
|
|
7014
|
+
function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {
|
|
7015
|
+
if (weekNumber < 10) {
|
|
7016
|
+
return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
|
|
7017
|
+
}
|
|
7018
|
+
return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
|
|
7019
|
+
}
|
|
7020
|
+
|
|
7021
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js
|
|
7022
|
+
function formatWeekNumberHeader() {
|
|
7023
|
+
return ``;
|
|
7024
|
+
}
|
|
7025
|
+
|
|
7026
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js
|
|
7027
|
+
function formatYearDropdown(year, dateLib = defaultDateLib) {
|
|
7028
|
+
return dateLib.format(year, "yyyy");
|
|
7029
|
+
}
|
|
7030
|
+
var formatYearCaption = formatYearDropdown;
|
|
7031
|
+
|
|
7032
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js
|
|
7033
|
+
function getFormatters(customFormatters) {
|
|
7034
|
+
if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
|
|
7035
|
+
customFormatters.formatCaption = customFormatters.formatMonthCaption;
|
|
7036
|
+
}
|
|
7037
|
+
if (customFormatters?.formatYearCaption && !customFormatters.formatYearDropdown) {
|
|
7038
|
+
customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
|
|
7039
|
+
}
|
|
7040
|
+
return {
|
|
7041
|
+
...formatters_exports,
|
|
7042
|
+
...customFormatters
|
|
7043
|
+
};
|
|
7044
|
+
}
|
|
7045
|
+
|
|
7046
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/index.js
|
|
7047
|
+
var labels_exports = {};
|
|
7048
|
+
__export(labels_exports, {
|
|
7049
|
+
labelCaption: () => labelCaption,
|
|
7050
|
+
labelDay: () => labelDay,
|
|
7051
|
+
labelDayButton: () => labelDayButton,
|
|
7052
|
+
labelGrid: () => labelGrid,
|
|
7053
|
+
labelGridcell: () => labelGridcell,
|
|
7054
|
+
labelMonthDropdown: () => labelMonthDropdown,
|
|
7055
|
+
labelNav: () => labelNav,
|
|
7056
|
+
labelNext: () => labelNext,
|
|
7057
|
+
labelPrevious: () => labelPrevious,
|
|
7058
|
+
labelWeekNumber: () => labelWeekNumber,
|
|
7059
|
+
labelWeekNumberHeader: () => labelWeekNumberHeader,
|
|
7060
|
+
labelWeekday: () => labelWeekday,
|
|
7061
|
+
labelYearDropdown: () => labelYearDropdown
|
|
7062
|
+
});
|
|
7063
|
+
|
|
7064
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js
|
|
7065
|
+
function labelDayButton(date, modifiers, options, dateLib) {
|
|
7066
|
+
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
|
|
7067
|
+
if (modifiers.today)
|
|
7068
|
+
label = `Today, ${label}`;
|
|
7069
|
+
if (modifiers.selected)
|
|
7070
|
+
label = `${label}, selected`;
|
|
7071
|
+
return label;
|
|
7072
|
+
}
|
|
7073
|
+
var labelDay = labelDayButton;
|
|
7074
|
+
|
|
7075
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelGrid.js
|
|
7076
|
+
function labelGrid(date, options, dateLib) {
|
|
7077
|
+
const lib = dateLib ?? new DateLib(options);
|
|
7078
|
+
return lib.formatMonthYear(date);
|
|
7079
|
+
}
|
|
7080
|
+
var labelCaption = labelGrid;
|
|
7081
|
+
|
|
7082
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js
|
|
7083
|
+
function labelGridcell(date, modifiers, options, dateLib) {
|
|
7084
|
+
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
|
|
7085
|
+
if (modifiers?.today) {
|
|
7086
|
+
label = `Today, ${label}`;
|
|
7087
|
+
}
|
|
7088
|
+
return label;
|
|
7089
|
+
}
|
|
7090
|
+
|
|
7091
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js
|
|
7092
|
+
function labelMonthDropdown(_options) {
|
|
7093
|
+
return "Choose the Month";
|
|
7094
|
+
}
|
|
7095
|
+
|
|
7096
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelNav.js
|
|
7097
|
+
function labelNav() {
|
|
7098
|
+
return "";
|
|
7099
|
+
}
|
|
7100
|
+
|
|
7101
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelNext.js
|
|
7102
|
+
var defaultLabel = "Go to the Next Month";
|
|
7103
|
+
function labelNext(_month, _options) {
|
|
7104
|
+
return defaultLabel;
|
|
7105
|
+
}
|
|
7106
|
+
|
|
7107
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js
|
|
7108
|
+
function labelPrevious(_month) {
|
|
7109
|
+
return "Go to the Previous Month";
|
|
7110
|
+
}
|
|
7111
|
+
|
|
7112
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js
|
|
7113
|
+
function labelWeekday(date, options, dateLib) {
|
|
7114
|
+
return (dateLib ?? new DateLib(options)).format(date, "cccc");
|
|
7115
|
+
}
|
|
7116
|
+
|
|
7117
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js
|
|
7118
|
+
function labelWeekNumber(weekNumber, _options) {
|
|
7119
|
+
return `Week ${weekNumber}`;
|
|
7120
|
+
}
|
|
7121
|
+
|
|
7122
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js
|
|
7123
|
+
function labelWeekNumberHeader(_options) {
|
|
7124
|
+
return "Week Number";
|
|
7125
|
+
}
|
|
7126
|
+
|
|
7127
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js
|
|
7128
|
+
function labelYearDropdown(_options) {
|
|
7129
|
+
return "Choose the Year";
|
|
7130
|
+
}
|
|
7131
|
+
|
|
7132
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getLabels.js
|
|
7133
|
+
var resolveLabel = (defaultLabel2, customLabel, localeLabel) => {
|
|
7134
|
+
if (customLabel)
|
|
7135
|
+
return customLabel;
|
|
7136
|
+
if (localeLabel) {
|
|
7137
|
+
return typeof localeLabel === "function" ? localeLabel : (..._args) => localeLabel;
|
|
7138
|
+
}
|
|
7139
|
+
return defaultLabel2;
|
|
7140
|
+
};
|
|
7141
|
+
function getLabels(customLabels, options) {
|
|
7142
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
7143
|
+
return {
|
|
7144
|
+
...labels_exports,
|
|
7145
|
+
...customLabels ?? {},
|
|
7146
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
7147
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
7148
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
7149
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
7150
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
7151
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
7152
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
7153
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
7154
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
7155
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
7156
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday)
|
|
7157
|
+
};
|
|
7158
|
+
}
|
|
7159
|
+
|
|
7160
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
|
|
7161
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
|
|
7162
|
+
const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
|
|
7163
|
+
const months = eachMonthOfInterval2({
|
|
7164
|
+
start: startOfYear2(displayMonth),
|
|
7165
|
+
end: endOfYear2(displayMonth)
|
|
7166
|
+
});
|
|
7167
|
+
const options = months.map((month) => {
|
|
7168
|
+
const label = formatters2.formatMonthDropdown(month, dateLib);
|
|
7169
|
+
const value = getMonth2(month);
|
|
7170
|
+
const disabled = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
|
|
7171
|
+
return { value, label, disabled };
|
|
7172
|
+
});
|
|
7173
|
+
return options;
|
|
7174
|
+
}
|
|
7175
|
+
|
|
7176
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
|
|
7177
|
+
function getStyleForModifiers(dayModifiers, styles2 = {}, modifiersStyles = {}) {
|
|
7178
|
+
let style = { ...styles2?.[UI.Day] };
|
|
7179
|
+
Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
|
|
7180
|
+
style = {
|
|
7181
|
+
...style,
|
|
7182
|
+
...modifiersStyles?.[modifier]
|
|
7183
|
+
};
|
|
7184
|
+
});
|
|
7185
|
+
return style;
|
|
7186
|
+
}
|
|
7187
|
+
|
|
7188
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
|
|
7189
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
7190
|
+
const referenceToday = today ?? dateLib.today();
|
|
7191
|
+
const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
|
|
7192
|
+
const days = [];
|
|
7193
|
+
for (let i = 0; i < 7; i++) {
|
|
7194
|
+
const day = dateLib.addDays(start, i);
|
|
7195
|
+
days.push(day);
|
|
7196
|
+
}
|
|
7197
|
+
return days;
|
|
7198
|
+
}
|
|
7199
|
+
|
|
7200
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
|
|
7201
|
+
function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
|
|
7202
|
+
if (!navStart)
|
|
7203
|
+
return void 0;
|
|
7204
|
+
if (!navEnd)
|
|
7205
|
+
return void 0;
|
|
7206
|
+
const { startOfYear: startOfYear2, endOfYear: endOfYear2, eachYearOfInterval: eachYearOfInterval2, getYear: getYear2 } = dateLib;
|
|
7207
|
+
const firstNavYear = startOfYear2(navStart);
|
|
7208
|
+
const lastNavYear = endOfYear2(navEnd);
|
|
7209
|
+
const years = eachYearOfInterval2({ start: firstNavYear, end: lastNavYear });
|
|
7210
|
+
if (reverse)
|
|
7211
|
+
years.reverse();
|
|
7212
|
+
return years.map((year) => {
|
|
7213
|
+
const label = formatters2.formatYearDropdown(year, dateLib);
|
|
7214
|
+
return {
|
|
7215
|
+
value: getYear2(year),
|
|
7216
|
+
label,
|
|
7217
|
+
disabled: false
|
|
7218
|
+
};
|
|
7219
|
+
});
|
|
7220
|
+
}
|
|
7221
|
+
|
|
7222
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/noonDateLib.js
|
|
7223
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
7224
|
+
const { weekStartsOn, locale } = options;
|
|
7225
|
+
const fallbackWeekStartsOn = weekStartsOn ?? locale?.options?.weekStartsOn ?? 0;
|
|
7226
|
+
const toNoonTZDate = (date) => {
|
|
7227
|
+
const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
|
|
7228
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
7229
|
+
};
|
|
7230
|
+
const toCalendarDate = (date) => {
|
|
7231
|
+
const zoned = toNoonTZDate(date);
|
|
7232
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
7233
|
+
};
|
|
7234
|
+
return {
|
|
7235
|
+
today: () => {
|
|
7236
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
7237
|
+
},
|
|
7238
|
+
newDate: (year, monthIndex, date) => {
|
|
7239
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
7240
|
+
},
|
|
7241
|
+
startOfDay: (date) => {
|
|
7242
|
+
return toNoonTZDate(date);
|
|
7243
|
+
},
|
|
7244
|
+
startOfWeek: (date, options2) => {
|
|
7245
|
+
const base = toNoonTZDate(date);
|
|
7246
|
+
const weekStartsOnValue = options2?.weekStartsOn ?? fallbackWeekStartsOn;
|
|
7247
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
7248
|
+
base.setDate(base.getDate() - diff);
|
|
7249
|
+
return base;
|
|
7250
|
+
},
|
|
7251
|
+
startOfISOWeek: (date) => {
|
|
7252
|
+
const base = toNoonTZDate(date);
|
|
7253
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
7254
|
+
base.setDate(base.getDate() - diff);
|
|
7255
|
+
return base;
|
|
7256
|
+
},
|
|
7257
|
+
startOfMonth: (date) => {
|
|
7258
|
+
const base = toNoonTZDate(date);
|
|
7259
|
+
base.setDate(1);
|
|
7260
|
+
return base;
|
|
7261
|
+
},
|
|
7262
|
+
startOfYear: (date) => {
|
|
7263
|
+
const base = toNoonTZDate(date);
|
|
7264
|
+
base.setMonth(0, 1);
|
|
7265
|
+
return base;
|
|
7266
|
+
},
|
|
7267
|
+
endOfWeek: (date, options2) => {
|
|
7268
|
+
const base = toNoonTZDate(date);
|
|
7269
|
+
const weekStartsOnValue = options2?.weekStartsOn ?? fallbackWeekStartsOn;
|
|
7270
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
7271
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
7272
|
+
base.setDate(base.getDate() + diff);
|
|
7273
|
+
return base;
|
|
7274
|
+
},
|
|
7275
|
+
endOfISOWeek: (date) => {
|
|
7276
|
+
const base = toNoonTZDate(date);
|
|
7277
|
+
const diff = (7 - base.getDay()) % 7;
|
|
7278
|
+
base.setDate(base.getDate() + diff);
|
|
7279
|
+
return base;
|
|
7280
|
+
},
|
|
7281
|
+
endOfMonth: (date) => {
|
|
7282
|
+
const base = toNoonTZDate(date);
|
|
7283
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
7284
|
+
return base;
|
|
7285
|
+
},
|
|
7286
|
+
endOfYear: (date) => {
|
|
7287
|
+
const base = toNoonTZDate(date);
|
|
7288
|
+
base.setMonth(11, 31);
|
|
7289
|
+
return base;
|
|
7290
|
+
},
|
|
7291
|
+
eachMonthOfInterval: (interval) => {
|
|
7292
|
+
const start = toNoonTZDate(interval.start);
|
|
7293
|
+
const end = toNoonTZDate(interval.end);
|
|
7294
|
+
const result = [];
|
|
7295
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
7296
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
7297
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
7298
|
+
result.push(new TZDate(cursor, timeZone));
|
|
7299
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
7300
|
+
}
|
|
7301
|
+
return result;
|
|
7302
|
+
},
|
|
7303
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
7304
|
+
// mutate the same TZDate, and return it.
|
|
7305
|
+
addDays: (date, amount) => {
|
|
7306
|
+
const base = toNoonTZDate(date);
|
|
7307
|
+
base.setDate(base.getDate() + amount);
|
|
7308
|
+
return base;
|
|
7309
|
+
},
|
|
7310
|
+
addWeeks: (date, amount) => {
|
|
7311
|
+
const base = toNoonTZDate(date);
|
|
7312
|
+
base.setDate(base.getDate() + amount * 7);
|
|
7313
|
+
return base;
|
|
7314
|
+
},
|
|
7315
|
+
addMonths: (date, amount) => {
|
|
7316
|
+
const base = toNoonTZDate(date);
|
|
7317
|
+
base.setMonth(base.getMonth() + amount);
|
|
7318
|
+
return base;
|
|
7319
|
+
},
|
|
7320
|
+
addYears: (date, amount) => {
|
|
7321
|
+
const base = toNoonTZDate(date);
|
|
7322
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
7323
|
+
return base;
|
|
7324
|
+
},
|
|
7325
|
+
eachYearOfInterval: (interval) => {
|
|
7326
|
+
const start = toNoonTZDate(interval.start);
|
|
7327
|
+
const end = toNoonTZDate(interval.end);
|
|
7328
|
+
const years = [];
|
|
7329
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
7330
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
7331
|
+
years.push(new TZDate(cursor, timeZone));
|
|
7332
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
7333
|
+
}
|
|
7334
|
+
return years;
|
|
7335
|
+
},
|
|
7336
|
+
getWeek: (date, options2) => {
|
|
7337
|
+
const base = toCalendarDate(date);
|
|
7338
|
+
return getWeek(base, {
|
|
7339
|
+
weekStartsOn: options2?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
7340
|
+
firstWeekContainsDate: options2?.firstWeekContainsDate ?? locale?.options?.firstWeekContainsDate ?? 1
|
|
7341
|
+
});
|
|
7342
|
+
},
|
|
7343
|
+
getISOWeek: (date) => {
|
|
7344
|
+
const base = toCalendarDate(date);
|
|
7345
|
+
return getISOWeek(base);
|
|
7346
|
+
},
|
|
7347
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
7348
|
+
const left = toCalendarDate(dateLeft);
|
|
7349
|
+
const right = toCalendarDate(dateRight);
|
|
7350
|
+
return differenceInCalendarDays(left, right);
|
|
7351
|
+
},
|
|
7352
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
7353
|
+
const left = toCalendarDate(dateLeft);
|
|
7354
|
+
const right = toCalendarDate(dateRight);
|
|
7355
|
+
return differenceInCalendarMonths(left, right);
|
|
7356
|
+
}
|
|
7357
|
+
};
|
|
7358
|
+
}
|
|
7359
|
+
var asHtmlElement = (element) => {
|
|
7360
|
+
if (element instanceof HTMLElement)
|
|
7361
|
+
return element;
|
|
7362
|
+
return null;
|
|
7363
|
+
};
|
|
7364
|
+
var queryMonthEls = (element) => [
|
|
7365
|
+
...element.querySelectorAll("[data-animated-month]") ?? []
|
|
7366
|
+
];
|
|
7367
|
+
var queryMonthEl = (element) => asHtmlElement(element.querySelector("[data-animated-month]"));
|
|
7368
|
+
var queryCaptionEl = (element) => asHtmlElement(element.querySelector("[data-animated-caption]"));
|
|
7369
|
+
var queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-animated-weeks]"));
|
|
7370
|
+
var queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
|
|
7371
|
+
var queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
|
|
7372
|
+
function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {
|
|
7373
|
+
const previousRootElSnapshotRef = useRef(null);
|
|
7374
|
+
const previousMonthsRef = useRef(months);
|
|
7375
|
+
const animatingRef = useRef(false);
|
|
7376
|
+
useLayoutEffect(() => {
|
|
7377
|
+
const previousMonths = previousMonthsRef.current;
|
|
7378
|
+
previousMonthsRef.current = months;
|
|
7379
|
+
if (!enabled || !rootElRef.current || // safety check because the ref can be set to anything by consumers
|
|
7380
|
+
!(rootElRef.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
7381
|
+
months.length === 0 || previousMonths.length === 0 || months.length !== previousMonths.length) {
|
|
7382
|
+
return;
|
|
7383
|
+
}
|
|
7384
|
+
const isSameMonth2 = dateLib.isSameMonth(months[0].date, previousMonths[0].date);
|
|
7385
|
+
const isAfterPreviousMonth = dateLib.isAfter(months[0].date, previousMonths[0].date);
|
|
7386
|
+
const captionAnimationClass = isAfterPreviousMonth ? classNames[Animation.caption_after_enter] : classNames[Animation.caption_before_enter];
|
|
7387
|
+
const weeksAnimationClass = isAfterPreviousMonth ? classNames[Animation.weeks_after_enter] : classNames[Animation.weeks_before_enter];
|
|
7388
|
+
const previousRootElSnapshot = previousRootElSnapshotRef.current;
|
|
7389
|
+
const rootElSnapshot = rootElRef.current.cloneNode(true);
|
|
7390
|
+
if (rootElSnapshot instanceof HTMLElement) {
|
|
7391
|
+
const currentMonthElsSnapshot = queryMonthEls(rootElSnapshot);
|
|
7392
|
+
currentMonthElsSnapshot.forEach((currentMonthElSnapshot) => {
|
|
7393
|
+
if (!(currentMonthElSnapshot instanceof HTMLElement))
|
|
7394
|
+
return;
|
|
7395
|
+
const previousMonthElSnapshot = queryMonthEl(currentMonthElSnapshot);
|
|
7396
|
+
if (previousMonthElSnapshot && currentMonthElSnapshot.contains(previousMonthElSnapshot)) {
|
|
7397
|
+
currentMonthElSnapshot.removeChild(previousMonthElSnapshot);
|
|
7398
|
+
}
|
|
7399
|
+
const captionEl = queryCaptionEl(currentMonthElSnapshot);
|
|
7400
|
+
if (captionEl) {
|
|
7401
|
+
captionEl.classList.remove(captionAnimationClass);
|
|
7402
|
+
}
|
|
7403
|
+
const weeksEl = queryWeeksEl(currentMonthElSnapshot);
|
|
7404
|
+
if (weeksEl) {
|
|
7405
|
+
weeksEl.classList.remove(weeksAnimationClass);
|
|
7406
|
+
}
|
|
7407
|
+
});
|
|
7408
|
+
previousRootElSnapshotRef.current = rootElSnapshot;
|
|
7409
|
+
} else {
|
|
7410
|
+
previousRootElSnapshotRef.current = null;
|
|
7411
|
+
}
|
|
7412
|
+
if (animatingRef.current || isSameMonth2 || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
7413
|
+
focused) {
|
|
7414
|
+
return;
|
|
7415
|
+
}
|
|
7416
|
+
const previousMonthEls = previousRootElSnapshot instanceof HTMLElement ? queryMonthEls(previousRootElSnapshot) : [];
|
|
7417
|
+
const currentMonthEls = queryMonthEls(rootElRef.current);
|
|
7418
|
+
if (currentMonthEls?.every((el) => el instanceof HTMLElement) && previousMonthEls && previousMonthEls.every((el) => el instanceof HTMLElement)) {
|
|
7419
|
+
animatingRef.current = true;
|
|
7420
|
+
rootElRef.current.style.isolation = "isolate";
|
|
7421
|
+
const navEl = queryNavEl(rootElRef.current);
|
|
7422
|
+
if (navEl) {
|
|
7423
|
+
navEl.style.zIndex = "1";
|
|
7424
|
+
}
|
|
7425
|
+
currentMonthEls.forEach((currentMonthEl, index) => {
|
|
7426
|
+
const previousMonthEl = previousMonthEls[index];
|
|
7427
|
+
if (!previousMonthEl) {
|
|
7428
|
+
return;
|
|
7429
|
+
}
|
|
7430
|
+
currentMonthEl.style.position = "relative";
|
|
7431
|
+
currentMonthEl.style.overflow = "hidden";
|
|
7432
|
+
const captionEl = queryCaptionEl(currentMonthEl);
|
|
7433
|
+
if (captionEl) {
|
|
7434
|
+
captionEl.classList.add(captionAnimationClass);
|
|
7435
|
+
}
|
|
7436
|
+
const weeksEl = queryWeeksEl(currentMonthEl);
|
|
7437
|
+
if (weeksEl) {
|
|
7438
|
+
weeksEl.classList.add(weeksAnimationClass);
|
|
7439
|
+
}
|
|
7440
|
+
const cleanUp = () => {
|
|
7441
|
+
animatingRef.current = false;
|
|
7442
|
+
if (rootElRef.current) {
|
|
7443
|
+
rootElRef.current.style.isolation = "";
|
|
7444
|
+
}
|
|
7445
|
+
if (navEl) {
|
|
7446
|
+
navEl.style.zIndex = "";
|
|
7447
|
+
}
|
|
7448
|
+
if (captionEl) {
|
|
7449
|
+
captionEl.classList.remove(captionAnimationClass);
|
|
7450
|
+
}
|
|
7451
|
+
if (weeksEl) {
|
|
7452
|
+
weeksEl.classList.remove(weeksAnimationClass);
|
|
7453
|
+
}
|
|
7454
|
+
currentMonthEl.style.position = "";
|
|
7455
|
+
currentMonthEl.style.overflow = "";
|
|
7456
|
+
if (currentMonthEl.contains(previousMonthEl)) {
|
|
7457
|
+
currentMonthEl.removeChild(previousMonthEl);
|
|
7458
|
+
}
|
|
7459
|
+
};
|
|
7460
|
+
previousMonthEl.style.pointerEvents = "none";
|
|
7461
|
+
previousMonthEl.style.position = "absolute";
|
|
7462
|
+
previousMonthEl.style.overflow = "hidden";
|
|
7463
|
+
previousMonthEl.setAttribute("aria-hidden", "true");
|
|
7464
|
+
const previousWeekdaysEl = queryWeekdaysEl(previousMonthEl);
|
|
7465
|
+
if (previousWeekdaysEl) {
|
|
7466
|
+
previousWeekdaysEl.style.opacity = "0";
|
|
7467
|
+
}
|
|
7468
|
+
const previousCaptionEl = queryCaptionEl(previousMonthEl);
|
|
7469
|
+
if (previousCaptionEl) {
|
|
7470
|
+
previousCaptionEl.classList.add(isAfterPreviousMonth ? classNames[Animation.caption_before_exit] : classNames[Animation.caption_after_exit]);
|
|
7471
|
+
previousCaptionEl.addEventListener("animationend", cleanUp);
|
|
7472
|
+
}
|
|
7473
|
+
const previousWeeksEl = queryWeeksEl(previousMonthEl);
|
|
7474
|
+
if (previousWeeksEl) {
|
|
7475
|
+
previousWeeksEl.classList.add(isAfterPreviousMonth ? classNames[Animation.weeks_before_exit] : classNames[Animation.weeks_after_exit]);
|
|
7476
|
+
}
|
|
7477
|
+
currentMonthEl.insertBefore(previousMonthEl, currentMonthEl.firstChild);
|
|
7478
|
+
});
|
|
7479
|
+
}
|
|
7480
|
+
});
|
|
7481
|
+
}
|
|
7482
|
+
|
|
7483
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getDates.js
|
|
7484
|
+
function getDates(displayMonths, maxDate, props, dateLib) {
|
|
7485
|
+
const firstMonth = displayMonths[0];
|
|
7486
|
+
const lastMonth = displayMonths[displayMonths.length - 1];
|
|
7487
|
+
const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
|
|
7488
|
+
const { addDays: addDays2, differenceInCalendarDays: differenceInCalendarDays2, differenceInCalendarMonths: differenceInCalendarMonths2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, isAfter: isAfter2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
|
|
7489
|
+
const startWeekFirstDate = broadcastCalendar ? startOfBroadcastWeek2(firstMonth, dateLib) : ISOWeek ? startOfISOWeek2(firstMonth) : startOfWeek2(firstMonth);
|
|
7490
|
+
const displayMonthsWeekEnd = broadcastCalendar ? endOfBroadcastWeek2(lastMonth) : ISOWeek ? endOfISOWeek2(endOfMonth2(lastMonth)) : endOfWeek2(endOfMonth2(lastMonth));
|
|
7491
|
+
const constraintWeekEnd = maxDate && (broadcastCalendar ? endOfBroadcastWeek2(maxDate) : ISOWeek ? endOfISOWeek2(maxDate) : endOfWeek2(maxDate));
|
|
7492
|
+
const gridEndDate = constraintWeekEnd && isAfter2(displayMonthsWeekEnd, constraintWeekEnd) ? constraintWeekEnd : displayMonthsWeekEnd;
|
|
7493
|
+
const nOfDays = differenceInCalendarDays2(gridEndDate, startWeekFirstDate);
|
|
7494
|
+
const nOfMonths = differenceInCalendarMonths2(lastMonth, firstMonth) + 1;
|
|
7495
|
+
const dates = [];
|
|
7496
|
+
for (let i = 0; i <= nOfDays; i++) {
|
|
7497
|
+
const date = addDays2(startWeekFirstDate, i);
|
|
7498
|
+
dates.push(date);
|
|
7499
|
+
}
|
|
7500
|
+
const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
|
|
7501
|
+
const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
|
|
7502
|
+
if (fixedWeeks && dates.length < extraDates) {
|
|
7503
|
+
const daysToAdd = extraDates - dates.length;
|
|
7504
|
+
for (let i = 0; i < daysToAdd; i++) {
|
|
7505
|
+
const date = addDays2(dates[dates.length - 1], 1);
|
|
7506
|
+
dates.push(date);
|
|
7507
|
+
}
|
|
7508
|
+
}
|
|
7509
|
+
return dates;
|
|
7510
|
+
}
|
|
7511
|
+
|
|
7512
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getDays.js
|
|
7513
|
+
function getDays(calendarMonths) {
|
|
7514
|
+
const initialDays = [];
|
|
7515
|
+
return calendarMonths.reduce((days, month) => {
|
|
7516
|
+
const weekDays = month.weeks.reduce((weekDays2, week) => {
|
|
7517
|
+
return weekDays2.concat(week.days.slice());
|
|
7518
|
+
}, initialDays.slice());
|
|
7519
|
+
return days.concat(weekDays.slice());
|
|
7520
|
+
}, initialDays.slice());
|
|
7521
|
+
}
|
|
7522
|
+
|
|
7523
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js
|
|
7524
|
+
function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {
|
|
7525
|
+
const { numberOfMonths = 1 } = props;
|
|
7526
|
+
const months = [];
|
|
7527
|
+
for (let i = 0; i < numberOfMonths; i++) {
|
|
7528
|
+
const month = dateLib.addMonths(firstDisplayedMonth, i);
|
|
7529
|
+
if (calendarEndMonth && month > calendarEndMonth) {
|
|
7530
|
+
break;
|
|
7531
|
+
}
|
|
7532
|
+
months.push(month);
|
|
7533
|
+
}
|
|
7534
|
+
return months;
|
|
7535
|
+
}
|
|
7536
|
+
|
|
7537
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js
|
|
7538
|
+
function getInitialMonth(props, navStart, navEnd, dateLib) {
|
|
7539
|
+
const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1 } = props;
|
|
7540
|
+
let initialMonth = month || defaultMonth || today;
|
|
7541
|
+
const { differenceInCalendarMonths: differenceInCalendarMonths2, addMonths: addMonths2, startOfMonth: startOfMonth2 } = dateLib;
|
|
7542
|
+
if (navEnd && differenceInCalendarMonths2(navEnd, initialMonth) < numberOfMonths - 1) {
|
|
7543
|
+
const offset = -1 * (numberOfMonths - 1);
|
|
7544
|
+
initialMonth = addMonths2(navEnd, offset);
|
|
7545
|
+
}
|
|
7546
|
+
if (navStart && differenceInCalendarMonths2(initialMonth, navStart) < 0) {
|
|
7547
|
+
initialMonth = navStart;
|
|
7548
|
+
}
|
|
7549
|
+
return startOfMonth2(initialMonth);
|
|
7550
|
+
}
|
|
7551
|
+
|
|
7552
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getMonths.js
|
|
7553
|
+
function getMonths(displayMonths, dates, props, dateLib) {
|
|
7554
|
+
const { addDays: addDays2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, getISOWeek: getISOWeek2, getWeek: getWeek2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
|
|
7555
|
+
const dayPickerMonths = displayMonths.reduce((months, month) => {
|
|
7556
|
+
const firstDateOfFirstWeek = props.broadcastCalendar ? startOfBroadcastWeek2(month, dateLib) : props.ISOWeek ? startOfISOWeek2(month) : startOfWeek2(month);
|
|
7557
|
+
const lastDateOfLastWeek = props.broadcastCalendar ? endOfBroadcastWeek2(month) : props.ISOWeek ? endOfISOWeek2(endOfMonth2(month)) : endOfWeek2(endOfMonth2(month));
|
|
7558
|
+
const monthDates = dates.filter((date) => {
|
|
7559
|
+
return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
|
|
7560
|
+
});
|
|
7561
|
+
const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;
|
|
7562
|
+
if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
|
|
7563
|
+
const extraDates = dates.filter((date) => {
|
|
7564
|
+
const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;
|
|
7565
|
+
return date > lastDateOfLastWeek && date <= addDays2(lastDateOfLastWeek, daysToAdd);
|
|
7566
|
+
});
|
|
7567
|
+
monthDates.push(...extraDates);
|
|
7568
|
+
}
|
|
7569
|
+
const weeks = monthDates.reduce((weeks2, date) => {
|
|
7570
|
+
const weekNumber = props.ISOWeek ? getISOWeek2(date) : getWeek2(date);
|
|
7571
|
+
const week = weeks2.find((week2) => week2.weekNumber === weekNumber);
|
|
7572
|
+
const day = new CalendarDay(date, month, dateLib);
|
|
7573
|
+
if (!week) {
|
|
7574
|
+
weeks2.push(new CalendarWeek(weekNumber, [day]));
|
|
7575
|
+
} else {
|
|
7576
|
+
week.days.push(day);
|
|
7577
|
+
}
|
|
7578
|
+
return weeks2;
|
|
7579
|
+
}, []);
|
|
7580
|
+
const dayPickerMonth = new CalendarMonth(month, weeks);
|
|
7581
|
+
months.push(dayPickerMonth);
|
|
7582
|
+
return months;
|
|
7583
|
+
}, []);
|
|
7584
|
+
if (!props.reverseMonths) {
|
|
7585
|
+
return dayPickerMonths;
|
|
7586
|
+
} else {
|
|
7587
|
+
return dayPickerMonths.reverse();
|
|
7588
|
+
}
|
|
7589
|
+
}
|
|
7590
|
+
|
|
7591
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js
|
|
7592
|
+
function getNavMonths(props, dateLib) {
|
|
7593
|
+
let { startMonth, endMonth } = props;
|
|
7594
|
+
const { startOfYear: startOfYear2, startOfDay: startOfDay2, startOfMonth: startOfMonth2, endOfMonth: endOfMonth2, addYears: addYears2, endOfYear: endOfYear2, newDate, today } = dateLib;
|
|
7595
|
+
const { fromYear, toYear, fromMonth, toMonth } = props;
|
|
7596
|
+
if (!startMonth && fromMonth) {
|
|
7597
|
+
startMonth = fromMonth;
|
|
7598
|
+
}
|
|
7599
|
+
if (!startMonth && fromYear) {
|
|
7600
|
+
startMonth = dateLib.newDate(fromYear, 0, 1);
|
|
7601
|
+
}
|
|
7602
|
+
if (!endMonth && toMonth) {
|
|
7603
|
+
endMonth = toMonth;
|
|
7604
|
+
}
|
|
7605
|
+
if (!endMonth && toYear) {
|
|
7606
|
+
endMonth = newDate(toYear, 11, 31);
|
|
7607
|
+
}
|
|
7608
|
+
const hasYearDropdown = props.captionLayout === "dropdown" || props.captionLayout === "dropdown-years";
|
|
7609
|
+
if (startMonth) {
|
|
7610
|
+
startMonth = startOfMonth2(startMonth);
|
|
7611
|
+
} else if (fromYear) {
|
|
7612
|
+
startMonth = newDate(fromYear, 0, 1);
|
|
7613
|
+
} else if (!startMonth && hasYearDropdown) {
|
|
7614
|
+
startMonth = startOfYear2(addYears2(props.today ?? today(), -100));
|
|
7615
|
+
}
|
|
7616
|
+
if (endMonth) {
|
|
7617
|
+
endMonth = endOfMonth2(endMonth);
|
|
7618
|
+
} else if (toYear) {
|
|
7619
|
+
endMonth = newDate(toYear, 11, 31);
|
|
7620
|
+
} else if (!endMonth && hasYearDropdown) {
|
|
7621
|
+
endMonth = endOfYear2(props.today ?? today());
|
|
7622
|
+
}
|
|
7623
|
+
return [
|
|
7624
|
+
startMonth ? startOfDay2(startMonth) : startMonth,
|
|
7625
|
+
endMonth ? startOfDay2(endMonth) : endMonth
|
|
7626
|
+
];
|
|
7627
|
+
}
|
|
7628
|
+
|
|
7629
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js
|
|
7630
|
+
function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
|
|
7631
|
+
if (options.disableNavigation) {
|
|
7632
|
+
return void 0;
|
|
7633
|
+
}
|
|
7634
|
+
const { pagedNavigation, numberOfMonths = 1 } = options;
|
|
7635
|
+
const { startOfMonth: startOfMonth2, addMonths: addMonths2, differenceInCalendarMonths: differenceInCalendarMonths2 } = dateLib;
|
|
7636
|
+
const offset = pagedNavigation ? numberOfMonths : 1;
|
|
7637
|
+
const month = startOfMonth2(firstDisplayedMonth);
|
|
7638
|
+
if (!calendarEndMonth) {
|
|
7639
|
+
return addMonths2(month, offset);
|
|
7640
|
+
}
|
|
7641
|
+
const monthsDiff = differenceInCalendarMonths2(calendarEndMonth, firstDisplayedMonth);
|
|
7642
|
+
if (monthsDiff < numberOfMonths) {
|
|
7643
|
+
return void 0;
|
|
7644
|
+
}
|
|
7645
|
+
return addMonths2(month, offset);
|
|
7646
|
+
}
|
|
7647
|
+
|
|
7648
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js
|
|
7649
|
+
function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {
|
|
7650
|
+
if (options.disableNavigation) {
|
|
7651
|
+
return void 0;
|
|
7652
|
+
}
|
|
7653
|
+
const { pagedNavigation, numberOfMonths } = options;
|
|
7654
|
+
const { startOfMonth: startOfMonth2, addMonths: addMonths2, differenceInCalendarMonths: differenceInCalendarMonths2 } = dateLib;
|
|
7655
|
+
const offset = pagedNavigation ? numberOfMonths ?? 1 : 1;
|
|
7656
|
+
const month = startOfMonth2(firstDisplayedMonth);
|
|
7657
|
+
if (!calendarStartMonth) {
|
|
7658
|
+
return addMonths2(month, -offset);
|
|
7659
|
+
}
|
|
7660
|
+
const monthsDiff = differenceInCalendarMonths2(month, calendarStartMonth);
|
|
7661
|
+
if (monthsDiff <= 0) {
|
|
7662
|
+
return void 0;
|
|
7663
|
+
}
|
|
7664
|
+
return addMonths2(month, -offset);
|
|
7665
|
+
}
|
|
7666
|
+
|
|
7667
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js
|
|
7668
|
+
function getWeeks(months) {
|
|
7669
|
+
const initialWeeks = [];
|
|
7670
|
+
return months.reduce((weeks, month) => {
|
|
7671
|
+
return weeks.concat(month.weeks.slice());
|
|
7672
|
+
}, initialWeeks.slice());
|
|
7673
|
+
}
|
|
7674
|
+
function useControlledValue(defaultValue, controlledValue) {
|
|
7675
|
+
const [uncontrolledValue, setValue] = useState(defaultValue);
|
|
7676
|
+
const value = controlledValue === void 0 ? uncontrolledValue : controlledValue;
|
|
7677
|
+
return [value, setValue];
|
|
7678
|
+
}
|
|
7679
|
+
|
|
7680
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/useCalendar.js
|
|
7681
|
+
function useCalendar(props, dateLib) {
|
|
7682
|
+
const [navStart, navEnd] = getNavMonths(props, dateLib);
|
|
7683
|
+
const { startOfMonth: startOfMonth2, endOfMonth: endOfMonth2 } = dateLib;
|
|
7684
|
+
const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
7685
|
+
const [firstMonth, setFirstMonth] = useControlledValue(
|
|
7686
|
+
initialMonth,
|
|
7687
|
+
// initialMonth is always computed from props.month if provided
|
|
7688
|
+
props.month ? initialMonth : void 0
|
|
7689
|
+
);
|
|
7690
|
+
useEffect(() => {
|
|
7691
|
+
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
7692
|
+
setFirstMonth(newInitialMonth);
|
|
7693
|
+
}, [props.timeZone]);
|
|
7694
|
+
const { months, weeks, days, previousMonth, nextMonth } = useMemo(() => {
|
|
7695
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
7696
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth2(props.endMonth) : void 0, {
|
|
7697
|
+
ISOWeek: props.ISOWeek,
|
|
7698
|
+
fixedWeeks: props.fixedWeeks,
|
|
7699
|
+
broadcastCalendar: props.broadcastCalendar
|
|
7700
|
+
}, dateLib);
|
|
7701
|
+
const months2 = getMonths(displayMonths, dates, {
|
|
7702
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
7703
|
+
fixedWeeks: props.fixedWeeks,
|
|
7704
|
+
ISOWeek: props.ISOWeek,
|
|
7705
|
+
reverseMonths: props.reverseMonths
|
|
7706
|
+
}, dateLib);
|
|
7707
|
+
const weeks2 = getWeeks(months2);
|
|
7708
|
+
const days2 = getDays(months2);
|
|
7709
|
+
const previousMonth2 = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
7710
|
+
const nextMonth2 = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
7711
|
+
return {
|
|
7712
|
+
months: months2,
|
|
7713
|
+
weeks: weeks2,
|
|
7714
|
+
days: days2,
|
|
7715
|
+
previousMonth: previousMonth2,
|
|
7716
|
+
nextMonth: nextMonth2
|
|
7717
|
+
};
|
|
7718
|
+
}, [
|
|
7719
|
+
dateLib,
|
|
7720
|
+
firstMonth.getTime(),
|
|
7721
|
+
navEnd?.getTime(),
|
|
7722
|
+
navStart?.getTime(),
|
|
7723
|
+
props.disableNavigation,
|
|
7724
|
+
props.broadcastCalendar,
|
|
7725
|
+
props.endMonth?.getTime(),
|
|
7726
|
+
props.fixedWeeks,
|
|
7727
|
+
props.ISOWeek,
|
|
7728
|
+
props.numberOfMonths,
|
|
7729
|
+
props.pagedNavigation,
|
|
7730
|
+
props.reverseMonths
|
|
7731
|
+
]);
|
|
7732
|
+
const { disableNavigation, onMonthChange } = props;
|
|
7733
|
+
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
7734
|
+
const goToMonth = (date) => {
|
|
7735
|
+
if (disableNavigation) {
|
|
7736
|
+
return;
|
|
7737
|
+
}
|
|
7738
|
+
let newMonth = startOfMonth2(date);
|
|
7739
|
+
if (navStart && newMonth < startOfMonth2(navStart)) {
|
|
7740
|
+
newMonth = startOfMonth2(navStart);
|
|
7741
|
+
}
|
|
7742
|
+
if (navEnd && newMonth > startOfMonth2(navEnd)) {
|
|
7743
|
+
newMonth = startOfMonth2(navEnd);
|
|
7744
|
+
}
|
|
7745
|
+
setFirstMonth(newMonth);
|
|
7746
|
+
onMonthChange?.(newMonth);
|
|
7747
|
+
};
|
|
7748
|
+
const goToDay = (day) => {
|
|
7749
|
+
if (isDayInCalendar(day)) {
|
|
7750
|
+
return;
|
|
7751
|
+
}
|
|
7752
|
+
goToMonth(day.date);
|
|
7753
|
+
};
|
|
7754
|
+
const calendar = {
|
|
7755
|
+
months,
|
|
7756
|
+
weeks,
|
|
7757
|
+
days,
|
|
7758
|
+
navStart,
|
|
7759
|
+
navEnd,
|
|
7760
|
+
previousMonth,
|
|
7761
|
+
nextMonth,
|
|
7762
|
+
goToMonth,
|
|
7763
|
+
goToDay
|
|
7764
|
+
};
|
|
7765
|
+
return calendar;
|
|
7766
|
+
}
|
|
7767
|
+
|
|
7768
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js
|
|
7769
|
+
var FocusTargetPriority;
|
|
7770
|
+
(function(FocusTargetPriority2) {
|
|
7771
|
+
FocusTargetPriority2[FocusTargetPriority2["Today"] = 0] = "Today";
|
|
7772
|
+
FocusTargetPriority2[FocusTargetPriority2["Selected"] = 1] = "Selected";
|
|
7773
|
+
FocusTargetPriority2[FocusTargetPriority2["LastFocused"] = 2] = "LastFocused";
|
|
7774
|
+
FocusTargetPriority2[FocusTargetPriority2["FocusedModifier"] = 3] = "FocusedModifier";
|
|
7775
|
+
})(FocusTargetPriority || (FocusTargetPriority = {}));
|
|
7776
|
+
function isFocusableDay(modifiers) {
|
|
7777
|
+
return !modifiers[DayFlag.disabled] && !modifiers[DayFlag.hidden] && !modifiers[DayFlag.outside];
|
|
7778
|
+
}
|
|
7779
|
+
function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {
|
|
7780
|
+
let focusTarget;
|
|
7781
|
+
let foundFocusTargetPriority = -1;
|
|
7782
|
+
for (const day of days) {
|
|
7783
|
+
const modifiers = getModifiers(day);
|
|
7784
|
+
if (isFocusableDay(modifiers)) {
|
|
7785
|
+
if (modifiers[DayFlag.focused] && foundFocusTargetPriority < FocusTargetPriority.FocusedModifier) {
|
|
7786
|
+
focusTarget = day;
|
|
7787
|
+
foundFocusTargetPriority = FocusTargetPriority.FocusedModifier;
|
|
7788
|
+
} else if (lastFocused?.isEqualTo(day) && foundFocusTargetPriority < FocusTargetPriority.LastFocused) {
|
|
7789
|
+
focusTarget = day;
|
|
7790
|
+
foundFocusTargetPriority = FocusTargetPriority.LastFocused;
|
|
7791
|
+
} else if (isSelected(day.date) && foundFocusTargetPriority < FocusTargetPriority.Selected) {
|
|
7792
|
+
focusTarget = day;
|
|
7793
|
+
foundFocusTargetPriority = FocusTargetPriority.Selected;
|
|
7794
|
+
} else if (modifiers[DayFlag.today] && foundFocusTargetPriority < FocusTargetPriority.Today) {
|
|
7795
|
+
focusTarget = day;
|
|
7796
|
+
foundFocusTargetPriority = FocusTargetPriority.Today;
|
|
7797
|
+
}
|
|
7798
|
+
}
|
|
7799
|
+
}
|
|
7800
|
+
if (!focusTarget) {
|
|
7801
|
+
focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));
|
|
7802
|
+
}
|
|
7803
|
+
return focusTarget;
|
|
7804
|
+
}
|
|
7805
|
+
|
|
7806
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js
|
|
7807
|
+
function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
|
|
7808
|
+
const { ISOWeek, broadcastCalendar } = props;
|
|
7809
|
+
const { addDays: addDays2, addMonths: addMonths2, addWeeks: addWeeks2, addYears: addYears2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfWeek: endOfWeek2, max: max2, min: min2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
|
|
7810
|
+
const moveFns = {
|
|
7811
|
+
day: addDays2,
|
|
7812
|
+
week: addWeeks2,
|
|
7813
|
+
month: addMonths2,
|
|
7814
|
+
year: addYears2,
|
|
7815
|
+
startOfWeek: (date) => broadcastCalendar ? startOfBroadcastWeek2(date, dateLib) : ISOWeek ? startOfISOWeek2(date) : startOfWeek2(date),
|
|
7816
|
+
endOfWeek: (date) => broadcastCalendar ? endOfBroadcastWeek2(date) : ISOWeek ? endOfISOWeek2(date) : endOfWeek2(date)
|
|
7817
|
+
};
|
|
7818
|
+
let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
|
|
7819
|
+
if (moveDir === "before" && navStart) {
|
|
7820
|
+
focusableDate = max2([navStart, focusableDate]);
|
|
7821
|
+
} else if (moveDir === "after" && navEnd) {
|
|
7822
|
+
focusableDate = min2([navEnd, focusableDate]);
|
|
7823
|
+
}
|
|
7824
|
+
return focusableDate;
|
|
7825
|
+
}
|
|
7826
|
+
|
|
7827
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js
|
|
7828
|
+
function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {
|
|
7829
|
+
if (attempt > 365) {
|
|
7830
|
+
return void 0;
|
|
7831
|
+
}
|
|
7832
|
+
const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
|
|
7833
|
+
const isDisabled = Boolean(props.disabled && dateMatchModifiers(focusableDate, props.disabled, dateLib));
|
|
7834
|
+
const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
|
|
7835
|
+
const targetMonth = focusableDate;
|
|
7836
|
+
const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
|
|
7837
|
+
if (!isDisabled && !isHidden) {
|
|
7838
|
+
return focusDay;
|
|
7839
|
+
}
|
|
7840
|
+
return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);
|
|
7841
|
+
}
|
|
7842
|
+
|
|
7843
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/useFocus.js
|
|
7844
|
+
function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
7845
|
+
const { autoFocus } = props;
|
|
7846
|
+
const [lastFocused, setLastFocused] = useState();
|
|
7847
|
+
const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
|
|
7848
|
+
const [focusedDay, setFocused] = useState(autoFocus ? focusTarget : void 0);
|
|
7849
|
+
const blur = () => {
|
|
7850
|
+
setLastFocused(focusedDay);
|
|
7851
|
+
setFocused(void 0);
|
|
7852
|
+
};
|
|
7853
|
+
const moveFocus = (moveBy, moveDir) => {
|
|
7854
|
+
if (!focusedDay)
|
|
7855
|
+
return;
|
|
7856
|
+
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
7857
|
+
if (!nextFocus)
|
|
7858
|
+
return;
|
|
7859
|
+
if (props.disableNavigation) {
|
|
7860
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
7861
|
+
if (!isNextInCalendar) {
|
|
7862
|
+
return;
|
|
7863
|
+
}
|
|
7864
|
+
}
|
|
7865
|
+
calendar.goToDay(nextFocus);
|
|
7866
|
+
setFocused(nextFocus);
|
|
7867
|
+
};
|
|
7868
|
+
const isFocusTarget = (day) => {
|
|
7869
|
+
return Boolean(focusTarget?.isEqualTo(day));
|
|
7870
|
+
};
|
|
7871
|
+
const useFocus2 = {
|
|
7872
|
+
isFocusTarget,
|
|
7873
|
+
setFocused,
|
|
7874
|
+
focused: focusedDay,
|
|
7875
|
+
blur,
|
|
7876
|
+
moveFocus
|
|
7877
|
+
};
|
|
7878
|
+
return useFocus2;
|
|
7879
|
+
}
|
|
7880
|
+
|
|
7881
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/selection/useMulti.js
|
|
7882
|
+
function useMulti(props, dateLib) {
|
|
7883
|
+
const { selected: initiallySelected, required, onSelect } = props;
|
|
7884
|
+
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
|
|
7885
|
+
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
7886
|
+
const { isSameDay: isSameDay2 } = dateLib;
|
|
7887
|
+
const isSelected = (date) => {
|
|
7888
|
+
return selected?.some((d) => isSameDay2(d, date)) ?? false;
|
|
7889
|
+
};
|
|
7890
|
+
const { min: min2, max: max2 } = props;
|
|
7891
|
+
const select = (triggerDate, modifiers, e) => {
|
|
7892
|
+
let newDates = [...selected ?? []];
|
|
7893
|
+
if (isSelected(triggerDate)) {
|
|
7894
|
+
if (selected?.length === min2) {
|
|
7895
|
+
return;
|
|
7896
|
+
}
|
|
7897
|
+
if (required && selected?.length === 1) {
|
|
7898
|
+
return;
|
|
7899
|
+
}
|
|
7900
|
+
newDates = selected?.filter((d) => !isSameDay2(d, triggerDate));
|
|
7901
|
+
} else {
|
|
7902
|
+
if (selected?.length === max2) {
|
|
7903
|
+
newDates = [triggerDate];
|
|
7904
|
+
} else {
|
|
7905
|
+
newDates = [...newDates, triggerDate];
|
|
7906
|
+
}
|
|
7907
|
+
}
|
|
7908
|
+
if (!onSelect) {
|
|
7909
|
+
setSelected(newDates);
|
|
7910
|
+
}
|
|
7911
|
+
onSelect?.(newDates, triggerDate, modifiers, e);
|
|
7912
|
+
return newDates;
|
|
7913
|
+
};
|
|
7914
|
+
return {
|
|
7915
|
+
selected,
|
|
7916
|
+
select,
|
|
7917
|
+
isSelected
|
|
7918
|
+
};
|
|
7919
|
+
}
|
|
7920
|
+
|
|
7921
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/addToRange.js
|
|
7922
|
+
function addToRange(date, initialRange, min2 = 0, max2 = 0, required = false, dateLib = defaultDateLib) {
|
|
7923
|
+
const { from, to } = initialRange || {};
|
|
7924
|
+
const { isSameDay: isSameDay2, isAfter: isAfter2, isBefore: isBefore2 } = dateLib;
|
|
7925
|
+
let range;
|
|
7926
|
+
if (!from && !to) {
|
|
7927
|
+
range = { from: date, to: min2 > 0 ? void 0 : date };
|
|
7928
|
+
} else if (from && !to) {
|
|
7929
|
+
if (isSameDay2(from, date)) {
|
|
7930
|
+
if (min2 === 0) {
|
|
7931
|
+
range = { from, to: date };
|
|
7932
|
+
} else if (required) {
|
|
7933
|
+
range = { from, to: void 0 };
|
|
7934
|
+
} else {
|
|
7935
|
+
range = void 0;
|
|
7936
|
+
}
|
|
7937
|
+
} else if (isBefore2(date, from)) {
|
|
7938
|
+
range = { from: date, to: from };
|
|
7939
|
+
} else {
|
|
7940
|
+
range = { from, to: date };
|
|
7941
|
+
}
|
|
7942
|
+
} else if (from && to) {
|
|
7943
|
+
if (isSameDay2(from, date) && isSameDay2(to, date)) {
|
|
7944
|
+
if (required) {
|
|
7945
|
+
range = { from, to };
|
|
7946
|
+
} else {
|
|
7947
|
+
range = void 0;
|
|
7948
|
+
}
|
|
7949
|
+
} else if (isSameDay2(from, date)) {
|
|
7950
|
+
range = { from, to: min2 > 0 ? void 0 : date };
|
|
7951
|
+
} else if (isSameDay2(to, date)) {
|
|
7952
|
+
range = { from: date, to: min2 > 0 ? void 0 : date };
|
|
7953
|
+
} else if (isBefore2(date, from)) {
|
|
7954
|
+
range = { from: date, to };
|
|
7955
|
+
} else if (isAfter2(date, from)) {
|
|
7956
|
+
range = { from, to: date };
|
|
7957
|
+
} else if (isAfter2(date, to)) {
|
|
7958
|
+
range = { from, to: date };
|
|
7959
|
+
} else {
|
|
7960
|
+
throw new Error("Invalid range");
|
|
7961
|
+
}
|
|
7962
|
+
}
|
|
7963
|
+
if (range?.from && range?.to) {
|
|
7964
|
+
const diff = dateLib.differenceInCalendarDays(range.to, range.from);
|
|
7965
|
+
if (max2 > 0 && diff > max2) {
|
|
7966
|
+
range = { from: date, to: void 0 };
|
|
7967
|
+
} else if (min2 > 1 && diff < min2) {
|
|
7968
|
+
range = { from: date, to: void 0 };
|
|
7969
|
+
}
|
|
7970
|
+
}
|
|
7971
|
+
return range;
|
|
7972
|
+
}
|
|
7973
|
+
|
|
7974
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js
|
|
7975
|
+
function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {
|
|
7976
|
+
const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;
|
|
7977
|
+
let date = range.from;
|
|
7978
|
+
const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
|
|
7979
|
+
const totalDaysLimit = Math.min(totalDays, 6);
|
|
7980
|
+
for (let i = 0; i <= totalDaysLimit; i++) {
|
|
7981
|
+
if (dayOfWeekArr.includes(date.getDay())) {
|
|
7982
|
+
return true;
|
|
7983
|
+
}
|
|
7984
|
+
date = dateLib.addDays(date, 1);
|
|
7985
|
+
}
|
|
7986
|
+
return false;
|
|
7987
|
+
}
|
|
7988
|
+
|
|
7989
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js
|
|
7990
|
+
function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {
|
|
7991
|
+
return rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) || rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) || rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) || rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib);
|
|
7992
|
+
}
|
|
7993
|
+
|
|
7994
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js
|
|
7995
|
+
function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
7996
|
+
const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];
|
|
7997
|
+
const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== "function");
|
|
7998
|
+
const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {
|
|
7999
|
+
if (typeof matcher === "boolean")
|
|
8000
|
+
return matcher;
|
|
8001
|
+
if (dateLib.isDate(matcher)) {
|
|
8002
|
+
return rangeIncludesDate(range, matcher, false, dateLib);
|
|
8003
|
+
}
|
|
8004
|
+
if (isDatesArray(matcher, dateLib)) {
|
|
8005
|
+
return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));
|
|
8006
|
+
}
|
|
8007
|
+
if (isDateRange(matcher)) {
|
|
8008
|
+
if (matcher.from && matcher.to) {
|
|
8009
|
+
return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);
|
|
8010
|
+
}
|
|
8011
|
+
return false;
|
|
8012
|
+
}
|
|
8013
|
+
if (isDayOfWeekType(matcher)) {
|
|
8014
|
+
return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);
|
|
8015
|
+
}
|
|
8016
|
+
if (isDateInterval(matcher)) {
|
|
8017
|
+
const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);
|
|
8018
|
+
if (isClosedInterval) {
|
|
8019
|
+
return rangeOverlaps(range, {
|
|
8020
|
+
from: dateLib.addDays(matcher.after, 1),
|
|
8021
|
+
to: dateLib.addDays(matcher.before, -1)
|
|
8022
|
+
}, dateLib);
|
|
8023
|
+
}
|
|
8024
|
+
return dateMatchModifiers(range.from, matcher, dateLib) || dateMatchModifiers(range.to, matcher, dateLib);
|
|
8025
|
+
}
|
|
8026
|
+
if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {
|
|
8027
|
+
return dateMatchModifiers(range.from, matcher, dateLib) || dateMatchModifiers(range.to, matcher, dateLib);
|
|
8028
|
+
}
|
|
8029
|
+
return false;
|
|
8030
|
+
});
|
|
8031
|
+
if (nonFunctionMatchersResult) {
|
|
8032
|
+
return true;
|
|
8033
|
+
}
|
|
8034
|
+
const functionMatchers = matchers.filter((matcher) => typeof matcher === "function");
|
|
8035
|
+
if (functionMatchers.length) {
|
|
8036
|
+
let date = range.from;
|
|
8037
|
+
const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
|
|
8038
|
+
for (let i = 0; i <= totalDays; i++) {
|
|
8039
|
+
if (functionMatchers.some((matcher) => matcher(date))) {
|
|
8040
|
+
return true;
|
|
8041
|
+
}
|
|
8042
|
+
date = dateLib.addDays(date, 1);
|
|
8043
|
+
}
|
|
8044
|
+
}
|
|
8045
|
+
return false;
|
|
8046
|
+
}
|
|
8047
|
+
|
|
8048
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/selection/useRange.js
|
|
8049
|
+
function useRange(props, dateLib) {
|
|
8050
|
+
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect } = props;
|
|
8051
|
+
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
|
|
8052
|
+
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
8053
|
+
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
8054
|
+
const select = (triggerDate, modifiers, e) => {
|
|
8055
|
+
const { min: min2, max: max2 } = props;
|
|
8056
|
+
const newRange = triggerDate ? addToRange(triggerDate, selected, min2, max2, required, dateLib) : void 0;
|
|
8057
|
+
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
8058
|
+
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
8059
|
+
newRange.from = triggerDate;
|
|
8060
|
+
newRange.to = void 0;
|
|
8061
|
+
}
|
|
8062
|
+
}
|
|
8063
|
+
if (!onSelect) {
|
|
8064
|
+
setSelected(newRange);
|
|
8065
|
+
}
|
|
8066
|
+
onSelect?.(newRange, triggerDate, modifiers, e);
|
|
8067
|
+
return newRange;
|
|
8068
|
+
};
|
|
8069
|
+
return {
|
|
8070
|
+
selected,
|
|
8071
|
+
select,
|
|
8072
|
+
isSelected
|
|
8073
|
+
};
|
|
8074
|
+
}
|
|
8075
|
+
|
|
8076
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/selection/useSingle.js
|
|
8077
|
+
function useSingle(props, dateLib) {
|
|
8078
|
+
const { selected: initiallySelected, required, onSelect } = props;
|
|
8079
|
+
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : void 0);
|
|
8080
|
+
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
8081
|
+
const { isSameDay: isSameDay2 } = dateLib;
|
|
8082
|
+
const isSelected = (compareDate) => {
|
|
8083
|
+
return selected ? isSameDay2(selected, compareDate) : false;
|
|
8084
|
+
};
|
|
8085
|
+
const select = (triggerDate, modifiers, e) => {
|
|
8086
|
+
let newDate = triggerDate;
|
|
8087
|
+
if (!required && selected && selected && isSameDay2(triggerDate, selected)) {
|
|
8088
|
+
newDate = void 0;
|
|
8089
|
+
}
|
|
8090
|
+
if (!onSelect) {
|
|
8091
|
+
setSelected(newDate);
|
|
8092
|
+
}
|
|
8093
|
+
if (required) {
|
|
8094
|
+
onSelect?.(newDate, triggerDate, modifiers, e);
|
|
8095
|
+
} else {
|
|
8096
|
+
onSelect?.(newDate, triggerDate, modifiers, e);
|
|
8097
|
+
}
|
|
8098
|
+
return newDate;
|
|
8099
|
+
};
|
|
8100
|
+
return {
|
|
8101
|
+
selected,
|
|
8102
|
+
select,
|
|
8103
|
+
isSelected
|
|
8104
|
+
};
|
|
8105
|
+
}
|
|
8106
|
+
|
|
8107
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/useSelection.js
|
|
8108
|
+
function useSelection(props, dateLib) {
|
|
8109
|
+
const single = useSingle(props, dateLib);
|
|
8110
|
+
const multi = useMulti(props, dateLib);
|
|
8111
|
+
const range = useRange(props, dateLib);
|
|
8112
|
+
switch (props.mode) {
|
|
8113
|
+
case "single":
|
|
8114
|
+
return single;
|
|
8115
|
+
case "multiple":
|
|
8116
|
+
return multi;
|
|
8117
|
+
case "range":
|
|
8118
|
+
return range;
|
|
8119
|
+
default:
|
|
8120
|
+
return void 0;
|
|
8121
|
+
}
|
|
8122
|
+
}
|
|
8123
|
+
|
|
8124
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js
|
|
8125
|
+
function toTimeZone(date, timeZone) {
|
|
8126
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
8127
|
+
return date;
|
|
8128
|
+
}
|
|
8129
|
+
return new TZDate(date, timeZone);
|
|
8130
|
+
}
|
|
8131
|
+
|
|
8132
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js
|
|
8133
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
8134
|
+
return toTimeZone(date, timeZone);
|
|
8135
|
+
}
|
|
8136
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
8137
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
8138
|
+
return matcher;
|
|
8139
|
+
}
|
|
8140
|
+
if (matcher instanceof Date) {
|
|
8141
|
+
return toZoneNoon(matcher, timeZone);
|
|
8142
|
+
}
|
|
8143
|
+
if (Array.isArray(matcher)) {
|
|
8144
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone) : value);
|
|
8145
|
+
}
|
|
8146
|
+
if (isDateRange(matcher)) {
|
|
8147
|
+
return {
|
|
8148
|
+
...matcher,
|
|
8149
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
8150
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to
|
|
8151
|
+
};
|
|
8152
|
+
}
|
|
8153
|
+
if (isDateInterval(matcher)) {
|
|
8154
|
+
return {
|
|
8155
|
+
before: toZoneNoon(matcher.before, timeZone),
|
|
8156
|
+
after: toZoneNoon(matcher.after, timeZone)
|
|
8157
|
+
};
|
|
8158
|
+
}
|
|
8159
|
+
if (isDateAfterType(matcher)) {
|
|
8160
|
+
return {
|
|
8161
|
+
after: toZoneNoon(matcher.after, timeZone)
|
|
8162
|
+
};
|
|
8163
|
+
}
|
|
8164
|
+
if (isDateBeforeType(matcher)) {
|
|
8165
|
+
return {
|
|
8166
|
+
before: toZoneNoon(matcher.before, timeZone)
|
|
8167
|
+
};
|
|
8168
|
+
}
|
|
8169
|
+
return matcher;
|
|
8170
|
+
}
|
|
8171
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
8172
|
+
if (!matchers) {
|
|
8173
|
+
return matchers;
|
|
8174
|
+
}
|
|
8175
|
+
if (Array.isArray(matchers)) {
|
|
8176
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone));
|
|
8177
|
+
}
|
|
8178
|
+
return convertMatcher(matchers, timeZone);
|
|
8179
|
+
}
|
|
8180
|
+
|
|
8181
|
+
// ../../node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.7/node_modules/react-day-picker/dist/esm/DayPicker.js
|
|
8182
|
+
function DayPicker(initialProps) {
|
|
8183
|
+
let props = initialProps;
|
|
8184
|
+
const timeZone = props.timeZone;
|
|
8185
|
+
if (timeZone) {
|
|
8186
|
+
props = {
|
|
8187
|
+
...initialProps,
|
|
8188
|
+
timeZone
|
|
8189
|
+
};
|
|
8190
|
+
if (props.today) {
|
|
8191
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
8192
|
+
}
|
|
8193
|
+
if (props.month) {
|
|
8194
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
8195
|
+
}
|
|
8196
|
+
if (props.defaultMonth) {
|
|
8197
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
8198
|
+
}
|
|
8199
|
+
if (props.startMonth) {
|
|
8200
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
8201
|
+
}
|
|
8202
|
+
if (props.endMonth) {
|
|
8203
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
8204
|
+
}
|
|
8205
|
+
if (props.mode === "single" && props.selected) {
|
|
8206
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
8207
|
+
} else if (props.mode === "multiple" && props.selected) {
|
|
8208
|
+
props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
|
|
8209
|
+
} else if (props.mode === "range" && props.selected) {
|
|
8210
|
+
props.selected = {
|
|
8211
|
+
from: props.selected.from ? toTimeZone(props.selected.from, timeZone) : props.selected.from,
|
|
8212
|
+
to: props.selected.to ? toTimeZone(props.selected.to, timeZone) : props.selected.to
|
|
8213
|
+
};
|
|
8214
|
+
}
|
|
8215
|
+
if (props.disabled !== void 0) {
|
|
8216
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
8217
|
+
}
|
|
8218
|
+
if (props.hidden !== void 0) {
|
|
8219
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
8220
|
+
}
|
|
8221
|
+
if (props.modifiers) {
|
|
8222
|
+
const nextModifiers = {};
|
|
8223
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
8224
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
8225
|
+
});
|
|
8226
|
+
props.modifiers = nextModifiers;
|
|
8227
|
+
}
|
|
8228
|
+
}
|
|
8229
|
+
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = useMemo(() => {
|
|
8230
|
+
const locale2 = { ...enUS2, ...props.locale };
|
|
8231
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
8232
|
+
const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
|
|
8233
|
+
weekStartsOn,
|
|
8234
|
+
locale: locale2
|
|
8235
|
+
}) : void 0;
|
|
8236
|
+
const overrides = props.dateLib && noonOverrides ? { ...noonOverrides, ...props.dateLib } : props.dateLib ?? noonOverrides;
|
|
8237
|
+
const dateLib2 = new DateLib({
|
|
8238
|
+
locale: locale2,
|
|
8239
|
+
weekStartsOn,
|
|
8240
|
+
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
8241
|
+
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
8242
|
+
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
8243
|
+
timeZone: props.timeZone,
|
|
8244
|
+
numerals: props.numerals
|
|
8245
|
+
}, overrides);
|
|
8246
|
+
return {
|
|
8247
|
+
dateLib: dateLib2,
|
|
8248
|
+
components: getComponents(props.components),
|
|
8249
|
+
formatters: getFormatters(props.formatters),
|
|
8250
|
+
labels: getLabels(props.labels, dateLib2.options),
|
|
8251
|
+
locale: locale2,
|
|
8252
|
+
classNames: { ...getDefaultClassNames(), ...props.classNames }
|
|
8253
|
+
};
|
|
8254
|
+
}, [
|
|
8255
|
+
props.locale,
|
|
8256
|
+
props.broadcastCalendar,
|
|
8257
|
+
props.weekStartsOn,
|
|
8258
|
+
props.firstWeekContainsDate,
|
|
8259
|
+
props.useAdditionalWeekYearTokens,
|
|
8260
|
+
props.useAdditionalDayOfYearTokens,
|
|
8261
|
+
props.timeZone,
|
|
8262
|
+
props.numerals,
|
|
8263
|
+
props.dateLib,
|
|
8264
|
+
props.noonSafe,
|
|
8265
|
+
props.components,
|
|
8266
|
+
props.formatters,
|
|
8267
|
+
props.labels,
|
|
8268
|
+
props.classNames
|
|
8269
|
+
]);
|
|
8270
|
+
if (!props.today) {
|
|
8271
|
+
props = { ...props, today: dateLib.today() };
|
|
8272
|
+
}
|
|
8273
|
+
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles: styles2 } = props;
|
|
8274
|
+
const { formatCaption: formatCaption2, formatDay: formatDay2, formatMonthDropdown: formatMonthDropdown2, formatWeekNumber: formatWeekNumber2, formatWeekNumberHeader: formatWeekNumberHeader2, formatWeekdayName: formatWeekdayName2, formatYearDropdown: formatYearDropdown2 } = formatters2;
|
|
8275
|
+
const calendar = useCalendar(props, dateLib);
|
|
8276
|
+
const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;
|
|
8277
|
+
const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
|
|
8278
|
+
const { isSelected, select, selected: selectedValue } = useSelection(props, dateLib) ?? {};
|
|
8279
|
+
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
8280
|
+
const { labelDayButton: labelDayButton2, labelGridcell: labelGridcell2, labelGrid: labelGrid2, labelMonthDropdown: labelMonthDropdown2, labelNav: labelNav2, labelPrevious: labelPrevious2, labelNext: labelNext2, labelWeekday: labelWeekday2, labelWeekNumber: labelWeekNumber2, labelWeekNumberHeader: labelWeekNumberHeader2, labelYearDropdown: labelYearDropdown2 } = labels;
|
|
8281
|
+
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
8282
|
+
const isInteractive = mode !== void 0 || onDayClick !== void 0;
|
|
8283
|
+
const handlePreviousClick = useCallback(() => {
|
|
8284
|
+
if (!previousMonth)
|
|
8285
|
+
return;
|
|
8286
|
+
goToMonth(previousMonth);
|
|
8287
|
+
onPrevClick?.(previousMonth);
|
|
8288
|
+
}, [previousMonth, goToMonth, onPrevClick]);
|
|
8289
|
+
const handleNextClick = useCallback(() => {
|
|
8290
|
+
if (!nextMonth)
|
|
8291
|
+
return;
|
|
8292
|
+
goToMonth(nextMonth);
|
|
8293
|
+
onNextClick?.(nextMonth);
|
|
8294
|
+
}, [goToMonth, nextMonth, onNextClick]);
|
|
8295
|
+
const handleDayClick = useCallback((day, m) => (e) => {
|
|
8296
|
+
e.preventDefault();
|
|
8297
|
+
e.stopPropagation();
|
|
8298
|
+
setFocused(day);
|
|
8299
|
+
if (m.disabled) {
|
|
8300
|
+
return;
|
|
8301
|
+
}
|
|
8302
|
+
select?.(day.date, m, e);
|
|
8303
|
+
onDayClick?.(day.date, m, e);
|
|
8304
|
+
}, [select, onDayClick, setFocused]);
|
|
8305
|
+
const handleDayFocus = useCallback((day, m) => (e) => {
|
|
8306
|
+
setFocused(day);
|
|
8307
|
+
onDayFocus?.(day.date, m, e);
|
|
8308
|
+
}, [onDayFocus, setFocused]);
|
|
8309
|
+
const handleDayBlur = useCallback((day, m) => (e) => {
|
|
8310
|
+
blur();
|
|
8311
|
+
onDayBlur?.(day.date, m, e);
|
|
8312
|
+
}, [blur, onDayBlur]);
|
|
8313
|
+
const handleDayKeyDown = useCallback((day, modifiers) => (e) => {
|
|
8314
|
+
const keyMap = {
|
|
8315
|
+
ArrowLeft: [
|
|
8316
|
+
e.shiftKey ? "month" : "day",
|
|
8317
|
+
props.dir === "rtl" ? "after" : "before"
|
|
8318
|
+
],
|
|
8319
|
+
ArrowRight: [
|
|
8320
|
+
e.shiftKey ? "month" : "day",
|
|
8321
|
+
props.dir === "rtl" ? "before" : "after"
|
|
8322
|
+
],
|
|
8323
|
+
ArrowDown: [e.shiftKey ? "year" : "week", "after"],
|
|
8324
|
+
ArrowUp: [e.shiftKey ? "year" : "week", "before"],
|
|
8325
|
+
PageUp: [e.shiftKey ? "year" : "month", "before"],
|
|
8326
|
+
PageDown: [e.shiftKey ? "year" : "month", "after"],
|
|
8327
|
+
Home: ["startOfWeek", "before"],
|
|
8328
|
+
End: ["endOfWeek", "after"]
|
|
8329
|
+
};
|
|
8330
|
+
if (keyMap[e.key]) {
|
|
8331
|
+
e.preventDefault();
|
|
8332
|
+
e.stopPropagation();
|
|
8333
|
+
const [moveBy, moveDir] = keyMap[e.key];
|
|
8334
|
+
moveFocus(moveBy, moveDir);
|
|
8335
|
+
}
|
|
8336
|
+
onDayKeyDown?.(day.date, modifiers, e);
|
|
8337
|
+
}, [moveFocus, onDayKeyDown, props.dir]);
|
|
8338
|
+
const handleDayMouseEnter = useCallback((day, modifiers) => (e) => {
|
|
8339
|
+
onDayMouseEnter?.(day.date, modifiers, e);
|
|
8340
|
+
}, [onDayMouseEnter]);
|
|
8341
|
+
const handleDayMouseLeave = useCallback((day, modifiers) => (e) => {
|
|
8342
|
+
onDayMouseLeave?.(day.date, modifiers, e);
|
|
8343
|
+
}, [onDayMouseLeave]);
|
|
8344
|
+
const handleMonthChange = useCallback((date) => (e) => {
|
|
8345
|
+
const selectedMonth = Number(e.target.value);
|
|
8346
|
+
const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
|
|
8347
|
+
goToMonth(month);
|
|
8348
|
+
}, [dateLib, goToMonth]);
|
|
8349
|
+
const handleYearChange = useCallback((date) => (e) => {
|
|
8350
|
+
const selectedYear = Number(e.target.value);
|
|
8351
|
+
const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
|
|
8352
|
+
goToMonth(month);
|
|
8353
|
+
}, [dateLib, goToMonth]);
|
|
8354
|
+
const { className, style } = useMemo(() => ({
|
|
8355
|
+
className: [classNames[UI.Root], props.className].filter(Boolean).join(" "),
|
|
8356
|
+
style: { ...styles2?.[UI.Root], ...props.style }
|
|
8357
|
+
}), [classNames, props.className, props.style, styles2]);
|
|
8358
|
+
const dataAttributes = getDataAttributes(props);
|
|
8359
|
+
const rootElRef = useRef(null);
|
|
8360
|
+
useAnimation(rootElRef, Boolean(props.animate), {
|
|
8361
|
+
classNames,
|
|
8362
|
+
months,
|
|
8363
|
+
focused,
|
|
8364
|
+
dateLib
|
|
8365
|
+
});
|
|
8366
|
+
const contextValue = {
|
|
8367
|
+
dayPickerProps: props,
|
|
8368
|
+
selected: selectedValue,
|
|
8369
|
+
select,
|
|
8370
|
+
isSelected,
|
|
8371
|
+
months,
|
|
8372
|
+
nextMonth,
|
|
8373
|
+
previousMonth,
|
|
8374
|
+
goToMonth,
|
|
8375
|
+
getModifiers,
|
|
8376
|
+
components,
|
|
8377
|
+
classNames,
|
|
8378
|
+
styles: styles2,
|
|
8379
|
+
labels,
|
|
8380
|
+
formatters: formatters2
|
|
8381
|
+
};
|
|
8382
|
+
return React27.createElement(
|
|
8383
|
+
dayPickerContext.Provider,
|
|
8384
|
+
{ value: contextValue },
|
|
8385
|
+
React27.createElement(
|
|
8386
|
+
components.Root,
|
|
8387
|
+
{ rootRef: props.animate ? rootElRef : void 0, className, style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
|
|
8388
|
+
React27.createElement(
|
|
8389
|
+
components.Months,
|
|
8390
|
+
{ className: classNames[UI.Months], style: styles2?.[UI.Months] },
|
|
8391
|
+
!props.hideNavigation && !navLayout && React27.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles2?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
|
|
8392
|
+
months.map((calendarMonth, displayIndex) => {
|
|
8393
|
+
return React27.createElement(
|
|
8394
|
+
components.Month,
|
|
8395
|
+
{
|
|
8396
|
+
"data-animated-month": props.animate ? "true" : void 0,
|
|
8397
|
+
className: classNames[UI.Month],
|
|
8398
|
+
style: styles2?.[UI.Month],
|
|
8399
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
8400
|
+
key: displayIndex,
|
|
8401
|
+
displayIndex,
|
|
8402
|
+
calendarMonth
|
|
8403
|
+
},
|
|
8404
|
+
navLayout === "around" && !props.hideNavigation && displayIndex === 0 && React27.createElement(
|
|
8405
|
+
components.PreviousMonthButton,
|
|
8406
|
+
{ type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : void 0 },
|
|
8407
|
+
React27.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" })
|
|
8408
|
+
),
|
|
8409
|
+
React27.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : void 0, className: classNames[UI.MonthCaption], style: styles2?.[UI.MonthCaption], calendarMonth, displayIndex }, captionLayout?.startsWith("dropdown") ? React27.createElement(
|
|
8410
|
+
components.DropdownNav,
|
|
8411
|
+
{ className: classNames[UI.Dropdowns], style: styles2?.[UI.Dropdowns] },
|
|
8412
|
+
(() => {
|
|
8413
|
+
const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ? React27.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown2(), classNames, components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters2, dateLib), style: styles2?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) }) : React27.createElement("span", { key: "month" }, formatMonthDropdown2(calendarMonth.date, dateLib));
|
|
8414
|
+
const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ? React27.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown2(dateLib.options), classNames, components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters2, dateLib, Boolean(props.reverseYears)), style: styles2?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) }) : React27.createElement("span", { key: "year" }, formatYearDropdown2(calendarMonth.date, dateLib));
|
|
8415
|
+
const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
|
|
8416
|
+
return controls;
|
|
8417
|
+
})(),
|
|
8418
|
+
React27.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
8419
|
+
border: 0,
|
|
8420
|
+
clip: "rect(0 0 0 0)",
|
|
8421
|
+
height: "1px",
|
|
8422
|
+
margin: "-1px",
|
|
8423
|
+
overflow: "hidden",
|
|
8424
|
+
padding: 0,
|
|
8425
|
+
position: "absolute",
|
|
8426
|
+
width: "1px",
|
|
8427
|
+
whiteSpace: "nowrap",
|
|
8428
|
+
wordWrap: "normal"
|
|
8429
|
+
} }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
|
|
8430
|
+
) : React27.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
|
|
8431
|
+
navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && React27.createElement(
|
|
8432
|
+
components.NextMonthButton,
|
|
8433
|
+
{ type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
|
|
8434
|
+
React27.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
|
|
8435
|
+
),
|
|
8436
|
+
displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && React27.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles2?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
|
|
8437
|
+
React27.createElement(
|
|
8438
|
+
components.MonthGrid,
|
|
8439
|
+
{ role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles2?.[UI.MonthGrid] },
|
|
8440
|
+
!props.hideWeekdays && React27.createElement(
|
|
8441
|
+
components.Weekdays,
|
|
8442
|
+
{ "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles2?.[UI.Weekdays] },
|
|
8443
|
+
showWeekNumber && React27.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles2?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
|
|
8444
|
+
weekdays.map((weekday) => React27.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles2?.[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
|
|
8445
|
+
),
|
|
8446
|
+
React27.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles2?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
8447
|
+
return React27.createElement(
|
|
8448
|
+
components.Week,
|
|
8449
|
+
{ className: classNames[UI.Week], key: week.weekNumber, style: styles2?.[UI.Week], week },
|
|
8450
|
+
showWeekNumber && React27.createElement(components.WeekNumber, { week, style: styles2?.[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
|
|
8451
|
+
locale
|
|
8452
|
+
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
|
|
8453
|
+
week.days.map((day) => {
|
|
8454
|
+
const { date } = day;
|
|
8455
|
+
const modifiers = getModifiers(day);
|
|
8456
|
+
modifiers[DayFlag.focused] = !modifiers.hidden && Boolean(focused?.isEqualTo(day));
|
|
8457
|
+
modifiers[SelectionState.selected] = isSelected?.(date) || modifiers.selected;
|
|
8458
|
+
if (isDateRange(selectedValue)) {
|
|
8459
|
+
const { from, to } = selectedValue;
|
|
8460
|
+
modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
|
|
8461
|
+
modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
|
|
8462
|
+
modifiers[SelectionState.range_middle] = rangeIncludesDate(selectedValue, date, true, dateLib);
|
|
8463
|
+
}
|
|
8464
|
+
const style2 = getStyleForModifiers(modifiers, styles2, props.modifiersStyles);
|
|
8465
|
+
const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
|
|
8466
|
+
const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
|
|
8467
|
+
return React27.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? React27.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles2?.[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
|
|
8468
|
+
})
|
|
8469
|
+
);
|
|
8470
|
+
}))
|
|
8471
|
+
)
|
|
8472
|
+
);
|
|
8473
|
+
})
|
|
8474
|
+
),
|
|
8475
|
+
props.footer && React27.createElement(components.Footer, { className: classNames[UI.Footer], style: styles2?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
|
|
8476
|
+
)
|
|
8477
|
+
);
|
|
8478
|
+
}
|
|
4119
8479
|
var dayPickerClassNames = {
|
|
4120
8480
|
selected: `tw-bg-primary tw-border-primary tw-font-medium hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground tw-rounded`
|
|
4121
8481
|
};
|
|
@@ -4712,7 +9072,7 @@ var DateInput = ({
|
|
|
4712
9072
|
const [hasFocus, setHasFocus] = useState(false);
|
|
4713
9073
|
const [isOpen, setIsOpen] = useState(false);
|
|
4714
9074
|
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
4715
|
-
const [month,
|
|
9075
|
+
const [month, setMonth2] = useState(/* @__PURE__ */ new Date());
|
|
4716
9076
|
const isControlled = value !== void 0;
|
|
4717
9077
|
const currentValue = isControlled ? value : internalValue;
|
|
4718
9078
|
const handleChange = (event) => {
|
|
@@ -4757,7 +9117,7 @@ var DateInput = ({
|
|
|
4757
9117
|
};
|
|
4758
9118
|
const handleOpenChange = (open) => {
|
|
4759
9119
|
if (open) {
|
|
4760
|
-
|
|
9120
|
+
setMonth2(currentValue ?? /* @__PURE__ */ new Date());
|
|
4761
9121
|
}
|
|
4762
9122
|
setIsOpen(open);
|
|
4763
9123
|
};
|
|
@@ -4783,7 +9143,7 @@ var DateInput = ({
|
|
|
4783
9143
|
endMonth,
|
|
4784
9144
|
mode: "single",
|
|
4785
9145
|
month,
|
|
4786
|
-
onMonthChange:
|
|
9146
|
+
onMonthChange: setMonth2,
|
|
4787
9147
|
onOpenChange: handleOpenChange,
|
|
4788
9148
|
onSelect: handleDatePickerChange,
|
|
4789
9149
|
open: isOpen,
|
|
@@ -4842,7 +9202,7 @@ var DateRangeInput = ({
|
|
|
4842
9202
|
const [hasFocus, setHasFocus] = useState(false);
|
|
4843
9203
|
const [isOpen, setIsOpen] = useState(false);
|
|
4844
9204
|
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
4845
|
-
const [month,
|
|
9205
|
+
const [month, setMonth2] = useState(/* @__PURE__ */ new Date());
|
|
4846
9206
|
const isControlled = value !== void 0;
|
|
4847
9207
|
const currentValue = isControlled ? value : internalValue;
|
|
4848
9208
|
const handleChange = (event) => {
|
|
@@ -4886,7 +9246,7 @@ var DateRangeInput = ({
|
|
|
4886
9246
|
};
|
|
4887
9247
|
const handleOpenChange = (open) => {
|
|
4888
9248
|
if (open) {
|
|
4889
|
-
|
|
9249
|
+
setMonth2(currentValue?.from ?? /* @__PURE__ */ new Date());
|
|
4890
9250
|
}
|
|
4891
9251
|
setIsOpen(open);
|
|
4892
9252
|
};
|
|
@@ -4910,7 +9270,7 @@ var DateRangeInput = ({
|
|
|
4910
9270
|
endMonth,
|
|
4911
9271
|
mode: "range",
|
|
4912
9272
|
month,
|
|
4913
|
-
onMonthChange:
|
|
9273
|
+
onMonthChange: setMonth2,
|
|
4914
9274
|
onOpenChange: handleOpenChange,
|
|
4915
9275
|
onSelect: handleDatePickerChange,
|
|
4916
9276
|
open: isOpen,
|
|
@@ -4997,10 +9357,10 @@ var TimePickerButton = ({
|
|
|
4997
9357
|
var pad = (n) => n.toString().padStart(2, "0");
|
|
4998
9358
|
var parseTime = (time) => {
|
|
4999
9359
|
if (!time) return { hour: null, minute: null };
|
|
5000
|
-
const
|
|
5001
|
-
if (!
|
|
5002
|
-
const hour = Number(
|
|
5003
|
-
const minute = Number(
|
|
9360
|
+
const match2 = /^(\d{1,2}):(\d{1,2})$/.exec(time.trim());
|
|
9361
|
+
if (!match2) return { hour: null, minute: null };
|
|
9362
|
+
const hour = Number(match2[1]);
|
|
9363
|
+
const minute = Number(match2[2]);
|
|
5004
9364
|
if (Number.isNaN(hour) || Number.isNaN(minute) || hour < 0 || hour > 23 || minute < 0 || minute > 59)
|
|
5005
9365
|
return { hour: null, minute: null };
|
|
5006
9366
|
return { hour, minute };
|
|
@@ -6178,8 +10538,8 @@ var Slider = ({
|
|
|
6178
10538
|
className,
|
|
6179
10539
|
value,
|
|
6180
10540
|
defaultValue,
|
|
6181
|
-
min = 0,
|
|
6182
|
-
max = 100,
|
|
10541
|
+
min: min2 = 0,
|
|
10542
|
+
max: max2 = 100,
|
|
6183
10543
|
onValueChange,
|
|
6184
10544
|
thumbTooltip,
|
|
6185
10545
|
thumbTooltipSide,
|
|
@@ -6190,7 +10550,7 @@ var Slider = ({
|
|
|
6190
10550
|
const [internalValues, setInternalValues] = useState(() => {
|
|
6191
10551
|
if (isControlled) return value;
|
|
6192
10552
|
if (Array.isArray(defaultValue)) return defaultValue;
|
|
6193
|
-
return [
|
|
10553
|
+
return [min2];
|
|
6194
10554
|
});
|
|
6195
10555
|
const liveValues = isControlled ? value : internalValues;
|
|
6196
10556
|
const handleValueChange = (next) => {
|
|
@@ -6202,8 +10562,8 @@ var Slider = ({
|
|
|
6202
10562
|
{
|
|
6203
10563
|
ref,
|
|
6204
10564
|
value: liveValues,
|
|
6205
|
-
min,
|
|
6206
|
-
max,
|
|
10565
|
+
min: min2,
|
|
10566
|
+
max: max2,
|
|
6207
10567
|
onValueChange: handleValueChange,
|
|
6208
10568
|
className: cn(
|
|
6209
10569
|
"tw-relative",
|
|
@@ -6787,7 +11147,7 @@ var SelectTrigger = ({
|
|
|
6787
11147
|
);
|
|
6788
11148
|
};
|
|
6789
11149
|
var isGroup = (itemOrGroup) => "items" in itemOrGroup;
|
|
6790
|
-
var
|
|
11150
|
+
var Select2 = ({
|
|
6791
11151
|
// root
|
|
6792
11152
|
value,
|
|
6793
11153
|
defaultValue,
|
|
@@ -6859,13 +11219,13 @@ var Select = ({
|
|
|
6859
11219
|
}
|
|
6860
11220
|
);
|
|
6861
11221
|
};
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
11222
|
+
Select2.Root = SelectRoot;
|
|
11223
|
+
Select2.Trigger = SelectTrigger;
|
|
11224
|
+
Select2.Content = SelectContent;
|
|
11225
|
+
Select2.Item = SelectItem;
|
|
11226
|
+
Select2.Group = SelectGroup;
|
|
11227
|
+
Select2.Label = SelectLabel;
|
|
11228
|
+
Select2.Separator = SelectSeparator;
|
|
6869
11229
|
var rootVariants2 = cva(
|
|
6870
11230
|
[
|
|
6871
11231
|
// reset
|
|
@@ -8529,7 +12889,7 @@ var InputOtpSlot = ({
|
|
|
8529
12889
|
}
|
|
8530
12890
|
);
|
|
8531
12891
|
};
|
|
8532
|
-
var
|
|
12892
|
+
var Root23 = ({
|
|
8533
12893
|
ref,
|
|
8534
12894
|
sizing = "md",
|
|
8535
12895
|
state = "default",
|
|
@@ -8553,7 +12913,7 @@ var Root22 = ({
|
|
|
8553
12913
|
children
|
|
8554
12914
|
}
|
|
8555
12915
|
) });
|
|
8556
|
-
var InputOtp = Object.assign(
|
|
12916
|
+
var InputOtp = Object.assign(Root23, {
|
|
8557
12917
|
Group: InputOtpGroup,
|
|
8558
12918
|
Slot: InputOtpSlot,
|
|
8559
12919
|
Separator: InputOtpSeparator
|
|
@@ -8879,8 +13239,8 @@ var TagSelectValue = ({ value, onAdd }) => {
|
|
|
8879
13239
|
);
|
|
8880
13240
|
};
|
|
8881
13241
|
var CREATE_ITEM_VALUE = "create-new-tag";
|
|
8882
|
-
var
|
|
8883
|
-
var TagSelectList = ({ options =
|
|
13242
|
+
var defaultOptions2 = [];
|
|
13243
|
+
var TagSelectList = ({ options = defaultOptions2, onAdd, onCreate }) => {
|
|
8884
13244
|
const [selected, setSelected] = useState([]);
|
|
8885
13245
|
const handleOnSelect = (value) => {
|
|
8886
13246
|
setSelected(
|
|
@@ -8933,10 +13293,10 @@ var TagSelectPopover = ({ children, onAdd, options, onCreate }) => {
|
|
|
8933
13293
|
/* @__PURE__ */ jsx(Popover.Content, { side: "bottom", align: "center", className: "tw-w-80", children: /* @__PURE__ */ jsx(TagSelectList, { onCreate: handleCreate, onAdd: handleAdd, options }) })
|
|
8934
13294
|
] });
|
|
8935
13295
|
};
|
|
8936
|
-
var
|
|
13296
|
+
var defaultOptions3 = [];
|
|
8937
13297
|
var Tagger = ({
|
|
8938
|
-
options =
|
|
8939
|
-
value =
|
|
13298
|
+
options = defaultOptions3,
|
|
13299
|
+
value = defaultOptions3,
|
|
8940
13300
|
onCreate,
|
|
8941
13301
|
onValueChange,
|
|
8942
13302
|
disabled
|
|
@@ -9793,7 +14153,7 @@ var Dropzone = /* @__PURE__ */ forwardRef(function(_ref, ref) {
|
|
|
9793
14153
|
open
|
|
9794
14154
|
};
|
|
9795
14155
|
}, [open]);
|
|
9796
|
-
return /* @__PURE__ */
|
|
14156
|
+
return /* @__PURE__ */ React27.createElement(Fragment, null, children(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
9797
14157
|
open
|
|
9798
14158
|
})));
|
|
9799
14159
|
});
|
|
@@ -11816,12 +16176,12 @@ var UsageStats = ({
|
|
|
11816
16176
|
side = "top",
|
|
11817
16177
|
sideOffset = 8
|
|
11818
16178
|
}) => {
|
|
11819
|
-
const
|
|
16179
|
+
const defaultLabel2 = `Usage: ${Math.round(clampPercentage(value))}%${alert ? " (usage alert)" : ""}`;
|
|
11820
16180
|
return /* @__PURE__ */ jsxs(HoverCard, { children: [
|
|
11821
16181
|
/* @__PURE__ */ jsx(HoverCard.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
11822
16182
|
"span",
|
|
11823
16183
|
{
|
|
11824
|
-
"aria-label": ariaLabel ??
|
|
16184
|
+
"aria-label": ariaLabel ?? defaultLabel2,
|
|
11825
16185
|
className: cn(
|
|
11826
16186
|
"tw-relative tw-inline-flex tw-size-8 tw-items-center tw-justify-center",
|
|
11827
16187
|
className
|
|
@@ -13138,7 +17498,7 @@ var TopNavShell = ({
|
|
|
13138
17498
|
children
|
|
13139
17499
|
}
|
|
13140
17500
|
);
|
|
13141
|
-
var
|
|
17501
|
+
var Root26 = ({
|
|
13142
17502
|
ref,
|
|
13143
17503
|
className,
|
|
13144
17504
|
children,
|
|
@@ -13205,6 +17565,10 @@ var Main = ({
|
|
|
13205
17565
|
"data-app-shell-slot": "main",
|
|
13206
17566
|
className: cn(
|
|
13207
17567
|
"tw-flex tw-min-w-0 tw-min-h-0 tw-flex-1 tw-flex-col tw-overflow-auto",
|
|
17568
|
+
// Opinionated default page gutter so page content clears the header /
|
|
17569
|
+
// rails and looks right out of the box. `cn` is tailwind-merge, so an
|
|
17570
|
+
// app that owns its own gutter overrides it (e.g. `className="tw-p-0"`).
|
|
17571
|
+
"tw-p-6",
|
|
13208
17572
|
"[grid-area:main]",
|
|
13209
17573
|
className
|
|
13210
17574
|
),
|
|
@@ -13236,7 +17600,7 @@ var Aside = ({
|
|
|
13236
17600
|
}
|
|
13237
17601
|
);
|
|
13238
17602
|
};
|
|
13239
|
-
var AppShell = Object.assign(
|
|
17603
|
+
var AppShell = Object.assign(Root26, {
|
|
13240
17604
|
/**
|
|
13241
17605
|
* Top header row. Renders above `Main` in the sidebar shell; renders as the
|
|
13242
17606
|
* top bar (with full-width navigation room) in the top-nav shell.
|
|
@@ -13248,7 +17612,11 @@ var AppShell = Object.assign(Root25, {
|
|
|
13248
17612
|
* primary navigation into `Header` for top-nav-first compositions.
|
|
13249
17613
|
*/
|
|
13250
17614
|
Sidebar: SidebarSlot,
|
|
13251
|
-
/**
|
|
17615
|
+
/**
|
|
17616
|
+
* Main content outlet. Applies an opinionated default page gutter (`tw-p-6`)
|
|
17617
|
+
* so content looks right out of the box; override the padding (e.g. `tw-p-0`)
|
|
17618
|
+
* when the app owns its own gutter.
|
|
17619
|
+
*/
|
|
13252
17620
|
Main,
|
|
13253
17621
|
/** Optional right rail. Present in both shells. */
|
|
13254
17622
|
Aside
|
|
@@ -13259,7 +17627,7 @@ var maxWidthClass = {
|
|
|
13259
17627
|
wide: "tw-max-w-[1600px]",
|
|
13260
17628
|
full: "tw-max-w-full"
|
|
13261
17629
|
};
|
|
13262
|
-
var
|
|
17630
|
+
var Root27 = ({
|
|
13263
17631
|
ref,
|
|
13264
17632
|
className,
|
|
13265
17633
|
maxWidth = "full",
|
|
@@ -13310,7 +17678,7 @@ var Content10 = ({
|
|
|
13310
17678
|
children,
|
|
13311
17679
|
...props
|
|
13312
17680
|
}) => /* @__PURE__ */ jsx("div", { ref, className: cn("tw-flex tw-w-full tw-flex-1 tw-flex-col", className), ...props, children });
|
|
13313
|
-
var
|
|
17681
|
+
var Footer2 = ({
|
|
13314
17682
|
ref,
|
|
13315
17683
|
className,
|
|
13316
17684
|
sticky = false,
|
|
@@ -13329,7 +17697,7 @@ var Footer = ({
|
|
|
13329
17697
|
children
|
|
13330
17698
|
}
|
|
13331
17699
|
);
|
|
13332
|
-
var PageLayout = Object.assign(
|
|
17700
|
+
var PageLayout = Object.assign(Root27, {
|
|
13333
17701
|
/** Detail-pattern breadcrumb row. Usually composed automatically by `PageHeader.Detail` — slot exists for layouts that don't fit either `PageHeader` variant. */
|
|
13334
17702
|
Breadcrumbs,
|
|
13335
17703
|
/** Host slot for `PageHeader.Index` / `PageHeader.Detail`, or custom header JSX when neither variant fits. */
|
|
@@ -13339,7 +17707,7 @@ var PageLayout = Object.assign(Root26, {
|
|
|
13339
17707
|
/** Main content slot. Lists, cards, tables. */
|
|
13340
17708
|
Content: Content10,
|
|
13341
17709
|
/** Bottom action bar — form submit + cancel. Pass `sticky` for a footer that pins to the viewport. */
|
|
13342
|
-
Footer
|
|
17710
|
+
Footer: Footer2
|
|
13343
17711
|
});
|
|
13344
17712
|
|
|
13345
17713
|
// src/blocks/PageHeader/styles.ts
|
|
@@ -13500,7 +17868,7 @@ var PageToolbarToken = ({
|
|
|
13500
17868
|
),
|
|
13501
17869
|
/* @__PURE__ */ jsx(Popover.Content, { align: "start", children: popover })
|
|
13502
17870
|
] });
|
|
13503
|
-
var
|
|
17871
|
+
var Root28 = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsx(
|
|
13504
17872
|
"div",
|
|
13505
17873
|
{
|
|
13506
17874
|
ref,
|
|
@@ -13565,7 +17933,7 @@ var AddFilter = ({ className, children, ...props }) => /* @__PURE__ */ jsxs(Butt
|
|
|
13565
17933
|
children ?? "Add filter"
|
|
13566
17934
|
] });
|
|
13567
17935
|
var Clear = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Button, { variant: "invisible", size: "small", className: cn("tw-ml-auto", className), ...props, children: children ?? "Clear all" });
|
|
13568
|
-
var PageToolbar = Object.assign(
|
|
17936
|
+
var PageToolbar = Object.assign(Root28, {
|
|
13569
17937
|
/** Left slot — typically a `SearchInput`. */
|
|
13570
17938
|
Search: Search5,
|
|
13571
17939
|
/** Right cluster — host the four control groups below in the recommended order. */
|
|
@@ -15362,7 +19730,21 @@ var navbarClassnames = cva(
|
|
|
15362
19730
|
}
|
|
15363
19731
|
}
|
|
15364
19732
|
);
|
|
15365
|
-
var Navbar = ({ className, accent = "blue", bordered = false, ...rest }) =>
|
|
19733
|
+
var Navbar = ({ className, accent = "blue", bordered = false, ...rest }) => (
|
|
19734
|
+
// A `<nav>` (not `<header>`): it's hosted inside `AppShell.Header`, which is
|
|
19735
|
+
// already the `<header>` landmark — nesting a second `<header>` is invalid and
|
|
19736
|
+
// muddies landmark navigation. `aria-label` comes first so a caller-supplied
|
|
19737
|
+
// label in `...rest` overrides the default.
|
|
19738
|
+
/* @__PURE__ */ jsx(
|
|
19739
|
+
"nav",
|
|
19740
|
+
{
|
|
19741
|
+
"aria-label": "Main navigation",
|
|
19742
|
+
...rest,
|
|
19743
|
+
"data-accent": accent,
|
|
19744
|
+
className: navbarClassnames({ bordered, className })
|
|
19745
|
+
}
|
|
19746
|
+
)
|
|
19747
|
+
);
|
|
15366
19748
|
Navbar.Header = NavbarHeader;
|
|
15367
19749
|
Navbar.Footer = NavbarFooter;
|
|
15368
19750
|
Navbar.Content = NavbarContent;
|
|
@@ -17264,8 +21646,8 @@ var errorMessage = (field) => {
|
|
|
17264
21646
|
if (!first) return void 0;
|
|
17265
21647
|
if (typeof first === "string") return first;
|
|
17266
21648
|
if (typeof first === "object" && first !== null && "message" in first) {
|
|
17267
|
-
const
|
|
17268
|
-
return typeof
|
|
21649
|
+
const message2 = first.message;
|
|
21650
|
+
return typeof message2 === "string" ? message2 : void 0;
|
|
17269
21651
|
}
|
|
17270
21652
|
return void 0;
|
|
17271
21653
|
};
|
|
@@ -17349,7 +21731,7 @@ var SelectField = ({
|
|
|
17349
21731
|
const field = useFieldContext();
|
|
17350
21732
|
const resolved = items ?? options ?? [];
|
|
17351
21733
|
return /* @__PURE__ */ jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxs(
|
|
17352
|
-
|
|
21734
|
+
Select2.Root,
|
|
17353
21735
|
{
|
|
17354
21736
|
value: field.state.value ?? "",
|
|
17355
21737
|
onValueChange: (value) => {
|
|
@@ -17358,7 +21740,7 @@ var SelectField = ({
|
|
|
17358
21740
|
...rootProps,
|
|
17359
21741
|
children: [
|
|
17360
21742
|
/* @__PURE__ */ jsx(
|
|
17361
|
-
|
|
21743
|
+
Select2.Trigger,
|
|
17362
21744
|
{
|
|
17363
21745
|
id: field.name,
|
|
17364
21746
|
className: triggerClassName ?? "tw-w-full",
|
|
@@ -17369,7 +21751,7 @@ var SelectField = ({
|
|
|
17369
21751
|
onBlur: field.handleBlur
|
|
17370
21752
|
}
|
|
17371
21753
|
),
|
|
17372
|
-
/* @__PURE__ */ jsx(
|
|
21754
|
+
/* @__PURE__ */ jsx(Select2.Content, { children: resolved.map((option) => /* @__PURE__ */ jsx(Select2.Item, { value: option.value, children: option.label }, option.value)) })
|
|
17373
21755
|
]
|
|
17374
21756
|
}
|
|
17375
21757
|
) });
|
|
@@ -17445,12 +21827,12 @@ var { useAppForm, withForm } = createFormHook({
|
|
|
17445
21827
|
|
|
17446
21828
|
// src/blocks/Form/setServerFieldErrors.ts
|
|
17447
21829
|
var setServerFieldErrors = (form, errors) => {
|
|
17448
|
-
for (const { field, message } of errors) {
|
|
21830
|
+
for (const { field, message: message2 } of errors) {
|
|
17449
21831
|
form.setFieldMeta(field, (meta) => ({
|
|
17450
21832
|
...meta,
|
|
17451
21833
|
isTouched: true,
|
|
17452
|
-
errors: [
|
|
17453
|
-
errorMap: { ...meta.errorMap, onServer:
|
|
21834
|
+
errors: [message2],
|
|
21835
|
+
errorMap: { ...meta.errorMap, onServer: message2 }
|
|
17454
21836
|
}));
|
|
17455
21837
|
}
|
|
17456
21838
|
};
|
|
@@ -17714,6 +22096,6 @@ object-assign/index.js:
|
|
|
17714
22096
|
*)
|
|
17715
22097
|
*/
|
|
17716
22098
|
|
|
17717
|
-
export { Alert, AlertModal, AnswerSummary, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, MarkedText, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeDecorator, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, Tooltip, TooltipProvider, Truncated, UsageStats, UsageStatsRing, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
|
|
22099
|
+
export { Alert, AlertModal, AnswerSummary, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, MarkedText, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select2 as Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeDecorator, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, Tooltip, TooltipProvider, Truncated, UsageStats, UsageStatsRing, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
|
|
17718
22100
|
//# sourceMappingURL=index.js.map
|
|
17719
22101
|
//# sourceMappingURL=index.js.map
|