@beweco/aurora-ui 0.6.35 → 0.6.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -4080,18 +4080,410 @@ var RowSteps = React.forwardRef(function (_a, ref) {
4080
4080
  });
4081
4081
  RowSteps.displayName = "RowSteps";
4082
4082
 
4083
+ /*
4084
+ * Copyright 2020 Adobe. All rights reserved.
4085
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4086
+ * you may not use this file except in compliance with the License. You may obtain a copy
4087
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
4088
+ *
4089
+ * Unless required by applicable law or agreed to in writing, software distributed under
4090
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
4091
+ * OF ANY KIND, either express or implied. See the License for the specific language
4092
+ * governing permissions and limitations under the License.
4093
+ */ function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
4094
+ return amount - numerator * Math.floor(amount / numerator);
4095
+ }
4096
+
4097
+ /*
4098
+ * Copyright 2020 Adobe. All rights reserved.
4099
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4100
+ * you may not use this file except in compliance with the License. You may obtain a copy
4101
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
4102
+ *
4103
+ * Unless required by applicable law or agreed to in writing, software distributed under
4104
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
4105
+ * OF ANY KIND, either express or implied. See the License for the specific language
4106
+ * governing permissions and limitations under the License.
4107
+ */ // Portions of the code in this file are based on code from ICU.
4108
+ // Original licensing can be found in the NOTICE file in the root directory of this source tree.
4109
+
4110
+
4111
+ const $3b62074eb05584b2$var$EPOCH = 1721426; // 001/01/03 Julian C.E.
4112
+ function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
4113
+ year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
4114
+ let y1 = year - 1;
4115
+ let monthOffset = -2;
4116
+ if (month <= 2) monthOffset = 0;
4117
+ else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;
4118
+ return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
4119
+ }
4120
+ function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
4121
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
4122
+ }
4123
+ function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
4124
+ return era === 'BC' ? 1 - year : year;
4125
+ }
4126
+ function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
4127
+ let era = 'AD';
4128
+ if (year <= 0) {
4129
+ era = 'BC';
4130
+ year = 1 - year;
4131
+ }
4132
+ return [
4133
+ era,
4134
+ year
4135
+ ];
4136
+ }
4137
+ const $3b62074eb05584b2$var$daysInMonth = {
4138
+ standard: [
4139
+ 31,
4140
+ 28,
4141
+ 31,
4142
+ 30,
4143
+ 31,
4144
+ 30,
4145
+ 31,
4146
+ 31,
4147
+ 30,
4148
+ 31,
4149
+ 30,
4150
+ 31
4151
+ ],
4152
+ leapyear: [
4153
+ 31,
4154
+ 29,
4155
+ 31,
4156
+ 30,
4157
+ 31,
4158
+ 30,
4159
+ 31,
4160
+ 31,
4161
+ 30,
4162
+ 31,
4163
+ 30,
4164
+ 31
4165
+ ]
4166
+ };
4167
+ class $3b62074eb05584b2$export$80ee6245ec4f29ec {
4168
+ fromJulianDay(jd) {
4169
+ let jd0 = jd;
4170
+ let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
4171
+ let quadricent = Math.floor(depoch / 146097);
4172
+ let dqc = ($2b4dce13dd5a17fa$export$842a2cf37af977e1)(depoch, 146097);
4173
+ let cent = Math.floor(dqc / 36524);
4174
+ let dcent = ($2b4dce13dd5a17fa$export$842a2cf37af977e1)(dqc, 36524);
4175
+ let quad = Math.floor(dcent / 1461);
4176
+ let dquad = ($2b4dce13dd5a17fa$export$842a2cf37af977e1)(dcent, 1461);
4177
+ let yindex = Math.floor(dquad / 365);
4178
+ let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
4179
+ let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
4180
+ let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
4181
+ let leapAdj = 2;
4182
+ if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
4183
+ else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;
4184
+ let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
4185
+ let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
4186
+ return new ($35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, month, day);
4187
+ }
4188
+ toJulianDay(date) {
4189
+ return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);
4190
+ }
4191
+ getDaysInMonth(date) {
4192
+ return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 'leapyear' : 'standard'][date.month - 1];
4193
+ }
4194
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4195
+ getMonthsInYear(date) {
4196
+ return 12;
4197
+ }
4198
+ getDaysInYear(date) {
4199
+ return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
4200
+ }
4201
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4202
+ getYearsInEra(date) {
4203
+ return 9999;
4204
+ }
4205
+ getEras() {
4206
+ return [
4207
+ 'BC',
4208
+ 'AD'
4209
+ ];
4210
+ }
4211
+ isInverseEra(date) {
4212
+ return date.era === 'BC';
4213
+ }
4214
+ balanceDate(date) {
4215
+ if (date.year <= 0) {
4216
+ date.era = date.era === 'BC' ? 'AD' : 'BC';
4217
+ date.year = 1 - date.year;
4218
+ }
4219
+ }
4220
+ constructor(){
4221
+ this.identifier = 'gregory';
4222
+ }
4223
+ }
4224
+
4225
+ function $14e0f24ef4ac5c92$export$dbc69fd56b53d5e(a, b) {
4226
+ var _a_isEqual, _b_isEqual;
4227
+ var _a_isEqual1, _ref;
4228
+ return (_ref = (_a_isEqual1 = (_a_isEqual = a.isEqual) === null || _a_isEqual === void 0 ? void 0 : _a_isEqual.call(a, b)) !== null && _a_isEqual1 !== void 0 ? _a_isEqual1 : (_b_isEqual = b.isEqual) === null || _b_isEqual === void 0 ? void 0 : _b_isEqual.call(b, a)) !== null && _ref !== void 0 ? _ref : a.identifier === b.identifier;
4229
+ }
4230
+ function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a, b) {
4231
+ return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
4232
+ }
4083
4233
  function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
