@dereekb/date 13.4.0 → 13.4.2

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/index.cjs.js CHANGED
@@ -9,6 +9,14 @@ var model = require('@dereekb/model');
9
9
  var rxjs = require('rxjs');
10
10
  var rrule = require('rrule');
11
11
 
12
+ function _array_like_to_array$7(arr, len) {
13
+ if (len == null || len > arr.length) len = arr.length;
14
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
15
+ return arr2;
16
+ }
17
+ function _array_without_holes$5(arr) {
18
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
19
+ }
12
20
  function _define_property$h(obj, key, value) {
13
21
  if (key in obj) {
14
22
  Object.defineProperty(obj, key, {
@@ -22,6 +30,12 @@ function _define_property$h(obj, key, value) {
22
30
  }
23
31
  return obj;
24
32
  }
33
+ function _iterable_to_array$5(iter) {
34
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
35
+ }
36
+ function _non_iterable_spread$5() {
37
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
38
+ }
25
39
  function _object_spread$e(target) {
26
40
  for(var i = 1; i < arguments.length; i++){
27
41
  var source = arguments[i] != null ? arguments[i] : {};
@@ -37,6 +51,17 @@ function _object_spread$e(target) {
37
51
  }
38
52
  return target;
39
53
  }
54
+ function _to_consumable_array$5(arr) {
55
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
56
+ }
57
+ function _unsupported_iterable_to_array$7(o, minLen) {
58
+ if (!o) return;
59
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
60
+ var n = Object.prototype.toString.call(o).slice(8, -1);
61
+ if (n === "Object" && o.constructor) n = o.constructor.name;
62
+ if (n === "Map" || n === "Set") return Array.from(n);
63
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
64
+ }
40
65
  /**
41
66
  * Sentinel date representing the maximum future date (January 1, 9999 UTC).
42
67
  *
@@ -134,6 +159,8 @@ function _object_spread$e(target) {
134
159
  *
135
160
  * Useful as a default for "no expiration" comparisons.
136
161
  *
162
+ * @returns the MAX_FUTURE_DATE sentinel
163
+ *
137
164
  * @example
138
165
  * ```ts
139
166
  * const futureDate = maxFutureDate();
@@ -204,8 +231,7 @@ function _object_spread$e(target) {
204
231
  * // tz === 'America/New_York' (or similar)
205
232
  * ```
206
233
  */ function guessCurrentTimezone() {
207
- var _Intl_DateTimeFormat_resolvedOptions, _Intl_DateTimeFormat;
208
- return (_Intl_DateTimeFormat = Intl.DateTimeFormat()) === null || _Intl_DateTimeFormat === void 0 ? void 0 : (_Intl_DateTimeFormat_resolvedOptions = _Intl_DateTimeFormat.resolvedOptions()) === null || _Intl_DateTimeFormat_resolvedOptions === void 0 ? void 0 : _Intl_DateTimeFormat_resolvedOptions.timeZone;
234
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
209
235
  }
210
236
  /**
211
237
  * Returns the current system's timezone, throwing if detection fails.
@@ -295,15 +321,15 @@ function isBefore(a, b) {
295
321
  }
296
322
  function isSameDate(a, b) {
297
323
  var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
298
- return a != null && b != null ? dateFns.isEqual(a, b) : defaultValue != null ? defaultValue : a == b;
324
+ return a != null && b != null ? dateFns.isEqual(a, b) : defaultValue !== null && defaultValue !== void 0 ? defaultValue : a == b;
299
325
  }
300
326
  function isSameDateHoursAndMinutes(a, b) {
301
327
  var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
302
- return a != null && b != null ? dateFns.isEqual(roundDownToMinute(a), roundDownToMinute(b)) : defaultValue != null ? defaultValue : a == b;
328
+ return a != null && b != null ? dateFns.isEqual(roundDownToMinute(a), roundDownToMinute(b)) : defaultValue !== null && defaultValue !== void 0 ? defaultValue : a == b;
303
329
  }
304
330
  function isSameDateDay(a, b) {
305
331
  var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
306
- return a != null && b != null ? dateFns.isSameDay(a, b) : defaultValue != null ? defaultValue : a == b;
332
+ return a != null && b != null ? dateFns.isSameDay(a, b) : defaultValue !== null && defaultValue !== void 0 ? defaultValue : a == b;
307
333
  }
308
334
  // MARK: Unix Date/Time
309
335
  /**
@@ -347,6 +373,10 @@ function isSameDateDay(a, b) {
347
373
  * Sets the hours and optionally minutes on a target date (defaults to now), with optional rounding to strip seconds/milliseconds.
348
374
  *
349
375
  * @param config - hours, optional minutes, and rounding options
376
+ * @param config.hours - the hours value to set
377
+ * @param config.minutes - optional minutes value to set
378
+ * @param config.removeSeconds - whether to zero out seconds
379
+ * @param config.roundDownToMinute - whether to zero out seconds and milliseconds (defaults to true)
350
380
  * @param target - date to modify (defaults to the current date/time)
351
381
  * @returns a new Date with the specified time values applied
352
382
  *
@@ -576,7 +606,7 @@ function roundDateTo(date, roundToUnit) {
576
606
  * // names === ['Mon', 'Tue']
577
607
  * ```
578
608
  */ function readDaysOfWeekNames(values, readDate, nameFunction) {
579
- return Array.from(readDaysOfWeek(values, readDate)).sort(util.sortNumbersAscendingFunction).map(nameFunction);
609
+ return _to_consumable_array$5(readDaysOfWeek(values, readDate)).sort(util.sortNumbersAscendingFunction).map(nameFunction);
580
610
  }
581
611
  /**
582
612
  * Checks whether the given date falls exactly at midnight (00:00:00.000) in UTC.
@@ -845,6 +875,9 @@ function _is_native_reflect_construct$2() {
845
875
  /**
846
876
  * Type guard to check if a value conforms to the {@link DateRangeStart} interface.
847
877
  *
878
+ * @param value - the value to check
879
+ * @returns true if the value has a valid Date `start` property
880
+ *
848
881
  * @example
849
882
  * ```ts
850
883
  * isDateRangeStart({ start: new Date() }); // true
@@ -873,6 +906,9 @@ function _is_native_reflect_construct$2() {
873
906
  * Counts the total number of calendar days spanned by the range, inclusive of both endpoints.
874
907
  * Always returns at least 1, even for same-day ranges.
875
908
  *
909
+ * @param dateRange - the date range to measure
910
+ * @returns the number of days in the range, inclusive
911
+ *
876
912
  * @example
877
913
  * ```ts
878
914
  * const range = { start: new Date('2024-01-01'), end: new Date('2024-01-03') };
@@ -884,6 +920,9 @@ function _is_native_reflect_construct$2() {
884
920
  /**
885
921
  * Type guard to check if a value is a valid {@link DateRange} with both start and end as Date objects.
886
922
  *
923
+ * @param input - the value to check
924
+ * @returns true if the value has valid Date `start` and `end` properties
925
+ *
887
926
  * @example
888
927
  * ```ts
889
928
  * isDateRange({ start: new Date(), end: new Date() }); // true
@@ -897,6 +936,10 @@ function _is_native_reflect_construct$2() {
897
936
  * Compares two date ranges for exact millisecond equality on both start and end.
898
937
  * Returns true if both are nullish.
899
938
  *
939
+ * @param a - first date range to compare
940
+ * @param b - second date range to compare
941
+ * @returns true if both ranges are equal or both are nullish
942
+ *
900
943
  * @example
901
944
  * ```ts
902
945
  * const a = { start: new Date('2024-01-01'), end: new Date('2024-01-31') };
@@ -911,6 +954,10 @@ function _is_native_reflect_construct$2() {
911
954
  * Compares two date ranges for calendar-day equality, ignoring time-of-day differences.
912
955
  * Returns true if both are nullish.
913
956
  *
957
+ * @param a - first date range to compare
958
+ * @param b - second date range to compare
959
+ * @returns true if both ranges fall on the same calendar days or both are nullish
960
+ *
914
961
  * @example
915
962
  * ```ts
916
963
  * const a = { start: new Date('2024-01-01T08:00:00'), end: new Date('2024-01-31T10:00:00') };
@@ -923,6 +970,9 @@ function _is_native_reflect_construct$2() {
923
970
  /**
924
971
  * Checks whether the range is unbounded (neither start nor end is set), meaning it conceptually includes all dates.
925
972
  *
973
+ * @param input - the partial date range to check
974
+ * @returns true if neither start nor end is set
975
+ *
926
976
  * @example
927
977
  * ```ts
928
978
  * isInfiniteDateRange({}); // true
@@ -934,6 +984,9 @@ function _is_native_reflect_construct$2() {
934
984
  /**
935
985
  * Checks whether the range has only one of start or end set, but not both.
936
986
  *
987
+ * @param input - the partial date range to check
988
+ * @returns true if exactly one of start or end is set
989
+ *
937
990
  * @example
938
991
  * ```ts
939
992
  * isPartialDateRange({ start: new Date() }); // true
@@ -945,6 +998,9 @@ function _is_native_reflect_construct$2() {
945
998
  /**
946
999
  * Checks whether the range has both start and end set.
947
1000
  *
1001
+ * @param input - the partial date range to check
1002
+ * @returns true if both start and end are set
1003
+ *
948
1004
  * @example
949
1005
  * ```ts
950
1006
  * isFullDateRange({ start: new Date(), end: new Date() }); // true
@@ -957,6 +1013,10 @@ function _is_native_reflect_construct$2() {
957
1013
  * Normalizes a Date or {@link DateRange} into a DateRange. When given a single Date,
958
1014
  * uses it as start and optionally uses the provided end date (defaults to the same date).
959
1015
  *
1016
+ * @param startOrDateRange - a Date or existing DateRange
1017
+ * @param end - optional end date when the first argument is a plain Date
1018
+ * @returns a DateRange
1019
+ *
960
1020
  * @example
961
1021
  * ```ts
962
1022
  * const range = dateOrDateRangeToDateRange(new Date('2024-01-01'), new Date('2024-01-31'));
@@ -1029,6 +1089,9 @@ exports.DateRangeType = void 0;
1029
1089
  * Creates a {@link DateRange} from the given type and optional parameters. Supports many range
1030
1090
  * strategies including fixed periods (day, week, month), directional ranges, and radii.
1031
1091
  *
1092
+ * @param input - the range type or full configuration object
1093
+ * @param inputRoundToMinute - optional override to round the date to the start of its minute
1094
+ * @returns a computed DateRange
1032
1095
  * @throws Error if the type is not a recognized {@link DateRangeType}
1033
1096
  *
1034
1097
  * @example
@@ -1062,25 +1125,27 @@ exports.DateRangeType = void 0;
1062
1125
  start = startOfFn(preStart);
1063
1126
  end = endOfFn(preEnd);
1064
1127
  }
1065
- function calculateStartAndEndForBetween(addFn) {
1066
- var distance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, startOfFn = arguments.length > 2 ? arguments[2] : void 0, endOfFn = arguments.length > 3 ? arguments[3] : void 0;
1128
+ function calculateStartAndEndForBetween(config) {
1129
+ var addFn = config.addFn, tmp = config.distance, betweenDistance = tmp === void 0 ? 0 : tmp, startOfFn = config.startOfFn, endOfFn = config.endOfFn;
1067
1130
  var preStart;
1068
1131
  var preEnd;
1069
- switch(distance){
1132
+ switch(betweenDistance){
1070
1133
  case 0:
1071
1134
  preStart = date;
1072
1135
  preEnd = date;
1073
1136
  break;
1074
1137
  default:
1075
- var hasNegativeDistance = distance < 0;
1076
- if (hasNegativeDistance) {
1077
- preStart = addFn(date, distance);
1078
- preEnd = date;
1079
- } else {
1080
- preStart = date;
1081
- preEnd = addFn(date, distance);
1138
+ {
1139
+ var hasNegativeDistance = betweenDistance < 0;
1140
+ if (hasNegativeDistance) {
1141
+ preStart = addFn(date, betweenDistance);
1142
+ preEnd = date;
1143
+ } else {
1144
+ preStart = date;
1145
+ preEnd = addFn(date, betweenDistance);
1146
+ }
1147
+ break;
1082
1148
  }
1083
- break;
1084
1149
  }
1085
1150
  start = startOfFn(preStart);
1086
1151
  end = endOfFn(preEnd);
@@ -1102,19 +1167,44 @@ exports.DateRangeType = void 0;
1102
1167
  calculateStartAndEndForDate(dateFns.startOfMinute, dateFns.endOfMinute);
1103
1168
  break;
1104
1169
  case exports.DateRangeType.MINUTES_RANGE:
1105
- calculateStartAndEndForBetween(dateFns.addMinutes, rawDistance, dateFns.startOfMinute, dateFns.endOfMinute);
1170
+ calculateStartAndEndForBetween({
1171
+ addFn: dateFns.addMinutes,
1172
+ distance: rawDistance,
1173
+ startOfFn: dateFns.startOfMinute,
1174
+ endOfFn: dateFns.endOfMinute
1175
+ });
1106
1176
  break;
1107
1177
  case exports.DateRangeType.HOURS_RANGE:
1108
- calculateStartAndEndForBetween(dateFns.addHours, rawDistance, dateFns.startOfHour, dateFns.endOfHour);
1178
+ calculateStartAndEndForBetween({
1179
+ addFn: dateFns.addHours,
1180
+ distance: rawDistance,
1181
+ startOfFn: dateFns.startOfHour,
1182
+ endOfFn: dateFns.endOfHour
1183
+ });
1109
1184
  break;
1110
1185
  case exports.DateRangeType.DAYS_RANGE:
1111
- calculateStartAndEndForBetween(dateFns.addDays, rawDistance, dateFns.startOfDay, dateFns.endOfDay);
1186
+ calculateStartAndEndForBetween({
1187
+ addFn: dateFns.addDays,
1188
+ distance: rawDistance,
1189
+ startOfFn: dateFns.startOfDay,
1190
+ endOfFn: dateFns.endOfDay
1191
+ });
1112
1192
  break;
1113
1193
  case exports.DateRangeType.WEEKS_RANGE:
1114
- calculateStartAndEndForBetween(dateFns.addWeeks, rawDistance, dateFns.startOfWeek, dateFns.endOfWeek);
1194
+ calculateStartAndEndForBetween({
1195
+ addFn: dateFns.addWeeks,
1196
+ distance: rawDistance,
1197
+ startOfFn: dateFns.startOfWeek,
1198
+ endOfFn: dateFns.endOfWeek
1199
+ });
1115
1200
  break;
1116
1201
  case exports.DateRangeType.MONTHS_RANGE:
1117
- calculateStartAndEndForBetween(dateFns.addMonths, rawDistance, dateFns.startOfMonth, dateFns.endOfMonth);
1202
+ calculateStartAndEndForBetween({
1203
+ addFn: dateFns.addMonths,
1204
+ distance: rawDistance,
1205
+ startOfFn: dateFns.startOfMonth,
1206
+ endOfFn: dateFns.endOfMonth
1207
+ });
1118
1208
  break;
1119
1209
  case exports.DateRangeType.MINUTES_RADIUS:
1120
1210
  distance = Math.abs(distance);
@@ -1137,10 +1227,12 @@ exports.DateRangeType = void 0;
1137
1227
  end = dateFns.addDays(date, distance * 7);
1138
1228
  break;
1139
1229
  case exports.DateRangeType.CALENDAR_MONTH:
1140
- var monthStart = dateFns.startOfMonth(dateFns.endOfWeek(date));
1141
- start = dateFns.startOfWeek(monthStart);
1142
- end = dateFns.endOfWeek(dateFns.endOfMonth(monthStart));
1143
- break;
1230
+ {
1231
+ var monthStart = dateFns.startOfMonth(dateFns.endOfWeek(date));
1232
+ start = dateFns.startOfWeek(monthStart);
1233
+ end = dateFns.endOfWeek(dateFns.endOfMonth(monthStart));
1234
+ break;
1235
+ }
1144
1236
  default:
1145
1237
  throw new Error("Unknown date range type: ".concat(type));
1146
1238
  }
@@ -1153,6 +1245,9 @@ exports.DateRangeType = void 0;
1153
1245
  * Returns a range spanning the full calendar day (first to last millisecond) of the given date.
1154
1246
  * Convenience wrapper around {@link dateRange} with {@link DateRangeType.DAY}.
1155
1247
  *
1248
+ * @param date - the date whose full day range to return
1249
+ * @returns a DateRange from start of day to end of day
1250
+ *
1156
1251
  * @example
1157
1252
  * ```ts
1158
1253
  * const range = dateRangeFromStartAndEndOfDay(new Date('2024-06-15T14:30:00'));
@@ -1191,6 +1286,8 @@ var DEFAULT_ITERATE_DAYS_IN_DATE_RANGE_MAX_ITERATIONS = 4000;
1191
1286
  * Creates a reusable function that iterates over dates within a range using a configurable step function.
1192
1287
  * Supports max iteration limits and early bail-out via {@link endItreateDaysInDateRangeEarly}.
1193
1288
  *
1289
+ * @param input - configuration or a step function for advancing between dates
1290
+ * @returns a reusable iteration function
1194
1291
  * @throws Error if max iterations is exceeded and throwErrorOnMaxIterations is true
1195
1292
  *
1196
1293
  * @example
@@ -1244,6 +1341,8 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1244
1341
  * Creates a reusable function that expands a {@link DateRange} into an array of individual day dates.
1245
1342
  * Includes a configurable safety limit to prevent accidental memory exhaustion from large ranges.
1246
1343
  *
1344
+ * @param config - optional configuration for the max expansion size
1345
+ * @returns a function that expands a DateRange into an array of Dates
1247
1346
  * @throws Error if the range spans more days than the configured maxExpansionSize
1248
1347
  *
1249
1348
  * @example
@@ -1273,6 +1372,9 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1273
1372
  * Expands a {@link DateRange} into an array of one Date per day. Uses the default max expansion size.
1274
1373
  * Convenience wrapper around {@link expandDaysForDateRangeFunction}.
1275
1374
  *
1375
+ * @param range - the date range to expand
1376
+ * @returns an array of Dates, one per day in the range
1377
+ *
1276
1378
  * @example
1277
1379
  * ```ts
1278
1380
  * const days = expandDaysForDateRange({ start: new Date('2024-01-01'), end: new Date('2024-01-03') });
@@ -1284,6 +1386,12 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1284
1386
  /**
1285
1387
  * Determines whether the current moment (or provided `now`) falls before, within, or after the given range.
1286
1388
  *
1389
+ * @param dateRange - the date range to compare against
1390
+ * @param dateRange.start - the start of the range
1391
+ * @param dateRange.end - the end of the range
1392
+ * @param now - the reference date, defaults to the current moment
1393
+ * @returns 'past', 'present', or 'future'
1394
+ *
1287
1395
  * @example
1288
1396
  * ```ts
1289
1397
  * const range = { start: new Date('2024-01-01'), end: new Date('2024-12-31') };
@@ -1306,6 +1414,10 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1306
1414
  /**
1307
1415
  * Groups an array of date ranges into past, present, and future buckets based on the current moment (or provided `now`).
1308
1416
  *
1417
+ * @param dateRanges - the date ranges to group
1418
+ * @param _now - the reference date, defaults to the current moment
1419
+ * @returns an object with past, present, and future arrays
1420
+ *
1309
1421
  * @example
1310
1422
  * ```ts
1311
1423
  * const ranges = [
@@ -1324,6 +1436,10 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1324
1436
  * Checks whether a date falls within a (possibly partial) date range.
1325
1437
  * Convenience wrapper around {@link isDateInDateRangeFunction}.
1326
1438
  *
1439
+ * @param date - the date to test
1440
+ * @param dateRange - the range to test against
1441
+ * @returns true if the date falls within the range
1442
+ *
1327
1443
  * @example
1328
1444
  * ```ts
1329
1445
  * const range = { start: new Date('2024-01-01'), end: new Date('2024-12-31') };
@@ -1338,6 +1454,9 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1338
1454
  * Handles partial ranges: if only start is set, checks >= start; if only end, checks <= end;
1339
1455
  * if neither, all dates are considered in range.
1340
1456
  *
1457
+ * @param dateRange - the boundary range to test against
1458
+ * @returns a function that tests whether a date falls within the range
1459
+ *
1341
1460
  * @example
1342
1461
  * ```ts
1343
1462
  * const isInQ1 = isDateInDateRangeFunction({
@@ -1372,7 +1491,7 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1372
1491
  return time <= endTime1;
1373
1492
  };
1374
1493
  } else {
1375
- fn = function fn(input) {
1494
+ fn = function fn(_input) {
1376
1495
  return true;
1377
1496
  };
1378
1497
  }
@@ -1383,6 +1502,10 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1383
1502
  * Checks whether a date range is fully contained within another (possibly partial) date range.
1384
1503
  * Convenience wrapper around {@link isDateRangeInDateRangeFunction}.
1385
1504
  *
1505
+ * @param compareDateRange - the range to test for containment
1506
+ * @param dateRange - the boundary range
1507
+ * @returns true if compareDateRange is fully within dateRange
1508
+ *
1386
1509
  * @example
1387
1510
  * ```ts
1388
1511
  * const outer = { start: new Date('2024-01-01'), end: new Date('2024-12-31') };
@@ -1396,6 +1519,9 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1396
1519
  * Creates a reusable function that tests whether a given date range is fully contained within
1397
1520
  * the configured boundary range. Both start and end of the input must be within bounds.
1398
1521
  *
1522
+ * @param dateRange - the boundary range
1523
+ * @returns a function that tests containment of other ranges
1524
+ *
1399
1525
  * @example
1400
1526
  * ```ts
1401
1527
  * const isInYear = isDateRangeInDateRangeFunction({
@@ -1417,6 +1543,10 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1417
1543
  * Checks whether two date ranges overlap in any way (partial or full).
1418
1544
  * Convenience wrapper around {@link dateRangeOverlapsDateRangeFunction}.
1419
1545
  *
1546
+ * @param compareDateRange - the range to test for overlap
1547
+ * @param dateRange - the reference range
1548
+ * @returns true if the ranges overlap
1549
+ *
1420
1550
  * @example
1421
1551
  * ```ts
1422
1552
  * const a = { start: new Date('2024-01-01'), end: new Date('2024-06-30') };
@@ -1430,6 +1560,9 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1430
1560
  * Creates a reusable function that tests whether input ranges overlap the configured boundary range.
1431
1561
  * Two ranges overlap if one starts before the other ends, and vice versa.
1432
1562
  *
1563
+ * @param dateRange - the boundary range to test overlap against
1564
+ * @returns a function that tests overlap of other ranges
1565
+ *
1433
1566
  * @example
1434
1567
  * ```ts
1435
1568
  * const overlapsQ1 = dateRangeOverlapsDateRangeFunction({
@@ -1461,6 +1594,9 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1461
1594
  *
1462
1595
  * Operates in UTC, so daylight savings transitions are not considered.
1463
1596
  *
1597
+ * @param dateRange - the date range to fit into a single day period
1598
+ * @returns a new date range with the same start and an end within 24 hours of start
1599
+ *
1464
1600
  * @example
1465
1601
  * ```ts
1466
1602
  * // 10AM to 1PM across 3 days becomes same-day 10AM to 1PM
@@ -1488,6 +1624,9 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1488
1624
  * Dates before start are clamped to start; dates after end are clamped to end.
1489
1625
  * Partial ranges clamp only on the side that is defined.
1490
1626
  *
1627
+ * @param dateRange - the boundary range for clamping
1628
+ * @returns a function that clamps dates to the range
1629
+ *
1491
1630
  * @example
1492
1631
  * ```ts
1493
1632
  * const clamp = clampDateFunction({
@@ -1503,15 +1642,16 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1503
1642
  var hasStartDate = dateRange.start != null;
1504
1643
  var hasEndDate = dateRange.end != null;
1505
1644
  if (hasStartDate || hasEndDate) {
1645
+ var _ref, _ref1;
1506
1646
  var _dateRange_start, _dateRange_end;
1507
1647
  // Start Clamp
1508
- var startTime = ((_dateRange_start = dateRange.start) === null || _dateRange_start === void 0 ? void 0 : _dateRange_start.getTime()) || 0;
1648
+ var startTime = (_ref = (_dateRange_start = dateRange.start) === null || _dateRange_start === void 0 ? void 0 : _dateRange_start.getTime()) !== null && _ref !== void 0 ? _ref : 0;
1509
1649
  var clampStart = function clampStart(input) {
1510
1650
  var time = input.getTime();
1511
1651
  return time >= startTime ? input : dateRange.start;
1512
1652
  };
1513
1653
  // End Clamp
1514
- var endTime = ((_dateRange_end = dateRange.end) === null || _dateRange_end === void 0 ? void 0 : _dateRange_end.getTime()) || 0;
1654
+ var endTime = (_ref1 = (_dateRange_end = dateRange.end) === null || _dateRange_end === void 0 ? void 0 : _dateRange_end.getTime()) !== null && _ref1 !== void 0 ? _ref1 : 0;
1515
1655
  var clampEnd = function clampEnd(input) {
1516
1656
  var time = input.getTime();
1517
1657
  return time <= endTime ? input : dateRange.end;
@@ -1541,6 +1681,10 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1541
1681
  * Clamps a single date to fall within the given range boundaries.
1542
1682
  * Convenience wrapper around {@link clampDateFunction}.
1543
1683
  *
1684
+ * @param date - the date to clamp
1685
+ * @param dateRange - the boundary range
1686
+ * @returns the clamped date
1687
+ *
1544
1688
  * @example
1545
1689
  * ```ts
1546
1690
  * const range = { start: new Date('2024-01-01'), end: new Date('2024-12-31') };
@@ -1568,6 +1712,10 @@ function clampDateRangeFunction(dateRange) {
1568
1712
  * Clamps a date range to fit within a boundary range.
1569
1713
  * Convenience wrapper around {@link clampDateRangeFunction}.
1570
1714
  *
1715
+ * @param inputDateRange - the date range to clamp
1716
+ * @param limitToDateRange - the boundary range
1717
+ * @returns the clamped date range
1718
+ *
1571
1719
  * @example
1572
1720
  * ```ts
1573
1721
  * const input = { start: new Date('2023-06-01'), end: new Date('2024-06-30') };
@@ -1581,6 +1729,9 @@ function clampDateRangeFunction(dateRange) {
1581
1729
  /**
1582
1730
  * Creates a function that applies a date transformation to both start and end of a {@link DateRange}.
1583
1731
  *
1732
+ * @param transform - the transformation to apply to both dates
1733
+ * @returns a function that transforms both dates of a DateRange
1734
+ *
1584
1735
  * @example
1585
1736
  * ```ts
1586
1737
  * import { startOfHour } from 'date-fns';
@@ -1604,6 +1755,9 @@ function clampDateRangeFunction(dateRange) {
1604
1755
  * Returns each unique day of the week present in the range, in the order they appear starting from
1605
1756
  * the range's start day. For ranges spanning 7+ days, returns all days of the week.
1606
1757
  *
1758
+ * @param dateRange - the date range to inspect
1759
+ * @returns an array of unique day-of-week values present in the range
1760
+ *
1607
1761
  * @example
1608
1762
  * ```ts
1609
1763
  * // Wednesday through Friday
@@ -1767,8 +1921,11 @@ function _type_of$6(obj) {
1767
1921
  * isValidDateTimezoneConversionConfig({ timezone: 'America/Chicago' }); // true
1768
1922
  * isValidDateTimezoneConversionConfig({}); // false
1769
1923
  * ```
1924
+ *
1925
+ * @param input - the conversion config to validate
1926
+ * @returns true if the config has at least one meaningful conversion property set
1770
1927
  */ function isValidDateTimezoneConversionConfig(input) {
1771
- return input.useSystemTimezone || input.timezone != null || input.timezoneOffset != null || input.noConversion || false;
1928
+ return input.useSystemTimezone === true || input.timezone != null || input.timezoneOffset != null || input.noConversion === true;
1772
1929
  }
1773
1930
  /**
1774
1931
  * Compares two configs for logical equivalence, accounting for the fact that
@@ -1779,12 +1936,16 @@ function _type_of$6(obj) {
1779
1936
  * isSameDateTimezoneConversionConfig({ timezone: 'UTC' }, { timezone: undefined }); // true
1780
1937
  * isSameDateTimezoneConversionConfig({ useSystemTimezone: true }, { timezone: 'America/Denver' }); // false
1781
1938
  * ```
1939
+ *
1940
+ * @param a - first conversion config to compare
1941
+ * @param b - second conversion config to compare
1942
+ * @returns true if both configs are logically equivalent
1782
1943
  */ function isSameDateTimezoneConversionConfig(a, b) {
1783
1944
  var isSame = false;
1784
1945
  if (a.useSystemTimezone || b.useSystemTimezone || a.timezoneOffset || b.timezoneOffset) {
1785
1946
  isSame = util.isSameNonNullValue(a.useSystemTimezone, b.useSystemTimezone) || util.isSameNonNullValue(a.timezoneOffset, b.timezoneOffset);
1786
1947
  } else {
1787
- isSame = util.isConsideredUtcTimezoneString(a.timezone) && util.isConsideredUtcTimezoneString(b.timezone) || a != null && a === b;
1948
+ isSame = util.isConsideredUtcTimezoneString(a.timezone) && util.isConsideredUtcTimezoneString(b.timezone) || a === b;
1788
1949
  }
1789
1950
  return isSame;
1790
1951
  }
@@ -1803,6 +1964,7 @@ function _type_of$6(obj) {
1803
1964
  * ```
1804
1965
  *
1805
1966
  * @param date - required to determine the correct offset for that instant (DST-aware)
1967
+ * @returns the system timezone UTC offset in milliseconds
1806
1968
  */ function getCurrentSystemOffsetInMs(date) {
1807
1969
  // Use native getTimezoneOffset() instead of calculateTimezoneOffset() to avoid
1808
1970
  // a DST edge case where toZonedTime() creates an epoch that lands on the system's
@@ -1819,6 +1981,7 @@ function _type_of$6(obj) {
1819
1981
  * ```
1820
1982
  *
1821
1983
  * @param date - required to determine the correct offset for that instant (DST-aware)
1984
+ * @returns the system timezone UTC offset truncated to whole hours
1822
1985
  */ function getCurrentSystemOffsetInHours(date) {
1823
1986
  return dateFns.millisecondsToHours(getCurrentSystemOffsetInMs(date));
1824
1987
  }
@@ -1835,6 +1998,7 @@ function _type_of$6(obj) {
1835
1998
  * ```
1836
1999
  *
1837
2000
  * @param date - required to determine the correct offset for that instant (DST-aware)
2001
+ * @returns the system timezone UTC offset in minutes
1838
2002
  */ function getCurrentSystemOffsetInMinutes(date) {
1839
2003
  return dateFns.millisecondsToMinutes(getCurrentSystemOffsetInMs(date));
1840
2004
  }
@@ -1855,6 +2019,7 @@ function _type_of$6(obj) {
1855
2019
  *
1856
2020
  * @param timezone - IANA timezone string (e.g. 'America/New_York')
1857
2021
  * @param date - the instant to evaluate, since DST may shift the offset
2022
+ * @returns the UTC offset for the given timezone at the given instant, in milliseconds
1858
2023
  */ function calculateTimezoneOffset(timezone, date) {
1859
2024
  var tzOffset;
1860
2025
  // UTC always has zero offset; skip toZonedTime which can produce wrong results
@@ -1881,7 +2046,15 @@ function _type_of$6(obj) {
1881
2046
  }
1882
2047
  return tzOffset;
1883
2048
  }
1884
- function calculateAllConversions(date, converter) {
2049
+ /**
2050
+ * Calculates offset values for every pair of conversion targets (target, base, system)
2051
+ * and returns them as a keyed map (e.g. `'target-base'`, `'base-system'`).
2052
+ *
2053
+ * @param date - the reference date used to compute offsets
2054
+ * @param converter - the converter instance providing offset calculations
2055
+ * @param map - optional mapping function applied to each raw millisecond offset
2056
+ * @returns a map of conversion-pair keys to their computed offset values
2057
+ */ function calculateAllConversions(date, converter) {
1885
2058
  var map = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(x) {
1886
2059
  return x;
1887
2060
  };
@@ -1908,6 +2081,9 @@ function calculateAllConversions(date, converter) {
1908
2081
  * inverseDateTimezoneUtcNormalInstanceTransformType('targetDateToBaseDate'); // 'baseDateToTargetDate'
1909
2082
  * inverseDateTimezoneUtcNormalInstanceTransformType('systemDateToTargetDate'); // 'targetDateToSystemDate'
1910
2083
  * ```
2084
+ *
2085
+ * @param input - the transform type to invert
2086
+ * @returns the inverse transform type for round-trip conversion
1911
2087
  */ function inverseDateTimezoneUtcNormalInstanceTransformType(input) {
1912
2088
  var result;
1913
2089
  switch(input){
@@ -1929,6 +2105,8 @@ function calculateAllConversions(date, converter) {
1929
2105
  case 'targetDateToSystemDate':
1930
2106
  result = 'systemDateToTargetDate';
1931
2107
  break;
2108
+ default:
2109
+ throw new Error("Unexpected transform type: ".concat(input));
1932
2110
  }
1933
2111
  return result;
1934
2112
  }
@@ -1960,8 +2138,7 @@ function calculateAllConversions(date, converter) {
1960
2138
  };
1961
2139
  };
1962
2140
  var calculateOffset = function calculateOffset(date) {
1963
- var offset = getOffsetInMsFn(date);
1964
- return offset;
2141
+ return getOffsetInMsFn(date);
1965
2142
  };
1966
2143
  var calculateSystemNormalDifference = function calculateSystemNormalDifference(date) {
1967
2144
  var normalOffset = calculateOffset(date);
@@ -2070,12 +2247,11 @@ function calculateAllConversions(date, converter) {
2070
2247
  * For example, when daylight savings changed on November 3, 2024 the offset returned was 5 but to get back to the original an offset of 6 was required.
2071
2248
  * This is where some contextual data was not being used. This function uses that contextual data to make sure the reverse will be consistent.
2072
2249
  *
2073
- * @param baseDate The base date. Should have been derived from the originalContextDate using the convertDate() function
2074
- * @param originalContextDate Original date used to derive the baseDate.
2075
- * @param fromOrTo the "type" of date the originalContextDate is
2250
+ * @param config - configuration for the safe mirrored conversion
2251
+ * @returns the converted date and the DST offset adjustment applied
2076
2252
  */ key: "safeMirroredConvertDate",
2077
- value: function safeMirroredConvertDate(baseDate, originalContextDate, contextType) {
2078
- var safeConvert = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
2253
+ value: function safeMirroredConvertDate(config) {
2254
+ var baseDate = config.baseDate, originalContextDate = config.originalContextDate, contextType = config.contextType, _config_safeConvert = config.safeConvert, safeConvert = _config_safeConvert === void 0 ? true : _config_safeConvert;
2079
2255
  if (contextType === 'base') {
2080
2256
  return {
2081
2257
  date: baseDate,
@@ -2238,7 +2414,8 @@ function calculateAllConversions(date, converter) {
2238
2414
  /**
2239
2415
  * Returns true if the input is midnight in the target timezone.
2240
2416
  *
2241
- * @param date
2417
+ * @param date - the date to check
2418
+ * @returns true if the date is at the start of the day in the target timezone
2242
2419
  */ key: "isStartOfDayInTargetTimezone",
2243
2420
  value: function isStartOfDayInTargetTimezone(date) {
2244
2421
  var utcNormal = this.baseDateToTargetDate(date);
@@ -2249,7 +2426,8 @@ function calculateAllConversions(date, converter) {
2249
2426
  /**
2250
2427
  * Start of the given day in the target timezone.
2251
2428
  *
2252
- * @param date The input is treated as an instant in time.
2429
+ * @param date - the input is treated as an instant in time
2430
+ * @returns the start-of-day date in the target timezone
2253
2431
  */ key: "startOfDayInTargetTimezone",
2254
2432
  value: function startOfDayInTargetTimezone(date) {
2255
2433
  var baseDay = this.startOfDayInBaseDate(date);
@@ -2260,7 +2438,8 @@ function calculateAllConversions(date, converter) {
2260
2438
  /**
2261
2439
  * Start of the given day in UTC.
2262
2440
  *
2263
- * @param date
2441
+ * @param date - the date or ISO8601 day string to get the start of day for
2442
+ * @returns the start of the day as a BaseDateAsUTC
2264
2443
  */ key: "startOfDayInBaseDate",
2265
2444
  value: function startOfDayInBaseDate(date) {
2266
2445
  if (typeof date === 'string') {
@@ -2275,8 +2454,8 @@ function calculateAllConversions(date, converter) {
2275
2454
  /**
2276
2455
  * End of the given day in UTC.
2277
2456
  *
2278
- * @param date
2279
- * @returns
2457
+ * @param date - the date or ISO8601 day string to get the end of day for
2458
+ * @returns the end of the day as a BaseDateAsUTC (23:59:59.999)
2280
2459
  */ key: "endOfDayInBaseDate",
2281
2460
  value: function endOfDayInBaseDate(date) {
2282
2461
  var result = this.startOfDayInBaseDate(date);
@@ -2288,8 +2467,8 @@ function calculateAllConversions(date, converter) {
2288
2467
  /**
2289
2468
  * Start of the given day for the system.
2290
2469
  *
2291
- * @param date
2292
- * @returns
2470
+ * @param date - the date or ISO8601 day string to get the start of day for
2471
+ * @returns the start of the day in the system timezone
2293
2472
  */ key: "startOfDayInSystemDate",
2294
2473
  value: function startOfDayInSystemDate(date) {
2295
2474
  if (typeof date === 'string') {
@@ -2304,8 +2483,8 @@ function calculateAllConversions(date, converter) {
2304
2483
  /**
2305
2484
  * End of the given day for the system.
2306
2485
  *
2307
- * @param date
2308
- * @returns
2486
+ * @param date - the date or ISO8601 day string to get the end of day for
2487
+ * @returns the end of the day in the system timezone
2309
2488
  */ key: "endOfDayInSystemDate",
2310
2489
  value: function endOfDayInSystemDate(date) {
2311
2490
  return dateFns.endOfDay(this.startOfDayInSystemDate(date));
@@ -2313,9 +2492,10 @@ function calculateAllConversions(date, converter) {
2313
2492
  },
2314
2493
  {
2315
2494
  /**
2316
- * Whether or not the system experiences daylight savings for the given year.
2495
+ * Whether or not the target timezone experiences daylight savings for the given year.
2317
2496
  *
2318
- * @param year
2497
+ * @param year - the year to check, as a Date or number; defaults to the current year
2498
+ * @returns true if the target timezone has different offsets in January and July
2319
2499
  */ key: "targetTimezoneExperiencesDaylightSavings",
2320
2500
  value: function targetTimezoneExperiencesDaylightSavings() {
2321
2501
  var year = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
@@ -2372,6 +2552,8 @@ function calculateAllConversions(date, converter) {
2372
2552
  * const same = dateTimezoneUtcNormal(denver); // same reference
2373
2553
  * ```
2374
2554
  *
2555
+ * @param config - timezone input: an existing instance, timezone string, millisecond offset, or config object
2556
+ * @returns a DateTimezoneUtcNormalInstance for the given input
2375
2557
  * @throws Error if the input type is not recognized
2376
2558
  */ function dateTimezoneUtcNormal(config) {
2377
2559
  var instance;
@@ -2394,7 +2576,7 @@ function calculateAllConversions(date, converter) {
2394
2576
  });
2395
2577
  break;
2396
2578
  default:
2397
- throw new Error('Invalid input passed to dateTimezoneUtcNormal()');
2579
+ throw new Error('Invalid input type "'.concat(type, '" passed to dateTimezoneUtcNormal()'));
2398
2580
  }
2399
2581
  }
2400
2582
  return instance;
@@ -2417,6 +2599,8 @@ function calculateAllConversions(date, converter) {
2417
2599
  *
2418
2600
  * Prefer this over constructing a new instance when you need system-timezone conversions,
2419
2601
  * as the singleton avoids unnecessary allocations.
2602
+ *
2603
+ * @returns the shared system-timezone DateTimezoneUtcNormalInstance singleton
2420
2604
  */ function systemDateTimezoneUtcNormal() {
2421
2605
  return SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE;
2422
2606
  }
@@ -2433,10 +2617,13 @@ function calculateAllConversions(date, converter) {
2433
2617
  * const target = baseDateToTargetDate(base, 'America/Denver');
2434
2618
  * // target is 2024-06-15T14:00:00.000-06:00 (2PM MDT)
2435
2619
  * ```
2620
+ *
2621
+ * @param date - the BaseDateAsUTC to convert
2622
+ * @param timezone - the target IANA timezone string
2623
+ * @returns a real instant in the specified timezone
2436
2624
  */ function baseDateToTargetDate(date, timezone) {
2437
2625
  var instance = new DateTimezoneUtcNormalInstance(timezone);
2438
- var result = instance.baseDateToTargetDate(date);
2439
- return result;
2626
+ return instance.baseDateToTargetDate(date);
2440
2627
  }
2441
2628
  /**
2442
2629
  * Convenience function that strips the timezone offset from a target-timezone date,
@@ -2451,30 +2638,46 @@ function calculateAllConversions(date, converter) {
2451
2638
  * const base = targetDateToBaseDate(target, 'America/Denver');
2452
2639
  * // base is 2024-06-15T14:00:00.000Z — wall-clock 2PM preserved as UTC
2453
2640
  * ```
2641
+ *
2642
+ * @param date - the target-timezone date to convert
2643
+ * @param timezone - the IANA timezone the date is expressed in
2644
+ * @returns a BaseDateAsUTC with wall-clock time preserved as UTC
2454
2645
  */ function targetDateToBaseDate(date, timezone) {
2455
2646
  return new DateTimezoneUtcNormalInstance(timezone).targetDateToBaseDate(date);
2456
2647
  }
2457
2648
  /**
2458
2649
  * Converts a {@link BaseDateAsUTC} to a target date in the system's local timezone
2459
2650
  * using the shared system-timezone instance.
2651
+ *
2652
+ * @param date - the BaseDateAsUTC to convert
2653
+ * @returns the date converted to the system's local timezone
2460
2654
  */ function systemBaseDateToNormalDate(date) {
2461
2655
  return SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.baseDateToTargetDate(date);
2462
2656
  }
2463
2657
  /**
2464
2658
  * Converts a target date in the system's local timezone back to a {@link BaseDateAsUTC}
2465
2659
  * using the shared system-timezone instance.
2660
+ *
2661
+ * @param date - the system-timezone target date to convert back to base
2662
+ * @returns the corresponding BaseDateAsUTC
2466
2663
  */ function systemNormalDateToBaseDate(date) {
2467
2664
  return SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.targetDateToBaseDate(date);
2468
2665
  }
2469
2666
  /**
2470
2667
  * Returns the millisecond offset needed to convert a {@link BaseDateAsUTC} to a target date
2471
2668
  * in the system's local timezone.
2669
+ *
2670
+ * @param date - the date to compute the offset for
2671
+ * @returns the offset in milliseconds
2472
2672
  */ function systemBaseDateToNormalDateOffset(date) {
2473
2673
  return SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.baseDateToTargetDateOffset(date);
2474
2674
  }
2475
2675
  /**
2476
2676
  * Returns the millisecond offset needed to convert a target date in the system's
2477
2677
  * local timezone back to a {@link BaseDateAsUTC}.
2678
+ *
2679
+ * @param date - the date to compute the offset for
2680
+ * @returns the offset in milliseconds
2478
2681
  */ function systemNormalDateToBaseDateOffset(date) {
2479
2682
  return SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.targetDateToBaseDateOffset(date);
2480
2683
  }
@@ -2482,6 +2685,9 @@ function calculateAllConversions(date, converter) {
2482
2685
  * Returns whether the system's local timezone observes daylight saving time in the given year.
2483
2686
  *
2484
2687
  * Compares the offset on January 1 and July 1; if they differ, DST is in effect for part of the year.
2688
+ *
2689
+ * @param year - the year to check, as a Date
2690
+ * @returns true if the system timezone observes DST in the given year
2485
2691
  */ function systemExperiencesDaylightSavings(year) {
2486
2692
  return SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.targetTimezoneExperiencesDaylightSavings(year);
2487
2693
  }
@@ -2497,7 +2703,9 @@ function calculateAllConversions(date, converter) {
2497
2703
  * const result = fn(someDate, (d) => startOfDay(d));
2498
2704
  * ```
2499
2705
  *
2706
+ * @param timezoneInput - timezone configuration for the conversion
2500
2707
  * @param transformType - defaults to `'systemDateToTargetDate'`
2708
+ * @returns a function that transforms dates within the specified timezone normalization
2501
2709
  */ function transformDateInTimezoneNormalFunction(timezoneInput) {
2502
2710
  var transformType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'systemDateToTargetDate';
2503
2711
  var timezoneInstance = dateTimezoneUtcNormal(timezoneInput);
@@ -2516,7 +2724,9 @@ function calculateAllConversions(date, converter) {
2516
2724
  * Creates a {@link TransformDateRangeToTimezoneFunction} that converts both dates in
2517
2725
  * a {@link DateRange} using the specified transform type.
2518
2726
  *
2727
+ * @param timezoneInput - timezone configuration for the conversion
2519
2728
  * @param transformType - defaults to `'systemDateToTargetDate'`
2729
+ * @returns a function that converts DateRange dates using the specified transform
2520
2730
  */ function transformDateRangeToTimezoneFunction(timezoneInput) {
2521
2731
  var transformType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'systemDateToTargetDate';
2522
2732
  var timezoneInstance = dateTimezoneUtcNormal(timezoneInput);
@@ -2529,7 +2739,9 @@ function calculateAllConversions(date, converter) {
2529
2739
  * Creates a {@link TransformDateRangeInTimezoneNormalFunction} that converts a date range
2530
2740
  * into the specified date space, applies a user-provided range transformation, then converts back.
2531
2741
  *
2742
+ * @param timezoneInput - timezone configuration for the conversion
2532
2743
  * @param transformType - defaults to `'systemDateToTargetDate'`
2744
+ * @returns a function that transforms date ranges within the specified timezone normalization
2533
2745
  */ function transformDateRangeInTimezoneNormalFunction(timezoneInput) {
2534
2746
  var transformType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'systemDateToTargetDate';
2535
2747
  var timezoneInstance = dateTimezoneUtcNormal(timezoneInput);
@@ -2553,6 +2765,9 @@ function calculateAllConversions(date, converter) {
2553
2765
  * const midnight = startOfDayInDenver('2024-06-15');
2554
2766
  * // midnight is 2024-06-15T06:00:00.000Z (midnight MDT = 6AM UTC)
2555
2767
  * ```
2768
+ *
2769
+ * @param timezone - timezone configuration to bind the factory to
2770
+ * @returns a factory that converts ISO8601 day strings to start-of-day dates
2556
2771
  */ function startOfDayInTimezoneDayStringFactory(timezone) {
2557
2772
  var timezoneInstance = dateTimezoneUtcNormal(timezone);
2558
2773
  return function(day) {
@@ -2568,6 +2783,10 @@ function calculateAllConversions(date, converter) {
2568
2783
  * ```ts
2569
2784
  * const midnight = startOfDayInTimezoneFromISO8601DayString('2024-06-15', 'America/Denver');
2570
2785
  * ```
2786
+ *
2787
+ * @param day - the ISO8601 day string to parse
2788
+ * @param timezone - timezone configuration for the start-of-day calculation
2789
+ * @returns the start-of-day instant in the given timezone
2571
2790
  */ function startOfDayInTimezoneFromISO8601DayString(day, timezone) {
2572
2791
  return startOfDayInTimezoneDayStringFactory(timezone)(day);
2573
2792
  }
@@ -2584,6 +2803,9 @@ function calculateAllConversions(date, converter) {
2584
2803
  * const result = setOnDate({ date: someDate, hours: 14, minutes: 30, inputType: 'target' });
2585
2804
  * // result is someDate with hours set to 14:30 in Denver time
2586
2805
  * ```
2806
+ *
2807
+ * @param timezone - the timezone configuration to bind to
2808
+ * @returns a function that sets hours/minutes on dates in the given timezone
2587
2809
  */ function setOnDateWithTimezoneNormalFunction(timezone) {
2588
2810
  var timezoneInstance = dateTimezoneUtcNormal(timezone);
2589
2811
  var fn = function fn(input) {
@@ -2601,7 +2823,7 @@ function calculateAllConversions(date, converter) {
2601
2823
  return roundDownToMinute ? roundDateDownTo(inputDate, 'minute') : inputDate;
2602
2824
  }
2603
2825
  if (inputType !== 'base') {
2604
- copyFrom = copyFrom != null ? timezoneInstance.convertDate(copyFrom, 'base', inputType) : undefined;
2826
+ copyFrom = timezoneInstance.convertDate(copyFrom, 'base', inputType);
2605
2827
  }
2606
2828
  }
2607
2829
  // set baseDate
@@ -2650,6 +2872,7 @@ function calculateAllConversions(date, converter) {
2650
2872
  *
2651
2873
  * @param input - the date whose day is preserved
2652
2874
  * @param timezone - the timezone context for the hour/minute interpretation
2875
+ * @returns the input date with hours and minutes set to the current time in the given timezone
2653
2876
  */ function copyHoursAndMinutesFromNowWithTimezoneNormal(input, timezone) {
2654
2877
  return copyHoursAndMinutesFromDateWithTimezoneNormal(input, 'now', timezone);
2655
2878
  }
@@ -2670,16 +2893,16 @@ function calculateAllConversions(date, converter) {
2670
2893
  * @param input - the date whose day is preserved
2671
2894
  * @param copyFrom - the date (or `'now'`) whose hours/minutes are copied
2672
2895
  * @param timezone - the timezone context for interpreting both dates
2896
+ * @returns the input date with hours and minutes copied from the source
2673
2897
  */ function copyHoursAndMinutesFromDateWithTimezoneNormal(input, copyFrom, timezone) {
2674
2898
  var timezoneInstance = dateTimezoneUtcNormal(timezone);
2675
- var result = timezoneInstance.setOnDate({
2899
+ return timezoneInstance.setOnDate({
2676
2900
  date: input,
2677
2901
  copyFrom: copyFrom,
2678
2902
  inputType: 'target',
2679
2903
  copyHours: true,
2680
2904
  copyMinutes: true
2681
2905
  });
2682
- return result;
2683
2906
  }
2684
2907
 
2685
2908
  function _define_property$e(obj, key, value) {
@@ -2740,6 +2963,7 @@ function _object_spread$c(target) {
2740
2963
  *
2741
2964
  * @param dateRange - the range to fit
2742
2965
  * @param timezone - the timezone for day boundary calculation
2966
+ * @returns the date range fitted to a single day period
2743
2967
  */ function fitDateRangeToDayPeriod(dateRange, timezone) {
2744
2968
  return fitDateRangeToDayPeriodFunction(timezone)(dateRange);
2745
2969
  }
@@ -2750,6 +2974,7 @@ function _object_spread$c(target) {
2750
2974
  * Useful when the same range formatting logic needs to be applied repeatedly with consistent settings.
2751
2975
  *
2752
2976
  * @param inputConfig - format function or full configuration
2977
+ * @returns a reusable function that formats date ranges into strings
2753
2978
  *
2754
2979
  * @example
2755
2980
  * ```ts
@@ -2786,6 +3011,7 @@ function _object_spread$c(target) {
2786
3011
  * @param range - date range to format
2787
3012
  * @param inputConfig - format function or full configuration
2788
3013
  * @param separator - optional separator override when inputConfig is a function
3014
+ * @returns the formatted date range string
2789
3015
  *
2790
3016
  * @example
2791
3017
  * ```ts
@@ -2809,6 +3035,7 @@ function _object_spread$c(target) {
2809
3035
  * (e.g., "3 hours", "about 2 days"). Delegates to date-fns `formatDistance` or `formatDistanceStrict`.
2810
3036
  *
2811
3037
  * @param inputConfig - controls distance formatting, optional transforms, and same-day handling
3038
+ * @returns a reusable function that computes and formats date range distances
2812
3039
  *
2813
3040
  * @example
2814
3041
  * ```ts
@@ -2862,6 +3089,7 @@ function _object_spread$c(target) {
2862
3089
  *
2863
3090
  * @param range - date range to compute distance for
2864
3091
  * @param inputConfig - optional distance formatting configuration
3092
+ * @returns the human-readable distance string
2865
3093
  *
2866
3094
  * @example
2867
3095
  * ```ts
@@ -2902,7 +3130,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
2902
3130
  end = endOrFormat;
2903
3131
  }
2904
3132
  }
2905
- var format = inputFormat !== null && inputFormat !== void 0 ? inputFormat : formatToShortDateString;
3133
+ var format = inputFormat !== null && inputFormat !== void 0 ? inputFormat : formatToMonthDaySlashDate;
2906
3134
  return formatDateRange(dateOrDateRangeToDateRange(startOrDateRange, end), {
2907
3135
  format: format,
2908
3136
  simplifySameDate: true
@@ -2913,6 +3141,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
2913
3141
  * instead of throwing.
2914
3142
  *
2915
3143
  * @param input - date, date string, or nullish value
3144
+ * @returns the ISO 8601 date string, or `undefined` if the input is invalid or nullish
2916
3145
  *
2917
3146
  * @example
2918
3147
  * ```ts
@@ -2935,6 +3164,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
2935
3164
  * Formats a Date to a full ISO 8601 date-time string via `Date.toISOString()`. Defaults to the current date/time.
2936
3165
  *
2937
3166
  * @param date - date to format; defaults to `new Date()`
3167
+ * @returns the full ISO 8601 date-time string
2938
3168
  *
2939
3169
  * @example
2940
3170
  * ```ts
@@ -2954,6 +3184,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
2954
3184
  * Use {@link toISO8601DayStringForUTC} when the UTC date is needed instead.
2955
3185
  *
2956
3186
  * @param dateOrString - date or existing day string
3187
+ * @returns the ISO 8601 day string in system timezone
2957
3188
  *
2958
3189
  * @example
2959
3190
  * ```ts
@@ -2973,6 +3204,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
2973
3204
  * Defaults to the current date.
2974
3205
  *
2975
3206
  * @param date - date to format; defaults to `new Date()`
3207
+ * @returns the ISO 8601 day string in system timezone
2976
3208
  *
2977
3209
  * @example
2978
3210
  * ```ts
@@ -2992,6 +3224,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
2992
3224
  * Use {@link toISO8601DayStringForSystem} when the system-local date is needed instead.
2993
3225
  *
2994
3226
  * @param dateOrString - date or existing day string
3227
+ * @returns the ISO 8601 day string in UTC
2995
3228
  *
2996
3229
  * @example
2997
3230
  * ```ts
@@ -3012,6 +3245,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3012
3245
  * Defaults to the current date.
3013
3246
  *
3014
3247
  * @param date - date to format; defaults to `new Date()`
3248
+ * @returns the ISO 8601 day string using UTC date components
3015
3249
  *
3016
3250
  * @example
3017
3251
  * ```ts
@@ -3024,12 +3258,18 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3024
3258
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3025
3259
  return "".concat(date.getUTCFullYear(), "-").concat((date.getUTCMonth() + 1).toString().padStart(2, '0'), "-").concat(date.getUTCDate().toString().padStart(2, '0'));
3026
3260
  }
3027
- /** date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`). */ var MONTH_DAY_SLASH_DATE_STRING_FORMAT = 'MM/dd/yyyy';
3028
- /** @deprecated use MONTH_DAY_SLASH_DATE_STRING_FORMAT instead. */ var monthDaySlashDateStringFormat = MONTH_DAY_SLASH_DATE_STRING_FORMAT;
3261
+ /**
3262
+ * date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`).
3263
+ */ var MONTH_DAY_SLASH_DATE_STRING_FORMAT = 'MM/dd/yyyy';
3264
+ /**
3265
+ * @deprecated Use MONTH_DAY_SLASH_DATE_STRING_FORMAT instead.
3266
+ */ // eslint-disable-next-line @typescript-eslint/naming-convention
3267
+ var monthDaySlashDateStringFormat = MONTH_DAY_SLASH_DATE_STRING_FORMAT;
3029
3268
  /**
3030
3269
  * Formats a Date as a month/day/year slash-separated string (`MM/dd/yyyy`). Defaults to the current date.
3031
3270
  *
3032
3271
  * @param date - date to format; defaults to `new Date()`
3272
+ * @returns the formatted `MM/dd/yyyy` string
3033
3273
  *
3034
3274
  * @example
3035
3275
  * ```ts
@@ -3045,12 +3285,18 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3045
3285
  /**
3046
3286
  * @deprecated use formatToMonthDaySlashDate instead.
3047
3287
  */ var formatToShortDateString = formatToMonthDaySlashDate;
3048
- /** date-fns format string for `MM/dd` (e.g., `"01/15"`). */ var DATE_MONTH_DAY_STRING_FORMAT = 'MM/dd';
3049
- /** @deprecated use DATE_MONTH_DAY_STRING_FORMAT instead. */ var dateMonthDayStringFormat = DATE_MONTH_DAY_STRING_FORMAT;
3288
+ /**
3289
+ * date-fns format string for `MM/dd` (e.g., `"01/15"`).
3290
+ */ var DATE_MONTH_DAY_STRING_FORMAT = 'MM/dd';
3291
+ /**
3292
+ * @deprecated Use DATE_MONTH_DAY_STRING_FORMAT instead.
3293
+ */ // eslint-disable-next-line @typescript-eslint/naming-convention
3294
+ var dateMonthDayStringFormat = DATE_MONTH_DAY_STRING_FORMAT;
3050
3295
  /**
3051
3296
  * Formats a Date as a month/day string (`MM/dd`) without the year. Defaults to the current date.
3052
3297
  *
3053
3298
  * @param date - date to format; defaults to `new Date()`
3299
+ * @returns the formatted `MM/dd` string
3054
3300
  *
3055
3301
  * @example
3056
3302
  * ```ts
@@ -3067,6 +3313,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3067
3313
  * Formats a Date as a human-friendly weekday and month/day string (e.g., `"Mon, Jan 15th"`).
3068
3314
  *
3069
3315
  * @param date - date to format
3316
+ * @returns the formatted weekday and month/day string
3070
3317
  *
3071
3318
  * @example
3072
3319
  * ```ts
@@ -3078,12 +3325,18 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3078
3325
  */ function formatToDateString(date) {
3079
3326
  return dateFns.format(date, 'EEE, MMM do');
3080
3327
  }
3081
- /** date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`). */ var DATE_TIME_STRING_FORMAT = 'h:mm a';
3082
- /** @deprecated use DATE_TIME_STRING_FORMAT instead. */ var dateTimeStringFormat = DATE_TIME_STRING_FORMAT;
3328
+ /**
3329
+ * date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`).
3330
+ */ var DATE_TIME_STRING_FORMAT = 'h:mm a';
3331
+ /**
3332
+ * @deprecated Use DATE_TIME_STRING_FORMAT instead.
3333
+ */ // eslint-disable-next-line @typescript-eslint/naming-convention
3334
+ var dateTimeStringFormat = DATE_TIME_STRING_FORMAT;
3083
3335
  /**
3084
3336
  * Formats a Date as a 12-hour time string with AM/PM (e.g., `"9:00 AM"`).
3085
3337
  *
3086
3338
  * @param date - date to format
3339
+ * @returns the formatted 12-hour time string with AM/PM
3087
3340
  *
3088
3341
  * @example
3089
3342
  * ```ts
@@ -3095,12 +3348,18 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3095
3348
  */ function formatToTimeString(date) {
3096
3349
  return dateFns.format(date, DATE_TIME_STRING_FORMAT);
3097
3350
  }
3098
- /** Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`). */ var DATE_SHORT_DATE_AND_TIME_STRING_FORMAT = "".concat(MONTH_DAY_SLASH_DATE_STRING_FORMAT, " ").concat(DATE_TIME_STRING_FORMAT);
3099
- /** @deprecated use DATE_SHORT_DATE_AND_TIME_STRING_FORMAT instead. */ var dateShortDateAndTimeStringFormat = DATE_SHORT_DATE_AND_TIME_STRING_FORMAT;
3351
+ /**
3352
+ * Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`).
3353
+ */ var DATE_SHORT_DATE_AND_TIME_STRING_FORMAT = "".concat(MONTH_DAY_SLASH_DATE_STRING_FORMAT, " ").concat(DATE_TIME_STRING_FORMAT);
3354
+ /**
3355
+ * @deprecated Use DATE_SHORT_DATE_AND_TIME_STRING_FORMAT instead.
3356
+ */ // eslint-disable-next-line @typescript-eslint/naming-convention
3357
+ var dateShortDateAndTimeStringFormat = DATE_SHORT_DATE_AND_TIME_STRING_FORMAT;
3100
3358
  /**
3101
3359
  * Formats a Date as a short date and time string (e.g., `"01/15/2024 9:00 AM"`).
3102
3360
  *
3103
3361
  * @param date - date to format
3362
+ * @returns the formatted short date and time string
3104
3363
  *
3105
3364
  * @example
3106
3365
  * ```ts
@@ -3118,6 +3377,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3118
3377
  *
3119
3378
  * @param start - start date/time
3120
3379
  * @param end - end date/time
3380
+ * @returns the formatted time string with an appended duration indicator
3121
3381
  *
3122
3382
  * @example
3123
3383
  * ```ts
@@ -3139,7 +3399,8 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3139
3399
  includeSeconds: false
3140
3400
  }), ")");
3141
3401
  } else {
3142
- subtitle = "".concat(minutes ? "(".concat(minutes, " Minutes)") : '');
3402
+ var minutesLabel = minutes ? "(".concat(minutes, " Minutes)") : '';
3403
+ subtitle = minutesLabel;
3143
3404
  }
3144
3405
  return "".concat(formatToTimeString(start), " ").concat(subtitle);
3145
3406
  }
@@ -3162,6 +3423,11 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3162
3423
  * formatStartedEndedDistanceString(activeRange);
3163
3424
  * // "started about 1 hour ago"
3164
3425
  * ```
3426
+ *
3427
+ * @param dateRange - date range with start and end dates
3428
+ * @param dateRange.start - the start date of the range
3429
+ * @param dateRange.end - the end date of the range
3430
+ * @returns the relative-time label describing the date range state
3165
3431
  */ function formatStartedEndedDistanceString(param) {
3166
3432
  var start = param.start, end = param.end;
3167
3433
  var state = dateRangeRelativeState({
@@ -3193,6 +3459,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3193
3459
  * Useful for converting heterogeneous date inputs into a consistent midnight-aligned Date.
3194
3460
  *
3195
3461
  * @param input - date or day string to normalize
3462
+ * @returns a Date set to midnight of the corresponding day in the system timezone
3196
3463
  *
3197
3464
  * @example
3198
3465
  * ```ts
@@ -3212,6 +3479,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3212
3479
  * in the system timezone. Supports year formats with more than 4 digits but does not support negative years.
3213
3480
  *
3214
3481
  * @param dayString - ISO 8601 day or date string to parse
3482
+ * @returns a Date at the start of the parsed day in the system timezone
3215
3483
  *
3216
3484
  * @example
3217
3485
  * ```ts
@@ -3428,6 +3696,11 @@ function _type_of$5(obj) {
3428
3696
  * The end date is used just to determine the number of days, but a minimum of 1 day is always enforced as a DateCellTiming must contain atleast 1 day.
3429
3697
  *
3430
3698
  * The start date from the inputDate is considered to to have the offset noted in DateCell, and will be retained.
3699
+ *
3700
+ * @param durationInput - the duration span containing the startsAt time and event duration in minutes
3701
+ * @param rangeInput - specifies the date range: a number of days, a DateRange, or a DateRangeDayDistanceInput
3702
+ * @param timezoneInput - optional timezone configuration; defaults to the system timezone if omitted
3703
+ * @returns a fully computed FullDateCellTiming with start, startsAt, end, duration, and timezone
3431
3704
  */ function dateCellTiming(durationInput, rangeInput, timezoneInput) {
3432
3705
  var duration = durationInput.duration;
3433
3706
  if (duration > util.MINUTES_IN_DAY) {
@@ -3482,7 +3755,12 @@ function _type_of$5(obj) {
3482
3755
  var utcDay = formatToISO8601DayStringForUTC(startsAtInUtc);
3483
3756
  var start = normalInstance.startOfDayInTargetTimezone(utcDay);
3484
3757
  var safeMirror = util.isEqualDate(startsAtInUtc, startsAtInUtcInitial);
3485
- var _normalInstance_safeMirroredConvertDate = normalInstance.safeMirroredConvertDate(startsAtInUtc, inputStartsAt, 'target', safeMirror), startsAt = _normalInstance_safeMirroredConvertDate.date, daylightSavingsOffset = _normalInstance_safeMirroredConvertDate.daylightSavingsOffset;
3758
+ var _normalInstance_safeMirroredConvertDate = normalInstance.safeMirroredConvertDate({
3759
+ baseDate: startsAtInUtc,
3760
+ originalContextDate: inputStartsAt,
3761
+ contextType: 'target',
3762
+ safeConvert: safeMirror
3763
+ }), startsAt = _normalInstance_safeMirroredConvertDate.date, daylightSavingsOffset = _normalInstance_safeMirroredConvertDate.daylightSavingsOffset;
3486
3764
  // calculate end to be the ending date/time of the final duration span
3487
3765
  var lastStartsAtInBaseTimezone = dateFns.addHours(startsAtInUtc, numberOfDayBlocks * 24 + daylightSavingsOffset); // use addHours instead of addDays, since addDays will take into account a daylight savings change if the system time changes
3488
3766
  var lastStartInTarget = normalInstance.targetDateToBaseDate(lastStartsAtInBaseTimezone);
@@ -3742,8 +4020,16 @@ function _calculateExpectedDateCellTimingDurationPair(timing) {
3742
4020
  var normalInstance = dateTimezoneUtcNormal(timezone);
3743
4021
  var startsAtInUtcNormal = normalInstance.baseDateToTargetDate(startsAt); // convert to UTC normal
3744
4022
  var endInUtcNormal = normalInstance.baseDateToTargetDate(end);
3745
- var _normalInstance_safeMirroredConvertDate = normalInstance.safeMirroredConvertDate(startsAtInUtcNormal, startsAt, 'target'), startDaylightSavingsOffset = _normalInstance_safeMirroredConvertDate.daylightSavingsOffset;
3746
- var _normalInstance_safeMirroredConvertDate1 = normalInstance.safeMirroredConvertDate(endInUtcNormal, end, 'target'), endDaylightSavingsOffset = _normalInstance_safeMirroredConvertDate1.daylightSavingsOffset;
4023
+ var _normalInstance_safeMirroredConvertDate = normalInstance.safeMirroredConvertDate({
4024
+ baseDate: startsAtInUtcNormal,
4025
+ originalContextDate: startsAt,
4026
+ contextType: 'target'
4027
+ }), startDaylightSavingsOffset = _normalInstance_safeMirroredConvertDate.daylightSavingsOffset;
4028
+ var _normalInstance_safeMirroredConvertDate1 = normalInstance.safeMirroredConvertDate({
4029
+ baseDate: endInUtcNormal,
4030
+ originalContextDate: end,
4031
+ contextType: 'target'
4032
+ }), endDaylightSavingsOffset = _normalInstance_safeMirroredConvertDate1.daylightSavingsOffset;
3747
4033
  if (startDaylightSavingsOffset) {
3748
4034
  startsAtInUtcNormal = dateFns.addHours(startsAtInUtcNormal, startDaylightSavingsOffset);
3749
4035
  }
@@ -3829,7 +4115,7 @@ function _calculateExpectedDateCellTimingDurationPair(timing) {
3829
4115
  isExpectedValidEnd = expectedDuration === duration; // should be the expected duration
3830
4116
  isValid = isExpectedValidEnd;
3831
4117
  }
3832
- var result = {
4118
+ return {
3833
4119
  isValid: isValid,
3834
4120
  endIsAfterTheStartsAtTime: endIsAfterTheStartsAtTime,
3835
4121
  durationGreaterThanZero: durationGreaterThanZero,
@@ -3838,7 +4124,6 @@ function _calculateExpectedDateCellTimingDurationPair(timing) {
3838
4124
  isExpectedValidEnd: isExpectedValidEnd,
3839
4125
  normalInstance: normalInstance
3840
4126
  };
3841
- return result;
3842
4127
  }
3843
4128
  /**
3844
4129
  * Returns true if the {@link DateCellTiming} passes all validation checks.
@@ -3903,13 +4188,13 @@ function _calculateExpectedDateCellTimingDurationPair(timing) {
3903
4188
  return isValid;
3904
4189
  }
3905
4190
 
3906
- function _array_like_to_array$5(arr, len) {
4191
+ function _array_like_to_array$6(arr, len) {
3907
4192
  if (len == null || len > arr.length) len = arr.length;
3908
4193
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3909
4194
  return arr2;
3910
4195
  }
3911
- function _array_without_holes$2(arr) {
3912
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
4196
+ function _array_without_holes$4(arr) {
4197
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
3913
4198
  }
3914
4199
  function _define_property$c(obj, key, value) {
3915
4200
  if (key in obj) {
@@ -3924,10 +4209,10 @@ function _define_property$c(obj, key, value) {
3924
4209
  }
3925
4210
  return obj;
3926
4211
  }
3927
- function _iterable_to_array$2(iter) {
4212
+ function _iterable_to_array$4(iter) {
3928
4213
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3929
4214
  }
3930
- function _non_iterable_spread$2() {
4215
+ function _non_iterable_spread$4() {
3931
4216
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3932
4217
  }
3933
4218
  function _object_spread$a(target) {
@@ -3964,20 +4249,20 @@ function _object_spread_props$8(target, source) {
3964
4249
  }
3965
4250
  return target;
3966
4251
  }
3967
- function _to_consumable_array$2(arr) {
3968
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$2();
4252
+ function _to_consumable_array$4(arr) {
4253
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
3969
4254
  }
3970
4255
  function _type_of$4(obj) {
3971
4256
  "@swc/helpers - typeof";
3972
4257
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
3973
4258
  }
3974
- function _unsupported_iterable_to_array$5(o, minLen) {
4259
+ function _unsupported_iterable_to_array$6(o, minLen) {
3975
4260
  if (!o) return;
3976
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
4261
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
3977
4262
  var n = Object.prototype.toString.call(o).slice(8, -1);
3978
4263
  if (n === "Object" && o.constructor) n = o.constructor.name;
3979
4264
  if (n === "Map" || n === "Set") return Array.from(n);
3980
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
4265
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
3981
4266
  }
3982
4267
  /**
3983
4268
  * Returns true if the input is a DateCellRange.
@@ -3985,6 +4270,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3985
4270
  * Does not check validity. Use {@link isValidDateCellRange} for that.
3986
4271
  *
3987
4272
  * @param input - value to check
4273
+ * @returns true if the input is a DateCellRange
3988
4274
  */ function isDateCellRange(input) {
3989
4275
  return (typeof input === "undefined" ? "undefined" : _type_of$4(input)) === 'object' ? Number.isInteger(input.i) && input.to === undefined || Number.isInteger(input.to) : false;
3990
4276
  }
@@ -3995,6 +4281,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3995
4281
  * that is greater than or equal to `i`.
3996
4282
  *
3997
4283
  * @param input - range to validate
4284
+ * @returns true if the range has valid non-negative indexes and `to` (when defined) is greater than or equal to `i`
3998
4285
  */ function isValidDateCellRange(input) {
3999
4286
  var i = input.i, to = input.to;
4000
4287
  if (!isValidDateCellIndex(i)) {
@@ -4010,6 +4297,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4010
4297
  * Validates that each range is individually valid and that no ranges overlap or appear out of order.
4011
4298
  *
4012
4299
  * @param input - array of ranges to validate as a non-overlapping ascending series
4300
+ * @returns true if the array is sorted in ascending order with no overlapping or duplicate indexes
4013
4301
  */ function isValidDateCellRangeSeries(input) {
4014
4302
  if (!Array.isArray(input)) {
4015
4303
  return false;
@@ -4021,13 +4309,30 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4021
4309
  return false;
4022
4310
  }
4023
4311
  var greatestIndex = -1;
4024
- for(var i = 0; i < input.length; i += 1){
4025
- var range = input[i];
4026
- if (range.i <= greatestIndex) {
4027
- return false;
4028
- } else {
4029
- var nextGreatestIndex = range.to || range.i; // to is greater than or equal to i in a valid date block range.
4030
- greatestIndex = nextGreatestIndex;
4312
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4313
+ try {
4314
+ for(var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4315
+ var range = _step.value;
4316
+ if (range.i <= greatestIndex) {
4317
+ return false;
4318
+ } else {
4319
+ var _range_to;
4320
+ var nextGreatestIndex = (_range_to = range.to) !== null && _range_to !== void 0 ? _range_to : range.i; // to is greater than or equal to i in a valid date block range.
4321
+ greatestIndex = nextGreatestIndex;
4322
+ }
4323
+ }
4324
+ } catch (err) {
4325
+ _didIteratorError = true;
4326
+ _iteratorError = err;
4327
+ } finally{
4328
+ try {
4329
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4330
+ _iterator.return();
4331
+ }
4332
+ } finally{
4333
+ if (_didIteratorError) {
4334
+ throw _iteratorError;
4335
+ }
4031
4336
  }
4032
4337
  }
4033
4338
  return true;
@@ -4038,6 +4343,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4038
4343
  * The input range is not expected to be sorted.
4039
4344
  *
4040
4345
  * @param input - unsorted array of date cell ranges to scan
4346
+ * @returns the smallest starting index found, or 0 if the input is empty
4041
4347
  */ function getLeastDateCellIndexInDateCellRanges(input) {
4042
4348
  var _ref;
4043
4349
  var _getLeastAndGreatestDateCellIndexInDateCellRanges;
@@ -4049,6 +4355,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4049
4355
  * The input range is not expected to be sorted.
4050
4356
  *
4051
4357
  * @param input - unsorted array of date cell ranges to scan
4358
+ * @returns the largest ending index found, or 0 if the input is empty
4052
4359
  */ function getGreatestDateCellIndexInDateCellRanges(input) {
4053
4360
  var _ref;
4054
4361
  var _getLeastAndGreatestDateCellIndexInDateCellRanges;
@@ -4060,6 +4367,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4060
4367
  * The input range is not expected to be sorted.
4061
4368
  *
4062
4369
  * @param input - unsorted array of date cell ranges to scan
4370
+ * @returns an object with the least and greatest indexes and their source items, or null if the input is empty
4063
4371
  */ function getLeastAndGreatestDateCellIndexInDateCellRanges(input) {
4064
4372
  if (!input.length) {
4065
4373
  return null;
@@ -4068,17 +4376,34 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4068
4376
  var greatestIndex = 0;
4069
4377
  var leastIndexItem = input[0];
4070
4378
  var greatestIndexItem = input[0];
4071
- for(var i = 0; i < input.length; i += 1){
4072
- var range = input[i];
4073
- var leastRangeIndex = range.i;
4074
- var greatestRangeIndex = range.to || range.i;
4075
- if (leastRangeIndex < leastIndex) {
4076
- leastIndex = leastRangeIndex;
4077
- leastIndexItem = range;
4379
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4380
+ try {
4381
+ for(var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4382
+ var range = _step.value;
4383
+ var _range_to;
4384
+ var leastRangeIndex = range.i;
4385
+ var greatestRangeIndex = (_range_to = range.to) !== null && _range_to !== void 0 ? _range_to : range.i;
4386
+ if (leastRangeIndex < leastIndex) {
4387
+ leastIndex = leastRangeIndex;
4388
+ leastIndexItem = range;
4389
+ }
4390
+ if (greatestRangeIndex > greatestIndex) {
4391
+ greatestIndex = greatestRangeIndex;
4392
+ greatestIndexItem = range;
4393
+ }
4078
4394
  }
4079
- if (greatestRangeIndex > greatestIndex) {
4080
- greatestIndex = greatestRangeIndex;
4081
- greatestIndexItem = range;
4395
+ } catch (err) {
4396
+ _didIteratorError = true;
4397
+ _iteratorError = err;
4398
+ } finally{
4399
+ try {
4400
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4401
+ _iterator.return();
4402
+ }
4403
+ } finally{
4404
+ if (_didIteratorError) {
4405
+ throw _iteratorError;
4406
+ }
4082
4407
  }
4083
4408
  }
4084
4409
  return {
@@ -4094,6 +4419,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4094
4419
  *
4095
4420
  * @param i - starting cell index
4096
4421
  * @param to - ending cell index (inclusive); defaults to `i`
4422
+ * @returns a DateCellRangeWithRange spanning from `i` to `to`
4097
4423
  */ function dateCellRange(i, to) {
4098
4424
  return {
4099
4425
  i: i,
@@ -4104,6 +4430,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4104
4430
  * Creates a single-cell {@link DateCellRangeWithRange} where both `i` and `to` equal the given index.
4105
4431
  *
4106
4432
  * @param dateCellIndex - the index for both start and end of the range
4433
+ * @returns a DateCellRangeWithRange where `i` and `to` both equal the given index
4107
4434
  */ function dateCellRangeWithRangeFromIndex(dateCellIndex) {
4108
4435
  return dateCellRange(dateCellIndex, dateCellIndex);
4109
4436
  }
@@ -4112,6 +4439,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4112
4439
  * ensuring the result always has an explicit `to` value.
4113
4440
  *
4114
4441
  * @param input - index, cell, or range to normalize
4442
+ * @returns a DateCellRangeWithRange with an explicit `to` value
4115
4443
  */ function dateCellRangeWithRange(input) {
4116
4444
  if (typeof input === 'number') {
4117
4445
  return dateCellRangeWithRangeFromIndex(input);
@@ -4124,12 +4452,12 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4124
4452
  * fully contains the configured `inputRange`.
4125
4453
  *
4126
4454
  * @param inputRange - the range that must be fully included
4455
+ * @returns a function that returns true when its argument fully contains `inputRange`
4127
4456
  */ function dateCellRangeIncludedByRangeFunction(inputRange) {
4128
4457
  var _dateCellRangeWithRange = dateCellRangeWithRange(inputRange), i = _dateCellRangeWithRange.i, to = _dateCellRangeWithRange.to;
4129
4458
  return function(input) {
4130
- var _ref;
4131
4459
  var range = dateCellRangeWithRange(input);
4132
- return range.i <= i && ((_ref = range === null || range === void 0 ? void 0 : range.to) !== null && _ref !== void 0 ? _ref : range.i) >= to;
4460
+ return range.i <= i && range.to >= to;
4133
4461
  };
4134
4462
  }
4135
4463
  /**
@@ -4137,12 +4465,12 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4137
4465
  * has any overlap with the configured `inputRange`.
4138
4466
  *
4139
4467
  * @param inputRange - the range to test for overlap against
4468
+ * @returns a function that returns true when its argument overlaps with `inputRange`
4140
4469
  */ function dateCellRangeOverlapsRangeFunction(inputRange) {
4141
4470
  var _dateCellRangeWithRange = dateCellRangeWithRange(inputRange), i = _dateCellRangeWithRange.i, to = _dateCellRangeWithRange.to;
4142
4471
  return function(input) {
4143
- var _ref;
4144
4472
  var range = dateCellRangeWithRange(input);
4145
- return range.i <= to && ((_ref = range === null || range === void 0 ? void 0 : range.to) !== null && _ref !== void 0 ? _ref : range.i) >= i;
4473
+ return range.i <= to && range.to >= i;
4146
4474
  };
4147
4475
  }
4148
4476
  /**
@@ -4150,6 +4478,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4150
4478
  *
4151
4479
  * @param rangeA - first range to compare
4152
4480
  * @param rangeB - second range to compare
4481
+ * @returns true if the two ranges share at least one common index
4153
4482
  */ function dateCellRangeOverlapsRange(rangeA, rangeB) {
4154
4483
  return dateCellRangeOverlapsRangeFunction(rangeA)(rangeB);
4155
4484
  }
@@ -4157,6 +4486,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4157
4486
  * Returns a sort comparator that orders ranges first by starting index (`i`), then by ending index (`to`).
4158
4487
  *
4159
4488
  * In many cases {@link sortAscendingIndexNumberRefFunction} may be preferential when `to` ordering is not needed.
4489
+ *
4490
+ * @returns a comparator function that sorts ranges by `i` then by `to`
4160
4491
  */ function sortDateCellRangeAndSizeFunction() {
4161
4492
  return function(a, b) {
4162
4493
  var _a_to, _b_to;
@@ -4167,6 +4498,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4167
4498
  * Sorts the input date ranges in-place by ascending index using {@link sortAscendingIndexNumberRefFunction}.
4168
4499
  *
4169
4500
  * @param input - array of ranges to sort (mutated in place)
4501
+ * @returns the same array, sorted in ascending index order
4170
4502
  */ function sortDateCellRanges(input) {
4171
4503
  return input.sort(util.sortAscendingIndexNumberRefFunction());
4172
4504
  }
@@ -4177,6 +4509,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4177
4509
  * The input is sorted internally before grouping.
4178
4510
  *
4179
4511
  * @param input - cells or ranges to merge into contiguous groups
4512
+ * @returns an array of non-overlapping contiguous DateCellRangeWithRange values
4180
4513
  *
4181
4514
  * @example
4182
4515
  * ```ts
@@ -4224,6 +4557,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4224
4557
  * Returns an array containing every individual index in the given date cell range (inclusive of both `i` and `to`).
4225
4558
  *
4226
4559
  * @param input - range to expand into individual indexes
4560
+ * @returns an array of every DateCellIndex from `i` to `to` inclusive
4227
4561
  */ function allIndexesInDateCellRange(input) {
4228
4562
  return input.to != null ? util.range(input.i, input.to + 1) : [
4229
4563
  input.i
@@ -4233,6 +4567,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4233
4567
  * Flattens an array of indexes and/or ranges into a single array of individual {@link DateCellIndex} values.
4234
4568
  *
4235
4569
  * @param input - mix of raw indexes and ranges to flatten
4570
+ * @returns a flat array of all individual DateCellIndex values
4236
4571
  */ function allIndexesInDateCellRangesToArray(input) {
4237
4572
  var result = [];
4238
4573
  input.forEach(function(x) {
@@ -4249,6 +4584,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4249
4584
  * Returns a deduplicated {@link Set} of all indexes within the input ranges.
4250
4585
  *
4251
4586
  * @param input - mix of raw indexes and ranges to collect
4587
+ * @returns a Set containing every unique DateCellIndex from the input
4252
4588
  */ function allIndexesInDateCellRanges(input) {
4253
4589
  return new Set(allIndexesInDateCellRangesToArray(input));
4254
4590
  }
@@ -4257,6 +4593,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4257
4593
  *
4258
4594
  * @param blocks - cells or ranges to filter
4259
4595
  * @param range - bounding range that blocks must fall within
4596
+ * @returns only the blocks that fall entirely within the given range
4260
4597
  */ function filterDateCellsInDateCellRange(blocks, range) {
4261
4598
  var dateCellIsWithinDateCellRange = isDateCellWithinDateCellRangeFunction(range);
4262
4599
  return blocks.filter(dateCellIsWithinDateCellRange);
@@ -4266,6 +4603,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4266
4603
  * is fully contained within `inputRange`.
4267
4604
  *
4268
4605
  * @param inputRange - the bounding range to test containment against
4606
+ * @returns a function that returns true when its argument is fully contained within `inputRange`
4269
4607
  */ function isDateCellWithinDateCellRangeFunction(inputRange) {
4270
4608
  var range = dateCellRangeWithRange(inputRange);
4271
4609
  return function(input) {
@@ -4287,6 +4625,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4287
4625
  *
4288
4626
  * @param range - the outer bounding range
4289
4627
  * @param contains - the cell or range to test for containment
4628
+ * @returns true if `contains` is fully within `range`
4290
4629
  */ function isDateCellWithinDateCellRange(range, contains) {
4291
4630
  return isDateCellWithinDateCellRangeFunction(range)(dateCellRangeWithRange(contains));
4292
4631
  }
@@ -4296,6 +4635,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4296
4635
  * Internally groups overlapping ranges before counting so each index is counted only once.
4297
4636
  *
4298
4637
  * @param inputDateCellRange - one or more cells/ranges to analyze
4638
+ * @returns count, total, and average statistics for the given ranges
4299
4639
  */ function dateCellRangeBlocksCountInfo(inputDateCellRange) {
4300
4640
  var group = groupToDateCellRanges(util.asArray(inputDateCellRange));
4301
4641
  var count = 0;
@@ -4318,6 +4658,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4318
4658
  * Shorthand for `dateCellRangeBlocksCountInfo(input).count`.
4319
4659
  *
4320
4660
  * @param inputDateCellRange - one or more cells/ranges to count
4661
+ * @returns the total number of individual cell indexes
4321
4662
  *
4322
4663
  * @example
4323
4664
  * ```ts
@@ -4332,13 +4673,14 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4332
4673
  * grouped range from `ranges` fully covers a given input range.
4333
4674
  *
4334
4675
  * @param ranges - the covering ranges to test against
4676
+ * @returns a function that returns true when any single grouped range fully covers the input range
4335
4677
  */ function dateCellRangesFullyCoverDateCellRangeFunction(ranges) {
4336
4678
  var groupedRanges = Array.isArray(ranges) ? groupToDateCellRanges(ranges) : [
4337
4679
  dateCellRangeWithRange(ranges)
4338
4680
  ];
4339
4681
  return function(inputRange) {
4340
4682
  var fn = dateCellRangeIncludedByRangeFunction(inputRange);
4341
- return groupedRanges.findIndex(fn) !== -1;
4683
+ return groupedRanges.some(fn);
4342
4684
  };
4343
4685
  }
4344
4686
  /**
@@ -4349,6 +4691,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4349
4691
  * nearest future range's starting index is used.
4350
4692
  *
4351
4693
  * @param input - the current index and ranges to evaluate
4694
+ * @returns classification of ranges as past/present/future and the next upcoming index
4352
4695
  *
4353
4696
  * @example
4354
4697
  * ```ts
@@ -4405,6 +4748,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4405
4748
  *
4406
4749
  * @param range - the date cell range to classify
4407
4750
  * @param nowIndex - the reference index representing "now"
4751
+ * @returns 'past', 'present', or 'future' depending on the range's position relative to `nowIndex`
4408
4752
  */ function dateRelativeStateForDateCellRangeComparedToIndex(range, nowIndex) {
4409
4753
  var _dateCellRange = dateCellRange(range.i, range.to), i = _dateCellRange.i, to = _dateCellRange.to;
4410
4754
  var state;
@@ -4422,6 +4766,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4422
4766
  * from `i` to `to` (inclusive). Each copy retains all properties of the original block.
4423
4767
  *
4424
4768
  * @param block - the range to expand
4769
+ * @returns an array of single-cell copies, one per index from `i` to `to`
4425
4770
  *
4426
4771
  * @example
4427
4772
  * ```ts
@@ -4440,6 +4785,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4440
4785
  * Returns true if the input spans more than one cell (i.e., has a `to` value strictly greater than `i`).
4441
4786
  *
4442
4787
  * @param input - range or cell to check
4788
+ * @returns true if `to` is defined and strictly greater than `i`
4443
4789
  */ function dateCellRangeHasRange(input) {
4444
4790
  return input.to != null && input.to > input.i;
4445
4791
  }
@@ -4447,6 +4793,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4447
4793
  * Returns the effective ending index of a range: `to` if defined, otherwise `i`.
4448
4794
  *
4449
4795
  * @param input - range or cell to read
4796
+ * @returns the `to` index if defined, otherwise `i`
4450
4797
  */ function dateCellEndIndex(input) {
4451
4798
  var _input_to;
4452
4799
  return (_input_to = input.to) !== null && _input_to !== void 0 ? _input_to : input.i;
@@ -4457,8 +4804,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4457
4804
  * and `to` is the maximum ending index across all blocks.
4458
4805
  *
4459
4806
  * @param input - cells or ranges to group
4807
+ * @returns a UniqueDateCellRangeGroup containing the sorted blocks with `i` at 0
4460
4808
  */ function groupUniqueDateCells(input) {
4461
- var blocks = sortDateCellRanges(_to_consumable_array$2(input));
4809
+ var blocks = sortDateCellRanges(_to_consumable_array$4(input));
4462
4810
  var i = 0;
4463
4811
  var to;
4464
4812
  if (blocks.length === 0) {
@@ -4479,6 +4827,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4479
4827
  * according to the provided configuration. Handles overlap resolution, gap filling, and boundary clamping.
4480
4828
  *
4481
4829
  * @param config - controls start/end bounds, fill strategy, and overlap retention behavior
4830
+ * @returns a function that merges, fills, and resolves overlaps in date cell range arrays
4482
4831
  *
4483
4832
  * @example
4484
4833
  * ```ts
@@ -4496,9 +4845,10 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4496
4845
  var retainOnOverlap = inputRetainOnOverlap !== null && inputRetainOnOverlap !== void 0 ? inputRetainOnOverlap : 'next';
4497
4846
  var maxAllowedIndex = endAtIndex !== null && endAtIndex !== void 0 ? endAtIndex : Number.MAX_SAFE_INTEGER;
4498
4847
  var fillFactory = inputFillFactory;
4499
- if (!fillFactory && fill === 'fill') {
4848
+ if (!inputFillFactory && fill === 'fill') {
4500
4849
  throw new Error('fillFactory is required when fillOption is "fill".');
4501
4850
  }
4851
+ // eslint-disable-next-line sonarjs/cognitive-complexity
4502
4852
  return function(input, newBlocks) {
4503
4853
  var addBlockWithRange = function addBlockWithRange(inputBlock, i) {
4504
4854
  var inputTo = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : i;
@@ -4536,7 +4886,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4536
4886
  to: to
4537
4887
  };
4538
4888
  var block = fillFactory(dateCellRange);
4539
- addBlockWithRange(block, i, to !== null && to !== void 0 ? to : i);
4889
+ addBlockWithRange(block, i, to);
4540
4890
  } else if (fill === 'empty') ; else if (blocks.length > 0) {
4541
4891
  // only extend if one or more blocks have been pushed
4542
4892
  var blockToExtend = util.lastValue(blocks);
@@ -4557,6 +4907,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4557
4907
  };
4558
4908
  var shouldRetainCurrentOverNext = /**
4559
4909
  * Used to determine how to handle two neighboring objects.
4910
+ *
4911
+ * @returns true if the current block should be retained over the next block
4560
4912
  */ function shouldRetainCurrentOverNext() {
4561
4913
  if (current.priority === next.priority) {
4562
4914
  return retainOnOverlap === 'current';
@@ -4727,12 +5079,11 @@ function _unsupported_iterable_to_array$5(o, minLen) {
4727
5079
  } else if (fill === 'fill') {
4728
5080
  completeBlocks();
4729
5081
  }
4730
- var result = {
5082
+ return {
4731
5083
  i: 0,
4732
5084
  blocks: blocks,
4733
5085
  discarded: discarded
4734
5086
  };
4735
- return result;
4736
5087
  };
4737
5088
  }
4738
5089
 
@@ -4795,6 +5146,9 @@ function _type_of$3(obj) {
4795
5146
  * When `limitToCompletedIndexes` is true, only indexes whose timing duration has fully elapsed are included,
4796
5147
  * with the max boundary lazily refreshed as time passes.
4797
5148
  *
5149
+ * @param config - Configuration specifying the timing, range fit, and completion constraints.
5150
+ * @returns A factory function that produces a clamped {@link DateCellRangeWithRange} from optional start/end input.
5151
+ *
4798
5152
  * @example
4799
5153
  * ```ts
4800
5154
  * const timing = dateCellTiming({ startsAt, duration: 60 }, 5);
@@ -4870,6 +5224,10 @@ function _type_of$3(obj) {
4870
5224
  * Computes a {@link DateCellRangeWithRange} from a timing and optional start/end input.
4871
5225
  *
4872
5226
  * Shorthand for creating a {@link dateCellRangeOfTimingFactory} and immediately invoking it.
5227
+ *
5228
+ * @param config - A {@link DateCellTiming} or full factory configuration.
5229
+ * @param input - Optional start/end boundaries for the range.
5230
+ * @returns A clamped {@link DateCellRangeWithRange} derived from the timing and input.
4873
5231
  */ function dateCellRangeOfTiming(config, input) {
4874
5232
  return dateCellRangeOfTimingFactory(isDateCellTiming(config) ? {
4875
5233
  timing: config
@@ -4880,6 +5238,10 @@ function _type_of$3(obj) {
4880
5238
  * of the timing schedule. Useful for determining which days have already finished.
4881
5239
  *
4882
5240
  * By default fitToTimingRange is true.
5241
+ *
5242
+ * @param timing - The timing schedule to evaluate.
5243
+ * @param config - Optional configuration for the current time reference and range fitting.
5244
+ * @returns A {@link DateCellRangeWithRange} covering only the completed day indexes.
4883
5245
  */ function dateCellTimingCompletedTimeRange(timing, config) {
4884
5246
  var _ref;
4885
5247
  return dateCellRangeOfTiming({
@@ -4893,6 +5255,10 @@ function _type_of$3(obj) {
4893
5255
  * Returns the latest completed day index for a {@link DateCellTiming}.
4894
5256
  *
4895
5257
  * Returns -1 if no days have been completed yet.
5258
+ *
5259
+ * @param timing - The timing schedule to evaluate.
5260
+ * @param now - Optional reference time; defaults to the current time.
5261
+ * @returns The zero-based index of the last fully completed day, or -1 if none.
4896
5262
  */ function dateCellTimingLatestCompletedIndex(timing, now) {
4897
5263
  return dateCellTimingCompletedTimeRange(timing, {
4898
5264
  now: now
@@ -4900,6 +5266,9 @@ function _type_of$3(obj) {
4900
5266
  }
4901
5267
  /**
4902
5268
  * Converts a {@link DateCellRange} (inclusive `to`) to a {@link DateCellIndexRange} (exclusive `maxIndex`).
5269
+ *
5270
+ * @param range - The inclusive date cell range to convert.
5271
+ * @returns A {@link DateCellIndexRange} with exclusive `maxIndex`.
4903
5272
  */ function dateCellRangeToDateCellIndexRange(range) {
4904
5273
  var _range_to;
4905
5274
  return {
@@ -4909,6 +5278,9 @@ function _type_of$3(obj) {
4909
5278
  }
4910
5279
  /**
4911
5280
  * Converts a {@link DateCellIndexRange} (exclusive `maxIndex`) back to a {@link DateCellRangeWithRange} (inclusive `to`).
5281
+ *
5282
+ * @param range - The exclusive date cell index range to convert.
5283
+ * @returns A {@link DateCellRangeWithRange} with inclusive `to`.
4912
5284
  */ function dateCellIndexRangeToDateCellRange(range) {
4913
5285
  return {
4914
5286
  i: range.minIndex,
@@ -4920,6 +5292,11 @@ function _type_of$3(obj) {
4920
5292
  *
4921
5293
  * An arbitrary limit can also be applied. When `fitToTimingRange` is true (default),
4922
5294
  * the limit is intersected with the timing's own range; otherwise the limit is used as-is.
5295
+ *
5296
+ * @param timing - The timing schedule to derive the range from.
5297
+ * @param limit - Optional range input to constrain the output.
5298
+ * @param fitToTimingRange - Whether to intersect the limit with the timing's own range. Defaults to true.
5299
+ * @returns A {@link DateCellIndexRange} representing the computed index bounds.
4923
5300
  */ function dateCellIndexRange(timing, limit) {
4924
5301
  var fitToTimingRange = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
4925
5302
  var indexFactory = dateCellTimingRelativeIndexFactory(timing);
@@ -4948,6 +5325,9 @@ function _type_of$3(obj) {
4948
5325
  * by combining its timing and blocks.
4949
5326
  *
4950
5327
  * Shorthand for calling {@link expandDateCellTiming} with `collection.timing` and `collection.blocks`.
5328
+ *
5329
+ * @param collection - The date cell collection containing timing and blocks to expand.
5330
+ * @returns An array of {@link DateCellDurationSpan} values with concrete start times and durations.
4951
5331
  */ function expandDateCellCollection(collection) {
4952
5332
  return expandDateCellTiming(collection.timing, collection.blocks);
4953
5333
  }
@@ -4955,6 +5335,10 @@ function _type_of$3(obj) {
4955
5335
  * Expands the given blocks into {@link DateCellDurationSpan} values using the provided timing.
4956
5336
  *
4957
5337
  * Shorthand for creating a {@link dateCellTimingExpansionFactory} and immediately invoking it.
5338
+ *
5339
+ * @param timing - The timing schedule providing start times and duration.
5340
+ * @param blocks - The date cell blocks to expand into duration spans.
5341
+ * @returns An array of {@link DateCellDurationSpan} values with concrete start times.
4958
5342
  */ function expandDateCellTiming(timing, blocks) {
4959
5343
  return dateCellTimingExpansionFactory({
4960
5344
  timing: timing
@@ -4968,6 +5352,9 @@ function _type_of$3(obj) {
4968
5352
  * Filtering is applied both at the block level and at the computed duration span level,
4969
5353
  * and evaluation can be capped for performance with large datasets.
4970
5354
  *
5355
+ * @param config - Configuration specifying the timing, range limits, filters, and output caps.
5356
+ * @returns A factory function that expands date cell blocks into {@link DateCellDurationSpan} arrays.
5357
+ *
4971
5358
  * @example
4972
5359
  * ```ts
4973
5360
  * const timing = dateCellTiming({ startsAt, duration: 60 }, 5);
@@ -5065,6 +5452,9 @@ function _type_of$3(obj) {
5065
5452
  * const dateInfo = infoFactory(someDate);
5066
5453
  * console.log(dateInfo.dayIndex); // which day index this date falls on
5067
5454
  * ```
5455
+ *
5456
+ * @param config - Configuration providing the timing and optional range limit.
5457
+ * @returns A factory that computes {@link DateCellDayTimingInfo} for any date or day index.
5068
5458
  */ function dateCellDayTimingInfoFactory(config) {
5069
5459
  var timing = config.timing, rangeLimit = config.rangeLimit;
5070
5460
  var duration = timing.duration;
@@ -5129,8 +5519,11 @@ function _type_of$3(obj) {
5129
5519
  * Type guard that returns true if the input is a {@link DateCellTimingRelativeIndexFactory}.
5130
5520
  *
5131
5521
  * Checks for the presence of `_timing` and `_normalInstance` properties on a function.
5522
+ *
5523
+ * @param input - The value to check.
5524
+ * @returns True if the input is a {@link DateCellTimingRelativeIndexFactory}.
5132
5525
  */ function isDateCellTimingRelativeIndexFactory(input) {
5133
- return typeof input === 'function' && input._timing != null && input._normalInstance != null;
5526
+ return typeof input === 'function' && '_timing' in input && '_normalInstance' in input;
5134
5527
  }
5135
5528
  /**
5136
5529
  * Creates a {@link DateCellTimingRelativeIndexFactory} that converts dates, ISO8601 day strings,
@@ -5158,6 +5551,9 @@ function _type_of$3(obj) {
5158
5551
  * indexFactory._timing; // the original timing
5159
5552
  * indexFactory._normalInstance; // timezone normalizer
5160
5553
  * ```
5554
+ *
5555
+ * @param input - A timing configuration or an existing factory (returned as-is).
5556
+ * @returns A factory that converts dates, ISO8601 day strings, or indexes to zero-based day offsets.
5161
5557
  */ function dateCellTimingRelativeIndexFactory(input) {
5162
5558
  if (isDateCellTimingRelativeIndexFactory(input)) {
5163
5559
  return input;
@@ -5196,6 +5592,9 @@ function _type_of$3(obj) {
5196
5592
  * dates, date ranges, and cell ranges into a flat array of day indexes.
5197
5593
  *
5198
5594
  * Date ranges and cell ranges are expanded to include every index within the range.
5595
+ *
5596
+ * @param indexFactory - The relative index factory used for date-to-index conversion.
5597
+ * @returns A factory that flattens mixed date/range arrays into day index arrays.
5199
5598
  */ function dateCellTimingRelativeIndexArrayFactory(indexFactory) {
5200
5599
  var factory = function factory(input) {
5201
5600
  var inputAsArray = util.asArray(input);
@@ -5237,6 +5636,10 @@ function _type_of$3(obj) {
5237
5636
  * // Get the index for a specific date
5238
5637
  * const index = getRelativeIndexForDateCellTiming(timing, someDate);
5239
5638
  * ```
5639
+ *
5640
+ * @param timing - The timing providing the start date and timezone context.
5641
+ * @param date - A date or index to convert; defaults to the current date/time.
5642
+ * @returns The zero-based day index relative to the timing's start.
5240
5643
  */ function getRelativeIndexForDateCellTiming(timing) {
5241
5644
  var date = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new Date();
5242
5645
  return dateCellTimingRelativeIndexFactory(timing)(date);
@@ -5263,6 +5666,9 @@ function _type_of$3(obj) {
5263
5666
  * // Convert index 3 to a date with a specific reference time
5264
5667
  * const dateForDay3AtNoon = dateFactory(3, noonDate);
5265
5668
  * ```
5669
+ *
5670
+ * @param timing - The timing providing the start date and timezone context.
5671
+ * @returns A factory that maps day indexes to calendar dates preserving the current time-of-day.
5266
5672
  */ function dateCellTimingDateFactory(timing) {
5267
5673
  var _dateCellTimingStartPair = dateCellTimingStartPair(timing), start = _dateCellTimingStartPair.start, normalInstance = _dateCellTimingStartPair.normalInstance;
5268
5674
  var utcStartDate = normalInstance.baseDateToTargetDate(start);
@@ -5278,8 +5684,8 @@ function _type_of$3(obj) {
5278
5684
  if (startUtcHours > nowHours) {
5279
5685
  input += 1;
5280
5686
  }
5281
- var nowWithDateForIndex = dateFns.addHours(utcStartDateWithNowTime, input * util.HOURS_IN_DAY); // add days to apply the correct offset to the target index
5282
- return nowWithDateForIndex;
5687
+ // add days to apply the correct offset to the target index
5688
+ return dateFns.addHours(utcStartDateWithNowTime, input * util.HOURS_IN_DAY);
5283
5689
  }
5284
5690
  };
5285
5691
  factory._timing = timing;
@@ -5296,6 +5702,9 @@ function _type_of$3(obj) {
5296
5702
  * const timing = dateCellTiming({ startsAt, duration: 60 }, 5);
5297
5703
  * const lastIndex = dateCellTimingEndIndex(timing); // 4 (zero-based, 5 days)
5298
5704
  * ```
5705
+ *
5706
+ * @param input - A timing or an existing relative index factory.
5707
+ * @returns The zero-based index of the last day in the schedule.
5299
5708
  */ function dateCellTimingEndIndex(input) {
5300
5709
  var factory = dateCellTimingRelativeIndexFactory(input);
5301
5710
  return factory(factory._timing.end);
@@ -5305,6 +5714,9 @@ function _type_of$3(obj) {
5305
5714
  * for any day index relative to the timing's start.
5306
5715
  *
5307
5716
  * The returned date represents the beginning of the day in the timing's timezone context.
5717
+ *
5718
+ * @param input - A timing or an existing relative index factory.
5719
+ * @returns A factory that maps day indexes to the start-of-day date in the timing's timezone.
5308
5720
  */ function dateCellTimingStartDateFactory(input) {
5309
5721
  var indexFactory = dateCellTimingRelativeIndexFactory(input);
5310
5722
  var _dateCellTimingStartPair = dateCellTimingStartPair(indexFactory._timing), start = _dateCellTimingStartPair.start, normalInstance = _dateCellTimingStartPair.normalInstance;
@@ -5342,6 +5754,10 @@ function dateCellTimingEndDateFactory(input) {
5342
5754
  /**
5343
5755
  * Convenience function that returns the calendar date for a given day index or date
5344
5756
  * relative to the timing. Shorthand for creating a {@link dateCellTimingDateFactory} and invoking it.
5757
+ *
5758
+ * @param timing - The timing providing the start date and timezone context.
5759
+ * @param input - A date or day index to convert.
5760
+ * @returns The calendar date corresponding to the input, preserving current time-of-day.
5345
5761
  */ function getRelativeDateForDateCellTiming(timing, input) {
5346
5762
  return dateCellTimingDateFactory(timing)(input);
5347
5763
  }
@@ -5367,6 +5783,9 @@ function dateCellTimingEndDateFactory(input) {
5367
5783
  * });
5368
5784
  * // result has the same start day and end day, but new time-of-day and 90-minute duration
5369
5785
  * ```
5786
+ *
5787
+ * @param input - Configuration specifying the timing to update, the event source, and which aspects to replace.
5788
+ * @returns A new {@link FullDateCellTiming} with the requested aspects replaced.
5370
5789
  */ function updateDateCellTimingWithDateCellTimingEvent(input) {
5371
5790
  var timing = input.timing, event = input.event, replaceStartDay = input.replaceStartDay, replaceStartsAt = input.replaceStartsAt, startDateDay = input.startDayDate, endOnEvent = input.endOnEvent, replaceDuration = input.replaceDuration;
5372
5791
  var timezone = timing.timezone;
@@ -5383,7 +5802,8 @@ function dateCellTimingEndDateFactory(input) {
5383
5802
  var _dateCellTimingStartPair = dateCellTimingStartPair({
5384
5803
  startsAt: event.startsAt,
5385
5804
  timezone: timezone
5386
- }), eventStartDate = _dateCellTimingStartPair.start, normalInstance = _dateCellTimingStartPair.normalInstance;
5805
+ }), initialEventStartDate = _dateCellTimingStartPair.start, normalInstance = _dateCellTimingStartPair.normalInstance;
5806
+ var eventStartDate = initialEventStartDate;
5387
5807
  if (startDateDay != null) {
5388
5808
  var startDateFactory = dateCellTimingStartDateFactory(timing);
5389
5809
  eventStartDate = startDateFactory(startDateDay);
@@ -5447,6 +5867,9 @@ function dateCellTimingEndDateFactory(input) {
5447
5867
  * isInRange(6); // false - index 6 is outside [2, 5]
5448
5868
  * isInRange(someDate); // converts date to index, then checks containment
5449
5869
  * ```
5870
+ *
5871
+ * @param config - Configuration specifying the reference range and optional timezone context.
5872
+ * @returns A predicate function that checks containment within the configured range.
5450
5873
  */ function isDateWithinDateCellRangeFunction(config) {
5451
5874
  var inputStartsAt = config.startsAt, inputRange = config.range;
5452
5875
  var startsAt = inputStartsAt;
@@ -5467,13 +5890,11 @@ function dateCellTimingEndDateFactory(input) {
5467
5890
  } else {
5468
5891
  rangeInput = inputRange;
5469
5892
  }
5470
- if (!inputStartsAt) {
5471
- if (dateRange && isDateInput) {
5472
- startsAt = {
5473
- startsAt: inputRange,
5474
- timezone: guessCurrentTimezone()
5475
- };
5476
- }
5893
+ if (!inputStartsAt && dateRange && isDateInput) {
5894
+ startsAt = {
5895
+ startsAt: inputRange,
5896
+ timezone: guessCurrentTimezone()
5897
+ };
5477
5898
  }
5478
5899
  if (!startsAt) {
5479
5900
  throw new Error('Invalid isDateWithinDateCellRangeFunction() config. StartsAt date info could not be determined from input.');
@@ -5626,6 +6047,7 @@ function _object_spread_props$6(target, source) {
5626
6047
  * Useful for identifying events or blocks that have already begun relative to a point in time.
5627
6048
  *
5628
6049
  * @param now - Reference time to compare against. Defaults to the current time.
6050
+ * @returns a filter function that returns true for spans whose start time is at or before the reference time
5629
6051
  *
5630
6052
  * @example
5631
6053
  * ```ts
@@ -5644,6 +6066,7 @@ function _object_spread_props$6(target, source) {
5644
6066
  * The inverse of {@link dateCellDurationSpanHasStartedFilterFunction}. Useful for finding upcoming or future events.
5645
6067
  *
5646
6068
  * @param now - Reference time to compare against. Defaults to the current time.
6069
+ * @returns a filter function that returns true for spans whose start time is strictly after the reference time
5647
6070
  *
5648
6071
  * @example
5649
6072
  * ```ts
@@ -5663,6 +6086,7 @@ function _object_spread_props$6(target, source) {
5663
6086
  * Useful for identifying completed events.
5664
6087
  *
5665
6088
  * @param now - Reference time to compare against. Defaults to the current time.
6089
+ * @returns a filter function that returns true for spans whose computed end time is at or before the reference time
5666
6090
  *
5667
6091
  * @example
5668
6092
  * ```ts
@@ -5683,6 +6107,7 @@ function _object_spread_props$6(target, source) {
5683
6107
  * still in progress or have not yet occurred.
5684
6108
  *
5685
6109
  * @param now - Reference time to compare against. Defaults to the current time.
6110
+ * @returns a filter function that returns true for spans whose computed end time is strictly after the reference time
5686
6111
  *
5687
6112
  * @example
5688
6113
  * ```ts
@@ -5704,6 +6129,7 @@ function _object_spread_props$6(target, source) {
5704
6129
  * indices clamped to the range boundaries. Non-overlapping cells are excluded entirely.
5705
6130
  *
5706
6131
  * @param range - The target range to fit cells into.
6132
+ * @returns a reusable function that clamps or filters date cells to the configured range
5707
6133
  *
5708
6134
  * @example
5709
6135
  * ```ts
@@ -5744,6 +6170,7 @@ function _object_spread_props$6(target, source) {
5744
6170
  *
5745
6171
  * @param range - The target range to fit cells into.
5746
6172
  * @param input - The date cells to clamp or filter.
6173
+ * @returns an array of date cells clamped to the range, with non-overlapping cells removed
5747
6174
  *
5748
6175
  * @example
5749
6176
  * ```ts
@@ -5758,6 +6185,7 @@ function _object_spread_props$6(target, source) {
5758
6185
  *
5759
6186
  * @param range - The target range to fit the cell into.
5760
6187
  * @param input - The single date cell to clamp or exclude.
6188
+ * @returns the clamped date cell, or `undefined` if it does not overlap the range
5761
6189
  *
5762
6190
  * @example
5763
6191
  * ```ts
@@ -5772,7 +6200,7 @@ function _object_spread_props$6(target, source) {
5772
6200
  ])[0];
5773
6201
  }
5774
6202
 
5775
- function _array_like_to_array$4(arr, len) {
6203
+ function _array_like_to_array$5(arr, len) {
5776
6204
  if (len == null || len > arr.length) len = arr.length;
5777
6205
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5778
6206
  return arr2;
@@ -5780,6 +6208,9 @@ function _array_like_to_array$4(arr, len) {
5780
6208
  function _array_with_holes$2(arr) {
5781
6209
  if (Array.isArray(arr)) return arr;
5782
6210
  }
6211
+ function _array_without_holes$3(arr) {
6212
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
6213
+ }
5783
6214
  function _instanceof(left, right) {
5784
6215
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5785
6216
  return !!right[Symbol.hasInstance](left);
@@ -5787,6 +6218,9 @@ function _instanceof(left, right) {
5787
6218
  return left instanceof right;
5788
6219
  }
5789
6220
  }
6221
+ function _iterable_to_array$3(iter) {
6222
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6223
+ }
5790
6224
  function _iterable_to_array_limit$2(arr, i) {
5791
6225
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
5792
6226
  if (_i == null) return;
@@ -5814,16 +6248,22 @@ function _iterable_to_array_limit$2(arr, i) {
5814
6248
  function _non_iterable_rest$2() {
5815
6249
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5816
6250
  }
6251
+ function _non_iterable_spread$3() {
6252
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6253
+ }
5817
6254
  function _sliced_to_array$2(arr, i) {
5818
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$2();
6255
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
5819
6256
  }
5820
- function _unsupported_iterable_to_array$4(o, minLen) {
6257
+ function _to_consumable_array$3(arr) {
6258
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
6259
+ }
6260
+ function _unsupported_iterable_to_array$5(o, minLen) {
5821
6261
  if (!o) return;
5822
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
6262
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
5823
6263
  var n = Object.prototype.toString.call(o).slice(8, -1);
5824
6264
  if (n === "Object" && o.constructor) n = o.constructor.name;
5825
6265
  if (n === "Map" || n === "Set") return Array.from(n);
5826
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
6266
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
5827
6267
  }
5828
6268
  /**
5829
6269
  * Used for default YearWeekCode values
@@ -5929,8 +6369,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
5929
6369
  * @param input - timezone string, config, or instance
5930
6370
  * @returns the resolved normal instance
5931
6371
  */ function yearWeekCodeDateTimezoneInstance(input) {
5932
- var normal = input ? _instanceof(input, DateTimezoneUtcNormalInstance) ? input : dateTimezoneUtcNormal(input) : SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE;
5933
- return normal;
6372
+ return input ? _instanceof(input, DateTimezoneUtcNormalInstance) ? input : dateTimezoneUtcNormal(input) : SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE;
5934
6373
  }
5935
6374
  function yearWeekCode(dateOrYear, inputWeek) {
5936
6375
  return yearWeekCodeFactory({
@@ -5982,6 +6421,7 @@ function yearWeekCode(dateOrYear, inputWeek) {
5982
6421
  *
5983
6422
  * @param dateRange - the range to compute week codes for
5984
6423
  * @param dateRangeTimezone - the timezone context for accurate week boundary calculation
6424
+ * @returns an array of YearWeekCode values covering the range
5985
6425
  */ function yearWeekCodeForDateRangeInTimezone(dateRange, dateRangeTimezone) {
5986
6426
  return yearWeekCodeForDateRangeFactory(yearWeekCodeFactory({
5987
6427
  timezone: dateRangeTimezone
@@ -6014,6 +6454,7 @@ function yearWeekCode(dateOrYear, inputWeek) {
6014
6454
  * Returns all {@link YearWeekCode} values for the calendar month containing the given date, using the system timezone.
6015
6455
  *
6016
6456
  * @param date - a date within the target month
6457
+ * @returns an array of YearWeekCode values for the month
6017
6458
  */ function yearWeekCodeForCalendarMonth(date) {
6018
6459
  return yearWeekCodeForCalendarMonthFactory(yearWeekCodeFactory({
6019
6460
  timezone: SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE
@@ -6057,8 +6498,8 @@ function yearWeekCode(dateOrYear, inputWeek) {
6057
6498
  var utcYearDate = new Date(Date.UTC(pair.year, 0, 1, 0, 0, 0, 0));
6058
6499
  var systemYearDate = normal.systemDateToBaseDate(utcYearDate); // convert to system before using system date functions
6059
6500
  var date = dateFns.startOfWeek(dateFns.setWeek(systemYearDate, pair.week));
6060
- var fixed = normal.targetDateToSystemDate(date); // back to timezone
6061
- return fixed;
6501
+ // back to timezone
6502
+ return normal.targetDateToSystemDate(date);
6062
6503
  };
6063
6504
  }
6064
6505
  /**
@@ -6112,10 +6553,10 @@ function yearWeekCode(dateOrYear, inputWeek) {
6112
6553
  }
6113
6554
  return yearWeekCode;
6114
6555
  });
6115
- var groups = Array.from(map.entries()).map(function(param) {
6556
+ var groups = _to_consumable_array$3(map.entries()).map(function(param) {
6116
6557
  var _param = _sliced_to_array$2(param, 2), week = _param[0], _$items = _param[1];
6117
6558
  return {
6118
- week: week || 0,
6559
+ week: week !== null && week !== void 0 ? week : 0,
6119
6560
  items: _$items
6120
6561
  };
6121
6562
  });
@@ -6154,8 +6595,7 @@ function yearWeekCode(dateOrYear, inputWeek) {
6154
6595
  var normalInstance = startDateFactory._indexFactory._normalInstance;
6155
6596
  return function(indexOrDate) {
6156
6597
  var dateInSystemTimezone = normalInstance.systemDateToTargetDate(startDateFactory(indexOrDate));
6157
- var yearWeekCode = yearWeekCodeFromDate(dateInSystemTimezone);
6158
- return yearWeekCode;
6598
+ return yearWeekCodeFromDate(dateInSystemTimezone);
6159
6599
  };
6160
6600
  }
6161
6601
  /**
@@ -6166,21 +6606,20 @@ function yearWeekCode(dateOrYear, inputWeek) {
6166
6606
  */ function dateCellIndexYearWeekCodeGroupFactory(config) {
6167
6607
  var dateCellIndexReader = config.dateCellIndexReader, inputDateCellIndexYearWeekCodeFactory = config.dateCellIndexYearWeekCodeFactory;
6168
6608
  var dateCellIndexYearWeekCode = typeof inputDateCellIndexYearWeekCodeFactory === 'function' ? inputDateCellIndexYearWeekCodeFactory : dateCellIndexYearWeekCodeFactory(inputDateCellIndexYearWeekCodeFactory);
6169
- var factory = yearWeekCodeGroupFactory({
6609
+ return yearWeekCodeGroupFactory({
6170
6610
  yearWeekCodeFactory: dateCellIndexYearWeekCode,
6171
6611
  yearWeekCodeReader: dateCellIndexYearWeekCode,
6172
6612
  dateReader: dateCellIndexReader
6173
6613
  });
6174
- return factory;
6175
6614
  }
6176
6615
 
6177
- function _array_like_to_array$3(arr, len) {
6616
+ function _array_like_to_array$4(arr, len) {
6178
6617
  if (len == null || len > arr.length) len = arr.length;
6179
6618
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6180
6619
  return arr2;
6181
6620
  }
6182
- function _array_without_holes$1(arr) {
6183
- if (Array.isArray(arr)) return _array_like_to_array$3(arr);
6621
+ function _array_without_holes$2(arr) {
6622
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
6184
6623
  }
6185
6624
  function _define_property$9(obj, key, value) {
6186
6625
  if (key in obj) {
@@ -6195,10 +6634,10 @@ function _define_property$9(obj, key, value) {
6195
6634
  }
6196
6635
  return obj;
6197
6636
  }
6198
- function _iterable_to_array$1(iter) {
6637
+ function _iterable_to_array$2(iter) {
6199
6638
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6200
6639
  }
6201
- function _non_iterable_spread$1() {
6640
+ function _non_iterable_spread$2() {
6202
6641
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6203
6642
  }
6204
6643
  function _object_spread$7(target) {
@@ -6235,20 +6674,20 @@ function _object_spread_props$5(target, source) {
6235
6674
  }
6236
6675
  return target;
6237
6676
  }
6238
- function _to_consumable_array$1(arr) {
6239
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$1();
6677
+ function _to_consumable_array$2(arr) {
6678
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
6240
6679
  }
6241
6680
  function _type_of$2(obj) {
6242
6681
  "@swc/helpers - typeof";
6243
6682
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
6244
6683
  }
6245
- function _unsupported_iterable_to_array$3(o, minLen) {
6684
+ function _unsupported_iterable_to_array$4(o, minLen) {
6246
6685
  if (!o) return;
6247
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
6686
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
6248
6687
  var n = Object.prototype.toString.call(o).slice(8, -1);
6249
6688
  if (n === "Object" && o.constructor) n = o.constructor.name;
6250
6689
  if (n === "Map" || n === "Set") return Array.from(n);
6251
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
6690
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
6252
6691
  }
6253
6692
  /**
6254
6693
  * Encodes days of the week as numeric codes for use in schedule filtering.
@@ -6313,7 +6752,7 @@ function _unsupported_iterable_to_array$3(o, minLen) {
6313
6752
  * @param input - schedule day codes to convert (WEEKDAY/WEEKEND shorthand codes are expanded)
6314
6753
  * @returns an EnabledDays object with boolean flags for each day
6315
6754
  */ function enabledDaysFromDateCellScheduleDayCodes(input) {
6316
- var days = expandDateCellScheduleDayCodesToDayOfWeekSet(Array.from(new Set(input)));
6755
+ var days = expandDateCellScheduleDayCodesToDayOfWeekSet(_to_consumable_array$2(new Set(input)));
6317
6756
  return util.enabledDaysFromDaysOfWeek(days);
6318
6757
  }
6319
6758
  /**
@@ -6461,7 +6900,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6461
6900
  * @param input - day codes to expand
6462
6901
  * @returns sorted array of individual day codes (1-7 only, no shorthand)
6463
6902
  */ function expandDateCellScheduleDayCodes(input) {
6464
- return Array.from(expandDateCellScheduleDayCodesToDayCodesSet(input)).sort(util.sortNumbersAscendingFunction);
6903
+ return _to_consumable_array$2(expandDateCellScheduleDayCodesToDayCodesSet(input)).sort(util.sortNumbersAscendingFunction);
6465
6904
  }
6466
6905
  /**
6467
6906
  * Expands the input DateCellScheduleDayCodesInput to a Set of individual DateCellScheduleDayCode values (1-7), expanding shorthand codes like WEEKDAY and WEEKEND.
@@ -6499,7 +6938,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6499
6938
  var dayCodes;
6500
6939
  switch(typeof input === "undefined" ? "undefined" : _type_of$2(input)){
6501
6940
  case 'string':
6502
- dayCodes = Array.from(new Set(input)).map(function(x) {
6941
+ dayCodes = _to_consumable_array$2(new Set(input)).map(function(x) {
6503
6942
  return Number(x);
6504
6943
  });
6505
6944
  break;
@@ -6509,7 +6948,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6509
6948
  ];
6510
6949
  break;
6511
6950
  default:
6512
- dayCodes = Array.from(input);
6951
+ dayCodes = _to_consumable_array$2(input);
6513
6952
  break;
6514
6953
  }
6515
6954
  return dayCodes.filter(function(x) {
@@ -6618,7 +7057,6 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6618
7057
  var timezone = inputTimezone !== null && inputTimezone !== void 0 ? inputTimezone : requireCurrentTimezone(); // treat input as the current timezone
6619
7058
  var normalInstance = dateTimezoneUtcNormal(timezone);
6620
7059
  var start;
6621
- var end;
6622
7060
  // either start or startsAt is provided
6623
7061
  if (inputStart != null) {
6624
7062
  var startInSystemTimezone = normalInstance.systemDateToTargetDate(inputStart); // start needs to be in the system timezone normal before processing.
@@ -6635,7 +7073,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6635
7073
  }
6636
7074
  }
6637
7075
  // set the end value
6638
- end = inputEnd !== null && inputEnd !== void 0 ? inputEnd : dateFns.addMinutes(start, 1); // default the end to one minute after the start
7076
+ var end = inputEnd !== null && inputEnd !== void 0 ? inputEnd : dateFns.addMinutes(start, 1); // default the end to one minute after the start
6639
7077
  return {
6640
7078
  w: w,
6641
7079
  ex: ex,
@@ -6837,11 +7275,12 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6837
7275
  * filter(5); // false (Saturday Jan 11)
6838
7276
  * ```
6839
7277
  */ function dateCellScheduleDateFilter(config) {
7278
+ var _ref;
6840
7279
  var w = config.w, inputStart = config.start, inputStartsAt = config.startsAt, inputEnd = config.end, inputTimezone = config.timezone, _config_setStartAsMinDate = config.setStartAsMinDate, setStartAsMinDate = _config_setStartAsMinDate === void 0 ? true : _config_setStartAsMinDate, minMaxDateRange = config.minMaxDateRange;
6841
7280
  var timezone = inputTimezone !== null && inputTimezone !== void 0 ? inputTimezone : requireCurrentTimezone(); // if the timezone is not provided, assume the startsAt is a system timezone normal.
6842
7281
  var normalInstance = dateTimezoneUtcNormal(timezone);
6843
7282
  // derive the startsAt time for the range. If not provided, defaults to inputStart, or midnight today in the target timezone.
6844
- var startsAt = inputStartsAt != null ? inputStartsAt : inputStart !== null && inputStart !== void 0 ? inputStart : normalInstance.startOfDayInTargetTimezone();
7283
+ var startsAt = (_ref = inputStartsAt !== null && inputStartsAt !== void 0 ? inputStartsAt : inputStart) !== null && _ref !== void 0 ? _ref : normalInstance.startOfDayInTargetTimezone();
6845
7284
  var allowedDays = expandDateCellScheduleDayCodesToDayOfWeekSet(w);
6846
7285
  var startsAtInSystem = normalInstance.systemDateToTargetDate(startsAt); // convert to the system date
6847
7286
  var firstDateDay = dateFns.getDay(startsAtInSystem);
@@ -6867,15 +7306,13 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6867
7306
  var excludedIndexes = new Set(config.ex);
6868
7307
  var fn = function fn(input) {
6869
7308
  var i;
6870
- var day;
6871
7309
  if (typeof input === 'number') {
6872
7310
  i = input;
6873
7311
  } else {
6874
7312
  i = _dateCellTimingRelativeIndexFactory(input);
6875
7313
  }
6876
- day = dayForIndex(i);
6877
- var result = i >= minAllowedIndex && i <= maxAllowedIndex && allowedDays.has(day) && !excludedIndexes.has(i) || includedIndexes.has(i);
6878
- return result;
7314
+ var day = dayForIndex(i);
7315
+ return i >= minAllowedIndex && i <= maxAllowedIndex && allowedDays.has(day) && !excludedIndexes.has(i) || includedIndexes.has(i);
6879
7316
  };
6880
7317
  fn._dateCellTimingRelativeIndexFactory = _dateCellTimingRelativeIndexFactory;
6881
7318
  return fn;
@@ -6929,6 +7366,8 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6929
7366
  * Creates a DateCellScheduleDateCellTimingFilter that tests whether a DateCell block's index is allowed by the schedule within the given timing.
6930
7367
  *
6931
7368
  * @param config - timing and schedule to build the filter from
7369
+ * @param config.timing - the DateCellTiming that defines the date range and event times for the filter
7370
+ * @param config.schedule - the DateCellSchedule that controls which day codes and indices are included or excluded
6932
7371
  * @returns a decision function returning true for allowed blocks
6933
7372
  */ function dateCellScheduleDateCellTimingFilter(param) {
6934
7373
  var timing = param.timing, schedule = param.schedule;
@@ -6952,7 +7391,6 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6952
7391
  * @returns an expansion factory that converts DateCellRange arrays into filtered DateCellDurationSpan arrays
6953
7392
  */ function expandDateCellScheduleFactory(config) {
6954
7393
  var _config_invertSchedule = config.invertSchedule, invertSchedule = _config_invertSchedule === void 0 ? false : _config_invertSchedule, now = config.now, onlyBlocksThatHaveEnded = config.onlyBlocksThatHaveEnded, onlyBlocksThatHaveStarted = config.onlyBlocksThatHaveStarted, onlyBlocksNotYetEnded = config.onlyBlocksNotYetEnded, onlyBlocksNotYetStarted = config.onlyBlocksNotYetStarted, maxDateCellsToReturn = config.maxDateCellsToReturn, inputDurationSpanFilter = config.durationSpanFilter;
6955
- var durationSpanFilter;
6956
7394
  var durationSpanFilters = [];
6957
7395
  if (inputDurationSpanFilter) {
6958
7396
  durationSpanFilters.push(inputDurationSpanFilter);
@@ -6969,14 +7407,13 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
6969
7407
  durationSpanFilters.push(dateCellDurationSpanHasNotEndedFilterFunction(now));
6970
7408
  }
6971
7409
  }
6972
- durationSpanFilter = util.mergeFilterFunctions.apply(void 0, _to_consumable_array$1(durationSpanFilters));
6973
- var expansionFactory = dateCellTimingExpansionFactory({
7410
+ var durationSpanFilter = util.mergeFilterFunctions.apply(void 0, _to_consumable_array$2(durationSpanFilters));
7411
+ return dateCellTimingExpansionFactory({
6974
7412
  timing: config.timing,
6975
7413
  filter: util.invertFilter(dateCellScheduleDateCellTimingFilter(config), invertSchedule),
6976
7414
  durationSpanFilter: durationSpanFilter,
6977
7415
  maxDateCellsToReturn: maxDateCellsToReturn
6978
7416
  });
6979
- return expansionFactory;
6980
7417
  }
6981
7418
  /**
6982
7419
  * Expands a DateCellTiming and DateCellSchedule into concrete DateCellDurationSpan values representing each active block in the event.
@@ -7062,16 +7499,155 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7062
7499
  });
7063
7500
  }
7064
7501
 
7502
+ function _define_property$8(obj, key, value) {
7503
+ if (key in obj) {
7504
+ Object.defineProperty(obj, key, {
7505
+ value: value,
7506
+ enumerable: true,
7507
+ configurable: true,
7508
+ writable: true
7509
+ });
7510
+ } else {
7511
+ obj[key] = value;
7512
+ }
7513
+ return obj;
7514
+ }
7515
+ function _object_spread$6(target) {
7516
+ for(var i = 1; i < arguments.length; i++){
7517
+ var source = arguments[i] != null ? arguments[i] : {};
7518
+ var ownKeys = Object.keys(source);
7519
+ if (typeof Object.getOwnPropertySymbols === "function") {
7520
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7521
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7522
+ }));
7523
+ }
7524
+ ownKeys.forEach(function(key) {
7525
+ _define_property$8(target, key, source[key]);
7526
+ });
7527
+ }
7528
+ return target;
7529
+ }
7530
+ /**
7531
+ * Distinguishes between time-based calendar events and all-day/multi-day events.
7532
+ */ exports.CalendarDateType = void 0;
7533
+ (function(CalendarDateType) {
7534
+ /**
7535
+ * Event starts at a specific time and lasts for a certain duration.
7536
+ */ CalendarDateType["TIME"] = "time";
7537
+ /**
7538
+ * Event is specifically for a number of days. Duration is still tracked in minutes.
7539
+ */ CalendarDateType["DAYS"] = "days";
7540
+ })(exports.CalendarDateType || (exports.CalendarDateType = {}));
7541
+ /**
7542
+ * Creates a {@link CalendarDateFactory} that produces all-day calendar events with timezone-aware start times.
7543
+ *
7544
+ * The factory converts an ISO 8601 day string to a UTC date, then applies timezone normalization
7545
+ * so the resulting `startsAt` represents the correct moment for the target timezone.
7546
+ *
7547
+ * @param config - optional timezone configuration
7548
+ * @returns a factory function that creates CalendarDate objects
7549
+ *
7550
+ * @example
7551
+ * ```ts
7552
+ * const factory = calendarDateFactory({ timezone: 'America/Denver' });
7553
+ * const event = factory('2024-01-15', 3);
7554
+ * // event.type === CalendarDateType.DAYS
7555
+ * // event.duration === daysToMinutes(3)
7556
+ * ```
7557
+ */ function calendarDateFactory(config) {
7558
+ var normalConfig = (config === null || config === void 0 ? void 0 : config.timezone) === undefined ? {
7559
+ useSystemTimezone: true
7560
+ } : {
7561
+ timezone: config.timezone ? config.timezone : undefined
7562
+ };
7563
+ var normal = dateTimezoneUtcNormal(normalConfig);
7564
+ return function(day, days) {
7565
+ var date = util.parseISO8601DayStringToUTCDate(day);
7566
+ var startsAt = normal.targetDateToBaseDate(date);
7567
+ return {
7568
+ type: exports.CalendarDateType.DAYS,
7569
+ startsAt: startsAt,
7570
+ duration: daysToMinutes(days)
7571
+ };
7572
+ };
7573
+ }
7574
+ /**
7575
+ * Convenience function that creates a single all-day {@link CalendarDate} with optional timezone.
7576
+ *
7577
+ * Shorthand for creating a factory and immediately invoking it.
7578
+ *
7579
+ * @param day - ISO 8601 day string (e.g. '2024-01-15')
7580
+ * @param days - number of days the event spans
7581
+ * @param timezone - IANA timezone string, false for UTC, or undefined for system timezone
7582
+ * @returns a CalendarDate with type DAYS
7583
+ *
7584
+ * @example
7585
+ * ```ts
7586
+ * const event = calendarDate('2024-01-15', 1, 'America/Denver');
7587
+ * // event.type === CalendarDateType.DAYS
7588
+ * ```
7589
+ */ function calendarDate(day, days, timezone) {
7590
+ return calendarDateFactory({
7591
+ timezone: timezone
7592
+ })(day, days);
7593
+ }
7594
+ /**
7595
+ * Wraps an existing {@link DateDurationSpan} as a time-based {@link CalendarDate}.
7596
+ *
7597
+ * @param dateDurationSpan - the duration span to wrap
7598
+ * @returns a CalendarDate with type TIME
7599
+ *
7600
+ * @example
7601
+ * ```ts
7602
+ * const span: DateDurationSpan = { startsAt: new Date(), duration: 60 };
7603
+ * const event = calendarDateForDateDurationSpan(span);
7604
+ * // event.type === CalendarDateType.TIME
7605
+ * ```
7606
+ */ function calendarDateForDateDurationSpan(dateDurationSpan) {
7607
+ return _object_spread$6({
7608
+ type: exports.CalendarDateType.TIME
7609
+ }, dateDurationSpan);
7610
+ }
7611
+
7612
+ function _array_like_to_array$3(arr, len) {
7613
+ if (len == null || len > arr.length) len = arr.length;
7614
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7615
+ return arr2;
7616
+ }
7617
+ function _array_without_holes$1(arr) {
7618
+ if (Array.isArray(arr)) return _array_like_to_array$3(arr);
7619
+ }
7620
+ function _iterable_to_array$1(iter) {
7621
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
7622
+ }
7623
+ function _non_iterable_spread$1() {
7624
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7625
+ }
7626
+ function _to_consumable_array$1(arr) {
7627
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$1();
7628
+ }
7629
+ function _unsupported_iterable_to_array$3(o, minLen) {
7630
+ if (!o) return;
7631
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
7632
+ var n = Object.prototype.toString.call(o).slice(8, -1);
7633
+ if (n === "Object" && o.constructor) n = o.constructor.name;
7634
+ if (n === "Map" || n === "Set") return Array.from(n);
7635
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
7636
+ }
7065
7637
  /**
7066
7638
  * Returns all recognized IANA timezone strings, including the explicit UTC entry.
7067
7639
  *
7640
+ * @returns all known IANA timezone strings plus UTC
7641
+ *
7068
7642
  * @example
7069
7643
  * ```ts
7070
7644
  * const zones = allTimezoneStrings();
7071
7645
  * // ['Africa/Abidjan', ..., 'UTC']
7072
7646
  * ```
7073
7647
  */ function allTimezoneStrings() {
7074
- return tzdb.timeZonesNames.concat(util.UTC_TIMEZONE_STRING);
7648
+ return _to_consumable_array$1(tzdb.timeZonesNames).concat([
7649
+ util.UTC_TIMEZONE_STRING
7650
+ ]);
7075
7651
  }
7076
7652
  /**
7077
7653
  * Lazily-computed set of all known timezone strings for O(1) membership checks.
@@ -7097,6 +7673,8 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7097
7673
  /**
7098
7674
  * Returns the {@link TimezoneInfo} for the current system timezone, falling back to UTC.
7099
7675
  *
7676
+ * @returns timezone info for the current system timezone
7677
+ *
7100
7678
  * @example
7101
7679
  * ```ts
7102
7680
  * const info = timezoneInfoForSystem();
@@ -7112,6 +7690,10 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7112
7690
  * The date matters because abbreviations change with DST transitions.
7113
7691
  * Returns `"UKNOWN"` if no timezone is provided.
7114
7692
  *
7693
+ * @param timezone - the IANA timezone string (or UTC abbreviation) to get the abbreviation for
7694
+ * @param date - the date at which to evaluate the abbreviation (defaults to now)
7695
+ * @returns the short timezone abbreviation
7696
+ *
7115
7697
  * @example
7116
7698
  * ```ts
7117
7699
  * getTimezoneAbbreviation('America/New_York'); // 'EST' or 'EDT'
@@ -7125,6 +7707,10 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7125
7707
  *
7126
7708
  * Returns `"Unknown Timezone"` if no timezone is provided.
7127
7709
  *
7710
+ * @param timezone - the IANA timezone string to get the long name for
7711
+ * @param date - the date at which to evaluate the name (defaults to now)
7712
+ * @returns the full timezone display name
7713
+ *
7128
7714
  * @example
7129
7715
  * ```ts
7130
7716
  * getTimezoneLongName('America/New_York'); // 'Eastern Standard Time'
@@ -7136,6 +7722,10 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7136
7722
  /**
7137
7723
  * Builds a {@link TimezoneInfo} for the given timezone, computing abbreviation and search variants.
7138
7724
  *
7725
+ * @param timezone - the IANA timezone string to build info for
7726
+ * @param date - the date at which to evaluate the abbreviation (defaults to now)
7727
+ * @returns the computed TimezoneInfo
7728
+ *
7139
7729
  * @example
7140
7730
  * ```ts
7141
7731
  * const info = timezoneStringToTimezoneInfo('America/Chicago');
@@ -7145,14 +7735,13 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7145
7735
  */ function timezoneStringToTimezoneInfo(timezone) {
7146
7736
  var date = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new Date();
7147
7737
  var abbreviation = getTimezoneAbbreviation(timezone, date);
7148
- var result = {
7738
+ return {
7149
7739
  timezone: timezone,
7150
7740
  search: timezoneStringToSearchableString(timezone),
7151
7741
  lowercase: timezone.toLowerCase(),
7152
7742
  abbreviation: abbreviation,
7153
7743
  lowercaseAbbreviation: abbreviation.toLowerCase()
7154
7744
  };
7155
- return result;
7156
7745
  }
7157
7746
  /**
7158
7747
  * Filters timezone infos by a search string, matching against the searchable name,
@@ -7160,6 +7749,10 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7160
7749
  *
7161
7750
  * For queries longer than 2 characters, substring matching on the searchable name is also used.
7162
7751
  *
7752
+ * @param search - the search query string
7753
+ * @param infos - the array of TimezoneInfo objects to filter
7754
+ * @returns the matching TimezoneInfo entries
7755
+ *
7163
7756
  * @example
7164
7757
  * ```ts
7165
7758
  * const results = searchTimezoneInfos('eastern', allTimezoneInfos());
@@ -7182,6 +7775,9 @@ var timezoneStringToSearchableStringReplace = util.replaceStringsFunction({
7182
7775
  *
7183
7776
  * Replaces `/` and `_` with spaces (e.g., `"America/New_York"` becomes `"america new york"`).
7184
7777
  *
7778
+ * @param timezone - the IANA timezone string to convert
7779
+ * @returns the searchable lowercase string
7780
+ *
7185
7781
  * @example
7186
7782
  * ```ts
7187
7783
  * timezoneStringToSearchableString('America/New_York'); // 'america new york'
@@ -7194,6 +7790,9 @@ var timezoneStringToSearchableStringReplace = util.replaceStringsFunction({
7194
7790
  *
7195
7791
  * Uses the cached set from {@link allKnownTimezoneStrings} for O(1) lookup.
7196
7792
  *
7793
+ * @param input - the string to check
7794
+ * @returns whether the input is a known timezone
7795
+ *
7197
7796
  * @example
7198
7797
  * ```ts
7199
7798
  * isKnownTimezone('America/New_York'); // true
@@ -7203,116 +7802,6 @@ var timezoneStringToSearchableStringReplace = util.replaceStringsFunction({
7203
7802
  return allKnownTimezoneStrings().has(input);
7204
7803
  }
7205
7804
 
7206
- function _define_property$8(obj, key, value) {
7207
- if (key in obj) {
7208
- Object.defineProperty(obj, key, {
7209
- value: value,
7210
- enumerable: true,
7211
- configurable: true,
7212
- writable: true
7213
- });
7214
- } else {
7215
- obj[key] = value;
7216
- }
7217
- return obj;
7218
- }
7219
- function _object_spread$6(target) {
7220
- for(var i = 1; i < arguments.length; i++){
7221
- var source = arguments[i] != null ? arguments[i] : {};
7222
- var ownKeys = Object.keys(source);
7223
- if (typeof Object.getOwnPropertySymbols === "function") {
7224
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7225
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7226
- }));
7227
- }
7228
- ownKeys.forEach(function(key) {
7229
- _define_property$8(target, key, source[key]);
7230
- });
7231
- }
7232
- return target;
7233
- }
7234
- /**
7235
- * Distinguishes between time-based calendar events and all-day/multi-day events.
7236
- */ exports.CalendarDateType = void 0;
7237
- (function(CalendarDateType) {
7238
- /**
7239
- * Event starts at a specific time and lasts for a certain duration.
7240
- */ CalendarDateType["TIME"] = "time";
7241
- /**
7242
- * Event is specifically for a number of days. Duration is still tracked in minutes.
7243
- */ CalendarDateType["DAYS"] = "days";
7244
- })(exports.CalendarDateType || (exports.CalendarDateType = {}));
7245
- /**
7246
- * Creates a {@link CalendarDateFactory} that produces all-day calendar events with timezone-aware start times.
7247
- *
7248
- * The factory converts an ISO 8601 day string to a UTC date, then applies timezone normalization
7249
- * so the resulting `startsAt` represents the correct moment for the target timezone.
7250
- *
7251
- * @param config - optional timezone configuration
7252
- * @returns a factory function that creates CalendarDate objects
7253
- *
7254
- * @example
7255
- * ```ts
7256
- * const factory = calendarDateFactory({ timezone: 'America/Denver' });
7257
- * const event = factory('2024-01-15', 3);
7258
- * // event.type === CalendarDateType.DAYS
7259
- * // event.duration === daysToMinutes(3)
7260
- * ```
7261
- */ function calendarDateFactory(config) {
7262
- var normalConfig = (config === null || config === void 0 ? void 0 : config.timezone) === undefined ? {
7263
- useSystemTimezone: true
7264
- } : {
7265
- timezone: config.timezone ? config.timezone : undefined
7266
- };
7267
- var normal = dateTimezoneUtcNormal(normalConfig);
7268
- return function(day, days) {
7269
- var date = util.parseISO8601DayStringToUTCDate(day);
7270
- var startsAt = normal.targetDateToBaseDate(date);
7271
- return {
7272
- type: exports.CalendarDateType.DAYS,
7273
- startsAt: startsAt,
7274
- duration: daysToMinutes(days)
7275
- };
7276
- };
7277
- }
7278
- /**
7279
- * Convenience function that creates a single all-day {@link CalendarDate} with optional timezone.
7280
- *
7281
- * Shorthand for creating a factory and immediately invoking it.
7282
- *
7283
- * @param day - ISO 8601 day string (e.g. '2024-01-15')
7284
- * @param days - number of days the event spans
7285
- * @param timezone - IANA timezone string, false for UTC, or undefined for system timezone
7286
- * @returns a CalendarDate with type DAYS
7287
- *
7288
- * @example
7289
- * ```ts
7290
- * const event = calendarDate('2024-01-15', 1, 'America/Denver');
7291
- * // event.type === CalendarDateType.DAYS
7292
- * ```
7293
- */ function calendarDate(day, days, timezone) {
7294
- return calendarDateFactory({
7295
- timezone: timezone
7296
- })(day, days);
7297
- }
7298
- /**
7299
- * Wraps an existing {@link DateDurationSpan} as a time-based {@link CalendarDate}.
7300
- *
7301
- * @param dateDurationSpan - the duration span to wrap
7302
- * @returns a CalendarDate with type TIME
7303
- *
7304
- * @example
7305
- * ```ts
7306
- * const span: DateDurationSpan = { startsAt: new Date(), duration: 60 };
7307
- * const event = calendarDateForDateDurationSpan(span);
7308
- * // event.type === CalendarDateType.TIME
7309
- * ```
7310
- */ function calendarDateForDateDurationSpan(dateDurationSpan) {
7311
- return _object_spread$6({
7312
- type: exports.CalendarDateType.TIME
7313
- }, dateDurationSpan);
7314
- }
7315
-
7316
7805
  function _array_like_to_array$2(arr, len) {
7317
7806
  if (len == null || len > arr.length) len = arr.length;
7318
7807
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -7352,7 +7841,7 @@ var _type, _type1;
7352
7841
  * const result = knownTimezoneType('America/Denver');
7353
7842
  * ```
7354
7843
  */ var knownTimezoneType = arktype.type('string > 0').narrow(function(val, ctx) {
7355
- return val != null && isKnownTimezone(val) || ctx.mustBe('a known timezone');
7844
+ return isKnownTimezone(val) || ctx.mustBe('a known timezone');
7356
7845
  });
7357
7846
  // MARK: DateDurationSpan
7358
7847
  /**
@@ -7466,21 +7955,21 @@ var _type, _type1;
7466
7955
  * Accepts both Date objects and date strings (parsed via `string.date.parse`), then validates the resulting timing
7467
7956
  * using {@link isValidDateCellTiming}.
7468
7957
  */ var validDateCellTimingType = dateCellTimingType.narrow(function(val, ctx) {
7469
- return val != null && isValidDateCellTiming(val) || ctx.mustBe('a valid DateCellTiming');
7958
+ return isValidDateCellTiming(val) || ctx.mustBe('a valid DateCellTiming');
7470
7959
  });
7471
7960
  /**
7472
7961
  * ArkType DTO schema that validates a value is a valid {@link DateCellRange} (non-negative indexes, `to >= i`).
7473
7962
  *
7474
7963
  * Validates cell range data from JSON/DTO input.
7475
7964
  */ var validDateCellRangeType = dateCellRangeType.narrow(function(val, ctx) {
7476
- return val != null && isValidDateCellRange(val) || ctx.mustBe('a valid DateCellRange');
7965
+ return isValidDateCellRange(val) || ctx.mustBe('a valid DateCellRange');
7477
7966
  });
7478
7967
  /**
7479
7968
  * ArkType DTO schema that validates a value is a sorted array of non-overlapping {@link DateCellRange} values.
7480
7969
  *
7481
7970
  * Validates cell range series data from JSON/DTO input.
7482
7971
  */ var validDateCellRangeSeriesType = arktype.type(dateCellRangeType.array()).narrow(function(val, ctx) {
7483
- return val != null && isValidDateCellRangeSeries(val) || ctx.mustBe('a valid DateCellRange series with items sorted in ascending order and no repeat indexes');
7972
+ return isValidDateCellRangeSeries(val) || ctx.mustBe('a valid DateCellRange series with items sorted in ascending order and no repeat indexes');
7484
7973
  });
7485
7974
 
7486
7975
  function _assert_this_initialized$1(self) {
@@ -7760,7 +8249,7 @@ function _object_spread_props$4(target, source) {
7760
8249
  logicalDate = 'now';
7761
8250
  }
7762
8251
  var intervalPeriod = period !== null && period !== void 0 ? period : util.MS_IN_SECOND;
7763
- var factory = inputFactory ? inputFactory : util.protectedFactory(logicalDateStringCodeDateFactory(logicalDate));
8252
+ var factory = inputFactory !== null && inputFactory !== void 0 ? inputFactory : util.protectedFactory(logicalDateStringCodeDateFactory(logicalDate));
7764
8253
  var obs = rxjs.interval(intervalPeriod, scheduler).pipe(rxjs.startWith(-1), rxjs.map(factory));
7765
8254
  if (emitAll !== true) {
7766
8255
  obs = obs.pipe(rxjs.distinctUntilChanged(isSameDate));
@@ -7852,7 +8341,8 @@ function _define_property$6(obj, key, value) {
7852
8341
  {
7853
8342
  key: "instant",
7854
8343
  get: function get() {
7855
- return this._config.instant || 'now';
8344
+ var _this__config_instant;
8345
+ return (_this__config_instant = this._config.instant) !== null && _this__config_instant !== void 0 ? _this__config_instant : 'now';
7856
8346
  }
7857
8347
  },
7858
8348
  {
@@ -7897,10 +8387,8 @@ function _define_property$6(obj, key, value) {
7897
8387
  var _this__config = this._config, _this__config_instant = _this__config.instant, instant = _this__config_instant === void 0 ? new Date() : _this__config_instant, _this__config_limits = _this__config.limits, limits = _this__config_limits === void 0 ? {} : _this__config_limits;
7898
8388
  var isPast = limits.isPast, max = limits.max;
7899
8389
  var limit = max;
7900
- if (typeof max !== 'string' && isPast) {
7901
- if (!max || dateFns.isBefore(max, instant)) {
7902
- limit = util.DATE_NOW_VALUE;
7903
- }
8390
+ if (typeof max !== 'string' && isPast && (!max || dateFns.isBefore(max, instant))) {
8391
+ limit = util.DATE_NOW_VALUE;
7904
8392
  }
7905
8393
  return limit;
7906
8394
  }
@@ -7915,6 +8403,8 @@ function _define_property$6(obj, key, value) {
7915
8403
  * const limiter = new LimitDateTimeInstance({ limits: { isFuture: true } });
7916
8404
  * const range = limiter.dateRange(); // { start: <now>, end: undefined }
7917
8405
  * ```
8406
+ *
8407
+ * @returns A partial {@link DateRange} with `start` and/or `end` derived from the limits.
7918
8408
  */ key: "dateRange",
7919
8409
  value: function dateRange() {
7920
8410
  var _this__config = this._config, _this__config_instant = _this__config.instant, instant = _this__config_instant === void 0 ? new Date() : _this__config_instant;
@@ -7927,6 +8417,7 @@ function _define_property$6(obj, key, value) {
7927
8417
  * like "now" or relative future offsets to resolve against the given moment.
7928
8418
  *
7929
8419
  * @param instant - The reference point in time for resolving dynamic limits.
8420
+ * @returns A partial {@link DateRange} resolved against the given instant.
7930
8421
  */ key: "dateRangeForInstant",
7931
8422
  value: function dateRangeForInstant(instant) {
7932
8423
  var _this = this, min = _this.min, max = _this.max;
@@ -7950,6 +8441,8 @@ function _define_property$6(obj, key, value) {
7950
8441
  * });
7951
8442
  * const safe = limiter.clamp(new Date()); // at least 30 minutes from now
7952
8443
  * ```
8444
+ *
8445
+ * @returns The clamped date within the allowed range.
7953
8446
  */ key: "clamp",
7954
8447
  value: function clamp(date) {
7955
8448
  var result = date;
@@ -7987,6 +8480,8 @@ function _define_property$6(obj, key, value) {
7987
8480
  * const clamped = limiter.clampDateRange({ start: pastDate, end: futureDate });
7988
8481
  * // clamped.start will be at least now
7989
8482
  * ```
8483
+ *
8484
+ * @returns The date range clamped to the allowed limits.
7990
8485
  */ key: "clampDateRange",
7991
8486
  value: function clampDateRange(dateRange) {
7992
8487
  return clampDateRangeToDateRange(dateRange, this.dateRange());
@@ -8008,6 +8503,8 @@ function _define_property$6(obj, key, value) {
8008
8503
  * });
8009
8504
  * const clamped = limiter.clamp(someDate);
8010
8505
  * ```
8506
+ *
8507
+ * @returns A new {@link LimitDateTimeInstance}.
8011
8508
  */ function limitDateTimeInstance(config) {
8012
8509
  return new LimitDateTimeInstance(config);
8013
8510
  }
@@ -8099,14 +8596,14 @@ function _object_spread_props$3(target, source) {
8099
8596
  function DateTimeMinuteInstance() {
8100
8597
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, dateOverride = arguments.length > 1 ? arguments[1] : void 0;
8101
8598
  _class_call_check$5(this, DateTimeMinuteInstance);
8102
- var _config_step;
8599
+ var _ref, _config_step;
8103
8600
  _define_property$5(this, "_config", void 0);
8104
8601
  _define_property$5(this, "_date", void 0);
8105
8602
  _define_property$5(this, "_step", void 0);
8106
8603
  _define_property$5(this, "_limit", void 0);
8107
8604
  _define_property$5(this, "_dateFilter", void 0);
8108
8605
  this._config = config;
8109
- this._date = (dateOverride == undefined ? config.date : dateOverride) || new Date();
8606
+ this._date = (_ref = dateOverride !== null && dateOverride !== void 0 ? dateOverride : config.date) !== null && _ref !== void 0 ? _ref : new Date();
8110
8607
  this._step = (_config_step = config.step) !== null && _config_step !== void 0 ? _config_step : 1;
8111
8608
  this._limit = new LimitDateTimeInstance(config);
8112
8609
  this._dateFilter = config.schedule ? dateCellScheduleDateFilter(config.schedule) : undefined;
@@ -8140,6 +8637,8 @@ function _object_spread_props$3(target, source) {
8140
8637
  key: "limitInstance",
8141
8638
  get: /**
8142
8639
  * Returns the LimitDateTimeInstance. This does not take the schedule into consideration.
8640
+ *
8641
+ * @returns The underlying {@link LimitDateTimeInstance}.
8143
8642
  */ function get() {
8144
8643
  return this._limit;
8145
8644
  }
@@ -8162,6 +8661,8 @@ function _object_spread_props$3(target, source) {
8162
8661
  * // true if June 15 is a weekday and overlaps the limit range
8163
8662
  * instance.dateDayContainsValidDateValue(new Date('2024-06-15'));
8164
8663
  * ```
8664
+ *
8665
+ * @returns `true` if the day contains at least one valid date/time value.
8165
8666
  */ key: "dateDayContainsValidDateValue",
8166
8667
  value: function dateDayContainsValidDateValue(date) {
8167
8668
  var isInSchedule = this.dateIsInSchedule(date);
@@ -8200,6 +8701,8 @@ function _object_spread_props$3(target, source) {
8200
8701
  *
8201
8702
  * instance.isInValidRange(new Date('2024-06-15T10:00:00')); // true if a weekday
8202
8703
  * ```
8704
+ *
8705
+ * @returns `true` if the date is within the min/max limits and on a scheduled day.
8203
8706
  */ key: "isInValidRange",
8204
8707
  value: function isInValidRange(date) {
8205
8708
  var result = this.getStatus(date);
@@ -8222,6 +8725,8 @@ function _object_spread_props$3(target, source) {
8222
8725
  *
8223
8726
  * instance.isValid(new Date('2099-03-15T10:00:00')); // true if all constraints pass
8224
8727
  * ```
8728
+ *
8729
+ * @returns `true` if the date passes all configured constraints.
8225
8730
  */ key: "isValid",
8226
8731
  value: function isValid(date) {
8227
8732
  var result = this.getStatus(date);
@@ -8245,6 +8750,8 @@ function _object_spread_props$3(target, source) {
8245
8750
  * // status.isAfterMinimum === false (before min)
8246
8751
  * // status.inFuture === false (if date is in the past)
8247
8752
  * ```
8753
+ *
8754
+ * @returns A {@link DateTimeMinuteDateStatus} snapshot for the given date.
8248
8755
  */ key: "getStatus",
8249
8756
  value: function getStatus() {
8250
8757
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date;
@@ -8303,6 +8810,8 @@ function _object_spread_props$3(target, source) {
8303
8810
  *
8304
8811
  * instance.dateIsInSchedule(new Date('2024-06-15')); // true (Saturday = false)
8305
8812
  * ```
8813
+ *
8814
+ * @returns `true` if the date is on a scheduled day or no schedule is configured.
8306
8815
  */ key: "dateIsInSchedule",
8307
8816
  value: function dateIsInSchedule() {
8308
8817
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date;
@@ -8327,6 +8836,8 @@ function _object_spread_props$3(target, source) {
8327
8836
  * instance.round({ roundToSteps: true }); // 2024-06-15T09:00:00
8328
8837
  * instance.round({ roundToSteps: true, roundToBound: true }); // clamped to min if below
8329
8838
  * ```
8839
+ *
8840
+ * @returns The rounded (and optionally clamped) date.
8330
8841
  */ key: "round",
8331
8842
  value: function round(round) {
8332
8843
  var _round_step;
@@ -8356,6 +8867,8 @@ function _object_spread_props$3(target, source) {
8356
8867
  *
8357
8868
  * instance.clamp(new Date('2024-05-25')); // clamped to min, then nearest weekday
8358
8869
  * ```
8870
+ *
8871
+ * @returns The date clamped to both the limits and the schedule.
8359
8872
  */ key: "clamp",
8360
8873
  value: function clamp() {
8361
8874
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date, maxClampDistance = arguments.length > 1 ? arguments[1] : void 0;
@@ -8376,6 +8889,8 @@ function _object_spread_props$3(target, source) {
8376
8889
  *
8377
8890
  * instance.clampToLimit(new Date('2025-03-01')); // returns max (2024-12-31)
8378
8891
  * ```
8892
+ *
8893
+ * @returns The date clamped to the configured min/max limits.
8379
8894
  */ key: "clampToLimit",
8380
8895
  value: function clampToLimit() {
8381
8896
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date;
@@ -8400,6 +8915,8 @@ function _object_spread_props$3(target, source) {
8400
8915
  * // If June 15, 2024 is a Saturday, returns the next Monday
8401
8916
  * instance.clampToSchedule(new Date('2024-06-15'));
8402
8917
  * ```
8918
+ *
8919
+ * @returns The nearest valid scheduled date, or the input date if already valid or no schedule is configured.
8403
8920
  */ key: "clampToSchedule",
8404
8921
  value: function clampToSchedule() {
8405
8922
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date, maxClampDistance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 370;
@@ -8434,9 +8951,7 @@ function _object_spread_props$3(target, source) {
8434
8951
  }
8435
8952
  }
8436
8953
  // set a default from the given input if applicable
8437
- if (nextAvailableDate == null) {
8438
- nextAvailableDate = this.clampToLimit(date);
8439
- }
8954
+ nextAvailableDate !== null && nextAvailableDate !== void 0 ? nextAvailableDate : nextAvailableDate = this.clampToLimit(date);
8440
8955
  }
8441
8956
  }
8442
8957
  return nextAvailableDate !== null && nextAvailableDate !== void 0 ? nextAvailableDate : date;
@@ -8461,6 +8976,8 @@ function _object_spread_props$3(target, source) {
8461
8976
  * // Find the next weekday after a Saturday
8462
8977
  * instance.findNextAvailableDayInSchedule(new Date('2024-06-15'), 'future');
8463
8978
  * ```
8979
+ *
8980
+ * @returns The next valid schedule date, or `undefined` if none found within the max distance.
8464
8981
  */ key: "findNextAvailableDayInSchedule",
8465
8982
  value: function findNextAvailableDayInSchedule(date, direction) {
8466
8983
  var maxDistance = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 370;
@@ -8496,6 +9013,8 @@ function _object_spread_props$3(target, source) {
8496
9013
  * instance.isInSchedule(new Date('2024-06-17')); // true (Monday)
8497
9014
  * instance.isInSchedule(new Date('2024-06-16')); // false (Sunday)
8498
9015
  * ```
9016
+ *
9017
+ * @returns `true` if the date is on a scheduled day or no schedule is configured.
8499
9018
  */ key: "isInSchedule",
8500
9019
  value: function isInSchedule(date) {
8501
9020
  return this._dateFilter ? this._dateFilter(date) : true;
@@ -8555,6 +9074,8 @@ function _object_spread_props$3(target, source) {
8555
9074
  *
8556
9075
  * isValid(new Date('2024-06-17T10:00:00')); // true if future weekday after min
8557
9076
  * ```
9077
+ *
9078
+ * @returns A decision function that returns `true` for valid dates.
8558
9079
  */ function dateTimeMinuteDecisionFunction(config) {
8559
9080
  var instance = new DateTimeMinuteInstance(config, null);
8560
9081
  return function(date) {
@@ -8587,6 +9108,8 @@ function _object_spread_props$3(target, source) {
8587
9108
  * // true only if both 00:00 and 23:59 on June 15 pass all constraints
8588
9109
  * isFullDayValid(new Date('2024-06-15'));
8589
9110
  * ```
9111
+ *
9112
+ * @returns A decision function that returns `true` for valid days.
8590
9113
  */ function dateTimeMinuteWholeDayDecisionFunction(config) {
8591
9114
  var startAndEndOfDayMustBeValid = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
8592
9115
  var instance = new DateTimeMinuteInstance(config, null);
@@ -8671,6 +9194,7 @@ function _object_spread_props$2(target, source) {
8671
9194
  * guaranteeing that `raw` and `result` are defined.
8672
9195
  *
8673
9196
  * @param result - The parse result to check.
9197
+ * @returns `true` if the result is valid, narrowing the type to {@link ValidDateFromTimestringResult}.
8674
9198
  *
8675
9199
  * @example
8676
9200
  * ```ts
@@ -8714,6 +9238,7 @@ function _object_spread_props$2(target, source) {
8714
9238
  *
8715
9239
  * @param date - The date to check. Defaults to now.
8716
9240
  * @param timezone - Overrides the instance's configured timezone for this call.
9241
+ * @returns {@link TimeAM.AM} or {@link TimeAM.PM} depending on the time of day.
8717
9242
  *
8718
9243
  * @example
8719
9244
  * ```ts
@@ -8733,6 +9258,7 @@ function _object_spread_props$2(target, source) {
8733
9258
  *
8734
9259
  * @param date - The date to format.
8735
9260
  * @param timezone - Overrides the instance's configured timezone for this call.
9261
+ * @returns The formatted time string (e.g., "1:30PM").
8736
9262
  *
8737
9263
  * @example
8738
9264
  * ```ts
@@ -8827,18 +9353,35 @@ function _object_spread_props$2(target, source) {
8827
9353
  'h:mm',
8828
9354
  'HH:mm' // 01:20
8829
9355
  ];
8830
- // tslint:disable-next-line: prefer-for-of
8831
- for(var i = 0; i < formats.length; i += 1){
8832
- systemParsedDateTime = dateFns.parse(input, formats[i], relativeDate);
8833
- if (dateFns.isValid(systemParsedDateTime)) {
8834
- valid = true;
8835
- break; // Use time.
9356
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
9357
+ try {
9358
+ // tslint:disable-next-line: prefer-for-of
9359
+ for(var _iterator = formats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
9360
+ var format = _step.value;
9361
+ systemParsedDateTime = dateFns.parse(input, format, relativeDate);
9362
+ if (dateFns.isValid(systemParsedDateTime)) {
9363
+ valid = true;
9364
+ break; // Use time.
9365
+ }
9366
+ }
9367
+ } catch (err) {
9368
+ _didIteratorError = true;
9369
+ _iteratorError = err;
9370
+ } finally{
9371
+ try {
9372
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
9373
+ _iterator.return();
9374
+ }
9375
+ } finally{
9376
+ if (_didIteratorError) {
9377
+ throw _iteratorError;
9378
+ }
8836
9379
  }
8837
9380
  }
8838
9381
  var removedPm = false;
8839
9382
  function removeAmPm(inputString) {
8840
9383
  inputString = inputString.toLowerCase();
8841
- removedPm = inputString.indexOf('pm') !== -1;
9384
+ removedPm = inputString.includes('pm');
8842
9385
  inputString = inputString.replace(/am|pm/g, '');
8843
9386
  return inputString;
8844
9387
  }
@@ -8938,6 +9481,8 @@ function _object_spread_props$2(target, source) {
8938
9481
  /**
8939
9482
  * Creates a {@link DateTimeUtilityInstance} configured for UTC.
8940
9483
  *
9484
+ * @returns A new {@link DateTimeUtilityInstance} using the UTC timezone.
9485
+ *
8941
9486
  * @example
8942
9487
  * ```ts
8943
9488
  * const utcInstance = dateTimeInstanceUtc();
@@ -8951,6 +9496,7 @@ function _object_spread_props$2(target, source) {
8951
9496
  * Defaults to UTC when no timezone is provided.
8952
9497
  *
8953
9498
  * @param timezone - The IANA timezone identifier (e.g., 'America/New_York').
9499
+ * @returns A new {@link DateTimeUtilityInstance} for the specified timezone.
8954
9500
  *
8955
9501
  * @example
8956
9502
  * ```ts
@@ -8965,6 +9511,7 @@ function _object_spread_props$2(target, source) {
8965
9511
  *
8966
9512
  * @param date - The date to check. Defaults to now.
8967
9513
  * @param timezone - The IANA timezone to evaluate in. Defaults to UTC.
9514
+ * @returns {@link TimeAM.AM} or {@link TimeAM.PM} depending on the time of day.
8968
9515
  *
8969
9516
  * @example
8970
9517
  * ```ts
@@ -8982,6 +9529,7 @@ function _object_spread_props$2(target, source) {
8982
9529
  * unlike {@link toReadableTimeString} which defaults to UTC.
8983
9530
  *
8984
9531
  * @param date - The date to format.
9532
+ * @returns The formatted time string in the system's local timezone.
8985
9533
  *
8986
9534
  * @example
8987
9535
  * ```ts
@@ -8995,6 +9543,7 @@ function _object_spread_props$2(target, source) {
8995
9543
  *
8996
9544
  * @param date - The date to format.
8997
9545
  * @param timezone - The IANA timezone to format in. Defaults to UTC.
9546
+ * @returns The formatted time string (e.g., "10:30AM").
8998
9547
  *
8999
9548
  * @example
9000
9549
  * ```ts
@@ -9010,6 +9559,7 @@ function _object_spread_props$2(target, source) {
9010
9559
  *
9011
9560
  * @param input - A time string such as "1:30PM", "13:30", or "1PM".
9012
9561
  * @param config - Optional configuration specifying the timezone and reference date.
9562
+ * @returns The parsed time string result, or `undefined` if parsing failed.
9013
9563
  *
9014
9564
  * @example
9015
9565
  * ```ts
@@ -9028,6 +9578,7 @@ function _object_spread_props$2(target, source) {
9028
9578
  *
9029
9579
  * @param input - A time string such as "1:30PM" or "13:30".
9030
9580
  * @param config - Optional configuration specifying the timezone and reference date.
9581
+ * @returns The resolved date, or `undefined` if the input could not be parsed.
9031
9582
  *
9032
9583
  * @example
9033
9584
  * ```ts
@@ -9041,6 +9592,7 @@ function _object_spread_props$2(target, source) {
9041
9592
  * Creates a {@link LimitDateTimeInstance} for clamping and constraining dates to a configured range.
9042
9593
  *
9043
9594
  * @param config - The limit configuration specifying min/max bounds, future requirements, etc.
9595
+ * @returns A new {@link LimitDateTimeInstance} configured with the given bounds.
9044
9596
  *
9045
9597
  * @example
9046
9598
  * ```ts
@@ -9150,6 +9702,7 @@ function _object_spread_props$1(target, source) {
9150
9702
  date: dateFnsTz.toZonedTime(find.range.date, find.timezone)
9151
9703
  }) : find.range;
9152
9704
  var dates = dateRange(range);
9705
+ // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
9153
9706
  switch(range.type){
9154
9707
  case exports.DateRangeType.DAY:
9155
9708
  case exports.DateRangeType.WEEK:
@@ -9345,13 +9898,12 @@ function _object_spread$1(target) {
9345
9898
  // A single field that manages start/end will start and end at the same instant (end = start)
9346
9899
  // so we merge the gte/lte values.
9347
9900
  var merged = mergeMongoDBLikeRangeFilters(startsAt, endsAt);
9348
- startsAtFilter = merged ? _define_property$2({}, fields.start, merged) : undefined;
9901
+ startsAtFilter = _define_property$2({}, fields.start, merged);
9349
9902
  } else {
9350
9903
  startsAtFilter = startsAt ? _define_property$2({}, fields.start, startsAt) : undefined;
9351
9904
  endsAtFilter = endsAt && fields.end ? _define_property$2({}, fields.end, endsAt) : undefined;
9352
9905
  }
9353
- var filter = _object_spread$1({}, startsAtFilter, endsAtFilter);
9354
- return filter;
9906
+ return _object_spread$1({}, startsAtFilter, endsAtFilter);
9355
9907
  }
9356
9908
  };
9357
9909
  }
@@ -9474,6 +10026,8 @@ function _is_native_reflect_construct() {
9474
10026
  * const rule = new DateRRule({ freq: RRule.DAILY, count: 5, dtstart: startDate });
9475
10027
  * const lastDate = rule.last(); // fifth occurrence
9476
10028
  * ```
10029
+ *
10030
+ * @returns The last occurrence date, or `undefined` if there are none.
9477
10031
  */ key: "last",
9478
10032
  value: function last() {
9479
10033
  return this._iter(new LastIterResult());
@@ -9488,6 +10042,9 @@ function _is_native_reflect_construct() {
9488
10042
  * const rule = new DateRRule({ freq: RRule.WEEKLY, dtstart: startDate });
9489
10043
  * const nextDate = rule.next(new Date());
9490
10044
  * ```
10045
+ *
10046
+ * @param minDate - The earliest date to consider.
10047
+ * @returns The first occurrence on or after `minDate`, or `undefined` if none.
9491
10048
  */ key: "next",
9492
10049
  value: function next(minDate) {
9493
10050
  return this._iter(new NextIterResult(minDate));
@@ -9502,6 +10059,11 @@ function _is_native_reflect_construct() {
9502
10059
  * const rule = new DateRRule({ freq: RRule.DAILY, dtstart: startDate });
9503
10060
  * const exists = rule.any({ minDate: rangeStart, maxDate: rangeEnd });
9504
10061
  * ```
10062
+ *
10063
+ * @param filter - Optional date bounds with `minDate` and `maxDate`.
10064
+ * @param filter.minDate - Optional minimum date bound.
10065
+ * @param filter.maxDate - Optional maximum date bound.
10066
+ * @returns `true` if at least one recurrence falls within the bounds.
9505
10067
  */ key: "any",
9506
10068
  value: function any() {
9507
10069
  var filter = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -9762,7 +10324,10 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9762
10324
  /**
9763
10325
  * Delimiter separating the property name/params from values in an RRule line.
9764
10326
  */ var RRULE_STRING_SPLITTER = ':';
9765
- /** @deprecated use RRULE_STRING_SPLITTER instead. */ var RRuleStringSplitter = RRULE_STRING_SPLITTER;
10327
+ /**
10328
+ * @deprecated use RRULE_STRING_SPLITTER instead.
10329
+ */ // eslint-disable-next-line @typescript-eslint/naming-convention
10330
+ var RRuleStringSplitter = RRULE_STRING_SPLITTER;
9766
10331
  /**
9767
10332
  * Utility class for parsing and manipulating RFC 5545 RRule strings.
9768
10333
  *
@@ -9793,6 +10358,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9793
10358
  * // result.basic = ['RRULE:FREQ=DAILY']
9794
10359
  * // result.exdates contains the parsed exclusion dates
9795
10360
  * ```
10361
+ *
10362
+ * @param input - The RRule string line set to separate.
10363
+ * @returns The separated basic rules and parsed EXDATE exclusion dates.
9796
10364
  */ function separateRRuleStringSetValues(input) {
9797
10365
  var basic = [];
9798
10366
  var exdateRules = [];
@@ -9822,6 +10390,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9822
10390
  /**
9823
10391
  * Parses an EXDATE line into its timezone and date components.
9824
10392
  *
10393
+ * @param line - The raw EXDATE line string to parse.
10394
+ * @returns The parsed EXDATE attribute with timezone and dates.
9825
10395
  * @throws Error if the line is not an EXDATE property.
9826
10396
  */ function parseExdateAttributeFromLine(line) {
9827
10397
  var property = this.parseProperty(line);
@@ -9833,6 +10403,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9833
10403
  key: "parseExdateAttributeFromProperty",
9834
10404
  value: /**
9835
10405
  * Extracts timezone and UTC-normalized dates from an already-parsed EXDATE property.
10406
+ *
10407
+ * @param property - The parsed EXDATE property to extract from.
10408
+ * @returns The EXDATE attribute containing timezone and UTC-normalized dates.
9836
10409
  */ function parseExdateAttributeFromProperty(property) {
9837
10410
  var _property_params_find;
9838
10411
  var timezone = (_property_params_find = property.params.find(function(x) {
@@ -9856,6 +10429,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9856
10429
  value: /**
9857
10430
  * Convenience wrapper that creates a timezone converter and delegates to {@link parseDateTimeString}.
9858
10431
  *
10432
+ * @param rfcDateString - The RFC 5545 date or date-time string to parse.
10433
+ * @param timezone - Optional timezone for non-UTC date strings.
10434
+ * @returns The parsed JavaScript Date.
9859
10435
  * @throws Error if the date string is not UTC and no timezone is provided.
9860
10436
  */ function parseDateTimeStringWithTimezone(rfcDateString, timezone) {
9861
10437
  return DateRRuleParseUtility.parseDateTimeString(rfcDateString, timezone ? new DateTimezoneUtcNormalInstance({
@@ -9871,6 +10447,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9871
10447
  * If the string does not end in `Z` (indicating UTC), the converter is used to normalize
9872
10448
  * the local date representation to its true UTC equivalent.
9873
10449
  *
10450
+ * @param rfcDateString - The RFC 5545 date or date-time string to parse.
10451
+ * @param converter - Optional timezone converter for non-UTC date strings.
10452
+ * @returns The parsed JavaScript Date.
9874
10453
  * @throws Error if the string cannot be parsed or a non-UTC string lacks a converter.
9875
10454
  */ function parseDateTimeString(rfcDateString, converter) {
9876
10455
  var RFC5545_DATE_TIME_FORMAT = /^((\d{4})(\d{2})(\d{2}))(T(\d{2})(\d{2})(\d{2})Z?)?$/;
@@ -9914,6 +10493,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9914
10493
  * DateRRuleParseUtility.formatDateTimeString(new Date('2021-06-11T11:00:00Z'));
9915
10494
  * // => '20210611T110000Z'
9916
10495
  * ```
10496
+ *
10497
+ * @param date - The date to format.
10498
+ * @returns The RFC 5545 UTC date-time string representation.
9917
10499
  */ function formatDateTimeString(date) {
9918
10500
  return dateFnsTz.format(date, "yyyyMMdd'T'HHmmss'Z'");
9919
10501
  }
@@ -9922,6 +10504,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9922
10504
  key: "parseProperty",
9923
10505
  value: /**
9924
10506
  * Parses a full RRule line string into a structured {@link RRuleProperty}.
10507
+ *
10508
+ * @param line - The raw RRule line string to parse.
10509
+ * @returns The structured property with type, params, and values.
9925
10510
  */ function parseProperty(line) {
9926
10511
  var rawLine = DateRRuleParseUtility.parseRawLine(line);
9927
10512
  return DateRRuleParseUtility.propertyFromRawLine(rawLine);
@@ -9931,6 +10516,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9931
10516
  key: "propertyFromRawLine",
9932
10517
  value: /**
9933
10518
  * Converts an {@link RRuleRawLine} into a structured {@link RRuleProperty} by splitting the type and params.
10519
+ *
10520
+ * @param rawLine - The raw line to convert.
10521
+ * @returns The structured property with separated type, params, and values.
9934
10522
  */ function propertyFromRawLine(rawLine) {
9935
10523
  var typeAndParams = rawLine.params.split(';');
9936
10524
  var type = typeAndParams[0].toUpperCase();
@@ -9946,6 +10534,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9946
10534
  key: "parseRawParam",
9947
10535
  value: /**
9948
10536
  * Splits a raw param string (e.g., `"TZID=America/New_York"`) into key-value form.
10537
+ *
10538
+ * @param param - The raw param string to split.
10539
+ * @returns The parsed key-value param.
9949
10540
  */ function parseRawParam(param) {
9950
10541
  var _splitJoinRemainder = _sliced_to_array$1(util.splitJoinRemainder(param, '=', 2), 2), key = _splitJoinRemainder[0], value = _splitJoinRemainder[1];
9951
10542
  return {
@@ -9959,6 +10550,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9959
10550
  value: /**
9960
10551
  * Splits a raw line at the colon delimiter into params and values portions.
9961
10552
  * Falls back to treating a single-segment line as an RRULE value.
10553
+ *
10554
+ * @param line - The raw RRule line string to split.
10555
+ * @returns The raw line with separated params and values.
9962
10556
  */ function parseRawLine(line) {
9963
10557
  var _splitJoinRemainder = _sliced_to_array$1(util.splitJoinRemainder(line, RRULE_STRING_SPLITTER, 2), 2), params = _splitJoinRemainder[0], values = _splitJoinRemainder[1];
9964
10558
  var result;
@@ -9981,6 +10575,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9981
10575
  value: // MARK: String
9982
10576
  /**
9983
10577
  * Splits a newline-delimited RRule string into individual line strings.
10578
+ *
10579
+ * @param lines - The newline-delimited RRule string to split.
10580
+ * @returns An array of individual RRule line strings.
9984
10581
  */ function toRRuleStringSet(lines) {
9985
10582
  return lines.split('\n');
9986
10583
  }
@@ -9989,6 +10586,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9989
10586
  key: "toRRuleLines",
9990
10587
  value: /**
9991
10588
  * Joins an array of RRule line strings into a single newline-delimited string.
10589
+ *
10590
+ * @param rruleStringSet - The array of RRule line strings to join.
10591
+ * @returns A single newline-delimited RRule string.
9992
10592
  */ function toRRuleLines(rruleStringSet) {
9993
10593
  return rruleStringSet.join('\n');
9994
10594
  }
@@ -9999,6 +10599,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9999
10599
  /**
10000
10600
  * Asserts that the property has the expected type, throwing if it does not match.
10001
10601
  *
10602
+ * @param type - The expected property type.
10603
+ * @param property - The property to check.
10002
10604
  * @throws Error if the property type does not match the expected type.
10003
10605
  */ function assertPropertyType(type, property) {
10004
10606
  if (property.type !== type) {
@@ -10139,7 +10741,7 @@ function _unsupported_iterable_to_array(o, minLen) {
10139
10741
  this.options = options;
10140
10742
  var tzid = rrule.origOptions.tzid;
10141
10743
  var dtstart = rrule.origOptions.dtstart;
10142
- var timezone = tzid || options.timezone;
10744
+ var timezone = tzid !== null && tzid !== void 0 ? tzid : options.timezone;
10143
10745
  /**
10144
10746
  * The normal instance for DateRRuleInstance is used backwards in most cases because DateRRule always
10145
10747
  * parses dates as UTC, so we handle all input dates as base dates, an
@@ -10190,8 +10792,7 @@ function _unsupported_iterable_to_array(o, minLen) {
10190
10792
  var from = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
10191
10793
  var baseFrom = this.normalInstance.baseDateToTargetDate(from);
10192
10794
  var rawNext = this.rrule.next(baseFrom);
10193
- var next = rawNext ? this.normalInstance.targetDateToBaseDate(rawNext) : undefined;
10194
- return next;
10795
+ return rawNext ? this.normalInstance.targetDateToBaseDate(rawNext) : undefined;
10195
10796
  }
10196
10797
  },
10197
10798
  {
@@ -10332,11 +10933,12 @@ function _unsupported_iterable_to_array(o, minLen) {
10332
10933
  /**
10333
10934
  * Returns `true` when the underlying RRule has neither a `count` nor an
10334
10935
  * `until` constraint, meaning it recurs indefinitely.
10936
+ *
10937
+ * @returns `true` if the rule recurs indefinitely.
10335
10938
  */ key: "hasForeverRange",
10336
10939
  value: function hasForeverRange() {
10337
10940
  var options = this.rrule.options;
10338
- var forever = !options.count && !options.until;
10339
- return forever;
10941
+ return !options.count && !options.until;
10340
10942
  }
10341
10943
  }
10342
10944
  ], [