4084
4234
  return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
4085
4235
  }
4086
4236
  function $14e0f24ef4ac5c92$var$timeToMs(a) {
4087
4237
  return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
4088
4238
  }
4239
+ let $14e0f24ef4ac5c92$var$localTimeZone = null;
4240
+ function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
4241
+ // TODO: invalidate this somehow?
4242
+ if ($14e0f24ef4ac5c92$var$localTimeZone == null) $14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
4243
+ return $14e0f24ef4ac5c92$var$localTimeZone;
4244
+ }
4245
+
4246
+ /*
4247
+ * Copyright 2020 Adobe. All rights reserved.
4248
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4249
+ * you may not use this file except in compliance with the License. You may obtain a copy
4250
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
4251
+ *
4252
+ * Unless required by applicable law or agreed to in writing, software distributed under
4253
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
4254
+ * OF ANY KIND, either express or implied. See the License for the specific language
4255
+ * governing permissions and limitations under the License.
4256
+ */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
4257
+ // Original licensing can be found in the NOTICE file in the root directory of this source tree.
4258
+
4259
+
4260
+
4261
+
4262
+ function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
4263
+ date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
4264
+ let year = ($3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
4265
+ return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
4266
+ }
4267
+ function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
4268
+ // Note: Date.UTC() interprets one and two-digit years as being in the
4269
+ // 20th century, so don't use it
4270
+ let date = new Date();
4271
+ date.setUTCHours(hour, minute, second, millisecond);
4272
+ date.setUTCFullYear(year, month - 1, day);
4273
+ return date.getTime();
4274
+ }
4275
+ function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
4276
+ // Fast path for UTC.
4277
+ if (timeZone === 'UTC') return 0;
4278
+ // Fast path: for local timezone after 1970, use native Date.
4279
+ if (ms > 0 && timeZone === ($14e0f24ef4ac5c92$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -6e4;
4280
+ let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
4281
+ let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
4282
+ return utc - Math.floor(ms / 1000) * 1000;
4283
+ }
4284
+ const $11d87f3f76e88657$var$formattersByTimeZone = new Map();
4285
+ function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
4286
+ let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
4287
+ if (!formatter) {
4288
+ formatter = new Intl.DateTimeFormat('en-US', {
4289
+ timeZone: timeZone,
4290
+ hour12: false,
4291
+ era: 'short',
4292
+ year: 'numeric',
4293
+ month: 'numeric',
4294
+ day: 'numeric',
4295
+ hour: 'numeric',
4296
+ minute: 'numeric',
4297
+ second: 'numeric'
4298
+ });
4299
+ $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
4300
+ }
4301
+ let parts = formatter.formatToParts(new Date(ms));
4302
+ let namedParts = {};
4303
+ for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;
4304
+ return {
4305
+ // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
4306
+ year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,
4307
+ month: +namedParts.month,
4308
+ day: +namedParts.day,
4309
+ hour: namedParts.hour === '24' ? 0 : +namedParts.hour,
4310
+ minute: +namedParts.minute,
4311
+ second: +namedParts.second
4312
+ };
4313
+ }
4314
+ const $11d87f3f76e88657$var$DAYMILLIS = 86400000;
4315
+ function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
4316
+ let found = earlier === later ? [
4317
+ earlier
4318
+ ] : [
4319
+ earlier,
4320
+ later
4321
+ ];
4322
+ return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
4323
+ }
4324
+ function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
4325
+ let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
4326
+ return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
4327
+ }
4328
+ function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
4329
+ let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
4330
+ // Fast path: if the time zone is UTC, use native Date.
4331
+ if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
4332
+ // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
4333
+ if (timeZone === ($14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible') {
4334
+ dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
4335
+ // Don't use Date constructor here because two-digit years are interpreted in the 20th century.
4336
+ let date = new Date();
4337
+ let year = ($3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
4338
+ date.setFullYear(year, dateTime.month - 1, dateTime.day);
4339
+ date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
4340
+ return date.getTime();
4341
+ }
4342
+ let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
4343
+ let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
4344
+ let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
4345
+ let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
4346
+ if (valid.length === 1) return valid[0];
4347
+ if (valid.length > 1) switch(disambiguation){
4348
+ // 'compatible' means 'earlier' for "fall back" transitions
4349
+ case 'compatible':
4350
+ case 'earlier':
4351
+ return valid[0];
4352
+ case 'later':
4353
+ return valid[valid.length - 1];
4354
+ case 'reject':
4355
+ throw new RangeError('Multiple possible absolute times found');
4356
+ }
4357
+ switch(disambiguation){
4358
+ case 'earlier':
4359
+ return Math.min(ms - offsetBefore, ms - offsetAfter);
4360
+ // 'compatible' means 'later' for "spring forward" transitions
4361
+ case 'compatible':
4362
+ case 'later':
4363
+ return Math.max(ms - offsetBefore, ms - offsetAfter);
4364
+ case 'reject':
4365
+ throw new RangeError('No such absolute time found');
4366
+ }
4367
+ }
4368
+ function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
4369
+ return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
4370
+ }
4371
+ function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
4372
+ let hour = 0, minute = 0, second = 0, millisecond = 0;
4373
+ if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
4374
+ else if ('hour' in date && !time) return date;
4375
+ if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
4376
+ return new ($35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
4377
+ }
4378
+ function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
4379
+ if (($14e0f24ef4ac5c92$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
4380
+ let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
4381
+ let copy = date.copy();
4382
+ copy.calendar = calendar;
4383
+ copy.era = calendarDate.era;
4384
+ copy.year = calendarDate.year;
4385
+ copy.month = calendarDate.month;
4386
+ copy.day = calendarDate.day;
4387
+ ($735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
4388
+ return copy;
4389
+ }
4089
4390
 
4391
+ function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
4392
+ let mutableDate = date.copy();
4393
+ let days = 'hour' in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
4394
+ $735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
4395
+ if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
4396
+ mutableDate.month += duration.months || 0;
4397
+ $735220c2d4774dd3$var$balanceYearMonth(mutableDate);
4398
+ $735220c2d4774dd3$var$constrainMonthDay(mutableDate);
4399
+ mutableDate.day += (duration.weeks || 0) * 7;
4400
+ mutableDate.day += duration.days || 0;
4401
+ mutableDate.day += days;
4402
+ $735220c2d4774dd3$var$balanceDay(mutableDate);
4403
+ if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
4404
+ // Constrain in case adding ended up with a date outside the valid range for the calendar system.
4405
+ // The behavior here is slightly different than when constraining in the `set` function in that
4406
+ // we adjust smaller fields to their minimum/maximum values rather than constraining each field
4407
+ // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.
4408
+ if (mutableDate.year < 1) {
4409
+ mutableDate.year = 1;
4410
+ mutableDate.month = 1;
4411
+ mutableDate.day = 1;
4412
+ }
4413
+ let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
4414
+ if (mutableDate.year > maxYear) {
4415
+ var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
4416
+ let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
4417
+ mutableDate.year = maxYear;
4418
+ mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
4419
+ mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
4420
+ }
4421
+ if (mutableDate.month < 1) {
4422
+ mutableDate.month = 1;
4423
+ mutableDate.day = 1;
4424
+ }
4425
+ let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
4426
+ if (mutableDate.month > maxMonth) {
4427
+ mutableDate.month = maxMonth;
4428
+ mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
4429
+ }
4430
+ mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
4431
+ return mutableDate;
4432
+ }
4433
+ function $735220c2d4774dd3$var$addYears(date, years) {
4434
+ var _date_calendar_isInverseEra, _date_calendar;
4435
+ if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date)) years = -years;
4436
+ date.year += years;
4437
+ }
4438
+ function $735220c2d4774dd3$var$balanceYearMonth(date) {
4439
+ while(date.month < 1){
4440
+ $735220c2d4774dd3$var$addYears(date, -1);
4441
+ date.month += date.calendar.getMonthsInYear(date);
4442
+ }
4443
+ let monthsInYear = 0;
4444
+ while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){
4445
+ date.month -= monthsInYear;
4446
+ $735220c2d4774dd3$var$addYears(date, 1);
4447
+ }
4448
+ }
4449
+ function $735220c2d4774dd3$var$balanceDay(date) {
4450
+ while(date.day < 1){
4451
+ date.month--;
4452
+ $735220c2d4774dd3$var$balanceYearMonth(date);
4453
+ date.day += date.calendar.getDaysInMonth(date);
4454
+ }
4455
+ while(date.day > date.calendar.getDaysInMonth(date)){
4456
+ date.day -= date.calendar.getDaysInMonth(date);
4457
+ date.month++;
4458
+ $735220c2d4774dd3$var$balanceYearMonth(date);
4459
+ }
4460
+ }
4461
+ function $735220c2d4774dd3$var$constrainMonthDay(date) {
4462
+ date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
4463
+ date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
4464
+ }
4465
+ function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
4466
+ if (date.calendar.constrainDate) date.calendar.constrainDate(date);
4467
+ date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
4468
+ $735220c2d4774dd3$var$constrainMonthDay(date);
4469
+ }
4090
4470
  function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
4091
4471
  let inverseDuration = {};
4092
4472
  for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
4093
4473
  return inverseDuration;
4094
4474
  }
4475
+ function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
4476
+ return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
4477
+ }
4478
+ function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
4479
+ let mutableDate = date.copy();
4480
+ if (fields.era != null) mutableDate.era = fields.era;
4481
+ if (fields.year != null) mutableDate.year = fields.year;
4482
+ if (fields.month != null) mutableDate.month = fields.month;
4483
+ if (fields.day != null) mutableDate.day = fields.day;
4484
+ $735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
4485
+ return mutableDate;
4486
+ }
4095
4487
  function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
4096
4488
  let mutableValue = value.copy();
4097
4489
  if (fields.hour != null) mutableValue.hour = fields.hour;
@@ -4138,6 +4530,43 @@ function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
4138
4530
  function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
4139
4531
  return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
4140
4532
  }
4533
+ function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
4534
+ let mutable = value.copy();
4535
+ switch(field){
4536
+ case 'era':
4537
+ {
4538
+ let eras = value.calendar.getEras();
4539
+ let eraIndex = eras.indexOf(value.era);
4540
+ if (eraIndex < 0) throw new Error('Invalid era: ' + value.era);
4541
+ eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
4542
+ mutable.era = eras[eraIndex];
4543
+ // Constrain the year and other fields within the era, so the era doesn't change when we balance below.
4544
+ $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
4545
+ break;
4546
+ }
4547
+ case 'year':
4548
+ var _mutable_calendar_isInverseEra, _mutable_calendar;
4549
+ if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;
4550
+ // The year field should not cycle within the era as that can cause weird behavior affecting other fields.
4551
+ // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back
4552
+ // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.
4553
+ mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
4554
+ if (mutable.year === -Infinity) mutable.year = 1;
4555
+ if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
4556
+ break;
4557
+ case 'month':
4558
+ mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
4559
+ break;
4560
+ case 'day':
4561
+ mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
4562
+ break;
4563
+ default:
4564
+ throw new Error('Unsupported field ' + field);
4565
+ }
4566
+ if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
4567
+ $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
4568
+ return mutable;
4569
+ }
4141
4570
  function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
4142
4571
  let mutable = value.copy();
4143
4572
  switch(field){
@@ -4184,9 +4613,33 @@ function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false
4184
4613
  return value;
4185
4614
  }
4186
4615
 
4616
+ const $fae977aafc393c5c$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
4617
+ function $fae977aafc393c5c$export$6b862160d295c8e(value) {
4618
+ let m = value.match($fae977aafc393c5c$var$DATE_RE);
4619
+ if (!m) throw new Error('Invalid ISO 8601 date string: ' + value);
4620
+ let date = new ($35ea8db9cb2ccb90$export$99faa760c7908e4f)($fae977aafc393c5c$var$parseNumber(m[1], 0, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1);
4621
+ date.day = $fae977aafc393c5c$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
4622
+ return date;
4623
+ }
4624
+ function $fae977aafc393c5c$var$parseNumber(value, min, max) {
4625
+ let val = Number(value);
4626
+ if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
4627
+ return val;
4628
+ }
4187
4629
  function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
4188
4630
  return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
4189
4631
  }
4632
+ function $fae977aafc393c5c$export$60dfd74aa96791bd(date) {
4633
+ let gregorianDate = ($11d87f3f76e88657$export$b4a036af3fc0b032)(date, new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
4634
+ let year;
4635
+ if (gregorianDate.era === 'BC') year = gregorianDate.year === 1 ? '0000' : '-' + String(Math.abs(1 - gregorianDate.year)).padStart(6, '00');
4636
+ else year = String(gregorianDate.year).padStart(4, '0');
4637
+ return `${year}-${String(gregorianDate.month).padStart(2, '0')}-${String(gregorianDate.day).padStart(2, '0')}`;
4638
+ }
4639
+ function $fae977aafc393c5c$export$4223de14708adc63(date) {
4640
+ // @ts-ignore
4641
+ return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date)}`;
4642
+ }
4190
4643
 
4191
4644
  function _check_private_redeclaration(obj, privateCollection) {
4192
4645
  if (privateCollection.has(obj)) {
@@ -4199,6 +4652,89 @@ function _class_private_field_init(obj, privateMap, value) {
4199
4652
  privateMap.set(obj, value);
4200
4653
  }
4201
4654
 
4655
+ /*
4656
+ * Copyright 2020 Adobe. All rights reserved.
4657
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4658
+ * you may not use this file except in compliance with the License. You may obtain a copy
4659
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
4660
+ *
4661
+ * Unless required by applicable law or agreed to in writing, software distributed under
4662
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
4663
+ * OF ANY KIND, either express or implied. See the License for the specific language
4664
+ * governing permissions and limitations under the License.
4665
+ */
4666
+
4667
+
4668
+
4669
+
4670
+
4671
+ function $35ea8db9cb2ccb90$var$shiftArgs(args) {
4672
+ let calendar = typeof args[0] === 'object' ? args.shift() : new ($3b62074eb05584b2$export$80ee6245ec4f29ec)();
4673
+ let era;
4674
+ if (typeof args[0] === 'string') era = args.shift();
4675
+ else {
4676
+ let eras = calendar.getEras();
4677
+ era = eras[eras.length - 1];
4678
+ }
4679
+ let year = args.shift();
4680
+ let month = args.shift();
4681
+ let day = args.shift();
4682
+ return [
4683
+ calendar,
4684
+ era,
4685
+ year,
4686
+ month,
4687
+ day
4688
+ ];
4689
+ }
4690
+ var // This prevents TypeScript from allowing other types with the same fields to match.
4691
+ // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
4692
+ // If that behavior is desired, use the AnyCalendarDate interface instead.
4693
+ // @ts-ignore
4694
+ $35ea8db9cb2ccb90$var$_type = /*#__PURE__*/ new WeakMap();
4695
+ class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
4696
+ /** Returns a copy of this date. */ copy() {
4697
+ if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
4698
+ else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
4699
+ }
4700
+ /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
4701
+ return ($735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
4702
+ }
4703
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
4704
+ return ($735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
4705
+ }
4706
+ /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
4707
+ return ($735220c2d4774dd3$export$adaa4cf7ef1b65be)(this, fields);
4708
+ }
4709
+ /**
4710
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
4711
+ * When the resulting value reaches the limits of the field, it wraps around.
4712
+ */ cycle(field, amount, options) {
4713
+ return ($735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
4714
+ }
4715
+ /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
4716
+ return ($11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone);
4717
+ }
4718
+ /** Converts the date to an ISO 8601 formatted string. */ toString() {
4719
+ return ($fae977aafc393c5c$export$60dfd74aa96791bd)(this);
4720
+ }
4721
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
4722
+ return ($14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
4723
+ }
4724
+ constructor(...args){
4725
+ (_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type, {
4726
+ writable: true,
4727
+ value: void 0
4728
+ });
4729
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
4730
+ this.calendar = calendar;
4731
+ this.era = era;
4732
+ this.year = year;
4733
+ this.month = month;
4734
+ this.day = day;
4735
+ ($735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
4736
+ }
4737
+ }
4202
4738
  var // This prevents TypeScript from allowing other types with the same fields to match.
4203
4739
  // @ts-ignore
4204
4740
  $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
@@ -4239,6 +4775,66 @@ class $35ea8db9cb2ccb90$export$680ea196effce5f {
4239
4775
  ($735220c2d4774dd3$export$7555de1e070510cb)(this);
4240
4776
  }
4241
4777
  }
4778
+ var // This prevents TypeScript from allowing other types with the same fields to match.
4779
+ // @ts-ignore
4780
+ $35ea8db9cb2ccb90$var$_type2 = /*#__PURE__*/ new WeakMap();
4781
+ class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
4782
+ /** Returns a copy of this date. */ copy() {
4783
+ if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
4784
+ else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
4785
+ }
4786
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
4787
+ return ($735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
4788
+ }
4789
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
4790
+ return ($735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
4791
+ }
4792
+ /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
4793
+ return ($735220c2d4774dd3$export$adaa4cf7ef1b65be)(($735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields), fields);
4794
+ }
4795
+ /**
4796
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
4797
+ * When the resulting value reaches the limits of the field, it wraps around.
4798
+ */ cycle(field, amount, options) {
4799
+ switch(field){
4800
+ case 'era':
4801
+ case 'year':
4802
+ case 'month':
4803
+ case 'day':
4804
+ return ($735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
4805
+ default:
4806
+ return ($735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
4807
+ }
4808
+ }
4809
+ /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
4810
+ return ($11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone, disambiguation);
4811
+ }
4812
+ /** Converts the date to an ISO 8601 formatted string. */ toString() {
4813
+ return ($fae977aafc393c5c$export$4223de14708adc63)(this);
4814
+ }
4815
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
4816
+ let res = ($14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
4817
+ if (res === 0) return ($14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, ($11d87f3f76e88657$export$b21e0b124e224484)(b));
4818
+ return res;
4819
+ }
4820
+ constructor(...args){
4821
+ (_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type2, {
4822
+ writable: true,
4823
+ value: void 0
4824
+ });
4825
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
4826
+ this.calendar = calendar;
4827
+ this.era = era;
4828
+ this.year = year;
4829
+ this.month = month;
4830
+ this.day = day;
4831
+ this.hour = args.shift() || 0;
4832
+ this.minute = args.shift() || 0;
4833
+ this.second = args.shift() || 0;
4834
+ this.millisecond = args.shift() || 0;
4835
+ ($735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
4836
+ }
4837
+ }
4242
4838
 
4243
4839
  var Switch = function (_a) {
4244
4840
  var id = _a.id, props = __rest(_a, ["id"]);
@@ -6549,7 +7145,35 @@ var DateFilter = function (_a) {
6549
7145
  }
6550
7146
  return HolidayType.SingleDay;
6551
7147
  };
6552
- return (jsx(DateSelector, { initialType: getInitialType(), initialDate: undefined, initialDateRange: undefined, onChange: handleDateSelectorChange, className: "w-full" }));
7148
+ var getInitialDate = function () {
7149
+ if ((value === null || value === void 0 ? void 0 : value.type) === "singleDay" && value.date) {
7150
+ try {
7151
+ return $fae977aafc393c5c$export$6b862160d295c8e(value.date);
7152
+ }
7153
+ catch (_a) {
7154
+ return undefined;
7155
+ }
7156
+ }
7157
+ return undefined;
7158
+ };
7159
+ var getInitialDateRange = function () {
7160
+ var _a, _b;
7161
+ if ((value === null || value === void 0 ? void 0 : value.type) === "dateRange" &&
7162
+ ((_a = value.dateRange) === null || _a === void 0 ? void 0 : _a.start) &&
7163
+ ((_b = value.dateRange) === null || _b === void 0 ? void 0 : _b.end)) {
7164
+ try {
7165
+ return {
7166
+ start: $fae977aafc393c5c$export$6b862160d295c8e(value.dateRange.start),
7167
+ end: $fae977aafc393c5c$export$6b862160d295c8e(value.dateRange.end),
7168
+ };
7169
+ }
7170
+ catch (_c) {
7171
+ return undefined;
7172
+ }
7173
+ }
7174
+ return undefined;
7175
+ };
7176
+ return (jsx(DateSelector, { initialType: getInitialType(), initialDate: getInitialDate(), initialDateRange: getInitialDateRange(), onChange: handleDateSelectorChange, className: "w-full" }));
6553
7177
  };
6554
7178
  // =========================================================================
6555
7179
  // TEXT FILTER